PageSourceSearch

https://rapidai-rapidocr.hf.space/static/js/7898.adfec040.chunk.js

js rapidai-rapidocr.hf.space collected 2026-10-03 10:23:31 UTC 2,279,203 bytes, 2 lines download raw bytes

1/*! For license information please see 7898.adfec040.chunk.js.LICENSE.txt */
2(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[7898],{12879:function(t,e,n){"use strict";n.r(e),n.d(e,{AGGREGATION_OPERATION:function(){return S},CPUGridLayer:function(){return oe},ContourLayer:function(){return gn},GPUGridLayer:function(){return kn},GridLayer:function(){return Sn},HeatmapLayer:function(){return Un},HexagonLayer:function(){return pe},ScreenGridLayer:function(){return Kt},_AggregationLayer:function(){return gt},_BinSorter:function(){return Ot},_CPUAggregator:function(){return ne},_GPUGridAggregator:function(){return et}});var r=n(64649),i=n(22951),o=n(91976),a=n(47169),s=n(83138),u=n(27597),l=n(67591),c=n(94337),h=n(50189),f=n(21970),p=n(70353),d=n(28007),A=n(12308),v=n(56474),g=n(94557),m=n(17225);function y(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=Math.fround(t),i=t-r;return e[n]=r,e[n+1]=i,e}function _(t){return t-Math.fround(t)}function b(t){for(var e=new Float32Array(32),n=0;n<4;++n)for(var r=0;r<4;++r){var i=4*n+r;y(t[4*r+n],e,2*i)}return e}var x={ONE:1};var w,C,B={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);
2\n#else\n  return sum_fp64(vec2(yn, 0.0), prod);\n#endif\n}\n",fs:null,getUniforms:function(){return x},fp64ify:y,fp64LowPart:_,fp64ifyMatrix4:b},k=n(46802),E=n(2123),S={SUM:1,MEAN:2,MIN:3,MAX:4};function T(t,e){return t+e}function M(t,e){return e>t?e:t}function I(t,e){return e<t?e:t}function P(t,e,n){var r=S[t]||S.SUM;switch(e=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Number.isFinite(t))return t;return function(n){return e.index=n.index,t(n.source,e)}}(e,n),r){case S.MIN:return function(t){return function(t,e){if(Number.isFinite(e))return t.length?e:null;var n=t.map(e).filter(Number.isFinite);return n.length?n.reduce(I,1/0):null}(t,e)};case S.SUM:return function(t){return function(t,e){if(Number.isFinite(e))return t.length?t.length*e:null;var n=t.map(e).filter(Number.isFinite);return n.length?n.reduce(T,0):null}(t,e)};case S.MEAN:return function(t){return function(t,e){if(Number.isFinite(e))return t.length?e:null;var n=t.map(e).filter(Number.isFinite);return n.length?n.reduce(T,0)/n.length:null}(t,e)};case S.MAX:return function(t){return function(t,e){if(Number.isFinite(e))return t.length?e:null;var n=t.map(e).filter(Number.isFinite);return n.length?n.reduce(M,-1/0):null}(t,e)};default:return null}}function Z(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){return e.indices=n.map((function(t){return t.index})),t(n.map((function(t){return t.source})),e)}}var D,L={projectPoints:!1,viewport:null,createBufferObjects:!0,moduleSettings:{}},O=3402823466e29,F=[32775,32774],R=[32776,32774],z=[32776,32775],U=(w={},(0,r.Z)(w,S.SUM,32774),(0,r.Z)(w,S.MEAN,32774),(0,r.Z)(w,S.MIN,F),(0,r.Z)(w,S.MAX,R),w),N={size:1,operation:S.SUM,needMin:!1,needMax:!1,combineMaxMin:!1},G=(C={},(0,r.Z)(C,10240,9728),(0,r.Z)(C,10241,9728),"#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"),j="#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",V="#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",H="#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",J="#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",W=n(58300),Q=n(79078),q=(D={},(0,r.Z)(D,10240,9728),(0,r.Z)(D,10241,9728),D);function K(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}
2,n=e.width,r=void 0===n?1:n,i=e.height,o=void 0===i?1:i,a=e.data,s=void 0===a?null:a,u=e.unpackFlipY,l=void 0===u||u,c=e.parameters,h=void 0===c?q:c;return new W.Z(t,{data:s,format:(0,d.D0)(t)?34836:6408,type:5126,border:0,mipmaps:!1,parameters:h,dataFormat:6408,width:r,height:o,unpackFlipY:l})}function X(t,e){var n=e.id,i=e.width,o=void 0===i?1:i,a=e.height,s=void 0===a?1:a,u=e.texture;return new Q.Z(t,{id:n,width:o,height:s,attachments:(0,r.Z)({},36064,u)})}var Y=["aggregationBuffer","maxMinBuffer","minBuffer","maxBuffer"],$={maxData:"maxBuffer",minData:"minBuffer",maxMinData:"maxMinBuffer"},tt=[p.h.WEBGL2,p.h.COLOR_ATTACHMENT_RGBA32F,p.h.BLEND_EQUATION_MINMAX,p.h.FLOAT_BLEND,p.h.TEXTURE_FLOAT],et=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,i.Z)(this,t),this.id=n.id||"gpu-grid-aggregator",this.gl=e,this.state={weightAttributes:{},textures:{},meanTextures:{},buffers:{},framebuffers:{},maxMinFramebuffers:{},minFramebuffers:{},maxFramebuffers:{},equations:{},resources:{},results:{}},this._hasGPUSupport=(0,d.D0)(e)&&(0,A.ag)(this.gl,p.h.BLEND_EQUATION_MINMAX,p.h.COLOR_ATTACHMENT_RGBA32F,p.h.TEXTURE_FLOAT),this._hasGPUSupport&&this._setupModels()}return(0,o.Z)(t,[{key:"delete",value:function(){var t=this.gridAggregationModel,e=this.allAggregationModel,n=this.meanTransform,r=this.state,i=r.textures,o=r.framebuffers,a=r.maxMinFramebuffers,s=r.minFramebuffers,u=r.maxFramebuffers,l=r.meanTextures,c=r.resources;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((function(t){for(var e in t)t[e].delete()}))}([o,i,a,s,u,l,c])}},{key:"run",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.setState({results:{}});var e=this._normalizeAggregationParams(t);return this._hasGPUSupport||f.Z.log(1,"GPUGridAggregator: not supported")(),this._runAggregation(e)}},{key:"getData",value:function(t){var e={},n=this.state.results;for(var r in n[t].aggregationData||(n[t].aggregationData=n[t].aggregationBuffer.getData()),e.aggregationData=n[t].aggregationData,$){var i=$[r];(n[t][r]||n[t][i])&&(n[t][r]=n[t][r]||n[t][i].getData(),e[r]=n[t][r])}return e}},{key:"updateShaders",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.setState({shaderOptions:t,modelDirty:!0})}},{key:"_normalizeAggregationParams",value:function(t){var e=(0,h.Z)((0,h.Z)({},L),t),n=e.weights;return n&&(e.weights=function(t){var e={};for(var n in t)e[n]=(0,h.Z)((0,h.Z)({},N),t[n]);return e}(n)),e}},{key:"setState",value:function(t){Object.assign(this.state,t)}},{key:"_getAggregateData",value:function(t){var e={},n=this.state,r=n.textures,i=n.framebuffers,o=n.maxMinFramebuffers,a=n.minFramebuffers,s=n.maxFramebuffers,u=n.resources,l=t.weights;for(var c in l){e[c]={};var h=l[c],f=h.needMin,p=h.needMax,d=h.combineMaxMin;e[c].aggregationTexture=r[c],e[c].aggregationBuffer=(0,v.Jb)(i[c],{target:l[c].aggregationBuffer,sourceType:5126}),f&&p&&d?(e[c].maxMinBuffer=(0,v.Jb)(o[c],{target:l[c].maxMinBuffer,sourceType:5126}),e[c].maxMinTexture=u["".concat(c,"-maxMinTexture")]):(f&&(e[c].minBuffer=(0,v.Jb)(a[c],{target:l[c].minBuffer,sourceType:5126}),e[c].minTexture=u["".concat(c,"-minTexture")]),p&&(e[c].maxBuffer=(0,v.Jb)(s[c],{target:l[c].maxBuffer,sourceType:5126}),e[c].maxTexture=u["".concat(c,"-maxTexture")]))}return this._trackGPUResultBuffers(e,l),e}},{key:"_renderAggregateData",value:function(t){var e=t.cellSize,n=t.projectPoints,r=t.attributes,i=t.moduleSettings,o=t.numCol,a=t.numRow,s=t.weights,u=t.translation,l=t.scaling,c=this.state,f=c.maxMinFramebuffers,p=c.minFramebuffers,d=c.maxFramebuffers,A=[o,a],v={blend:!0,depthTest:!1,blendFunc:[1,1]},g={cellSize:e,gridSize:A,projectPoints:n,translation:u,scaling:l};for(var m in s){var y=s[m],_=y.needMin,b=y.needMax,x=_&&b&&s[m].combineMaxMin;this._renderToWeightsTexture({id:m,parameters:v,moduleSettings:i,uniforms:g,gridSize:A,attributes:r,weights:s}),x?this._renderToMaxMinTexture({id:m,parameters:(0,h.Z)((0,h.Z)({},v),{},{blendEquation:z}),gridSize:A,minOrMaxFb:f[m],clearParams:{clearColor:[0,0,0,O]},combineMaxMin:x}):(_&&this._renderToMaxMinTexture({id:m,parameters:(0,h.Z)((0,h.Z)({},v),{},{blendEquation:F}),gridSize:A,minOrMaxFb:p[m],clearParams:{clearColor:[O,O,O,0]},combineMaxMin:x}),b&&this._renderToMaxMinTexture({id:m,parameters:(0,h.Z)((0,h.Z)({},v),{},{blendEquation:R}),gridSize:A,minOrMaxFb:d[m],clearParams:{clearColor:[0,0,0,0]},combineMaxMin:x}))}}}
2,{key:"_renderToMaxMinTexture",value:function(t){var e=t.id,n=t.parameters,r=t.gridSize,i=t.minOrMaxFb,o=t.combineMaxMin,a=t.clearParams,s=void 0===a?{}:a,u=this.state.framebuffers,l=this.gl,c=this.allAggregationModel;(0,d.s8)(l,(0,h.Z)((0,h.Z)({},s),{},{framebuffer:i,viewport:[0,0,r[0],r[1]]}),(function(){l.clear(16384),c.draw({parameters:n,uniforms:{uSampler:u[e].texture,gridSize:r,combineMaxMin:o}})}))}},{key:"_renderToWeightsTexture",value:function(t){var e=t.id,n=t.parameters,i=t.moduleSettings,o=t.uniforms,a=t.gridSize,s=t.weights,u=this.state,l=u.framebuffers,c=u.equations,f=u.weightAttributes,p=this.gl,A=this.gridAggregationModel,v=s[e].operation,g=v===S.MIN?[O,O,O,0]:[0,0,0,0];if((0,d.s8)(p,{framebuffer:l[e],viewport:[0,0,a[0],a[1]],clearColor:g},(function(){p.clear(16384);var t={weights:f[e]};A.draw({parameters:(0,h.Z)((0,h.Z)({},n),{},{blendEquation:c[e]}),moduleSettings:i,uniforms:o,attributes:t})})),v===S.MEAN){var y=this.state,_=y.meanTextures,b=y.textures,x={_sourceTextures:{aggregationValues:_[e]},_targetTexture:b[e],elementCount:b[e].width*b[e].height};this.meanTransform?this.meanTransform.update(x):this.meanTransform=function(t,e){return new m.Z(t,(0,h.Z)({vs:J,_targetTextureVarying:"meanValues"},e))}(p,x),this.meanTransform.run({parameters:{blend:!1,depthTest:!1}}),l[e].attach((0,r.Z)({},36064,b[e]))}}},{key:"_runAggregation",value:function(t){this._updateModels(t),this._setupFramebuffers(t),this._renderAggregateData(t);var e=this._getAggregateData(t);return this.setState({results:e}),e}},{key:"_setupFramebuffers",value:function(t){var e=this.state,n=e.textures,i=e.framebuffers,o=e.maxMinFramebuffers,a=e.minFramebuffers,s=e.maxFramebuffers,u=e.meanTextures,l=e.equations,c=t.weights,h=t.numCol,f=t.numRow,p={width:h,height:f};for(var d in c){var A=c[d],v=A.needMin,g=A.needMax,m=A.combineMaxMin,y=A.operation;n[d]=c[d].aggregationTexture||n[d]||K(this.gl,{id:"".concat(d,"-texture"),width:h,height:f}),n[d].resize(p);var _=n[d];y===S.MEAN&&(u[d]=u[d]||K(this.gl,{id:"".concat(d,"-mean-texture"),width:h,height:f}),u[d].resize(p),_=u[d]),i[d]?i[d].attach((0,r.Z)({},36064,_)):i[d]=X(this.gl,{id:"".concat(d,"-fb"),width:h,height:f,texture:_}),i[d].resize(p),l[d]=U[y]||U.SUM,(v||g)&&(v&&g&&m?o[d]||(_=c[d].maxMinTexture||this._getMinMaxTexture("".concat(d,"-maxMinTexture")),o[d]=X(this.gl,{id:"".concat(d,"-maxMinFb"),texture:_})):(v&&(a[d]||(_=c[d].minTexture||this._getMinMaxTexture("".concat(d,"-minTexture")),a[d]=X(this.gl,{id:"".concat(d,"-minFb"),texture:_}))),g&&(s[d]||(_=c[d].maxTexture||this._getMinMaxTexture("".concat(d,"-maxTexture")),s[d]=X(this.gl,{id:"".concat(d,"-maxFb"),texture:_})))))}}},{key:"_getMinMaxTexture",value:function(t){var e=this.state.resources;return e[t]||(e[t]=K(this.gl,{id:"resourceName"})),e[t]}},{key:"_setupModels",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.numCol,r=void 0===n?0:n,i=e.numRow,o=void 0===i?0:i,a=this.gl,s=this.state.shaderOptions;if(null===(t=this.gridAggregationModel)||void 0===t||t.delete(),this.gridAggregationModel=function(t,e){var n=(0,k.l)({vs:G,fs:j,modules:[B,E.Z]},e);return new g.Z(t,(0,h.Z)({id:"Gird-Aggregation-Model",vertexCount:1,drawMode:0},n))}(a,s),!this.allAggregationModel){var u=r*o;this.allAggregationModel=function(t,e){return new g.Z(t,{id:"All-Aggregation-Model",vs:V,fs:H,modules:[B],vertexCount:1,drawMode:0,isInstanced:!0,instanceCount:e,attributes:{position:[0,0]}})}(a,u)}}},{key:"_setupWeightAttributes",value:function(t){var e=this.state.weightAttributes,n=t.weights;for(var r in n)e[r]=t.attributes[r]}},{key:"_trackGPUResultBuffers",value:function(t,e){var n=this.state.resources;for(var r in t)if(t[r])for(var i=0,o=Y;i<o.length;i++){var a=o[i];if(t[r][a]&&e[r][a]!==t[r][a]){var s="gpu-result-".concat(r,"-").concat(a);n[s]&&n[s].delete(),n[s]=t[r][a]}}}},{key:"_updateModels",value:function(t){var e=t.vertexCount,n=t.attributes,r=t.numCol,i=t.numRow;this.state.modelDirty&&(this._setupModels(t),this.setState({modelDirty:!1})),this._setupWeightAttributes(t),this.gridAggregationModel.setVertexCount(e),this.gridAggregationModel.setAttributes(n),this.allAggregationModel.setInstanceCount(r*i)}}],[{key:"getAggregationData",value:function(t){var e=t.aggregationData,n=t.maxData,r=t.minData,i=t.maxMinData,o=4*t.pixelIndex,a={};return e&&(a.cellCount=e[o+3],a.cellWeight=e[o]),i?(a.maxCellWieght=i[0],a.minCellWeight=i[3]):(n&&(a.maxCellWieght=n[0],a.totalCount=n[3]),r&&(a.minCellWeight=r[0],a.totalCount=n[3])),a}},{key:"getCellData",value:function(t){for(var e=t.countsData,n=t.size,r=void 0===n?1:n,i=e.length/4,o=new Float32Array(i*r),a=new Uint32Array(i),s=0;s<i;s++){for(var u=0;u<r;u++)o[s*r+u]=e[4*s+u];a[s]=e[4*s+3]}return{cellCounts:a,cellWeights:o}}},{key:"isSupported",value:function(t){return(0,A.ag)(t,tt)}}]),t}();var nt=n(69296),rt=n(2578),it=n(90031),ot=[[255,255,178],[254,217,118],[254,178,76],[253,141,60],[240,59,32],[189,0,38]];function at(t){var e,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Float32Array;
2if(Number.isFinite(t[0]))e=new r(t);else{e=new r(4*t.length);for(var i=0,o=0;o<t.length;o++){var a=t[o];e[i++]=a[0],e[i++]=a[1],e[i++]=a[2],e[i++]=Number.isFinite(a[3])?a[3]:255}}if(n)for(var s=0;s<e.length;s++)e[s]/=255;return e}var st=[0,0,0,0],ut=[0,255,0,255],lt=["minColor","maxColor","colorRange","colorDomain"],ct={cellSizePixels:{value:100,min:1},cellMarginPixels:{value:2,min:0,max:5},colorDomain:null,colorRange:ot},ht=function(t){(0,l.Z)(n,t);var e=(0,c.Z)(n);function n(){var t;(0,i.Z)(this,n);for(var o=arguments.length,s=new Array(o),u=0;u<o;u++)s[u]=arguments[u];return t=e.call.apply(e,[this].concat(s)),(0,r.Z)((0,a.Z)(t),"state",void 0),t}return(0,o.Z)(n,[{key:"getShaders",value:function(){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\n  // Set color to be rendered to picking fbo (also used to check for selection highlight).\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:[rt.Z]}}},{key:"initializeState",value:function(){var t=this.context.gl;this.getAttributeManager().addInstanced({instancePositions:{size:3,update:this.calculateInstancePositions},instanceCounts:{size:4,noAlloc:!0}}),this.setState({model:this._getModel(t)})}},{key:"shouldUpdateState",value:function(t){return t.changeFlags.somethingChanged}},{key:"updateState",value:function(t){(0,s.Z)((0,u.Z)(n.prototype),"updateState",this).call(this,t);var e=t.oldProps,r=t.props,i=t.changeFlags,o=this.getAttributeManager();r.numInstances!==e.numInstances?o.invalidateAll():e.cellSizePixels!==r.cellSizePixels&&o.invalidate("instancePositions"),this._updateUniforms(e,r,i)}},{key:"draw",value:function(t){var e=t.uniforms,n=this.props,r=n.parameters,i=n.maxTexture,o=this.props.minColor||st,a=this.props.maxColor||ut,s=this.props.colorDomain||[1,0];this.state.model.setUniforms(e).setUniforms({minColor:o,maxColor:a,maxTexture:i,colorDomain:s}).draw({parameters:(0,h.Z)({depthTest:!1,depthMask:!1},r)})}},{key:"calculateInstancePositions",value:function(t,e){for(var n=e.numInstances,r=this.context.viewport,i=r.width,o=r.height,a=this.props.cellSizePixels,s=Math.ceil(i/a),u=t.value,l=t.size,c=0;c<n;c++){var h=c%s,f=Math.floor(c/s);u[c*l+0]=h*a/i*2-1,u[c*l+1]=1-f*a/o*2,u[c*l+2]=0}}},{key:"_getModel",value:function(t){return new g.Z(t,(0,h.Z)((0,h.Z)({}
2,this.getShaders()),{},{id:this.props.id,geometry:new nt.Z({drawMode:6,attributes:{positions:new Float32Array([0,0,0,1,0,0,1,1,0,0,1,0])}}),isInstanced:!0}))}},{key:"_shouldUseMinMax",value:function(){var t=this.props,e=t.minColor,n=t.maxColor,r=t.colorDomain,i=t.colorRange;return e||n?(f.Z.deprecated("ScreenGridLayer props: minColor and maxColor","colorRange, colorDomain")(),!0):!r&&!i}},{key:"_updateUniforms",value:function(t,e,n){var r=this.state.model;if(lt.some((function(n){return t[n]!==e[n]}))&&r.setUniforms({shouldUseMinMax:this._shouldUseMinMax()}),t.colorRange!==e.colorRange&&r.setUniforms({colorRange:at(e.colorRange)}),t.cellMarginPixels!==e.cellMarginPixels||t.cellSizePixels!==e.cellSizePixels||n.viewportChanged){var i=this.context.viewport,o=i.width,a=i.height,s=this.props,u=s.cellSizePixels,l=s.cellMarginPixels,c=u>l?l:0,h=new Float32Array([(u-c)/o*2,-(u-c)/a*2,1]);r.setUniforms({cellScale:h})}}}],[{key:"isSupported",value:function(t){return(0,A.ag)(t,[p.h.TEXTURE_FLOAT])}}]),n}(it.Z);(0,r.Z)(ht,"layerName","ScreenGridCellLayer"),(0,r.Z)(ht,"defaultProps",ct);var ft=n(60726),pt=n(49473),dt=n(96684),At=n(79366);function vt(t,e){var n={};for(var r in t)e.includes(r)||(n[r]=t[r]);return n}var gt=function(t){(0,l.Z)(n,t);var e=(0,c.Z)(n);function n(){var t;(0,i.Z)(this,n);for(var o=arguments.length,s=new Array(o),u=0;u<o;u++)s[u]=arguments[u];return t=e.call.apply(e,[this].concat(s)),(0,r.Z)((0,a.Z)(t),"state",void 0),t}return(0,o.Z)(n,[{key:"initializeAggregationLayer",value:function(t){(0,s.Z)((0,u.Z)(n.prototype),"initializeState",this).call(this,this.context),this.setState({ignoreProps:vt(this.constructor._propTypes,t.data.props),dimensions:t})}},{key:"updateState",value:function(t){if((0,s.Z)((0,u.Z)(n.prototype),"updateState",this).call(this,t),t.changeFlags.extensionsChanged){var e=this.getShaders({});e&&e.defines&&(e.defines.NON_INSTANCED_MODEL=1),this.updateShaders(e)}this._updateAttributes()}},{key:"updateAttributes",value:function(t){this.setState({changedAttributes:t})}},{key:"getAttributes",value:function(){return this.getAttributeManager().getShaderAttributes()}},{key:"getModuleSettings",value:function(){var t=this.context,e=t.viewport,n=t.mousePosition,r=t.gl;return Object.assign(Object.create(this.props),{viewport:e,mousePosition:n,pickingActive:0,devicePixelRatio:(0,d.w)(r)})}},{key:"updateShaders",value:function(t){}},{key:"isAggregationDirty",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.props,r=t.oldProps,i=t.changeFlags,o=e.compareAll,a=void 0!==o&&o,s=e.dimension,u=this.state.ignoreProps,l=s.props,c=s.accessors,h=void 0===c?[]:c,f=i.updateTriggersChanged;if(i.dataChanged)return!0;if(f){if(f.all)return!0;var p,d=(0,ft.Z)(h);try{for(d.s();!(p=d.n()).done;){if(f[p.value])return!0}}catch(m){d.e(m)}finally{d.f()}}if(a)return!!i.extensionsChanged||(0,pt.tg)({oldProps:r,newProps:n,ignoreProps:u,propTypes:this.constructor._propTypes});var A,v=(0,ft.Z)(l);try{for(v.s();!(A=v.n()).done;){var g=A.value;if(n[g]!==r[g])return!0}}catch(m){v.e(m)}finally{v.f()}return!1}},{key:"isAttributeChanged",value:function(t){var e=this.state.changedAttributes;return t?e&&void 0!==e[t]:!function(t){var e=!0;for(var n in t){e=!1;break}return e}(e)}},{key:"_getAttributeManager",value:function(){return new dt.Z(this.context.gl,{id:this.props.id,stats:this.context.stats})}}]),n}(At.Z);(0,r.Z)(gt,"layerName","AggregationLayer");var mt=n(33839),yt=n(11026);function _t(t,e,n){var r=n;return r.domain=function(){return t},r.range=function(){return e},r}function bt(t,e){return _t(t,e,(function(n){return function(t,e,n){var r=t[1]-t[0];if(r<=0)return f.Z.warn("quantizeScale: invalid domain, returning range[0]")(),e[0];var i=r/e.length,o=Math.floor((n-t[0])/i),a=Math.max(Math.min(o,e.length-1),0);return e[a]}(t,e,n)}))}function xt(t,e){return _t(t,e,(function(n){return function(t,e,n){return(n-t[0])/(t[1]-t[0])*(e[1]-e[0])+e[0]}(t,e,n)}))}function wt(t,e){for(var n=t.sort(Ct),r=0,i=Math.max(1,e.length),o=new Array(i-1);++r<i;)o[r-1]=Bt(n,r/i);var a=function(t){return function(t,e,n){return e[function(t,e){var n=0,r=t.length;for(;n<r;){var i=n+r>>>1;Ct(t[i],e)>0?r=i:n=i+1}return n}(t,n)]}(o,e,t)};return a.thresholds=function(){return o},_t(t,e,a)}function Ct(t,e){return t-e}function Bt(t,e){var n=t.length;if(e<=0||n<2)return t[0];if(e>=1)return t[n-1];var r=(n-1)*e,i=Math.floor(r),o=t[i];return o+(t[i+1]-o)*(r-i)}function kt(t,e){var n,r=new Map,i=[],o=(0,ft.Z)(t);try{for(o.s();!(n=o.n()).done;){var a=n.value,s="".concat(a);r.has(s)||r.set(s,i.push(a))}}catch(u){o.e(u)}finally{o.f()}return _t(t,e,(function(t){return function(t,e,n,r){var i="".concat(r),o=e.get(i);return void 0===o&&(o=t.push(r),e.set(i,o)),n[(o-1)%n.length]}(i,r,e,t)}))}function Et(t){return void 0!==t&&null!==t}function St(t,e){return("function"===typeof e?t.map(e):t).filter(Et)}function Tt(t,e){return St(t,e)}function Mt(t,e){return function(t){var e=[];return t.forEach((function(t){!e.includes(t)&&Et(t)&&e.push(t)})),e}(St(t,e))}var It=function(t){return t.length},Pt=function(t){return t.points},Zt=function(t){return t.index},Dt=function(t,e){return t<e?-1:t>e?1:t>=e?0:NaN},Lt={getValue:It,getPoints:Pt,getIndex:Zt,filterData:null},Ot=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Lt;(0,i.Z)(this,t),(0,r.Z)(this,"maxCount",void 0),(0,r.Z)(this,"maxValue",void 0),(0,r.Z)(this,"minValue",void 0),(0,r.Z)(this,"totalCount",void 0),(0,r.Z)(this,"aggregatedBins",void 0),(0,r.Z)(this,"sortedBins",void 0),(0,r.Z)(this,"binMap",void 0),this.aggregatedBins=this.getAggregatedBins(e,n),this._updateMinMaxValues(),this.binMap=this.getBinMap()}return(0,o.Z)(t,[{key:"getAggregatedBins",value:function(t,e){for(var n=e.getValue,r=void 0===n?It:n,i=e.getPoints,o=void 0===i?Pt:i,a=e.getIndex,s=void 0===a?Zt:a,u=e.filterData,l="function"===typeof u,c=t.length,h=[],f=0,p=0;p<c;p++){var d=t[p],A=o(d),v=s(d),g=l?A.filter(u):A;d.filteredPoints=l?g:null;var m=g.length?r(g):null;null!==m&&void 0!==m&&(h[f]={i:Number.isFinite(v)?v:p,value:m,counts:g.length},f++)}return h}},{key:"_percentileToIndex",value:function(t){var e=this.sortedBins.length;if(e<2)return[0,0];var n=t.map((function(t){return e=t,n=0,r=100,Math.max(n,Math.min(r,e));var e,n,r})),r=(0,yt.Z)(n,2),i=r[0],o=r[1];return[Math.ceil(i/100*(e-1)),Math.floor(o/100*(e-1))]}},{key:"getBinMap",value:function(){var t,e={},n=(0,ft.Z)(this.aggregatedBins);try{for(n.s();!(t=n.n()).done;){var r=t.value;e[r.i]=r}}catch(i){n.e(i)}finally{n.f()}return e}},{key:"_updateMinMaxValues",value:function(){var t,e=0,n=0,r=3402823466e29,i=0,o=(0,ft.Z)(this.aggregatedBins);try{for(o.s();!(t=o.n()).done;){var a=t.value;e=e>a.counts?e:a.counts,n=n>a.value?n:a.value,r=r<a.value?r:a.value,i+=a.counts}}catch(s){o.e(s)}finally{o.f()}this.maxCount=e,this.maxValue=n,this.minValue=r,this.totalCount=i}},{key:"getValueRange",value:function(t){if(this.sortedBins||(this.sortedBins=this.aggregatedBins.sort((function(t,e){return Dt(t.value,e.value)}))),!this.sortedBins.length)return[];var e=0,n=this.sortedBins.length-1;if(Array.isArray(t)){var r=this._percentileToIndex(t);e=r[0],n=r[1]}return[this.sortedBins[e].value,this.sortedBins[n].value]}},{key:"getValueDomainByScale",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=(0,yt.Z)(e,2),r=n[0],i=void 0===r?0:r,o=n[1],a=void 0===o?100:o;if(this.sortedBins||(this.sortedBins=this.aggregatedBins.sort((function(t,e){return Dt(t.value,e.value)}))),!this.sortedBins.length)return[];var s=this._percentileToIndex([i,a]);return this._getScaleDomain(t,s)}},{key:"_getScaleDomain",value:function(t,e){var n=(0,yt.Z)(e,2),r=n[0],i=n[1],o=this.sortedBins;switch(t){case"quantize":case"linear":default:return[o[r].value,o[i].value];case"quantile":return Tt(o.slice(r,i+1),(function(t){return t.value}));case"ordinal":return Mt(o,(function(t){return t.value}))}}}]),t}(),Ft=n(73115),Rt=n(18252),zt=6378e3;function Ut(t){return Number.isFinite(t)?t:0}function Nt(t,e){for(var n,r,i=t.positions.value,o=1/0,a=-1/0,s=1/0,u=-1/0,l=0;l<e;l++)r=i[3*l],o=(n=i[3*l+1])<o?n:o,a=n>a?n:a,s=r<s?r:s,u=r>u?r:u;return{xMin:Ut(s),xMax:Ut(u),yMin:Ut(o),yMax:Ut(a)}}function Gt(t,e){var n=t<0?-1:1,r=n<0?Math.abs(t)+e:Math.abs(t);return(r=Math.floor(r/e)*e)*n}function jt(t,e){return arguments.length>2&&void 0!==arguments[2]&&!arguments[2]?{xOffset:e,yOffset:e}:function(t,e){var n=(a=t,a/zt*(180/Math.PI)),r=(i=e,o=t,o/zt*(180/Math.PI)/Math.cos(i*Math.PI/180)
2);var i,o;var a;return{yOffset:n,xOffset:r}}(e,(t.yMin+t.yMax)/2)}function Vt(t,e,n,r){var i=jt(t,e,r!==Rt.Df.CARTESIAN),o=function(t,e,n,r){var i=r.width,o=r.height,a=n===Rt.Df.CARTESIAN?[-i/2,-o/2]:[-180,-90];f.Z.assert(n===Rt.Df.CARTESIAN||n===Rt.Df.LNGLAT||n===Rt.Df.DEFAULT);var s=t.xMin,u=t.yMin;return[-1*(Gt(s-a[0],e.xOffset)+a[0]),-1*(Gt(u-a[1],e.yOffset)+a[1])]}(t,i,r,n),a=t.xMin,s=t.yMin,u=t.xMax,l=t.yMax,c=u-a+i.xOffset,h=l-s+i.yOffset;return{gridOffset:i,translation:o,width:c,height:h,numCol:Math.ceil(c/i.xOffset),numRow:Math.ceil(h/i.yOffset)}}function Ht(t,e){var n=function(t,e){var n=t.data,r=void 0===n?[]:n,i=t.cellSize,o=e.attributes,a=e.viewport,s=e.projectPoints,u=e.numInstances,l=o.positions.value,c=o.positions.getAccessor().size,h=e.boundingBox||function(t,e){for(var n,r,i=t.value,o=t.getAccessor().size,a=1/0,s=-1/0,u=1/0,l=-1/0,c=0;c<e;c++)r=i[c*o],n=i[c*o+1],Number.isFinite(r)&&Number.isFinite(n)&&(a=n<a?n:a,s=n>s?n:s,u=r<u?r:u,l=r>l?r:l);return{xMin:u,xMax:l,yMin:a,yMax:s}}(o.positions,u),f=e.posOffset||[180,90],p=e.gridOffset||jt(h,i);if(p.xOffset<=0||p.yOffset<=0)return{gridHash:{},gridOffset:p};var d,A=a.width,v=a.height,g=Math.ceil(A/p.xOffset),m=Math.ceil(v/p.yOffset),y={},_=(0,Ft.jB)(r),b=_.iterable,x=_.objectInfo,w=new Array(3),C=(0,ft.Z)(b);try{for(C.s();!(d=C.n()).done;){var B=d.value;x.index++,w[0]=l[x.index*c],w[1]=l[x.index*c+1],w[2]=c>=3?l[x.index*c+2]:0;var k=s?a.project(w):w,E=(0,yt.Z)(k,2),S=E[0],T=E[1];if(Number.isFinite(S)&&Number.isFinite(T)){var M=Math.floor((T+f[1])/p.yOffset),I=Math.floor((S+f[0])/p.xOffset);if(!s||I>=0&&I<g&&M>=0&&M<m){var P="".concat(M,"-").concat(I);y[P]=y[P]||{count:0,points:[],lonIdx:I,latIdx:M},y[P].count+=1,y[P].points.push({source:B,index:x.index})}}}}catch(Z){C.e(Z)}finally{C.f()}return{gridHash:y,gridOffset:p,offsets:[-1*f[0],-1*f[1]]}}(t,e),r=function(t){var e=t.gridHash,n=t.gridOffset,r=t.offsets,i=new Array(Object.keys(e).length),o=0;for(var a in e){var s=a.split("-"),u=parseInt(s[0],10),l=parseInt(s[1],10),c=o++;i[c]=(0,h.Z)({index:c,position:[r[0]+n.xOffset*l,r[1]+n.yOffset*u]},e[a])}return i}(n);return{gridHash:n.gridHash,gridOffset:n.gridOffset,data:r}}var Jt=function(t){(0,l.Z)(n,t);var e=(0,c.Z)(n);function n(){var t;(0,i.Z)(this,n);for(var o=arguments.length,s=new Array(o),u=0;u<o;u++)s[u]=arguments[u];return t=e.call.apply(e,[this].concat(s)),(0,r.Z)((0,a.Z)(t),"state",void 0),t}return(0,o.Z)(n,[{key:"initializeAggregationLayer",value:function(t){var e=t.dimensions,r=this.context.gl;(0,s.Z)((0,u.Z)(n.prototype),"initializeAggregationLayer",this).call(this,e),this.setState({layerData:{},gpuGridAggregator:new et(r,{id:"".concat(this.id,"-gpu-aggregator")}),cpuGridAggregator:Ht})}},{key:"updateState",value:function(t){(0,s.Z)((0,u.Z)(n.prototype),"updateState",this).call(this,t),this.updateAggregationState(t);var e=this.state,r=e.aggregationDataDirty,i=e.aggregationWeightsDirty,o=e.gpuAggregation;if(!(this.getNumInstances()<=0)){var a=!1;(r||o&&i)&&(this._updateAggregation(t),a=!0),o||!r&&!i||(this._updateWeightBins(),this._uploadAggregationResults(),a=!0),this.setState({aggregationDirty:a})}}},{key:"finalizeState",value:function(t){var e,r=this.state.weights.count;r&&r.aggregationBuffer&&r.aggregationBuffer.delete(),null===(e=this.state.gpuGridAggregator)||void 0===e||e.delete(),(0,s.Z)((0,u.Z)(n.prototype),"finalizeState",this).call(this,t)}},{key:"updateShaders",value:function(t){this.state.gpuAggregation&&this.state.gpuGridAggregator.updateShaders(t)}},{key:"updateAggregationState",value:function(t){f.Z.assert(!1)}},{key:"allocateResources",value:function(t,e){if(this.state.numRow!==t||this.state.numCol!==e){var n=e*t*4*4,r=this.context.gl,i=this.state.weights;for(var o in i){var a=i[o];a.aggregationBuffer&&a.aggregationBuffer.delete(),a.aggregationBuffer=new mt.Z(r,{byteLength:n,accessor:{size:4,type:5126,divisor:1}})}}}},{key:"updateResults",value:function(t){var e=t.aggregationData,n=t.maxMinData,r=t.maxData,i=t.minData,o=this.state.weights.count;o&&(o.aggregationData=e,o.maxMinData=n,o.maxData=r,o.minData=i)}},{key:"_updateAggregation",value:function(t){var e=this.state,n=e.cpuGridAggregator,r=e.gpuGridAggregator,i=e.gridOffset,o=e.posOffset,a=e.translation,s=void 0===a?[0,0]:a,u=e.scaling,l=void 0===u?[0,0,0]:u,c=e.boundingBox,h=e.projectPoints,f=e.gpuAggregation,p=e.numCol,d=e.numRow,A=t.props,v=this.context.viewport,g=this.getAttributes(),m=this.getNumInstances();if(f){var y=this.state.weights;r.run({weights:y,cellSize:[i.xOffset,i.yOffset],numCol:p,numRow:d,translation:s,scaling:l,vertexCount:m,projectPoints:h,attributes:g,moduleSettings:this.getModuleSettings()})}else{var _=n(A,{gridOffset:i,projectPoints:h,attributes:g,viewport:v,posOffset:o,boundingBox:c});this.setState({layerData:_})}}},{key:"_updateWeightBins",value:function(){var t=this.state.getValue,e=new Ot(this.state.layerData.data||[],{getValue:t});this.setState({sortedBins:e})}},{key:"_uploadAggregationResults",value:function(){var t,e=this.state,n=e.numCol,r=e.numRow,i=this.state.layerData.data,o=this.state.sortedBins,a=o.aggregatedBins,s=o.minValue,u=o.maxValue,l=o.totalCount,c=new Float32Array(n*r*4).fill(0),h=(0,ft.Z)(a);try{for(h.s();!(t=h.n()).done;){var f=t.value,p=i[f.i],d=p.lonIdx,A=p.latIdx,v=f.value,g=f.counts,m=4*(d+A*n);c[m]=v,c[m+4-1]=g}}catch(x){h.e(x)}finally{h.f()}var y=new Float32Array([u,0,0,s]),_=new Float32Array([u,0,0,l]),b=new Float32Array([s,0,0,l]);this.updateResults({aggregationData:c,maxMinData:y,maxData:_,minData:b})}}]),n}(gt);(0,r.Z)(Jt,"layerName","GridAggregationLayer");var Wt=(0,h.Z)((0,h.Z)({},ht.defaultProps),{},{getPosition:{type:"accessor",value:function(t){return t.position}},getWeight:{type:"accessor",value:1},gpuAggregation:!0,aggregation:"SUM"}),Qt="positions",qt={data:{props:["cellSizePixels"]},weights:{props:["aggregation"],accessors:["getWeight"]}},Kt=function(t){(0,l.Z)(n,t);var e=(0,c.Z)(n);function n(){var t;(0,i.Z)(this,n);for(var o=arguments.length,s=new Array(o),u=0;u<o;u++)s[u]=arguments[u];return t=e.call.apply(e,[this].concat(s)),(0,r.Z)((0,a.Z)(t),"state",void 0),t}return(0,o.Z)(n,[{key:"initializeState",value:function(){var t,e=this.context.gl;
2if(!ht.isSupported(e))return this.setState({supported:!1}),void f.Z.error("ScreenGridLayer: ".concat(this.id," is not supported on this browser"))();(0,s.Z)((0,u.Z)(n.prototype),"initializeAggregationLayer",this).call(this,{dimensions:qt,getCellSize:function(t){return t.cellSizePixels}});var i={count:{size:1,operation:S.SUM,needMax:!0,maxTexture:K(e,{id:"".concat(this.id,"-max-texture")})}};this.setState({supported:!0,projectPoints:!0,weights:i,subLayerData:{attributes:{}},maxTexture:i.count.maxTexture,positionAttributeName:"positions",posOffset:[0,0],translation:[1,-1]}),this.getAttributeManager().add((t={},(0,r.Z)(t,Qt,{size:3,accessor:"getPosition",type:5130,fp64:this.use64bitPositions()}),(0,r.Z)(t,"count",{size:3,accessor:"getWeight"}),t))}},{key:"shouldUpdateState",value:function(t){var e=t.changeFlags;return this.state.supported&&e.somethingChanged}},{key:"updateState",value:function(t){(0,s.Z)((0,u.Z)(n.prototype),"updateState",this).call(this,t)}},{key:"renderLayers",value:function(){if(!this.state.supported)return[];var t=this.state,e=t.maxTexture,n=t.numRow,r=t.numCol,i=t.weights,o=this.props.updateTriggers,a=i.count.aggregationBuffer;return new(this.getSubLayerClass("cells",ht))(this.props,this.getSubLayerProps({id:"cell-layer",updateTriggers:o}),{data:{attributes:{instanceCounts:a}},maxTexture:e,numInstances:n*r})}},{key:"finalizeState",value:function(t){(0,s.Z)((0,u.Z)(n.prototype),"finalizeState",this).call(this,t);var e=this.state,r=e.aggregationBuffer,i=e.maxBuffer,o=e.maxTexture;null===r||void 0===r||r.delete(),null===i||void 0===i||i.delete(),null===o||void 0===o||o.delete()}},{key:"getPickingInfo",value:function(t){var e=t.info,n=e.index;if(n>=0){var r=this.state,i=r.gpuGridAggregator,o=r.gpuAggregation,a=r.weights,s=o?i.getData("count"):a.count;e.object=et.getAggregationData((0,h.Z)({pixelIndex:n},s))}return e}},{key:"updateResults",value:function(t){var e=t.aggregationData,n=t.maxData,r=this.state.weights.count;r.aggregationData=e,r.aggregationBuffer.setData({data:e}),r.maxData=n,r.maxTexture.setImageData({data:n})}},{key:"updateAggregationState",value:function(t){var e=t.props.cellSizePixels,n=t.oldProps.cellSizePixels!==e,r=t.changeFlags.viewportChanged,i=t.props.gpuAggregation;this.state.gpuAggregation!==t.props.gpuAggregation&&i&&!et.isSupported(this.context.gl)&&(f.Z.warn("GPU Grid Aggregation not supported, falling back to CPU")(),i=!1);var o=i!==this.state.gpuAggregation;this.setState({gpuAggregation:i});var a=this.isAttributeChanged(Qt),s=this.state.dimensions,u=s.data,l=s.weights,c=a||o||r||this.isAggregationDirty(t,{compareAll:i,dimension:u}),h=this.isAggregationDirty(t,{dimension:l});this.setState({aggregationDataDirty:c,aggregationWeightsDirty:h});var p=this.context.viewport;if(r||n){var d=p.width,A=p.height,v=Math.ceil(d/e),g=Math.ceil(A/e);this.allocateResources(g,v),this.setState({scaling:[d/2,-A/2,1],gridOffset:{xOffset:e,yOffset:e},width:d,height:A,numCol:v,numRow:g})}h&&this._updateAccessors(t),(c||h)&&this._resetResults()}},{key:"_updateAccessors",value:function(t){var e=t.props,n=e.getWeight,r=e.aggregation,i=e.data,o=this.state.weights.count;o&&(o.getWeight=n,o.operation=S[r]),this.setState({getValue:P(r,n,{data:i})})}},{key:"_resetResults",value:function(){var t=this.state.weights.count;t&&(t.aggregationData=null)}}]),n}(Jt);(0,r.Z)(Kt,"layerName","ScreenGridLayer"),(0,r.Z)(Kt,"defaultProps",Wt);var Xt=n(90555);function Yt(){}var $t=["getBins","getDomain","getScaleFunc"],te=[{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}],ee=function(t){return t.cellSize},ne=function(){function t(e){(0,i.Z)(this,t),this.state={layerData:{},dimensions:{}},this.changeFlags={},this.dimensionUpdaters={},this._getCellSize=e.getCellSize||ee,this._getAggregator=e.getAggregator,this._addDimension(e.dimensions||te)}return(0,o.Z)(t,[{key:"updateState",value:function(t,e){var n=t.oldProps,r=t.props,i=t.changeFlags;this.updateGetValueFuncs(n,r,i);var o=this.needsReProjectPoints(n,r,i),a=!1;i.dataChanged||o?(this.getAggregatedData(r,e),a=!0):((this.getDimensionChanges(n,r,i)||[]).forEac
2h((function(t){return"function"===typeof t&&t()})),a=!0);return this.setState({aggregationDirty:a}),this.state}},{key:"setState",value:function(t){this.state=(0,h.Z)((0,h.Z)({},this.state),t)}},{key:"setDimensionState",value:function(t,e){this.setState({dimensions:(0,h.Z)((0,h.Z)({},this.state.dimensions),{},(0,r.Z)({},t,(0,h.Z)((0,h.Z)({},this.state.dimensions[t]),e)))})}},{key:"normalizeResult",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.hexagons?(0,h.Z)({data:t.hexagons},t):t.layerData?(0,h.Z)({data:t.layerData},t):t}},{key:"getAggregatedData",value:function(t,e){var n=this._getAggregator(t)(t,e);this.setState({layerData:this.normalizeResult(n)}),this.changeFlags={layerData:!0},this.getSortedBins(t)}},{key:"updateGetValueFuncs",value:function(t,e,n){for(var r in this.dimensionUpdaters){var i=this.dimensionUpdaters[r].getBins.triggers,o=i.value,a=i.weight,s=i.aggregation,u=e[o.prop];this.needUpdateDimensionStep(this.dimensionUpdaters[r].getBins,t,e,n)&&(u=u?Z(u,{data:e.data}):P(e[s.prop],e[a.prop],{data:e.data})),u&&this.setDimensionState(r,{getValue:u})}}},{key:"needsReProjectPoints",value:function(t,e,n){return this._getCellSize(t)!==this._getCellSize(e)||this._getAggregator(t)!==this._getAggregator(e)||n.updateTriggersChanged&&(n.updateTriggersChanged.all||n.updateTriggersChanged.getPosition)}},{key:"addDimension",value:function(t){this._addDimension(t)}},{key:"_addDimension",value:function(){var t=this;(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((function(e){var n=e.key;t.dimensionUpdaters[n]=t.getDimensionUpdaters(e),t.state.dimensions[n]={getValue:null,domain:null,sortedBins:null,scaleFunc:Yt}}))}},{key:"getDimensionUpdaters",value:function(t){var e=t.key,n=t.accessor,r=t.pickingInfo,i=t.getBins,o=t.getDomain,a=t.getScaleFunc,s=t.nullValue;return{key:e,accessor:n,pickingInfo:r,getBins:(0,h.Z)({updater:this.getDimensionSortedBins},i),getDomain:(0,h.Z)({updater:this.getDimensionValueDomain},o),getScaleFunc:(0,h.Z)({updater:this.getDimensionScale},a),attributeAccessor:this.getSubLayerDimensionAttribute(e,s)}}},{key:"needUpdateDimensionStep",value:function(t,e,n,r){return Object.values(t.triggers).some((function(t){return t.updateTrigger?r.dataChanged||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged[t.updateTrigger]):e[t.prop]!==n[t.prop]}))}},{key:"getDimensionChanges",value:function(t,e,n){var r=this,i=[],o=function(o){var a=$t.find((function(i){return r.needUpdateDimensionStep(r.dimensionUpdaters[o][i],t,e,n)}));a&&i.push(r.dimensionUpdaters[o][a].updater.bind(r,e,r.dimensionUpdaters[o]))};for(var a in this.dimensionUpdaters)o(a);return i.length?i:null}},{key:"getUpdateTriggers",value:function(t){var e=this,n=t.updateTriggers||{},r={},i=function(i){var o=e.dimensionUpdaters[i].accessor;r[o]={},$t.forEach((function(a){Object.values(e.dimensionUpdaters[i][a].triggers).forEach((function(e){var i=e.prop,a=e.updateTrigger;if(a){var s=n[a];"object"!==typeof s||Array.isArray(s)?void 0!==s&&(r[o][i]=s):Object.assign(r[o],s)}else r[o][i]=t[i]}))}))};for(var o in this.dimensionUpdaters)i(o);return r}},{key:"getSortedBins",value:function(t){for(var e in this.dimensionUpdaters)this.getDimensionSortedBins(t,this.dimensionUpdaters[e])}},{key:"getDimensionSortedBins",value:function(t,e){var n=e.key,r=this.state.dimensions[n].getValue,i=new Ot(this.state.layerData.data||[],{getValue:r,filterData:t._filterData});this.setDimensionState(n,{sortedBins:i}),this.getDimensionValueDomain(t,e)}},{key:"getDimensionValueDomain",value:function(t,e){var n=e.getDomain,r=e.key,i=n.triggers,o=i.lowerPercentile,a=i.upperPercentile,s=i.scaleType,u=this.state.dimensions[r].sortedBins.getValueDomainByScale(t[s.prop],[t[o.prop],t[a.prop]]);this.setDimensionState(r,{valueDomain:u}),this.getDimensionScale(t,e)}},{key:"getDimensionScale",value:function(t,e){var n=e.key,r=e.getScaleFunc,i=e.getDomain,o=r.triggers,a=o.domain,s=o.range,u=i.triggers.scaleType,l=r.onSet,c=t[s.prop],h=t[a.prop]||this.state.dimensions[n].valueDomain,f=function(t){switch(t){case"quantize":default:return bt;case"linear":return xt;case"quantile":return wt;case"ordinal":return kt}}(u&&t[u.prop]),p=f(h,c);"object"===typeof l&&"function"===typeof t[l.props]&&t[l.props](p.domain()),this.setDimensionState(n,{scaleFunc:p})}},{key:"getSubLayerDimensionAttribute",value:function(t,e){var n=this;return function(r){var i=n.state.dimensions[t],o=i.sortedBins,a=i.scaleFunc,s=o.binMap[r.index];if(s&&0===s.counts)return e;var u=s&&s.value,l=a.domain();return u>=l[0]&&u<=l[l.length-1]?a(u):e}}},{key:"getSubLayerAccessors",value:function(t){var e={};for(var n in this.dimensionUpdaters){e[this.dimensionUpdaters[n].accessor]=this.getSubLayerDimensionAttribute(t,n)}return e}},{key:"getPickingInfo",value:function(t){var e=t.info,n=null;if(e.picked&&e.index>-1){var r=this.state.layerData.data[e.index],i={};for(var o in this.dimensionUpdaters){var a=this.dimensionUpdaters[o].pickingInfo,s=this.state.dimensions[o].sortedBins,u=s.binMap[r.index]&&s.binMap[r.index].value;i[a]=u}n=Object.assign(i,r,{points:r.filteredPoints||r.points})}return e.picked=Boolean(n),e.object=n,e}},{key:"getAccessor",value:function(t){return this.dimensionUpdaters.hasOwnProperty(t)?this.dimensionUpdaters[t].attributeAcce
2ssor:Yt}}],[{key:"defaultDimensions",value:function(){return te}}]),t}();function re(){}var ie={colorDomain:null,colorRange:ot,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:re,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:re,gridAggregator:Ht,cellSize:{type:"number",min:0,max:1e3,value:1e3},coverage:{type:"number",min:0,max:1,value:1},getPosition:{type:"accessor",value:function(t){return t.position}},extruded:!1,material:!0,_filterData:{type:"function",value:null,optional:!0}},oe=function(t){(0,l.Z)(n,t);var e=(0,c.Z)(n);function n(){return(0,i.Z)(this,n),e.apply(this,arguments)}return(0,o.Z)(n,[{key:"initializeState",value:function(){var t=new ne({getAggregator:function(t){return t.gridAggregator},getCellSize:function(t){return t.cellSize}});this.state={cpuAggregator:t,aggregatorState:t.state},this.getAttributeManager().add({positions:{size:3,type:5130,accessor:"getPosition"}})}},{key:"updateState",value:function(t){(0,s.Z)((0,u.Z)(n.prototype),"updateState",this).call(this,t),this.setState({aggregatorState:this.state.cpuAggregator.updateState(t,{viewport:this.context.viewport,attributes:this.getAttributes(),numInstances:this.getNumInstances()})})}},{key:"getPickingInfo",value:function(t){var e=t.info;return this.state.cpuAggregator.getPickingInfo({info:e})}},{key:"_onGetSublayerColor",value:function(t){return this.state.cpuAggregator.getAccessor("fillColor")(t)}},{key:"_onGetSublayerElevation",value:function(t){return this.state.cpuAggregator.getAccessor("elevation")(t)}},{key:"_getSublayerUpdateTriggers",value:function(){return this.state.cpuAggregator.getUpdateTriggers(this.props)}},{key:"renderLayers",value:function(){var t=this.props,e=t.elevationScale,n=t.extruded,r=t.cellSize,i=t.coverage,o=t.material,a=t.transitions,s=this.state.cpuAggregator,u=this.getSubLayerClass("grid-cell",Xt.Z),l=this._getSublayerUpdateTriggers();return new u({cellSize:r,coverage:i,material:o,elevationScale:e,extruded:n,getFillColor:this._onGetSublayerColor.bind(this),getElevation:this._onGetSublayerElevation.bind(this),transitions:a&&{getFillColor:a.getColorValue||a.getColorWeight,getElevation:a.getElevationValue||a.getElevationWeight}},this.getSubLayerProps({id:"grid-cell",updateTriggers:l}),{data:s.state.layerData.data})}}]),n}(gt);(0,r.Z)(oe,"layerName","CPUGridLayer"),(0,r.Z)(oe,"defaultProps",ie);var ae=n(35387),se=Math.PI/3,ue=[0,se,2*se,3*se,4*se,5*se];function le(t){return t[0]}function ce(t){return t[1]}function he(){}var fe={colorDomain:null,colorRange:ot,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:he,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:he,radius:{type:"number",value:1e3,min:1},coverage:{type:"number",min:0,max:1,value:1},extruded:!1,hexagonAggregator:function(t,e){var n,r=t.data,i=t.radius,o=e.viewport,a=e.attributes,s=r.length?function(t,e){var n,r=e.attributes,i=r.positions.value,o=r.positions.getAccessor(),a=o.size,s=1/0,u=1/0,l=-1/0,c=-1/0;for(n=0;n<a*t.length;n+=a){var h=i[n],f=i[n+1];Number.isFinite(h)&&Number.isFinite(f)&&(s=Math.min(h,s),l=Math.max(h,l),u=Math.min(f,u),c=Math.max(f,c))}return[s,u,l,c].every(Number.isFinite)?[(s+l)/2,(u+c)/2]:null}(r,e):null,u=function(t,e,n){var r=e.getDistanceScales(n),i=r.unitsPerMeter;return t*i[0]}(i,o,s),l=[],c=(0,Ft.jB)(r),h=c.iterable,p=c.objectInfo,d=a.positions.value,A=a.positions.getAccessor().size,v=(0,ft.Z)(h);try{for(v.s();!(n=v.n()).done;){var g=n.value;p.index++;var m=p.index*A,y=[d[m],d[m+1]];Number.isFinite(y[0])&&Number.isFinite(y[1])?l.push({screenCoord:o.projectFlat(y),source:g,index:
2p.index}):f.Z.warn("HexagonLayer: invalid position")()}}catch(b){v.e(b)}finally{v.f()}var _=function(){var t,e,n,r=0,i=0,o=1,a=1,s=le,u=ce;function l(t){var r,i={},o=[],a=t.length;for(r=0;r<a;++r)if(!isNaN(c=+s.call(null,l=t[r],r,t))&&!isNaN(h=+u.call(null,l,r,t))){var l,c,h,f=Math.round(h/=n),p=Math.round(c=c/e-(1&f)/2),d=h-f;if(3*Math.abs(d)>1){var A=c-p,v=p+(c<p?-1:1)/2,g=f+(h<f?-1:1),m=c-v,y=h-g;A*A+d*d>m*m+y*y&&(p=v+(1&f?1:-1)/2,f=g)}var _=p+"-"+f,b=i[_];b?b.push(l):(o.push(b=i[_]=[l]),b.x=(p+(1&f)/2)*e,b.y=f*n)}return o}function c(t){var e=0,n=0;return ue.map((function(r){var i=Math.sin(r)*t,o=-Math.cos(r)*t,a=i-e,s=o-n;return e=i,n=o,[a,s]}))}return l.hexagon=function(e){return"m"+c(null==e?t:+e).join("l")+"z"},l.centers=function(){for(var s=[],u=Math.round(i/n),l=Math.round(r/e),c=u*n;c<a+t;c+=n,++u)for(var h=l*e+(1&u)*e/2;h<o+e/2;h+=e)s.push([h,c]);return s},l.mesh=function(){var e=c(t).slice(0,4).join("l");return l.centers().map((function(t){return"M"+t+"m"+e})).join("")},l.x=function(t){return arguments.length?(s=t,l):s},l.y=function(t){return arguments.length?(u=t,l):u},l.radius=function(r){return arguments.length?(e=2*(t=+r)*Math.sin(se),n=1.5*t,l):t},l.size=function(t){return arguments.length?(r=i=0,o=+t[0],a=+t[1],l):[o-r,a-i]},l.extent=function(t){return arguments.length?(r=+t[0][0],i=+t[0][1],o=+t[1][0],a=+t[1][1],l):[[r,i],[o,a]]},l.radius(1)}().radius(u).x((function(t){return t.screenCoord[0]})).y((function(t){return t.screenCoord[1]}));return{hexagons:_(l).map((function(t,e){return{position:o.unprojectFlat([t.x,t.y]),points:t,index:e}})),radiusCommon:u}},getPosition:{type:"accessor",value:function(t){return t.position}},material:!0,_filterData:{type:"function",value:null,optional:!0}},pe=function(t){(0,l.Z)(n,t);var e=(0,c.Z)(n);function n(){var t;(0,i.Z)(this,n);for(var o=arguments.length,s=new Array(o),u=0;u<o;u++)s[u]=arguments[u];return t=e.call.apply(e,[this].concat(s)),(0,r.Z)((0,a.Z)(t),"state",void 0),t}return(0,o.Z)(n,[{key:"initializeState",value:function(){var t=new ne({getAggregator:function(t){return t.hexagonAggregator},getCellSize:function(t){return t.radius}});this.state={cpuAggregator:t,aggregatorState:t.state,vertices:null},this.getAttributeManager().add({positions:{size:3,type:5130,accessor:"getPosition"}})}},{key:"updateState",value:function(t){if((0,s.Z)((0,u.Z)(n.prototype),"updateState",this).call(this,t),t.changeFlags.propsOrDataChanged){var e=this.state.cpuAggregator.updateState(t,{viewport:this.context.viewport,attributes:this.getAttributes()});if(this.state.aggregatorState.layerData!==e.layerData){var r=(e.layerData||{}).hexagonVertices;this.setState({vertices:r&&this.convertLatLngToMeterOffset(r)})}this.setState({aggregatorState:e})}}},{key:"convertLatLngToMeterOffset",value:function(t){var e=this.context.viewport;if(Array.isArray(t)&&6===t.length){var n=t[0],r=t[3],i=[(n[0]+r[0])/2,(n[1]+r[1])/2],o=e.projectFlat(i),a=e.getDistanceScales(i).metersPerUnit;return t.map((function(t){var n=e.projectFlat(t);return[(n[0]-o[0])*a[0],(n[1]-o[1])*a[1]]}))}return f.Z.error("HexagonLayer: hexagonVertices needs to be an array of 6 points")(),null}},{key:"getPickingInfo",value:function(t){var e=t.info;return this.state.cpuAggregator.getPickingInfo({info:e})}},{key:"_onGetSublayerColor",value:function(t){return this.state.cpuAggregator.getAccessor("fillColor")(t)}},{key:"_onGetSublayerElevation",value:function(t){return this.state.cpuAggregator.getAccessor("elevation")(t)}},{key:"_getSublayerUpdateTriggers",value:function(){return this.state.cpuAggregator.getUpdateTriggers(this.props)}},{key:"renderLayers",value:function(){var t=this.props,e=t.elevationScale,n=t.extruded,r=t.coverage,i=t.material,o=t.transitions,a=this.state,s=a.aggregatorState,u=a.vertices,l=this.getSubLayerClass("hexagon-cell",ae.Z),c=this._getSublayerUpdateTriggers(),f=u?{vertices:u,radius:1}:{radius:s.layerData.radiusCommon||1,radiusUnits:"common",angle:90};return new l((0,h.Z)((0,h.Z)({},f),{},{diskResolution:6,elevationScale:e,extruded:n,coverage:r,material:i,getFillColor:this._onGetSublayerColor.bind(this),getElevation:this._onGetSublayerElevation.bind(this),transitions:o&&{getFillColor:o.getColorValue||o.getColorWeight,getElevation:o.getElevationValue||o.getElevationWeight}}
2),this.getSubLayerProps({id:"hexagon-cell",updateTriggers:c}),{data:s.layerData.data})}}]),n}(gt);(0,r.Z)(pe,"layerName","HexagonLayer"),(0,r.Z)(pe,"defaultProps",fe);var de,Ae=n(24985),ve=n(3453),ge=.5,me=1/6,ye={N:[0,ge],E:[ge,0],S:[0,-.5],W:[-.5,0],NE:[ge,ge],NW:[-.5,ge],SE:[ge,-.5],SW:[-.5,-.5]},_e=[ye.W,ye.SW,ye.S],be=[ye.S,ye.SE,ye.E],xe=[ye.E,ye.NE,ye.N],we=[ye.NW,ye.W,ye.N],Ce=[[-.5,me],[-.5,-me],[-me,-.5],[me,-.5]],Be=[[-me,-.5],[me,-.5],[ge,-me],[ge,me]],ke=[[ge,-me],[ge,me],[me,ge],[-me,ge]],Ee=[[-.5,me],[-.5,-me],[me,ge],[-me,ge]],Se=[ye.W,ye.SW,ye.SE,ye.E],Te=[ye.S,ye.SE,ye.NE,ye.N],Me=[ye.NW,ye.W,ye.E,ye.NE],Ie=[ye.NW,ye.SW,ye.S,ye.N],Pe=[[-.5,me],[-.5,-me],[ge,-me],[ge,me]],Ze=[[-me,-.5],[me,-.5],[me,ge],[-me,ge]],De=[ye.NW,ye.SW,ye.SE,ye.NE],Le=[ye.NW,ye.SW,ye.SE,ye.E,ye.N],Oe=[ye.W,ye.SW,ye.SE,ye.NE,ye.N],Fe=[ye.NW,ye.W,ye.S,ye.SE,ye.NE],Re=[ye.NW,ye.SW,ye.S,ye.E,ye.NE],ze=[ye.NW,ye.W,[ge,-me],[ge,me],ye.N],Ue=[[-me,-.5],[me,-.5],ye.E,ye.NE,ye.N],Ne=[[-.5,me],[-.5,-me],ye.S,ye.SE,ye.E],Ge=[ye.W,ye.SW,ye.S,[me,ge],[-me,ge]],je=[ye.NW,ye.W,[-me,-.5],[me,-.5],ye.N],Ve=[[-.5,me],[-.5,-me],ye.E,ye.NE,ye.N],He=[ye.S,ye.SE,ye.E,[me,ge],[-me,ge]],Je=[ye.W,ye.SW,ye.S,[ge,-me],[ge,me]],We=[ye.W,ye.SW,ye.SE,ye.E,[me,ge],[-me,ge]],Qe=[[-.5,me],[-.5,-me],ye.S,ye.SE,ye.NE,ye.N],qe=[ye.NW,ye.W,[-me,-.5],[me,-.5],ye.E,ye.NE],Ke=[ye.NW,ye.SW,ye.S,[ge,-me],[ge,me],ye.N],Xe=[ye.W,ye.SW,ye.S,ye.E,ye.NE,ye.N],Ye=[ye.NW,ye.W,ye.S,ye.SE,ye.E,ye.N],$e=[[-.5,me],[-.5,-me],[-me,-.5],[me,-.5],ye.E,ye.NE,ye.N],tn=[ye.W,ye.SW,ye.S,[ge,-me],[ge,me],[me,ge],[-me,ge]],en=[ye.NW,ye.W,[-me,-.5],[me,-.5],[ge,-me],[ge,me],ye.N],nn=[[-.5,me],[-.5,-me],ye.S,ye.SE,ye.E,[me,ge],[-me,ge]],rn=[[-.5,me],[-.5,-me],[-me,-.5],[me,-.5],[ge,-me],[ge,me],[me,ge],[-me,ge]],on={0:[],1:[[ye.W,ye.S]],2:[[ye.S,ye.E]],3:[[ye.W,ye.E]],4:[[ye.N,ye.E]],5:{0:[[ye.W,ye.S],[ye.N,ye.E]],1:[[ye.W,ye.N],[ye.S,ye.E]]},6:[[ye.N,ye.S]],7:[[ye.W,ye.N]],8:[[ye.W,ye.N]],9:[[ye.N,ye.S]],10:{0:[[ye.W,ye.N],[ye.S,ye.E]],1:[[ye.W,ye.S],[ye.N,ye.E]]},11:[[ye.N,ye.E]],12:[[ye.W,ye.E]],13:[[ye.S,ye.E]],14:[[ye.W,ye.S]],15:[]};function an(t){return parseInt(t,4)}var sn=(de={},(0,r.Z)(de,an("0000"),[]),(0,r.Z)(de,an("2222"),[]),(0,r.Z)(de,an("2221"),[_e]),(0,r.Z)(de,an("2212"),[be]),(0,r.Z)(de,an("2122"),[xe]),(0,r.Z)(de,an("1222"),[we]),(0,r.Z)(de,an("0001"),[_e]),(0,r.Z)(de,an("0010"),[be]),(0,r.Z)(de,an("0100"),[xe]),(0,r.Z)(de,an("1000"),[we]),(0,r.Z)(de,an("2220"),[Ce]),(0,r.Z)(de,an("2202"),[Be]),(0,r.Z)(de,an("2022"),[ke]),(0,r.Z)(de,an("0222"),[Ee]),(0,r.Z)(de,an("0002"),[Ce]),(0,r.Z)(de,an("0020"),[Be]),(0,r.Z)(de,an("0200"),[ke]),(0,r.Z)(de,an("2000"),[Ee]),(0,r.Z)(de,an("0011"),[Se]),(0,r.Z)(de,an("0110"),[Te]),(0,r.Z)(de,an("1100"),[Me]),(0,r.Z)(de,an("1001"),[Ie]),(0,r.Z)(de,an("2211"),[Se]),(0,r.Z)(de,an("2112"),[Te]),(0,r.Z)(de,an("1122"),[Me]),(0,r.Z)(de,an("1221"),[Ie]),(0,r.Z)(de,an("2200"),[Pe]),(0,r.Z)(de,an("2002"),[Ze]),(0,r.Z)(de,an("0022"),[Pe]),(0,r.Z)(de,an("0220"),[Ze]),(0,r.Z)(de,an("1111"),[De]),(0,r.Z)(de,an("1211"),[Le]),(0,r.Z)(de,an("2111"),[Oe]),(0,r.Z)(de,an("1112"),[Fe]),(0,r.Z)(de,an("1121"),[Re]),(0,r.Z)(de,an("1011"),[Le]),(0,r.Z)(de,an("0111"),[Oe]),(0,r.Z)(de,an("1110"),[Fe]),(0,r.Z)(de,an("1101"),[Re]),(0,r.Z)(de,an("1200"),[ze]),(0,r.Z)(de,an("0120"),[Ue]),(0,r.Z)(de,an("0012"),[Ne]),(0,r.Z)(de,an("2001"),[Ge]),(0,r.Z)(de,an("1022"),[ze]),(0,r.Z)(de,an("2102"),[Ue]),(0,r.Z)(de,an("2210"),[Ne]),(0,r.Z)(de,an("0221"),[Ge]),(0,r.Z)(de,an("1002"),[je]),(0,r.Z)(de,an("2100"),[Ve]),(0,r.Z)(de,an("0210"),[He]),(0,r.Z)(de,an("0021"),[Je]),(0,r.Z)(de,an("1220"),[je]),(0,r.Z)(de,an("0122"),[Ve]),(0,r.Z)(de,an("2012"),[He]),(0,r.Z)(de,an("2201"),[Je]),(0,r.Z)(de,an("0211"),[We]),(0,r.Z)(de,an("2110"),[Qe]),(0,r.Z)(de,an("1102"),[qe]),(0,r.Z)(de,an("1021"),[Ke]),(0,r.Z)(de,an("2011"),[We]),(0,r.Z)(de,an("0112"),[Qe]),(0,r.Z)(de,an("1120"),[qe]),(0,r.Z)(de,an("1201"),[Ke]),(0,r.Z)(de,an("2101"),[Xe]),(0,r.Z)(de,an("0121"),[Xe]),(0,r.Z)(de,an("1012"),[Ye]),(0,r.Z)(de,an("1210"),[Ye]),(0,r.Z)(de,an("0101"),{0:[_e,xe],1:[Xe],2:[Xe]}),(0,r.Z)(de,an("1010"),{0:[we,be],1:[Ye],2:[Ye]}),(0,r.Z)(de,an("2121"),{0:[Xe],1:[Xe],2:[_e,xe]}
2),(0,r.Z)(de,an("1212"),{0:[Ye],1:[Ye],2:[we,be]}),(0,r.Z)(de,an("2120"),{0:[$e],1:[$e],2:[Ce,xe]}),(0,r.Z)(de,an("2021"),{0:[tn],1:[tn],2:[_e,ke]}),(0,r.Z)(de,an("1202"),{0:[en],1:[en],2:[we,Be]}),(0,r.Z)(de,an("0212"),{0:[nn],1:[nn],2:[be,Ee]}),(0,r.Z)(de,an("0102"),{0:[Ce,xe],1:[$e],2:[$e]}),(0,r.Z)(de,an("0201"),{0:[_e,ke],1:[tn],2:[tn]}),(0,r.Z)(de,an("1020"),{0:[we,Be],1:[en],2:[en]}),(0,r.Z)(de,an("2010"),{0:[be,Ee],1:[nn],2:[nn]}),(0,r.Z)(de,an("2020"),{0:[Ee,Be],1:[rn],2:[Ce,ke]}),(0,r.Z)(de,an("0202"),{0:[ke,Ce],1:[rn],2:[Ee,Be]}),de),un={ISO_LINES:1,ISO_BANDS:2},ln={zIndex:0,zOffset:.005};function cn(t,e){return Array.isArray(e)?t<e[0]?0:t<e[1]?1:2:t>=e?1:0}function hn(t){var e=t.cellWeights,n=t.x,r=t.y,i=t.width,o=t.height,a=t.threshold;t.thresholdValue&&(f.Z.deprecated("thresholdValue","threshold")(),a=t.thresholdValue);var s=n<0,u=n>=i-1,l=r<0,c=r>=o-1,h=s||u||l||c,p={},d={};s||c?d.top=0:(p.top=e[(r+1)*i+n],d.top=cn(p.top,a)),u||c?d.topRight=0:(p.topRight=e[(r+1)*i+n+1],d.topRight=cn(p.topRight,a)),u||l?d.right=0:(p.right=e[r*i+n+1],d.right=cn(p.right,a)),s||l?d.current=0:(p.current=e[r*i+n],d.current=cn(p.current,a));var A=d.top,v=d.topRight,g=d.right,m=d.current,y=-1;Number.isFinite(a)&&(y=A<<3|v<<2|g<<1|m),Array.isArray(a)&&(y=A<<6|v<<4|g<<2|m);var _=0;return h||(_=cn((p.top+p.topRight+p.right+p.current)/4,a)),{code:y,meanCode:_}}function fn(t){var e=t.gridOrigin,n=t.cellSize,r=t.x,i=t.y,o=t.code,a=t.meanCode,s=t.type,u=void 0===s?un.ISO_LINES:s,l=(0,h.Z)((0,h.Z)({},ln),t.thresholdData),c=u===un.ISO_BANDS?sn[o]:on[o];Array.isArray(c)||(c=c[a]);var f=l.zIndex*l.zOffset,p=(r+1)*n[0],d=(i+1)*n[1],A=e[0]+p,v=e[1]+d;if(u===un.ISO_BANDS){var g=[];return c.forEach((function(t){var e=[];t.forEach((function(t){var r=A+t[0]*n[0],i=v+t[1]*n[1];e.push([r,i,f])})),g.push(e)})),g}var m=[];return c.forEach((function(t){t.forEach((function(t){var e=A+t[0]*n[0],r=v+t[1]*n[1];m.push([e,r,f])}))})),m}var pn=[255,255,255,255],dn={cellSize:{type:"number",min:1,max:1e3,value:1e3},getPosition:{type:"accessor",value:function(t){return t.position}},getWeight:{type:"accessor",value:1},gpuAggregation:!0,aggregation:"SUM",contours:[{threshold:1}],zOffset:.005},An="positions",vn={data:{props:["cellSize"]},weights:{props:["aggregation"],accessors:["getWeight"]}},gn=function(t){(0,l.Z)(n,t);var e=(0,c.Z)(n);function n(){return(0,i.Z)(this,n),e.apply(this,arguments)}return(0,o.Z)(n,[{key:"initializeState",value:function(){var t;(0,s.Z)((0,u.Z)(n.prototype),"initializeAggregationLayer",this).call(this,{dimensions:vn}),this.setState({contourData:{},projectPoints:!1,weights:{count:{size:1,operation:S.SUM}}}),this.getAttributeManager().add((t={},(0,r.Z)(t,An,{size:3,accessor:"getPosition",type:5130,fp64:this.use64bitPositions()}),(0,r.Z)(t,"count",{size:3,accessor:"getWeight"}),t))}},{key:"updateState",value:function(t){(0,s.Z)((0,u.Z)(n.prototype),"updateState",this).call(this,t);var e=!1,r=t.oldProps,i=t.props,o=this.state.aggregationDirty;r.contours===i.contours&&r.zOffset===i.zOffset||(e=!0,this._updateThresholdData(t.props)),this.getNumInstances()>0&&(o||e)&&this._generateContours()}},{key:"renderLayers",value:function(){var t=this.state.contourData,e=t.contourSegments,n=t.contourPolygons,r=this.getSubLayerClass("lines",Ae.Z),i=this.getSubLayerClass("bands",ve.Z);return[e&&e.length>0&&new r(this.getSubLayerProps({id:"lines"}),{data:this.state.contourData.contourSegments,getSourcePosition:function(t){return t.start},getTargetPosition:function(t){return t.end},getColor:function(t){return t.contour.color||pn},getWidth:function(t){return t.contour.strokeWidth||1}}),n&&n.length>0&&new i(this.getSubLayerProps({id:"bands"}),{data:this.state.contourData.contourPolygons,getPolygon:function(t){return t.vertices},getFillColor:function(t){return t.contour.color||pn}})]}},{key:"updateAggregationState",value:function(t){var e=t.props,n=t.oldProps,r=e.cellSize,i=e.coordinateSystem,o=this.context.viewport,a=n.cellSize!==r,s=e.gpuAggregation;this.state.gpuAggregation!==e.gpuAggregation&&s&&!et.isSupported(this.context.gl)&&(f.Z.warn("GPU Grid Aggregation not supported, falling back to CPU")(),s=!1);var u=s!==this.state.gpuAggregation;this.setState({gpuAggregation:s});var l=this.state.dimensions,c=this.isAttributeChanged(An),h=l.data,p=l.weights,d=this.state.boundingBox;if(c&&(d=Nt(this.getAttributes(),this.getNumInstances()),this.setState({boun
2dingBox:d})),c||a){var A=Vt(d,r,o,i),v=A.gridOffset,g=A.translation,m=A.width,y=A.height,_=A.numCol,b=A.numRow;this.allocateResources(b,_),this.setState({gridOffset:v,boundingBox:d,translation:g,posOffset:g.slice(),gridOrigin:[-1*g[0],-1*g[1]],width:m,height:y,numCol:_,numRow:b})}var x=c||u||this.isAggregationDirty(t,{dimension:h,compareAll:s}),w=this.isAggregationDirty(t,{dimension:p});w&&this._updateAccessors(t),(x||w)&&this._resetResults(),this.setState({aggregationDataDirty:x,aggregationWeightsDirty:w})}},{key:"_updateAccessors",value:function(t){var e=t.props,n=e.getWeight,r=e.aggregation,i=e.data,o=this.state.weights.count;o&&(o.getWeight=n,o.operation=S[r]),this.setState({getValue:P(r,n,{data:i})})}},{key:"_resetResults",value:function(){var t=this.state.weights.count;t&&(t.aggregationData=null)}},{key:"_generateContours",value:function(){var t=this.state,e=t.numCol,n=t.numRow,r=t.gridOrigin,i=t.gridOffset,o=t.thresholdData,a=this.state.weights.count,s=a.aggregationData;s||(s=a.aggregationBuffer.getData(),a.aggregationData=s);var u=function(t){var e,n=t.thresholdData,r=t.cellWeights,i=t.gridSize,o=t.gridOrigin,a=t.cellSize,s=[],u=[],l=i[0],c=i[1],h=0,f=0,p=(0,ft.Z)(n);try{for(p.s();!(e=p.n()).done;)for(var d=e.value,A=d.contour,v=A.threshold,g=-1;g<l;g++)for(var m=-1;m<c;m++){var y=hn({cellWeights:r,threshold:v,x:g,y:m,width:l,height:c}),_=y.code,b=y.meanCode,x={type:un.ISO_BANDS,gridOrigin:o,cellSize:a,x:g,y:m,width:l,height:c,code:_,meanCode:b,thresholdData:d};if(Array.isArray(v)){x.type=un.ISO_BANDS;var w,C=fn(x),B=(0,ft.Z)(C);try{for(B.s();!(w=B.n()).done;){var k=w.value;u[f++]={vertices:k,contour:A}}}catch(T){B.e(T)}finally{B.f()}}else{x.type=un.ISO_LINES;for(var E=fn(x),S=0;S<E.length;S+=2)s[h++]={start:E[S],end:E[S+1],contour:A}}}}catch(T){p.e(T)}finally{p.f()}return{contourSegments:s,contourPolygons:u}}({thresholdData:o,cellWeights:et.getCellData({countsData:s}).cellWeights,gridSize:[e,n],gridOrigin:r,cellSize:[i.xOffset,i.yOffset]});this.setState({contourData:u})}},{key:"_updateThresholdData",value:function(t){for(var e=t.contours,n=t.zOffset,r=e.length,i=new Array(r),o=0;o<r;o++){var a=e[o];i[o]={contour:a,zIndex:a.zIndex||o,zOffset:n}}this.setState({thresholdData:i})}}]),n}(Jt);(0,r.Z)(gn,"layerName","ContourLayer"),(0,r.Z)(gn,"defaultProps",dn);var mn=n(54976),yn=n(64441),_n=n(34819),bn={colorDomain:null,colorRange:ot,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},xn=function(t){(0,l.Z)(n,t);var e=(0,c.Z)(n);function n(){return(0,i.Z)(this,n),e.apply(this,arguments)}return(0,o.Z)(n,[{key:"getShaders",value:function(){return(0,s.Z)((0,u.Z)(n.prototype),"getShaders",this).call(this,{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;\n\n// Custom uniforms\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;\n\n// Domain uniforms\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\n\n// Result\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\n  // if aggregated color or elevation is 0 do not render\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\n  // Set color to be rendered to picking fbo (also used to check for selection highlight).\n  picking_setPickingColor(instancePickingColors);\n\n  gl_Position = project_position_to_clipspace(centroidPosition, centroidPosition64Low, pos, geometry.position);\n\n  // Light calculations\n  // Worldspace is the linear space after Mercator projection\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:[E.Z,mn.N,rt.Z,B]})}},{key:"initializeState",value:function(t){var e=t.gl;this.getAttributeManager().addInstanced({colors:{size:4,noAlloc:!0},elevations:{size:4,noAlloc:!0}});var n=this._getModel(e);this._setupUniformBuffer(n),this.setState({model:n})}},{key:"_getModel",value:function(t){return new g.Z(t,(0,h.Z)((0,h.Z)({}
2,this.getShaders()),{},{id:this.props.id,geometry:new _n.Z,isInstanced:!0}))}},{key:"draw",value:function(t){var e=t.uniforms,n=this.props,r=n.cellSize,i=n.offset,o=n.extruded,a=n.elevationScale,s=n.coverage,u=n.gridSize,l=n.gridOrigin,c=n.gridOffset,h=n.elevationRange,f=n.colorMaxMinBuffer,p=n.elevationMaxMinBuffer,d=[(0,yn.Ks)(l[0]),(0,yn.Ks)(l[1])],A=[(0,yn.Ks)(c[0]),(0,yn.Ks)(c[1])],v=this.getDomainUniforms(),g=at(this.props.colorRange);this.bindUniformBuffers(f,p),this.state.model.setUniforms(e).setUniforms(v).setUniforms({cellSize:r,offset:i,extruded:o,elevationScale:a,coverage:s,gridSize:u,gridOrigin:l,gridOriginLow:d,gridOffset:c,gridOffsetLow:A,colorRange:g,elevationRange:h}).draw(),this.unbindUniformBuffers(f,p)}},{key:"bindUniformBuffers",value:function(t,e){t.bind({target:35345,index:0}),e.bind({target:35345,index:1})}},{key:"unbindUniformBuffers",value:function(t,e){t.unbind({target:35345,index:0}),e.unbind({target:35345,index:1})}},{key:"getDomainUniforms",value:function(){var t=this.props,e=t.colorDomain,n=t.elevationDomain,r={};return null!==e?(r.colorDomainValid=!0,r.colorDomain=e):r.colorDomainValid=!1,null!==n?(r.elevationDomainValid=!0,r.elevationDomain=n):r.elevationDomainValid=!1,r}},{key:"_setupUniformBuffer",value:function(t){var e=this.context.gl,n=t.program.handle,r=e.getUniformBlockIndex(n,"ColorData"),i=e.getUniformBlockIndex(n,"ElevationData");e.uniformBlockBinding(n,r,0),e.uniformBlockBinding(n,i,1)}}]),n}(it.Z);(0,r.Z)(xn,"layerName","GPUGridCellLayer"),(0,r.Z)(xn,"defaultProps",bn);var wn={colorDomain:null,colorRange:ot,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:function(t){return t.position}},extruded:!1,material:!0},Cn={data:{props:["cellSize","colorAggregation","elevationAggregation"]}},Bn="positions",kn=function(t){(0,l.Z)(n,t);var e=(0,c.Z)(n);function n(){return(0,i.Z)(this,n),e.apply(this,arguments)}return(0,o.Z)(n,[{key:"initializeState",value:function(t){var e,i=t.gl,o=et.isSupported(i);o||f.Z.error("GPUGridLayer is not supported on this browser, use GridLayer instead")(),(0,s.Z)((0,u.Z)(n.prototype),"initializeAggregationLayer",this).call(this,{dimensions:Cn}),this.setState({gpuAggregation:!0,projectPoints:!1,isSupported:o,weights:{color:{needMin:!0,needMax:!0,combineMaxMin:!0,maxMinBuffer:new mt.Z(i,{byteLength:16,accessor:{size:4,type:5126,divisor:1}})},elevation:{needMin:!0,needMax:!0,combineMaxMin:!0,maxMinBuffer:new mt.Z(i,{byteLength:16,accessor:{size:4,type:5126,divisor:1}})}},positionAttributeName:"positions"}),this.getAttributeManager().add((e={},(0,r.Z)(e,Bn,{size:3,accessor:"getPosition",type:5130,fp64:this.use64bitPositions()}),(0,r.Z)(e,"color",{size:3,accessor:"getColorWeight"}),(0,r.Z)(e,"elevation",{size:3,accessor:"getElevationWeight"}),e))}},{key:"updateState",value:function(t){!1!==this.state.isSupported&&((0,s.Z)((0,u.Z)(n.prototype),"updateState",this).call(this,t),this.state.aggregationDirty&&this.setState({gridHash:null}))}},{key:"getHashKeyForIndex",value:function(t){var e=this.state,n=e.numRow,r=e.numCol,i=e.boundingBox,o=e.gridOffset,a=[r,n],s=[i.xMin,i.yMin],u=[o.xOffset,o.yOffset],l=Math.floor(t/a[0]),c=t-l*a[0],h=Math.floor((l*u[1]+s[1]+90+u[1]/2)/u[1]),f=Math.floor((c*u[0]+s[0]+180+u[0]/2)/u[0]);return"".concat(h,"-").concat(f)}},{key:"getPositionForIndex",value:function(t){var e=this.state,n=e.numRow,r=e.numCol,i=e.boundingBox,o=e.gridOffset,a=[r,n],s=[i.xMin,i.yMin],u=[o.xOffset,o.yOffset],l=Math.floor(t/a[0]);return[(t-l*a[0])*u[0]+s[0],l*u[1]+s[1]]}},{key:"getPickingInfo",value:function(t){var e=t.info,n=t.mode,r=e.index,i=null;if(r>=0){var o=this.state.gpuGridAggregator,a=this.getPositionForIndex(r),s=et.getAggregationData((0,h.Z)({pixelIndex:r},o.getData("color"))),u=et.getAggregationData((0,h.Z)({pixelIndex:r},o.getData("elevation")));if(i={colorValue:s.cellWeight,elevationValue:u.cellWeight,count:s.cellCount||u.cellCount,position:a,totalCount:s.totalCount||u.totalCount},"hover"!==n){var l=this.props,c=this.state.gridHash;
2if(!c){var f=this.state,p=f.gridOffset,d=f.translation,A=f.boundingBox,v=this.context.viewport;c=Ht(l,{gridOffset:p,attributes:this.getAttributes(),viewport:v,translation:d,boundingBox:A}).gridHash,this.setState({gridHash:c})}var g=c[this.getHashKeyForIndex(r)];Object.assign(i,g)}}return e.picked=Boolean(i),e.object=i,e}},{key:"renderLayers",value:function(){if(!this.state.isSupported)return null;var t=this.props,e=t.elevationScale,n=t.extruded,r=t.cellSize,i=t.coverage,o=t.material,a=t.elevationRange,s=t.colorDomain,u=t.elevationDomain,l=this.state,c=l.weights,h=l.numRow,f=l.numCol,p=l.gridOrigin,d=l.gridOffset,A=c.color,v=c.elevation,g=at(this.props.colorRange);return new(this.getSubLayerClass("gpu-grid-cell",xn))({gridSize:[f,h],gridOrigin:p,gridOffset:[d.xOffset,d.yOffset],colorRange:g,elevationRange:a,colorDomain:s,elevationDomain:u,cellSize:r,coverage:i,material:o,elevationScale:e,extruded:n},this.getSubLayerProps({id:"gpu-grid-cell"}),{data:{attributes:{colors:A.aggregationBuffer,elevations:v.aggregationBuffer}},colorMaxMinBuffer:A.maxMinBuffer,elevationMaxMinBuffer:v.maxMinBuffer,numInstances:f*h})}},{key:"finalizeState",value:function(t){var e=this.state.weights;[e.color,e.elevation].forEach((function(t){var e=t.aggregationBuffer;t.maxMinBuffer.delete(),null===e||void 0===e||e.delete()})),(0,s.Z)((0,u.Z)(n.prototype),"finalizeState",this).call(this,t)}},{key:"updateAggregationState",value:function(t){var e=t.props,n=t.oldProps,r=e.cellSize,i=e.coordinateSystem,o=this.context.viewport,a=n.cellSize!==r,s=this.state.dimensions,u=this.isAttributeChanged(Bn),l=u||this.isAttributeChanged(),c=this.state.boundingBox;if(u&&(c=Nt(this.getAttributes(),this.getNumInstances()),this.setState({boundingBox:c})),u||a){var h=Vt(c,r,o,i),f=h.gridOffset,p=h.translation,d=h.width,A=h.height,v=h.numCol,g=h.numRow;this.allocateResources(g,v),this.setState({gridOffset:f,translation:p,gridOrigin:[-1*p[0],-1*p[1]],width:d,height:A,numCol:v,numRow:g})}var m=l||this.isAggregationDirty(t,{dimension:s.data,compareAll:!0});m&&this._updateAccessors(t),this.setState({aggregationDataDirty:m})}},{key:"_updateAccessors",value:function(t){var e=t.props,n=e.colorAggregation,r=e.elevationAggregation,i=this.state.weights,o=i.color,a=i.elevation;o.operation=S[n],a.operation=S[r]}}]),n}(Jt);(0,r.Z)(kn,"layerName","GPUGridLayer"),(0,r.Z)(kn,"defaultProps",wn);var En=(0,h.Z)((0,h.Z)((0,h.Z)({},kn.defaultProps),oe.defaultProps),{},{gpuAggregation:!1}),Sn=function(t){(0,l.Z)(n,t);var e=(0,c.Z)(n);function n(){var t;(0,i.Z)(this,n);for(var o=arguments.length,s=new Array(o),u=0;u<o;u++)s[u]=arguments[u];return t=e.call.apply(e,[this].concat(s)),(0,r.Z)((0,a.Z)(t),"state",void 0),t}return(0,o.Z)(n,[{key:"initializeState",value:function(){this.state={useGPUAggregation:!0}}},{key:"updateState",value:function(t){var e=t.props;this.setState({useGPUAggregation:this.canUseGPUAggregation(e)})}},{key:"renderLayers",value:function(){var t=this.props,e=t.data,n=t.updateTriggers,r=this.state.useGPUAggregation?"GPU":"CPU";return new(this.state.useGPUAggregation?this.getSubLayerClass("GPU",kn):this.getSubLayerClass("CPU",oe))(this.props,this.getSubLayerProps({id:r,updateTriggers:n}),{data:e})}},{key:"canUseGPUAggregation",value:function(t){var e=t.gpuAggregation,n=t.lowerPercentile,r=t.upperPercentile,i=t.getColorValue,o=t.getElevationValue,a=t.colorScaleType;return!!e&&(!!et.isSupported(this.context.gl)&&(0===n&&100===r&&(null===i&&null===o&&("quantile"!==a&&"ordinal"!==a))))}}]),n}(At.Z);(0,r.Z)(Sn,"layerName","GridLayer"),(0,r.Z)(Sn,"defaultProps",En);var Tn=new Float32Array(12);function Mn(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,r=0,i=(0,ft.Z)(t);try{for(i.s();!(e=i.n()).done;)for(var o=e.value,a=0;a<n;a++)Tn[r++]=o[a]||0}catch(s){i.e(s)}finally{i.f()}return Tn}var In=function(t){(0,l.Z)(n,t);var e=(0,c.Z)(n);function n(){return(0,i.Z)(this,n),e.apply(this,arguments)}return(0,o.Z)(n,[{key:"getShaders",value:function(){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    // if user specified custom domain use it.\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\n  // discard pixels with 0 weight.\n  if (weight <= 0.) {\n     discard;\n  }\n\n  vec4 linearColor = getLinearColor(weight);\n  linearColor.a *= opacity;\n  gl_FragColor =linearColor;\n}\n",modules:[E.Z]}}},{key:"initializeState",value:function(t){var e=t.gl;this.getAttributeManager().add({positions:{size:3,noAlloc:!0},texCoords:{size:2,noAlloc:!0}}),this.setState({model:this._getModel(e)})}},{key:"_getModel",value:function(t){var e=this.props.vertexCount;return new g.Z(t,(0,h.Z)((0,h.Z)({}
2,this.getShaders()),{},{id:this.props.id,geometry:new nt.Z({drawMode:6,vertexCount:e})}))}},{key:"draw",value:function(t){var e=t.uniforms,n=this.state.model,r=this.props,i=r.texture,o=r.maxTexture,a=r.colorTexture,s=r.intensity,u=r.threshold,l=r.aggregationMode,c=r.colorDomain;n.setUniforms((0,h.Z)((0,h.Z)({},e),{},{texture:i,maxTexture:o,colorTexture:a,intensity:s,threshold:u,aggregationMode:l,colorDomain:c})).draw()}}]),n}(it.Z);(0,r.Z)(In,"layerName","TriangleLayer");var Pn,Zn={mipmaps:!1,parameters:(Pn={},(0,r.Z)(Pn,10240,9729),(0,r.Z)(Pn,10241,9729),(0,r.Z)(Pn,10242,33071),(0,r.Z)(Pn,10243,33071),Pn),dataFormat:6408},Dn=[0,0],Ln={SUM:0,MEAN:1},On={getPosition:{type:"accessor",value:function(t){return t.position}},getWeight:{type:"accessor",value:1},intensity:{type:"number",min:0,value:1},radiusPixels:{type:"number",min:1,max:100,value:50},colorRange:ot,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}},Fn=[p.h.BLEND_EQUATION_MINMAX,p.h.TEXTURE_FLOAT],Rn=[p.h.COLOR_ATTACHMENT_RGBA32F,p.h.FLOAT_BLEND],zn={data:{props:["radiusPixels"]}},Un=function(t){(0,l.Z)(n,t);var e=(0,c.Z)(n);function n(){var t;(0,i.Z)(this,n);for(var o=arguments.length,s=new Array(o),u=0;u<o;u++)s[u]=arguments[u];return t=e.call.apply(e,[this].concat(s)),(0,r.Z)((0,a.Z)(t),"state",void 0),t}return(0,o.Z)(n,[{key:"initializeState",value:function(){var t=this.context.gl;if(!(0,A.ag)(t,Fn))return this.setState({supported:!1}),void f.Z.error("HeatmapLayer: ".concat(this.id," is not supported on this browser"))();(0,s.Z)((0,u.Z)(n.prototype),"initializeAggregationLayer",this).call(this,zn),this.setState({supported:!0,colorDomain:Dn}),this._setupTextureParams(),this._setupAttributes(),this._setupResources()}},{key:"shouldUpdateState",value:function(t){return t.changeFlags.somethingChanged}},{key:"updateState",value:function(t){this.state.supported&&((0,s.Z)((0,u.Z)(n.prototype),"updateState",this).call(this,t),this._updateHeatmapState(t))}},{key:"_updateHeatmapState",value:function(t){var e=t.props,n=t.oldProps,r=this._getChangeFlags(t);(r.dataChanged||r.viewportChanged)&&(r.boundsChanged=this._updateBounds(r.dataChanged),this._updateTextureRenderingBounds()),r.dataChanged||r.boundsChanged?(clearTimeout(this.state.updateTimer),this.setState({isWeightMapDirty:!0})):r.viewportZoomChanged&&this._debouncedUpdateWeightmap(),e.colorRange!==n.colorRange&&this._updateColorTexture(t),this.state.isWeightMapDirty&&this._updateWeightmap(),this.setState({zoom:t.context.viewport.zoom})}},{key:"renderLayers",value:function(){if(!this.state.supported)return[];var t=this.state,e=t.weightsTexture,n=t.triPositionBuffer,r=t.triTexCoordBuffer,i=t.maxWeightsTexture,o=t.colorTexture,a=t.colorDomain,s=this.props,u=s.updateTriggers,l=s.intensity,c=s.threshold,h=s.aggregation;return new(this.getSubLayerClass("triangle",In))(this.getSubLayerProps({id:"triangle-layer",updateTriggers:u}),{coordinateSystem:Rt.Df.DEFAULT,data:{attributes:{positions:n,texCoords:r}},vertexCount:4,maxTexture:i,colorTexture:o,aggregationMode:Ln[h]||0,texture:e,intensity:l,threshold:c,colorDomain:a})}},{key:"finalizeState",value:function(t){(0,s.Z)((0,u.Z)(n.prototype),"finalizeState",this).call(this,t);var e=this.state,r=e.weightsTransform,i=e.weightsTexture,o=e.maxWeightTransform,a=e.maxWeightsTexture,l=e.triPositionBuffer,c=e.triTexCoordBuffer,h=e.colorTexture,f=e.updateTimer;null===r||void 0===r||r.delete(),null===i||void 0===i||i.delete(),null===o||void 0===o||o.delete(),null===a||void 0===a||a.delete(),null===l||void 0===l||l.delete(),null===c||void 0===c||c.delete(),null===h||void 0===h||h.delete(),f&&clearTimeout(f)}},{key:"_getAttributeManager",value:function(){return new dt.Z(this.context.gl,{id:this.props.id,stats:this.context.stats})}},{key:"_getChangeFlags",value:function(t){var e={},n=this.state.dimensions;e.dataChanged=this.isAttributeChanged()||this.isAggregationDirty(t,{compareAll:!0,dimension:n.data}),e.viewportChanged=t.changeFlags.viewportChanged;var r=this.state.zoom;return t.context.viewport&&t.context.viewport.zoom===r||(e.viewportZoomChanged=!0),e}},{key:"_createTextures",value:function(){var t=this.context.gl,e=this.state,n=e.textureSize,r=e.format,i=e.type;this.setState({weightsTexture:new W.Z(t,(0,h.Z)({width:n,height:n,format:r,type:i},Zn)),maxWeightsTexture:new W.Z(t,(0,h.Z)({format:r,type:i},Zn))})}},{key:"_setupAttributes",value:function(){this.getAttributeManager().add({positions:{size:3,type:5130,accessor:"getPosition"},weights:{size:1,accessor:"getWeight"}}),this.setState({positionAttributeName:"positions"})}}
2,{key:"_setupTextureParams",value:function(){var t=this.context.gl,e=this.props.weightsTextureSize,n=Math.min(e,(0,d.ZS)(t,3379)),r=(0,A.ag)(t,Rn),i=function(t){var e=t.gl;return t.floatTargetSupport?{format:(0,d.D0)(e)?34836:6408,type:5126}:{format:6408,type:5121}}({gl:t,floatTargetSupport:r}),o=i.format,a=i.type,s=r?1:1/255;this.setState({textureSize:n,format:o,type:a,weightsScale:s}),r||f.Z.warn("HeatmapLayer: ".concat(this.id," rendering to float texture not supported, fallingback to low precession format"))()}},{key:"getShaders",value:function(t){return(0,s.Z)((0,u.Z)(n.prototype),"getShaders",this).call(this,"max-weights-transform"===t?{vs:"attribute vec4 inTexture;\nvarying vec4 outTexture;\n\nvoid main()\n{\noutTexture = inTexture;\ngl_Position = vec4(0, 0, 0, 1.);\n// Enforce default value for ANGLE issue (https://bugs.chromium.org/p/angleproject/issues/detail?id=3941)\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\n  // map xy from commonBounds to [-1, 1]\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;\n// Epanechnikov function, keeping for reference\n// float epanechnikovKDE(float u) {\n//   return 0.75 * (1.0 - u * u);\n// }\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"})}},{key:"_createWeightsTransform",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.context.gl,r=this.state.weightsTransform,i=this.state.weightsTexture;null===(t=r)||void 0===t||t.delete(),r=new m.Z(n,(0,h.Z)({id:"".concat(this.id,"-weights-transform"),elementCount:1,_targetTexture:i,_targetTextureVarying:"weightsTexture"},e)),this.setState({weightsTransform:r})}},{key:"_setupResources",value:function(){var t=this.context.gl;this._createTextures();var e=this.state,n=e.textureSize,r=e.weightsTexture,i=e.maxWeightsTexture,o=this.getShaders("weights-transform");this._createWeightsTransform(o);var a=this.getShaders("max-weights-transform"),s=new m.Z(t,(0,h.Z)((0,h.Z)({id:"".concat(this.id,"-max-weights-transform"),_sourceTextures:{inTexture:r},_targetTexture:i,_targetTextureVarying:"outTexture"},a),{},{elementCount:n*n}));this.setState({weightsTexture:r,maxWeightsTexture:i,maxWeightTransform:s,zoom:null,triPositionBuffer:new mt.Z(t,{byteLength:48,accessor:{size:3}}),triTexCoordBuffer:new mt.Z(t,{byteLength:48,accessor:{size:2}})})}},{key:"updateShaders",value:function(t){this._createWeightsTransform(t)}},{key:"_updateMaxWeightValue",value:function(){this.state.maxWeightTransform.run({parameters:{blend:!0,depthTest:!1,blendFunc:[1,1],blendEquation:32776}})}},{key:"_updateBounds",value:function(){var t,e,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=this.context.viewport,i=[r.unproject([0,0]),r.unproject([r.width,0]),r.unproject([r.width,r.height]),r.unproject([0,r.height])].map((function(t){return t.map(Math.fround)})),o=function(t){var e=t.map((function(t){return t[0]})),n=t.map((function(t){return t[1]})),r=Math.min.apply(null,e),i=Math.max.apply(null,e);return[r,Math.min.apply(null,n),i,Math.max.apply(null,n)]}(i),a={visibleWorldBounds:o,viewportCorners:i},s=!1;if(n||!this.state.worldBounds||(t=this.state.worldBounds,!((e=o)[0]>=t[0]&&e[2]<=t[2]&&e[1]>=t[1]&&e[3]<=t[3]))){var u=this._worldToCommonBounds(o),l=this._commonToWorldBounds(u);this.props.coordinateSystem===Rt.Df.LNGLAT&&(l[1]=Math.max(l[1],-85.051129),l[3]=Math.min(l[3],85.051129),l[0]=Math.max(l[0],-360),l[2]=Math.min(l[2],360));var c=this._worldToCommonBounds(l);a.worldBounds=l,a.normalizedCommonBounds=c,s=!0}return this.setState(a),s}},{key:"_updateTextureRenderingBounds",value:function(){var t=this.state,e=t.triPositionBuffer,n=t.triTexCoordBuffer,r=t.normalizedCommonBounds,i=t.viewportCorners,o=this.context.viewport;e.subData(Mn(i,3));var a=i.map((function(t){return function(t,e){var n=(0,yt.Z)(e,4),r=n[0],i=n[1],o=n[2],a=n[3];return[(t[0]-r)/(o-r),(t[1]-i)/(a-i)]}(o.projectPosition(t),r)}));n.subData(Mn(a,2))}},{key:"_updateColorTexture",value:function(t){var e=t.props.colorRange,n=this.state.colorTexture,r=at(e,!1,Uint8Array);n?n.setImageData({data:r,width:e.length}):n=new W.Z(this.context.gl,(0,h.Z)({data:r,width:e.length,height:1},Zn)),this.setState({colorTexture:n})}},{key:"_updateWeightmap",value:function(){var t,e=this,n=this.props,i=n.radiusPixels,o=n.colorDomain,a=n.aggregation,s=this.state,u=s.weightsTransform,l=s.worldBounds,c=s.textureSize,h=s.weightsTexture,f=s.weightsScale;
2this.state.isWeightMapDirty=!1;var p=this._worldToCommonBounds(l,{useLayerCoordinateSystem:!0});if(o&&"SUM"===a){var A=this.context.viewport.distanceScales.metersPerUnit[2]*(p[2]-p[0])/c;this.state.colorDomain=o.map((function(t){return t*A*f}))}else this.state.colorDomain=o||Dn;var v={radiusPixels:i,commonBounds:p,textureWidth:c,weightsScale:f};u.update({elementCount:this.getNumInstances()}),(0,d.s8)(this.context.gl,{clearColor:[0,0,0,0]},(function(){u.run({uniforms:v,parameters:{blend:!0,depthTest:!1,blendFunc:[1,1],blendEquation:32774},clearRenderTarget:!0,attributes:e.getAttributes(),moduleSettings:e.getModuleSettings()})})),this._updateMaxWeightValue(),h.setParameters((t={},(0,r.Z)(t,10240,9729),(0,r.Z)(t,10241,9729),t))}},{key:"_debouncedUpdateWeightmap",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.state.updateTimer,n=this.props.debounceTimeout;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})}},{key:"_worldToCommonBounds",value:function(t){var e,n,r=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).useLayerCoordinateSystem,i=void 0!==r&&r,o=(0,yt.Z)(t,4),a=o[0],s=o[1],u=o[2],l=o[3],c=this.context.viewport,h=this.state.textureSize,f=this.props.coordinateSystem,p=i&&(f===Rt.Df.LNGLAT_OFFSETS||f===Rt.Df.METER_OFFSETS),d=p?c.projectPosition(this.props.coordinateOrigin):[0,0],A=2*h/c.scale;return i&&!p?(e=this.projectPosition([a,s,0]),n=this.projectPosition([u,l,0])):(e=c.projectPosition([a,s,0]),n=c.projectPosition([u,l,0])),function(t,e,n){var r=(0,yt.Z)(t,4),i=r[0],o=r[1],a=r[2],s=r[3],u=a-i,l=s-o,c=u,h=l;u/l<e/n?c=e/n*l:h=n/e*u,c<e&&(c=e,h=n);var f=(a+i)/2,p=(s+o)/2;return[f-c/2,p-h/2,f+c/2,p+h/2]}([e[0]-d[0],e[1]-d[1],n[0]-d[0],n[1]-d[1]],A,A)}},{key:"_commonToWorldBounds",value:function(t){var e=(0,yt.Z)(t,4),n=e[0],r=e[1],i=e[2],o=e[3],a=this.context.viewport,s=a.unprojectPosition([n,r]),u=a.unprojectPosition([i,o]);return s.slice(0,2).concat(u.slice(0,2))}}]),n}(gt);(0,r.Z)(Un,"layerName","HeatmapLayer"),(0,r.Z)(Un,"defaultProps",On)},23427:function(t,e,n){"use strict";n.d(e,{Z:function(){return a},z:function(){return o}});var r=n(21970),i={};function o(t){i=t}function a(t,e,n,o){r.Z.level>0&&i[t]&&i[t].call(null,e,n,o)}},96684:function(t,e,n){"use strict";n.d(e,{Z:function(){return G}});var r=n(50189),i=n(60726),o=n(22951),a=n(91976),s=n(64649),u=n(11026),l=n(47169),c=n(83138),h=n(27597),f=n(67591),p=n(94337),d=n(12308),A=n(70353),v=n(33839),g=function(){function t(e,n){(0,o.Z)(this,t),(0,s.Z)(this,"opts",void 0),(0,s.Z)(this,"source",void 0),this.opts=n,this.source=e}return(0,a.Z)(t,[{key:"value",get:function(){return this.source.value}},{key:"getValue",value:function(){var t=this.source.getBuffer(),e=this.getAccessor();if(t)return[t,e];var n=this.source.value,r=e.size,i=n;if(n&&n.length!==r){i=new Float32Array(r);for(var o=e.elementOffset||0,a=0;a<r;++a)i[a]=n[o+a]}return i}},{key:"getAccessor",value:function(){return(0,r.Z)((0,r.Z)({},this.source.getAccessor()),this.opts)}}]),t}();var m=n(28321),y=n(64441),_=n(21970);function b(t){return t.stride||t.size*t.bytesPerElement}function x(t,e){e.offset&&_.Z.removed("shaderAttribute.offset","vertexOffset, elementOffset")();var n=b(t),i=(void 0!==e.vertexOffset?e.vertexOffset:t.vertexOffset||0)*n+(e.elementOffset||0)*t.bytesPerElement+(t.offset||0);return(0,r.Z)((0,r.Z)({},e),{},{offset:i,stride:n})}var w=function(){function t(e,n,i){(0,o.Z)(this,t),(0,s.Z)(this,"gl",void 0),(0,s.Z)(this,"id",void 0),(0,s.Z)(this,"size",void 0),(0,s.Z)(this,"settings",void 0),(0,s.Z)(this,"value",void 0),(0,s.Z)(this,"doublePrecision",void 0),(0,s.Z)(this,"_buffer",void 0),(0,s.Z)(this,"state",void 0),this.gl=e,this.id=n.id||"",this.size=n.size||1;var a,u=n.logicalType||n.type,l=5130===u,c=n.defaultValue;c=Number.isFinite(c)?[c]:c||new Array(this.size).fill(0),a=l?5126:!u&&n.isIndexed?e&&(0,d.U6)(e,A.h.ELEMENT_INDEX_UINT32)?5125:5123:u||5126;var h=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")}}(u||a||5126);this.doublePrecision=l,l&&!1===n.fp64&&(h=Float32Array),this.value=null,this.settings=(0,r.Z)((0,r.Z)({},n),{},{defaultType:h,defaultValue:c,logicalType:u,type:a,size:this.size,bytesPerElement:h.BYTES_PER_ELEMENT}),this.state=(0,r.Z)((0,r.Z)({},i),{},{externalBuffer:null,bufferAccessor:this.settings,allocatedValue:null,numInstances:0,bounds:null,constant:!1}),this._buffer=null}return(0,a.Z)(t,[{key:"isConstant",get:function(){return this.state.constant}},{key:"buffer",get:function(){if(!this._buffer){var t=this.settings,e=t.isIndexed,n=t.type;this._buffer=new v.Z(this.gl,{id:this.id,target:e?34963:34962,accessor:{type:n}})}return this._buffer}},{key:"byteOffset",get:function(){var t=this.getAccessor();return t.vertexOffset?t.vertexOffset*b(t):0}},{key:"numInstances",get:function(){return this.state.numInstances},set:function(t){this.state.numInstances=t}},{key:"delete",value:function(){this._buffer&&(this._buffer.delete(),this._buffer=null),m.Z.release(this.state.allocatedValue)}},{key:"getShaderAttributes",value:function(t,e){if(this.doublePrecision){var n={},i=this.value instanceof Float64Array,o=function(t,e){var n=x(t,e);return{high:n,low:(0,r.Z)((0,r.Z)({},n),{},{offset:n.offset+4*t.size})}}(this.getAccessor(),e||{});return n[t]=new g(this,o.high),n["".concat(t,"64Low")]=i?new g(this,o.low):new Float32Array(this.size),n}if(e){var a=x(this.getAccessor(),e);return(0,s.Z)({},t,new g(this,a))}return(0,s.Z)({},t,this)}},{key:"getBuffer",value:function(){return this.state.constant?null:this.state.externalBuffer||this._buffer}},{key:"getValue",value:function(){return this.state.constant?this.value:[this.getBuffer(),this.getAccessor()]}},{key:"getAccessor",value:function(){return this.state.bufferAccessor}},{key:"getBounds",value:function(){if(this.state.bounds)return this.state.bounds;var t=null;if(this.state.constant&&this.value){var e=Array.from(this.value);t=[e,e]}else{var n=this.value,r=this.numInstances,i=this.size,o=r*i;if(n&&o&&n.length>=o){for(var a=new Array(i).fill(1/0),s=new Array(i).fill(-1/0),u=0;u<o;)for(var l=0;l<i;l++){var c=n[u++];c<a[l]&&(a[l]=c),c>s[l]&&(s[l]=c)}t=[a,s]}}return this.state.bounds=t,t}},{key:"setData",value:function(t){var e,n=this.state;e=ArrayBuffer.isView(t)?{value:t}:t instanceof v.Z?{buffer:t}:t;var i=(0,r.Z)((0,r.Z)({},this.settings),e);if(n.bufferAccessor=i,n.bounds=null,e.constant){var o=e.value;if(o=this._normalizeValue(o,[],0),this.settings.normalized&&(o=this.normalizeConstant(o)),!(!n.constant||!this._areValuesEqual(o,this.value)))return!1;n.externalBuffer=null,n.constant=!0,this.value=o}else if(e.buffer){var a=e.buffer;n.externalBuffer=a,n.constant=!1,this.value=e.value||null;var s=e.value instanceof Float64Array;i.type=e.type||a.accessor.type,i.bytesPerElement=a.accessor.BYTES_PER_ELEMENT*(s?2:1),i.stride=b(i)}else if(e.value){this._checkExternalBuffer(e);var u=e.value;n.externalBuffer=null,n.constant=!1,this.value=u,i.bytesPerElement=u.BYTES_PER_ELEMENT,i.stride=b(i);var l=this.buffer,c=this.byteOffset;this.doublePrecision&&u instanceof Float64Array&&(u=(0,y.TK)(u,i));var h=u.byteLength+c+2*i.stride;l.byteLength<h&&l.reallocate(h),l.setAccessor(null),l.subData({data:u,offset:c}),i.type=e.type||l.accessor.type}return!0}},{key:"updateSubBuffer",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.state.bounds=null;
2var e=this.value,n=t.startOffset,r=void 0===n?0:n,i=t.endOffset;this.buffer.subData({data:this.doublePrecision&&e instanceof Float64Array?(0,y.TK)(e,{size:this.size,startIndex:r,endIndex:i}):e.subarray(r,i),offset:r*e.BYTES_PER_ELEMENT+this.byteOffset})}},{key:"allocate",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.state,r=n.allocatedValue,i=m.Z.allocate(r,t+1,{size:this.size,type:this.settings.defaultType,copy:e});this.value=i;var o=this.buffer,a=this.byteOffset;return o.byteLength<i.byteLength+a&&(o.reallocate(i.byteLength+a),e&&r&&o.subData({data:r instanceof Float64Array?(0,y.TK)(r,this):r,offset:a})),n.allocatedValue=i,n.constant=!1,n.externalBuffer=null,n.bufferAccessor=this.settings,!0}},{key:"_checkExternalBuffer",value:function(t){var e=t.value;if(!ArrayBuffer.isView(e))throw new Error("Attribute ".concat(this.id," value is not TypedArray"));var n=this.settings.defaultType,r=!1;if(this.doublePrecision&&(r=e.BYTES_PER_ELEMENT<4),r)throw new Error("Attribute ".concat(this.id," does not support ").concat(e.constructor.name));e instanceof n||!this.settings.normalized||"normalized"in t||_.Z.warn("Attribute ".concat(this.id," is normalized"))()}},{key:"normalizeConstant",value:function(t){switch(this.settings.type){case 5120:return new Float32Array(t).map((function(t){return(t+128)/255*2-1}));case 5122:return new Float32Array(t).map((function(t){return(t+32768)/65535*2-1}));case 5121:return new Float32Array(t).map((function(t){return t/255}));case 5123:return new Float32Array(t).map((function(t){return t/65535}));default:return t}}},{key:"_normalizeValue",value:function(t,e,n){var r=this.settings,i=r.defaultValue,o=r.size;if(Number.isFinite(t))return e[n]=t,e;if(!t)return e[n]=i[0],e;switch(o){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:for(var a=o;--a>=0;)e[n+a]=Number.isFinite(t[a])?t[a]:i[a]}return e}},{key:"_areValuesEqual",value:function(t,e){if(!t||!e)return!1;for(var n=this.size,r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}}]),t}(),C=n(12997),B=n(73115),k=n(18757),E=[],S=[[0,1/0]];var T=n(41894),M=function(t){(0,f.Z)(n,t);var e=(0,p.Z)(n);function n(t,r){var i;return(0,o.Z)(this,n),i=e.call(this,t,r,{startIndices:null,lastExternalBuffer:null,binaryValue:null,binaryAccessor:null,needsUpdate:!0,needsRedraw:!1,updateRanges:S}),(0,s.Z)((0,l.Z)(i),"constant",!1),i.settings.update=r.update||(r.accessor?i._autoUpdater:void 0),Object.seal(i.settings),Object.seal(i.state),i._validateAttributeUpdaters(),i}return(0,a.Z)(n,[{key:"startIndices",get:function(){return this.state.startIndices},set:function(t){this.state.startIndices=t}},{key:"needsUpdate",value:function(){return this.state.needsUpdate}},{key:"needsRedraw",value:function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).clearChangedFlags,e=void 0!==t&&t,n=this.state.needsRedraw;return this.state.needsRedraw=n&&!e,n}},{key:"getUpdateTriggers",value:function(){var t=this.settings.accessor;return[this.id].concat("function"!==typeof t&&t||[])}},{key:"supportsTransition",value:function(){return Boolean(this.settings.transition)}},{key:"getTransitionSetting",value:function(t){if(!t||!this.supportsTransition())return null;var e=this.settings.accessor,n=this.settings.transition,r=Array.isArray(e)?t[e.find((function(e){return t[e]}))]:t[e];return(0,T.M0)(r,n)}},{key:"setNeedsUpdate",value:function(){var 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){var n=e.startRow,r=void 0===n?0:n,i=e.endRow,o=void 0===i?1/0:i;this.state.updateRanges=function(t,e){if(t===S)return t;if(e[0]<0&&(e[0]=0),e[0]>=e[1])return t;for(var n=[],r=t.length,i=0,o=0;o<r;o++){var a=t[o];a[1]<e[0]?(n.push(a),i=o+1):a[0]>e[1]?n.push(a):e=[Math.min(a[0],e[0]),Math.max(a[1],e[1])]}return n.splice(i,0,e),n}(this.state.updateRanges,[r,o])}else this.state.updateRanges=S}},{key:"clearNeedsUpdate",value:function(){this.state.needsUpdate=!1,this.state.updateRanges=E}},{key:"setNeedsRedraw",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.id;this.state.needsRedraw=this.state.needsRedraw||t}},{key:"allocate",value:function(t){var e=this.state,r=this.settings;return!r.noAlloc&&(!!r.update&&((0,c.Z)((0,h.Z)(n.prototype),"allocate",this).call(this,t,e.updateRanges!==S),!0))}},{key:"updateBuffer",value:function(t){var e=t.numInstances,r=t.data,o=t.props,a=t.context;if(!this.needsUpdate())return!1;var s=this.state.updateRanges,l=this.settings,f=l.update,p=l.noAlloc,d=!0;if(f){var A,v=(0,i.Z)(s);try{for(v.s();!(A=v.n()).done;){var g=(0,u.Z)(A.value,2),m=g[0],y=g[1];f.call(a,this,{data:r,startRow:m,endRow:y,props:o,numInstances:e})}}catch(E){v.e(E)}finally{v.f()}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{var _,b=(0,i.Z)(s);try{for(b.s();!(_=b.n()).done;){var x=(0,u.Z)(_.value,2),w=x[0],C=x[1],B=Number.isFinite(w)?this.getVertexOffset(w):0,k=Number.isFinite(C)?this.getVertexOffset(C):p||!Number.isFinite(e)?this.value.length:e*this.size;(0,c.Z)((0,h.Z)(n.prototype),"updateSubBuffer",this).call(this,{startOffset:B,endOffset:k})}}catch(E){b.e(E)}finally{b.f()}}else;this._checkAttributeArray()}else d=!1;return this.clearNeedsUpdate(),this.setNeedsRedraw(),d}},{key:"setConstantValue",value:function(t){return void 0!==t&&"function"!==typeof t&&(this.setData({constant:!0,value:t})&&this.setNeedsRedraw(),this.clearNeedsUpdate(),!0)}},{key:"setExternalBuffer",value:function(t){var e=this.state;
2return t?(this.clearNeedsUpdate(),e.lastExternalBuffer===t||(e.lastExternalBuffer=t,this.setNeedsRedraw(),this.setData(t)),!0):(e.lastExternalBuffer=null,!1)}},{key:"setBinaryValue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=this.state,r=this.settings;if(!t)return n.binaryValue=null,n.binaryAccessor=null,!1;if(r.noAlloc)return!1;if(n.binaryValue===t)return this.clearNeedsUpdate(),!0;if(n.binaryValue=t,this.setNeedsRedraw(),r.transform||e!==this.startIndices){ArrayBuffer.isView(t)&&(t={value:t});var i=t;(0,C.Z)(ArrayBuffer.isView(i.value),"invalid ".concat(r.accessor));var o=Boolean(i.size)&&i.size!==this.size;return n.binaryAccessor=(0,B.jr)(i.value,{size:i.size||this.size,stride:i.stride,offset:i.offset,startIndices:e,nested:o}),!1}return this.clearNeedsUpdate(),this.setData(t),!0}},{key:"getVertexOffset",value:function(t){var e=this.startIndices;return(e?t<e.length?e[t]:this.numInstances:t)*this.size}},{key:"getShaderAttributes",value:function(){var t=this.settings.shaderAttributes||(0,s.Z)({},this.id,null),e={};for(var r in t)Object.assign(e,(0,c.Z)((0,h.Z)(n.prototype),"getShaderAttributes",this).call(this,r,t[r]));return e}},{key:"_autoUpdater",value:function(t,e){var n=e.data,r=e.startRow,o=e.endRow,a=e.props,s=e.numInstances;if(!t.constant){var u=t.settings,l=t.state,c=t.value,h=t.size,f=t.startIndices,p=u.accessor,d=u.transform,A=l.binaryAccessor||("function"===typeof p?p:a[p]);(0,C.Z)("function"===typeof A,'accessor "'.concat(p,'" is not a function'));var v,g=t.getVertexOffset(r),m=(0,B.jB)(n,r,o),y=m.iterable,_=m.objectInfo,b=(0,i.Z)(y);try{for(b.s();!(v=b.n()).done;){var x=v.value;_.index++;var w=A(x,_);if(d&&(w=d.call(this,w)),f){var E=(_.index<f.length-1?f[_.index+1]:s)-f[_.index];if(w&&Array.isArray(w[0])){var S,T=g,M=(0,i.Z)(w);try{for(M.s();!(S=M.n()).done;){var I=S.value;t._normalizeValue(I,c,T),T+=h}}catch(P){M.e(P)}finally{M.f()}}else w&&w.length>h?c.set(w,g):(t._normalizeValue(w,_.target,0),(0,k.k)({target:c,source:_.target,start:g,count:E}));g+=E*h}else t._normalizeValue(w,c,g),g+=h}}catch(P){b.e(P)}finally{b.f()}}}},{key:"_validateAttributeUpdaters",value:function(){var t=this.settings;if(!(t.noAlloc||"function"===typeof t.update))throw new Error("Attribute ".concat(this.id," missing update or accessor"))}},{key:"_checkAttributeArray",value:function(){var t=this.value,e=Math.min(4,this.size);if(t&&t.length>=e){var 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))}}}]),n}(w),I=n(23427),P=n(17225),Z=n(99188),D=function(){function t(e){var n=e.gl,r=e.attribute,i=e.timeline;(0,o.Z)(this,t),(0,s.Z)(this,"gl",void 0),(0,s.Z)(this,"type","interpolation"),(0,s.Z)(this,"attributeInTransition",void 0),(0,s.Z)(this,"settings",void 0),(0,s.Z)(this,"attribute",void 0),(0,s.Z)(this,"transition",void 0),(0,s.Z)(this,"currentStartIndices",void 0),(0,s.Z)(this,"currentLength",void 0),(0,s.Z)(this,"transform",void 0),(0,s.Z)(this,"buffers",void 0),this.gl=n,this.transition=new Z.Z(i),this.attribute=r,this.attributeInTransition=new M(n,r.settings),this.currentStartIndices=r.startIndices,this.currentLength=0,this.transform=function(t,e){var n=(0,T.w)(e.size);return new P.Z(t,{vs:L,defines:{ATTRIBUTE_TYPE:n},varyings:["vCurrent"]})}(n,r);var a={byteLength:0,usage:35050};this.buffers=[new v.Z(n,a),new v.Z(n,a)]}return(0,a.Z)(t,[{key:"inProgress",get:function(){return this.transition.inProgress}},{key:"start",value:function(t,e){if(t.duration<=0)this.transition.cancel();else{this.settings=t;var n=this.gl,o=this.buffers,a=this.attribute;(0,T.DY)(o);var s,u={numInstances:e,attribute:a,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:t.enter},l=(0,i.Z)(o);try{for(l.s();!(s=l.n()).done;){var c=s.value;(0,T.IV)((0,r.Z)({buffer:c},u))}}catch(h){l.e(h)}finally{l.f()}this.currentStartIndices=a.startIndices,this.currentLength=(0,T.pi)(a,e),this.attributeInTransition.setData({buffer:o[1],value:a.value}),this.transition.start(t),this.transform.update({elementCount:Math.floor(this.currentLength/a.size),sourceBuffers:{aFrom:o[0],aTo:(0,T.AQ)(n,a)},feedbackBuffers:{vCurrent:o[1]}})}}},{key:"update",value:function(){var t=this.transition.update();if(t){var e=this.settings,n=e.duration,r=e.easing,i=this.transition.time/n;r&&(i=r(i)),this.transform.run({uniforms:{time:i}})}return t}},{key:"cancel",value:function(){this.transition.cancel(),this.transform.delete();var t,e=(0,i.Z)(this.buffers);try{for(e.s();!(t=e.n()).done;){t.value.delete()}}catch(n){e.e(n)}finally{e.f()}this.buffers.length=0}}]),t}(),L="\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 O=n(56474),F=n(58300),R=n(79078);var z={interpolation:D,spring:function(){function t(e){var n=e.gl,i=e.attribute,a=e.timeline;(0,o.Z)(this,t),(0,s.Z)(this,"gl",void 0),(0,s.Z)(this,"type","spring"),(0,s.Z)(this,"attributeInTransition",void 0),(0,s.Z)(this,"settings",void 0),(0,s.Z)(this,"attribute",void 0),(0,s.Z)(this,"transition",void 0),(0,s.Z)(this,"currentStartIndices",void 0),(0,s.Z)(this,"currentLength",void 0),(0,s.Z)(this,"texture",void 0),(0,s.Z)(this,"framebuffer",void 0),(0,s.Z)(this,"transform",void 0),(0,s.Z)(this,"buffers",void 0),this.gl=n,this.type="spring",this.transition=new Z.Z(a),this.attribute=i,this.attributeInTransition=new M(n,(0,r.Z)((0,r.Z)({},i.settings),{},{normalized:!1})),this.currentStartIndices=i.startIndices,this.currentLength=0,this.texture=function(t){return new F.Z(t,{data:new Uint8Array(4),format:6408,type:5121,border:0,mipmaps:!1,dataFormat:6408,width:1,height:1})}(n),this.framebuffer=function(t,e){return new R.Z(t,{id:"spring-transition-is-transitioning-framebuffer",width:1,height:1,attachments:(0,s.Z)({},36064,e)})}
2(n,this.texture),this.transform=function(t,e,n){var r=(0,T.w)(e.size);return new P.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:r},varyings:["vNext"]})}(n,i,this.framebuffer);var u={byteLength:0,usage:35050};this.buffers=[new v.Z(n,u),new v.Z(n,u),new v.Z(n,u)]}return(0,a.Z)(t,[{key:"inProgress",get:function(){return this.transition.inProgress}},{key:"start",value:function(t,e){var n,o=this.gl,a=this.buffers,s=this.attribute,u={numInstances:e,attribute:s,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:t.enter},l=(0,i.Z)(a);try{for(l.s();!(n=l.n()).done;){var c=n.value;(0,T.IV)((0,r.Z)({buffer:c},u))}}catch(h){l.e(h)}finally{l.f()}this.settings=t,this.currentStartIndices=s.startIndices,this.currentLength=(0,T.pi)(s,e),this.attributeInTransition.setData({buffer:a[1],value:s.value}),this.transition.start((0,r.Z)((0,r.Z)({},t),{},{duration:1/0})),this.transform.update({elementCount:Math.floor(this.currentLength/s.size),sourceBuffers:{aTo:(0,T.AQ)(o,s)}})}},{key:"update",value:function(){var t=this.buffers,e=this.transform,n=this.framebuffer,r=this.transition;if(!r.update())return!1;var i=this.settings;return e.update({sourceBuffers:{aPrev:t[0],aCur:t[1]},feedbackBuffers:{vNext:t[2]}}),e.run({framebuffer:n,discard:!1,clearRenderTarget:!0,uniforms:{stiffness:i.stiffness,damping:i.damping},parameters:{depthTest:!1,blend:!0,viewport:[0,0,1,1],blendFunc:[1,1],blendEquation:[32776,32776]}}),(0,T.DY)(t),this.attributeInTransition.setData({buffer:t[1],value:this.attribute.value}),(0,O.z6)(n)[0]>0||r.end(),!0}},{key:"cancel",value:function(){this.transition.cancel(),this.transform.delete();var t,e=(0,i.Z)(this.buffers);try{for(e.s();!(t=e.n()).done;){t.value.delete()}}catch(n){e.e(n)}finally{e.f()}this.buffers.length=0,this.texture.delete(),this.framebuffer.delete()}}]),t}()},U=function(){function t(e,n){var r=n.id,i=n.timeline;(0,o.Z)(this,t),(0,s.Z)(this,"id",void 0),(0,s.Z)(this,"isSupported",void 0),(0,s.Z)(this,"gl",void 0),(0,s.Z)(this,"timeline",void 0),(0,s.Z)(this,"transitions",void 0),(0,s.Z)(this,"needsRedraw",void 0),(0,s.Z)(this,"numInstances",void 0),this.id=r,this.gl=e,this.timeline=i,this.transitions={},this.needsRedraw=!1,this.numInstances=1,this.isSupported=P.Z.isSupported(e)}return(0,a.Z)(t,[{key:"finalize",value:function(){for(var t in this.transitions)this._removeTransition(t)}},{key:"update",value:function(t){var e=t.attributes,n=t.transitions,r=t.numInstances;for(var i in this.numInstances=r||1,e){var o=e[i],a=o.getTransitionSetting(n);a&&this._updateAttribute(i,o,a)}for(var s in this.transitions){var u=e[s];u&&u.getTransitionSetting(n)||this._removeTransition(s)}}},{key:"hasAttribute",value:function(t){var e=this.transitions[t];return e&&e.inProgress}},{key:"getAttributes",value:function(){var t={};for(var e in this.transitions){var n=this.transitions[e];n.inProgress&&(t[e]=n.attributeInTransition)}return t}},{key:"run",value:function(){if(!this.isSupported||0===this.numInstances)return!1;for(var t in this.transitions){this.transitions[t].update()&&(this.needsRedraw=!0)}var e=this.needsRedraw;return this.needsRedraw=!1,e}},{key:"_removeTransition",value:function(t){this.transitions[t].cancel(),delete this.transitions[t]}},{key:"_updateAttribute",value:function(t,e,n){var r=this.transitions[t],i=!r||r.type!==n.type;if(i){if(!this.isSupported)return void _.Z.warn("WebGL2 not supported by this browser. Transition for ".concat(t," is disabled."))();r&&this._removeTransition(t);var o=z[n.type];o?this.transitions[t]=new o({attribute:e,timeline:this.timeline,gl:this.gl}):(_.Z.error("unsupported transition type '".concat(n.type,"'"))(),i=!1)}(i||e.needsRedraw())&&(this.needsRedraw=!0,this.transitions[t].start(n,this.numInstances))}}]),t}(),N="attributeManager.invalidate",G=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}
2,r=n.id,i=void 0===r?"attribute-manager":r,a=n.stats,u=n.timeline;(0,o.Z)(this,t),(0,s.Z)(this,"id",void 0),(0,s.Z)(this,"gl",void 0),(0,s.Z)(this,"attributes",void 0),(0,s.Z)(this,"updateTriggers",void 0),(0,s.Z)(this,"needsRedraw",void 0),(0,s.Z)(this,"userData",void 0),(0,s.Z)(this,"stats",void 0),(0,s.Z)(this,"attributeTransitionManager",void 0),this.id=i,this.gl=e,this.attributes={},this.updateTriggers={},this.needsRedraw=!0,this.userData={},this.stats=a,this.attributeTransitionManager=new U(e,{id:"".concat(i,"-transitions"),timeline:u}),Object.seal(this)}return(0,a.Z)(t,[{key:"finalize",value:function(){for(var t in this.attributes)this.attributes[t].delete();this.attributeTransitionManager.finalize()}},{key:"getNeedsRedraw",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},e=this.needsRedraw;return this.needsRedraw=this.needsRedraw&&!t.clearRedrawFlags,e&&this.id}},{key:"setNeedsRedraw",value:function(){this.needsRedraw=!0}},{key:"add",value:function(t){this._add(t)}},{key:"addInstanced",value:function(t){this._add(t,{instanced:1})}},{key:"remove",value:function(t){var e,n=(0,i.Z)(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;void 0!==this.attributes[r]&&(this.attributes[r].delete(),delete this.attributes[r])}}catch(o){n.e(o)}finally{n.f()}}},{key:"invalidate",value:function(t,e){var n=this._invalidateTrigger(t,e);(0,I.Z)(N,this,t,n)}},{key:"invalidateAll",value:function(t){for(var e in this.attributes)this.attributes[e].setNeedsUpdate(e,t);(0,I.Z)(N,this,"all")}},{key:"update",value:function(t){var e=t.data,n=t.numInstances,r=t.startIndices,i=void 0===r?null:r,o=t.transitions,a=t.props,s=void 0===a?{}:a,u=t.buffers,l=void 0===u?{}:u,c=t.context,h=void 0===c?{}:c,f=!1;for(var p in(0,I.Z)("attributeManager.updateStart",this),this.stats&&this.stats.get("Update Attributes").timeStart(),this.attributes){var d=this.attributes[p],A=d.settings.accessor;d.startIndices=i,d.numInstances=n,s[p]&&_.Z.removed("props.".concat(p),"data.attributes.".concat(p))(),d.setExternalBuffer(l[p])||d.setBinaryValue("string"===typeof A?l[A]:void 0,e.startIndices)||"string"===typeof A&&!l[A]&&d.setConstantValue(s[A])||d.needsUpdate()&&(f=!0,this._updateAttribute({attribute:d,numInstances:n,data:e,props:s,context:h})),this.needsRedraw=this.needsRedraw||d.needsRedraw()}f&&(0,I.Z)("attributeManager.updateEnd",this,n),this.stats&&this.stats.get("Update Attributes").timeEnd(),this.attributeTransitionManager.update({attributes:this.attributes,numInstances:n,transitions:o})}},{key:"updateTransition",value:function(){var t=this.attributeTransitionManager.run();return this.needsRedraw=this.needsRedraw||t,t}},{key:"getAttributes",value:function(){return this.attributes}},{key:"getChangedAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearChangedFlags:!1},e=this.attributes,n=this.attributeTransitionManager,i=(0,r.Z)({},n.getAttributes());for(var o in e){var a=e[o];a.needsRedraw(t)&&!n.hasAttribute(o)&&(i[o]=a)}return i}},{key:"getShaderAttributes",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t||(t=this.getAttributes());var n={};for(var r in t)e[r]||Object.assign(n,t[r].getShaderAttributes());return n}},{key:"_add",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for(var n in t){var r=t[n];this.attributes[n]=this._createAttribute(n,r,e)}this._mapUpdateTriggersToAttributes()}},{key:"_createAttribute",value:function(t,e,n){var i=(0,r.Z)((0,r.Z)({},e),{},{id:t,size:(e.isIndexed?1:e.size)||1,divisor:n.instanced?1:e.divisor||0});return new M(this.gl,i)}},{key:"_mapUpdateTriggersToAttributes",value:function(){var t=this,e={},n=function(n){t.attributes[n].getUpdateTriggers().forEach((function(t){e[t]||(e[t]=[]),e[t].push(n)}))};for(var r in this.attributes)n(r);this.updateTriggers=e}},{key:"_invalidateTrigger",value:function(t,e){var n=this.attributes,r=this.updateTriggers[t];return r&&r.forEach((function(t){var r=n[t];r&&r.setNeedsUpdate(r.id,e)})),r}},{key:"_updateAttribute",value:function(t){var e=t.attribute,n=t.numInstances;((0,I.Z)("attribute.updateStart",e),e.constant)?e.setConstantValue(e.value):(e.allocate(n)&&(0,I.Z)("attribute.allocate",e,n),e.updateBuffer(t)&&(this.needsRedraw=!0,(0,I.Z)("attribute.updateEnd",e,n)))}}]),t}()},41894:function(t,e,n){"use strict";n.d(e,{DY:function(){return l},pi:function(){return c},w:function(){return u},AQ:function(){return s},M0:function(){return a},IV:function(){return h}});var r=n(50189);function i(t){var e=t.source,n=t.target,r=t.start,i=void 0===r?0:r,o=t.size,a=t.getData,s=t.end||n.length,u=e.length,l=s-i;if(u>l)n.set(e.subarray(0,l),i);else if(n.set(e,i),a)for(var c=u;c<l;)for(var h=a(c,e),f=0;f<o;f++)n[i+c]=h[f]||0,c++}var o={interpolation:{duration:0,easing:function(t){return t}},spring:{stiffness:.05,damping:.5}};function a(t,e){if(!t)return null;Number.isFinite(t)&&(t={type:"interpolation",duration:t});var n=t.type||"interpolation";return(0,r.Z)((0,r.Z)((0,r.Z)((0,r.Z)({},o[n]),e),t),{},{type:n})}function s(t,e){var n=e.getBuffer();return n?[n,{divisor:0,size:e.size,normalized:e.settings.normalized}]:e.value}function u(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){var n=t.doublePrecision,r=t.settings,i=t.value,o=t.size,a=n&&i instanceof Float64Array?2:1;return(r.noAlloc?i.length:e*o)*a}function h(t){var e=t.buffer,n=t.numInstances,r=t.attribute,o=t.fromLength,a=t.fromStartIndices,s=t.getData,u=void 0===s?function(t){return t}:s,l=r.doublePrecision&&r.value instanceof Float64Array?2:1,h=r.size*l,f=r.byteOffset,p=r.startIndices,d=a&&p,A=c(r,n),v=r.isConstant;if(d||!(o>=A)){var g=v?r.value:r.getBuffer().getData({srcByteOffset:f});if(r.settings.normalized&&!v){var m=u;u=function(t,e){return r.normalizeConstant(m(t,e))}}var y=v?function(t,e){return u(g,e)}:function(t,e){return u(g.subarray(t,t+h),e)},_=e.getData({length:o}),b=new Float32Array(A);!function(t){var e=t.source,n=t.target,r=t.size,o=t.getData,a=t.sourceStartIndices,s=t.targetStartIndices;if(!Array.isArray(s))return i({source:e,target:n,size:r,getData:o}),n;for(var u=0,l=0,c=o&&function(t,e){return o(t+l,e)},h=Math.min(a.length,s.length),f=1;f<h;f++){var p=a[f]*r,d=s[f]*r;i({source:e.subarray(u,p),target:n,start:l,end:d,size:r,getData:c}),u=p,l=d}l<n.length&&i({source:[],target:n,start:l,size:r,getData:c})}({source:_,target:b,sourceStartIndices:a,targetStartIndices:p,size:h,getData:y}),e.byteLength<b.byteLength+f&&e.reallocate(b.byteLength+f),e.subData({data:b,offset:f})}}},79366:function(t,e,n){"use strict";n.d(e,{Z:function(){return A}});var r=n(60726),i=n(50189),o=n(22951),a=n(91976),s=n(83138),u=n(27597),l=n(67591),c=n(94337),h=n(64649),f=n(90031),p=n(23427),d=n(18757),A=function(t){(0,l.Z)(n,t);var e=(0,c.Z)(n);function n(){return(0,o.Z)(this,n),e.apply(this,arguments)}return(0,a.Z)(n,[{key:"isComposite",get:function(){return!0}},{key:"isLoaded",get:function(){return(0,s.Z)((0,u.Z)(n.prototype),"isLoaded",this)&&this.get
2SubLayers().every((function(t){return t.isLoaded}))}},{key:"getSubLayers",value:function(){return this.internalState&&this.internalState.subLayers||[]}},{key:"initializeState",value:function(t){}},{key:"setState",value:function(t){(0,s.Z)((0,u.Z)(n.prototype),"setState",this).call(this,t),this.setNeedsUpdate()}},{key:"getPickingInfo",value:function(t){var e=t.info,n=e.object;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}},{key:"filterSubLayer",value:function(t){return!0}},{key:"shouldRenderSubLayer",value:function(t,e){return e&&e.length}},{key:"getSubLayerClass",value:function(t,e){var n=this.props._subLayerProps;return n&&n[t]&&n[t].type||e}},{key:"getSubLayerRow",value:function(t,e,n){return t.__source={parent:this,object:e,index:n},t}},{key:"getSubLayerAccessor",value:function(t){if("function"===typeof t){var e={index:-1,data:this.props.data,target:[]};return function(n,r){return n&&n.__source?(e.index=n.__source.index,t(n.__source.object,e)):t(n,r)}}return t}},{key:"getSubLayerProps",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.props,o=n.opacity,a=n.pickable,s=n.visible,u=n.parameters,l=n.getPolygonOffset,c=n.highlightedObjectIndex,h=n.autoHighlight,f=n.highlightColor,p=n.coordinateSystem,d=n.coordinateOrigin,A=n.wrapLongitude,v=n.positionFormat,g=n.modelMatrix,m=n.extensions,y=n.fetch,_=n.operation,b=n._subLayerProps,x={id:"",updateTriggers:{},opacity:o,pickable:a,visible:s,parameters:u,getPolygonOffset:l,highlightedObjectIndex:c,autoHighlight:h,highlightColor:f,coordinateSystem:p,coordinateOrigin:d,wrapLongitude:A,positionFormat:v,modelMatrix:g,extensions:m,fetch:y,operation:_},w=b&&e.id&&b[e.id],C=w&&w.updateTriggers,B=e.id||"sublayer";if(w){var k=this.constructor._propTypes,E=e.type?e.type._propTypes:{};for(var S in w){var T=E[S]||k[S];T&&"accessor"===T.type&&(w[S]=this.getSubLayerAccessor(w[S]))}}Object.assign(x,e,w),x.id="".concat(this.props.id,"-").concat(B),x.updateTriggers=(0,i.Z)((0,i.Z)({all:null===(t=this.props.updateTriggers)||void 0===t?void 0:t.all},e.updateTriggers),C);var M,I=(0,r.Z)(m);try{for(I.s();!(M=I.n()).done;){var P=M.value,Z=P.getSubLayerProps.call(this,P);Z&&Object.assign(x,Z,{updateTriggers:Object.assign(x.updateTriggers,Z.updateTriggers)})}}catch(D){I.e(D)}finally{I.f()}return x}},{key:"_updateAutoHighlight",value:function(t){var e,n=(0,r.Z)(this.getSubLayers());try{for(n.s();!(e=n.n()).done;){e.value.updateAutoHighlight(t)}}catch(i){n.e(i)}finally{n.f()}}},{key:"_getAttributeManager",value:function(){return null}},{key:"_postUpdate",value:function(t,e){var n=this.internalState.subLayers,i=!n||this.needsUpdate();if(i){var o=this.renderLayers();n=(0,d.x)(o,Boolean),this.internalState.subLayers=n}(0,p.Z)("compositeLayer.renderLayers",this,i,n);var a,s=(0,r.Z)(n);try{for(s.s();!(a=s.n()).done;){a.value.parent=this}}catch(u){s.e(u)}finally{s.f()}}}]),n}(f.Z);(0,h.Z)(A,"layerName","CompositeLayer")},18252:function(t,e,n){"use strict";n.d(e,{Df:function(){return i},FP:function(){return s},iI:function(){return a},k8:function(){return u},zG:function(){return o}});var r=n(21970),i={DEFAULT:-1,LNGLAT:1,METER_OFFSETS:2,LNGLAT_OFFSETS:3,CARTESIAN:0};Object.defineProperty(i,"IDENTITY",{get:function(){return r.Z.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")(),0}});var o={WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},a={common:0,meters:1,pixels:2},s={click:{handler:"onClick"},panstart:{handler:"onDragStart"},panmove:{handler:"onDrag"},panend:{handler:"onDragEnd"}},u={DRAW:"draw",MASK:"mask"}},90031:function(t,e,n){"use strict";n.d(e,{Z:function(){return _t}});var r=n(60726),i=n(11026),o=n(22951),a=n(91976),s=n(47169),u=n(67591),l=n(94337),c=n(50189),h=n(64649),f=n(18252),p=n(96684),d=n(41894),A=n(47410),v=n(99188),g=function(t){(0,u.Z)(n,t);var e=(0,l.Z)(n);function n(){return(0,o.Z)(this,n),e.apply(this,arguments)}return(0,a.Z)(n,[{key:"value",get:function(){return this._value}},{key:"_onUpdate",value:function(){var t=this.time,e=this.settings,n=e.fromValue,r=e.toValue,i=e.duration,o=(0,e.easing)(t/i);this._value=(0,A.t7)(n,r,o)}}]),n}(v.Z),m=1e-5;function y(t,e,n,r,i){var o=e-t;return(n-e)*i+-o*r+o+e}function _(t,e){if(Array.isArray(t)){for(var n=0,r=0;r<t.length;r++){var i=t[r]-e[r];n+=i*i}return Math.sqrt(n)}return Math.abs(t-e)}var b=function(t){(0,u.Z)(n,t);var e=(0,l.Z)(n);function n(){return(0,o.Z)(this,n),e.apply(this,arguments)}return(0,a.Z)(n,[{key:"value",get:function(){return this._currValue}},{key:"_onUpdate",value:function(){var t=this.settings,e=t.fromValue,n=t.toValue,r=t.damping,i=t.stiffness,o=this._prevValue,a=void 0===o?e:o,s=this._currValue,u=void 0===s?e:s,l=function(t,e,n,r,i){if(Array.isArray(n)){for(var o=[],a=0;a<n.length;a++)o[a]=y(t[a],e[a],n[a],r,i);return o}return y(t,e,n,r,i)}(a,u,n,r,i),c=_(l,n),h=_(l,u);c<m&&h<m&&(l=n,this.end()),this._prevValue=u,this._currValue=l}}]),n}(v.Z),x=n(21970),w={interpolation:g,spring:b},C=function(){function t(e){(0,o.Z)(this,t),this.transitions=new Map,this.timeline=e}return(0,a.Z)(t,[{key:"active",get:function(){return this.transitions.size>0}},{key:"add",value:function(t,e,n,r){var i=this.transitions;if(i.has(t)){var o=i.get(t),a=o.value;e=void 0===a?o.settings.fromValue:a,this.remove(t)}if(r=(0,d.M0)(r)){var s=w[r.type];if(s){var u=new s(this.timeline);u.start((0,c.Z)((0,c.Z)({},r),{},{fromValue:e,toValue:n})),i.set(t,u)}else x.Z.error("unsupported transition type '".concat(r.type,"'"))()}}},{key:"remove",value:function(t){var e=this.transitions;e.has(t)&&(e.get(t).cancel(),e.delete(t))}},{key:"update",value:function(){var t,e={},n=(0,r.Z)(this.transitions);try{for(n.s();!(t=n.n()).done;){var o=(0,i.Z)(t.value,2),a=o[0],s=o[1];s.update(),e[a]=s.value,s.inProgress||this.remove(a)}}catch(u){n.e(u)}finally{n.f()}return e}},{key:"clear",value:function(){var t,e=(0,r.Z)(this.transitions.keys());try{for(e.s();!(t=e.n()).done;){var n=t.value;this.remove(n)}}catch(i){e.e(i)}finally{e.f()}}}]),t}(),B=n(49473),k=n(48915);function E(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 S=n(23427),T=n(28007),M=n(12997),I=n(18188),P=n(46802),Z=n(70487),D=n(52310),L=n(62220),O=n(99007),F=n(75818);function R(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=e.projectPosition(t);
2if(n&&e instanceof D.Z){var o=(0,i.Z)(t,3),a=o[0],s=o[1],u=o[2],l=void 0===u?0:u,c=e.getDistanceScales([a,s]);r[2]=l*c.unitsPerMeter[2]}return r}function z(t,e){var n=e.viewport,r=e.modelMatrix,o=e.coordinateSystem,a=e.coordinateOrigin,s=e.offsetMode,u=(0,i.Z)(t,3),l=u[0],c=u[1],h=u[2],p=void 0===h?0:h;if(r){var d=L.fF([],[l,c,p,1],r),A=(0,i.Z)(d,3);l=A[0],c=A[1],p=A[2]}switch(o){case f.Df.LNGLAT:return R([l,c,p],n,s);case f.Df.LNGLAT_OFFSETS:return R([l+a[0],c+a[1],p+(a[2]||0)],n,s);case f.Df.METER_OFFSETS:return R((0,F.eG)(a,[l,c,p]),n,s);case f.Df.CARTESIAN:default:return n.isGeospatial?[l+a[0],c+a[1],p+a[2]]:n.projectPosition([l,c,p])}}function U(t,e){var n=function(t){var e=t.viewport,n=t.modelMatrix,r=t.coordinateOrigin,i=t.coordinateSystem,o=t.fromCoordinateSystem,a=t.fromCoordinateOrigin;return i===f.Df.DEFAULT&&(i=e.isGeospatial?f.Df.LNGLAT:f.Df.CARTESIAN),void 0===o&&(o=i),void 0===a&&(a=r),{viewport:e,coordinateSystem:i,coordinateOrigin:r,modelMatrix:n,fromCoordinateSystem:o,fromCoordinateOrigin:a}}(e),r=n.viewport,i=n.coordinateSystem,o=n.coordinateOrigin,a=n.modelMatrix,s=n.fromCoordinateSystem,u=n.fromCoordinateOrigin,l=(0,Z.v)(r,i,o),c=l.geospatialOrigin,h=l.shaderCoordinateOrigin,p=l.offsetMode,d=z(t,{viewport:r,modelMatrix:a,coordinateSystem:s,coordinateOrigin:u,offsetMode:p});if(p){var A=r.projectPosition(c||h);O.lu(d,d,A)}return d}var N,G=n(28321),j=n(73115),V=n(58300),H=(N={},(0,h.Z)(N,10241,9987),(0,h.Z)(N,10240,9729),(0,h.Z)(N,10242,33071),(0,h.Z)(N,10243,33071),N),J={};var W=n(98949),Q={boolean:{validate:function(t,e){return!0},equal:function(t,e,n){return Boolean(t)===Boolean(e)}},number:{validate:function(t,e){return Number.isFinite(t)&&(!("max"in e)||t<=e.max)&&(!("min"in e)||t>=e.min)}},color:{validate:function(t,e){return e.optional&&!t||Y(t)&&(3===t.length||4===t.length)},equal:function(t,e,n){return q(t,e)}},accessor:{validate:function(t,e){var n=$(t);return"function"===n||n===$(e.value)},equal:function(t,e,n){return"function"===typeof e||q(t,e)}},array:{validate:function(t,e){return e.optional&&!t||Y(t)},equal:function(t,e,n){return n.compare?q(t,e):t===e}},object:{equal:function(t,e,n){return n.compare?(0,W.v)(t,e):t===e}},function:{validate:function(t,e){return e.optional&&!t||"function"===typeof t},equal:function(t,e,n){return!n.compare||t===e}},data:{transform:function(t,e,n){var r=n.props.dataTransform;return r&&t?r(t):t}},image:{transform:function(t,e,n){return function(t,e){var n=t.context&&t.context.gl;if(!n||!e)return null;if(e instanceof V.Z)return e;e.constructor&&"Object"!==e.constructor.name&&(e={data:e});var r=null;e.compressed&&(r=(0,h.Z)({},10241,e.data.length>1?9985:9729));var i=new V.Z(n,(0,c.Z)((0,c.Z)({},e),{},{parameters:(0,c.Z)((0,c.Z)((0,c.Z)({},H),r),t.props.textureParameters)}));return J[i.id]=!0,i}(n,t)},release:function(t){var e;(e=t)&&e instanceof V.Z&&J[e.id]&&(e.delete(),delete J[e.id])}}};function q(t,e){if(t===e)return!0;if(!Y(t)||!Y(e))return!1;var n=t.length;if(n!==e.length)return!1;for(var r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}function K(t,e){switch($(e)){case"object":return X(t,e);case"array":return X(t,{type:"array",value:e,compare:!1});case"boolean":return X(t,{type:"boolean",value:e});case"number":return X(t,{type:"number",value:e});case"function":return X(t,{type:"function",value:e,compare:!0});default:return{name:t,type:"unknown",value:e}}}function X(t,e){return"type"in e?(0,c.Z)((0,c.Z)({name:t},Q[e.type]),e):"value"in e?(0,c.Z)({name:t,type:$(e.value)},e):{name:t,type:"object",value:e}}function Y(t){return Array.isArray(t)||ArrayBuffer.isView(t)}function $(t){return Y(t)?"array":null===t?"null":typeof t}function tt(t){var e=rt(t,"_mergedDefaultProps");return e||(function(t){var e=t.prototype;if(!e)return;var n=Object.getPrototypeOf(t),o=tt(n),a=rt(t,"defaultProps")||{},s=function(t){for(var e={},n={},r={},o=0,a=Object.entries(t);o<a.length;o++){var s=(0,i.Z)(a[o],2),u=s[0],l=s[1],c=null===l||void 0===l?void 0:l.deprecatedFor;if(c)r[u]=Array.isArray(c)?c:[c];else{var h=K(u,l);e[u]=h,n[u]=h.value}}return{propTypes:e,defaultProps:n,deprecatedProps:r}}(a),u=function(t,e,n){var r=Object.create(null);Object.assign(r,e,t);var i=function(t){var e=rt(t,"layerName")||rt(t,"componentName");e||x.Z.once(0,"".concat(t.name,".componentName not specified"))();return e||t.name}(n);return delete t.id,Object.defineProperties(r,{id:{writable:!0,value:i}}),r}(s.defaultProps,o,t),l=(0,c.Z)((0,c.Z)({},n._propTypes),s.propTypes);!function(t,e){var n={},r={};for(var i in e){var o=e[i],a=o.name,s=o.value;o.async&&(n[a]=s,r[a]=et(a))}t[k.lY]=n,t[k.fO]={},Object.defineProperties(t,r)}(u,l);var h=(0,c.Z)((0,c.Z)({},n._deprecatedProps),s.deprecatedProps);(function(t,e){var n=function(n){Object.defineProperty(t,n,{enumerable:!1,set:function(t){var i,o="".concat(this.id,": ").concat(n),a=(0,r.Z)(e[n]);try{for(a.s();!(i=a.n()).done;){var s=i.value;nt(this,s)||(this[s]=t)}}catch(u){a.e(u)}finally{a.f()}x.Z.deprecated(o,e[n].join("/"))()}})};for(var i in e)n(i)})(u,h),t._mergedDefaultProps=u,t._propTypes=l,t._deprecatedProps=h}(t),t._mergedDefaultProps)}function et(t){return{enumerable:!0,set:function(e){"string"===typeof e||e instanceof Promise||(0,j.D0)(e)?this[k.fO][t]=e:this[k.bN][t]=e}
2,get:function(){if(this[k.bN]){if(t in this[k.bN])return this[k.bN][t]||this[k.lY][t];if(t in this[k.fO]){var e=this[k.fm]&&this[k.fm].internalState;if(e&&e.hasAsyncProp(t))return e.getAsyncProp(t)||this[k.lY][t]}}return this[k.lY][t]}}}function nt(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function rt(t,e){return nt(t,e)&&t[e]}var it=0,ot=function(){function t(){(0,o.Z)(this,t),(0,h.Z)(this,"id",void 0),(0,h.Z)(this,"props",void 0),(0,h.Z)(this,"count",void 0);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.props=function(t,e){var n=tt(t.constructor),r=Object.create(n);r[k.fm]=t,r[k.fO]={},r[k.bN]={};for(var i=0;i<e.length;++i){var o=e[i];for(var a in o)r[a]=o[a]}return Object.freeze(r),r}(this,n),this.id=this.props.id,this.count=it++}return(0,a.Z)(t,[{key:"clone",value:function(t){var e=this.props,n={};for(var r in e[k.lY])r in e[k.bN]?n[r]=e[k.bN][r]:r in e[k.fO]&&(n[r]=e[k.fO][r]);return new this.constructor((0,c.Z)((0,c.Z)((0,c.Z)({},e),n),t))}}]),t}();(0,h.Z)(ot,"componentName","Component"),(0,h.Z)(ot,"defaultProps",{});var at=n(83138),st=n(27597),ut=n(11092),lt=n(27791),ct=n(187),ht=Object.freeze({}),ft=function(){function t(e){(0,o.Z)(this,t),(0,h.Z)(this,"component",void 0),(0,h.Z)(this,"onAsyncPropUpdated",void 0),(0,h.Z)(this,"asyncProps",void 0),(0,h.Z)(this,"oldProps",void 0),(0,h.Z)(this,"oldAsyncProps",void 0),this.component=e,this.asyncProps={},this.onAsyncPropUpdated=function(){},this.oldProps=null,this.oldAsyncProps=null}return(0,a.Z)(t,[{key:"finalize",value:function(){for(var t in this.asyncProps){var e=this.asyncProps[t];e&&e.type&&e.type.release&&e.type.release(e.resolvedValue,e.type,this.component)}}},{key:"getOldProps",value:function(){return this.oldAsyncProps||this.oldProps||ht}},{key:"resetOldProps",value:function(){this.oldAsyncProps=null,this.oldProps=this.component.props}},{key:"hasAsyncProp",value:function(t){return t in this.asyncProps}},{key:"getAsyncProp",value:function(t){var e=this.asyncProps[t];return e&&e.resolvedValue}},{key:"isAsyncPropLoading",value:function(t){if(t){var e=this.asyncProps[t];return Boolean(e&&e.pendingLoadCount>0&&e.pendingLoadCount!==e.resolvedLoadCount)}for(var n in this.asyncProps)if(this.isAsyncPropLoading(n))return!0;return!1}},{key:"reloadAsyncProp",value:function(t,e){this._watchPromise(t,Promise.resolve(e))}},{key:"setAsyncProps",value:function(t){var e=t[k.bN]||{},n=t[k.fO]||t,r=t[k.lY]||{};for(var i in e){var o=e[i];this._createAsyncPropData(i,r[i]),this._updateAsyncProp(i,o),e[i]=this.getAsyncProp(i)}for(var a in n){var s=n[a];this._createAsyncPropData(a,r[a]),this._updateAsyncProp(a,s)}}},{key:"_fetch",value:function(t,e){return null}},{key:"_onResolve",value:function(t,e){}},{key:"_onError",value:function(t,e){}},{key:"_updateAsyncProp",value:function(t,e){this._didAsyncInputValueChange(t,e)&&("string"===typeof e&&(e=this._fetch(t,e)),e instanceof Promise?this._watchPromise(t,e):(0,j.D0)(e)?this._resolveAsyncIterable(t,e):this._setPropValue(t,e))}},{key:"_freezeAsyncOldProps",value:function(){if(!this.oldAsyncProps&&this.oldProps)for(var t in this.oldAsyncProps=Object.create(this.oldProps),this.asyncProps)Object.defineProperty(this.oldAsyncProps,t,{enumerable:!0,value:this.oldProps[t]})}},{key:"_didAsyncInputValueChange",value:function(t,e){var n=this.asyncProps[t];return e!==n.resolvedValue&&e!==n.lastValue&&(n.lastValue=e,!0)}},{key:"_setPropValue",value:function(t,e){this._freezeAsyncOldProps();var n=this.asyncProps[t];n&&(e=this._postProcessValue(n,e),n.resolvedValue=e,n.pendingLoadCount++,n.resolvedLoadCount=n.pendingLoadCount)}},{key:"_setAsyncPropValue",value:function(t,e,n){var r=this.asyncProps[t];r&&n>=r.resolvedLoadCount&&void 0!==e&&(this._freezeAsyncOldProps(),r.resolvedValue=e,r.resolvedLoadCount=n,this.onAsyncPropUpdated(t,e))}},{key:"_watchPromise",value:function(t,e){var n=this,r=this.asyncProps[t];if(r){r.pendingLoadCount++;var i=r.pendingLoadCount;e.then((function(e){e=n._postProcessValue(r,e),n._setAsyncPropValue(t,e,i),n._onResolve(t,e)})).catch((function(e){n._onError(t,e)}))}}},{key:"_resolveAsyncIterable",value:function(){var t=(0,lt.Z)((0,ut.Z)().mark((function t(e,n){var r,i,o,a,s,u,l,c,h,f,p;return(0,ut.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("data"===e){t.next=3;break}return this._setPropValue(e,n),t.abrupt("return");case 3:if(r=this.asyncProps[e]){t.next=6;break}return t.abrupt("return");
2case 6:r.pendingLoadCount++,i=r.pendingLoadCount,o=[],a=0,s=!1,u=!1,t.prev=12,c=(0,ct.Z)(n);case 14:return t.next=16,c.next();case 16:if(!(s=!(h=t.sent).done)){t.next=26;break}f=h.value,p=this.component.props.dataTransform,o=p?p(f,o):o.concat(f),Object.defineProperty(o,"__diff",{enumerable:!1,value:[{startRow:a,endRow:o.length}]}),a=o.length,this._setAsyncPropValue(e,o,i);case 23:s=!1,t.next=14;break;case 26:t.next=32;break;case 28:t.prev=28,t.t0=t.catch(12),u=!0,l=t.t0;case 32:if(t.prev=32,t.prev=33,!s||null==c.return){t.next=37;break}return t.next=37,c.return();case 37:if(t.prev=37,!u){t.next=40;break}throw l;case 40:return t.finish(37);case 41:return t.finish(32);case 42:this._onResolve(e,o);case 43:case"end":return t.stop()}}),t,this,[[12,28,32,42],[33,,37,41]])})));return function(e,n){return t.apply(this,arguments)}}()},{key:"_postProcessValue",value:function(t,e){var n=t.type;return n&&(n.release&&n.release(t.resolvedValue,n,this.component),n.transform)?n.transform(e,n,this.component):e}},{key:"_createAsyncPropData",value:function(t,e){if(!this.asyncProps[t]){var n=this.component&&this.component.constructor._propTypes;this.asyncProps[t]={type:n&&n[t],lastValue:null,resolvedValue:e,pendingLoadCount:0,resolvedLoadCount:0}}}}]),t}(),pt=function(t){(0,u.Z)(n,t);var e=(0,l.Z)(n);function n(t){var r,i=t.attributeManager,a=t.layer;return(0,o.Z)(this,n),r=e.call(this,a),(0,h.Z)((0,s.Z)(r),"attributeManager",void 0),(0,h.Z)((0,s.Z)(r),"needsRedraw",void 0),(0,h.Z)((0,s.Z)(r),"needsUpdate",void 0),(0,h.Z)((0,s.Z)(r),"subLayers",void 0),(0,h.Z)((0,s.Z)(r),"usesPickingColorCache",void 0),(0,h.Z)((0,s.Z)(r),"changeFlags",void 0),(0,h.Z)((0,s.Z)(r),"viewport",void 0),(0,h.Z)((0,s.Z)(r),"uniformTransitions",void 0),(0,h.Z)((0,s.Z)(r),"propsInTransition",void 0),r.attributeManager=i,r.needsRedraw=!0,r.needsUpdate=!0,r.subLayers=null,r.usesPickingColorCache=!1,r}return(0,a.Z)(n,[{key:"layer",get:function(){return this.component},set:function(t){this.component=t}},{key:"_fetch",value:function(t,e){var r=this.component.props.fetch;return r?r(e,{propName:t,layer:this.layer}):(0,at.Z)((0,st.Z)(n.prototype),"_fetch",this).call(this,t,e)}},{key:"_onResolve",value:function(t,e){var n=this.component.props.onDataLoad;"data"===t&&n&&n(e,{propName:t,layer:this.layer})}},{key:"_onError",value:function(t,e){this.layer.raiseError(e,"loading ".concat(t," of ").concat(this.layer))}}]),n}(ft),dt=n(3685),At=Math.pow(2,24)-1,vt=Object.freeze([]),gt=(0,I.Z)((function(t){var e=t.oldViewport,n=t.viewport;return e.equals(n)})),mt=new Uint8ClampedArray(0),yt={data:{type:"data",value:vt,async:!0},dataComparator:{type:"function",value:null,compare:!1,optional:!0},_dataDiff:{type:"function",value:function(t){return t&&t.__diff},compare:!1,optional:!0},dataTransform:{type:"function",value:null,compare:!1,optional:!0},onDataLoad:{type:"function",value:null,compare:!1,optional:!0},onError:{type:"function",value:null,compare:!1,optional:!0},fetch:{type:"function",value:function(t,e){var n,r=e.propName,i=e.layer,o=e.loaders,a=e.loadOptions,s=e.signal,u=i.context.resourceManager;(a=a||i.getLoadOptions(),o=o||i.props.loaders,s)&&(a=(0,c.Z)((0,c.Z)({},a),{},{fetch:(0,c.Z)((0,c.Z)({},null===(n=a)||void 0===n?void 0:n.fetch),{},{signal:s})}));var l=u.contains(t);return l||a||(u.add({resourceId:t,data:(0,dt.z)(t,o),persistent:!1}),l=!0),l?u.subscribe({resourceId:t,onChange:function(t){var e;return null===(e=i.internalState)||void 0===e?void 0:e.reloadAsyncProp(r,t)},consumerId:i.id,requestId:r}):(0,dt.z)(t,o,a)},compare:!1},updateTriggers:{},visible:!0,pickable:!1,opacity:{type:"number",min:0,max:1,value:1},operation:f.k8.DRAW,onHover:{type:"function",value:null,compare:!1,optional:!0},onClick:{type:"function",value:null,compare:!1,optional:!0},onDragStart:{type:"function",value:null,compare:!1,optional:!0},onDrag:{type:"function",value:null,compare:!1,optional:!0},onDragEnd:{type:"function",value:null,compare:!1,optional:!0},coordinateSystem:f.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:!0},transitions:null,extensions:[],loaders:{type:"array",value:[],optional:!0,compare:!0},getPolygonOffset:{type:"function",value:function(t){return[0,100*-t.layerIndex]},compare:!1},highlightedObjectIndex:null,autoHighlight:!1,highlightColor:{type:"accessor",value:[0,0,128,128]}},_t=function(t){(0,u.Z)(n,t);var e=(0,l.Z)(n);function n(){var t;(0,o.Z)(this,n);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return t=e.call.apply(e,[this].concat(i)),(0,h.Z)((0,s.Z)(t),"internalState",null),(0,h.Z)((0,s.Z)(t),"lifecycle",k.dt.NO_STATE),(0,h.Z)((0,s.Z)(t),"context",void 0),(0,h.Z)((0,s.Z)(t),"state",void 0),(0,h.Z)((0,s.Z)(t),"parent",null),t}return(0,a.Z)(n,[{key:"root",get:function(){for(var t=this;t.parent;)t=t.parent;return t}},{key:"toString",value:function(){var t=this.constructor.layerName||this.constructor.name;return"".concat(t,"({id: '").concat(this.props.id,"'})")}},{key:"project",value:function(t){(0,M.Z)(this.internalState);var e=this.internalState.viewport||this.context.viewport,n=z(t,{viewport:e,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),r=(0,F.aW)(n,e.pixelProjectionMatrix),o=(0,i.Z)(r,3),a=o[0],s=o[1],u=o[2];return 2===t.length?[a,s]:[a,s,u]}},{key:"unproject",value:function(t){return(0,M.Z)(this.internalState),(this.internalState.viewport||this.context.viewport).unproject(t)}},{key:"projectPosition",value:function(t,e){(0,M.Z)(this.internalState);var n=this.internalState.viewport||this.context.viewport;return U(t,(0,c.Z)({viewport:n,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem},e))}},{key:"isComposite",get:function(){return!1}},{key:"setState",value:function(t){this.setChangeFlags({stateChanged:!0}),Object.assign(this.state,t),this.setNeedsRedraw()}},{key:"setNeedsRedraw",value:function(){this.internalState&&(this.internalState.needsRedraw=!0)}},{key:"setNeedsUpdate",value:function(){this.internalState&&(this.context.layerManager.setNeedsUpdate(String(this)),this.internalState.needsUpdate=!0)}},{key:"isLoaded",get:function(){return!!this.internalState&&!this.internalState.isAsyncPropLoading()}},{key:"wrapLongitude",get:function(){return this.props.wrapLongitude}},{key:"isPickable",value:function(){return this.props.pickable&&this.props.visible}},{key:"getModels",value:function(){return this.state&&(this.state.models||this.state.model&&[this.state.model])||[]}},{key:"setModuleParameters",value:function(t){var e,n=(0,r.Z)(this.getModels());try{for(n.s();!(e=n.n()).done;){e.value.updateModuleSettings(t)}}catch(i){n.e(i)}finally{n.f()}}},{key:"getAttributeManager",value:function(){return this.internalState&&this.internalState.attributeManager}},{key:"getCurrentLayer",value:function(){return this.internalState&&this.internalState.layer}},{key:"getLoadOptions",value:function(){return this.props.loadOptions}},{key:"use64bitPositions",value:function(){var t=this.props.coordinateSystem;return t===f.Df.DEFAULT||t===f.Df.LNGLAT||t===f.Df.CARTESIAN}},{key:"onHover",value:function(t,e){return this.props.onHover&&this.props.onHover(t,e)||!1}},{key:"onClick",value:function(t,e){return this.props.onClick&&this.props.onClick(t,e)||!1}},{key:"nullPickingColor",value:function(){return[0,0,0]}},{key:"encodePickingColor",value:function(t){var 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}},{key:"decodePickingColor",value:function(t){(0,M.Z)(t instanceof Uint8Array);var e=(0,i.Z)(t,3);return e[0]+256*e[1]+65536*e[2]-1}},{key:"getNumInstances",value:function(){return Number.isFinite(this.props.numInstances)?this.props.numInstances:this.state&&void 0!==this.state.numInstances?this.state.numInstances:E(this.props.data)}},{key:"getStartIndices",value:function(){return this.props.startIndices?this.props.startIndices:this.state&&this.state.startIndices?this.state.startIndices:null}},{key:"getBounds",value:function(){var t,e=this.getAttributeManager();if(!e)return null;var n=e.attributes,r=n.positions,i=n.instancePositions;return null===(t=r||i)||void 0===t?void 0:t.getBounds()}},{key:"getShaders",value:function(t){var e,n=(0,r.Z)(this.props.extensions);try{for(n.s();!(e=n.n()).done;){var i=e.value;t=(0,P.l)(t,i.getShaders.call(this,i))}}catch(o){n.e(o)}finally{n.f()}return t}},{key:"shouldUpdateState",value:function(t){return t.changeFlags.propsOrDataChanged}},{key:"updateState",value:function(t){var e=this.getAttributeManager(),n=t.changeFlags.dataChanged;if(n&&e)if(Array.isArray(n)){var i,o=(0,r.Z)(n);try{for(o.s();!(i=o.n()).done;){var a=i.value;
2e.invalidateAll(a)}}catch(A){o.e(A)}finally{o.f()}}else e.invalidateAll();var s=t.props,u=t.oldProps,l=Number.isInteger(u.highlightedObjectIndex)||u.pickable,c=Number.isInteger(s.highlightedObjectIndex)||s.pickable;if(l!==c&&e){var h=e.attributes,f=h.pickingColors,p=h.instancePickingColors,d=f||p;d&&(c&&d.constant&&(d.constant=!1,e.invalidate(d.id)),d.value||c||(d.constant=!0,d.value=[0,0,0]))}}},{key:"finalizeState",value:function(t){var e,n=(0,r.Z)(this.getModels());try{for(n.s();!(e=n.n()).done;){e.value.delete()}}catch(o){n.e(o)}finally{n.f()}var i=this.getAttributeManager();i&&i.finalize(),this.context&&this.context.resourceManager.unsubscribe({consumerId:this.id}),this.internalState&&(this.internalState.uniformTransitions.clear(),this.internalState.finalize())}},{key:"draw",value:function(t){var e,n=(0,r.Z)(this.getModels());try{for(n.s();!(e=n.n()).done;){e.value.draw(t)}}catch(i){n.e(i)}finally{n.f()}}},{key:"getPickingInfo",value:function(t){var e=t.info,n=(t.mode,t.sourceLayer,e.index);return n>=0&&Array.isArray(this.props.data)&&(e.object=this.props.data[n]),e}},{key:"raiseError",value:function(t,e){var n,r,i,o;(e&&(t.message="".concat(e,": ").concat(t.message)),null!==(n=(r=this.props).onError)&&void 0!==n&&n.call(r,t))||(null===(i=this.context)||void 0===i||null===(o=i.onError)||void 0===o||o.call(i,t,this))}},{key:"getNeedsRedraw",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};return this._getNeedsRedraw(t)}},{key:"needsUpdate",value:function(){return!!this.internalState&&(this.internalState.needsUpdate||this.hasUniformTransition()||this.shouldUpdateState(this._getUpdateParams()))}},{key:"hasUniformTransition",value:function(){var t;return(null===(t=this.internalState)||void 0===t?void 0:t.uniformTransitions.active)||!1}},{key:"activateViewport",value:function(t){if(this.internalState){var e=this.internalState.viewport;this.internalState.viewport=t,e&&gt({oldViewport:e,viewport:t})||(this.setChangeFlags({viewportChanged:!0}),this.isComposite?this.needsUpdate()&&this.setNeedsUpdate():this._update())}}},{key:"invalidateAttribute",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all",e=this.getAttributeManager();e&&("all"===t?e.invalidateAll():e.invalidate(t))}},{key:"updateAttributes",value:function(t){var e,n=(0,r.Z)(this.getModels());try{for(n.s();!(e=n.n()).done;){var i=e.value;this._setModelAttributes(i,t)}}catch(o){n.e(o)}finally{n.f()}}},{key:"_updateAttributes",value:function(){var t=this.getAttributeManager();if(t){var e=this.props,n=this.getNumInstances(),r=this.getStartIndices();t.update({data:e.data,numInstances:n,startIndices:r,props:e,transitions:e.transitions,buffers:e.data.attributes,context:this});var i=t.getChangedAttributes({clearChangedFlags:!0});this.updateAttributes(i)}}},{key:"_updateAttributeTransition",value:function(){var t=this.getAttributeManager();t&&t.updateTransition()}},{key:"_updateUniformTransition",value:function(){var t=this.internalState.uniformTransitions;if(t.active){var e=t.update(),n=Object.create(this.props);for(var r in e)Object.defineProperty(n,r,{value:e[r]});return n}return this.props}},{key:"calculateInstancePickingColors",value:function(t,e){var n=e.numInstances;if(!t.constant){var r=Math.floor(mt.length/3);if(this.internalState.usesPickingColorCache=!0,r<n){n>At&&x.Z.warn("Layer has too many data objects. Picking might not be able to distinguish all objects.")(),mt=G.Z.allocate(mt,n,{size:3,copy:!0,maxCount:Math.max(n,At)});for(var i=Math.floor(mt.length/3),o=[],a=r;a<i;a++)this.encodePickingColor(a,o),mt[3*a+0]=o[0],mt[3*a+1]=o[1],mt[3*a+2]=o[2]}t.value=mt.subarray(0,3*n)}}},{key:"_setModelAttributes",value:function(t,e){var n=this.getAttributeManager(),r=t.userData.excludeAttributes||{},i=n.getShaderAttributes(e,r);t.setAttributes(i)}},{key:"disablePickingIndex",value:function(t){this._disablePickingIndex(t)}},{key:"_disablePickingIndex",value:function(t){var e=this.getAttributeManager().attributes,n=e.pickingColors,r=e.instancePickingColors,i=n||r;if(i){var o=i.getVertexOffset(t),a=i.getVertexOffset(t+1);i.buffer.subData({data:new Uint8Array(a-o),offset:o})}}},{key:"restorePickingColors",value:function(){var t=this.getAttributeManager().attributes,e=t.pickingColors,n=t.instancePickingColors,r=e||n;r&&(this.internalState.usesPickingColorCache&&r.value.buffer!==mt.buffer&&(r.value=mt.subarray(0,r.value.length)),r.updateSubBuffer({startOffset:0}))}},{key:"_initialize",value:function(){(0,M.Z)(!this.internalState),(0,M.Z)(Number.isFinite(this.props.coordinateSystem)),(0,S.Z)("layer.initialize",this);var t=this._getAttributeManager();t&&t.addInstanced({instancePickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateInstancePickingColors}}),this.internalState=new pt({attributeManager:t,layer:this}),this._clearChangeFlags(),this.state={},Object.defineProperty(this.state,"attributeManager",{get:function(){return x.Z.deprecated("layer.state.attributeManager","layer.getAttributeManager()")(),t}}),this.internalState.layer=this,this.internalState.uniformTransitions=new C(this.context.timeline),this.internalState.onAsyncPropUpdated=this._onAsyncPropUpdated.bind(this),this.internalState.setAsyncProps(this.props),this.initializeState(this.context);var e,n=(0,r.Z)(this.props.extensions);try{for(n.s();!(e=n.n()).done;){var i=e.value;i.initializeState.call(this,this.context,i)}}catch(o){n.e(o)}finally{n.f()}this.setChangeFlags({dataChanged:"init",propsChanged:"init",viewportChanged:!0,extensionsChanged:!0}),this._update()}},{key:"_transferState",value:function(t){(0,S.Z)("layer.matched",this,this===t);
2var e=t.state,n=t.internalState;this!==t&&(this.internalState=n,this.internalState.layer=this,this.state=e,this.internalState.setAsyncProps(this.props),this._diffProps(this.props,this.internalState.getOldProps()))}},{key:"_update",value:function(){var t=this.needsUpdate();if((0,S.Z)("layer.update",this,t),t){var e=this.props,n=this.context,i=this.internalState,o=n.viewport,a=this._updateUniformTransition();i.propsInTransition=a,n.viewport=i.viewport||o,this.props=a;try{var s=this._getUpdateParams(),u=this.getModels();if(n.gl)this.updateState(s);else try{this.updateState(s)}catch(p){}var l,c=(0,r.Z)(this.props.extensions);try{for(c.s();!(l=c.n()).done;){var h=l.value;h.updateState.call(this,s,h)}}catch(d){c.e(d)}finally{c.f()}var f=this.getModels()[0]!==u[0];this._postUpdate(s,f)}finally{n.viewport=o,this.props=e,this._clearChangeFlags(),i.needsUpdate=!1,i.resetOldProps()}}}},{key:"_finalize",value:function(){(0,S.Z)("layer.finalize",this),this.finalizeState(this.context);var t,e=(0,r.Z)(this.props.extensions);try{for(e.s();!(t=e.n()).done;){var n=t.value;n.finalizeState.call(this,n)}}catch(i){e.e(i)}finally{e.f()}}},{key:"_drawLayer",value:function(t){var e=this,n=t.moduleParameters,i=void 0===n?null:n,o=t.uniforms,a=void 0===o?{}:o,s=t.parameters,u=void 0===s?{}:s;this._updateAttributeTransition();var l=this.props,c=this.context;this.props=this.internalState.propsInTransition||l;var h=this.props.opacity;a.opacity=Math.pow(h,1/2.2);try{i&&this.setModuleParameters(i);var f=this.props.getPolygonOffset,p=f&&f(a)||[0,0];(0,T.dR)(c.gl,{polygonOffset:p}),(0,T.s8)(c.gl,u,(function(){var t,n={moduleParameters:i,uniforms:a,parameters:u,context:c},o=(0,r.Z)(e.props.extensions);try{for(o.s();!(t=o.n()).done;){var s=t.value;s.draw.call(e,n,s)}}catch(l){o.e(l)}finally{o.f()}e.draw(n)}))}finally{this.props=l}}},{key:"getChangeFlags",value:function(){var t;return null===(t=this.internalState)||void 0===t?void 0:t.changeFlags}},{key:"setChangeFlags",value:function(t){if(this.internalState){var e=this.internalState.changeFlags;for(var n in t)if(t[n]){var r=!1;if("dataChanged"===n){var i=t[n],o=e[n];i&&Array.isArray(o)&&(e.dataChanged=Array.isArray(i)?o.concat(i):i,r=!0)}e[n]||(e[n]=t[n],r=!0),r&&(0,S.Z)("layer.changeFlag",this,n,t)}var a=Boolean(e.dataChanged||e.updateTriggersChanged||e.propsChanged||e.extensionsChanged);e.propsOrDataChanged=a,e.somethingChanged=a||e.viewportChanged||e.stateChanged}}},{key:"_clearChangeFlags",value:function(){this.internalState.changeFlags={dataChanged:!1,propsChanged:!1,updateTriggersChanged:!1,viewportChanged:!1,stateChanged:!1,extensionsChanged:!1,propsOrDataChanged:!1,somethingChanged:!1}}},{key:"_diffProps",value:function(t,e){var n=(0,B.Yt)(t,e);if(n.updateTriggersChanged)for(var r in n.updateTriggersChanged)n.updateTriggersChanged[r]&&this.invalidateAttribute(r);if(n.transitionsChanged)for(var i in n.transitionsChanged){var o;this.internalState.uniformTransitions.add(i,e[i],t[i],null===(o=t.transitions)||void 0===o?void 0:o[i])}return this.setChangeFlags(n)}},{key:"validateProps",value:function(){(0,B.eQ)(this.props)}},{key:"updateAutoHighlight",value:function(t){this.props.autoHighlight&&!Number.isInteger(this.props.highlightedObjectIndex)&&this._updateAutoHighlight(t)}},{key:"_updateAutoHighlight",value:function(t){var e={pickingSelectedColor:t.picked?t.color:null},n=this.props.highlightColor;t.picked&&"function"===typeof n&&(e.pickingHighlightColor=n(t)),this.setModuleParameters(e),this.setNeedsRedraw()}},{key:"_getAttributeManager",value:function(){var t=this.context;return new p.Z(t.gl,{id:this.props.id,stats:t.stats,timeline:t.timeline})}},{key:"_postUpdate",value:function(t,e){var n=t.props,r=t.oldProps;this.setNeedsRedraw(),this._updateAttributes();var i=this.state.model;null===i||void 0===i||i.setInstanceCount(this.getNumInstances());var o=n.autoHighlight,a=n.highlightedObjectIndex,s=n.highlightColor;if(e||r.autoHighlight!==o||r.highlightedObjectIndex!==a||r.highlightColor!==s){var u={};o||(u.pickingSelectedColor=null),Array.isArray(s)&&(u.pickingHighlightColor=s),(e||a!==r.highlightedObjectIndex)&&(u.pickingSelectedColor=Number.isFinite(a)&&a>=0?this.encodePickingColor(a):null),this.setModuleParameters(u)}}}
2,{key:"_getUpdateParams",value:function(){return{props:this.props,oldProps:this.internalState.getOldProps(),context:this.context,changeFlags:this.internalState.changeFlags}}},{key:"_getNeedsRedraw",value:function(t){if(!this.internalState)return!1;var e=!1;e=e||this.internalState.needsRedraw&&this.id,this.internalState.needsRedraw=this.internalState.needsRedraw&&!t.clearRedrawFlags;var n=this.getAttributeManager(),r=!!n&&n.getNeedsRedraw(t);return e=e||r}},{key:"_onAsyncPropUpdated",value:function(){this._diffProps(this.props,this.internalState.getOldProps()),this.setNeedsUpdate()}}]),n}(ot);(0,h.Z)(_t,"defaultProps",yt),(0,h.Z)(_t,"layerName","Layer")},48915:function(t,e,n){"use strict";n.d(e,{bN:function(){return s},dt:function(){return r},fO:function(){return a},fm:function(){return i},lY:function(){return o}});var r={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"},i=Symbol.for("component"),o=Symbol.for("asyncPropDefaults"),a=Symbol.for("asyncPropOriginal"),s=Symbol.for("asyncPropResolved")},49473:function(t,e,n){"use strict";n.d(e,{Yt:function(){return o},eQ:function(){return i},tg:function(){return s}});var r=n(48915);function i(t){var e=h(t);for(var n in e){var r=e[n],i=r.validate;if(i&&!i(t[n],r))throw new Error("Invalid prop ".concat(n,": ").concat(t[n]))}}function o(t,e){var n=s({newProps:t,oldProps:e,propTypes:h(t),ignoreProps:{data:null,updateTriggers:null,extensions:null,transitions:null}}),r=function(t,e){if(null===e)return"oldProps is null, initial diff";var n=!1,r=t.dataComparator,i=t._dataDiff;r?r(t.data,e.data)||(n="Data comparator detected a change"):t.data!==e.data&&(n="A new data container was supplied");n&&i&&(n=i(t.data,e.data)||n);return n}(t,e),i=!1;return r||(i=function(t,e){if(null===e)return{all:!0};if("all"in t.updateTriggers){if(c(t,e,"all"))return{all:!0}}var n={},r=!1;for(var i in t.updateTriggers){if("all"!==i)c(t,e,i)&&(n[i]=!0,r=!0)}return!!r&&n}(t,e)),{dataChanged:r,propsChanged:n,updateTriggersChanged:i,extensionsChanged:l(t,e),transitionsChanged:a(t,e)}}function a(t,e){if(!t.transitions)return!1;var n={},r=h(t),i=!1;for(var o in t.transitions){var a=r[o],s=a&&a.type;("number"===s||"color"===s||"array"===s)&&u(t[o],e[o],a)&&(n[o]=!0,i=!0)}return!!i&&n}function s(t){var e=t.newProps,n=t.oldProps,r=t.ignoreProps,i=void 0===r?{}:r,o=t.propTypes,a=void 0===o?{}:o,s=t.triggerName,l=void 0===s?"props":s;if(n===e)return!1;if("object"!==typeof e||null===e)return"".concat(l," changed shallowly");if("object"!==typeof n||null===n)return"".concat(l," changed shallowly");for(var c=0,h=Object.keys(e);c<h.length;c++){var f=h[c];if(!(f in i)){if(!(f in n))return"".concat(l,".").concat(f," added");var p=u(e[f],n[f],a[f]);if(p)return"".concat(l,".").concat(f," ").concat(p)}}for(var d=0,A=Object.keys(n);d<A.length;d++){var v=A[d];if(!(v in i)){if(!(v in e))return"".concat(l,".").concat(v," dropped");if(!Object.hasOwnProperty.call(e,v)){var g=u(e[v],n[v],a[v]);if(g)return"".concat(l,".").concat(v," ").concat(g)}}}return!1}function u(t,e,n){var r=n&&n.equal;return r&&!r(t,e,n)?"changed deeply":r||!(r=t&&e&&t.equals)||r.call(t,e)?r||e===t?null:"changed shallowly":"changed deeply"}function l(t,e){if(null===e)return!0;var n=e.extensions,r=t.extensions;if(r===n)return!1;if(!n||!r)return!0;if(r.length!==n.length)return!0;for(var i=0;i<r.length;i++)if(!r[i].equals(n[i]))return!0;return!1}function c(t,e,n){var r=t.updateTriggers[n];r=void 0===r||null===r?{}:r;var i=e.updateTriggers[n];return s({oldProps:i=void 0===i||null===i?{}:i,newProps:r,triggerName:n})}function h(t){var e=t[r.fm],n=e&&e.constructor;return n?n._propTypes:{}}},2578:function(t,e,n){"use strict";n.d(e,{Z:function(){return a}});var r=n(50189),i={pickingSelectedColor:null,pickingHighlightColor:new Uint8Array([0,255,255,255]),pickingActive:!1,pickingAttribute:!1};var o={name:"picking",vs:"uniform bool picking_uActive;\nuniform bool picking_uAttribute;\nuniform vec3 picking_uSelectedColor;\nuniform bool picking_uSelectedColorValid;
2\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(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i,e={};if(void 0!==t.pickingSelectedColor)if(t.pickingSelectedColor){var n=t.pickingSelectedColor.slice(0,3);e.picking_uSelectedColorValid=1,e.picking_uSelectedColor=n}else e.picking_uSelectedColorValid=0;if(t.pickingHighlightColor){var r=Array.from(t.pickingHighlightColor,(function(t){return t/255}));Number.isFinite(r[3])||(r[3]=1),e.picking_uHighlightColor=r}return void 0!==t.pickingActive&&(e.picking_uActive=Boolean(t.pickingActive),e.picking_uAttribute=Boolean(t.pickingAttribute)),e}},a=(0,r.Z)({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: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    "}}},o)},66199:function(t,e,n){"use strict";n.d(e,{Z:function(){return p}});var r={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;
2\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},i="#define SMOOTH_EDGE_RADIUS 0.5",o={name:"geometry",vs:"\n".concat(i,"\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(i,"\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")},a=n(18252),s=Object.keys(a.Df).map((function(t){return"const int COORDINATE_SYSTEM_".concat(t," = ").concat(a.Df[t],";")})).join(""),u=Object.keys(a.zG).map((function(t){return"const int PROJECTION_MODE_".concat(t," = ").concat(a.zG[t],";")})).join(""),l=Object.keys(a.iI).map((function(t){return"const int UNIT_".concat(t.toUpperCase()," = ").concat(a.iI[t],";")})).join(""),c="".concat(s,"\n").concat(u,"\n").concat(l,'\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; // meters\nconst float GLOBE_RADIUS = 256.0;\n\n// returns an adjustment factor for uCommonUnitsPerMeter\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    // uCommonUnitsPerMeter in low-zoom Web Mercator is non-linear\n    // Adjust by 1 / cos(latitude)\n    // If geometry.position (vertex in common space) is populated, use it\n    // Otherwise use geometry.worldPosition (anchor in world space)\n    \n    if (geometry.position.w == 0.0) {\n      return project_size_at_latitude(geometry.worldPosition.y);\n    }\n\n    // latitude from common y: 2.0 * (atan(exp(y / TILE_SIZE * 2.0 * PI - PI)) - PI / 4.0)\n    // Taylor series of 1 / cos(latitude)\n    // Max error < 0.003\n  \n    float y = geometry.position.y / TILE_SIZE * 2.0 - 1.0;
2\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}\n\n//\n// Scaling offsets - scales meters to "world distance"\n// Note the scalar version of project_size is for scaling the z component only\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}\n\n// Get rotation matrix that aligns the z axis with the given up vector\n// Find 3 unit vectors ux, uy, uz that are perpendicular to each other and uz == up\nmat3 project_get_orientation_matrix(vec3 up) {\n  vec3 uz = normalize(up);\n  // Tangent on XY plane\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}\n\n//\n// Projecting normal - transform deltas from current coordinate system to\n// normals in the worldspace\n//\nvec3 project_normal(vec3 vector) {\n  // Apply model matrix\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}\n\n//\n// Projecting positions - non-linear projection: lnglats => unit tile [0-1, 0-1]\n//\nvec2 project_mercator_(vec2 lnglat) {\n  float x = lnglat.x;
2\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}\n\n//\n// Projects positions (defined by project_uCoordinateSystem) to common space (defined by project_uProjectionMode)\n//\nvec4 project_position(vec4 position, vec3 position64Low) {\n  vec4 position_world = project_uModelMatrix * position;\n\n  // Work around for a Mac+NVIDIA bug https://github.com/visgl/deck.gl/issues/4145\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        // Too far from the projection center for offset mode to be accurate\n        // Only use high parts\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    // Subtract high part of 64 bit value. Convert remainder to float32, preserving precision.\n    position_world.xyz -= project_uCoordinateOrigin;\n  }\n\n  // Translation is already added to the high parts\n  return project_offset_(position_world + 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}\n\n//\n// Projects from common space coordinates to clip space.\n// Uses project_uViewProjectionMatrix\n//\nvec4 project_common_position_to_clipspace(vec4 position) {\n  return project_common_position_to_clipspace(position, project_uViewProjectionMatrix, project_uCenter);\n}\n\n// Returns a clip space offset that corresponds to a given number of screen pixels\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  // UNIT_PIXELS\n  return size;\n}\nfloat project_pixel_size(float pixels) {\n  return pixels / project_uScale;\n}
2\nvec2 project_pixel_size(vec2 pixels) {\n  return pixels / project_uScale;\n}\n'),h=n(70487),f={};var p={name:"project",dependencies:[r,o],vs:c,getUniforms:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:f;return"viewport"in t?(0,h.C)(t):{}}}},70487:function(t,e,n){"use strict";n.d(e,{C:function(){return d},v:function(){return p}});var r=n(83367),i=n(62220),o=n(18252),a=n(18188),s=[0,0,0,0],u=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],l=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],c=[0,0,0],h=[0,0,0],f=(0,a.Z)((function(t){var e=t.viewport,n=t.devicePixelRatio,a=t.coordinateSystem,h=t.coordinateOrigin,f=function(t,e,n){var o=t.viewMatrixUncentered,a=t.projectionMatrix,l=t.viewMatrix,c=t.viewProjectionMatrix,h=s,f=s,d=t.cameraPosition,A=p(t,e,n),v=A.geospatialOrigin,g=A.shaderCoordinateOrigin;A.offsetMode&&(f=t.projectPosition(v||g),d=[d[0]-f[0],d[1]-f[1],d[2]-f[2]],f[3]=1,h=i.fF([],f,c),l=o||l,c=r.Jp([],a,l),c=r.Jp([],c,u));return{viewMatrix:l,viewProjectionMatrix:c,projectionCenter:h,originCommon:f,cameraPosCommon:d,shaderCoordinateOrigin:g,geospatialOrigin:v}}(e,a,h),d=f.projectionCenter,A=f.viewProjectionMatrix,v=f.originCommon,g=f.cameraPosCommon,m=f.shaderCoordinateOrigin,y=f.geospatialOrigin,_=e.getDistanceScales(),b=[e.width*n,e.height*n],x=i.fF([],[0,0,-e.focalDistance,1],e.projectionMatrix)[3]||1,w={project_uCoordinateSystem:a,project_uProjectionMode:e.projectionMode,project_uCoordinateOrigin:m,project_uCommonOrigin:v.slice(0,3),project_uCenter:d,project_uPseudoMeters:Boolean(e._pseudoMeters),project_uViewportSize:b,project_uDevicePixelRatio:n,project_uFocalDistance:x,project_uCommonUnitsPerMeter:_.unitsPerMeter,project_uCommonUnitsPerWorldUnit:_.unitsPerMeter,project_uCommonUnitsPerWorldUnit2:c,project_uScale:e.scale,project_uWrapLongitude:!1,project_uViewProjectionMatrix:A,project_uModelMatrix:l,project_uCameraPosition:g};if(y){var C=e.getDistanceScales(y);switch(a){case o.Df.METER_OFFSETS:w.project_uCommonUnitsPerWorldUnit=C.unitsPerMeter,w.project_uCommonUnitsPerWorldUnit2=C.unitsPerMeter2;break;case o.Df.LNGLAT:case o.Df.LNGLAT_OFFSETS:e._pseudoMeters||(w.project_uCommonUnitsPerMeter=C.unitsPerMeter),w.project_uCommonUnitsPerWorldUnit=C.unitsPerDegree,w.project_uCommonUnitsPerWorldUnit2=C.unitsPerDegree2;break;case o.Df.CARTESIAN:w.project_uCommonUnitsPerWorldUnit=[1,1,C.unitsPerMeter[2]],w.project_uCommonUnitsPerWorldUnit2=[0,0,C.unitsPerMeter2[2]]}}return w}));function p(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:h;n.length<3&&(n=[n[0],n[1],0]);var r,i=n,a=!0;switch(r=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||(r=[0,0,0],a=!1);break;case o.zG.WEB_MERCATOR_AUTO_OFFSET:e===o.Df.LNGLAT?i=r:e===o.Df.CARTESIAN&&(i=[Math.fround(t.center[0]),Math.fround(t.center[1]),0],r=t.unprojectPosition(i),i[0]-=n[0],i[1]-=n[1],i[2]-=n[2]);break;case o.zG.IDENTITY:(i=t.position.map(Math.fround))[2]=i[2]||0;break;case o.zG.GLOBE:a=!1,r=null;break;default:a=!1}return{geospatialOrigin:r,shaderCoordinateOrigin:i,offsetMode:a}}function d(t){var e=t.viewport,n=t.devicePixelRatio,r=void 0===n?1:n,i=t.modelMatrix,a=void 0===i?null:i,s=t.coordinateSystem,u=void 0===s?o.Df.DEFAULT:s,c=t.coordinateOrigin,p=void 0===c?h:c,d=t.autoWrapLongitude,A=void 0!==d&&d;u===o.Df.DEFAULT&&(u=e.isGeospatial?o.Df.LNGLAT:o.Df.CARTESIAN);var v=f({viewport:e,devicePixelRatio:r,coordinateSystem:u,coordinateOrigin:p});return v.project_uWrapLongitude=A,v.project_uModelMatrix=a||l,v}},2123:function(t,e,n){"use strict";var r=n(66199);e.Z={name:"project32",dependencies:[r.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
2) {\n  vec4 commonPosition;\n  return project_position_to_clipspace(position, position64Low, offset, commonPosition);\n}\n"}},99188:function(t,e,n){"use strict";n.d(e,{Z:function(){return a}});var r=n(22951),i=n(91976),o=n(64649),a=function(){function t(e){(0,r.Z)(this,t),(0,o.Z)(this,"_inProgress",void 0),(0,o.Z)(this,"_handle",void 0),(0,o.Z)(this,"_timeline",void 0),(0,o.Z)(this,"time",void 0),(0,o.Z)(this,"settings",void 0),this._inProgress=!1,this._handle=null,this._timeline=e,this.time=0,this.settings={duration:0}}return(0,i.Z)(t,[{key:"inProgress",get:function(){return this._inProgress}},{key:"start",value:function(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)}},{key:"end",value:function(){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))}},{key:"cancel",value:function(){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)}},{key:"update",value:function(){var t,e;if(!this._inProgress)return!1;if(null===this._handle){var n=this._timeline,r=this.settings;this._handle=n.addChannel({delay:n.getTime(),duration:r.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}},{key:"_onUpdate",value:function(){}}]),t}()},12997:function(t,e,n){"use strict";function r(t,e){if(!t)throw new Error(e||"deck.gl: assertion failed.")}n.d(e,{Z:function(){return r}})},98949:function(t,e,n){"use strict";function r(t,e){if(t===e)return!0;if(!t||!e)return!1;for(var n in t){var i=t[n],o=e[n];if(!(i===o||Array.isArray(i)&&Array.isArray(o)&&r(i,o)))return!1}return!0}n.d(e,{v:function(){return r}})},18757:function(t,e,n){"use strict";function r(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return!0};return Array.isArray(t)?i(t,e,[]):e(t)?[t]:[]}function i(t,e,n){for(var r=-1;++r<t.length;){var o=t[r];Array.isArray(o)?i(o,e,n):e(o)&&n.push(o)}return n}function o(t){for(var e=t.target,n=t.source,r=t.start,i=void 0===r?0:r,o=t.count,a=void 0===o?1:o,s=n.length,u=a*s,l=0,c=i;l<s;l++)e[c++]=n[l];for(;l<u;)l<u-l?(e.copyWithin(i+l,i,i+l),l*=2):(e.copyWithin(i+l,i,i+u-l),l=u);return e}n.d(e,{k:function(){return o},x:function(){return r}})},73115:function(t,e,n){"use strict";n.d(e,{D0:function(){return a},jB:function(){return o},jr:function(){return s}});var r=[],i=[];function o(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,o=r,a={index:-1,data:t,target:[]};return t?"function"===typeof t[Symbol.iterator]?o=t:t.length>0&&(i.length=t.length,o=i):o=r,(e>0||Number.isFinite(n))&&(o=(Array.isArray(o)?o:Array.from(o)).slice(e,n),a.index=e-1),{iterable:o,objectInfo:a}}function a(t){return t&&t[Symbol.asyncIterator]}function s(t,e){var n=e.size,r=e.stride,i=e.offset,o=e.startIndices,a=e.nested,s=t.BYTES_PER_ELEMENT,u=r?r/s:n,l=i?i/s:0,c=Math.floor((t.length-l)/u);return function(e,r){var i=r.index,s=r.target;if(!o){for(var h=i*u+l,f=0;f<n;f++)s[f]=t[h+f];return s}var p,d=o[i],A=o[i+1]||c;if(a){p=new Array(A-d);for(var v=d;v<A;v++){var g=v*u+l;s=new Array(n);for(var m=0;m<n;m++)s[m]=t[g+m];p[v-d]=s}}else if(u===n)p=t.subarray(d*n+l,A*n+l);else{p=new t.constructor((A-d)*n);for(var y=0,_=d;_<A;_++)for(var b=_*u+l,x=0;x<n;x++)p[y++]=t[b+x]}return p}}},21970:function(t,e,n){"use strict";var r=n(87294);e.Z=new r.Z({id:"deck"})},64441:function(t,e,n){"use strict";n.d(e,{Du:function(){return u},Ks:function(){return f},TK:function(){return p},Xt:function(){return s},bS:function(){return o},wQ:function(){return a}});var r=n(28321),i=n(431);function o(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function a(t,e){var n=t%e;return n<0?e+n:n}function s(t){return[t[12],t[13],t[14]]}function u(t){return{left:h(t[3]+t[0],t[7]+t[4],t[11]+t[8],t[15]+t[12]),right:h(t[3]-t[0],t[7]-t[4],t[11]-t[8],t[15]-t[12]),bottom:h(t[3]+t[1],t[7]+t[5],t[11]+t[9],t[15]+t[13]),top:h(t[3]-t[1],t[7]-t[5],t[11]-t[9],t[15]-t[13]),near:h(t[3]+t[2],t[7]+t[6],t[11]+t[10
2],t[15]+t[14]),far:h(t[3]-t[2],t[7]-t[6],t[11]-t[10],t[15]-t[14])}}var l,c=new i.Z;function h(t,e,n,r){c.set(t,e,n);var o=c.len();return{distance:r/o,normal:new i.Z(-t/o,-e/o,-n/o)}}function f(t){return t-Math.fround(t)}function p(t,e){var n=e.size,i=void 0===n?1:n,o=e.startIndex,a=void 0===o?0:o,s=void 0!==e.endIndex?e.endIndex:t.length,u=(s-a)/i;l=r.Z.allocate(l,u,{type:Float32Array,size:2*i});for(var c=a,h=0;c<s;){for(var p=0;p<i;p++){var d=t[c++];l[h+p]=d,l[h+p+i]=f(d)}h+=2*i}return l.subarray(0,u*i*2)}},18188:function(t,e,n){"use strict";function r(t,e){if(t===e)return!0;if(Array.isArray(t)){var n=t.length;if(!e||e.length!==n)return!1;for(var r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}return!1}function i(t){var e,n={};return function(i){for(var o in i)if(!r(i[o],n[o])){e=t(i),n=i;break}return e}}n.d(e,{Z:function(){return i}})},46802:function(t,e,n){"use strict";n.d(e,{l:function(){return i}});var r=n(50189);function i(t,e){if(!e)return t;var n=(0,r.Z)((0,r.Z)({},t),e);if("defines"in e&&(n.defines=(0,r.Z)((0,r.Z)({},t.defines),e.defines)),"modules"in e&&(n.modules=(t.modules||[]).concat(e.modules),e.modules.some((function(t){return"project64"===t.name})))){var i=n.modules.findIndex((function(t){return"project32"===t.name}));i>=0&&n.modules.splice(i,1)}if("inject"in e)if(t.inject){var o=(0,r.Z)({},t.inject);for(var a in e.inject)o[a]=(o[a]||"")+e.inject[a];n.inject=o}else n.inject=e.inject;return n}},55678:function(t,e,n){"use strict";n.d(e,{Z:function(){return h}});var r=n(60726),i=n(22951),o=n(91976),a=n(64649),s=n(73115),u=n(28321),l=n(12997),c=n(33839),h=function(){function t(e){(0,i.Z)(this,t),(0,a.Z)(this,"opts",void 0),(0,a.Z)(this,"typedArrayManager",void 0),(0,a.Z)(this,"indexStarts",[0]),(0,a.Z)(this,"vertexStarts",[0]),(0,a.Z)(this,"vertexCount",0),(0,a.Z)(this,"instanceCount",0),(0,a.Z)(this,"attributes",void 0),(0,a.Z)(this,"_attributeDefs",void 0),(0,a.Z)(this,"data",void 0),(0,a.Z)(this,"getGeometry",void 0),(0,a.Z)(this,"geometryBuffer",void 0),(0,a.Z)(this,"buffers",void 0),(0,a.Z)(this,"positionSize",void 0),(0,a.Z)(this,"normalize",void 0);var n=e.attributes,r=void 0===n?{}:n;this.typedArrayManager=u.Z,this.attributes={},this._attributeDefs=r,this.opts=e,this.updateGeometry(e)}return(0,o.Z)(t,[{key:"updateGeometry",value:function(t){Object.assign(this.opts,t);var e=this.opts,n=e.data,i=e.buffers,o=void 0===i?{}:i,a=e.getGeometry,s=e.geometryBuffer,u=e.positionFormat,c=e.dataChanged,h=e.normalize,f=void 0===h||h;if(this.data=n,this.getGeometry=a,this.positionSize=s&&s.size||("XY"===u?2:3),this.buffers=o,this.normalize=f,s&&((0,l.Z)(n.startIndices),this.getGeometry=this.getGeometryFromBuffer(s),f||(o.positions=s)),this.geometryBuffer=o.positions,Array.isArray(c)){var p,d=(0,r.Z)(c);try{for(d.s();!(p=d.n()).done;){var A=p.value;this._rebuildGeometry(A)}}catch(v){d.e(v)}finally{d.f()}}else this._rebuildGeometry()}},{key:"updatePartialGeometry",value:function(t){var e=t.startRow,n=t.endRow;this._rebuildGeometry({startRow:e,endRow:n})}},{key:"getGeometryFromBuffer",value:function(t){var e=t.value||t;return ArrayBuffer.isView(e)?(0,s.jr)(e,{size:this.positionSize,offset:t.offset,stride:t.stride,startIndices:this.data.startIndices}):null}},{key:"_allocate",value:function(t,e){var n=this.attributes,r=this.buffers,i=this._attributeDefs,o=this.typedArrayManager;for(var a in i)if(a in r)o.release(n[a]),n[a]=null;else{var s=i[a];s.copy=e,n[a]=o.allocate(n[a],t,s)}}},{key:"_forEachGeometry",value:function(t,e,n){var i,o=this.data,a=this.getGeometry,u=(0,s.jB)(o,e,n),l=u.iterable,c=u.objectInfo,h=(0,r.Z)(l);try{for(h.s();!(i=h.n()).done;){var f=i.value;c.index++,t(a?a(f,c):null,c.index)}}catch(p){h.e(p)}finally{h.f()}}},{key:"_rebuildGeometry",value:function(t){var e=this;if(this.data){var n=this.indexStarts,r=this.vertexStarts,i=this.instanceCount,o=this.data,a=this.geometryBuffer,s=t||{},u=s.startRow,l=void 0===u?0:u,h=s.endRow,f=void 0===h?1/0:h,p={};if(t||(n=[0],r=[0]),this.normalize||!a)this._forEachGeometry((function(t,n){var i=t&&e.normalizeGeometry(t);p[n]=i,r[n+1]=r[n]+(i?e.getGeometrySize(i):0)}),l,f),i=r[r.length-1];else if(r=o.startIndices,i=r[o.length]||0,ArrayBuffer.isView(a))i=i||a.length/this.positionSize;else if(a instanceof c.Z){var d=a.accessor.stride||4*this.positionSize;i=i||a.byteLength/d}else if(a.buffer){var A=a.stride||4*this.positionSize;i=i||a.buffer.byteLength/A}else if(a.value){var v=a.value,g=a.stride/v.BYTES_PER_ELEMENT||this.positionSize;i=i||v.length/g}this._allocate(i,Boolean(t)),this.indexStarts=n,this.vertexStarts=r,this.instanceCount=i;var m={};
2this._forEachGeometry((function(t,o){var a=p[o]||t;m.vertexStart=r[o],m.indexStart=n[o];var s=o<r.length-1?r[o+1]:i;m.geometrySize=s-r[o],m.geometryIndex=o,e.updateGeometryAttributes(a,m)}),l,f),this.vertexCount=n[n.length-1]}}}]),t}()},28321:function(t,e,n){"use strict";var r=n(22951),i=n(91976),o=n(64649),a=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,r.Z)(this,t),(0,o.Z)(this,"_pool",[]),(0,o.Z)(this,"opts",{overAlloc:2,poolSize:100}),this.setOptions(e)}return(0,i.Z)(t,[{key:"setOptions",value:function(t){Object.assign(this.opts,t)}},{key:"allocate",value:function(t,e,n){var r=n.size,i=void 0===r?1:r,o=n.type,a=n.padding,s=void 0===a?0:a,u=n.copy,l=void 0!==u&&u,c=n.initialize,h=void 0!==c&&c,f=n.maxCount,p=o||t&&t.constructor||Float32Array,d=e*i+s;if(ArrayBuffer.isView(t)){if(d<=t.length)return t;if(d*t.BYTES_PER_ELEMENT<=t.buffer.byteLength)return new p(t.buffer,0,d)}var A=1/0;f&&(A=f*i+s);var v=this._allocate(p,d,h,A);return t&&l?v.set(t):h||v.fill(0,0,4),this._release(t),v}},{key:"release",value:function(t){this._release(t)}},{key:"_allocate",value:function(t,e,n,r){var i=Math.max(Math.ceil(e*this.opts.overAlloc),1);i>r&&(i=r);var o=this._pool,a=t.BYTES_PER_ELEMENT*i,s=o.findIndex((function(t){return t.byteLength>=a}));if(s>=0){var u=new t(o.splice(s,1)[0],0,i);return n&&u.fill(0),u}return new t(i)}},{key:"_release",value:function(t){if(ArrayBuffer.isView(t)){var e=this._pool,n=t.buffer,r=n.byteLength,i=e.findIndex((function(t){return t.byteLength>=r}));i<0?e.push(n):(i>0||e.length<this.opts.poolSize)&&e.splice(i,0,n),e.length>this.opts.poolSize&&e.shift()}}}]),t}();e.Z=new a},83427:function(t,e,n){"use strict";n.d(e,{Z:function(){return y}});var r=n(11026),i=n(22951),o=n(91976),a=n(64649),s=n(21970),u=n(64441),l=n(12987),c=n(47410),h=n(431),f=n(83367),p=n(75818),d=n(18252),A=Math.PI/180,v=(0,u.bS)(),g=[0,0,0],m={unitsPerMeter:[1,1,1],metersPerUnit:[1,1,1]};var y=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,i.Z)(this,t),(0,a.Z)(this,"id",void 0),(0,a.Z)(this,"x",void 0),(0,a.Z)(this,"y",void 0),(0,a.Z)(this,"width",void 0),(0,a.Z)(this,"height",void 0),(0,a.Z)(this,"padding",void 0),(0,a.Z)(this,"isGeospatial",void 0),(0,a.Z)(this,"zoom",void 0),(0,a.Z)(this,"focalDistance",void 0),(0,a.Z)(this,"position",void 0),(0,a.Z)(this,"modelMatrix",void 0),(0,a.Z)(this,"distanceScales",void 0),(0,a.Z)(this,"scale",void 0),(0,a.Z)(this,"center",void 0),(0,a.Z)(this,"cameraPosition",void 0),(0,a.Z)(this,"projectionMatrix",void 0),(0,a.Z)(this,"viewMatrix",void 0),(0,a.Z)(this,"viewMatrixUncentered",void 0),(0,a.Z)(this,"viewMatrixInverse",void 0),(0,a.Z)(this,"viewProjectionMatrix",void 0),(0,a.Z)(this,"pixelProjectionMatrix",void 0),(0,a.Z)(this,"pixelUnprojectionMatrix",void 0),(0,a.Z)(this,"resolution",void 0),(0,a.Z)(this,"_frustumPlanes",{}),this.id=e.id||this.constructor.displayName||"viewport",this.x=e.x||0,this.y=e.y||0,this.width=e.width||1,this.height=e.height||1,this.zoom=e.zoom||0,this.padding=e.padding,this.distanceScales=e.distanceScales||m,this.focalDistance=e.focalDistance||1,this.position=e.position||g,this.modelMatrix=e.modelMatrix||null;var n=e.longitude,r=e.latitude;this.isGeospatial=Number.isFinite(r)&&Number.isFinite(n),this._initProps(e),this._initMatrices(e),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)}return(0,o.Z)(t,[{key:"metersPerPixel",get:function(){return this.distanceScales.metersPerUnit[2]/this.scale}},{key:"projectionMode",get:function(){return this.isGeospatial?this.zoom<12?d.zG.WEB_MERCATOR:d.zG.WEB_MERCATOR_AUTO_OFFSET:d.zG.IDENTITY}},{key:"equals",value:function(e){return e instanceof t&&(this===e||e.width===this.width&&e.height===this.height&&e.scale===this.scale&&(0,c.fS)(e.projectionMatrix,this.projectionMatrix)&&(0,c.fS)(e.viewMatrix,this.viewMatrix))}},{key:"project",value:function(t){var e=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).topLeft,n=void 0===e||e,i=this.projectPosition(t),o=(0,p.aW)(i,this.pixelProjectionMatrix),a=(0,r.Z)(o,2),s=a[0],u=a[1],l=n?u:this.height-u;return 2===t.length?[s,l]:[s,l,o[2]]}},{key:"unproject",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.topLeft,i=void 0===n||n,o=e.targetZ,a=(0,r.Z)(t,3),s=a[0],u=a[1],l=a[2],c=i?u:this.height-u,h=o&&o*this.distanceScales.unitsPerMeter[2],f=(0,p.CT)([s,c,l],this.pixelUnprojectionMatrix,h),d=this.unprojectPosition(f),A=(0,r.Z)(d,3),v=A[0],g=A[1],m=A[2];return Number.isFinite(l)?[v,g,m]:Number.isFinite(o)?[v,g,o]:[v,g]}},{key:"projectPosition",value:function(t){var e=this.projectFlat(t),n=(0,r.Z)(e,2);return[n[0],n[1],(t[2]||0)*this.distanceScales.unitsPerMeter[2]]}},{key:"unprojectPosition",value:function(t){var e=this.unprojectFlat(t),n=(0,r.Z)(e,2);return[n[0],n[1],(t[2]||0)*this.distanceScales.metersPerUnit[2]]}},{key:"projectFlat",value:function(t){if(this.isGeospatial){var e=(0,p.w5)(t);return e[1]=(0,c.uZ)(e[1],-318,830),e}return t}},{key:"unprojectFlat",value:function(t){return this.isGeospatial?(0,p.es)(t):t}},{key:"getBounds",value:function(){var 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),r=this.unproject([0,this.height],t),i=this.unproject([this.width,this.height],t);return[Math.min(e[0],n[0],r[0],i[0]),Math.min(e[1],n[1],r[1],i[1]),Math.max(e[0],n[0],r[0],i[0]),Math.max(e[1],n[1],r[1],i[1])]}},{key:"getDistanceScales",value:function(t){return t?(0,p.ro)({longitude:t[0],latitude:t[1],highPrecision:!0}):this.distanceScales}},{key:"containsPixel",value:function(t){var e=t.x,n=t.y,r=t.width,i=void 0===r?1:r,o=t.height,a=void 0===o?1:o;return e<this.x+this.width&&this.x<e+i&&n<this.y+this.height&&this.y<n+a}},{key:"getFrustumPlanes",value:function(){return this._frustumPlanes.near||Object.assign(this._frustumPlanes,(0,u.Du)(this.viewProjectionMatrix)),this._frustumPlanes}},{key:"panByPosition",value:function(t,e){return null}},{key:"_initProps",value:function(t){var e=t.longitude,n=t.latitude;this.isGeospatial&&(Number.isFinite(t.zoom)||(this.zoom=(0,p.Bf)({latitude:n})+Math.log2(this.focalDistance)),this.distanceScales=t.distanceScales||(0,p.ro)({latitude:n,longitude:e}));var r=Math.pow(2,this.zoom);this.scale=r;var i=t.position,o=t.modelMatrix,a=g;if(i&&(a=o?new l.Z(o).transformAsVector(i,[]):i),this.isGeospatial){var s=this.projectPosition([e,n,0]);this.center=new h.Z(a).scale(this.distanceScales.unitsPerMeter).add(s)}else this.center=this.projectPosition(a)}},{key:"_initMatrices",value:function(t){var e=t.viewMatrix,n=void 0===e?v:e,r=t.projectionMatrix,i=void 0===r?null:r,o=t.orthographic,a=void 0!==o&&o,p=t.fovyRadians,d=t.fovy,g=void 0===d?7
25:d,m=t.near,y=void 0===m?.1:m,_=t.far,b=void 0===_?1e3:_,x=t.padding,w=void 0===x?null:x,C=t.focalDistance,B=void 0===C?1:C;this.viewMatrixUncentered=n,this.viewMatrix=(new l.Z).multiplyRight(n).translate(new h.Z(this.center).negate()),this.projectionMatrix=i||function(t){var e=t.width,n=t.height,r=t.orthographic,i=t.fovyRadians,o=t.focalDistance,a=t.padding,s=t.near,u=t.far,h=e/n,f=r?(new l.Z).orthographic({fovy:i,aspect:h,focalDistance:o,near:s,far:u}):(new l.Z).perspective({fovy:i,aspect:h,near:s,far:u});if(a){var p=a.left,d=void 0===p?0:p,A=a.right,v=void 0===A?0:A,g=a.top,m=void 0===g?0:g,y=a.bottom,_=void 0===y?0:y,b=(0,c.uZ)((d+e-v)/2,0,e)-e/2,x=(0,c.uZ)((m+n-_)/2,0,n)-n/2;f[8]-=2*b/e,f[9]+=2*x/n}return f}({width:this.width,height:this.height,orthographic:a,fovyRadians:p||g*A,focalDistance:B,padding:w,near:y,far:b});var k=(0,u.bS)();f.Jp(k,k,this.projectionMatrix),f.Jp(k,k,this.viewMatrix),this.viewProjectionMatrix=k,this.viewMatrixInverse=f.U_([],this.viewMatrix)||this.viewMatrix,this.cameraPosition=(0,u.Xt)(this.viewMatrixInverse);var E=(0,u.bS)(),S=(0,u.bS)();f.bA(E,E,[this.width/2,-this.height/2,1]),f.Iu(E,E,[1,-1,0]),f.Jp(S,E,this.viewProjectionMatrix),this.pixelProjectionMatrix=S,this.pixelUnprojectionMatrix=f.U_((0,u.bS)(),this.pixelProjectionMatrix),this.pixelUnprojectionMatrix||s.Z.warn("Pixel project matrix not invertible")()}}]),t}();(0,a.Z)(y,"displayName","Viewport")},52310:function(t,e,n){"use strict";n.d(e,{Z:function(){return y}});var r=n(11026),i=n(50189),o=n(22951),a=n(91976),s=n(47169),u=n(83138),l=n(27597),c=n(67591),h=n(94337),f=n(64649),p=n(83427),d=n(75818),A=n(77548),v=n(12987),g=Math.PI/180;function m(t){return 512/4003e4/Math.cos(t*g)}var y=function(t){(0,c.Z)(n,t);var e=(0,h.Z)(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,o.Z)(this,n);var a,u=r.latitude,l=void 0===u?0:u,c=r.longitude,h=void 0===c?0:c,p=r.zoom,A=void 0===p?0:p,g=r.pitch,m=void 0===g?0:g,y=r.bearing,_=void 0===y?0:y,b=r.nearZMultiplier,x=void 0===b?.1:b,w=r.farZMultiplier,C=void 0===w?1.01:w,B=r.orthographic,k=void 0!==B&&B,E=r.projectionMatrix,S=r.repeat,T=void 0!==S&&S,M=r.worldOffset,I=void 0===M?0:M,P=r.legacyMeterSizes,Z=void 0!==P&&P,D=r.width,L=r.height,O=r.altitude,F=void 0===O?1.5:O,R=Math.pow(2,A);D=D||1,L=L||1;var z=null;E?(F=E[5]/2,a=(0,d.Lu)(F)):(r.fovy?(a=r.fovy,F=(0,d.sj)(a)):a=(0,d.Lu)(F),z=(0,d.wl)({width:D,height:L,pitch:m,fovy:a,nearZMultiplier:x,farZMultiplier:C}));var U=(0,d.lf)({height:L,pitch:m,bearing:_,scale:R,altitude:F});I&&(U=(new v.Z).translate([512*I,0,0]).multiplyLeft(U));return t=e.call(this,(0,i.Z)((0,i.Z)((0,i.Z)({},r),{},{width:D,height:L,viewMatrix:U,longitude:h,latitude:l,zoom:A},z),{},{fovy:a,focalDistance:F})),(0,f.Z)((0,s.Z)(t),"longitude",void 0),(0,f.Z)((0,s.Z)(t),"latitude",void 0),(0,f.Z)((0,s.Z)(t),"pitch",void 0),(0,f.Z)((0,s.Z)(t),"bearing",void 0),(0,f.Z)((0,s.Z)(t),"altitude",void 0),(0,f.Z)((0,s.Z)(t),"fovy",void 0),(0,f.Z)((0,s.Z)(t),"orthographic",void 0),(0,f.Z)((0,s.Z)(t),"_subViewports",void 0),(0,f.Z)((0,s.Z)(t),"_pseudoMeters",void 0),t.latitude=l,t.longitude=h,t.zoom=A,t.pitch=m,t.bearing=_,t.altitude=F,t.fovy=a,t.orthographic=k,t._subViewports=T?[]:null,t._pseudoMeters=Z,Object.freeze((0,s.Z)(t)),t}return(0,a.Z)(n,[{key:"subViewports",get:function(){if(this._subViewports&&!this._subViewports.length)for(var t=this.getBounds(),e=Math.floor((t[0]+180)/360),r=Math.ceil((t[2]-180)/360),o=e;o<=r;o++){var a=o?new n((0,i.Z)((0,i.Z)({},this),{},{worldOffset:o})):this;this._subViewports.push(a)}return this._subViewports}},{key:"projectPosition",value:function(t){if(this._pseudoMeters)return(0,u.Z)((0,l.Z)(n.prototype),"projectPosition",this).call(this,t);var e=this.projectFlat(t),i=(0,r.Z)(e,2);return[i[0],i[1],(t[2]||0)*m(t[1])]}},{key:"unprojectPosition",value:function(t){if(this._pseudoMeters)return(0,u.Z)((0,l.Z)(n.prototype),"unprojectPosition",this).call(this,t);var e=this.unprojectFlat(t),i=(0,r.Z)(e,2),o=i[0],a=i[1];return[o,a,(t[2]||0)/m(a)]}},{key:"addMetersToLngLat",value:function(t,e){return(0,d.eG)(t,e)}},{key:"panByPosition",value:function(t,e){var n=(0,d.CT)(e,this.pixelUnprojectionMatrix),i=this.projectFlat(t),o=A.IH([],i,A.tk([],n)),a=A.IH([],this.center,o),s=this.unprojectFlat(a),u=(0,r.Z)(s,2);return{longitude:u[0],latitude:u[1]}}},{key:"getBounds",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=(0,d.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])]}},{key:"fitBounds",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.width,o=this.height,a=(0,d.Xg)((0,i.Z)({width:r,height:o,bounds:t},e));return new n({width:r,height:o,longitude:a.longitude,latitude:a.latitude,zoom:a.zoom})}}]),n}(p.Z);
2(0,f.Z)(y,"displayName","WebMercatorViewport")},44948:function(t,e,n){"use strict";n.r(e),n.d(e,{GeohashLayer:function(){return up},GreatCircleLayer:function(){return A},H3ClusterLayer:function(){return Vn},H3HexagonLayer:function(){return jn},MVTLayer:function(){return qf},QuadkeyLayer:function(){return U},S2Layer:function(){return O},TerrainLayer:function(){return Dh},Tile3DLayer:function(){return Sh},TileLayer:function(){return $e},TripsLayer:function(){return nn},_GeoCellLayer:function(){return _},_Tile2DHeader:function(){return W},_Tileset2D:function(){return qe},_getURLFromTemplate:function(){return Ze}});var r={};n.r(r),n.d(r,{decode:function(){return Hu},name:function(){return Vu}});var i={};n.r(i),n.d(i,{name:function(){return $u},preprocess:function(){return tl}});var o={};n.r(o),n.d(o,{name:function(){return nl},preprocess:function(){return rl}});var a={};n.r(a),n.d(a,{decode:function(){return cl},encode:function(){return fl},name:function(){return ul},preprocess:function(){return ll}});var s={};n.r(s),n.d(s,{decode:function(){return _l},encode:function(){return xl},name:function(){return yl}});var u={};n.r(u),n.d(u,{decode:function(){return kl},encode:function(){return Sl},name:function(){return Bl}});var l={};n.r(l),n.d(l,{decode:function(){return Il},encode:function(){return Zl},name:function(){return Ml}});var c=n(91976),h=n(22951),f=n(67591),p=n(94337),d=n(64649),A=function(t){(0,f.Z)(n,t);var e=(0,p.Z)(n);function n(){return(0,h.Z)(this,n),e.apply(this,arguments)}return(0,c.Z)(n)}(n(73351).Z);(0,d.Z)(A,"layerName","GreatCircleLayer"),(0,d.Z)(A,"defaultProps",{getHeight:{type:"accessor",value:0},greatCircle:!0});var v=n(50189),g=n(79366),m=n(94300),y=(0,v.Z)({},m.Z.defaultProps),_=function(t){(0,f.Z)(n,t);var e=(0,p.Z)(n);function n(){return(0,h.Z)(this,n),e.apply(this,arguments)}return(0,c.Z)(n,[{key:"indexToBounds",value:function(){return null}},{key:"renderLayers",value:function(){var t=this.props,e=t.elevationScale,n=t.extruded,r=t.wireframe,i=t.filled,o=t.stroked,a=t.lineWidthUnits,s=t.lineWidthScale,u=t.lineWidthMinPixels,l=t.lineWidthMaxPixels,c=t.lineJointRounded,h=t.lineMiterLimit,f=t.lineDashJustified,p=t.getElevation,d=t.getFillColor,A=t.getLineColor,v=t.getLineWidth,g=this.props,y=g.updateTriggers,_=g.material,b=g.transitions;return new(this.getSubLayerClass("cell",m.Z))({filled:i,wireframe:r,extruded:n,elevationScale:e,stroked:o,lineWidthUnits:a,lineWidthScale:s,lineWidthMinPixels:u,lineWidthMaxPixels:l,lineJointRounded:c,lineMiterLimit:h,lineDashJustified:f,material:_,transitions:b,getElevation:p,getFillColor:d,getLineColor:A,getLineWidth:v},this.getSubLayerProps({id:"cell",updateTriggers:y&&{getElevation:y.getElevation,getFillColor:y.getFillColor,getLineColor:y.getLineColor,getLineWidth:y.getLineWidth}}),this.indexToBounds())}}]),n}(g.Z);(0,d.Z)(_,"layerName","GeoCellLayer"),(0,d.Z)(_,"defaultProps",y);var b=n(11026),x=n(84977),w=n.n(x),C=3,B=61,k=180/Math.PI;function E(t,e,n){var r=1<<e;return[(t[0]+n[0])/r,(t[1]+n[1])/r]}function S(t){return t>=.5?1/3*(4*t*t-1):1/3*(1-4*(1-t)*(1-t))}function T(t){return[S(t[0]),S(t[1])]}function M(t,e){var n=(0,b.Z)(e,2),r=n[0],i=n[1];switch(t){case 0:return[1,r,i];case 1:return[-r,1,i];case 2:return[-r,-i,1];case 3:return[-1,-i,-r];case 4:return[i,-1,-r];case 5:return[i,r,-1];default:throw new Error("Invalid face")}}function I(t){var e=(0,b.Z)(t,3),n=e[0],r=e[1],i=e[2],o=Math.atan2(i,Math.sqrt(n*n+r*r));return[Math.atan2(r,n)*k,o*k]}function P(t,e,n,r){if(0===r){1===n&&(e[0]=t-1-e[0],e[1]=t-1-e[1]);var i=e[0];e[0]=e[1],e[1]=i}}var Z=100;function D(t){if("string"===typeof t){if(t.indexOf("/")>0)return t;t=function(t){var e=t.padEnd(16,"0");return w().fromString(e,16)}(t)}return function(t){for(var e=w().fromString(t,!0,10).toString(2);e.length<C+B;)e="0"+e;for(var n=e.lastIndexOf("1"),r=e.substring(0,3),i=e.substring(3,n),o=i.length/2,a=w().fromString(r,!0,2).toString(10),s=w().fromString(i,!0,2).toString(4);s.length<o;)s="0"+s;return"".concat(a,"/").concat(s)}(t.toString())}function L(t){var e=function(t){for(var e,n=t.split("/"),r=parseInt(n[0],10),i=n[1],o=i.length,a=[0,0],s=o-1;s>=0;s--){e=o-s;var u=i[s],l=0,c=0;"1"===u?c=1:"2"===u?(l=1,c=1):"3"===u&&(l=1);var h=Math.pow(2,e-1);P(h,a,l,c),a[0]+=h*l,a[1]+=h*c}if(r%2===1){var f=a[0];a[0]=a[1],a[1]=f}return{face:r,ij:a,level:e}}(D(t));return function(t){for(var e=t.face,n=t.ij,r=t.level,i=[[0,0],[0,1],[1,1],[1,0],[0,0]],o=Math.max(1,Math.ceil(Z*Math.pow(2,-r))),a=new Float64Array(4*o*2+2),s=0,u=0,l=0;l<4;l++)for(var c=i[l].slice(0),h=i[l+1],f=(h[0]-c[0])/o,p=(h[1]-c[1])/o,d=0;d<o;d++){c[0]+=f,c[1]+=p;var A=I(M(e,T(E(n,r,c))));Math.abs(A[1])>89.999&&(A[0]=u);var v=A[0]-u;A[0]+=v>180?-360:v<-180?360:0,a[s++]=A[0],a[s++]=A[1],u=A[0]}return a[s++]=a[0],a[s++]=a[1],a}(e)}var O=function(t){(0,f.Z)(n,t);var e=(0,p.Z)(n);function n(){return(0,h.Z)(this,n),e.apply(this,arguments)}return(0,c.Z)(n,[{key:"indexToBounds",value:function(){var t=this.props,e=t.data,n=t.getS2Token;return{data:e,_normalize:!1,positionFormat:"XY",getPolygon:function(t,e){return L(n(t,e))}}}}]),n}(_);(0,d.Z)(O,"layerName","S2Layer"),(0,d.Z)(O,"defaultProps",{getS2Token:{type:"accessor",value:function(t){return t.token}}});var F=n(75818),R=512;function z(t){var e=function(t){for(var e=0,n=0,r=1<<t.length,i=r/R,o=0;o<t.length;o++){r>>=1;var a=parseInt(t[o]);a%2&&(e|=r),a>1&&(n|=r)}return[[e/i,R-n/i],[(e+.99)/i,R-(n+.99)/i]]}(t),n=(0,b.Z)(e,2),r=n[0],i=n[1],o=(0,F.es)(r),a=(0,b.Z)(o,2),s=a[0],u=a[1],l=(0,F.es)(i),c=(0,b.Z)(l,2),h=c[0],f=c[1];return[h,u,h,f,s,f,s,u,h,u]}var U=function(t){(0,f.Z)(n,t);var e=(0,p.Z)(n);function n(){return(0,h.Z)(this,n),e.apply(this,arguments)}return(0,c.Z)(n,[{key:"indexToBounds",value:function(){var t=this.props,e=t.data,n=t.getQuadkey;return{data:e,_normalize:!1,positionFormat:"XY",getPolygon:function(t,e){return z(n(t,e))}}}}]),n}(_);(0,d.Z)(U,"layerName","QuadkeyLayer"),(0,d.Z)(U,"defaultProps",{getQuadkey:{type:"accessor",value:function(t){return t.quadkey}}});var N=n(18757),G=n(43610),j=n(60726),V=n(11092),H=n(27791),J=n(21970),W=function(){function t(e){(0,h.Z)(this,t),(0,d.Z)(this,"index",void 0),(0,d.Z)(this,"isVisible",void 0),(0,d.Z)(this,"isSelected",void 0),(0,d.Z)(this,"parent",void 0),(0,d.Z)(this,"children",void 0),(0,d.Z)(this,"content",void 0),(0,d.Z)(this,"state",void 0),(0,d.Z)(this,"layers",void 0),(0,d.Z)(this,"id",void 0),(0,d.Z)(this,"bbox",void 0),(0,d.Z)(this,"zoom",void 0),(0,d.Z)(this,"userData",void 0),(0,d.Z)(this,"_abortController",void 0),(0,d.Z)(this,"_loader",void 0),(0,d.Z)(this,"_loaderId",void 0),(0,d.Z)(this,"_isLoaded",void 0),(0,d.Z)(this,"_isCancelled",void 0),(0,d.Z)(this,"_needsReload",void 0),this.index=e,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}return(0,c.Z)(t,[{key:"data",get:function(){var t=this;return this.isLoading&&this._loader?this._loader.then((function(){return t.data})):this.content}},{key:"isLoaded",get:function(){return this._isLoaded&&!this._needsReload}},{key:"isLoading",get:function(){return Boolean(this._loader)&&!this._isCancelled}},{key:"needsReload",get:function(){return this._needsReload||this._isCancelled}},{key:"byteLength",get:function(){var t=this.content?this.content.byteLength:0;return Number.isFinite(t)||J.Z.error("byteLength not defined in tile data")(),t}}
2,{key:"_loadData",value:function(){var t=(0,H.Z)((0,V.Z)().mark((function t(e){var n,r,i,o,a,s,u,l,c,h,f,p,d,A;return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.getData,r=e.requestScheduler,i=e.onLoad,o=e.onError,a=this.index,s=this.id,u=this.bbox,l=this.userData,c=this.zoom,h=this._loaderId,this._abortController=new AbortController,f=this._abortController.signal,t.next=7,r.scheduleRequest(this,(function(t){return t.isSelected?1:-1}));case 7:if(p=t.sent){t.next=11;break}return this._isCancelled=!0,t.abrupt("return");case 11:if(!this._isCancelled){t.next=14;break}return p.done(),t.abrupt("return");case 14:return d=null,t.prev=15,t.next=18,n({index:a,id:s,bbox:u,userData:l,zoom:c,signal:f});case 18:d=t.sent,t.next=24;break;case 21:t.prev=21,t.t0=t.catch(15),A=t.t0||!0;case 24:return t.prev=24,p.done(),t.finish(24);case 27:if(h===this._loaderId){t.next=29;break}return t.abrupt("return");case 29:if(this._loader=void 0,this.content=d,!this._isCancelled||d){t.next=34;break}return this._isLoaded=!1,t.abrupt("return");case 34:this._isLoaded=!0,this._isCancelled=!1,A?o(A,this):i(this);case 37:case"end":return t.stop()}}),t,this,[[15,21,24,27]])})));return function(e){return t.apply(this,arguments)}}()},{key:"loadData",value:function(t){return this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1,this._loaderId++,this._loader=this._loadData(t),this._loader}},{key:"setNeedsReload",value:function(){this.isLoading&&(this.abort(),this._loader=void 0),this._needsReload=!0}},{key:"abort",value:function(){var t;this.isLoaded||(this._isCancelled=!0,null===(t=this._abortController)||void 0===t||t.abort())}}]),t}(),Q=n(649),q=n(47169),K=n(12987),X=n(83427),Y=n(18252),$=n(99007),tt=n(62220),et=Math.PI/180,nt=180/Math.PI,rt=6370972,it=256;function ot(){var t=4018225162502676e-20,e=Math.PI/180*it;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]}}var at=function(t){(0,f.Z)(n,t);var e=(0,p.Z)(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,h.Z)(this,n);var i=r.latitude,o=void 0===i?0:i,a=r.longitude,s=void 0===a?0:a,u=r.zoom,l=void 0===u?0:u,c=r.nearZMultiplier,f=void 0===c?.1:c,p=r.farZMultiplier,A=void 0===p?2:p,g=r.resolution,m=void 0===g?10:g,y=r.height,_=r.altitude,b=void 0===_?1.5:_;y=y||1,b=Math.max(.75,b);var x=(new K.Z).lookAt({eye:[0,-b,0],up:[0,0,1]}),w=Math.pow(2,l);x.rotateX(o*et),x.rotateZ(-s*et),x.scale(w/y);var C=Math.atan(.5/b),B=512*w/y;return t=e.call(this,(0,v.Z)((0,v.Z)({},r),{},{height:y,viewMatrix:x,longitude:s,latitude:o,zoom:l,distanceScales:ot(),fovyRadians:2*C,focalDistance:b,near:f,far:Math.min(2,1/B+1)*b*A})),(0,d.Z)((0,q.Z)(t),"longitude",void 0),(0,d.Z)((0,q.Z)(t),"latitude",void 0),(0,d.Z)((0,q.Z)(t),"resolution",void 0),t.latitude=o,t.longitude=s,t.resolution=m,t}return(0,c.Z)(n,[{key:"projectionMode",get:function(){return Y.zG.GLOBE}},{key:"getDistanceScales",value:function(){return this.distanceScales}},{key:"getBounds",value:function(){var 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),r=this.unproject([this.width,this.height/2],t),i=this.unproject([this.width/2,this.height],t);return r[0]<this.longitude&&(r[0]+=360),e[0]>this.longitude&&(e[0]-=360),[Math.min(e[0],r[0],n[0],i[0]),Math.min(e[1],r[1],n[1],i[1]),Math.max(e[0],r[0],n[0],i[0]),Math.max(e[1],r[1],n[1],i[1])]}},{key:"unproject",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.topLeft,i=void 0===r||r,o=n.targetZ,a=(0,b.Z)(t,3),s=a[0],u=a[1],l=a[2],c=i?u:this.height-u,h=this.pixelUnprojectionMatrix;if(Number.isFinite(l))e=st(h,[s,c,l,1]);else{var f=st(h,[s,c,-1,1]),p=st(h,[s,c,1,1]),d=((o||0)/rt+1)*it,A=$.x9($.lu([],f,p)),v=$.x9(f),g=$.x9(p),m=4*((4*v*g-Math.pow(A-v-g,2))/16)/A,y=(Math.sqrt(v-m)-Math.sqrt(Math.max(0,d*d-m)))/Math.sqrt(A);e=$.t7([],f,p,y)}var _=this.unprojectPosition(e),x=(0,b.Z)(_,3),w=x[0],C=x[1],B=x[2];return Number.isFinite(l)?[w,C,B]:Number.isFinite(o)?[w,C,o]:[w,C]}},{key:"projectPosition",value:function(t){var e=(0,b.Z)(t,3),n=e[0],r=e[1],i=e[2],o=void 0===i?0:i,a=n*et,s=r*et,u=Math.cos(s),l=(o/rt+1)*it;return[Math.sin(a)*u*l,-Math.cos(a)*u*l,Math.sin(s)*l]}},{key:"unprojectPosition",value:function(t){var e=(0,b.Z)(t,3),n=e[0],r=e[1],i=e[2],o=$.Zh(t),a=Math.asin(i/o);return[Math.atan2(n,-r)*nt,a*nt,(o/it-1)*rt]}},{key:"projectFlat",value:function(t){return t}},{key:"unprojectFlat",value:function(t){return t}},{key:"panByPosition",value:function(t,e){var n=this.unproject(e);return{longitude:t[0]-n[0]+this.longitude,latitude:t[1]-n[1]+this.latitude}}}]),n}(X.Z);function st(t,e){var n=tt.fF([],e,t);return tt.bA(n,n,1/n[3]),n}var ut,lt=n(52310),ct=-1,ht=0,ft=1,pt=n(431),dt=new pt.Z,At=new pt.Z,vt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,0],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0],r=arguments.length>2?arguments[2]:void 0;(0,h.Z)(this,t),(0,d.Z)(this,"center",void 0),(0,d.Z)(this,"halfDiagonal",void 0),(0,d.Z)(this,"minimum",void 0),(0,d.Z)(this,"maximum",void 0),r=r||dt.copy(e).add(n).scale(.5),this.center=new pt.Z(r),this.halfDiagonal=new pt.Z(n).subtract(this.center),this.minimum=new pt.Z(e),this.maximum=new pt.Z(n)}return(0,c.Z)(t,[{key:"clone",value:function(){return new t(this.minimum,this.maximum,this.center)}},{key:"equals",value:function(t){return this===t||Boolean(t)&&this.minimum.equals(t.minimum)&&this.maximum.equals(t.maximum)}},{key:"transform",value:function(t){return this.center.transformAsPoint(t),this.halfDiagonal.transform(t),this.minimum.transform(t),this.maximum.transform(t),this}},{key:"intersectPlane",value:function(t){var e=this.halfDiagonal,n=At.from(t.
2normal),r=e.x*Math.abs(n.x)+e.y*Math.abs(n.y)+e.z*Math.abs(n.z),i=this.center.dot(n)+t.distance;return i-r>0?ft:i+r<0?ct:ht}},{key:"distanceTo",value:function(t){return Math.sqrt(this.distanceSquaredTo(t))}},{key:"distanceSquaredTo",value:function(t){var e,n=dt.from(t).subtract(this.center),r=this.halfDiagonal,i=0;return(e=Math.abs(n.x)-r.x)>0&&(i+=e*e),(e=Math.abs(n.y)-r.y)>0&&(i+=e*e),(e=Math.abs(n.z)-r.z)>0&&(i+=e*e),i}}]),t}(),gt=n(83367),mt=new pt.Z,yt=new pt.Z,_t=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,0],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;(0,h.Z)(this,t),(0,d.Z)(this,"center",void 0),(0,d.Z)(this,"radius",void 0),this.radius=-0,this.center=new pt.Z,this.fromCenterRadius(e,n)}return(0,c.Z)(t,[{key:"fromCenterRadius",value:function(t,e){return this.center.from(t),this.radius=e,this}},{key:"fromCornerPoints",value:function(t,e){return e=mt.from(e),this.center=(new pt.Z).from(t).add(e).scale(.5),this.radius=this.center.distance(e),this}},{key:"equals",value:function(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.radius===t.radius}},{key:"clone",value:function(){return new t(this.center,this.radius)}},{key:"union",value:function(t){var e=this.center,n=this.radius,r=t.center,i=t.radius,o=mt.copy(r).subtract(e),a=o.magnitude();if(n>=a+i)return this.clone();if(i>=a+n)return t.clone();var s=.5*(n+a+i);return yt.copy(o).scale((-n+s)/a).add(e),this.center.copy(yt),this.radius=s,this}},{key:"expand",value:function(t){var e=mt.from(t).subtract(this.center).magnitude();return e>this.radius&&(this.radius=e),this}},{key:"transform",value:function(t){this.center.transform(t);var e=gt.Q$(mt,t);return this.radius=Math.max(e[0],Math.max(e[1],e[2]))*this.radius,this}},{key:"distanceSquaredTo",value:function(t){var e=this.distanceTo(t);return e*e}},{key:"distanceTo",value:function(t){var e=mt.from(t).subtract(this.center);return Math.max(0,e.len()-this.radius)}},{key:"intersectPlane",value:function(t){var e=this.center,n=this.radius,r=t.normal.dot(e)+t.distance;return r<-n?ct:r<n?ht:ft}}]),t}(),bt=n(53209),xt=n(69801),wt=n(63986),Ct=n(24645),Bt=n(77548);!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"}(ut||(ut={}));var kt,Et,St=Object.freeze([1,0,0,0,1,0,0,0,1]),Tt=function(t){(0,f.Z)(n,t);var e=(0,p.Z)(n);function n(t){for(var r,i=arguments.length,o=new Array(i>1?i-1:0),a=1;a<i;a++)o[a-1]=arguments[a];return(0,h.Z)(this,n),r=e.call(this,-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(t)?r.copy(t):o.length>0?r.copy([t].concat(o)):r.identity(),r}return(0,c.Z)(n,[{key:"ELEMENTS",get:function(){return 9}},{key:"RANK",get:function(){return 3}},{key:"INDICES",get:function(){return ut}},{key:"copy",value:function(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()}},{key:"identity",value:function(){return this.copy(St)}},{key:"fromObject",value:function(t){return this.check()}},{key:"fromQuaternion",value:function(t){return Ct.en(this,t),this.check()}},{key:"set",value:function(t,e,n,r,i,o,a,s,u){return this[0]=t,this[1]=e,this[2]=n,this[3]=r,this[4]=i,this[5]=o,this[6]=a,this[7]=s,this[8]=u,this.check()}},{key:"setRowMajor",value:function(t,e,n,r,i,o,a,s,u){return this[0]=t,this[1]=r,this[2]=a,this[3]=e,this[4]=i,this[5]=s,this[6]=n,this[7]=o,this[8]=u,this.check()}},{key:"determinant",value:function(){return Ct.GH(this)}},{key:"transpose",value:function(){return Ct.p4(this,this),this.check()}},{key:"invert",value:function(){return Ct.U_(this,this),this.check()}},{key:"multiplyLeft",value:function(t){return Ct.Jp(this,t,this),this.check()}},{key:"multiplyRight",value:function(t){return Ct.Jp(this,this,t),this.check()}},{key:"rotate",value:function(t){return Ct.U1(this,this,t),this.check()}},{key:"scale",value:function(t){return Array.isArray(t)?Ct.bA(this,this,t):Ct.bA(this,this,[t,t]),this.check()}},{key:"translate",value:function(t){return Ct.Iu(this,this,t),this.check()}},{key:"transform",value:function(t,e){var n;switch(t.length){case 2:n=Bt.kK(e||[-0,-0],t,this);break;case 3:n=$.kK(e||[-0,-0,-0],t,this);break;case 4:n=(0,wt._x)(e||[-0,-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return(0,xt.IL)(n,t.length),n}},{key:"transformVector",value:function(t,e){return this.transform(t,e)}},{key:"transformVector2",value:function(t,e){return this.transform(t,e)}},{key:"transformVector3",value:function(t,e){return this.transform(t,e)}}],[{key:"IDENTITY",get:function(){return It()}},{key:"ZERO",get:function(){return Mt()}}]),n}(bt.Z);function Mt(){return kt||(kt=new Tt([0,0,0,0,0,0,0,0,0]),Object.freeze(kt)),kt}function It(){return Et||(Et=new Tt,Object.freeze(Et)),Et}
2var Pt=n(34980),Zt=new pt.Z,Dt=new pt.Z,Lt=new pt.Z,Ot=new pt.Z,Ft=new pt.Z,Rt=new pt.Z,zt=new pt.Z,Ut=0,Nt=1,Gt=2,jt=3,Vt=4,Ht=5,Jt=6,Wt=7,Qt=8,qt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,0],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0,0,0,0,0,0,0];(0,h.Z)(this,t),(0,d.Z)(this,"center",void 0),(0,d.Z)(this,"halfAxes",void 0),this.center=(new pt.Z).from(e),this.halfAxes=new Tt(n)}return(0,c.Z)(t,[{key:"halfSize",get:function(){var t=this.halfAxes.getColumn(0),e=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2);return[new pt.Z(t).len(),new pt.Z(e).len(),new pt.Z(n).len()]}},{key:"quaternion",get:function(){var t=this.halfAxes.getColumn(0),e=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2),r=new pt.Z(t).normalize(),i=new pt.Z(e).normalize(),o=new pt.Z(n).normalize();return(new Pt.Z).fromMatrix3(new Tt([].concat((0,Q.Z)(r),(0,Q.Z)(i),(0,Q.Z)(o))))}},{key:"fromCenterHalfSizeQuaternion",value:function(t,e,n){var r=new Pt.Z(n),i=(new Tt).fromQuaternion(r);return i[0]=i[0]*e[0],i[1]=i[1]*e[0],i[2]=i[2]*e[0],i[3]=i[3]*e[1],i[4]=i[4]*e[1],i[5]=i[5]*e[1],i[6]=i[6]*e[2],i[7]=i[7]*e[2],i[8]=i[8]*e[2],this.center=(new pt.Z).from(t),this.halfAxes=i,this}},{key:"clone",value:function(){return new t(this.center,this.halfAxes)}},{key:"equals",value:function(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.halfAxes.equals(t.halfAxes)}},{key:"getBoundingSphere",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new _t,e=this.halfAxes,n=e.getColumn(0,Lt),r=e.getColumn(1,Ot),i=e.getColumn(2,Ft),o=Zt.copy(n).add(r).add(i);return t.center.copy(this.center),t.radius=o.magnitude(),t}},{key:"intersectPlane",value:function(t){var e=this.center,n=t.normal,r=this.halfAxes,i=n.x,o=n.y,a=n.z,s=Math.abs(i*r[Ut]+o*r[Nt]+a*r[Gt])+Math.abs(i*r[jt]+o*r[Vt]+a*r[Ht])+Math.abs(i*r[Jt]+o*r[Wt]+a*r[Qt]),u=n.dot(e)+t.distance;return u<=-s?ct:u>=s?ft:ht}},{key:"distanceTo",value:function(t){return Math.sqrt(this.distanceSquaredTo(t))}},{key:"distanceSquaredTo",value:function(t){var e=Dt.from(t).subtract(this.center),n=this.halfAxes,r=n.getColumn(0,Lt),i=n.getColumn(1,Ot),o=n.getColumn(2,Ft),a=r.magnitude(),s=i.magnitude(),u=o.magnitude();r.normalize(),i.normalize(),o.normalize();var l,c=0;return(l=Math.abs(e.dot(r))-a)>0&&(c+=l*l),(l=Math.abs(e.dot(i))-s)>0&&(c+=l*l),(l=Math.abs(e.dot(o))-u)>0&&(c+=l*l),c}},{key:"computePlaneDistances",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[-0,-0],r=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,o=this.center,a=this.halfAxes,s=a.getColumn(0,Lt),u=a.getColumn(1,Ot),l=a.getColumn(2,Ft),c=Rt.copy(s).add(u).add(l).add(o),h=zt.copy(c).subtract(t),f=e.dot(h);return r=Math.min(f,r),i=Math.max(f,i),c.copy(o).add(s).add(u).subtract(l),h.copy(c).subtract(t),f=e.dot(h),r=Math.min(f,r),i=Math.max(f,i),c.copy(o).add(s).subtract(u).add(l),h.copy(c).subtract(t),f=e.dot(h),r=Math.min(f,r),i=Math.max(f,i),c.copy(o).add(s).subtract(u).subtract(l),h.copy(c).subtract(t),f=e.dot(h),r=Math.min(f,r),i=Math.max(f,i),o.copy(c).subtract(s).add(u).add(l),h.copy(c).subtract(t),f=e.dot(h),r=Math.min(f,r),i=Math.max(f,i),o.copy(c).subtract(s).add(u).subtract(l),h.copy(c).subtract(t),f=e.dot(h),r=Math.min(f,r),i=Math.max(f,i),o.copy(c).subtract(s).subtract(u).add(l),h.copy(c).subtract(t),f=e.dot(h),r=Math.min(f,r),i=Math.max(f,i),o.copy(c).subtract(s).subtract(u).subtract(l),h.copy(c).subtract(t),f=e.dot(h),r=Math.min(f,r),i=Math.max(f,i),n[0]=r,n[1]=i,n}},{key:"transform",value:function(t){this.center.transformAsPoint(t);var e=this.halfAxes.getColumn(0,Lt);e.transformAsPoint(t);var n=this.halfAxes.getColumn(1,Ot);n.transformAsPoint(t);var r=this.halfAxes.getColumn(2,Ft);return r.transformAsPoint(t),this.halfAxes=new Tt([].concat((0,Q.Z)(e),(0,Q.Z)(n),(0,Q.Z)(r))),this}},{key:"getTransform",value:function(){throw new Error("not implemented")}}]),t}(),Kt=n(45903),Xt=n(47410),Yt=new pt.Z,$t=new pt.Z,te=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,1],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;(0,h.Z)(this,t),(0,d.Z)(this,"normal",void 0),(0,d.Z)(this,"distance",void 0),this.normal=new pt.Z,this.distance=-0,this.fromNormalDistance(e,n)}return(0,c.Z)(t,[{key:"fromNormalDistance",value:function(t,e){return(0,Kt.Z)(Number.isFinite(e)),this.normal.from(t).normalize(),this.distance=e,this}},{key:"fromPointNormal",value:function(t,e){t=Yt.from(t),this.normal.from(e).normalize();var n=-this.normal.dot(t);return this.distance=n,this}},{key:"fromCoefficients",value:function(t,e,n,r){return this.normal.set(t,e,n),(0,Kt.Z)((0,Xt.fS)(this.normal.len(),1)),this.distance=r,this}},{key:"clone",value:function(){return new t(this.normal,this.distance)}},{key:"equals",value:function(t){return(0,Xt.fS)(this.distance,t.distance)&&(0,Xt.fS)(this.normal,t.normal)}},{key:"getPointDistance",value:function(t){return this.normal.dot(t)+this.distance}},{key:"transform",value:function(t){var e=$t.copy(this.normal).transformAsVector(t).normalize(),n=this.normal.scale(-this.distance).transform(t);return this.fromPointNormal(n,e)}},{key:"projectPointOntoPlane",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];t=Yt.from(t);var n=this.getPointDistance(t),r=$t.copy(this.normal).scale(n);return t.subtract(r).to(e)}}]),t}(),ee=[new pt.Z([1,0,0]),new pt.Z([0,1,0]),new pt.Z([0,0,1])],ne=new pt.Z,re=new pt.Z,ie=(new te(new pt.Z(1,
20,0),0),function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];(0,h.Z)(this,t),(0,d.Z)(this,"planes",void 0),this.planes=e}return(0,c.Z)(t,[{key:"fromBoundingSphere",value:function(t){this.planes.length=2*ee.length;for(var e=t.center,n=t.radius,r=0,i=0,o=ee;i<o.length;i++){var a=o[i],s=this.planes[r],u=this.planes[r+1];s||(s=this.planes[r]=new te),u||(u=this.planes[r+1]=new te);var l=ne.copy(a).scale(-n).add(e);a.dot(l);s.fromPointNormal(l,a);var c=ne.copy(a).scale(n).add(e),h=re.copy(a).negate();h.dot(c);u.fromPointNormal(c,h),r+=2}return this}},{key:"computeVisibility",value:function(t){var e,n=ft,r=(0,j.Z)(this.planes);try{for(r.s();!(e=r.n()).done;){var i=e.value;switch(t.intersectPlane(i)){case ct:return ct;case ht:n=ht}}}catch(o){r.e(o)}finally{r.f()}return n}},{key:"computeVisibilityWithPlaneMask",value:function(e,n){if((0,Kt.Z)(Number.isFinite(n),"parentPlaneMask is required."),n===t.MASK_OUTSIDE||n===t.MASK_INSIDE)return n;for(var r=t.MASK_INSIDE,i=this.planes,o=0;o<this.planes.length;++o){var a=o<31?1<<o:0;if(!(o<31&&0===(n&a))){var s=i[o],u=e.intersectPlane(s);if(u===ct)return t.MASK_OUTSIDE;u===ht&&(r|=a)}}return r}}]),t}());(0,d.Z)(ie,"MASK_OUTSIDE",4294967295),(0,d.Z)(ie,"MASK_INSIDE",0),(0,d.Z)(ie,"MASK_INDETERMINATE",2147483647);new pt.Z,new pt.Z,new pt.Z,new pt.Z,new pt.Z,new pt.Z,new pt.Z,new pt.Z,new pt.Z,new pt.Z,new pt.Z,new pt.Z,new pt.Z,new pt.Z,new pt.Z,new pt.Z,new pt.Z,Math.PI;var oe={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},ae=new Tt,se=new Tt,ue=new Tt,le=new Tt,ce=new Tt;function he(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=oe.EPSILON20,r=0,i=0,o=se,a=ue;o.identity(),a.copy(t);for(var s=n*function(t){for(var e=0,n=0;n<9;++n){var r=t[n];e+=r*r}return Math.sqrt(e)}(a);i<10&&de(a)>s;)Ae(a,le),ce.copy(le).transpose(),a.multiplyRight(le),a.multiplyLeft(ce),o.multiplyRight(le),++r>2&&(++i,r=0);return e.unitary=o.toTarget(e.unitary),e.diagonal=a.toTarget(e.diagonal),e}var fe=[1,0,0],pe=[2,2,1];function de(t){for(var e=0,n=0;n<3;++n){var r=t[ae.getElementIndex(pe[n],fe[n])];e+=2*r*r}return Math.sqrt(e)}function Ae(t,e){for(var n=oe.EPSILON15,r=0,i=1,o=0;o<3;++o){var a=Math.abs(t[ae.getElementIndex(pe[o],fe[o])]);a>r&&(i=o,r=a)}var s=fe[i],u=pe[i],l=1,c=0;if(Math.abs(t[ae.getElementIndex(u,s)])>n){var h,f=(t[ae.getElementIndex(u,u)]-t[ae.getElementIndex(s,s)])/2/t[ae.getElementIndex(u,s)];c=(h=f<0?-1/(-f+Math.sqrt(1+f*f)):1/(f+Math.sqrt(1+f*f)))*(l=1/Math.sqrt(1+h*h))}return Tt.IDENTITY.to(e),e[ae.getElementIndex(s,s)]=e[ae.getElementIndex(u,u)]=l,e[ae.getElementIndex(u,s)]=c,e[ae.getElementIndex(s,u)]=-c,e}var ve=new pt.Z,ge=new pt.Z,me=new pt.Z,ye=new pt.Z,_e=new pt.Z,be=new Tt,xe={diagonal:new Tt,unitary:new Tt};var we=512,Ce=3,Be=[[.5,.5],[0,0],[0,1],[1,0],[1,1]],ke=Be.concat([[0,.5],[.5,0],[1,.5],[.5,1]]),Ee=ke.concat([[.25,.5],[.75,.5]]),Se=function(){function t(e,n,r){(0,h.Z)(this,t),(0,d.Z)(this,"x",void 0),(0,d.Z)(this,"y",void 0),(0,d.Z)(this,"z",void 0),(0,d.Z)(this,"childVisible",void 0),(0,d.Z)(this,"selected",void 0),(0,d.Z)(this,"_children",void 0),this.x=e,this.y=n,this.z=r}return(0,c.Z)(t,[{key:"children",get:function(){if(!this._children){var e=2*this.x,n=2*this.y,r=this.z+1;this._children=[new t(e,n,r),new t(e,n+1,r),new t(e+1,n,r),new t(e+1,n+1,r)]}return this._children}},{key:"update",value:function(t){var e=t.viewport,n=t.cullingVolume,r=t.elevationBounds,i=t.minZ,o=t.maxZ,a=t.bounds,s=t.offset,u=t.project,l=this.getBoundingVolume(r,s,u);if(a&&!this.insideBounds(a))return!1;if(n.computeVisibility(l)<0)return!1;if(!this.childVisible){var c=this.z;if(c<o&&c>=i){var h=l.distanceTo(e.cameraPosition)*e.scale/e.height;c+=Math.floor(Math.log2(h))}if(c>=o)return this.selected=!0,!0}this.selected=!1,this.childVisible=!0;var f,p=(0,j.Z)(this.children);try{for(p.s();!(f=p.n()).done;){f.value.update(t)}}catch(d){p.e(d)}finally{p.f()}return!0}},{key:"getSelected",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(this.selected&&t.push(this),this._children){var e,n=(0,j.Z)(this._children);try{for(n.s();!(e=n.n()).done;){e.value.getSelected(t)}}catch(r){n.e(r)}finally{n.f()}}return t}},{key:"insideBounds",value:function(t){var e=(0,b.Z)(t,4),n=e[0],r=e[1],i=e[2],o=e[3],a=Math.pow(2,this.z),s=we/a;return this.x*s<i&&this.y*s<o&&(this.x+1)*s>n&&(this.y+1)*s>r}},{key:"getBoundingVolume",value:function(t,e,n){if(n){var r,i=this.z<1?Ee:this.z<2?ke:Be,o=[],a=(0,j.Z)(i);try{for(a.s();!(r=a.n()).done;){var s=r.value,u=Oe(this.x+s[0],this.y+s[1],this.z);u[2]=t[0],o.push(n(u)),t[0]!==t[1]&&(u[2]=t[1],o.push(n(u)))}}catch(p){a.e(p)}finally{a.f()}return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new qt;if(!t||0===t.length)return e.halfAxes=new Tt([0,0,0,0,0,0,0,0,0]),e.center=new pt.Z,e;var n,r=t.length,i=new pt.Z(0,0,0),o=(0,j.Z)(t);try{for(o.s();!(n=o.n()).done;){var a=n.value;i.add(a)}}catch(p){o.e(p)}finally{o.f()}var s=1/r;i.multiplyByScalar(s);var u,l=0,c=0,h=0,f=0,d=0,A=0,v=(0,j.Z)(t);try{for(v.s();!(u=v.n()).done;){var g=u.value,m=ve.copy(g).subtract(i);l+=m.x*m.x,c+=m.x*m.y,h+=m.x*m.z,f+=m.y*m.y,d+=m.y*m.z,A+=m.z*m.z}}catch(p){v.e(p)}finally{v.f()}l*=s,c*=s,h*=s,f*=s,d*=s,A*=s;var y=be;y[0]=l,y[1]=c,y[2]=h,y[3]=c,y[4]=f,y[5]=d,y[6]=h,y[7]=d,y[8]=A;var _,b=he(y,xe).unitary,x=e.halfAxes.copy(b),w=x.getColumn(0,me),C=x.getColumn(1,ye),B=x.getColumn(2,_e),k=-Number.MAX_VALUE,E=-Number.MAX_VALUE,S=-Number.MAX_VALUE,T=Number.MAX_VALUE,M=Number.MAX_VALUE,I=Number.MAX_VALUE,P=(0,j.Z)(t);try{for(P.s();!(_=P.n()).done;){var Z=_.value;ve.copy(Z),k=Math.max(ve.dot(w),k),E=Math.max(ve.dot(C),E),S=Math.max(ve.dot(B),S),T=Math.min(ve.dot(w),T),M=Math.min(ve.dot(C),M),I=Math.min(ve.dot(B),I)}}catch(p){P.e(p)}finally{P.f()}w=w.multiplyByScalar(.5*(T+k)),C=C.multiplyByScalar(.5*(M+E)),B=B.multiplyByScalar(.5*(I+S)),e.center.copy(w).add(C).add(B);var D=ge.set(k-T,E-M,S-I).multiplyByScalar(.5),L=new Tt([D[0],0,0,0,D[1],0,0,0,D[2]]);return e.halfAxes.multiplyRight(L),e}(o)}var l=Math.pow(2,this.z),c=we/l,h=this.x*c+e*we,f=we-(this.y+1)*c;return new vt([h,f,t[0]],[h+c,f+c,t[1]])}}]),t}();var Te=512,Me=[-1/0,-1/0,1/0,1/0],Ie={type:"url",value:null,validate:function(t,e){return e.optional&&null===t||"string"===typeof t||Array.isArray(t)&&t.every((function(t){return"string"===typeof t}))},equals:function(t,e){if(t===e)return!0;
2if(!Array.isArray(t)||!Array.isArray(e))return!1;var n=t.length;if(n!==e.length)return!1;for(var r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}};function Pe(t,e){var 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]])],r=[Math.min.apply(Math,(0,Q.Z)(n.map((function(t){return t[0]})))),Math.min.apply(Math,(0,Q.Z)(n.map((function(t){return t[1]})))),Math.max.apply(Math,(0,Q.Z)(n.map((function(t){return t[0]})))),Math.max.apply(Math,(0,Q.Z)(n.map((function(t){return t[1]}))))];return r}function Ze(t,e){if(!t||!t.length)return null;var n,r=e.index,i=e.id;Array.isArray(t)&&(t=t[(n=i,Math.abs(n.split("").reduce((function(t,e){return(t<<5)-t+e.charCodeAt(0)|0}),0))%t.length)]);for(var o=t,a=0,s=Object.keys(r);a<s.length;a++){var u=s[a],l=new RegExp("{".concat(u,"}"),"g");o=o.replace(l,String(r[u]))}return Number.isInteger(r.y)&&Number.isInteger(r.z)&&(o=o.replace(/\{-y\}/g,String(Math.pow(2,r.z)-r.y-1))),o}function De(t){var e=t.viewport,n=t.z,r=t.cullRect,i=r.x-e.x,o=r.y-e.y,a=r.width,s=r.height;if(!Array.isArray(n)){var u={targetZ:n||0},l=e.unproject([i,o],u),c=e.unproject([i+a,o],u),h=e.unproject([i,o+s],u),f=e.unproject([i+a,o+s],u);return[Math.min(l[0],c[0],h[0],f[0]),Math.min(l[1],c[1],h[1],f[1]),Math.max(l[0],c[0],h[0],f[0]),Math.max(l[1],c[1],h[1],f[1])]}var p=De({viewport:e,z:n[0],cullRect:r}),d=De({viewport:e,z:n[1],cullRect:r});return[Math.min(p[0],d[0]),Math.min(p[1],d[1]),Math.max(p[2],d[2]),Math.max(p[3],d[3])]}function Le(t,e){return Math.pow(2,t)*Te/e}function Oe(t,e,n){var r=Le(n,Te),i=t/r*360-180,o=Math.PI-2*Math.PI*e/r;return[i,180/Math.PI*Math.atan(.5*(Math.exp(o)-Math.exp(-o)))]}function Fe(t,e,n,r){var i=Le(n,r);return[t/i*Te,e/i*Te]}function Re(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Te;if(t.isGeospatial){var o=Oe(e,n,r),a=(0,b.Z)(o,2),s=a[0],u=a[1],l=Oe(e+1,n+1,r),c=(0,b.Z)(l,2);return{west:s,north:u,east:c[0],south:c[1]}}var h=Fe(e,n,r,i),f=(0,b.Z)(h,2),p=f[0],d=f[1],A=Fe(e+1,n+1,r,i),v=(0,b.Z)(A,2);return{left:p,top:d,right:v[0],bottom:v[1]}}function ze(t,e,n,r,i){for(var o=function(t,e,n){var r;if(e&&2===e.length){var i=(0,b.Z)(e,2),o=i[0],a=i[1],s=t.getBounds({z:o}),u=t.getBounds({z:a});r=[Math.min(s[0],u[0]),Math.min(s[1],u[1]),Math.max(s[2],u[2]),Math.max(s[3],u[3])]}else r=t.getBounds();return t.isGeospatial?[Math.max(r[0],n[0]),Math.max(r[1],n[1]),Math.min(r[2],n[2]),Math.min(r[3],n[3])]:[Math.max(Math.min(r[0],n[2]),n[0]),Math.max(Math.min(r[1],n[3]),n[1]),Math.min(Math.max(r[2],n[0]),n[2]),Math.min(Math.max(r[3],n[1]),n[3])]}(t,null,r),a=function(t,e,n){if(n){var r=Pe(t,n).map((function(t){return t*e/Te}));return r}return t.map((function(t){return t*e/Te}))}(o,Le(e,n),i),s=(0,b.Z)(a,4),u=s[0],l=s[1],c=s[2],h=s[3],f=[],p=Math.floor(u);p<c;p++)for(var d=Math.floor(l);d<h;d++)f.push({x:p,y:d,z:e});return f}function Ue(t){var e=t.viewport,n=t.maxZoom,r=t.minZoom,i=t.zRange,o=t.extent,a=t.tileSize,s=void 0===a?Te:a,u=t.modelMatrix,l=t.modelMatrixInverse,c=t.zoomOffset,h=void 0===c?0:c,f=e.isGeospatial?Math.round(e.zoom+Math.log2(Te/s))+h:Math.ceil(e.zoom)+h;if("number"===typeof r&&Number.isFinite(r)&&f<r){if(!o)return[];f=r}"number"===typeof n&&Number.isFinite(n)&&f>n&&(f=n);var p=o;
2return u&&l&&o&&!e.isGeospatial&&(p=Pe(o,u)),e.isGeospatial?function(t,e,n,r){var i=t instanceof at&&t.resolution?t.projectPosition:null,o=Object.values(t.getFrustumPlanes()).map((function(t){var e=t.normal,n=t.distance;return new te(e.clone().negate(),n)})),a=new ie(o),s=t.distanceScales.unitsPerMeter[2],u=n&&n[0]*s||0,l=n&&n[1]*s||0,c=t instanceof lt.Z&&t.pitch<=60?e:0;if(r){var h=r,f=(0,b.Z)(h,4),p=f[0],d=f[1],A=f[2],v=f[3],g=(0,F.w5)([p,v]),m=(0,F.w5)([A,d]);r=[g[0],we-g[1],m[0],we-m[1]]}var y=new Se(0,0,0),_={viewport:t,project:i,cullingVolume:a,elevationBounds:[u,l],minZ:c,maxZ:e,bounds:r,offset:0};if(y.update(_),t instanceof lt.Z&&t.subViewports&&t.subViewports.length>1){for(_.offset=-1;y.update(_)&&!(--_.offset<-Ce););for(_.offset=1;y.update(_)&&!(++_.offset>Ce););}return y.getSelected()}(e,f,i,o):ze(e,f,s,p||Me,l)}var Ne,Ge=n(92138),je={id:"request-scheduler",throttleRequests:!0,maxRequests:6},Ve=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,h.Z)(this,t),(0,d.Z)(this,"props",void 0),(0,d.Z)(this,"stats",void 0),(0,d.Z)(this,"activeRequestCount",0),(0,d.Z)(this,"requestQueue",[]),(0,d.Z)(this,"requestMap",new Map),(0,d.Z)(this,"deferredUpdate",null),this.props=(0,v.Z)((0,v.Z)({},je),e),this.stats=new Ge.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")}return(0,c.Z)(t,[{key:"scheduleRequest",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return 0};if(!this.props.throttleRequests)return Promise.resolve({done:function(){}});if(this.requestMap.has(t))return this.requestMap.get(t);var n={handle:t,priority:0,getPriority:e},r=new Promise((function(t){return n.resolve=t,n}));return this.requestQueue.push(n),this.requestMap.set(t,r),this._issueNewRequests(),r}},{key:"_issueRequest",value:function(t){var e=this,n=t.handle,r=t.resolve,i=!1,o=function(){i||(i=!0,e.requestMap.delete(n),e.activeRequestCount--,e._issueNewRequests())};return this.activeRequestCount++,r?r({done:o}):Promise.resolve({done:o})}},{key:"_issueNewRequests",value:function(){var t=this;this.deferredUpdate||(this.deferredUpdate=setTimeout((function(){return t._issueNewRequestsAsync()}),0))}},{key:"_issueNewRequestsAsync",value:function(){this.deferredUpdate=null;var t=Math.max(this.props.maxRequests-this.activeRequestCount,0);if(0!==t){this._updateAllRequests();for(var e=0;e<t;++e){var n=this.requestQueue.shift();n&&this._issueRequest(n)}}}},{key:"_updateAllRequests",value:function(){for(var t=this.requestQueue,e=0;e<t.length;++e){var n=t[e];this._updateRequest(n)||(t.splice(e,1),this.requestMap.delete(n.handle),e--)}t.sort((function(t,e){return t.priority-e.priority}))}},{key:"_updateRequest",value:function(t){return t.priority=t.getPriority(t.handle),!(t.priority<0)||(t.resolve(null),!1)}}]),t}(),He=n(18188),Je=2,We="best-available",Qe=(Ne={},(0,d.Z)(Ne,We,(function(t){var e,n=(0,j.Z)(t);try{for(n.s();!(e=n.n()).done;){e.value.state=0}}catch(l){n.e(l)}finally{n.f()}var r,i=(0,j.Z)(t);try{for(i.s();!(r=i.n()).done;){var o=r.value;o.isSelected&&!Ke(o)&&Xe(o)}}catch(l){i.e(l)}finally{i.f()}var a,s=(0,j.Z)(t);try{for(s.s();!(a=s.n()).done;){var u=a.value;u.isVisible=Boolean(u.state&Je)}}catch(l){s.e(l)}finally{s.f()}})),(0,d.Z)(Ne,"no-overlap",(function(t){var e,n=(0,j.Z)(t);try{for(n.s();!(e=n.n()).done;){e.value.state=0}}catch(f){n.e(f)}finally{n.f()}var r,i=(0,j.Z)(t);try{for(i.s();!(r=i.n()).done;){var o=r.value;o.isSelected&&Ke(o)}}catch(f){i.e(f)}finally{i.f()}var a,s=Array.from(t).sort((function(t,e){return t.zoom-e.zoom})),u=(0,j.Z)(s);try{for(u.s();!(a=u.n()).done;){var l=a.value;if(l.isVisible=Boolean(l.state&Je),l.children&&(l.isVisible||1&l.state)){var c,h=(0,j.Z)(l.children);try{for(h.s();!(c=h.n()).done;){c.value.state=1}}catch(f){h.e(f)}finally{h.f()}}else l.isSelected&&Xe(l)}}catch(f){u.e(f)}finally{u.f()}})),(0,d.Z)(Ne,"never",(function(){})),Ne),qe=function(){function t(e){var n=this;(0,h.Z)(this,t),(0,d.Z)(this,"opts",void 0),(0,d.Z)(this,"_requestScheduler",void 0),(0,d.Z)(this,"_cache",void 0),(0,d.Z)(this,"_dirty",void 0),(0,d.Z)(this,"_tiles",void 0),(0,d.Z)(this,"_cacheByteSize",void 0),(0,d.Z)(this,"_viewport",void 0),(0,d.Z)(this,"_zRange",void 0),(0,d.Z)(this,"_selectedTiles",void 0),(0,d.Z)(this,"_frameNumber",void 0),(0,d.Z)(this,"_modelMatrix",void 0),(0,d.Z)(this,"_modelMatrixInverse",void 0),(0,d.Z)(this,"_maxZoom",void 0),(0,d.Z)(this,"_minZoom",void 0),(0,d.Z)(this,"onTileLoad",void 0),(0,d.Z)(this,"_getCullBounds",(0,He.Z)(De)),this.opts=e,this.onTileLoad=function(t){n.opts.onTileLoad(t),n.opts.maxCacheByteSize&&(n._cacheByteSize+=t.byteLength,n._resizeCache())}
2,this._requestScheduler=new Ve({maxRequests:e.maxRequests,throttleRequests:e.maxRequests>0}),this._cache=new Map,this._tiles=[],this._dirty=!1,this._cacheByteSize=0,this._viewport=null,this._selectedTiles=null,this._frameNumber=0,this._modelMatrix=new K.Z,this._modelMatrixInverse=new K.Z,this.setOptions(e)}return(0,c.Z)(t,[{key:"tiles",get:function(){return this._tiles}},{key:"selectedTiles",get:function(){return this._selectedTiles}},{key:"isLoaded",get:function(){return null!==this._selectedTiles&&this._selectedTiles.every((function(t){return t.isLoaded}))}},{key:"needsReload",get:function(){return null!==this._selectedTiles&&this._selectedTiles.some((function(t){return t.needsReload}))}},{key:"setOptions",value:function(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))}},{key:"finalize",value:function(){var t,e=(0,j.Z)(this._cache.values());try{for(e.s();!(t=e.n()).done;){var n=t.value;n.isLoading&&n.abort()}}catch(r){e.e(r)}finally{e.f()}this._cache.clear(),this._tiles=[],this._selectedTiles=null}},{key:"reloadAll",value:function(){var t,e=(0,j.Z)(this._cache.keys());try{for(e.s();!(t=e.n()).done;){var n=t.value,r=this._cache.get(n);this._selectedTiles&&this._selectedTiles.includes(r)?r.setNeedsReload():this._cache.delete(n)}}catch(i){e.e(i)}finally{e.f()}}},{key:"update",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.zRange,i=n.modelMatrix,o=new K.Z(i),a=!o.equals(this._modelMatrix);if(this._viewport&&t.equals(this._viewport)&&(0,Xt.fS)(this._zRange,r)&&!a)this.needsReload&&(this._selectedTiles=this._selectedTiles.map((function(t){return e._getTile(t.index,!0)})));else{a&&(this._modelMatrixInverse=o.clone().invert(),this._modelMatrix=o),this._viewport=t,this._zRange=r;var s=this.getTileIndices({viewport:t,maxZoom:this._maxZoom,minZoom:this._minZoom,zRange:r,modelMatrix:this._modelMatrix,modelMatrixInverse:this._modelMatrixInverse});this._selectedTiles=s.map((function(t){return e._getTile(t,!0)})),this._dirty&&this._rebuildTree()}var u=this.updateTileStates();return this._pruneRequests(),this._dirty&&this._resizeCache(),u&&this._frameNumber++,this._frameNumber}},{key:"isTileVisible",value:function(t,e){if(!t.isVisible)return!1;if(e&&this._viewport){var n=De({viewport:this._viewport,z:this._zRange,cullRect:e}),r=(0,b.Z)(n,4),i=r[0],o=r[1],a=r[2],s=r[3],u=t.bbox;if("west"in u)return u.west<a&&u.east>i&&u.south<s&&u.north>o;var l=Math.min(u.top,u.bottom),c=Math.max(u.top,u.bottom);return u.left<a&&u.right>i&&l<s&&c>o}return!0}},{key:"getTileIndices",value:function(t){var e=t.viewport,n=t.maxZoom,r=t.minZoom,i=t.zRange,o=t.modelMatrix,a=t.modelMatrixInverse,s=this.opts;return Ue({viewport:e,maxZoom:n,minZoom:r,zRange:i,tileSize:s.tileSize,extent:s.extent,modelMatrix:o,modelMatrixInverse:a,zoomOffset:s.zoomOffset})}},{key:"getTileId",value:function(t){return"".concat(t.x,"-").concat(t.y,"-").concat(t.z)}},{key:"getTileZoom",value:function(t){return t.z}},{key:"getTileMetadata",value:function(t){var e=this.opts.tileSize;return{bbox:Re(this._viewport,t.x,t.y,t.z,e)}}},{key:"getParentIndex",value:function(t){return{x:Math.floor(t.x/2),y:Math.floor(t.y/2),z:t.z-1}}},{key:"updateTileStates",value:function(){var t,e=this.opts.refinementStrategy||We,n=new Array(this._cache.size),r=0,i=(0,j.Z)(this._cache.values());try{for(i.s();!(t=i.n()).done;){var o=t.value;n[r++]=o.isVisible,o.isSelected=!1,o.isVisible=!1}}catch(f){i.e(f)}finally{i.f()}var a,s=(0,j.Z)(this._selectedTiles);try{for(s.s();!(a=s.n()).done;){var u=a.value;u.isSelected=!0,u.isVisible=!0}}catch(f){s.e(f)}finally{s.f()}("function"===typeof e?e:Qe[e])(Array.from(this._cache.values())),r=0;var l,c=(0,j.Z)(this._cache.values());try{for(c.s();!(l=c.n()).done;){var h=l.value;if(n[r++]!==h.isVisible)return!0}}catch(f){c.e(f)}finally{c.f()}return!1}},{key:"_pruneRequests",value:function(){var t,e=this.opts.maxRequests,n=[],r=0,i=(0,j.Z)(this._cache.values());try{for(i.s();!(t=i.n()).done;){var o=t.value;o.isLoading&&(r++,o.isSelected||o.isVisible||n.push(o))}}catch(a){i.e(a)}finally{i.f()}for(;e>0&&r>e&&n.length>0;){n.shift().abort(),r--}}},{key:"_rebuildTree",value:function(){var t,e=this._cache,n=(0,j.Z)(e.values());try{for(n.s();!(t=n.n()).done;){var r=t.value;r.parent=null,r.children&&(r.children.length=0)}}catch(u){n.e(u)}finally{n.f()}var i,o=(0,j.Z)(e.values());try{for(o.s();!(i=o.n()).done;){var a=i.value,s=this._getNearestAncestor(a);a.parent=s,null!==s&&void 0!==s&&s.children&&s.children.push(a)}}catch(u){o.e(u)}finally{o.f()}}},{key:"_resizeCache",value:function(){var t=this._cache,e=this.opts,n=e.maxCacheSize||(e.maxCacheByteSize?1/0:5*this.selectedTiles.length),r=e.maxCacheByteSize||1/0;if(t.size>n||this._cacheByteSize>r){var i,o=(0,j.Z)(t);try{for(o.s();!(i=o.n()).done;){var a=(0,b.Z)(i.value,2),s=a[0],u=a[1];if(u.isVisible||u.isSelected||(this._cacheByteSize-=e.maxCacheByteSize?u.byteLength:0,t.delete(s),this.opts.onTileUnload(u)),t.size<=n&&this._cacheByteSize<=r)break}}catch(l){o.e(l)}finally{o.f()}this._rebuildTree(),this._dirty=!0}this._dirty&&(this._tiles=Array.from(this._cache.values()).sort((function(t,e){return t.zoom-e.zoom})),this._dirty=!1)}},{key:"_getTile",value:function(t,e){var n=this.getTileId(t),r=this._cache.get(n),i=!1;return!r&&e?(r=new W(t),Object.assign(r,this.getTileMetadata(r.index)),Object.assign(r,{id:n,zoom:this.getTileZoom(r.index)}),i=!0,this._cache.set(n,r),this._dirty=!0):r&&r.needsReload&&(i=!0),r&&i&&r.loadData({getData:this.opts.getTileData,requestScheduler:this._requestScheduler,onLoad:this.onTileLoad,onError:this.opts.onTileError}),r}},{key:"_getNearestAncestor",value:function(t){for(var e=this._minZoom,n=void 0===e?0:e,r=t.index;this.getTileZoom(r)>n;){r=this.getParentIndex(r);var i=this._getTile(r);if(i)return i}return null}}]),t}();function Ke(t){for(var e=t;e;){if(e.isLoaded||e.content)return e.state|=Je,!0;e=e.parent}return!1}function Xe(t){var e,n=(0,j.Z)(t.children);try{for(n.s();!(e=n.n()).done;){var r=e.value;r.isLoaded||r.content?r.state|=Je:Xe(r)}}catch(i){n.e(i)}finally{n.f()}}var Ye={TilesetClass:qe,data:{type:"data",value:[]},dataComparator:Ie.equals,renderSubLayers:{type:"function",value:function(t){return new G.Z(t)},compare:!1},getTileData:{type:"function",optional:!0,value:null,compare:!1},onViewportLoad:{type:"function",optional:!0,value:null,compare:!1},onTileLoad:{type:"function",value:function(t){},compare:!1},onTileUnload:{type:"function",value:function(t){},compare:!1},onTileError:{type:"function",value:function(t){return console.error(t)},compare:!1},extent:{type:"array",optional:!0,value:null,compare:!0},tileSize:512,maxZoom:null,minZoom:0,maxCacheSize:null,maxCacheByteSize:null,refinementStrategy:We,zRange:null,maxRequests:6,zoomOffset:0},$e=function(t){(0,f.Z)(n,t);var e=(0,p.Z)(n);function n(){return(0,h.Z)(this,n),e.apply(this,arguments)}return(0,c.Z)(n,[{key:"initializeState",value:function(){this.state={t
2ileset:null,isLoaded:!1}}},{key:"finalizeState",value:function(){var t,e;null===(t=this.state)||void 0===t||null===(e=t.tileset)||void 0===e||e.finalize()}},{key:"isLoaded",get:function(){var t,e;return null===(t=this.state)||void 0===t||null===(e=t.tileset)||void 0===e?void 0:e.selectedTiles.every((function(t){return t.isLoaded&&t.layers&&t.layers.every((function(t){return t.isLoaded}))}))}},{key:"shouldUpdateState",value:function(t){return t.changeFlags.somethingChanged}},{key:"updateState",value:function(t){var e=t.changeFlags,n=this.state.tileset,r=e.propsOrDataChanged||e.updateTriggersChanged,i=e.dataChanged||e.updateTriggersChanged&&(e.updateTriggersChanged.all||e.updateTriggersChanged.getTileData);n?r&&(n.setOptions(this._getTilesetOptions()),i?n.reloadAll():this.state.tileset.tiles.forEach((function(t){t.layers=null}))):(n=new this.props.TilesetClass(this._getTilesetOptions()),this.setState({tileset:n})),this._updateTileset()}},{key:"_getTilesetOptions",value:function(){var t=this.props,e=t.tileSize,n=t.maxCacheSize,r=t.maxCacheByteSize,i=t.refinementStrategy,o=t.extent;return{maxCacheSize:n,maxCacheByteSize:r,maxZoom:t.maxZoom,minZoom:t.minZoom,tileSize:e,refinementStrategy:i,extent:o,maxRequests:t.maxRequests,zoomOffset:t.zoomOffset,getTileData:this.getTileData.bind(this),onTileLoad:this._onTileLoad.bind(this),onTileError:this._onTileError.bind(this),onTileUnload:this._onTileUnload.bind(this)}}},{key:"_updateTileset",value:function(){var t=this.state.tileset,e=this.props,n=e.zRange,r=e.modelMatrix,i=t.update(this.context.viewport,{zRange:n,modelMatrix:r}),o=t.isLoaded,a=this.state.isLoaded!==o,s=this.state.frameNumber!==i;o&&(a||s)&&this._onViewportLoad(),s&&this.setState({frameNumber:i}),this.state.isLoaded=o}},{key:"_onViewportLoad",value:function(){var t=this.state.tileset,e=this.props.onViewportLoad;e&&e(t.selectedTiles)}},{key:"_onTileLoad",value:function(t){this.props.onTileLoad(t),t.layers=null,this.setNeedsUpdate()}},{key:"_onTileError",value:function(t,e){this.props.onTileError(t),e.layers=null,this.setNeedsUpdate()}},{key:"_onTileUnload",value:function(t){this.props.onTileUnload(t)}},{key:"getTileData",value:function(t){var e=this.props,n=e.data,r=e.getTileData,i=e.fetch,o=t.signal;return t.url="string"===typeof n||Array.isArray(n)?Ze(n,t):null,r?r(t):i&&t.url?i(t.url,{propName:"data",layer:this,signal:o}):null}},{key:"renderSubLayers",value:function(t){return this.props.renderSubLayers(t)}},{key:"getSubLayerPropsByTile",value:function(t){return null}},{key:"getPickingInfo",value:function(t){var e=t.info,n=t.sourceLayer;return e.picked&&(e.tile=n.props.tile),e}},{key:"_updateAutoHighlight",value:function(t){t.sourceLayer&&t.sourceLayer.updateAutoHighlight(t)}},{key:"renderLayers",value:function(){var t=this;return this.state.tileset.tiles.map((function(e){var n=t.getSubLayerPropsByTile(e);if(e.isLoaded||e.content)if(e.layers)n&&e.layers[0]&&Object.keys(n).some((function(t){return e.layers[0].props[t]!==n[t]}))&&(e.layers=e.layers.map((function(t){return t.clone(n)})));else{var r=t.renderSubLayers((0,v.Z)((0,v.Z)({},t.props),{},{id:"".concat(t.id,"-").concat(e.id),data:e.content,_offset:0,tile:e}));e.layers=(0,N.x)(r,Boolean).map((function(t){return t.clone((0,v.Z)({tile:e},n))}))}else;return e.layers}))}},{key:"filterSubLayer",value:function(t){var e=t.layer,n=t.cullRect,r=e.props.tile;return this.state.tileset.isTileVisible(r,n)}}]),n}(g.Z);(0,d.Z)($e,"defaultProps",Ye),(0,d.Z)($e,"layerName","TileLayer");var tn=n(83138),en=n(27597),nn=function(t){(0,f.Z)(n,t);var e=(0,p.Z)(n);function n(){return(0,h.Z)(this,n),e.apply(this,arguments)}return(0,c.Z)(n,[{key:"getShaders",value:function(){var t=(0,tn.Z)((0,en.Z)(n.prototype),"getShaders",this).call(this);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;
2\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}},{key:"initializeState",value:function(){(0,tn.Z)((0,en.Z)(n.prototype),"initializeState",this).call(this),this.getAttributeManager().addInstanced({timestamps:{size:1,accessor:"getTimestamps",shaderAttributes:{instanceTimestamps:{vertexOffset:0},instanceNextTimestamps:{vertexOffset:1}}}})}},{key:"draw",value:function(t){var e=this.props,r=e.fadeTrail,i=e.trailLength,o=e.currentTime;t.uniforms=(0,v.Z)((0,v.Z)({},t.uniforms),{},{fadeTrail:r,trailLength:i,currentTime:o}),(0,tn.Z)((0,en.Z)(n.prototype),"draw",this).call(this,t)}}]),n}(n(69554).Z);(0,d.Z)(nn,"layerName","TripsLayer"),(0,d.Z)(nn,"defaultProps",{fadeTrail:!0,trailLength:{type:"number",value:120,min:0},currentTime:{type:"number",value:0,min:0},getTimestamps:{type:"accessor",value:function(t){return t.timestamps}}});var rn=function(t){var e,n="undefined"!==typeof(t=t||{})?t:{},r={};for(e in n)n.hasOwnProperty(e)&&(r[e]=n[e]);var i,o=[],a="";document.currentScript&&(a=document.currentScript.src),a=0!==a.indexOf("blob:")?a.substr(0,a.lastIndexOf("/")+1):"",i=function(t,e,n){var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=function(){if(200==r.status||0==r.status&&r.response)e(r.response);else{var i=q(t);i?e(i.buffer):n()}},r.onerror=n,r.send(null)};var s=n.print||console.log.bind(console),u=n.printErr||console.warn.bind(console);for(e in r)r.hasOwnProperty(e)&&(n[e]=r[e]);r=null,n.arguments&&(o=n.arguments);var l=0,c=function(){return l};var h=!1;function f(t){var e,r=n["_"+t];return e="Cannot call unknown function "+t+", make sure it is exported",r||lt("Assertion failed: "+e),r}function p(t,e,n,r,i){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,r){if(!(r>0))return 0;for(var i=n,o=n+r-1,a=0;a<t.length;++a){var s=t.charCodeAt(a);if(s>=55296&&s<=57343)s=65536+((1023&s)<<10)|1023&t.charCodeAt(++a);if(s<=127){if(n>=o)break;e[n++]=s}else if(s<=2047){if(n+1>=o)break;e[n++]=192|s>>6,e[n++]=128|63&s}else if(s<=65535){if(n+2>=o)break;e[n++]=224|s>>12,e[n++]=128|s>>6&63,e[n++]=128|63&s}else{if(n+3>=o)break;e[n++]=240|s>>18,e[n++]=128|s>>12&63,e[n++]=128|s>>6&63,e[n++]=128|63&s}}e[n]=0})(t,m,e,n)})(t,e=et(n),n)}return e},array:function(t){var e=et(t.length);return function(t,e){g.set(t,e)}(t,e),e}};var a=f(t),s=[],u=0;if(r)for(var l=0;l<r.length;l++){var c=o[n[l]];c?(0===u&&(u=rt()),s[l]=c(r[l])):s[l]=r[l]}var h=a.apply(null,s);return h=function(t){return"string"===e?A(t):"boolean"===e?Boolean(t):t}(h),0!==u&&nt(u),h}var d="undefined"!==typeof TextDecoder?new TextDecoder("utf8"):void 0;function A(t,e){return t?function(t,e,n){for(var r=e+n,i=e;t[i]&&!(i>=r);)++i;if(i-e>16&&t.subarray&&d)return d.decode(t.subarray(e,i));for(var o="";e<i;){var a=t[e++];if(128&a){var s=63&t[e++];if(192!=(224&a)){var u=63&t[e++];if((a=224==(240&a)?(15&a)<<12|s<<6|u:(7&a)<<18|s<<12|u<<6|63&t[e++])<65536)o+=String.fromCharCode(a);else{var l=a-65536;o+=String.fromCharCode(55296|l>>10,56320|1023&l)}}else o+=String.fromCharCode((31&a)<<6|s)}else o+=String.fromCharCode(a)}return o}(m,t,e):""}var v,g,m,y,_,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){v=t,n.HEAP8=g=new Int8Array(t),n.HEAP16=y=new Int16Array(t),n.HEAP32=_=new Int32Array(t),n.HEAPU8=m=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 k(t){for(;t.length>0;){var e=t.shift();if("function"!=typeof e){var r=e.func;"number"===typeof r?void 0===e.arg?n.dynCall_v(r):n.dynCall_vi(r,e.arg):r(void 0===e.arg?null:e.arg)}else e()}}B=(v=n.buffer?n.buffer:new ArrayBuffer(B)).byteLength,C(v),_[6004]=5266928;var E=[],S=[],T=[],M=[];var I=Math.abs,P=Math.ceil,Z=Math.floor,D=Math.min,L=0,O=null,F=null;n.preloadedImages={},n.preloadedAudios={};var R,z,U=null,N="data:application/octet-stream;base64,";function G(t){return String.prototype.startsWith?t.startsWith(N):0===t.indexOf(N)}U="data:application/octet-stream;base64,AAAAAAAAAAACAAAAAwAAAAEAAAAFAAAABAAAAAYAAAAAAAAAAAAAAAAAAAABAAAAAgAAAAMAAAAEAAAABQAAAAYAAAABAAAABAAAAAMAAAAGAAAABQAAAAIAAAAAAAAAAgAAAAMAAAABAAAABAAAAAYAAAAAAAAABQAAAAMAAAAGAAAABAAAAAUAAAAAAAAAAQAAAAIAAAAEAAAABQAAAAYAAAAAAAAAAgAAAAMAAAABAAAABQAAAAIAAAAAAAAAAQAAAAMAAAAGAAAABAAAAAYAAAAAAAAABQAAAAIAAAABAAAABAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAgAAAAMAAAAAAAAAAAAAAAIAAAAAAAAAAQAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAEAAAABgAAAAAAAAAFAAAAAAAAAAAAAAAEAAAABQAAAAAAAAAAAAAAAAAAAAIAAAAAAAAABgAAAAAAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAACAAAAAwAAAAQAAAAFAAAABgAAAAEAAAACAAAAAwAAAAQAAAAFAAAABgAAAAAAAAACAAAAAwAAAAQAAAAFAAAABgAAAAAAAAABAAAAAwAAAAQAAAAFAAAABgAAAAAAAAABAAAAAgAAAAQAAAAFAAAABgAAAAAAAAABAAAAAgAAAAMAAAAFAAAABgAAAAAAAAABAAAAAgAAAAMAAAAEAAAABgAAAAAAAAABAAAAAgAAAAMAAAAEAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAADAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAACAAAAAgAAAAAAAAAAAAAABgAAAAAAAAADAAAAAgAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAUAAAAEAAAAAAAAAAEAAAAAAAAAAAAAAAUAAAAFAAAAAAAAAAAAAAAAAAAABgAAAAAAAAAEAAAAAAAAAAYAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAUAAAACAAAABAAAAAMAAAAIAAAAAQAAAAcAAAAGAAAACQAAAAAAAAADAAAAAgAAAAIAAAAGAAAACgAAAAsAAAAAAAAAAQAAAAUAAAADAAAADQAAAAEAAAAHAAAABAAAAAwAAAAAAAAABAAAAH8AAAAPAAAACAAAAAMAAAAAAAAADAAAAAUAAAACAAAAEgAAAAoAAAAIAAAAAAAAABAAAAAGAAAADgAAAAsAAAARAAAAAQAAAAkAAAACAAAABwAAABUAAAAJAAAAEwAAAAMAAAANAAAAAQAAAAgAAAAFAAAAFgAAABAAAAAEAAAAAAAAAA8AAAAJAAAAEwAAAA4AAAAUAAAAAQAAAAcAAAAGAAAACgAAAAsAAAAYAAAAFwAAAAUAAAACAAAAEgAAAAsAAAARAAAAFwAAABkAAAACAAAABgAAAAoAAAAMAAAAHAAAAA0AAAAaAAAABAAAAA8AAAADAAAADQAAABoAAAAVAAAAHQAAAAMAAAAMAAAABwAAAA4AAAB/AAAAEQAAABsAAAAJAAAAFAAAAAYAAAAPAAAAFgAAABwAAAAfAAAABAAAAAgAAAAMAAAAEAAAABIAAAAhAAAAHgAAAAgAAAAFAAAAFgAAABEAAAALAAAADgAAAAYAAAAjAAAAGQAAABsAAAASAAAAGAAAAB4AAAAgAAAABQAAAAoAAAAQAAAAEwAAACIAAAAUAAAAJAAAAAcAAAAVAAAACQAAABQAAAAOAAAAEwAAAAkAAAAoAAAAGwAAACQAAAAVAAAAJgAAABMAAAAiAAAADQAAAB0AAAAHAAAAFgAAABAAAAApAAAAIQAAAA8AAAAIAAAAHwAAABcAAAAYAAAACwAAAAoAAAAnAAAAJQAAABkAAAAYAAAAfwAAACAAAAAlAAAACgAAABcAAAASAAAAGQAAABcAAAARAAAACwAAAC0AAAAnAAAAIwAAABoAAAAqAAAAHQAAACsAAAAMAAAAHAAAAA0AAAAbAAAAKAAAACMAAAAuAAAADgAAABQAAAARAAAAHAAAAB8AAAAqAAAALAAAAAwAAAAPAAAAGgAAAB0AAAArAAAAJgAAAC8AAAANAAAAGgAAABUAAAAeAAAAIAAAADAAAAAyAAAAEAAAABIAAAAhAAAAHwAAACkAAAAsAAAANQAAAA8AAAAWAAAAHAAAACAAAAAeAAAAGAAAABIAAAA0AAAAMgAAACUAAAAhAAAAHgAAADEAAAAwAAAAFgAAABAAAAApAAAAIgAAABMAAAAmAAAAFQAAADYAAAAkAAAAMwAAACMAAAAuAAAALQAAADgAAAARAAAAGwAAABkAAAAkAAAAFAAAACIAAAATAAAANwAAACgAAAA2AAAAJQAAACcAAAA0AAAAOQAAABgAAAAXAAAAIAAAACYAAAB/AAAAIgAAADMAAAAdAAAALwAAABUAAAAnAAAAJQAAABkAAAAXAAAAOwAAADkAAAAtAAAAKAAAABsAAAAkAAAAFAAAADwAAAAuAAAANwAAACkAAAAxAAAANQAAAD0AAAAWAAAAIQAAAB8AAAAqAAAAOgAAACsAAAA+AAAAHAAAACwAAAAaAAAAKwAAAD4AAAAvAAAAQAAAABoAAAAqAAAAHQAAACwAAAA1AAAAOgAAAEEAAAAcAAAAHwAAACoAAAAtAAAAJwAAACMAAAAZAAAAPwAAADsAAAA4AAAALgAAADwAAAA4AAAARAAAABsAAAAoAAAAIwAAAC8AAAAmAAAAKwAAAB0AAAB
2FAAAAMwAAAEAAAAAwAAAAMQAAAB4AAAAhAAAAQwAAAEIAAAAyAAAAMQAAAH8AAAA9AAAAQgAAACEAAAAwAAAAKQAAADIAAAAwAAAAIAAAAB4AAABGAAAAQwAAADQAAAAzAAAARQAAADYAAABHAAAAJgAAAC8AAAAiAAAANAAAADkAAABGAAAASgAAACAAAAAlAAAAMgAAADUAAAA9AAAAQQAAAEsAAAAfAAAAKQAAACwAAAA2AAAARwAAADcAAABJAAAAIgAAADMAAAAkAAAANwAAACgAAAA2AAAAJAAAAEgAAAA8AAAASQAAADgAAABEAAAAPwAAAE0AAAAjAAAALgAAAC0AAAA5AAAAOwAAAEoAAABOAAAAJQAAACcAAAA0AAAAOgAAAH8AAAA+AAAATAAAACwAAABBAAAAKgAAADsAAAA/AAAATgAAAE8AAAAnAAAALQAAADkAAAA8AAAASAAAAEQAAABQAAAAKAAAADcAAAAuAAAAPQAAADUAAAAxAAAAKQAAAFEAAABLAAAAQgAAAD4AAAArAAAAOgAAACoAAABSAAAAQAAAAEwAAAA/AAAAfwAAADgAAAAtAAAATwAAADsAAABNAAAAQAAAAC8AAAA+AAAAKwAAAFQAAABFAAAAUgAAAEEAAAA6AAAANQAAACwAAABWAAAATAAAAEsAAABCAAAAQwAAAFEAAABVAAAAMQAAADAAAAA9AAAAQwAAAEIAAAAyAAAAMAAAAFcAAABVAAAARgAAAEQAAAA4AAAAPAAAAC4AAABaAAAATQAAAFAAAABFAAAAMwAAAEAAAAAvAAAAWQAAAEcAAABUAAAARgAAAEMAAAA0AAAAMgAAAFMAAABXAAAASgAAAEcAAABZAAAASQAAAFsAAAAzAAAARQAAADYAAABIAAAAfwAAAEkAAAA3AAAAUAAAADwAAABYAAAASQAAAFsAAABIAAAAWAAAADYAAABHAAAANwAAAEoAAABOAAAAUwAAAFwAAAA0AAAAOQAAAEYAAABLAAAAQQAAAD0AAAA1AAAAXgAAAFYAAABRAAAATAAAAFYAAABSAAAAYAAAADoAAABBAAAAPgAAAE0AAAA/AAAARAAAADgAAABdAAAATwAAAFoAAABOAAAASgAAADsAAAA5AAAAXwAAAFwAAABPAAAATwAAAE4AAAA/AAAAOwAAAF0AAABfAAAATQAAAFAAAABEAAAASAAAADwAAABjAAAAWgAAAFgAAABRAAAAVQAAAF4AAABlAAAAPQAAAEIAAABLAAAAUgAAAGAAAABUAAAAYgAAAD4AAABMAAAAQAAAAFMAAAB/AAAASgAAAEYAAABkAAAAVwAAAFwAAABUAAAARQAAAFIAAABAAAAAYQAAAFkAAABiAAAAVQAAAFcAAABlAAAAZgAAAEIAAABDAAAAUQAAAFYAAABMAAAASwAAAEEAAABoAAAAYAAAAF4AAABXAAAAUwAAAGYAAABkAAAAQwAAAEYAAABVAAAAWAAAAEgAAABbAAAASQAAAGMAAABQAAAAaQAAAFkAAABhAAAAWwAAAGcAAABFAAAAVAAAAEcAAABaAAAATQAAAFAAAABEAAAAagAAAF0AAABjAAAAWwAAAEkAAABZAAAARwAAAGkAAABYAAAAZwAAAFwAAABTAAAATgAAAEoAAABsAAAAZAAAAF8AAABdAAAATwAAAFoAAABNAAAAbQAAAF8AAABqAAAAXgAAAFYAAABRAAAASwAAAGsAAABoAAAAZQAAAF8AAABcAAAATwAAAE4AAABtAAAAbAAAAF0AAABgAAAAaAAAAGIAAABuAAAATAAAAFYAAABSAAAAYQAAAH8AAABiAAAAVAAAAGcAAABZAAAAbwAAAGIAAABuAAAAYQAAAG8AAABSAAAAYAAAAFQAAABjAAAAUAAAAGkAAABYAAAAagAAAFoAAABxAAAAZAAAAGYAAABTAAAAVwAAAGwAAAByAAAAXAAAAGUAAABmAAAAawAAAHAAAABRAAAAVQAAAF4AAABmAAAAZQAAAFcAAABVAAAAcgAAAHAAAABkAAAAZwAAAFsAAABhAAAAWQAAAHQAAABpAAAAbwAAAGgAAABrAAAAbgAAAHMAAABWAAAAXgAAAGAAAABpAAAAWAAAAGcAAABbAAAAcQAAAGMAAAB0AAAAagAAAF0AAABjAAAAWgAAAHUAAABtAAAAcQAAAGsAAAB/AAAAZQAAAF4AAABzAAAAaAAAAHAAAABsAAAAZAAAAF8AAABcAAAAdgAAAHIAAABtAAAAbQAAAGwAAABdAAAAXwAAAHUAAAB2AAAAagAAAG4AAABiAAAAaAAAAGAAAAB3AAAAbwAAAHMAAABvAAAAYQAAAG4AAABiAAAAdAAAAGcAAAB3AAAAcAAAAGsAAABmAAAAZQAAAHgAAABzAAAAcgAAAHEAAABjAAAAdAAAAGkAAAB1AAAAagAAAHkAAAByAAAAcAAAAGQAAABmAAAAdgAAAHgAAABsAAAAcwAAAG4AAABrAAAAaAAAAHgAAAB3AAAAcAAAAHQAAABnAAAAdwAAAG8AAABxAAAAaQAAAHkAAAB1AAAAfwAAAG0AAAB2AAAAcQAAAHkAAABqAAAAdgAAAHgAAABsAAAAcgAAAHUAAAB5AAAAbQAAAHcAAABvAAAAcwAAAG4AAAB5AAAAdAAAAHgAAAB4AAAAcwAAAHIAAABwAAAAeQAAAHcAAAB2AAAAeQAAAHQAAAB4AAAAdwAAAHUAAABxAAAAdgAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAEAAAAFAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAIAAAAFAAAAAQAAAAAAAAD/////AQAAAAAAAAADAAAABAAAAAIAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAwAAAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAUAAAABAAAAAAAAAAAAAAABAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAAFAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAEAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAQAAAAFAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAUAAAAFAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAUAAAAFAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAMAAAAAAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAADAAAAAAAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAABAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAADAAAAAwAAAAMAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAADAAAABQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAUAAAAFAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAAAAAAAAAAABAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAADAAAAAAAAAAMAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAMAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAFAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAFAAAAAAAAAAAAAAAAAAAAAQAAAAMAAAABAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAMAAAABAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAADAAAABQAAAAEAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAFAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAEAAAABQAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAgAAAAUAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAMAAAABAAAAAAAAAAEAAAAAAAAABQAAAAAAAAAAAAAABQAAAAUAAAAAAAAAAAAAAP////8BAAAAAAAAAAMAAAAEAAAAAgAAAAAAAAAAAAAAAQAAAAAAAAAAAAAABQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAFAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAABQAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAQAAAP//////////AQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAMAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAIAAAAAAAAAAAAAAAEAAAACAAAABgAAAAQAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABgAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAABwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABgAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAoAAAACAAAAAAAAAAAAAAABAAAAAQAAAAUAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAIAAAAAAAAAAAAAAAEAAAADAAAABwAAAAYAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAHAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAABAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAOAAAAAgAAAAAAAAAAAAAAAQAAAAAAAAAJAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAwAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAgAAAAAAAAAAAAAAAQAAAAQAAAAIAAAACgAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAsAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAJAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAACAAAAAAAAAAAAAAABAAAACwAAAA8AAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAA4AAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAgAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAFAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcAAAACAAAAAAAAAAAAAAABAAAADAAAABAAAAAMAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAPAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAEAAAAKAAAAEwAAAAgAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACQAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAADwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABAAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAJAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAgAAAAAAAAAAAAAAAQAAAA0AAAARAAAADQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAABEAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAATAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAABMAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACQAAAAIAAAAAAAAAAAAAAAEAAAAOAAAAEgAAAA8AAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAPAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEgAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAABIAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAATAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAEgAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABMAAAACAAAAAAAAAAAAAAABAAAA//////
2////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/2LhTfev81i5
2RexJsy/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/N
2FQDMzMzMzMxlAzczMzMzM7D+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 g.length}function W(t){try{var e=new ArrayBuffer(t);if(e.byteLength!=t)return;return new Int8Array(e).set(g),tt(e),C(e),1}catch(n){}}var Q="function"===typeof atob?atob:function(t){var e,n,r,i,o,a,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",u="",l=0;t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{e=s.indexOf(t.charAt(l++))<<2|(i=s.indexOf(t.charAt(l++)))>>4,n=(15&i)<<4|(o=s.indexOf(t.charAt(l++)))>>2,r=(3&o)<<6|(a=s.indexOf(t.charAt(l++))),u+=String.fromCharCode(e),64!==o&&(u+=String.fromCharCode(n)),64!==a&&(u+=String.fromCharCode(r))}while(l<t.length);return u};function q(t){if(G(t))return function(t){try{for(var e=Q(t),n=new Uint8Array(e.length),r=0;r<e.length;++r)n[r]=e.charCodeAt(r);return n}catch(i){throw new Error("Converting base64 string to bytes failed.")}}(t.slice(N.length))}var K,X,Y={a:lt,b:function(t){l=t},c:c,d:function(t,e,n,r){lt("Assertion failed: "+A(t)+", at: "+[e?A(e):"unknown filename",n,r?A(r):"unknown function"])},e:function(t){return n.___errno_location&&(_[n.___errno_location()>>2]=t),t},f:J,g:function(t,e,n){m.set(m.subarray(e,e+n),t)},h:function(t){var e=J(),n=16777216,r=2130706432;if(t>r)return!1;for(var i=Math.max(e,16777216);i<t;)i=i<=536870912?w(2*i,n):Math.min(w((3*i+2147483648)/4,n),r);return!!W(i)},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},$=function(t,e,n){var r=new t.Int8Array(n),i=new t.Int32Array(n),o=(new t.Uint8Array(n),new t.Float32Array(n),new t.Float64Array(n)),a=0|e.p,s=t.Math.floor,u=t.Math.abs,l=t.Math.sqrt,c=t.Math.pow,h=t.Math.cos,f=t.Math.sin,p=t.Math.tan,d=t.Math.acos,A=t.Math.asin,v=t.Math.atan,g=t.Math.atan2,m=t.Math.ceil,y=t.Math.imul,_=t.Math.min,b=t.Math.clz32,x=e.b,w=e.c,C=e.d,B=e.e,k=e.f,E=e.g,S=e.h,T=e.i,M=24048;function I(t,e,n,r){var i,o;0|P(t|=0,e|=0,n|=0,r|=0,0)&&(Te(0|r,0,(o=1+(0|y(3*n|0,n+1|0))|0)<<3|0),(i=0|ye(o,4))&&(Z(t,e,n,r,i,o,0),me(i)))}function P(t,e,n,r,o){t|=0,e|=0,n|=0,o|=0;var a,s=0,u=0,l=0,c=0,h=0,f=0,p=0,d=0;if(a=M,M=M+16|0,d=a,i[(s=r|=0)>>2]=t,i[s+4>>2]=e,(s=0!=(0|o))&&(i[o>>2]=0),0|Dt(t,e))return M=a,0|(d=1);i[d>>2]=0;
2t:do{if((0|n)>=1)if(s)for(h=0,f=1,p=1,u=0,s=t;;){if(!(u|h)){if(0==(0|(s=0|D(s,e,4,d)))&0==(0|(e=0|w()))){s=2;break t}if(0|Dt(s,e)){s=1;break t}}if(0==(0|(s=0|D(s,e,0|i[16+(h<<2)>>2],d)))&0==(0|(e=0|w()))){s=2;break t}if(i[(t=r+(p<<3)|0)>>2]=s,i[t+4>>2]=e,i[o+(p<<2)>>2]=f,t=(0|(u=u+1|0))==(0|f),c=6==(0|(l=h+1|0)),0|Dt(s,e)){s=1;break t}if((0|(f=f+(c&t&1)|0))>(0|n)){s=0;break}h=t?c?0:l:h,p=p+1|0,u=t?0:u}else for(h=0,f=1,p=1,u=0,s=t;;){if(!(u|h)){if(0==(0|(s=0|D(s,e,4,d)))&0==(0|(e=0|w()))){s=2;break t}if(0|Dt(s,e)){s=1;break t}}if(0==(0|(s=0|D(s,e,0|i[16+(h<<2)>>2],d)))&0==(0|(e=0|w()))){s=2;break t}if(i[(t=r+(p<<3)|0)>>2]=s,i[t+4>>2]=e,t=(0|(u=u+1|0))==(0|f),c=6==(0|(l=h+1|0)),0|Dt(s,e)){s=1;break t}if((0|(f=f+(c&t&1)|0))>(0|n)){s=0;break}h=t?c?0:l:h,p=p+1|0,u=t?0:u}else s=0}while(0);return M=a,0|(d=s)}function Z(t,e,n,r,o,a,s){n|=0,r|=0,o|=0,a|=0,s|=0;var u,l,c=0,h=0,f=0,p=0,d=0;if(l=M,M=M+16|0,u=l,0==(0|(t|=0))&0==(0|(e|=0)))M=l;else{if(c=0|we(0|t,0|e,0|a,((0|a)<0)<<31>>31|0),w(),!(0==(0|(d=0|i[(p=h=r+(c<<3)|0)>>2]))&0==(0|(p=0|i[p+4>>2]))|(f=(0|d)==(0|t)&(0|p)==(0|e))))do{f=(0|(p=0|i[(d=h=r+((c=(c+1|0)%(0|a)|0)<<3)|0)>>2]))==(0|t)&(0|(d=0|i[d+4>>2]))==(0|e)}while(!(0==(0|p)&0==(0|d)|f));c=o+(c<<2)|0,f&&(0|i[c>>2])<=(0|s)||(i[(d=h)>>2]=t,i[d+4>>2]=e,i[c>>2]=s,(0|s)>=(0|n)||(d=s+1|0,i[u>>2]=0,Z(p=0|D(t,e,2,u),0|w(),n,r,o,a,d),i[u>>2]=0,Z(p=0|D(t,e,3,u),0|w(),n,r,o,a,d),i[u>>2]=0,Z(p=0|D(t,e,1,u),0|w(),n,r,o,a,d),i[u>>2]=0,Z(p=0|D(t,e,5,u),0|w(),n,r,o,a,d),i[u>>2]=0,Z(p=0|D(t,e,4,u),0|w(),n,r,o,a,d),i[u>>2]=0,Z(p=0|D(t,e,6,u),0|w(),n,r,o,a,d))),M=l}}function D(t,e,n,r){t|=0,e|=0,n|=0;var o,a,s=0,u=0,l=0,c=0,h=0,f=0,p=0;if((0|i[(r|=0)>>2])>0){s=0;do{n=0|ut(n),s=s+1|0}while((0|s)<(0|i[r>>2]))}o=0|Ce(0|t,0|e,45),w(),a=127&o,u=0|Lt(t,e),s=0|Ce(0|t,0|e,52),w(),s&=15;t:do{if(s)for(;;){if(f=0|Ce(0|t,0|e,0|(h=3*(15-s|0)|0)),w(),f&=7,p=0==(0|Ut(s)),s=s+-1|0,c=0|Be(7,0,0|h),e&=~(0|w()),t=(h=0|Be(0|i[(p?464:48)+(28*f|0)+(n<<2)>>2],0,0|h))|t&~c,e|=0|w(),!(n=0|i[(p?672:256)+(28*f|0)+(n<<2)>>2])){n=0;break t}if(!s){l=6;break}}else l=6}while(0);6==(0|l)&&(t|=f=0|Be(0|(p=0|i[880+(28*a|0)+(n<<2)>>2]),0,45),e=0|w()|-1040385&e,n=0|i[4304+(28*a|0)+(n<<2)>>2],127==(127&p|0)&&(p=0|Be(0|i[880+(28*a|0)+20>>2],0,45),e=0|w()|-1040385&e,n=0|i[4304+(28*a|0)+20>>2],t=0|Ft(p|t,e),e=0|w(),i[r>>2]=1+(0|i[r>>2]))),l=0|Ce(0|t,0|e,45),w(),l&=127;t:do{if(0|O(l)){e:do{if(1==(0|Lt(t,e))){if((0|a)!=(0|l)){if(0|U(l,0|i[7728+(28*a|0)>>2])){t=0|zt(t,e),u=1,e=0|w();break}t=0|Ft(t,e),u=1,e=0|w();break}switch(0|u){case 5:t=0|zt(t,e),e=0|w(),i[r>>2]=5+(0|i[r>>2]),u=0;break e;case 3:t=0|Ft(t,e),e=0|w(),i[r>>2]=1+(0|i[r>>2]),u=0;break e;default:return p=0,x(0|(f=0)),0|p}}else u=0}while(0);if((0|n)>0){s=0;do{t=0|Ot(t,e),e=0|w(),s=s+1|0}while((0|s)!=(0|n))}if((0|a)!=(0|l)){if(!(0|F(l))){if(0!=(0|u)|5!=(0|Lt(t,e)))break;i[r>>2]=1+(0|i[r>>2]);break}switch(127&o){case 8:case 118:break t}3!=(0|Lt(t,e))&&(i[r>>2]=1+(0|i[r>>2]))}}else if((0|n)>0){s=0;do{t=0|Ft(t,e),e=0|w(),s=s+1|0}while((0|s)!=(0|n))}}while(0);return i[r>>2]=((0|i[r>>2])+n|0)%6|0,p=t,x(0|(f=e)),0|p}function L(t,e,n,r,a,s){e|=0,n|=0,r|=0,a|=0,s|=0;var u,l,c,h,f,p,d,A,v,g=0,m=0,y=0,_=0,b=0,x=0,C=0,B=0,k=0,E=0,S=0,T=0,I=0,P=0;if(v=M,M=M+48|0,p=v+32|0,d=v+16|0,A=v,(0|(g=0|i[(t|=0)>>2]))<=0)return M=v,0|(T=0);u=t+4|0,l=p+8|0,c=d+8|0,h=A+8|0,f=((0|e)<0)<<31>>31,S=0;t:for(;;){k=(m=0|i[u>>2])+(S<<4)|0,i[p>>2]=i[k>>2],i[p+4>>2]=i[k+4>>2],i[p+8>>2]=i[k+8>>2],i[p+12>>2]=i[k+12>>2],(0|S)==(g+-1|0)?(i[d>>2]=i[m>>2],i[d+4>>2]=i[m+4>>2],i[d+8>>2]=i[m+8>>2],i[d+12>>2]=i[m+12>>2]):(k=m+(S+1<<4)|0,i[d>>2]=i[k>>2],i[d+4>>2]=i[k+4>>2],i[d+8>>2]=i[k+8>>2],i[d+12>>2]=i[k+12>>2]),k=0|J(p,d,n);e:do{if((0|k)>0){E=+(0|k),B=0;n:for(;;){P=+(k-B|0),I=+(0|B),o[A>>3]=+o[p>>3]*P/E+ +o[d>>3]*I/E,o[h>>3]=+o[l>>3]*P/E+ +o[c>>3]*I/E,m=0|we(0|(x=0|Nt(A,n)),0|(C=0|w()),0|e,0|f),w(),_=0|i[(y=g=s+(m<<3)|0)>>2],y=0|i[y+4>>2];r:do{if(0==(0|_)&0==(0|y))T=14;else for(b=0;;){if((0|b)>(0|e)){g=1;break r}if((0|_)==(0|x)&(0|y)==(0|C)){g=7;break r}if(0==(0|(_=0|i[(y=g=s+((m=(m+1|0)%(0|e)|0)<<3)|0)>>2]))&0==(0|(y=0|i[y+4>>2]))){T=14;break}b=b+1|0}}while(0);switch(14==(0|T)&&(T=0,0==(0|x)&0==(0|C)?g=7:(i[g>>2]=x,i[g+4>>2]=C,g=0|i[r>>2],i[(b=a+(g<<3)|0)>>2]=x,i[b+4>>2]=C,i[r>>2]=g+1,g=0)),7&g){case 7:case 0:break;default:break n}if((0|k)<=(0|(B=B+1|0))){T=8;break e}}if(0|g){g=-1,T=20;break t}}else T=8}while(0);if(8==(0|T)&&(T=0),(0|(S=S+1|0))>=(0|(g=0|i[t>>2]))){g=0,T=20;break}}return 20==(0|T)?(M=v,0|g):0}function O(t){return 0|i[7728+(28*(t|=0)|0)+16>>2]}function F(t){return 4==(0|(t|=0))|117==(0|t)|0}function R(t){return 0|i[11152+(216*(0|i[(t|=0)>>2])|0)+(72*(0|i[t+4>>2])|0)+(24*(0|i[t+8>>2])|0)+(i[t+12>>2]<<3)>>2]}function z(t){return 0|i[11152+(216*(0|i[(t|=0)>>2])|0)+(72*(0|i[t+4>>2])|0)+(24*(0|i[t+8>>2])|0)+(i[t+12>>2]<<3)+4>>2]}function U(t,e){return e|=0,(0|i[7728+(28*(t|=0)|0)+20>>2])==(0|e)?0|(e=1):0|(e=(0|i[7728+(28*t|0)+24>>2])==(0|e))}function N(t,e){return 0|i[880+(28*(t|=0)|0)+((e|=0)<<2)>>2]}function G(t,e){return e|=0,(0|i[880+(28*(t|=0)|0)>>2])==(0|e)?0|(e=0):(0|i[880+(28*t|0)+4>>2])==(0|e)?0|(e=1):(0|i[880+(28*t|0)+8>>2])==(0|e)?0|(e=2):(0|i[880+(28*t|0)+12>>2])==(0|e)?0|(e=3):(0|i[880+(28*t|0)+16>>2])==(0|e)?0|(e=4):(0|i[880+(28*t|0)+20>>2])==(0|e)?0|(e=5):0|((0|i[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,r,i=0;return(i=+o[(e|=0)>>3])>=+o[t+8>>3]&&i<=+o[t>>3]?(n=+o[t+16>>3],i=+o[t+24>>3],e=(r=+o[e+8>>3])>=i,t=r<=n&1,n<i?e&&(t=1):e||(t=0),0|(e=0!=(0|t))):0|(e=0)}function H(t,e){t|=0,e|=0;var n,r,a,s,l,c,h=0,f=0;
vendor: 24,299 bytes, line 2
2s=M,M=M+288|0,n=s+264|0,r=s+96|0,f=(h=a=s)+96|0;do{i[h>>2]=0,h=h+4|0}while((0|h)<(0|f));return Jt(e,a),Vt(f=0|i[(h=a)>>2],h=0|i[h+4>>2],n),Ht(f,h,r),l=+St(n,r+8|0),o[n>>3]=+o[t>>3],o[(h=n+8|0)>>3]=+o[t+16>>3],o[r>>3]=+o[t+8>>3],o[(f=r+8|0)>>3]=+o[t+24>>3],c=+St(n,r),f=~~+m(+c*c/+ke(+ +u(+(+o[h>>3]-+o[f>>3])/(+o[n>>3]-+o[r>>3])),3)/(l*(2.59807621135*l)*.8)),M=s,0|(0==(0|f)?1:f)}function J(t,e,n){t|=0,e|=0,n|=0;var r,o,a,s,u,l=0,c=0;s=M,M=M+288|0,r=s+264|0,o=s+96|0,c=(l=a=s)+96|0;do{i[l>>2]=0,l=l+4|0}while((0|l)<(0|c));return Jt(n,a),Vt(l=0|i[(c=a)>>2],c=0|i[c+4>>2],r),Ht(l,c,o),u=+St(r,o+8|0),c=~~+m(+ +St(t,e)/(2*u)),M=s,0|(0==(0|c)?1:c)}function W(t,e,n,r){e|=0,n|=0,r|=0,i[(t|=0)>>2]=e,i[t+4>>2]=n,i[t+8>>2]=r}function Q(t,e){t|=0;var n,r,a,s,l=0,c=0,h=0,f=0,p=0,d=0,A=0;i[(s=(e|=0)+8|0)>>2]=0,r=+o[t>>3],f=+u(+r),a=+o[t+8>>3],f+=.5*(p=+u(+a)/.8660254037844386),f-=+(0|(l=~~f)),p-=+(0|(t=~~p));do{if(f<.5){if(f<.3333333333333333){if(i[e>>2]=l,p<.5*(f+1)){i[e+4>>2]=t;break}t=t+1|0,i[e+4>>2]=t;break}if(t=(1&!(p<(A=1-f)))+t|0,i[e+4>>2]=t,A<=p&p<2*f){l=l+1|0,i[e>>2]=l;break}i[e>>2]=l;break}if(!(f<.6666666666666666)){if(l=l+1|0,i[e>>2]=l,p<.5*f){i[e+4>>2]=t;break}t=t+1|0,i[e+4>>2]=t;break}if(p<1-f){if(i[e+4>>2]=t,2*f-1<p){i[e>>2]=l;break}}else t=t+1|0,i[e+4>>2]=t;l=l+1|0,i[e>>2]=l}while(0);do{if(r<0){if(1&t){l=~~(+(0|l)-(2*(+((d=0|_e(0|l,((0|l)<0)<<31>>31|0,0|(d=(t+1|0)/2|0),((0|d)<0)<<31>>31|0))>>>0)+4294967296*+(0|w()))+1)),i[e>>2]=l;break}l=~~(+(0|l)-2*(+((d=0|_e(0|l,((0|l)<0)<<31>>31|0,0|(d=(0|t)/2|0),((0|d)<0)<<31>>31|0))>>>0)+4294967296*+(0|w()))),i[e>>2]=l;break}}while(0);d=e+4|0,a<0&&(l=l-((1|t<<1)/2|0)|0,i[e>>2]=l,t=0-t|0,i[d>>2]=t),c=t-l|0,(0|l)<0?(h=0-l|0,i[d>>2]=c,i[s>>2]=h,i[e>>2]=0,t=c,l=0):h=0,(0|t)<0&&(l=l-t|0,i[e>>2]=l,h=h-t|0,i[s>>2]=h,i[d>>2]=0,t=0),n=l-h|0,c=t-h|0,(0|h)<0&&(i[e>>2]=n,i[d>>2]=c,i[s>>2]=0,t=c,l=n,h=0),(0|(c=(0|h)<(0|(c=(0|t)<(0|l)?t:l))?h:c))<=0||(i[e>>2]=l-c,i[d>>2]=t-c,i[s>>2]=h-c)}function q(t){var e,n=0,r=0,o=0,a=0,s=0;n=0|i[(t|=0)>>2],r=0|i[(e=t+4|0)>>2],(0|n)<0&&(r=r-n|0,i[e>>2]=r,i[(s=t+8|0)>>2]=(0|i[s>>2])-n,i[t>>2]=0,n=0),(0|r)<0?(n=n-r|0,i[t>>2]=n,a=(0|i[(s=t+8|0)>>2])-r|0,i[s>>2]=a,i[e>>2]=0,r=0):(s=a=t+8|0,a=0|i[a>>2]),(0|a)<0&&(n=n-a|0,i[t>>2]=n,r=r-a|0,i[e>>2]=r,i[s>>2]=0,a=0),(0|(o=(0|a)<(0|(o=(0|r)<(0|n)?r:n))?a:o))<=0||(i[t>>2]=n-o,i[e>>2]=r-o,i[s>>2]=a-o)}function K(t,e){e|=0;var n,r;r=0|i[(t|=0)+8>>2],n=+((0|i[t+4>>2])-r|0),o[e>>3]=+((0|i[t>>2])-r|0)-.5*n,o[e+8>>3]=.8660254037844386*n}function X(t,e,n){t|=0,e|=0,i[(n|=0)>>2]=(0|i[e>>2])+(0|i[t>>2]),i[n+4>>2]=(0|i[e+4>>2])+(0|i[t+4>>2]),i[n+8>>2]=(0|i[e+8>>2])+(0|i[t+8>>2])}function Y(t,e,n){t|=0,e|=0,i[(n|=0)>>2]=(0|i[t>>2])-(0|i[e>>2]),i[n+4>>2]=(0|i[t+4>>2])-(0|i[e+4>>2]),i[n+8>>2]=(0|i[t+8>>2])-(0|i[e+8>>2])}function $(t,e){e|=0;var n,r=0;r=0|y(0|i[(t|=0)>>2],e),i[t>>2]=r,n=0|y(0|i[(r=t+4|0)>>2],e),i[r>>2]=n,e=0|y(0|i[(t=t+8|0)>>2],e),i[t>>2]=e}function tt(t){var e,n,r=0,o=0,a=0,s=0,u=0;u=(0|(n=0|i[(t|=0)>>2]))<0,t=(t=(o=(0|(s=((e=(0|(a=(0|i[t+4>>2])-(u?n:0)|0))<0)?0-a|0:0)+((0|i[t+8>>2])-(u?n:0))|0))<0)?0:s)-((a=(0|(o=(0|t)<(0|(o=(0|(r=(e?0:a)-(o?s:0)|0))<(0|(s=(u?0:n)-(e?a:0)-(o?s:0)|0))?r:s))?t:o))>0)?o:0)|0,r=r-(a?o:0)|0;t:do{switch(s-(a?o:0)|0){case 0:switch(0|r){case 0:return 0|(u=0==(0|t)?0:1==(0|t)?1:7);case 1:return 0|(u=0==(0|t)?2:1==(0|t)?3:7);default:break t}case 1:switch(0|r){case 0:return 0|(u=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|(u=7)}function et(t){var e,n,r=0,o=0,a=0,s=0,u=0;o=0|i[(e=(t|=0)+8|0)>>2],a=0|ve(+((3*(r=(0|i[t>>2])-o|0)|0)-(o=(0|i[(n=t+4|0)>>2])-o|0)|0)/7),i[t>>2]=a,r=0|ve(+((o<<1)+r|0)/7),i[n>>2]=r,i[e>>2]=0,o=r-a|0,(0|a)<0?(u=0-a|0,i[n>>2]=o,i[e>>2]=u,i[t>>2]=0,r=o,a=0,o=u):o=0,(0|r)<0&&(a=a-r|0,i[t>>2]=a,o=o-r|0,i[e>>2]=o,i[n>>2]=0,r=0),u=a-o|0,s=r-o|0,(0|o)<0?(i[t>>2]=u,i[n>>2]=s,i[e>>2]=0,r=s,s=u,o=0):s=a,(0|(a=(0|o)<(0|(a=(0|r)<(0|s)?r:s))?o:a))<=0||(i[t>>2]=s-a,i[n>>2]=r-a,i[e>>2]=o-a)}function nt(t){var e,n,r=0,o=0,a=0,s=0,u=0;o=0|i[(e=(t|=0)+8|0)>>2],a=0|ve(+(((r=(0|i[t>>2])-o|0)<<1)+(o=(0|i[(n=t+4|0)>>2])-o|0)|0)/7),i[t>>2]=a,r=0|ve(+((3*o|0)-r|0)/7),i[n>>2]=r,i[e>>2]=0,o=r-a|0,(0|a)<0?(u=0-a|0,i[n>>2]=o,i[e>>2]=u,i[t>>2]=0,r=o,a=0,o=u):o=0,(0|r)<0&&(a=a-r|0,i[t>>2]=a,o=o-r|0,i[e>>2]=o,i[n>>2]=0,r=0),u=a-o|0,s=r-o|0,(0|o)<0?(i[t>>2]=u,i[n>>2]=s,i[e>>2]=0,r=s,s=u,o=0):s=a,(0|(a=(0|o)<(0|(a=(0|r)<(0|s)?r:s))?o:a))<=0||(i[t>>2]=s-a,i[n>>2]=r-a,i[e>>2]=o-a)}function rt(t){var e,n,r,o=0,a=0,s=0,u=0;o=0|i[(t|=0)>>2],a=0|i[(n=t+4|0)>>2],s=0|i[(r=t+8|0)>>2],u=a+(3*o|0)|0,i[t>>2]=u,a=s+(3*a|0)|0,i[n>>2]=a,o=(3*s|0)+o|0,i[r>>2]=o,s=a-u|0,(0|u)<0?(o=o-u|0,i[n>>2]=s,i[r>>2]=o,i[t>>2]=0,a=s,s=0):s=u,(0|a)<0&&(s=s-a|0,i[t>>2]=s,o=o-a|0,i[r>>2]=o,i[n>>2]=0,a=0),e=s-o|0,u=a-o|0,(0|o)<0?(i[t>>2]=e,i[n>>2]=u,i[r>>2]=0,s=e,o=0):u=a,(0|(a=(0|o)<(0|(a=(0|u)<(0|s)?u:s))?o:a))<=0||(i[t>>2]=s-a,i[n>>2]=u-a,i[r>>2]=o-a)}function it(t){var e,n,r,o=0,a=0,s=0,u=0;u=0|i[(t|=0)>>2],s=(3*(o=0|i[(n=t+4|0)>>2])|0)+u|0,u=(a=0|i[(r=t+8|0)>>2])+(3*u|0)|0,i[t>>2]=u,i[n>>2]=s,o=(3*a|0)+o|0,i[r>>2]=o,a=s-u|0,(0|u)<0?(o=o-u|0,i[n>>2]=a,i[r>>2]=o,i[t>>2]=0,u=0):a=s,(0|a)<0&&(u=u-a|0,i[t>>2]=u,o=o-a|0,i[r>>2]=o,i[n>>2]=0,a=0),e=u-o|0,s=a-o|0,(0|o)<0?(i[t>>2]=e,i[n>>2]=s,i[r>>2]=0,u=e,o=0):s=a,(0|(a=(0|o)<(0|(a=(0|s)<(0|u)?s:u))?o:a))<=0||(i[t>>2]=u-a,i[n>>2]=s-a,i[r>>2]=o-a)}function ot(t,e){t|=0;var n,r,o,a=0,s=0,u=0;((e|=0)+-1|0)>>>0>=6||(u=(0|i[15472+(12*e|0)>>2])+(0|i[t>>2])|0,i[t>>2]=u,o=t+4|0,s=(0|i[15472+(12*e|0)+4>>2])+(0|i[o>>2])|0,i[o>>2]=s,r=t+8|0,e=(0|i[15472+(12*e|0)+8>>2])+(0|i[r>>2])|0,i[r>>2]=e,a=s-u|0,(0|u)<0?(e=e-u|0,i[o>>2]=a,i[r>>2]=e,i[t>>2]=0,s=0):(a=s,s=u),(0|a)<0&&(s=s-a|0,i[t>>2]=s,e=e-a|0,i[r>>2]=e,i[o>>2]=0,a=0),n=s-e|0,u=a-e|0,(0|e)<0?(i[t>>2]=n,i[o>>2]=u,i[r>>2]=0,s=n,e=0):u=a,(0|(a=(0|e)<(0|(a=(0|u)<(0|s)?u:s))?e:a))<=0||(i[t>>2]=s-a,i[o>>2]=u-a,i[r>>2]=e-a))}function at(t){var e,n,r,o=0,a=0,s=0,u=0;u=0|i[(t|=0)>>2],s=(o=0|i[(n=t+4|0)>>2])+u|0,u=(a=0|i[(r=t+8|0)>>2])+u|0,i[t>>2]=u,i[n>>2]=s,o=a+o|0,i[r>>2]=o,a=s-u|0,(0|u)<0?(o=o-u|0,i[n>>2]=a,i[r>>2]=o,i[t>>2]=0,s=0):(a=s,s=u),(0|a)<0&&(s=s-a|0,i[t>>2]=s,o=o-a|0,i[r>>2]=o,i[n>>2]=0,a=0),e=s-o|0,u=a-o|0,(0|o)<0?(i[t>>2]=e,i[n>>2]=u,i[r>>2]=0,s=e,o=0):u=a,(0|(a=(0|o)<(0|(a=(0|u)<(0|s)?u:s))?o:a))<=0||(i[t>>2]=s-a,i[n>>2]=u-a,i[r>>2]=o-a)}function st(t){var e,n,r,o=0,a=0,s=0,u=0;o=0|i[(t|=0)>>2],s=0|i[(n=t+4|0)>>2],a=0|i[(r=t+8|0)>>2],u=s+o|0,i[t>>2]=u,s=a+s|0,i[n>>2]=s,o=a+o|0,i[r>>2]=o,a=s-u|0,(0|u)<0?(o=o-u|0,i[n>>2]=a,i[r>>2]=o,i[t>>2]=0,s=0):(a=s,s=u),(0|a)<0&&(s=s-a|0,i[t>>2]=s,o=o-a|0,i[r>>2]=o,i[n>>2]=0,a=0),e=s-o|0,u=a-o|0,(0|o)<0?(i[t>>2]=e,i[n>>2]=u,i[r>>2]=0,s=e,o=0):u=a,(0|(a=(0|o)<(0|(a=(0|u)<(0|s)?u:s))?o:a))<=0||(i[t>>2]=s-a,i[n>>2]=u-a,i[r>>2]=o-a)}function ut(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 lt(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 ct(t){var e,n,r,o=0,a=0,s=0,u=0;o=0|i[(t|=0)>>2],a=0|i[(n=t+4|0)>>2],s=0|i[(r=t+8|0)>>2],u=a+(o<<1)|0,i[t>>2]=u,a=s+(a<<1)|0,i[n>>2]=a,o=(s<<1)+o|0,i[r>>2]=o,s=a-u|0,(0|u)<0?(o=o-u|0,i[n>>2]=s,i[r>>2]=o,i[t>>2]=0,a=s,s=0):s=u,(0|a)<0&&(s=s-a|0,i[t>>2]=s,o=o-a|0,i[r>>2]=o,i[n>>2]=0,a=0),e=s-o|0,u=a-o|0,(0|o)<0?(i[t>>2]=e,i[n>>2]=u,i[r>>2]=0,s=e,o=0):u=a,(0|(a=(0|o)<(0|(a=(0|u)<(0|s)?u:s))?o:a))<=0||(i[t>>2]=s-a,i[n>>2]=u-a,i[r>>2]=o-a)}function ht(t){var e,n,r,o=0,a=0,s=0,u=0;u=0|i[(t|=0)>>2],s=((o=0|i[(n=t+4|0)>>2])<<1)+u|0,u=(a=0|i[(r=t+8|0)>>2])+(u<<1)|0,i[t>>2]=u,i[n>>2]=s,o=(a<<1)+o|0,i[r>>2]=o,a=s-u|0,(0|u)<0?(o=o-u|0,i[n>>2]=a,i[r>>2]=o,i[t>>2]=0,u=0):a=s,(0|a)<0&&(u=u-a|0,i[t>>2]=u,o=o-a|0,i[r>>2]=o,i[n>>2]=0,a=0),e=u-o|0,s=a-o|0,(0|o)<0?(i[t>>2]=e,i[n>>2]=s,i[r>>2]=0,u=e,o=0):s=a,(0|(a=(0|o)<(0|(a=(0|s)<(0|u)?s:u))?o:a))<=0||(i[t>>2]=u-a,i[n>>2]=s-a,i[r>>2]=o-a)}function ft(t,e){e|=0;var n,r,o,a=0,s=0,u=0;return o=(0|(r=(0|i[(t|=0)>>2])-(0|i[e>>2])|0))<0,n=(0|(s=(0|i[t+4>>2])-(0|i[e+4>>2])-(o?r:0)|0))<0,e=(e=(t=(0|(u=(o?0-r|0:0)+(0|i[t+8>>2])-(0|i[e+8>>2])+(n?0-s|0:0)|0))<0)?0:u)-((s=(0|(t=(0|e)<(0|(t=(0|(a=(n?0:s)-(t?u:0)|0))<(0|(u=(o?0:r)-(n?s:0)-(t?u:0)|0))?a:u))?e:t))>0)?t:0)|0,a=a-(s?t:0)|0,0|((0|(t=(0|(t=u-(s?t:0)|0))>-1?t:0-t|0))>(0|(e=(0|(a=(0|a)>-1?a:0-a|0))>(0|(e=(0|e)>-1?e:0-e|0))?a:e))?t:e)}function pt(t,e){e|=0;var n;n=0|i[(t|=0)+8>>2],i[e>>2]=(0|i[t>>2])-n,i[e+4>>2]=(0|i[t+4>>2])-n}function dt(t,e){e|=0;var n,r,o,a=0,s=0,u=0;s=0|i[(t|=0)>>2],i[e>>2]=s,t=0|i[t+4>>2],i[(r=e+4|0)>>2]=t,i[(o=e+8|0)>>2]=0,a=t-s|0,(0|s)<0?(t=0-s|0,i[r>>2]=a,i[o>>2]=t,i[e>>2]=0,s=0):(a=t,t=0),(0|a)<0&&(s=s-a|0,i[e>>2]=s,t=t-a|0,i[o>>2]=t,i[r>>2]=0,a=0),n=s-t|0,u=a-t|0,(0|t)<0?(i[e>>2]=n,i[r>>2]=u,i[o>>2]=0,a=u,u=n,t=0):u=s,(0|(s=(0|t)<(0|(s=(0|a)<(0|u)?a:u))?t:s))<=0||(i[e>>2]=u-s,i[r>>2]=a-s,i[o>>2]=t-s)}function At(t){var e,n,r,o;n=(o=0|i[(e=(t|=0)+8|0)>>2])-(0|i[t>>2])|0,i[t>>2]=n,t=(0|i[(r=t+4|0)>>2])-o|0,i[r>>2]=t,i[e>>2]=0-(t+n)}function vt(t){var e,n,r=0,o=0,a=0,s=0,u=0;r=0-(o=0|i[(t|=0)>>2])|0,i[t>>2]=r,i[(e=t+8|0)>>2]=0,s=(a=0|i[(n=t+4|0)>>2])+o|0,(0|o)>0?(i[n>>2]=s,i[e>>2]=o,i[t>>2]=0,r=0,a=s):o=0,(0|a)<0?(u=r-a|0,i[t>>2]=u,o=o-a|0,i[e>>2]=o,i[n>>2]=0,s=u-o|0,r=0-o|0,(0|o)<0?(i[t>>2]=s,i[n>>2]=r,i[e>>2]=0,a=r,o=0):(a=0,s=u)):s=r,(0|(r=(0|o)<(0|(r=(0|a)<(0|s)?a:s))?o:r))<=0||(i[t>>2]=s-r,i[n>>2]=a-r,i[e>>2]=o-r)}function gt(t,e,n,r){e|=0,n|=0,r|=0;var a,s=0,u=0,l=0,c=0;if(a=M,M=M+32|0,function(t,e){t|=0,e|=0;var n=0,r=0,i=0;n=+o[t>>3],r=+h(+n),n=+f(+n),o[e+16>>3]=n,n=+o[t+8>>3],i=r*+h(+n),o[e>>3]=i,n=r*+f(+n),o[e+8>>3]=n}(t|=0,u=a),i[n>>2]=0,s=+ue(15888,u),(l=+ue(15912,u))<s&&(i[n>>2]=1,s=l),(l=+ue(15936,u))<s&&(i[n>>2]=2,s=l),(l=+ue(15960,u))<s&&(i[n>>2]=3,s=l),(l=+ue(15984,u))<s&&(i[n>>2]=4,s=l),(l=+ue(16008,u))<s&&(i[n>>2]=5,s=l),(l=+ue(16032,u))<s&&(i[n>>2]=6,s=l),(l=+ue(16056,u))<s&&(i[n>>2]=7,s=l),(l=+ue(16080,u))<s&&(i[n>>2]=8,s=l),(l=+ue(16104,u))<s&&(i[n>>2]=9,s=l),(l=+ue(16128,u))<s&&(i[n>>2]=10,s=l),(l=+ue(16152,u))<s&&(i[n>>2]=11,s=l),(l=+ue(16176,u))<s&&(i[n>>2]=12,s=l),(l=+ue(16200,u))<s&&(i[n>>2]=13,s=l),(l=+ue(16224,u))<s&&(i[n>>2]=14,s=l),(l=+ue(16248,u))<s&&(i[n>>2]=15,s=l),(l=+ue(16272,u))<s&&(i[n>>2]=16,s=l),(l=+ue(16296,u))<s&&(i[n>>2]=17,s=l),(l=+ue(16320,u))<s&&(i[n>>2]=18,s=l),(l=+ue(16344,u))<s&&(i[n>>2]=19,s=l),(l=+d(+(1-.5*s)))<1e-16)return i[r>>2]=0,i[r+4>>2]=0,i[r+8>>2]=0,i[r+12>>2]=0,void(M=a);if(n=0|i[n>>2],s=+kt((s=+o[16368+(24*n|0)>>3])-+kt(+function(t,e){t|=0,e|=0;var n=0,r=0,i=0,a=0,s=0;return a=+o[e>>3],r=+h(+a),i=+o[e+8>>3]-+o[t+8>>3],s=r*+f(+i),n=+o[t>>3],+ +g(+s,+(+f(+a)*+h(+n)-+h(+i)*(r*+f(+n))))}(15568+(n<<4)|0,t))),c=0|Ut(e)?+kt(s+-.3334731722518321):s,s=+p(+l)/.381966011250105,(0|e)>0){u=0;do{s*=2.6457513110645907,u=u+1|0}while((0|u)!=(0|e))}l=+h(+c)*s,o[r>>3]=l,c=+f(+c)*s,o[r+8>>3]=c,M=a}function mt(t,e,n,r,a){e|=0,n|=0,r|=0,a|=0;var s=0,c=0;if(s=+function(t){t|=0;var e=0,n=0;return n=+o[t>>3],e=+o[t+8>>3],+ +l(+(n*n+e*e))}(t|=0),s<1e-16)return e=15568+(e<<4)|0,i[a>>2]=i[e>>2],i[a+4>>2]=i[e+4>>2],i[a+8>>2]=i[e+8>>2],void(i[a+12>>2]=i[e+12>>2]);if(c=+g(+ +o[t+8>>3],+ +o[t>>3]),(0|n)>0){t=0;do{s/=2.6457513110645907,t=t+1|0}while((0|t)!=(0|n))}r?(s/=3,n=0==(0|Ut(n)),s=+v(.381966011250105*(n?s:s/2.6457513110645907))):(s=+v(.381966011250105*s),0|Ut(n)&&(c=+kt(c+.3334731722518321))),function(t,e,n,r){t|=0,e=+e,n=+n,r|=0;var a=0,s=0,l=0,c=0;if(n<1e-16)return i[r>>2]=i[t>>2],i[r+4>>2]=i[t+4>>2],i[r+8>>2]=i[t+8>>2],void(i[r+12>>2]=i[t+12>>2]);s=e<0?e+6.283185307179586:e,s=e>=6.283185307179586?s+-6.283185307179586:s;do{if(!(s<1e-16)){if(a=+u(+(s+-3.141592653589793))<1e-16,e=+o[t>>3],a){e-=n,o[r>>3]=e,a=r;break}if(l=+h(+n),n=+f(+n),e=l*+f(+e)+ +h(+s)*(n*+h(+e)),e=+A(+((e=e>1?1:e)<-1?-1:e)),o[r>>3]=e,+u(+(e+-1.5707963267948966))<1e-16)return o[r>>3]=1.5707963267948966,void(o[r+8>>3]=0);if(+u(+(e+1.5707963267948966))<1e-16)return o[r>>3]=-1.5707963267948966,void(o[r+8>>3]=0);if(c=+h(+e),s=n*+f(+s)/c,n=+o[t>>3],e=(l-+f(+e)*+f(+n))/+h(+n)/c,l=s>1?1:s,e=e>1?1:e,(e=+o[t+8>>3]+ +g(+(l<-1?-1:l),+(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[r+8>>3]=e)}e=+o[t>>3]+n,o[r>>3]=e,a=r}while(0);if(+u(+(e+-1.5707963267948966))<1e-16)return o[a>>3]=1.5707963267948966,void(o[r+8>>3]=0);if(+u(+(e+1.5707963267948966))<1e-16)return o[a>>3]=-1.5707963267948966,void(o[r+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[r+8>>3]=e}(15568+(e<<4)|0,+kt(+o[16368+(24*e|0)>>3]-c),s,a)}function yt(t,e,n){e|=0,n|=0;var r,o;r=M,M=M+16|0,K((t|=0)+4|0,o=r),mt(o,0|i[t>>2],e,0,n),M=r}function _t(t,e,n,r,a){t|=0,e|=0,n|=0,r|=0,a|=0;var s,u,l,c,h,f,p,d,A,v,g,m,y,_,b,x,w,B,k,E,S,T,I=0,P=0,Z=0,D=0,L=0,O=0;if(T=M,M=M+272|0,D=T+240|0,k=T,E=T+224|0,S=T+208|0,g=T+176|0,m=T+160|0,y=T+192|0,_=T+144|0,b=T+128|0,x=T+112|0,w=T+96|0,B=T+80|0,i[(I=T+256|0)>>2]=e,i[D>>2]=i[t>>2],i[D+4>>2]=i[t+4>>2],i[D+8>>2]=i[t+8>>2],i[D+12>>2]=i[t+12>>2],bt(D,I,k),i[a>>2]=0,(0|(D=r+n+(5==(0|r)&1)|0))<=(0|n))M=T;else{u=E+4|0,l=g+4|0,c=n+5|0,h=16848+((s=0|i[I>>2])<<2)|0,f=16928+(s<<2)|0,p=b+8|0,d=x+8|0,A=w+8|0,v=S+4|0,Z=n;t:for(;;){P=k+(((0|Z)%5|0)<<4)|0,i[S>>2]=i[P>>2],i[S+4>>2]=i[P+4>>2],i[S+8>>2]=i[P+8>>2],i[S+12>>2]=i[P+12>>2];do{}while(2==(0|xt(S,s,0,1)));if((0|Z)>(0|n)&0!=(0|Ut(e))){if(i[g>>2]=i[S>>2],i[g+4>>2]=i[S+4>>2],i[g+8>>2]=i[S+8>>2],i[g+12>>2]=i[S+12>>2],K(u,m),r=0|i[g>>2],I=0|i[17008+(80*r|0)+(i[E>>2]<<2)>>2],i[g>>2]=i[18608+(80*r|0)+(20*I|0)>>2],(0|(P=0|i[18608+(80*r|0)+(20*I|0)+16>>2]))>0){t=0;do{at(l),t=t+1|0}while((0|t)<(0|P))}switch(P=18608+(80*r|0)+(20*I|0)+4|0,i[y>>2]=i[P>>2],i[y+4>>2]=i[P+4>>2],i[y+8>>2]=i[P+8>>2],$(y,3*(0|i[h>>2])|0),X(l,y,l),q(l),K(l,_),L=+(0|i[f>>2]),o[b>>3]=3*L,o[p>>3]=0,O=-1.5*L,o[x>>3]=O,o[d>>3]=2.598076211353316*L,o[w>>3]=O,o[A>>3]=-2.598076211353316*L,0|i[17008+(80*(0|i[g>>2])|0)+(i[S>>2]<<2)>>2]){case 1:t=x,r=b;break;case 3:t=w,r=x;break;case 2:t=b,r=w;break;default:t=12;break t}ae(m,_,r,t,B),mt(B,0|i[g>>2],s,1,a+8+(i[a>>2]<<4)|0),i[a>>2]=1+(0|i[a>>2])}if((0|Z)<(0|c)&&(K(v,g),mt(g,0|i[S>>2],s,1,a+8+(i[a>>2]<<4)|0),i[a>>2]=1+(0|i[a>>2])),i[E>>2]=i[S>>2],i[E+4>>2]=i[S+4>>2],i[E+8>>2]=i[S+8>>2],i[E+12>>2]=i[S+12>>2],(0|(Z=Z+1|0))>=(0|D)){t=3;break}}3!=(0|t)?12==(0|t)&&C(22474,22521,581,22531):M=T}}function bt(t,e,n){t|=0,e|=0,n|=0;var r,o=0,a=0,s=0,u=0,l=0;r=M,M=M+128|0,a=r,u=20208,l=(s=o=r+64|0)+60|0;do{i[s>>2]=i[u>>2],s=s+4|0,u=u+4|0}while((0|s)<(0|l));u=20272,l=(s=a)+60|0;do{i[s>>2]=i[u>>2],s=s+4|0,u=u+4|0}while((0|s)<(0|l));o=(l=0==(0|Ut(0|i[e>>2])))?o:a,ct(a=t+4|0),ht(a),0|Ut(0|i[e>>2])&&(it(a),i[e>>2]=1+(0|i[e>>2])),i[n>>2]=i[t>>2],X(a,o,e=n+4|0),q(e),i[n+16>>2]=i[t>>2],X(a,o+12|0,e=n+20|0),q(e),i[n+32>>2]=i[t>>2],X(a,o+24|0,e=n+36|0),q(e),i[n+48>>2]=i[t>>2],X(a,o+36|0,e=n+52|0),q(e),i[n+64>>2]=i[t>>2],X(a,o+48|0,n=n+68|0),q(n),M=r}function xt(t,e,n,r){n|=0,r|=0;var o,a,s,u,l,c,h=0,f=0,p=0,d=0,A=0;if(c=M,M=M+32|0,l=c+12|0,a=c,A=(t|=0)+4|0,d=0|i[16928+((e|=0)<<2)>>2],d=(u=0!=(0|r))?3*d|0:d,h=0|i[A>>2],o=0|i[(s=t+8|0)>>2],u){if((0|(h=o+h+(r=0|i[(f=t+12|0)>>2])|0))==(0|d))return M=c,0|(A=1);p=f}else h=o+h+(r=0|i[(p=t+12|0)>>2])|0;if((0|h)<=(0|d))return M=c,0|(A=0);do{if((0|r)>0){if(r=0|i[t>>2],(0|o)>0){f=18608+(80*r|0)+60|0,r=t;break}r=18608+(80*r|0)+40|0,n?(W(l,d,0,0),Y(A,l,a),st(a),X(a,l,A),f=r,r=t):(f=r,r=t)}else f=18608+(80*(0|i[t>>2])|0)+20|0,r=t}while(0);if(i[r>>2]=i[f>>2],(0|i[(h=f+16|0)>>2])>0){r=0;do{at(A),r=r+1|0}while((0|r)<(0|i[h>>2]))}return t=f+4|0,i[l>>2]=i[t>>2],i[l+4>>2]=i[t+4>>2],i[l+8>>2]=i[t+8>>2],e=0|i[16848+(e<<2)>>2],$(l,u?3*e|0:e),X(A,l,A),q(A),r=u&&((0|i[s>>2])+(0|i[A>>2])+(0|i[p>>2])|0)==(0|d)?1:2,M=c,0|(A=r)}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,r,a){t|=0,e|=0,n|=0,r|=0,a|=0;var s,u,l,c,h,f,p,d,A,v,g,m,y,_,b,x,w,B,k=0,E=0,S=0,T=0,I=0;if(B=M,M=M+240|0,_=B+208|0,b=B,x=B+192|0,w=B+176|0,A=B+160|0,v=B+144|0,g=B+128|0,m=B+112|0,y=B+96|0,i[(k=B+224|0)>>2]=e,i[_>>2]=i[t>>2],i[_+4>>2]=i[t+4>>2],i[_+8>>2]=i[t+8>>2],i[_+12>>2]=i[t+12>>2],Bt(_,k,b),i[a>>2]=0,(0|(d=r+n+(6==(0|r)&1)|0))<=(0|n))M=B;else{u=n+6|0,l=16928+((s=0|i[k>>2])<<2)|0,c=v+8|0,h=g+8|0,f=m+8|0,p=x+4|0,E=0,S=n,r=-1;t:for(;;){if(t=b+((k=(0|S)%6|0)<<4)|0,i[x>>2]=i[t>>2],i[x+4>>2]=i[t+4>>2],i[x+8>>2]=i[t+8>>2],i[x+12>>2]=i[t+12>>2],t=E,E=0|xt(x,s,0,1),(0|S)>(0|n)&0!=(0|Ut(e))&&(1!=(0|t)&&(0|i[x>>2])!=(0|r))){switch(K(b+(((k+5|0)%6|0)<<4)+4|0,w),K(b+(k<<4)+4|0,A),T=+(0|i[l>>2]),o[v>>3]=3*T,o[c>>3]=0,I=-1.5*T,o[g>>3]=I,o[h>>3]=2.598076211353316*T,o[m>>3]=I,o[f>>3]=-2.598076211353316*T,k=0|i[_>>2],0|i[17008+(80*k|0)+(((0|r)==(0|k)?0|i[x>>2]:r)<<2)>>2]){case 1:t=g,r=v;break;case 3:t=m,r=g;break;case 2:t=v,r=m;break;default:t=8;break t}ae(w,A,r,t,y),0|se(w,y)||0|se(A,y)||(mt(y,0|i[_>>2],s,1,a+8+(i[a>>2]<<4)|0),i[a>>2]=1+(0|i[a>>2]))}if((0|S)<(0|u)&&(K(p,w),mt(w,0|i[x>>2],s,1,a+8+(i[a>>2]<<4)|0),i[a>>2]=1+(0|i[a>>2])),(0|(S=S+1|0))>=(0|d)){t=3;break}r=0|i[x>>2]}3!=(0|t)?8==(0|t)&&C(22557,22521,746,22602):M=B}}function Bt(t,e,n){t|=0,e|=0,n|=0;var r,o=0,a=0,s=0,u=0,l=0;r=M,M=M+160|0,a=r,u=20336,l=(s=o=r+80|0)+72|0;do{i[s>>2]=i[u>>2],s=s+4|0,u=u+4|0}while((0|s)<(0|l));u=20416,l=(s=a)+72|0;do{i[s>>2]=i[u>>2],s=s+4|0,u=u+4|0}while((0|s)<(0|l));o=(l=0==(0|Ut(0|i[e>>2])))?o:a,ct(a=t+4|0),ht(a),0|Ut(0|i[e>>2])&&(it(a),i[e>>2]=1+(0|i[e>>2])),i[n>>2]=i[t>>2],X(a,o,e=n+4|0),q(e),i[n+16>>2]=i[t>>2],X(a,o+12|0,e=n+20|0),q(e),i[n+32>>2]=i[t>>2],X(a,o+24|0,e=n+36|0),q(e),i[n+48>>2]=i[t>>2],X(a,o+36|0,e=n+52|0),q(e),i[n+64>>2]=i[t>>2],X(a,o+48|0,e=n+68|0),q(e),i[n+80>>2]=i[t>>2],X(a,o+60|0,n=n+84|0),q(n),M=r}function kt(t){var e;return e=(t=+t)<0?t+6.283185307179586:t,+(t>=6.283185307179586?e+-6.283185307179586:e)}function Et(t,e){return e|=0,+u(+(+o[(t|=0)>>3]-+o[e>>3]))<17453292519943298e-27?0|(e=+u(+(+o[t+8>>3]-+o[e+8>>3]))<17453292519943298e-27):0|(e=0)}function St(t,e){t|=0;var n,r,i,a=0;return r=+o[(e|=0)>>3],n=+o[t>>3],a=(i=+f(.5*(r-n)))*i+(a=+f(.5*(+o[e+8>>3]-+o[t+8>>3])))*(+h(+r)*+h(+n)*a),2*+g(+ +l(+a),+ +l(+(1-a)))*6371.007180918475}function Tt(t,e,n){t|=0,n|=0;var r,i,a,s,u=0,c=0,d=0,A=0,m=0,y=0;return y=+o[(e|=0)>>3],a=+o[t>>3],m=+f(.5*(y-a)),d=+o[e+8>>3],i=+o[t+8>>3],A=+f(.5*(d-i)),r=+h(+a),s=+h(+y),A=2*+g(+ +l(+(A=m*m+A*(s*r*A))),+ +l(+(1-A))),m=+o[n>>3],y=+f(.5*(m-y)),u=+o[n+8>>3],d=+f(.5*(u-d)),c=+h(+m),d=2*+g(+ +l(+(d=y*y+d*(s*c*d))),+ +l(+(1-d))),m=+f(.5*(a-m)),u=+f(.5*(i-u)),u=2*+g(+ +l(+(u=m*m+u*(r*c*u))),+ +l(+(1-u))),4*+v(+ +l(+ +p(.5*(c=.5*(A+d+u)))*+p(.5*(c-A))*+p(.5*(c-d))*+p(.5*(c-u))))}function Mt(t,e){return e=0|Ce(0|(t|=0),0|(e|=0),45),w(),127&e|0}function It(t,e){var n=0,r=0,i=0,o=0,a=0,s=0;if(!(!0&134217728==(-16777216&(e|=0)|0)))return 0|(e=0);if(a=0|Ce(0|(t|=0),0|e,45),w(),(a&=127)>>>0>121)return 0|(e=0);n=0|Ce(0|t,0|e,52),w(),n&=15;do{if(0|n){for(i=1,r=0;;){if(o=0|Ce(0|t,0|e,3*(15-i|0)|0),w(),0!=(0|(o&=7))&(1^r)){if(1==(0|o)&0!=(0|O(a))){s=0,r=13;break}r=1}if(7==(0|o)){s=0,r=13;break}if(!(i>>>0<n>>>0)){r=9;break}i=i+1|0}if(9==(0|r)){if(15!=(0|n))break;return 0|(s=1)}if(13==(0|r))return 0|s}}while(0);for(;;){if(s=0|Ce(0|t,0|e,3*(14-n|0)|0),w(),!(7==(7&s|0)&!0)){s=0,r=13;break}if(!(n>>>0<14)){s=1,r=13;break}n=n+1|0}return 13==(0|r)?0|s:0}function Pt(t,e,n){n|=0;var r=0,i=0;if(r=0|Ce(0|(t|=0),0|(e|=0),52),w(),(0|(r&=15))>=(0|n)){if((0|r)!=(0|n))if(n>>>0<=15){if(t|=i=0|Be(0|n,0,52),e=0|w()|-15728641&e,(0|r)>(0|n))do{i=0|Be(7,0,3*(14-n|0)|0),n=n+1|0,t|=i,e=0|w()|e}while((0|n)<(0|r))}else e=0,t=0}else e=0,t=0;return x(0|e),0|t}function Zt(t,e,n,r){n|=0,r|=0;var o,a=0,s=0,u=0,l=0,c=0,h=0;if(u=0|Ce(0|(t|=0),0|(e|=0),52),w(),(0|n)<16&(0|(u&=15))<=(0|n)){if((0|u)==(0|n))return i[(n=r)>>2]=t,void(i[n+4>>2]=e);if(o=(0|(c=0|ee(7,n-u|0)))/7|0,l=0|Ce(0|t,0|e,45),w(),0|O(127&l)){t:do{if(u)for(s=1;;){if(a=0|Ce(0|t,0|e,3*(15-s|0)|0),w(),0|(a&=7))break t;if(!(s>>>0<u>>>0)){a=0;break}s=s+1|0}else a=0}while(0);s=0==(0|a)}else s=0;if(h=0|Be(u+1|0,0,52),a=0|w()|-15728641&e,Zt(e=(h|t)&~(e=0|Be(7,0,0|(l=3*(14-u|0)|0))),u=a&~(0|w()),n,r),a=r+(o<<3)|0,!s)return Zt((h=0|Be(1,0,0|l))|e,0|w()|u,n,a),h=a+(o<<3)|0,Zt((c=0|Be(2,0,0|l))|e,0|w()|u,n,h),h=h+(o<<3)|0,Zt((c=0|Be(3,0,0|l))|e,0|w()|u,n,h),h=h+(o<<3)|0,Zt((c=0|Be(4,0,0|l))|e,0|w()|u,n,h),h=h+(o<<3)|0,Zt((c=0|Be(5,0,0|l))|e,0|w()|u,n,h),void Zt((c=0|Be(6,0,0|l))|e,0|w()|u,n,h+(o<<3)|0);s=a+(o<<3)|0,(0|c)>6&&(Te(0|a,0,(h=(s>>>0>(c=a+8|0)>>>0?s:c)+-1+(0-a)|0)+8&-8|0),a=c+(h>>>3<<3)|0),Zt((h=0|Be(2,0,0|l))|e,0|w()|u,n,a),h=a+(o<<3)|0,Zt((c=0|Be(3,0,0|l))|e,0|w()|u,n,h),h=h+(o<<3)|0,Zt((c=0|Be(4,0,0|l))|e,0|w()|u,n,h),h=h+(o<<3)|0,Zt((c=0|Be(5,0,0|l))|e,0|w()|u,n,h),Zt((c=0|Be(6,0,0|l))|e,0|w()|u,n,h+(o<<3)|0)}}function Dt(t,e){var n=0,r=0,i=0;if(i=0|Ce(0|(t|=0),0|(e|=0),45),w(),!(0|O(127&i)))return 0|(i=0);i=0|Ce(0|t,0|e,52),w(),i&=15;t:do{if(i)for(r=1;;){if(n=0|Ce(0|t,0|e,3*(15-r|0)|0),w(),0|(n&=7))break t;if(!(r>>>0<i>>>0)){n=0;break}r=r+1|0}else n=0}while(0);return 0|(i=0==(0|n)&1)}function Lt(t,e){var n=0,r=0,i=0;if(i=0|Ce(0|(t|=0),0|(e|=0),52),w(),!(i&=15))return 0|(i=0);for(r=1;;){if(n=0|Ce(0|t,0|e,3*(15-r|0)|0),w(),0|(n&=7)){r=5;break}if(!(r>>>0<i>>>0)){n=0,r=5;break}r=r+1|0}return 5==(0|r)?0|n:0}function Ot(t,e){var n=0,r=0,i=0,o=0,a=0,s=0,u=0;if(u=0|Ce(0|(t|=0),0|(e|=0),52),w(),!(u&=15))return u=t,x(0|(s=e)),0|u;for(s=1,n=0;;){r=0|Be(7,0,0|(o=3*(15-s|0)|0)),i=0|w(),a=0|Ce(0|t,0|e,0|o),w(),t=(o=0|Be(0|ut(7&a),0,0|o))|t&~r,e=(a=0|w())|e&~i;t:do{if(!n)if(0==(o&r|0)&0==(a&i|0))n=0;else if(r=0|Ce(0|t,0|e,52),w(),r&=15){n=1;e:for(;;){switch(a=0|Ce(0|t,0|e,3*(15-n|0)|0),w(),7&a){case 1:break e;case 0:break;default:n=1;break t}if(!(n>>>0<r>>>0)){n=1;break t}n=n+1|0}for(n=1;;){if(i=0|Ce(0|t,0|e,0|(a=3*(15-n|0)|0)),w(),o=0|Be(7,0,0|a),e&=~(0|w()),t=t&~o|(a=0|Be(0|ut(7&i),0,0|a)),e=0|e|w(),!(n>>>0<r>>>0)){n=1;break}n=n+1|0}}else n=1}while(0);if(!(s>>>0<u>>>0))break;s=s+1|0}return x(0|e),0|t}function Ft(t,e){var n=0,r=0,i=0,o=0,a=0;if(r=0|Ce(0|(t|=0),0|(e|=0),52),w(),!(r&=15))return r=t,x(0|(n=e)),0|r;for(n=1;a=0|Ce(0|t,0|e,0|(o=3*(15-n|0)|0)),w(),i=0|Be(7,0,0|o),e&=~(0|w()),t=(o=0|Be(0|ut(7&a),0,0|o))|t&~i,e=0|w()|e,n>>>0<r>>>0;)n=n+1|0;return x(0|e),0|t}function Rt(t,e){var n=0,r=0,i=0,o=0,a=0,s=0,u=0;if(u=0|Ce(0|(t|=0),0|(e|=0),52),w(),!(u&=15))return u=t,x(0|(s=e)),0|u;for(s=1,n=0;;){r=0|Be(7,0,0|(o=3*(15-s|0)|0)),i=0|w(),a=0|Ce(0|t,0|e,0|o),w(),t=(o=0|Be(0|lt(7&a),0,0|o))|t&~r,e=(a=0|w())|e&~i;t:do{if(!n)if(0==(o&r|0)&0==(a&i|0))n=0;else if(r=0|Ce(0|t,0|e,52),w(),r&=15){n=1;e:for(;;){switch(a=0|Ce(0|t,0|e,3*(15-n|0)|0),w(),7&a){case 1:break e;case 0:break;default:n=1;break t}if(!(n>>>0<r>>>0)){n=1;break t}n=n+1|0}for(n=1;;){if(o=0|Be(7,0,0|(i=3*(15-n|0)|0)),a=e&~(0|w()),e=0|Ce(0|t,0|e,0|i),w(),t=t&~o|(e=0|Be(0|lt(7&e),0,0|i)),e=0|a|w(),!(n>>>0<r>>>0)){n=1;break}n=n+1|0}}else n=1}while(0);if(!(s>>>0<u>>>0))break;s=s+1|0}return x(0|e),0|t}function zt(t,e){var n=0,r=0,i=0,o=0,a=0;if(r=0|Ce(0|(t|=0),0|(e|=0),52),w(),!(r&=15))return r=t,x(0|(n=e)),0|r;for(n=1;o=0|Be(7,0,0|(a=3*(15-n|0)|0)),i=e&~(0|w()),e=0|Ce(0|t,0|e,0|a),w(),t=(e=0|Be(0|lt(7&e),0,0|a))|t&~o,e=0|w()|i,n>>>0<r>>>0;)n=n+1|0;return x(0|e),0|t}function Ut(t){return 0|(0|(t|=0))%2}function Nt(t,e){t|=0;var n,r;return r=M,M=M+16|0,n=r,(e|=0)>>>0<=15&&2146435072!=(2146435072&i[t+4>>2]|0)&&2146435072!=(2146435072&i[t+8+4>>2]|0)?(!function(t,e,n){var r,i;r=M,M=M+16|0,gt(t|=0,e|=0,n|=0,i=r),Q(i,n+4|0),M=r}(t,e,n),e=0|function(t,e){t|=0;var n,r=0,o=0,a=0,s=0,u=0,l=0,c=0,h=0;if(n=M,M=M+64|0,l=n+40|0,o=n+24|0,a=n+12|0,s=n,Be(0|(e|=0),0,52),r=134225919|w(),!e)return(0|i[t+4>>2])>2||(0|i[t+8>>2])>2||(0|i[t+12>>2])>2?(l=0,x(0|(u=0)),M=n,0|l):(Be(0|R(t),0,45),u=0|w()|r,l=-1,x(0|u),M=n,0|l);if(i[l>>2]=i[t>>2],i[l+4>>2]=i[t+4>>2],i[l+8>>2]=i[t+8>>2],i[l+12>>2]=i[t+12>>2],u=l+4|0,(0|e)>0)for(t=-1;i[o>>2]=i[u>>2],i[o+4>>2]=i[u+4>>2],i[o+8>>2]=i[u+8>>2],1&e?(et(u),i[a>>2]=i[u>>2],i[a+4>>2]=i[u+4>>2],i[a+8>>2]=i[u+8>>2],rt(a)):(nt(u),i[a>>2]=i[u>>2],i[a+4>>2]=i[u+4>>2],i[a+8>>2]=i[u+8>>2],it(a)),Y(o,a,s),q(s),c=0|Be(7,0,0|(h=3*(15-e|0)|0)),r&=~(0|w()),t=(h=0|Be(0|tt(s),0,0|h))|t&~c,r=0|w()|r,(0|e)>1;)e=e+-1|0;else t=-1;t:do{if((0|i[u>>2])<=2&&(0|i[l+8>>2])<=2&&(0|i[l+12>>2])<=2){if(e=0|Be(0|(o=0|R(l)),0,45),e|=t,t=0|w()|-1040385&r,s=0|z(l),!(0|O(o))){if((0|s)<=0)break;for(a=0;;
2){if(o=0|Ce(0|e,0|t,52),w(),o&=15)for(r=1;l=0|Ce(0|e,0|t,0|(h=3*(15-r|0)|0)),w(),c=0|Be(7,0,0|h),t&=~(0|w()),e=e&~c|(h=0|Be(0|ut(7&l),0,0|h)),t=0|t|w(),r>>>0<o>>>0;)r=r+1|0;if((0|(a=a+1|0))==(0|s))break t}}a=0|Ce(0|e,0|t,52),w(),a&=15;e:do{if(a){r=1;n:for(;;){switch(h=0|Ce(0|e,0|t,3*(15-r|0)|0),w(),7&h){case 1:break n;case 0:break;default:break e}if(!(r>>>0<a>>>0))break e;r=r+1|0}if(0|U(o,0|i[l>>2]))for(r=1;c=0|Be(7,0,0|(l=3*(15-r|0)|0)),h=t&~(0|w()),t=0|Ce(0|e,0|t,0|l),w(),e=e&~c|(t=0|Be(0|lt(7&t),0,0|l)),t=0|h|w(),r>>>0<a>>>0;)r=r+1|0;else for(r=1;l=0|Ce(0|e,0|t,0|(h=3*(15-r|0)|0)),w(),c=0|Be(7,0,0|h),t&=~(0|w()),e=e&~c|(h=0|Be(0|ut(7&l),0,0|h)),t=0|t|w(),r>>>0<a>>>0;)r=r+1|0}}while(0);if((0|s)>0){r=0;do{e=0|Ot(e,t),t=0|w(),r=r+1|0}while((0|r)!=(0|s))}}else e=0,t=0}while(0);return h=e,x(0|(c=t)),M=n,0|h}(n,e),t=0|w()):(t=0,e=0),x(0|t),M=r,0|e}function Gt(t,e,n){var r,o=0,a=0,s=0;if(r=(n|=0)+4|0,a=0|Ce(0|(t|=0),0|(e|=0),52),w(),a&=15,s=0|Ce(0|t,0|e,45),w(),o=0==(0|a),0|O(127&s)){if(o)return 0|(s=1);o=1}else{if(o)return 0|(s=0);o=0==(0|i[r>>2])&&0==(0|i[n+8>>2])?0!=(0|i[n+12>>2])&1:1}for(n=1;1&n?rt(r):it(r),s=0|Ce(0|t,0|e,3*(15-n|0)|0),w(),ot(r,7&s),n>>>0<a>>>0;)n=n+1|0;return 0|o}function jt(t,e,n){n|=0;var r,o,a=0,s=0,u=0,l=0,c=0,h=0;o=M,M=M+16|0,r=o,h=0|Ce(0|(t|=0),0|(e|=0),45),w(),h&=127;t:do{if(0!=(0|O(h))&&(u=0|Ce(0|t,0|e,52),w(),0!=(0|(u&=15)))){a=1;e:for(;;){switch(c=0|Ce(0|t,0|e,3*(15-a|0)|0),w(),7&c){case 5:break e;case 0:break;default:a=e;break t}if(!(a>>>0<u>>>0)){a=e;break t}a=a+1|0}for(s=1,a=e;l=0|Be(7,0,0|(e=3*(15-s|0)|0)),c=a&~(0|w()),a=0|Ce(0|t,0|a,0|e),w(),t=t&~l|(a=0|Be(0|lt(7&a),0,0|e)),a=0|c|w(),s>>>0<u>>>0;)s=s+1|0}else a=e}while(0);if(c=7728+(28*h|0)|0,i[n>>2]=i[c>>2],i[n+4>>2]=i[c+4>>2],i[n+8>>2]=i[c+8>>2],i[n+12>>2]=i[c+12>>2],0|Gt(t,a,n)){if(l=n+4|0,i[r>>2]=i[l>>2],i[r+4>>2]=i[l+4>>2],i[r+8>>2]=i[l+8>>2],u=0|Ce(0|t,0|a,52),w(),c=15&u,1&u?(it(l),u=c+1|0):u=c,0|O(h)){t:do{if(c)for(e=1;;){if(s=0|Ce(0|t,0|a,3*(15-e|0)|0),w(),0|(s&=7)){a=s;break t}if(!(e>>>0<c>>>0)){a=0;break}e=e+1|0}else a=0}while(0);a=4==(0|a)&1}else a=0;if(0|xt(n,u,a,0)){if(0|O(h))do{}while(0!=(0|xt(n,u,0,0)));(0|u)!=(0|c)&&nt(l)}else(0|u)!=(0|c)&&(i[l>>2]=i[r>>2],i[l+4>>2]=i[r+4>>2],i[l+8>>2]=i[r+8>>2]);M=o}else M=o}function Vt(t,e,n){n|=0;var r,i;r=M,M=M+16|0,jt(t|=0,e|=0,i=r),e=0|Ce(0|t,0|e,52),w(),yt(i,15&e,n),M=r}function Ht(t,e,n){n|=0;var r,i,o=0,a=0;i=M,M=M+16|0,jt(t|=0,e|=0,r=i),o=0|Ce(0|t,0|e,45),w(),o=0==(0|O(127&o)),a=0|Ce(0|t,0|e,52),w(),a&=15;t:do{if(!o){if(0|a)for(o=1;;){if(!(0==((0|Be(7,0,3*(15-o|0)|0))&t|0)&0==((0|w())&e|0)))break t;if(!(o>>>0<a>>>0))break;o=o+1|0}return _t(r,a,0,5,n),void(M=i)}}while(0);Ct(r,a,0,6,n),M=i}function Jt(t,e){e|=0;var n,r=0,o=0,a=0,s=0,u=0,l=0;if(Be(0|(t|=0),0,52),n=134225919|w(),(0|t)<1){o=0,r=0;do{0|O(o)&&(Be(0|o,0,45),u=0|n|w(),i[(t=e+(r<<3)|0)>>2]=-1,i[t+4>>2]=u,r=r+1|0),o=o+1|0}while(122!=(0|o))}else{u=0,r=0;do{if(0|O(u)){for(Be(0|u,0,45),o=1,a=-1,s=0|n|w();a&=~(l=0|Be(7,0,3*(15-o|0)|0)),s&=~(0|w()),(0|o)!=(0|t);)o=o+1|0;i[(l=e+(r<<3)|0)>>2]=a,i[l+4>>2]=s,r=r+1|0}u=u+1|0}while(122!=(0|u))}}function Wt(t,e,n,r){var o,a=0,s=0,u=0,l=0,c=0;if(o=M,M=M+64|0,u=o,(0|(t|=0))==(0|(n|=0))&(0|(e|=0))==(0|(r|=0))|!1|134217728!=(2013265920&e|0)|!1|134217728!=(2013265920&r|0))return M=o,0|(u=0);if(a=0|Ce(0|t,0|e,52),w(),a&=15,s=0|Ce(0|n,0|r,52),w(),(0|a)!=(15&s|0))return M=o,0|(u=0);if(s=a+-1|0,a>>>0>1&&(c=0|Pt(t,e,s),l=0|w(),(0|c)==(0|(s=0|Pt(n,r,s)))&(0|l)==(0|w()))){if(a=0|Ce(0|t,0|e,0|(s=3*(15^a)|0)),w(),a&=7,s=0|Ce(0|n,0|r,0|s),w(),0==(0|a)|0==(0|(s&=7)))return M=o,0|(c=1);if((0|i[21136+(a<<2)>>2])==(0|s))return M=o,0|(c=1);if((0|i[21168+(a<<2)>>2])==(0|s))return M=o,0|(c=1)}s=(a=u)+56|0;do{i[a>>2]=0,a=a+4|0}while((0|a)<(0|s));return I(t,e,1,u),a=(0|i[(c=u)>>2])==(0|n)&&(0|i[c+4>>2])==(0|r)||(0|i[(c=u+8|0)>>2])==(0|n)&&(0|i[c+4>>2])==(0|r)||(0|i[(c=u+16|0)>>2])==(0|n)&&(0|i[c+4>>2])==(0|r)||(0|i[(c=u+24|0)>>2])==(0|n)&&(0|i[c+4>>2])==(0|r)||(0|i[(c=u+32|0)>>2])==(0|n)&&(0|i[c+4>>2])==(0|r)||(0|i[(c=u+40|0)>>2])==(0|n)&&(0|i[c+4>>2])==(0|r)?1:1&((0|i[(a=u+48|0)>>2])==(0|n)?(0|i[a+4>>2])==(0|r):0),M=o,0|(c=a)}function Qt(t,e,n){n|=0;var r,o,a,s,u=0;if(a=M,M=M+16|0,o=a,u=0|Ce(0|(t|=0),0|(e|=0),56),w(),e=0|function(t,e,n){t|=0,e|=0,n|=0;var r=0,o=0;if(r=0|Dt(t,e),(n+-1|0)>>>0>5)return 0|(n=-1);if(o=0!=(0|r),1==(0|n)&o)return 0|(n=-1);return r=0|function(t,e){t|=0,e|=0;var n=0,r=0,o=0,a=0,s=0,u=0,l=0,c=0;if(c=M,M=M+32|0,o=c+16|0,a=c,jt(t,e,o),s=0|Mt(t,e),l=0|Lt(t,e),function(t,e){t=7728+(28*(t|=0)|0)|0,i[(e|=0)>>2]=i[t>>2],i[e+4>>2]=i[t+4>>2],i[e+8>>2]=i[t+8>>2],i[e+12>>2]=i[t+12>>2]}(s,a),e=0|function(t,e){t|=0;var n=0,r=0;if((e|=0)>>>0>20)return-1;do{if((0|i[11152+(216*e|0)>>2])!=(0|t))if((0|i[11152+(216*e|0)+8>>2])!=(0|t))if((0|i[11152+(216*e|0)+16>>2])!=(0|t))if((0|i[11152+(216*e|0)+24>>2])!=(0|t))if((0|i[11152+(216*e|0)+32>>2])!=(0|t))if((0|i[11152+(216*e|0)+40>>2])!=(0|t))if((0|i[11152+(216*e|0)+48>>2])!=(0|t))if((0|i[11152+(216*e|0)+56>>2])!=(0|t))if((0|i[11152+(216*e|0)+64>>2])!=(0|t))if((0|i[11152+(216*e|0)+72>>2])!=(0|t))if((0|i[11152+(216*e|0)+80>>2])!=(0|t))if((0|i[11152+(216*e|0)+88>>2])!=(0|t))if((0|i[11152+(216*e|0)+96>>2])!=(0|t))if((0|i[11152+(216*e|0)+104>>2])!=(0|t))if((0|i[11152+(216*e|0)+112>>2])!=(0|t))if((0|i[11152+(216*e|0)+120>>2])!=(0|t))if((0|i[11152+(216*e|0)+128>>
vendor: 4,687 bytes, line 2
22])!=(0|t)){if((0|i[11152+(216*e|0)+136>>2])!=(0|t)){if((0|i[11152+(216*e|0)+144>>2])==(0|t)){t=0,n=2,r=0;break}if((0|i[11152+(216*e|0)+152>>2])==(0|t)){t=0,n=2,r=1;break}if((0|i[11152+(216*e|0)+160>>2])==(0|t)){t=0,n=2,r=2;break}if((0|i[11152+(216*e|0)+168>>2])==(0|t)){t=1,n=2,r=0;break}if((0|i[11152+(216*e|0)+176>>2])==(0|t)){t=1,n=2,r=1;break}if((0|i[11152+(216*e|0)+184>>2])==(0|t)){t=1,n=2,r=2;break}if((0|i[11152+(216*e|0)+192>>2])==(0|t)){t=2,n=2,r=0;break}if((0|i[11152+(216*e|0)+200>>2])==(0|t)){t=2,n=2,r=1;break}if((0|i[11152+(216*e|0)+208>>2])==(0|t)){t=2,n=2,r=2;break}return-1}t=2,n=1,r=2}else t=2,n=1,r=1;else t=2,n=1,r=0;else t=1,n=1,r=2;else t=1,n=1,r=1;else t=1,n=1,r=0;else t=0,n=1,r=2;else t=0,n=1,r=1;else t=0,n=1,r=0;else t=2,n=0,r=2;else t=2,n=0,r=1;else t=2,n=0,r=0;else t=1,n=0,r=2;else t=1,n=0,r=1;else t=1,n=0,r=0;else t=0,n=0,r=2;else t=0,n=0,r=1;else t=0,n=0,r=0}while(0);return 0|i[11152+(216*e|0)+(72*n|0)+(24*t|0)+(r<<3)+4>>2]}(s,0|i[o>>2]),!(0|O(s)))return M=c,0|(l=e);switch(0|s){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:u=0,r=0}14==(0|n)&&(u=0|i[22096+(24*t|0)+8>>2],r=0|i[22096+(24*t|0)+16>>2]);t=0|i[o>>2],(0|t)!=(0|i[a>>2])&&(s=0|F(s))|(0|(t=0|i[o>>2]))==(0|r)&&(e=(e+1|0)%6|0);if(3==(0|l)&(0|t)==(0|r))return M=c,0|(l=(e+5|0)%6|0);if(!(5==(0|l)&(0|t)==(0|u)))return M=c,0|(l=e);return l=(e+1|0)%6|0,M=c,0|l}(t,e),o?0|(n=(5-r+(0|i[22384+(n<<2)>>2])|0)%5|0):0|(n=(6-r+(0|i[22416+(n<<2)>>2])|0)%6|0)}(r=(s=!0&268435456==(2013265920&e|0))?t:0,t=s?-2130706433&e|134217728:0,7&u),-1==(0|e))return i[n>>2]=0,void(M=a);jt(r,t,o),u=0|Ce(0|r,0|t,52),w(),u&=15,0|Dt(r,t)?_t(o,u,e,2,n):Ct(o,u,e,2,n),M=a}function qt(t){t|=0;var e,n,r=0;return(e=0|ye(1,12))||C(22691,22646,49,22704),0|(r=0|i[(n=t+4|0)>>2])?(i[(r=r+8|0)>>2]=e,i[n>>2]=e,0|e):(0|i[t>>2]&&C(22721,22646,61,22744),i[(r=t)>>2]=e,i[n>>2]=e,0|e)}function Kt(t,e){t|=0,e|=0;var n,r;return(r=0|ge(24))||C(22758,22646,78,22772),i[r>>2]=i[e>>2],i[r+4>>2]=i[e+4>>2],i[r+8>>2]=i[e+8>>2],i[r+12>>2]=i[e+12>>2],i[r+16>>2]=0,0|(n=0|i[(e=t+4|0)>>2])?(i[n+16>>2]=r,i[e>>2]=r,0|r):(0|i[t>>2]&&C(22787,22646,82,22772),i[t>>2]=r,i[e>>2]=r,0|r)}function Xt(t){var e,n,r=0,a=0,s=0,l=0,c=0,h=0,f=0,p=0,d=0,A=0,v=0,g=0,m=0,y=0,_=0,b=0,x=0,w=0,B=0,k=0,E=0,S=0,T=0,M=0,I=0,P=0,Z=0,D=0,L=0,O=0;if(0|i[(l=(t|=0)+8|0)>>2])return 0|(O=1);if(!(s=0|i[t>>2]))return 0|(O=0);r=s,a=0;do{a=a+1|0,r=0|i[r+8>>2]}while(0!=(0|r));if(a>>>0<2)return 0|(O=0);(n=0|ge(a<<2))||C(22807,22646,317,22826),(e=0|ge(a<<5))||C(22848,22646,321,22826),i[t>>2]=0,i[(S=t+4|0)>>2]=0,i[l>>2]=0,a=0,D=0,E=0,v=0;t:for(;;){if(A=0|i[s>>2]){c=0,h=A;do{if(p=+o[h+8>>3],r=h,h=0|i[h+16>>2],f=+o[(l=(d=0==(0|h))?A:h)+8>>3],+u(+(p-f))>3.141592653589793){O=14;break}c+=(f-p)*(+o[r>>3]+ +o[l>>3])}while(!d);if(14==(0|O)){O=0,c=0,r=A;do{k=+o[r+8>>3],P=0|i[(Z=r+16|0)>>2],B=+o[(P=0==(0|P)?A:P)+8>>3],c+=(+o[r>>3]+ +o[P>>3])*((B<0?B+6.283185307179586:B)-(k<0?k+6.283185307179586:k)),r=0|i[(0==(0|r)?s:Z)>>2]}while(0!=(0|r))}c>0?(i[n+(D<<2)>>2]=s,D=D+1|0,l=E,r=v):O=19}else O=19;if(19==(0|O)){O=0;do{if(!a){if(v){l=S,h=v+8|0,r=s,a=t;break}if(0|i[t>>2]){O=27;break t}l=S,h=t,r=s,a=t;break}if(0|i[(r=a+8|0)>>2]){O=21;break t}if(!(a=0|ye(1,12))){O=23;break t}i[r>>2]=a,l=a+4|0,h=a,r=v}while(0);if(i[h>>2]=s,i[l>>2]=s,h=e+(E<<5)|0,d=0|i[s>>2]){for(o[(A=e+(E<<5)+8|0)>>3]=17976931348623157e292,o[(v=e+(E<<5)+24|0)>>3]=17976931348623157e292,o[h>>3]=-17976931348623157e292,o[(g=e+(E<<5)+16|0)>>3]=-17976931348623157e292,x=17976931348623157e292,w=-17976931348623157e292,l=0,m=d,p=17976931348623157e292,_=17976931348623157e292,b=-17976931348623157e292,f=-17976931348623157e292;c=+o[m>>3],k=+o[m+8>>3],m=0|i[m+16>>2],B=+o[((y=0==(0|m))?d:m)+8>>3],c<p&&(o[A>>3]=c,p=c),k<_&&(o[v>>3]=k,_=k),c>b?o[h>>3]=c:c=b,k>f&&(o[g>>3]=k,f=k),x=k>0&k<x?k:x,w=k<0&k>w?k:w,l|=+u(+(k-B))>3.141592653589793,!y;)b=c;l&&(o[g>>3]=w,o[v>>3]=x)}else i[h>>2]=0,i[h+4>>2]=0,i[h+8>>2]=0,i[h+12>>2]=0,i[h+16>>2]=0,i[h+20>>2]=0,i[h+24>>2]=0,i[h+28>>2]=0;l=E+1|0}if(s=0|i[(Z=s+8|0)>>2],i[Z>>2]=0,!s){O=45;break}E=l,v=r}if(21==(0|O))C(22624,22646,35,22658);else if(23==(0|O))C(22678,22646,37,22658);else if(27==(0|O))C(22721,22646,61,22744);else if(45==(0|O)){t:do{if((0|D)>0){for(Z=0==(0|l),I=l<<2,P=0==(0|t),M=0,r=0;;){if(T=0|i[n+(M<<2)>>2],Z)O=73;else{if(!(E=0|ge(I))){O=50;break}if(!(S=0|ge(I))){O=52;break}e:do{if(P)a=0;else{for(l=0,a=0,h=t;s=e+(l<<5)|0,0|Yt(0|i[h>>2],s,0|i[T>>2])?(i[E+(a<<2)>>2]=h,i[S+(a<<2)>>2]=s,y=a+1|0):y=a,h=0|i[h+8>>2];)l=l+1|0,a=y;
2if((0|y)>0)if(s=0|i[E>>2],1==(0|y))a=s;else for(g=0,m=-1,a=s,v=s;;){for(d=0|i[v>>2],s=0,h=0;A=(0|(l=0|i[i[E+(h<<2)>>2]>>2]))==(0|d)?s:s+(1&(0|Yt(l,0|i[S+(h<<2)>>2],0|i[d>>2])))|0,(0|(h=h+1|0))!=(0|y);)s=A;if(a=(l=(0|A)>(0|m))?v:a,(0|(s=g+1|0))==(0|y))break e;g=s,m=l?A:m,v=0|i[E+(s<<2)>>2]}else a=0}}while(0);if(me(E),me(S),a){if(s=0|i[(l=a+4|0)>>2])a=s+8|0;else if(0|i[a>>2]){O=70;break}i[a>>2]=T,i[l>>2]=T}else O=73}if(73==(0|O)){if(O=0,0|(r=0|i[T>>2]))do{S=r,r=0|i[r+16>>2],me(S)}while(0!=(0|r));me(T),r=2}if((0|(M=M+1|0))>=(0|D)){L=r;break t}}50==(0|O)?C(22863,22646,249,22882):52==(0|O)?C(22901,22646,252,22882):70==(0|O)&&C(22721,22646,61,22744)}else L=0}while(0);return me(n),me(e),0|(O=L)}return 0}function Yt(t,e,n){t|=0;var r,a=0,s=0,u=0,l=0,c=0,h=0,f=0;if(!(0|V(e|=0,n|=0)))return 0|(t=0);if(e=0|j(e),r=+o[n>>3],a=e&(a=+o[n+8>>3])<0?a+6.283185307179586:a,!(t=0|i[t>>2]))return 0|(t=0);if(e){e=0,n=t;t:for(;;){for(;l=+o[n>>3],h=+o[n+8>>3],f=0|i[(n=n+16|0)>>2],u=+o[(f=0==(0|f)?t:f)>>3],s=+o[f+8>>3],l>u?(c=l,l=h):(c=u,u=l,l=s,s=h),r<u|r>c;)if(!(n=0|i[n>>2])){n=22;break t}if(a=(l=l<0?l+6.283185307179586:l)==a|(h=s<0?s+6.283185307179586:s)==a?a+-2220446049250313e-31:a,((h+=(r-u)/(c-u)*(l-h))<0?h+6.283185307179586:h)>a&&(e^=1),!(n=0|i[n>>2])){n=22;break}}if(22==(0|n))return 0|e}else{e=0,n=t;t:for(;;){for(;l=+o[n>>3],h=+o[n+8>>3],f=0|i[(n=n+16|0)>>2],u=+o[(f=0==(0|f)?t:f)>>3],s=+o[f+8>>3],l>u?(c=l,l=h):(c=u,u=l,l=s,s=h),r<u|r>c;)if(!(n=0|i[n>>2])){n=22;break t}if(s+(r-u)/(c-u)*(l-s)>(a=l==a|s==a?a+-2220446049250313e-31:a)&&(e^=1),!(n=0|i[n>>2])){n=22;break}}if(22==(0|n))return 0|e}return 0}function $t(t,e,n,o,a){n|=0,o|=0,a|=0;var s,u,l,c,h=0,f=0,p=0,d=0,A=0,v=0,g=0,m=0,y=0,_=0;if(c=M,M=M+32|0,_=c+16|0,l=c,h=0|Ce(0|(t|=0),0|(e|=0),52),w(),h&=15,g=0|Ce(0|n,0|o,52),w(),(0|h)!=(15&g|0))return M=c,0|(_=1);if(A=0|Ce(0|t,0|e,45),w(),A&=127,v=0|Ce(0|n,0|o,45),w(),g=(0|A)!=(0|(v&=127))){if(7==(0|(p=0|G(A,v))))return M=c,0|(_=2);7==(0|(d=0|G(v,A)))?C(22925,22949,151,22959):(m=p,f=d)}else m=0,f=0;s=0|O(A),u=0|O(v),i[_>>2]=0,i[_+4>>2]=0,i[_+8>>2]=0,i[_+12>>2]=0;do{if(m){if(p=(0|(v=0|i[4304+(28*A|0)+(m<<2)>>2]))>0,u)if(p){A=0,d=n,p=o;do{d=0|Rt(d,p),p=0|w(),1==(0|(f=0|lt(f)))&&(f=0|lt(1)),A=A+1|0}while((0|A)!=(0|v));v=f,A=d,d=p}else v=f,A=n,d=o;else if(p){A=0,d=n,p=o;do{d=0|zt(d,p),p=0|w(),f=0|lt(f),A=A+1|0}while((0|A)!=(0|v));v=f,A=d,d=p}else v=f,A=n,d=o;if(Gt(A,d,_),g||C(22972,22949,181,22959),(p=0!=(0|s))&(f=0!=(0|u))&&C(22999,22949,182,22959),p){if(f=0|Lt(t,e),0|r[22032+(7*f|0)+m>>0]){h=3;break}A=d=0|i[21200+(28*f|0)+(m<<2)>>2],y=26}else if(f){if(f=0|Lt(A,d),0|r[22032+(7*f|0)+v>>0]){h=4;break}A=0,d=0|i[21200+(28*v|0)+(f<<2)>>2],y=26}else f=0;if(26==(0|y))if((0|d)<=-1&&C(23030,22949,212,22959),(0|A)<=-1&&C(23053,22949,213,22959),(0|d)>0){p=_+4|0,f=0;do{st(p),f=f+1|0}while((0|f)!=(0|d));f=A}else f=A;if(i[l>>2]=0,i[l+4>>2]=0,i[l+8>>2]=0,ot(l,m),0|h)for(;0|Ut(h)?rt(l):it(l),(0|h)>1;)h=h+-1|0;if((0|f)>0){h=0;do{st(l),h=h+1|0}while((0|h)!=(0|f))}X(y=_+4|0,l,y),q(y),y=50}else if(Gt(n,o,_),0!=(0|s)&0!=(0|u))if((0|v)!=(0|A)&&C(23077,22949,243,22959),f=0|Lt(t,e),h=0|Lt(n,o),0|r[22032+(7*f|0)+h>>0])h=5;else if((0|(f=0|i[21200+(28*f|0)+(h<<2)>>2]))>0){p=_+4|0,h=0;do{st(p),h=h+1|0}while((0|h)!=(0|f));y=50}else y=50;else y=50}while(0);return 50==(0|y)&&(h=_+4|0,i[a>>2]=i[h>>2],i[a+4>>2]=i[h+4>>2],i[a+8>>2]=i[h+8>>2],h=0),M=c,0|(_=h)}function te(t,e,n,r){n|=0,r|=0;var o,a,s=0,u=0,l=0,c=0,h=0,f=0,p=0,d=0,A=0,v=0,g=0,m=0,y=0;if(a=M,M=M+48|0,l=a+36|0,c=a+24|0,h=a+12|0,f=a,u=0|Ce(0|(t|=0),0|(e|=0),52),w(),u&=15,d=0|Ce(0|t,0|e,45),w(),o=0|O(d&=127),Be(0|u,0,52),g=134225919|w(),i[(v=r)>>2]=-1,i[v+4>>2]=g,!u)return(0|i[n>>2])>1||(0|i[n+4>>2])>1||(0|i[n+8>>2])>1||127==(0|(s=0|N(d,0|tt(n))))?(M=a,0|(g=1)):(A=0|Be(0|s,0,45),v=0|w(),v=-1040385&i[(d=r)+4>>2]|v,i[(g=r)>>2]=i[d>>2]|A,i[g+4>>2]=v,M=a,0|(g=0));for(i[l>>2]=i[n>>2],i[l+4>>2]=i[n+4>>2],i[l+8>>2]=i[n+8>>2];i[c>>2]=i[l>>2],i[c+4>>2]=i[l+4>>2],i[c+8>>2]=i[l+8>>2],0|Ut(u)?(et(l),i[h>>2]=i[l>>2],i[h+4>>2]=i[l+4>>2],i[h+8>>2]=i[l+8>>2],rt(h)):(nt(l),i[h>>2]=i[l>>2],i[h+4>>2]=i[l+4>>2],i[h+8>>2]=i[l+8>>2],it(h)),Y(c,h,f),q(f),m=0|i[(v=r)>>2],v=0|i[v+4>>2],n=0|Be(7,0,0|(y=3*(15-u|0)|0)),v&=~(0|w()),y=0|Be(0|tt(f),0,0|y),v=0|w()|v,i[(g=r)>>2]=y|m&~n,i[g+4>>2]=v,(0|u)>1;)u=u+-1|0;t:do{if((0|i[l>>2])<=1&&(0|i[l+4>>2])<=1&&(0|i[l+8>>2])<=1){f=127==(0|(c=0|N(d,u=0|tt(l))))?0:0|O(c);e:do{if(u){if(o){if(l=21408+(28*(0|Lt(t,e))|0)+(u<<2)|0,(0|(l=0|i[l>>2]))>0){n=0;do{u=0|ut(u),n=n+1|0}while((0|n)!=(0|l))}if(1==(0|u)){s=3;break t}127==(0|(n=0|N(d,u)))&&C(23104,22949,376,23134),0|O(n)?C(23147,22949,377,23
2134):(A=l,p=u,s=n)}else A=0,p=u,s=c;if((0|(h=0|i[4304+(28*d|0)+(p<<2)>>2]))<=-1&&C(23178,22949,384,23134),!f){if((0|A)<=-1&&C(23030,22949,417,23134),0|A){u=0,n=0|i[(l=r)>>2],l=0|i[l+4>>2];do{n=0|Ft(n,l),l=0|w(),i[(y=r)>>2]=n,i[y+4>>2]=l,u=u+1|0}while((0|u)<(0|A))}if((0|h)<=0){u=54;break}for(u=0,n=0|i[(l=r)>>2],l=0|i[l+4>>2];;)if(n=0|Ft(n,l),l=0|w(),i[(y=r)>>2]=n,i[y+4>>2]=l,(0|(u=u+1|0))==(0|h)){u=54;break e}}if(7==(0|(c=0|G(s,d)))&&C(22925,22949,393,23134),n=0|i[(u=r)>>2],u=0|i[u+4>>2],(0|h)>0){l=0;do{n=0|Ft(n,u),u=0|w(),i[(y=r)>>2]=n,i[y+4>>2]=u,l=l+1|0}while((0|l)!=(0|h))}if(n=0|Lt(n,u),y=0|F(s),(0|(n=0|i[(y?21824:21616)+(28*c|0)+(n<<2)>>2]))<=-1&&C(23030,22949,412,23134),n){u=0,l=0|i[(c=r)>>2],c=0|i[c+4>>2];do{l=0|Ot(l,c),c=0|w(),i[(y=r)>>2]=l,i[y+4>>2]=c,u=u+1|0}while((0|u)<(0|n));u=54}else u=54}else if(0!=(0|o)&0!=(0|f))if(u=21408+(28*(y=0|Lt(t,e))|0)+((0|Lt(0|i[(u=r)>>2],0|i[u+4>>2]))<<2)|0,(0|(u=0|i[u>>2]))<=-1&&C(23201,22949,433,23134),u){s=0,n=0|i[(l=r)>>2],l=0|i[l+4>>2];do{n=0|Ft(n,l),l=0|w(),i[(y=r)>>2]=n,i[y+4>>2]=l,s=s+1|0}while((0|s)<(0|u));s=c,u=54}else s=c,u=55;else s=c,u=54}while(0);if(54==(0|u)&&f&&(u=55),55==(0|u)&&1==(0|Lt(0|i[(y=r)>>2],0|i[y+4>>2]))){s=4;break}g=0|i[(y=r)>>2],y=-1040385&i[y+4>>2],m=0|Be(0|s,0,45),y=0|y|w(),i[(s=r)>>2]=g|m,i[s+4>>2]=y,s=0}else s=2}while(0);return M=a,0|(y=s)}function ee(t,e){var n=0;if(!(e|=0))return 0|(n=1);n=t|=0,t=1;do{t=0|y(0==(1&e|0)?1:n,t),e>>=1,n=0|y(n,n)}while(0!=(0|e));return 0|t}function ne(t,e,n){t|=0;var r,a,s=0,u=0,l=0,c=0,h=0,f=0,p=0,d=0;if(!(0|V(e|=0,n|=0)))return 0|(d=0);if(e=0|j(e),a=+o[n>>3],s=e&(s=+o[n+8>>3])<0?s+6.283185307179586:s,(0|(d=0|i[t>>2]))<=0)return 0|(d=0);if(r=0|i[t+4>>2],e){e=0,n=-1,t=0;t:for(;;){for(p=t;c=+o[r+(p<<4)>>3],f=+o[r+(p<<4)+8>>3],l=+o[r+((t=(n+2|0)%(0|d)|0)<<4)>>3],u=+o[r+(t<<4)+8>>3],c>l?(h=c,c=f):(h=l,l=c,c=u,u=f),a<l|a>h;){if(!((0|(n=p+1|0))<(0|d))){n=22;break t}t=p,p=n,n=t}if(s=(c=c<0?c+6.283185307179586:c)==s|(f=u<0?u+6.283185307179586:u)==s?s+-2220446049250313e-31:s,((f
vendor: 25,366 bytes, line 2
2+=(a-l)/(h-l)*(c-f))<0?f+6.283185307179586:f)>s&&(e^=1),(0|(t=p+1|0))>=(0|d)){n=22;break}n=p}if(22==(0|n))return 0|e}else{e=0,n=-1,t=0;t:for(;;){for(p=t;c=+o[r+(p<<4)>>3],f=+o[r+(p<<4)+8>>3],l=+o[r+((t=(n+2|0)%(0|d)|0)<<4)>>3],u=+o[r+(t<<4)+8>>3],c>l?(h=c,c=f):(h=l,l=c,c=u,u=f),a<l|a>h;){if(!((0|(n=p+1|0))<(0|d))){n=22;break t}t=p,p=n,n=t}if(u+(a-l)/(h-l)*(c-u)>(s=c==s|u==s?s+-2220446049250313e-31:s)&&(e^=1),(0|(t=p+1|0))>=(0|d)){n=22;break}n=p}if(22==(0|n))return 0|e}return 0}function re(t,e){e|=0;var n,r,a,s,l,c=0,h=0,f=0,p=0,d=0,A=0,v=0,g=0,m=0,y=0,_=0,b=0;if(!(r=0|i[(t|=0)>>2]))return i[e>>2]=0,i[e+4>>2]=0,i[e+8>>2]=0,i[e+12>>2]=0,i[e+16>>2]=0,i[e+20>>2]=0,i[e+24>>2]=0,void(i[e+28>>2]=0);if(o[(a=e+8|0)>>3]=17976931348623157e292,o[(s=e+24|0)>>3]=17976931348623157e292,o[e>>3]=-17976931348623157e292,o[(l=e+16|0)>>3]=-17976931348623157e292,!((0|r)<=0)){for(n=0|i[t+4>>2],g=17976931348623157e292,m=-17976931348623157e292,y=0,t=-1,p=17976931348623157e292,d=17976931348623157e292,v=-17976931348623157e292,h=-17976931348623157e292,_=0;c=+o[n+(_<<4)>>3],A=+o[n+(_<<4)+8>>3],f=+o[n+(((0|(t=t+2|0))==(0|r)?0:t)<<4)+8>>3],c<p&&(o[a>>3]=c,p=c),A<d&&(o[s>>3]=A,d=A),c>v?o[e>>3]=c:c=v,A>h&&(o[l>>3]=A,h=A),g=A>0&A<g?A:g,m=A<0&A>m?A:m,y|=+u(+(A-f))>3.141592653589793,(0|(t=_+1|0))!=(0|r);)b=_,v=c,_=t,t=b;y&&(o[l>>3]=m,o[s>>3]=g)}}function ie(t,e){e|=0;var n,r=0,a=0,s=0,l=0,c=0,h=0,f=0,p=0,d=0,A=0,v=0,g=0,m=0,y=0,_=0,b=0,x=0,w=0,C=0,B=0,k=0;if(m=0|i[(t|=0)>>2]){if(o[(y=e+8|0)>>3]=17976931348623157e292,o[(_=e+24|0)>>3]=17976931348623157e292,o[e>>3]=-17976931348623157e292,o[(b=e+16|0)>>3]=-17976931348623157e292,(0|m)>0){for(s=0|i[t+4>>2],v=17976931348623157e292,g=-17976931348623157e292,a=0,r=-1,f=17976931348623157e292,p=17976931348623157e292,A=-17976931348623157e292,c=-17976931348623157e292,x=0;l=+o[s+(x<<4)>>3],d=+o[s+(x<<4)+8>>3],h=+o[s+(((0|(B=r+2|0))==(0|m)?0:B)<<4)+8>>3],l<f&&(o[y>>3]=l,f=l),d<p&&(o[_>>3]=d,p=d),l>A?o[e>>3]=l:l=A,d>c&&(o[b>>3]=d,c=d),v=d>0&d<v?d:v,g=d<0&d>g?d:g,a|=+u(+(d-h))>3.141592653589793,(0|(r=x+1|0))!=(0|m);)B=x,A=l,x=r,r=B;a&&(o[b>>3]=g,o[_>>3]=v)}}else i[e>>2]=0,i[e+4>>2]=0,i[e+8>>2]=0,i[e+12>>2]=0,i[e+16>>2]=0,i[e+20>>2]=0,i[e+24>>2]=0,i[e+28>>2]=0;if(!((0|(r=0|i[(B=t+8|0)>>2]))<=0)){n=t+12|0,C=0;do{if(s=0|i[n>>2],a=C,_=e+((C=C+1|0)<<5)|0,b=0|i[s+(a<<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(m=0|i[s+(a<<3)+4>>2],v=17976931348623157e292,g=-17976931348623157e292,s=0,a=-1,y=0,f=17976931348623157e292,p=17976931348623157e292,d=-17976931348623157e292,c=-17976931348623157e292;l=+o[m+(y<<4)>>3],A=+o[m+(y<<4)+8>>3],h=+o[m+(((0|(a=a+2|0))==(0|b)?0:a)<<4)+8>>3],l<f&&(o[x>>3]=l,f=l),A<p&&(o[t>>3]=A,p=A),l>d?o[_>>3]=l:l=d,A>c&&(o[w>>3]=A,c=A),v=A>0&A<v?A:v,g=A<0&A>g?A:g,s|=+u(+(A-h))>3.141592653589793,(0|(a=y+1|0))!=(0|b);)k=y,y=a,d=l,a=k;s&&(o[w>>3]=g,o[t>>3]=v)}}else i[_>>2]=0,i[_+4>>2]=0,i[_+8>>2]=0,i[_+12>>2]=0,i[_+16>>2]=0,i[_+20>>2]=0,i[_+24>>2]=0,i[_+28>>2]=0,r=0|i[B>>2]}while((0|C)<(0|r))}}function oe(t,e,n){var r=0,o=0,a=0;if(!(0|ne(t|=0,e|=0,n|=0)))return 0|(o=0);if((0|i[(o=t+8|0)>>2])<=0)return 0|(o=1);for(r=t+12|0,t=0;;){if(a=t,t=t+1|0,0|ne((0|i[r>>2])+(a<<3)|0,e+(t<<5)|0,n)){t=0,r=6;break}if((0|t)>=(0|i[o>>2])){t=1,r=6;break}}return 6==(0|r)?0|t:0}function ae(t,e,n,r,i){e|=0,n|=0,r|=0,i|=0;var a,s,u,l,c,h,f,p=0;l=+o[(t|=0)>>3],u=+o[e>>3]-l,s=+o[t+8>>3],a=+o[e+8>>3]-s,h=+o[n>>3],p=((p=+o[r>>3]-h)*(s-(f=+o[n+8>>3]))-(l-h)*(c=+o[r+8>>3]-f))/(u*c-a*p),o[i>>3]=l+u*p,o[i+8>>3]=s+a*p}function se(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 ue(t,e){e|=0;var n,r,i;return+((i=+o[(t|=0)>>3]-+o[e>>3])*i+(r=+o[t+8>>3]-+o[e+8>>3])*r+(n=+o[t+16>>3]-+o[e+16>>3])*n)}function le(t,e,n){t|=0,n|=0;var r=0;(0|(e|=0))>0?(r=0|ye(e,4),i[t>>2]=r,r||C(23230,23253,40,23267)):i[t>>2]=0,i[t+4>>2]=e,i[t+8>>2]=0,i[t+12>>2]=n}function ce(t){var e,n,r,a=0,s=0,l=0,h=0;e=(t|=0)+4|0,n=t+12|0,r=t+8|0;t:for(;;){for(s=0|i[e>>2],a=0;;){if((0|a)>=(0|s))break t;if(l=0|i[t>>2],h=0|i[l+(a<<2)>>2])break;a=a+1|0}a=l+(~~(+u(+ +c(10,+ +(15-(0|i[n>>2])|0))*(+o[h>>3]+ +o[h+8>>3]))%+(0|s))>>>0<<2)|0,s=0|i[a>>2];e:do{if(0|s){if(l=h+32|0,(0|s)==(0|h))i[a>>2]=i[l>>2];else{if(!(a=0|i[(s=s+32|0)>>2]))break;for(;(0|a)!=(0|h);)if(!(a=0|i[(s=a+32|0)>>2]))break e;i[s>>2]=i[l>>2]}me(h),i[r>>2]=(0|i[r>>2])-1}}while(0)}me(0|i[t>>2])}function he(t){var e,n=0,r=0;for(e=0|i[(t|=0)+4>>2],r=0;;){if((0|r)>=(0|e)){n=0,r=4;break}if(n=0|i[(0|i[t>>2])+(r<<2)>>2]){r=4;break}r=r+1|0}return 4==(0|r)?0|n:0}function fe(t,e){e|=0;var n=0,r=0,a=0,s=0;if(n=~~(+u(+ +c(10,+ +(15-(0|i[(t|=0)+12>>2])|0))*(+o[e>>3]+ +o[e+8>>3]))%+(0|i[t+4>>2]))>>>0,n=(0|i[t>>2])+(n<<2)|0,!(r=0|i[n>>2]))return 0|(s=1);s=e+32|0;do{if((0|r)!=(0|e)){if(!(n=0|i[r+32>>2]))return 0|(s=1);for(a=n;;){if((0|a)==(0|e)){a=8;break}if(!(n=0|i[a+32>>2])){n=1,a=10;break}r=a,a=n}if(8==(0|a)){i[r+32>>2]=i[s>>2];break}if(10==(0|a))return 0|n}else i[n>>2]=i[s>>2]}while(0);return me(e),i[(s=t+8|0)>>2]=(0|i[s>>2])-1,0|(s=0)}function pe(t,e,n){t|=0,e|=0,n|=0;var r,a=0,s=0,l=0;(r=0|ge(40))||C(23283,23253,98,23296),i[r>>2]=i[e>>2],i[r+4>>2]=i[e+4>>2],i[r+8>>2]=i[e+8>>2],i[r+12>>2]=i[e+12>>2],i[(s=r+16|0)>>2]=i[n>>2],i[s+4>>2]=i[n+4>>2],i[s+8>>2]=i[n+8>>2],i[s+12>>2]=i[n+12>>2],i[r+32>>2]=0,s=~~(+u(+ +c(10,+ +(15-(0|i[t+12>>2])|0))*(+o[e>>3]+ +o[e+8>>3]))%+(0|i[t+4>>2]))>>>0,s=(0|i[t>>2])+(s<<2)|0,a=0|i[s>>2];do{if(a){for(;!(0|Et(a,e)&&0|Et(a+16|0,n));)if(s=0|i[a+32>>2],!(0|i[(a=0==(0|s)?a:s)+32>>2])){l=10;break}if(10==(0|l)){i[a+32>>2]=r;break}return me(r),0|(l=a)}i[s>>2]=r}while(0);return i[(l=t+8|0)>>2]=1+(0|i[l>>2]),0|(l=r)}function de(t,e,n){e|=0,n|=0;var r=0,a=0;if(a=~~(+u(+ +c(10,+ +(15-(0|i[(t|=0)+12>>2])|0))*(+o[e>>3]+ +o[e+8>>3]))%+(0|i[t+4>>2]))>>>0,!(a=0|i[(0|i[t>>2])+(a<<2)>>2]))return 0|(n=0);if(!n){for(t=a;;){if(0|Et(t,e)){r=10;break}if(!(t=0|i[t+32>>2])){t=0,r=10;break}}if(10==(0|r))return 0|t}for(t=a;;){if(0|Et(t,e)&&0|Et(t+16|0,n)){r=10;break}if(!(t=0|i[t+32>>2])){t=0,r=10;break}}return 10==(0|r)?0|t:0}function Ae(t,e){e|=0;var n=0;if(n=~~(+u(+ +c(10,+ +(15-(0|i[(t|=0)+12>>2])|0))*(+o[e>>3]+ +o[e+8>>3]))%+(0|i[t+4>>2]))>>>0,!(t=0|i[(0|i[t>>2])+(n<<2)>>2]))return 0|(n=0);for(;;){if(0|Et(t,e)){e=5;break}if(!(t=0|i[t+32>>2])){t=0,e=5;break}}return 5==(0|e)?0|t:0}function ve(t){return 0|~~+function(t){return+ +Me(+(t=+t))}(t=+t)}function ge(t){t|=0;var e,n=0,r=0,o=0,a=0,s=0,u=0,l=0,c=0,h=0,f=0,p=0,d=0,A=0,v=0,g=0,m=0,y=0,_=0,b=0,x=0;e=M,M=M+16|0,d=e;do{if(t>>>0<245){if(t=(h=t>>>0<11?16:t+11&-8)>>>3,3&(r=(p=0|i[5829])>>>t)|0)return o=0|i[(r=(t=23356+((n=(1&r^1)+t|0)<<1<<2)|0)+8|0)>>2],(0|(s=0|i[(a=o+8|0)>>2]))==(0|t)?i[5829]=p&~(1<<n):(i[s+12>>2]=t,i[r>>2]=s),x=n<<3,i[o+4>>2]=3|x,i[(x=o+x+4|0)>>2]=1|i[x>>2],M=e,0|(x=a);if(h>>>0>(f=0|i[5831])>>>0){if(0|r)return n=((n=r<<t&((n=2<<t)|0-n))&0-n)-1|0,s=0|i[(t=(n=23356+((o=((r=(n>>>=l=n>>>12&16)>>>5&8)|l|(s=(n>>>=r)>>>2&4)|(t=(n>>>=s)>>>1&2)|(o=(n>>>=t)>>>1&1))+(n>>>o)|0)<<1<<2)|0)+8|0)>>2],(0|(r=0|i[(l=s+8|0)>>2]))==(0|n)?(t=p&~(1<<o),i[5829]=t):(i[r+12>>2]=n,i[t>>2]=r,t=p),u=(x=o<<3)-h|0,i[s+4>>2]=3|h,i[(a=s+h|0)+4>>2]=1|u,i[s+x>>2]=u,0|f&&(o=0|i[5834],r=23356+((n=f>>>3)<<1<<2)|0,t&(n=1<<n)?n=0|i[(t=r+8|0)>>2]:(i[5829]=t|n,n=r,t=r+8|0),i[t>>2]=o,i[n+12>>2]=o,i[o+8>>2]=n,i[o+12>>2]=r),i[5831]=u,i[5834]=a,M=e,0|(x=l);if(s=0|i[5830]){for(r=(s&0-s)-1|0,r=c=0|i[23620+(((o=(r>>>=a=r>>>12&16)>>>5&8)|a|(u=(r>>>=o)>>>2&4)|(l=(r>>>=u)>>>1&2)|(c=(r>>>=l)>>>1&1))+(r>>>c)<<2)>>2],l=c,c=(-8&i[c+4>>2])-h|0;(t=0|i[r+16>>2])||(t=0|i[r+20>>2]);)r=t,l=(a=(u=(-8&i[t+4>>2])-h|0)>>>0<c>>>0)?t:l,c=a?u:c;if((u=l+h|0)>>>0>l>>>0){a=0|i[l+24>>2],n=0|i[l+12>>2];do{if((0|n)==(0|l)){if(!(n=0|i[(t=l+20|0)>>2])&&!(n=0|i[(t=l+16|0)>>2])){r=0;break}for(;;)if(r=0|i[(o=n+20|0)>>2])n=r,t=o;else{if(!(r=0|i[(o=n+16|0)>>2]))break;n=r,t=o}i[t>>2]=0,r=n}else r=0|i[l+8>>2],i[r+12>>2]=n,i[n+8>>2]=r,r=n}while(0);do{if(0|a){if(n=0|i[l+28>>2],(0|l)==(0|i[(t=23620+(n<<2)|0)>>2])){if(i[t>>2]=r,!r){i[5830]=s&~(1<<n);break}}else if(i[((0|i[(x=a+16|0)>>2])==(0|l)?x:a+20|0)>>2]=r,!r)break;i[r+24>>2]=a,0|(n=0|i[l+16>>2])&&(i[r+16>>2]=n,i[n+24>>2]=r),0|(n=0|i[l+20>>2])&&(i[r+20>>2]=n,i[n+24>>2]=r)}}while(0);return c>>>0<16?(x=c+h|0,i[l+4>>2]=3|x,i[(x=l+x+4|0)>>2]=1|i[x>>2]):(i[l+4>>2]=3|h,i[u+4>>2]=1|c,i[u+c>>2]=c,0|f&&(o=0|i[5834],r=23356+((n=f>>>3)<<1<<2)|0,(n=1<<n)&p?n=0|i[(t=r+8|0)>>2]:(i[5829]=n|p,n=r,t=r+8|0),i[t>>2]=o,i[n+12>>2]=o,i[o+8>>2]=n,i[o+12>>2]=r),i[5831]=c,i[5834]=u),M=e,0|(x=l+8|0)}p=h}else p=h}else p=h}else if(t>>>0<=4294967231)if(h=-8&(t=t+11|0),o=0|i[5830]){a=0-h|0,c=(t>>>=8)?h>>>0>16777215?31:h>>>((c=14-((l=((g=t<<(p=(t+1048320|0)>>>16&8))+520192|0)>>>16&4)|p|(c=((g<<=l)+245760|0)>>>16&2))+(g<<c>>>15)|0)+7|0)&1|c<<1:0,r=0|i[23620+(c<<2)>>2];t:do{if(r)for(t=0,l=h<<(31==(0|c)?0:25-(c>>>1)|0),s=0;;){if((u=(-8&i[r+4>>2])-h|0)>>>0<a>>>0){if(!u){t=r,a=0,g=65;break t}t=r,a=u}if(s=0==(0|(g=0|i[r+20>>2]))|(0|g)==(0|(r=0|i[r+16+(l>>>31<<2)>>2]))?s:g,!r){r=s,g=61;break}l<<=1}else r=0,t=0,g=61}while(0);if(61==(0|g)){if(0==(0|r)&0==(0|t)){if(!(t=((t=2<<c)|0-t)&o)){p=h;break}p=(t&0-t)-1|0,t=0,r=0|i[23620+(((s=(p>>>=u=p>>>12&16)>>>5&8)|u|(l=(p>>>=s)>>>2&4)|(c=(p>>>=l)>>>1&2)|(r=(p>>>=c)>>>1&1))+(p>>>r)<<2)>>2]}r?g=65:(l=t,u=a)}if(65==(0|g))for(s=r;;){if(a=(r=(p=(-8&i[s+4>>2])-h|0)>>>0<a>>>0)?p:a,t=r?s:t,(r=0|i[s+16>>2])||(r=0|i[s+20>>2]),!r){l=t,u=a;break}s=r}if(0!=(0|l)&&u>>>0<((0|i[5831])-h|0)>>>0&&(f=l+h|0)>>>0>l>>>0){s=0|i[l+24>>2],n=0|i[l+12>>2];do{if((0|n)==(0|l)){if(!(n=0|i[(t=l+20|0)>>2])&&!(n=0|i[(t=l+16|0)>>2])){n=0;break}for(;;)if(r=0|i[(a=n+20|0)>>2])n=r,t=a;else{if(!(r=0|i[(a=n+16|0)>>2]))break;n=r,t=a}i[t>>2]=0}else x=0|i[l+8>>2],i[x+12>>2]=n,i[n+8>>2]=x}while(0);do{if(s){if(t=0|i[l+28>>2],(0|l)==(0|i[(r=23620+(t<<2)|0)>>2])){if(i[r>>2]=n,!n){o&=~(1<<t),i[5830]=o;break}}else if(i[((0|i[(x=s+16|0)>>2])==(0|l)?x:s+20|0)>>2]=n,!n)break;i[n+24>>2]=s,0|(t=0|i[l+16>>2])&&(i[n+16>>2]=t,i[t+24>>2]=n),(t=0|i[l+20>>2])&&(i[n+20>>2]=t,i[t+24>>2]=n)}}while(0);t:do{if(u>>>0<16)x=u+h|0,i[l+4>>2]=3|x,i[(x=l+x+4|0)>>2]=1|i[x>>2];else{if(i[l+4>>2]=3|h,i[f+4>>2]=1|u,i[f+u>>2]=u,n=u>>>3,u>>>0<256){r=23356+(n<<1<<2)|0,(t=0|i[5829])&(n=1<<n)?n=0|i[(t=r+8|0)>>2]:(i[5829]=t|n,n=r,t=r+8|0),i[t>>2]=f,i[n+12>>2]=f,i[f+8>>2]=n,i[f+12>>2]=r;break}if(n=23620+((r=(n=u>>>8)?u>>>0>16777215?31:u>>>((r=14-((_=((x=n<<(b=(n+1048320|0)>>>16&8))+520192|0)>>>16&4)|b|(r=((x<<=_)+245760|0)>>>16&2))+(x<<r>>>15)|0)+7|0)&1|r<<1:0)<<2)|0,i[f+28>>2]=r,i[(t=f+16|0)+4>>2]=0,i[t>>2]=0,!(o&(t=1<<r))){i[5830]=o|t,i[n>>2]=f,i[f+24>>2]=n,i[f+12>>2]=f,i[f+8>>2]=f;break}n=0|i[n>>2];e:do{if((-8&i[n+4>>2]|0)!=(0|u)){for(o=u<<(31==(0|r)?0:25-(r>>>1)|0);t=0|i[(r=n+16+(o>>>31<<2)|0)>>2];){if((-8&i[t+4>>2]|0)==(0|u)){n=t;break e}o<<=1,n=t}i[r>>2]=f,i[f+24>>2]=n,i[f+12>>2]=f,i[f+8>>2]=f;break t}}while(0);x=0|i[(b=n+8|0)>>2],i[x+12>>2]=f,i[b>>2]=f,i[f+8>>2]=x,i[f+12>>2]=n,i[f+24>>2]=0}}while(0);return M=e,0|(x=l+8|0)}p=h}else p=h;else p=-1}while(0);if((r=0|i[5831])>>>0>=p>>>0)return n=r-p|0,t=0|i[5834],n>>>0>15?(x=t+p|0,i[5834]=x,i[5831]=n,i[x+4>>2]=1|n,i[t+r>>2]=n,i[t+4>>2]=3|p):(i[5831]=0,i[5834]=0,i[t+4>>2]=3|r,i[(x=t+r+4|0)>>2]=1|i[x>>2]),M=e,0|(x=t+8|0);if((u=0|i[5832])>>>0>p>>>0)return _=u-p|0,i[5832]=_,b=(x=0|i[5835])+p|0,i[5835]=b,i[b+4>>2]=1|_,i[x+4>>2]=3|p,M=e,0|(x=x+8|0);if(0|i[5947]?t=0|i[5949]:(i[5949]=4096,i[5948]=4096,i[5950]=-1,i[5951]=-1,i[5952]=0,i[5940]=0,i[5947]=-16&d^1431655768,t=4096),l=p+48|0,(h=(s=t+(c=p+47|0)|0)&(a=0-t|0))>>>0<=p>>>0)return M=e,0|(x=0);if(0|(t=0|i[5939])&&(d=(f=0|i[5937])+h|0)>>>0<=f>>>0|d>>>0>t>>>0)return M=e,0|(x=0);t:do{if(4&i[5940])n=0,g=143;else{r=0|i[5835];e:do{if(r){for(o=23764;!((d=0|i[o>>2])>>>0<=r>>>0&&(d+(0|i[o+4>>2])|0)>>>0>r>>>0);){if(!(t=0|i[o+8>>2])){g=128;break e}o=t}if((n=s-u&a)>>>0<2147483647)if((0|(t=0|Ie(0|n)))==((0|i[o>>2])+(0|i[o+4>>2])|0)){if(-1!=(0|t)){u=n,s=t,g=145;break t}}else o=t,g=136;else n=0}else g=128}while(0);do{if(128==(0|g))if(-1!=(0|(r=0|Ie(0)))&&(n=r,v=(n=(0==((v=(A=0|i[5948])+-1|0)&n|0)?0:(v+n&0-A)-n|0)+h|0)+(A=0|i[5937])|0,n>>>0>p>>>0&n>>>0<2147483647)){if(0|(d=0|i[5939])&&v>>>0<=A>>>0|v>>>0>d>>>0){n=0;break}if((0|(t=0|Ie(0|n)))==(0|r)){u=n,s=r,g=145;break t}o=t,g=136}else n=0}while(0);do{if(136==(0|g)){if(r=0-n|0,!(l>>>0>n>>>0&n>>>0<2147483647&-1!=(0|o))){if(-1==(0|o)){n=0;break}u=n,s=o,g=145;break t}if((t=c-n+(t=0|i[5949])&0-t)>>>0>=2147483647){u=n,s=o,g=145;break t}if(-1==(0|Ie(0|t))){Ie(0|r),n=0;break}u=t+n|0,s=o,g=145;break t}}while(0);i[5940]=4|i[5940],g=143}}while(0);if(143==(0|g)&&h>>>0<2147483647&&!(-1==(0|(_=0|Ie(0|h)))|1^(y=(m=(v=0|Ie(0))-_|0)>>>0>(p+40|0)>>>0)|_>>>0<v>>>0&-1!=(0|_)&-1!=(0|v)^1)&&(u=y?m:n,s=_,g=145),145==(0|g)){n=(0|i[5937])+u|0,i[5937]=n,n>>>0>(0|i[5938])>>>0&&(i[5938]=n),c=0|i[5835];t:do{if(c){for(n=23764;;){if((0|s)==((t=0|i[n>>2])+(r=0|i[n+4>>2])|0)){g=154;break}if(!(o=0|i[n+8>>2]))break;n=o}if(154==(0|g)&&(b=n+4|0,0==(8&i[n+12>>2]|0))&&s>>>0>c>>>0&t>>>0<=c>>>0){i[b>>2]=r+u,b=c+(_=0==(7&(_=c+8|0)|0)?0:0-_&7)|0,_=(x=(0|i[5832])+u|0)-_|0,i[5835]=b,i[5832]=_,i[b+4>>2]=1|_,i[c+x+4>>2]=40,i[5836]=i[5951];break}for(s>>>0<(0|i[5833])>>>0&&(i[5833]=s),r=s+u|0,n=23764;;){if((0|i[n>>2])==(0|r)){g=162;break}if(!(t=0|i[n+8>>2]))break;n=t}if(162==(0|g)&&0==(8&i[n+12>>2]|0)){i[n>>2]=s,i[(f=n+4|0)>>2]=(0|i[f>>2])+u,h=(f=s+(0==(7&(f=s+8|0)|0)?0:0-f&7)|0)+p|0,l=(n=r+(0==(7&(n=r+8|0)|0)?0:0-n&7)|0)-f-p|0,i[f+4>>2]=3|p;e:do{if((0|c)==(0|n))x=(0|i[5832])+l|0,i[5832]=x,i[5835]=h,i[h+4>>2]=1|x;else{if((0|i[5834])==(0|n)){x=(0|i[5831])+l|0,i[5831]=x,i[5834]=h,i[h+4>>2]=1|x,i[h+x>>2]=x;break}if(1==(3&(t=0|i[n+4>>2])|0)){u=-8&t,o=t>>>3;n:do{if(t>>>0<256){if(t=0|i[n+8>>2],(0|(r=0|i[n+12>>2]))==(0|t)){i[5829]=i[5829]&~(1<<o);break}i[t+12>>2]=r,i[r+8>>2]=t;break}s=0|i[n+24>>2],t=0|i[n+12>>2];do{if((0|t)==(0|n)){if(t=0|i[(o=(r=n+16|0)+4|0)>>2])r=o;else if(!(t=0|i[r>>2])){t=0;break}for(;;)if(o=0|i[(a=t+20|0)>>2])t=o,r=a;else{if(!(o=0|i[(a=t+16|0)>>2]))break;t=o,r=a}i[r>>2]=0}else x=0|i[n+8>>2],i[x+12>>2]=t,i[t+8>>2]=x}while(0);if(!s)break;o=23620+((r=0|i[n+28>>2])<<2)|0;do{if((0|i[o>>2])==(0|n)){if(i[o>>2]=t,0|t)break;i[5830]=i[5830]&~(1<<r);break n}if(i[((0|i[(x=s+16|0)>>2])==(0|n)?x:s+20|0)>>2]=t,!t)break n}while(0);if(i[t+24>>2]=s,0|(o=0|i[(r=n+16|0)>>2])&&(i[t+16>>2]=o,i[o+24>>2]=t),!(r=0|i[r+4>>2]))break;i[t+20>>2]=r,i[r+24>>2]=t}while(0);n=n+u|0,a=u+l|0}else a=l;if(i[(n=n+4|0)>>2]=-2&i[n>>2],i[h+4>>2]=1|a,i[h+a>>2]=a,n=a>>>3,a>>>0<256){r=23356+(n<<1<<2)|0,(t=0|i[5829])&(n=1<<n)?n=0|i[(t=r+8|0)>>2]:(i[5829]=t|n,n=r,t=r+8|0),i[t>>2]=h,i[n+12>>2]=h,i[h+8>>2]=n,i[h+12>>2]=r;break}n=a>>>8;do{if(n){if(a>>>0>16777215){o=31;break}o=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}else o=0}while(0);if(n=23620+(o<<2)|0,i[h+28>>2]=o,i[(t=h+16|0)+4>>2]=0,i[t>>2]=0,!((t=0|i[5830])&(r=1<<o))){i[5830]=t|r,i[n>>2]=h,i[h+24>>2]=n,i[h+12>>2]=h,i[h+8>>2]=h;break}n=0|i[n>>2];n:do{if((-8&i[n+4>>2]|0)!=(0|a)){for(o=a<<(31==(0|o)?0:25-(o>>>1)|0);t=0|i[(r=n+16+(o>>>31<<2)|0)>>2];){if((-8&i[t+4>>2]|0)==(0|a)){n=t;break n}o<<=1,n=t}i[r>>2]=h,i[h+24>>2]=n,i[h+12>>2]=h,i[h+8>>2]=h;break e}}while(0);x=0|i[(b=n+8|0)>>2],i[x+12>>2]=h,i[b>>2]=h,i[h+8>>2]=x,i[h+12>>2]=n,i[h+24>>2]=0}}while(0);return M=e,0|(x=f+8|0)}for(n=23764;!((t=0|i[n>>2])>>>0<=c>>>0&&(x=t+(0|i[n+4>>2])|0)>>>0>c>>>0);)n=0|i[n+8>>2];n=(t=(t=(a=x+-47|0)+(0==(7&(t=a+8|0)|0)?0:0-t&7)|0)>>>0<(a=c+16|0)>>>0?c:t)+8|0,b=s+(_=0==(7&(_=s+8|0)|0)?0:0-_&7)|0,_=(r=u+-40|0)-_|0,i[5835]=b,i[5832]=_,i[b+4>>2]=1|_,i[s+r+4>>2]=40,i[5836]=i[5951],i[(r=t+4|0)>>2]=27,i[n>>2]=i[5941],i[n+4>>2]=i[5942],i[n+8>>2]=i[5943],i[n+12>>2]=i[5944],i[5941]=s,i[5942]=u,i[5944]=0,i[5943]=n,n=t+24|0;do{b=n,i[(n=n+4|0)>>2]=7}while((b+8|0)>>>0<x>>>0);if((0|t)!=(0|c)){if(s=t-c|0,i[r>>2]=-2&i[r>>2],i[c+4>>2]=1|s,i[t>>2]=s,n=s>>>3,s>>>0<256){r=23356+(n<<1<<2)|0,(t=0|i[5829])&(n=1<<n)?n=0|i[(t=r+8|0)>>2]:(i[5829]=t|n,n=r,t=r+8|0),i[t>>2]=c,i[n+12>>2]=c,i[c+8>>2]=n,i[c+12>>2]=r;break}if(r=23620+((o=(n=s>>>8)?s>>>0>16777215?31: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:0)<<2)|0,i[c+28>>2]=o,i[c+20>>2]=0,i[a>>2]=0,!((n=0|i[5830])&(t=1<<o))){i[5830]=n|t,i[r>>2]=c,i[c+24>>2]=r,i[c+12>>2]=c,i[c+8>>2]=c;break}n=0|i[r>>2];e:do{if((-8&i[n+4>>2]|0)!=(0|s)){for(o=s<<(31==(0|o)?0:25-(o>>>1)|0);t=0|i[(r=n+16+(o>>>31<<2)|0)>>2];){if((-8&i[t+4>>2]|0)==(0|s)){n=t;break e}o<<=1,n=t}i[r>>2]=c,i[c+24>>2]=n,i[c+12>>2]=c,i[c+8>>2]=c;break t}}while(0);x=0|i[(b=n+8|0)>>2],i[x+12>>2]=c,i[b>>2]=c,i[c+8>>2]=x,i[c+12>>2]=n,i[c+24>>2]=0}}else 0==(0|(x=0|i[5833]))|s>>>0<x>>>0&&(i[5833]=s),i[5941]=s,i[5942]=u,i[5944]=0,i[5838]=i[5947],i[5837]=-1,i[5842]=23356,i[5841]=23356,i[5844]=23364,i[5843]=23364,i[5846]=23372,i[5845]=23372,i[5848]=23380,i[5847]=23380,i[5850]=23388,i[5849]=23388,i[5852]=23396,i[5851]=23396,i[5854]=23404,i[5853]=23404,i[5856]=23412,i[5855]=23412,i[5858]=23420,i[5857]=23420,i[5860]=23428,i[5859]=23428,i[5862]=23436,i[5861]=23436,i[5864]=23444,i[5863]=23444,i[5866]=23452,i[5865]=23452,i[5868]=23460,i[5867]=23460,i[5870]=23468,i[5869]=23468,i[5872]=23476,i[5871]=23476,i[5874]=23484,i[5873]=23484,i[5876]=23492,i[5875]=23492,i[5878]=23500,i[5877]=23500,i[5880]=23508,i[5879]=23508,i[5882]=23516,i[5881]=23516,i[5884]=23524,i[5883]=23524,i[5886]=23532,i[5885]=23532,i[5888]=23540,i[5887]=23540,i[5890]=23548,i[5889]=23548,i[5892]=23556,i[5891]=23556,i[5894]=23564,i[5893]=23564,i[5896]=23572,i[5895]=23572,i[5898]=23580,i[5897]=23580,i[5900]=23588,i[5899]=23588,i[5902]=23596,i[5901]=23596,i[5904]=23604,i[5903]=23604,b=s+(_=0==(7&(_=s+8|0)|0)?0:0-_&7)|0,_=(x=u+-40|0)-_|0,i[5835]=b,i[5832]=_,i[b+4>>2]=1|_,i[s+x+4>>2]=40,i[5836]=i[5951]}while(0);if((n=0|i[5832])>>>0>p>>>0)return _=n-p|0,i[5832]=_,b=(x=0|i[5835])+p|0,i[5835]=b,i[b+4>>2]=1|_,i[x+4>>2]=3|p,M=e,0|(x=x+8|0)}return i[(x=23312)>>2]=12,M=e,0|(x=0)}function me(t){var e=0,n=0,r=0,o=0,a=0,s=0,u=0,l=0;if(t|=0){n=t+-8|0,o=0|i[5833],l=n+(e=-8&(t=0|i[t+-4>>2]))|0;do{if(1&t)u=n,s=n;else{if(r=0|i[n>>2],!(3&t))return;if(a=r+e|0,(s=n+(0-r)|0)>>>0<o>>>0)return;if((0|i[5834])==(0|s)){if(3!=(3&(e=0|i[(t=l+4|0)>>2])|0)){u=s,e=a;break}return i[5831]=a,i[t>>2]=-2&e,i[s+4>>2]=1|a,void(i[s+a>>2]=a)}if(n=r>>>3,r>>>0<256){if(t=0|i[s+8>>2],(0|(e=0|i[s+12>>2]))==(0|t)){i[5829]=i[5829]&~(1<<n),u=s,e=a;break}i[t+12>>2]=e,i[e+8>>2]=t,u=s,e=a;break}o=0|i[s+24>>2],t=0|i[s+12>>2];do{if((0|t)==(0|s)){if(t=0|i[(n=(e=s+16|0)+4|0)>>2])e=n;else if(!(t=0|i[e>>2])){t=0;break}for(;;)if(n=0|i[(r=t+20|0)>>2])t=n,e=r;else{if(!(n=0|i[(r=t+16|0)>>2]))break;t=n,e=r}i[e>>2]=0}else u=0|i[s+8>>2],i[u+12>>2]=t,i[t+8>>2]=u}while(0);if(o){if(e=0|i[s+28>>2],(0|i[(n=23620+(e<<2)|0)>>2])==(0|s)){if(i[n>>2]=t,!t){i[5830]=i[5830]&~(1<<e),u=s,e=a;break}}else if(i[((0|i[(u=o+16|0)>>2])==(0|s)?u:o+20|0)>>2]=t,!t){u=s,e=a;break}i[t+24>>2]=o,0|(n=0|i[(e=s+16|0)>>2])&&(i[t+16>>2]=n,i[n+24>>2]=t),(e=0|i[e+4>>2])?(i[t+20>>2]=e,i[e+24>>2]=t,u=s,e=a):(u=s,e=a)}else u=s,e=a}}while(0);if(!(s>>>0>=l>>>0)&&1&(r=0|i[(t=l+4|0)>>2])){if(2&r)i[t>>2]=-2&r,i[u+4>>2]=1|e,i[s+e>>2]=e,o=e;else{if((0|i[5835])==(0|l)){if(l=(0|i[5832])+e|0,i[5832]=l,i[5835]=u,i[u+4>>2]=1|l,(0|u)!=(0|i[5834]))return;return i[5834]=0,void(i[5831]=0)}if((0|i[5834])==(0|l))return l=(0|i[5831])+e|0,i[5831]=l,i[5834]=s,i[u+4>>2]=1|l,void(i[s+l>>2]=l);o=(-8&r)+e|0,n=r>>>3;do{if(r>>>0<256){if(e=0|i[l+8>>2],(0|(t=0|i[l+12>>2]))==(0|e)){i[5829]=i[5829]&~(1<<n);break}i[e+12>>2]=t,i[t+8>>2]=e;break}a=0|i[l+24>>2],t=0|i[l+12>>2];do{if((0|t)==(0|l)){if(t=0|i[(n=(e=l+16|0)+4|0)>>2])e=n;else if(!(t=0|i[e>>2])){n=0;break}for(;;)if(n=0|i[(r=t+20|0)>>2])t=n,e=r;else{if(!(n=0|i[(r=t+16|0)>>2]))break;t=n,e=r}i[e>>2]=0,n=t}else n=0|i[l+8>>2],i[n+12>>2]=t,i[t+8>>2]=n,n=t}while(0);if(0|a){if(t=0|i[l+28>>2],(0|i[(e=23620+(t<<2)|0)>>2])==(0|l)){if(i[e>>2]=n,!n){i[5830]=i[5830]&~(1<<t);break}}else if(i[((0|i[(r=a+16|0)>>2])==(0|l)?r:a+20|0)>>2]=n,!n)break;i[n+24>>2]=a,0|(e=0|i[(t=l+16|0)>>2])&&(i[n+16>>2]=e,i[e+24>>2]=n),0|(t=0|i[t+4>>2])&&(i[n+20>>2]=t,i[t+24>>2]=n)}}while(0);if(i[u+4>>2]=1|o,i[s+o>>2]=o,(0|u)==(0|i[5834]))return void(i[5831]=o)}if(t=o>>>3,o>>>0<256)return n=23356+(t<<1<<2)|0,(e=0|i[5829])&(t=1<<t)?t=0|i[(e=n+8|0)>>2]:(i[5829]=e|t,t=n,e=n+8|0),i[e>>2]=u,i[t+12>>2]=u,i[u+8>>2]=t,void(i[u+12>>2]=n);t=23620+((r=(t=o>>>8)?o>>>0>16777215?31:o>>>((r=14-((a=((l=t<<(s=(t+1048320|0)>>>16&8))+520192|0)>>>16&4)|s|(r=((l<<=a)+245760|0)>>>16&2))+(l<<r>>>15)|0)+7|0)&1|r<<1:0)<<2)|0,i[u+28>>2]=r,i[u+20>>2]=0,i[u+16>>2]=0,e=0|i[5830],n=1<<r;t:do{if(e&n){t=0|i[t>>2];e:do{if((-8&i[t+4>>2]|0)!=(0|o)){for(r=o<<(31==(0|r)?0:25-(r>>>1)|0);e=0|i[(n=t+16+(r>>>31<<2)|0)>>2];){if((-8&i[e+4>>2]|0)==(0|o)){t=e;break e}r<<=1,t=e}i[n>>2]=u,i[u+24>>2]=t,i[u+12>>2]=u,i[u+8>>2]=u;break t}}while(0);l=0|i[(s=t+8|0)>>2],i[l+12>>2]=u,i[s>>2]=u,i[u+8>>2]=l,i[u+12>>2]=t,i[u+24>>2]=0}else i[5830]=e|n,i[t>>2]=u,i[u+24>>2]=t,i[u+12>>2]=u,i[u+8>>2]=u}while(0);if(l=(0|i[5837])-1|0,i[5837]=l,!(0|l)){for(t=23772;t=0|i[t>>2];)t=t+8|0;i[5837]=-1}}}}function ye(t,e){e|=0;var n=0;return(t|=0)?(n=0|y(e,t),(e|t)>>>0>65535&&(n=(0|(n>>>0)/(t>>>0))==(0|e)?n:-1)):n=0,(t=0|ge(n))&&3&i[t+-4>>2]?(Te(0|t,0,0|n),0|t):0|t}function _e(t,e,n,r){return 0|(x(0|(r=(e|=0)-(r|=0)-((n|=0)>>>0>(t|=0)>>>0|0)>>>0)),t-n>>>0|0)}function be(t){return 0|((t|=0)?31-(0|b(t^t-1))|0:32)}function xe(t,e,n,r,o){o|=0;var a=0,s=0,u=0,l=0,c=0,h=0,f=0,p=0,d=0,A=0;if(h=t|=0,s=n|=0,u=p=r|=0,!(c=l=e|=0))return a=0!=(0|o),u?a?(i[o>>2]=0|t,i[o+4>>2]=0&e,o=0,0|(x(0|(p=0)),o)):(o=0,0|(x(0|(p=0)),o)):(a&&(i[o>>2]=(h>>>0)%(s>>>0),i[o+4>>2]=0),o=(h>>>0)/(s>>>0)>>>0,0|(x(0|(p=0)),o));a=0==(0|u);do{if(s){if(!a){if((a=(0|b(0|u))-(0|b(0|c))|0)>>>0<=31){s=f=a+1|0,t=h>>>(f>>>0)&(e=a-31>>31)|c<<(u=31-a|0),e&=c>>>(f>>>0),a=0,u=h<<u;break}return o?(i[o>>2]=0|t,i[o+4>>2]=l|0&e,o=0,0|(x(0|(p=0)),o)):(o=0,0|(x(0|(p=0)),o))}if((a=s-1|0)&s|0){s=u=33+(0|b(0|s))-(0|b(0|c))|0,t=(f=32-u|0)-1>>31&c>>>((d=u-32|0)>>>0)|(c<<f|h>>>(u>>>0))&(e=d>>31),e&=c>>>(u>>>0),a=h<<(A=64-u|0)&(l=f>>31),u=(c<<A|h>>>(d>>>0))&l|h<<f&u-33>>31;break}return 0|o&&(i[o>>2]=a&h,i[o+4>>2]=0),1==(0|s)?(A=0|t,0|(x(0|(d=l|0&e)),A)):(d=c>>>((A=0|be(0|s))>>>0)|0,A=c<<32-A|h>>>(A>>>0)|0,0|(x(0|d),A))}if(a)return 0|o&&(i[o>>2]=(c>>>0)%(s>>>0),i[o+4>>2]=0),A=(c>>>0)/(s>>>0)>>>0,0|(x(0|(d=0)),A);if(!h)return 0|o&&(i[o>>2]=0,i[o+4>>2]=(c>>>0)%(u>>>0)),A=(c>>>0)/(u>>>0)>>>0,0|(x(0|(d=0)),A);if(!((a=u-1|0)&u))return 0|o&&(i[o>>2]=0|t,i[o+4>>2]=a&c|0&e),d=0,A=c>>>((0|be(0|u))>>>0),0|(x(0|d),A);if((a=(0|b(0|u))-(0|b(0|c))|0)>>>0<=30){s=e=a+1|0,t=c<<(u=31-a|0)|h>>>(e>>>0),e=c>>>(e>>>0),a=0,u=h<<u;break}return o?(i[o>>2]=0|t,i[o+4>>2]=l|0&e,A=0,0|(x(0|(d=0)),A)):(A=0,0|(x(0|(d=0)),A))}while(0);if(s){c=0|function(t,e,n,r){return 0|(x((e|=0)+(r|=0)+((n=(t|=0)+(n|=0)>>>0)>>>0<t>>>0|0)>>>0|0),0|n)}(0|(f=0|n),0|(h=p|0&r),-1,-1),n=0|w(),l=u,u=0;do{r=l,l=a>>>31|l<<1,a=u|a<<1,_e(0|c,0|n,0|(r=t<<1|r>>>31|0),0|(p=t>>>31|e<<1|0)),u=1&(d=(A=0|w())>>31|((0|A)<0?-1:0)<<1),t=0|_e(0|r,0|p,d&f|0,(((0|A)<0?-1:0)>>31|((0|A)<0?-1:0)<<1)&h|0),e=0|w(),s=s-1|0}while(0!=(0|s));c=l,l=0}else c=u,l=0,u=0;return s=0,0|o&&(i[o>>2]=t,i[o+4>>2]=e),A=-2&(a<<1|0)|u,0|(x(0|(d=(0|a)>>>31|(c|s)<<1|0&(s<<1|a>>>31)|l)),A)}function we(t,e,n,r){var o,a;return a=M,M=M+16|0,xe(t|=0,e|=0,n|=0,r|=0,o=0|a),M=a,0|(x(0|i[o+4>>2]),0|i[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|0),t<<n):(x(t<<n-32|0),0)}function ke(t,e){return e=+e,(t=+t)!=t?+e:e!=e?+t:+_(+t,+e)}function Ee(t){return(t=+t)>=0?+s(t+.5):+m(t-.5)}function Se(t,e,n){t|=0,e|=0;var o,a,s=0;if((0|(n|=0))>=8192)return E(0|t,0|e,0|n),0|t;if(a=0|t,o=t+n|0,(3&t)==(3&e)){for(;3&t;){if(!n)return 0|a;r[t>>0]=0|r[e>>0],t=t+1|0,e=e+1|0,n=n-1|0}for(s=(n=-4&o|0)-64|0;(0|t)<=(0|s);)i[t>>2]=i[e>>2],i[t+4>>2]=i[e+4>>2],i[t+8>>2]=i[e+8>>2],i[t+12>>2]=i[e+12>>2],i[t+16>>2]=i[e+16>>2],i[t+20>>2]=i[e+20>>2],i[t+24>>2]=i[e+24>>2],i[t+28>>2]=i[e+28>>2],i[t+32>>2]=i[e+32>>2],i[t+36>>2]=i[e+36>>2],i[t+40>>2]=i[e+40>>2],i[t+44>>2]=i[e+44>>2],i[t+48>>2]=i[e+48>>2],i[t+52>>2]=i[e+52>>2],i[t+56>>2]=i[e+56>>2],i[t+60>>2]=i[e+60>>2],t=t+64|0,e=e+64|0;for(;(0|t)<(0|n);)i[t>>2]=i[e>>2],t=t+4|0,e=e+4|0}else for(n=o-4|0;(0|t)<(0|n);)r[t>>0]=0|r[e>>0],r[t+1>>0]=0|r[e+1>>0],r[t+2>>0]=0|r[e+2>>0],r[t+3>>0]=0|r[e+3>>0],t=t+4|0,e=e+4|0;for(;(0|t)<(0|o);)r[t>>0]=0|r[e>>0],t=t+1|0,e=e+1|0;return 0|a}function Te(t,e,n){e|=0;var o,a=0,s=0,u=0;if(o=(t|=0)+(n|=0)|0,e&=255,(0|n)>=67){for(;3&t;)r[t>>0]=e,t=t+1|0;for(u=e|e<<8|e<<16|e<<24,s=(a=-4&o|0)-64|0;(0|t)<=(0|s);)i[t>>2]=u,i[t+4>>2]=u,i[t+8>>2]=u,i[t+12>>2]=u,i[t+16>>2]=u,i[t+20>>2]=u,i[t+24>>2]=u,i[t+28>>2]=u,i[t+32>>2]=u,i[t+36>>2]=u,i[t+40>>2]=u,i[t+44>>2]=u,i[t+48>>2]=u,i[t+52>>2]=u,i[t+56>>2]=u,i[t+60>>2]=u,t=t+64|0;for(;(0|t)<(0|a);)i[t>>2]=u,t=t+4|0}for(;(0|t)<(0|o);)r[t>>0]=e,t=t+1|0;return o-n|0}function Me(t){return(t=+t)>=0?+s(t+.5):+m(t-.5)}function Ie(t){t|=0;var e,n,r;return r=0|k(),(0|t)>0&(0|(e=(n=0|i[a>>2])+t|0))<(0|n)|(0|e)<0?(T(0|e),B(12),-1):(0|e)>(0|r)&&!(0|S(0|e))?(B(12),-1):(i[a>>2]=e,0|n)}return{___uremdi3:we,_bitshift64Lshr:Ce,_bitshift64Shl:Be,_calloc:ye,_cellAreaKm2:function(t,e){var n,r,o,a=0;if(o=M,M=M+192|0,r=o,Vt(t|=0,e|=0,n=o+168|0),Ht(t,e,r),(0|(e=0|i[r>>2]))>0){if(a=+Tt(r+8|0,r+8+((1!=(0|e)&1)<<4)|0,n)+0,1!=(0|e)){t=1;
2do{a+=+Tt(r+8+(t<<4)|0,r+8+(((0|(t=t+1|0))%(0|e)|0)<<4)|0,n)}while((0|t)<(0|e))}}else a=0;return M=o,6371.007180918475*a*6371.007180918475},_cellAreaM2:function(t,e){var n,r,o,a=0;if(o=M,M=M+192|0,r=o,Vt(t|=0,e|=0,n=o+168|0),Ht(t,e,r),(0|(e=0|i[r>>2]))>0){if(a=+Tt(r+8|0,r+8+((1!=(0|e)&1)<<4)|0,n)+0,1!=(0|e)){t=1;do{a+=+Tt(r+8+(t<<4)|0,r+8+(((0|(t=t+1|0))%(0|e)|0)<<4)|0,n)}while((0|t)<(0|e))}}else a=0;return M=o,6371.007180918475*a*6371.007180918475*1e3*1e3},_cellAreaRads2:function(t,e){var n,r,o,a=0;if(o=M,M=M+192|0,r=o,Vt(t|=0,e|=0,n=o+168|0),Ht(t,e,r),(0|(e=0|i[r>>2]))<=0)return M=o,+(a=0);if(a=+Tt(r+8|0,r+8+((1!=(0|e)&1)<<4)|0,n)+0,1==(0|e))return M=o,+a;t=1;do{a+=+Tt(r+8+(t<<4)|0,r+8+(((0|(t=t+1|0))%(0|e)|0)<<4)|0,n)}while((0|t)<(0|e));return M=o,+a},_compact:function(t,e,n){e|=0;var r,o=0,a=0,s=0,u=0,l=0,c=0,h=0,f=0,p=0,d=0,A=0,v=0,g=0,m=0,y=0,_=0,b=0,x=0,C=0,B=0,k=0;if(!(n|=0))return 0|(B=0);if(o=0|i[(a=t|=0)>>2],!0&0==(15728640&(a=0|i[a+4>>2])|0)){if((0|n)<=0)return 0|(B=0);if(i[(B=e)>>2]=o,i[B+4>>2]=a,1==(0|n))return 0|(B=0);o=1;do{C=0|i[(x=t+(o<<3)|0)+4>>2],i[(B=e+(o<<3)|0)>>2]=i[x>>2],i[B+4>>2]=C,o=o+1|0}while((0|o)!=(0|n));return 0|(o=0)}if(!(C=0|ge(x=n<<3)))return 0|(B=-3);if(Se(0|C,0|t,0|x),!(r=0|ye(n,8)))return me(C),0|(B=-3);o=n;t:for(;;){_=0|Ce(0|(f=0|i[(u=C)>>2]),0|(u=0|i[u+4>>2]),52),w(),b=(_&=15)+-1|0,y=(0|o)>0;e:do{if(y){if(m=((0|o)<0)<<31>>31,v=0|Be(0|b,0,52),g=0|w(),b>>>0>15)for(a=0,t=f,n=u;;){if(!(0==(0|t)&0==(0|n))){if(s=0|Ce(0|t,0|n,52),w(),l=(0|(s&=15))<(0|b),s=(0|s)==(0|b),n=0|we(0|(h=l?0:s?t:0),0|(t=l?0:s?n:0),0|o,0|m),w(),0==(0|(c=0|i[(l=s=r+(n<<3)|0)>>2]))&0==(0|(l=0|i[l+4>>2])))n=h;else for(v=0,A=n,d=l,n=h;;){if((0|v)>(0|o)){B=41;break t}if((0|c)==(0|n)&(-117440513&d|0)==(0|t)){h=0|Ce(0|c,0|d,56),w(),p=(h&=7)+1|0,g=0|Ce(0|c,0|d,45),w();n:do{if(0|O(127&g)){if(c=0|Ce(0|c,0|d,52),w(),!(c&=15)){l=6;break}for(l=1;;){if(!(0==((g=0|Be(7,0,3*(15-l|0)|0))&n|0)&0==((0|w())&t|0))){l=7;break n}if(!(l>>>0<c>>>0)){l=6;break}l=l+1|0}}else l=7}while(0);if((h+2|0)>>>0>l>>>0){B=51;break t}g=0|Be(0|p,0,56),t=0|w()|-117440513&t,i[(l=s)>>2]=0,i[l+4>>2]=0,l=A,n|=g}else l=(A+1|0)%(0|o)|0;if(0==(0|(c=0|i[(d=s=r+(l<<3)|0)>>2]))&0==(0|(d=0|i[d+4>>2])))break;v=v+1|0,A=l}i[(g=s)>>2]=n,i[g+4>>2]=t}if((0|(a=a+1|0))>=(0|o))break e;t=0|i[(n=C+(a<<3)|0)>>2],n=0|i[n+4>>2]}for(a=0,t=f,n=u;;){if(!(0==(0|t)&0==(0|n))){if(l=0|Ce(0|t,0|n,52),w(),(0|(l&=15))>=(0|b)){if((0|l)!=(0|b)&&(t|=v,n=-15728641&n|g,l>>>0>=_>>>0)){s=b;do{A=0|Be(7,0,3*(14-s|0)|0),s=s+1|0,t|=A,n=0|w()|n}while(s>>>0<l>>>0)}}else t=0,n=0;if(l=0|we(0|t,0|n,0|o,0|m),w(),!(0==(0|(h=0|i[(c=s=r+(l<<3)|0)>>2]))&0==(0|(c=0|i[c+4>>2]))))for(A=0;;){if((0|A)>(0|o)){B=41;break t}if((0|h)==(0|t)&(-117440513&c|0)==(0|n)){p=0|Ce(0|h,0|c,56),w(),d=(p&=7)+1|0,k=0|Ce(0|h,0|c,45),w();n:do{if(0|O(127&k)){if(h=0|Ce(0|h,0|c,52),w(),!(h&=15)){c=6;break}for(c=1;;){if(!(0==((k=0|Be(7,0,3*(15-c|0)|0))&t|0)&0==((0|w())&n|0))){c=7;break n}if(!(c>>>0<h>>>0)){c=6;break}c=c+1|0}}else c=7}while(0);if((p+2|0)>>>0>c>>>0){B=51;break t}k=0|Be(0|d,0,56),n=0|w()|-117440513&n,i[(d=s)>>2]=0,i[d+4>>2]=0,t|=k}else l=(l+1|0)%(0|o)|0;if(0==(0|(h=0|i[(c=s=r+(l<<3)|0)>>2]))&0==(0|(c=0|i[c+4>>2])))break;A=A+1|0}i[(k=s)>>2]=t,i[k+4>>2]=n}if((0|(a=a+1|0))>=(0|o))break e;t=0|i[(n=C+(a<<3)|0)>>2],n=0|i[n+4>>2]}}}while(0);if((o+5|0)>>>0<11){B=99;break}if(!(g=0|ye((0|o)/6|0,8))){B=58;break}e:do{if(y){A=0,d=0;do{if(!(0==(0|(a=0|i[(t=l=r+(A<<3)|0)>>2]))&0==(0|(t=0|i[t+4>>2])))){c=0|Ce(0|a,0|t,56),w(),n=(c&=7)+1|0,h=-117440513&t,k=0|Ce(0|a,0|t,45),w();n:do{if(0|O(127&k)){if(p=0|Ce(0|a,0|t,52),w(),0|(p&=15))for(s=1;;){if(!(0==(a&(k=0|Be(7,0,3*(15-s|0)|0))|0)&0==(h&(0|w())|0)))break n;if(!(s>>>0<p>>>0))break;s=s+1|0}a|=t=0|Be(0|n,0,56),t=0|w()|h,i[(n=l)>>2]=a,i[n+4>>2]=t,n=c+2|0}}while(0);7==(0|n)&&(i[(k=g+(d<<3)|0)>>2]=a,i[k+4>>2]=-117440513&t,d=d+1|0)}A=A+1|0}while((0|A)!=(0|o));if(y){if(v=((0|o)<0)<<31>>31,p=0|Be(0|b,0,52),A=0|w(),b>>>0>15)for(t=0,a=0;;){do{if(!(0==(0|f)&0==(0|u))){for(c=0|Ce(0|f,0|u,52),w(),s=(0|(c&=15))<(0|b),c=(0|c)==(0|b),s=0|we(0|(l=s?0:c?f:0),0|(c=s?0:c?u:0),0|o,0|v),w(),n=0;;){if((0|n)>(0|o)){B=98;break t}if((-117440513&(h=0|i[(k=r+(s<<3)|0)+4>>2])|0)==(0|c)&&(0|i[k>>2])==(0|l)){B=70;break}if((0|i[(k=r+((s=(s+1|0)%(0|o)|0)<<3)|0)>>2])==(0|l)&&(0|i[k+4>>2])==(0|c))break;n=n+1|0}if(70==(0|B)&&(B=0,!0&100663296==(117440512&h|0)))break;i[(k=e+(a<<3)|0)>>2]=f,i[k+4>>2]=u,a=a+1|0}}while(0);
2if((0|(t=t+1|0))>=(0|o)){o=d;break e}f=0|i[(u=C+(t<<3)|0)>>2],u=0|i[u+4>>2]}for(t=0,a=0;;){do{if(!(0==(0|f)&0==(0|u))){if(c=0|Ce(0|f,0|u,52),w(),(0|(c&=15))>=(0|b))if((0|c)!=(0|b))if(n=f|p,s=-15728641&u|A,c>>>0<_>>>0)c=s;else{l=b;do{k=0|Be(7,0,3*(14-l|0)|0),l=l+1|0,n|=k,s=0|w()|s}while(l>>>0<c>>>0);c=s}else n=f,c=u;else n=0,c=0;for(l=0|we(0|n,0|c,0|o,0|v),w(),s=0;;){if((0|s)>(0|o)){B=98;break t}if((-117440513&(h=0|i[(k=r+(l<<3)|0)+4>>2])|0)==(0|c)&&(0|i[k>>2])==(0|n)){B=93;break}if((0|i[(k=r+((l=(l+1|0)%(0|o)|0)<<3)|0)>>2])==(0|n)&&(0|i[k+4>>2])==(0|c))break;s=s+1|0}if(93==(0|B)&&(B=0,!0&100663296==(117440512&h|0)))break;i[(k=e+(a<<3)|0)>>2]=f,i[k+4>>2]=u,a=a+1|0}}while(0);if((0|(t=t+1|0))>=(0|o)){o=d;break e}f=0|i[(u=C+(t<<3)|0)>>2],u=0|i[u+4>>2]}}else a=0,o=d}else a=0,o=0}while(0);if(Te(0|r,0,0|x),Se(0|C,0|g,o<<3|0),me(g),!o)break;e=e+(a<<3)|0}return 41==(0|B)?(me(C),me(r),0|(k=-1)):51==(0|B)?(me(C),me(r),0|(k=-2)):58==(0|B)?(me(C),me(r),0|(k=-3)):98==(0|B)?(me(g),me(C),me(r),0|(k=-1)):(99==(0|B)&&Se(0|e,0|C,o<<3|0),me(C),me(r),0|(k=0))},_destroyLinkedPolygon:function(t){var e=0,n=0,r=0,o=0;if(t|=0)for(r=1;;){if(0|(e=0|i[t>>2]))do{if(0|(n=0|i[e>>2]))do{o=n,n=0|i[n+16>>2],me(o)}while(0!=(0|n));o=e,e=0|i[e+8>>2],me(o)}while(0!=(0|e));if(e=t,t=0|i[t+8>>2],r||me(e),!t)break;r=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 r=new Int8Array(t),new Uint8Array(t),i=new Int32Array(t),new Float32Array(t),o=new Float64Array(t),n=t,!0},_exactEdgeLengthKm:function(t,e){var n,r,a=0,s=0,u=0,c=0,p=0,d=0;if(r=M,M=M+176|0,Qt(t|=0,e|=0,n=r),(0|(t=0|i[n>>2]))<=1)return M=r,+(u=0);e=t+-1|0,t=0,a=0,s=+o[n+8>>3],u=+o[n+16>>3];do{p=s,s=+o[n+8+((t=t+1|0)<<4)>>3],d=+f(.5*(s-p)),c=u,u=+o[n+8+(t<<4)+8>>3],c=d*d+(c=+f(.5*(u-c)))*(+h(+p)*+h(+s)*c),a+=2*+g(+ +l(+c),+ +l(+(1-c)))}while((0|t)!=(0|e));return M=r,+(d=6371.007180918475*a)},_exactEdgeLengthM:function(t,e){var n,r,a=0,s=0,u=0,c=0,p=0,d=0;if(r=M,M=M+176|0,Qt(t|=0,e|=0,n=r),(0|(t=0|i[n>>2]))<=1)return M=r,+(u=0);e=t+-1|0,t=0,a=0,s=+o[n+8>>3],u=+o[n+16>>3];do{p=s,s=+o[n+8+((t=t+1|0)<<4)>>3],d=+f(.5*(s-p)),c=u,u=+o[n+8+(t<<4)+8>>3],c=d*d+(c=+f(.5*(u-c)))*(+h(+p)*+h(+s)*c),a+=2*+g(+ +l(+c),+ +l(+(1-c)))}while((0|t)!=(0|e));return M=r,+(d=6371.007180918475*a*1e3)},_exactEdgeLengthRads:function(t,e){var n,r,a=0,s=0,u=0,c=0,p=0,d=0;if(r=M,M=M+176|0,Qt(t|=0,e|=0,n=r),(0|(t=0|i[n>>2]))<=1)return M=r,+(u=0);e=t+-1|0,t=0,a=0,s=+o[n+8>>3],u=+o[n+16>>3];do{p=s,s=+o[n+8+((t=t+1|0)<<4)>>3],d=+f(.5*(s-p)),c=u,u=+o[n+8+(t<<4)+8>>3],c=d*d+(c=+f(.5*(u-c)))*(+h(+s)*+h(+p)*c),a+=2*+g(+ +l(+c),+ +l(+(1-c)))}while((0|t)<(0|e));return M=r,+a},_experimentalH3ToLocalIj:function(t,e,n,r,i){var o,a;return i|=0,a=M,M=M+16|0,(t=0|$t(t|=0,e|=0,n|=0,r|=0,o=a))||(pt(o,i),t=0),M=a,0|t},_experimentalLocalIjToH3:function(t,e,n,r){var i,o;return t|=0,e|=0,r|=0,i=M,M=M+16|0,dt(n|=0,o=i),r=0|te(t,e,o,r),M=i,0|r},_free:me,_geoToH3:Nt,_getDestinationH3IndexFromUnidirectionalEdge:function(t,e){t|=0;var n,r,o=0;return n=M,M=M+16|0,o=n,!0&268435456==(2013265920&(e|=0)|0)?(r=0|Ce(0|t,0|e,56),w(),i[o>>2]=0,o=0|D(t,-2130706433&e|134217728,7&r,o),e=0|w(),x(0|e),M=n,0|o):(o=0,x(0|(e=0)),M=n,0|o)},_getH3IndexesFromUnidirectionalEdge:function(t,e,n){t|=0;var r,o,a,s,u=0;a=M,M=M+16|0,r=a,s=!0&268435456==(2013265920&(e|=0)|0),o=-2130706433&e|134217728,i[(u=n|=0)>>2]=s?t:0,i[u+4>>2]=s?o:0,s?(e=0|Ce(0|t,0|e,56),w(),i[r>>2]=0,t=0|D(t,o,7&e,r),e=0|w()):(t=0,e=0),i[(u=n+8|0)>>2]=t,i[u+4>>2]=e,M=a},_getH3UnidirectionalEdge:function(t,e,n,r){var o,a,s=0,u=0,l=0,c=0,h=0;if(a=M,M=M+16|0,o=a,!(0|Wt(t|=0,e|=0,n|=0,r|=0)))return c=0,x(0|(l=0)),M=a,0|c;for(l=-2130706433&e,s=(s=0==(0|Dt(t,e)))?1:2;i[o>>2]=0,u=s+1|0,!((0|(h=0|D(t,e,s,o)))==(0|n)&(0|w())==(0|r));){if(!(u>>>0<7)){s=0,t=0,c=6;break}s=u}return 6==(0|c)?(x(0|s),M=a,0|t):(h=0|Be(0|s,0,56),c=0|l|w()|268435456,h|=t,x(0|c),M=a,0|h)},_getH3UnidirectionalEdgeBoundary:Qt,_getH3UnidirectionalEdgesFromHexagon:function(t,e,n){n|=0;var r,o=0;r=0==(0|Dt(t|=0,e|=0)),e&=-2130706433,i[(o=n)>>2]=r?t:0,i[o+4>>2]=r?285212672|e:0,i[(o=n+8|0)>>2]=t,i[o+4>>2]=301989888|e,i[(o=n+16|0)>>2]=t,i[o+4>>2]=318767104|e,i[(o=n+24|0)>>2]=t,i[o+4>>2]=335544320|e,i[(o=n+32|0)>>2]=t,i[o+4>>2]=352321536|e,i[(n=n+40|0)>>2]=t,i[n+4>>2]=369098752|e},_getOriginH3IndexFromUnidirectionalEdge:function(t,e){var n;return t|=0,x(0|((n=!0&268435456==(2013265920&(e|=0)|0))?-2130706433&e|134217728:0)),0|(n?t:0)},_getPentagonIndexes:Jt,_getRes0Indexes:function(t){t|=0;var e=0,n=0,r=0;e=0;do{Be(0|e,0,45),r=134225919|w(),i[(n=t+(e<<3)|0)>>2]=-1,i[n+4>>2]=r,e=e+1|0}while(122!=(0|e))},_h3Distance:function(t,e,n,r){var i,o,a;return n|=0,r|=0,a=M,M=M+32|0,o=a,t=0==(0|$t(t|=0,e|=0,t,e,i=a+12|0))&&0==(0|$t(t,e,n,r,o))?0|ft(i,o):-1,M=a,0|t},_h3GetBaseCell:Mt,_h3GetFaces:function t(e,n,r){r|=0;var o,a=0,s=0,u=0,l=0,c=0,h=0,f=0,p=0;o=M,M=M+128|0,f=o+112|0,u=o+96|0,p=o,s=0|Ce(0|(e|=0),0|(n|=0),52),w(),c=15&s,i[f>>2]=c,l=0|Ce(0|e,0|n,45),w(),l&=127;t:do{if(0|O(l)){if(0|c)for(a=1;;){if(!(0==((h=0|Be(7,0,3*(15-a|0)|0))&e|0)&0==((0|w())&n|0))){s=0;break t}if(!(a>>>0<c>>>0))break;a=a+1|0}if(!(1&s))return h=0|Be(c+1|0,0,52),p=0|w()|-15728641&n,t((h|e)&~(f=0|Be(7,0,3*(14-c|0)|0)),p&~(0|w()),r),void(M=o);s=1}else s=0}while(0);jt(e,n,u),s?(bt(u,f,p),h=5):(Bt(u,f,p),h=6);t:do{if(0|O(l))if(c)for(a=1;;){if(!(0==((l=0|Be(7,0,3*(15-a|0)|0))&e|0)&0==((0|w())&n|0))){a=8;break t}if(!(a>>>0<c>>>0)){a=20;break}a=a+1|0}else a=20;else a=8}while(0);if(Te(0|r,-1,0|a),s){s=0;do{for(wt(u=p+(s<<4)|0,0|i[f>>2]),u=0|i[u>>2],a=0;!(-1==(0|(c=0|i[(l=r+(a<<2)|0)>>2]))|(0|c)==(0|u));)a=a+1|0;i[l>>2]=u,s=s+1|0}while((0|s)!=(0|h))}else{s=0;do{for(xt(u=p+(s<<4)|0,0|i[f>>2],0,1),u=0|i[u>>2],a=0;!(-1==(0|(c=0|i[(l=r+(a<<2)|0)>>2]))|(0|c)==(0|u));)a=a+1|0;i[l>>2]=u,s=s+1|0}while((0|s)!=(0|h))}M=o},_h3GetResolution:function(t,e){return e=0|Ce(0|(t|=0),0|(e|=0),52),w(),15&e|0}
2,_h3IndexesAreNeighbors:Wt,_h3IsPentagon:Dt,_h3IsResClassIII:function(t,e){return e=0|Ce(0|(t|=0),0|(e|=0),52),w(),1&e|0},_h3IsValid:It,_h3Line:function(t,e,n,r,o){n|=0,r|=0,o|=0;var a,s=0,l=0,c=0,h=0,f=0,p=0,d=0,A=0,v=0,g=0,m=0,y=0,_=0,b=0,x=0,w=0,C=0;if(a=M,M=M+48|0,l=a+12|0,w=a,0==(0|$t(t|=0,e|=0,t,e,s=a+24|0))&&0==(0|$t(t,e,n,r,l))){if((0|(x=0|ft(s,l)))<0)return M=a,0|(w=x);for(i[s>>2]=0,i[s+4>>2]=0,i[s+8>>2]=0,i[l>>2]=0,i[l+4>>2]=0,i[l+8>>2]=0,$t(t,e,t,e,s),$t(t,e,n,r,l),At(s),At(l),x?(v=+(0|x),b=s,n=p=0|i[s>>2],r=d=0|i[(y=s+4|0)>>2],s=A=0|i[(_=s+8|0)>>2],g=+((0|i[l>>2])-p|0)/v,m=+((0|i[l+4>>2])-d|0)/v,v=+((0|i[l+8>>2])-A|0)/v):(y=r=s+4|0,_=A=s+8|0,b=s,n=0|i[s>>2],r=0|i[r>>2],s=0|i[A>>2],g=0,m=0,v=0),i[w>>2]=n,i[(A=w+4|0)>>2]=r,i[(d=w+8|0)>>2]=s,p=0;;){C=g*(h=+(0|p))+ +(0|n),c=m*h+ +(0|i[y>>2]),h=v*h+ +(0|i[_>>2]),r=~~+Ee(+C),l=~~+Ee(+c),n=~~+Ee(+h),C=+u(+(+(0|r)-C)),c=+u(+(+(0|l)-c)),h=+u(+(+(0|n)-h));do{if(!(C>c&C>h)){if(f=0-r|0,c>h){s=f-n|0;break}s=l,n=f-l|0;break}r=0-(l+n)|0,s=l}while(0);if(i[w>>2]=r,i[A>>2]=s,i[d>>2]=n,vt(w),te(t,e,w,o+(p<<3)|0),(0|p)==(0|x))break;p=p+1|0,n=0|i[b>>2]}return M=a,0|(w=0)}return M=a,0|(w=-1)},_h3LineSize:function(t,e,n,r){var i,o,a;return n|=0,r|=0,a=M,M=M+32|0,o=a,t=0==(0|$t(t|=0,e|=0,t,e,i=a+12|0))&&0==(0|$t(t,e,n,r,o))?0|ft(i,o):-1,M=a,(t>>>31^1)+t|0},_h3SetToLinkedGeo:function(t,e,n){n|=0;var r,o,a,s=0;if(a=M,M=M+32|0,r=a,function(t,e,n){t|=0,n|=0;var r,o,a=0,s=0,u=0,l=0,c=0;if(o=M,M=M+176|0,r=o,(0|(e|=0))<1)return le(n,0,0),void(M=o);l=0|Ce(0|i[(l=t)>>2],0|i[l+4>>2],52),w(),le(n,(0|e)>6?e:6,15&l),l=0;do{if(Ht(0|i[(a=t+(l<<3)|0)>>2],0|i[a+4>>2],r),(0|(a=0|i[r>>2]))>0){c=0;do{u=r+8+(c<<4)|0,(s=0|de(n,a=r+8+(((0|(c=c+1|0))%(0|a)|0)<<4)|0,u))?fe(n,s):pe(n,u,a),a=0|i[r>>2]}while((0|c)<(0|a))}l=l+1|0}while((0|l)!=(0|e));M=o}(t|=0,e|=0,o=a+16|0),i[n>>2]=0,i[n+4>>2]=0,i[n+8>>2]=0,!(t=0|he(o)))return Xt(n),ce(o),void(M=a);do{e=0|qt(n);do{Kt(e,t),s=t+16|0,i[r>>2]=i[s>>2],i[r+4>>2]=i[s+4>>2],i[r+8>>2]=i[s+8>>2],i[r+12>>2]=i[s+12>>2],fe(o,t),t=0|Ae(o,r)}while(0!=(0|t));t=0|he(o)}while(0!=(0|t));Xt(n),ce(o),M=a},_h3ToCenterChild:function(t,e,n){n|=0;var r=0,i=0;if(r=0|Ce(0|(t|=0),0|(e|=0),52),w(),(0|n)<16&(0|(r&=15))<=(0|n)){if((0|r)!=(0|n)&&(t|=i=0|Be(0|n,0,52),e=0|w()|-15728641&e,(0|r)<(0|n)))do{i=0|Be(7,0,3*(14-r|0)|0),r=r+1|0,t&=~i,e&=~(0|w())}while((0|r)<(0|n))}else e=0,t=0;return x(0|e),0|t},_h3ToChildren:Zt,_h3ToGeo:Vt,_h3ToGeoBoundary:Ht,_h3ToParent:Pt,_h3UnidirectionalEdgeIsValid:function(t,e){var n=0;if(!(!0&268435456==(2013265920&(e|=0)|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!=(0|Dt(t,n=-2130706433&e|134217728))?0|(n=0):0|(n=0|It(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,r){t|=0,e|=0,r|=0;var o,a=0,s=0,u=0,l=0,c=0,h=0,f=0;if(o=M,M=M+16|0,f=o,!(n|=0))return i[(f=r)>>2]=t,i[f+4>>2]=e,M=o,0|(f=0);i[f>>2]=0;t:do{if(0|Dt(t,e))t=1;else{if(s=(0|n)>0){a=0,h=t;do{if(0==(0|(h=0|D(h,e,4,f)))&0==(0|(e=0|w()))){t=2;break t}if(a=a+1|0,0|Dt(h,e)){t=1;break t}}while((0|a)<(0|n));if(i[(c=r)>>2]=h,i[c+4>>2]=e,c=n+-1|0,s){s=0,u=1,a=h,t=e;do{if(0==(0|(a=0|D(a,t,2,f)))&0==(0|(t=0|w()))){t=2;break t}if(i[(l=r+(u<<3)|0)>>2]=a,i[l+4>>2]=t,u=u+1|0,0|Dt(a,t)){t=1;break t}s=s+1|0}while((0|s)<(0|n));l=0,s=u;do{if(0==(0|(a=0|D(a,t,3,f)))&0==(0|(t=0|w()))){t=2;break t}if(i[(u=r+(s<<3)|0)>>2]=a,i[u+4>>2]=t,s=s+1|0,0|Dt(a,t)){t=1;break t}l=l+1|0}while((0|l)<(0|n));u=0;do{if(0==(0|(a=0|D(a,t,1,f)))&0==(0|(t=0|w()))){t=2;break t}if(i[(l=r+(s<<3)|0)>>2]=a,i[l+4>>2]=t,s=s+1|0,0|Dt(a,t)){t=1;break t}u=u+1|0}while((0|u)<(0|n));u=0;do{if(0==(0|(a=0|D(a,t,5,f)))&0==(0|(t=0|w()))){t=2;break t}if(i[(l=r+(s<<3)|0)>>2]=a,i[l+4>>2]=t,s=s+1|0,0|Dt(a,t)){t=1;break t}u=u+1|0}while((0|u)<(0|n));u=0;do{if(0==(0|(a=0|D(a,t,4,f)))&0==(0|(t=0|w()))){t=2;break t}if(i[(l=r+(s<<3)|0)>>2]=a,i[l+4>>2]=t,s=s+1|0,0|Dt(a,t)){t=1;break t}u=u+1|0}while((0|u)<(0|n));for(u=0;;){if(0==(0|(a=0|D(a,t,6,f)))&0==(0|(t=0|w()))){t=2;break t}if((0|u)!=(0|c)){if(i[(l=r+(s<<3)|0)>>2]=a,i[l+4>>2]=t,0|Dt(a,t)){t=1;break t}s=s+1|0}if((0|(u=u+1|0))>=(0|n)){u=h,s=e;break}}}else u=h,a=h,s=e,t=e}else i[(u=r)>>
22]=t,i[u+4>>2]=e,u=t,a=t,s=e,t=e;t=1&((0|u)!=(0|a)|(0|s)!=(0|t))}}while(0);return M=o,0|(f=t)},_i64Subtract:_e,_kRing:I,_kRingDistances:function(t,e,n,r,i){var o;if(0|P(t|=0,e|=0,n|=0,r|=0,i|=0)){if(Te(0|r,0,(o=1+(0|y(3*n|0,n+1|0))|0)<<3|0),0|i)return Te(0|i,0,o<<2|0),void Z(t,e,n,r,i,o,0);(i=0|ye(o,4))&&(Z(t,e,n,r,i,o,0),me(i))}},_llvm_minnum_f64:ke,_llvm_round_f64:Ee,_malloc:ge,_maxFaceCount:function(t,e){var n=0,r=0;if(r=0|Ce(0|(t|=0),0|(e|=0),45),w(),!(0|O(127&r)))return 0|(r=2);if(r=0|Ce(0|t,0|e,52),w(),!(r&=15))return 0|(r=5);for(n=1;;){if(!(0==((0|Be(7,0,3*(15-n|0)|0))&t|0)&0==((0|w())&e|0))){n=2,t=6;break}if(!(n>>>0<r>>>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|y(3*(t|=0)|0,t+1|0))|0},_maxPolyfillSize:function(t,e){e|=0;var n,r=0,o=0,a=0,s=0,u=0;if(n=M,M=M+48|0,a=n+8|0,o=n,s=0|i[(u=t|=0)+4>>2],i[(r=o)>>2]=i[u>>2],i[r+4>>2]=s,re(o,a),a=0|H(a,e),e=0|i[o>>2],(0|(o=0|i[t+8>>2]))<=0)return M=n,0|(u=(u=(s=(0|a)<(0|(u=e)))?u:a)+12|0);r=0|i[t+12>>2],t=0;do{e=(0|i[r+(t<<3)>>2])+e|0,t=t+1|0}while((0|t)<(0|o));return M=n,0|(u=(u=(u=(0|a)<(0|e))?e:a)+12|0)},_maxUncompactSize:function(t,e,n){t|=0,n|=0;var r=0,o=0,a=0,s=0;if((0|(e|=0))<=0)return 0|(n=0);if((0|n)>=16){for(r=0;;){if(!(0==(0|i[(s=t+(r<<3)|0)>>2])&0==(0|i[s+4>>2]))){r=-1,o=13;break}if((0|(r=r+1|0))>=(0|e)){r=0,o=13;break}}if(13==(0|o))return 0|r}r=0,s=0;t:for(;;){a=0|i[(o=t+(s<<3)|0)>>2],o=0|i[o+4>>2];do{if(!(0==(0|a)&0==(0|o))){if(o=0|Ce(0|a,0|o,52),w(),(0|(o&=15))>(0|n)){r=-1,o=13;break t}if((0|o)==(0|n)){r=r+1|0;break}r=(0|ee(7,n-o|0))+r|0;break}}while(0);if((0|(s=s+1|0))>=(0|e)){o=13;break}}return 13==(0|o)?0|r:0},_memcpy:Se,_memset:Te,_numHexagons:function(t){var e;return t=0|i[(e=21008+((t|=0)<<3)|0)>>2],x(0|i[e+4>>2]),0|t},_pentagonIndexCount:function(){return 12},_pointDistKm:St,_pointDistM:function(t,e){t|=0;var n,r,i,a=0;return r=+o[(e|=0)>>3],n=+o[t>>3],a=(i=+f(.5*(r-n)))*i+(a=+f(.5*(+o[e+8>>3]-+o[t+8>>3])))*(+h(+r)*+h(+n)*a),2*+g(+ +l(+a),+ +l(+(1-a)))*6371.007180918475*1e3},_pointDistRads:function(t,e){t|=0;var n,r,i,a=0;return r=+o[(e|=0)>>3],n=+o[t>>3],a=(i=+f(.5*(r-n)))*i+(a=+f(.5*(+o[e+8>>3]-+o[t+8>>3])))*(+h(+r)*+h(+n)*a),2*+g(+ +l(+a),+ +l(+(1-a)))},_polyfill:function(t,e,n){var r,o=0,a=0,s=0,u=0,l=0;if(r=M,M=M+48|0,o=r+8|0,a=r,0|function(t,e,n){t|=0,e|=0,n|=0;var r=0,o=0,a=0,s=0,u=0,l=0,c=0,h=0,f=0,p=0,d=0,A=0,v=0,g=0,m=0,y=0,_=0,b=0,x=0,B=0,k=0,E=0,S=0,T=0,I=0,D=0,O=0,F=0,R=0,z=0;z=M,M=M+112|0,D=z+80|0,l=z+72|0,O=z,F=z+56|0,c=t+8|0,R=0|ge(32+(i[c>>2]<<5)|0),R||C(22848,22448,800,22456);if(ie(t,R),a=t,r=0|i[a+4>>2],u=l,i[u>>2]=i[a>>2],i[u+4>>2]=r,re(l,D),u=0|H(D,e),r=0|i[l>>2],a=0|i[c>>2],(0|a)>0){s=0|i[t+12>>2],o=0;do{r=(0|i[s+(o<<3)>>2])+r|0,o=o+1|0}while((0|o)!=(0|a))}if(u=(0|u)<(0|r)?r:u,I=u+12|0,o=0|ye(I,8),h=0|ye(I,8),i[D>>2]=0,S=t,T=0|i[S+4>>2],r=l,i[r>>2]=i[S>>2],i[r+4>>2]=T,r=0|L(l,I,e,D,o,h),0|r)return me(o),me(h),me(R),M=z,0|(R=r);t:do{if((0|i[c>>2])>0){for(a=t+12|0,r=0;s=0|L((0|i[a>>2])+(r<<3)|0,I,e,D,o,h),r=r+1|0,!(0|s);)if((0|r)>=(0|i[c>>2]))break t;return me(o),me(h),me(R),M=z,0|(R=s)}}while(0);(0|u)>-12&&Te(0|h,0,((0|I)>1?I:1)<<3|0);t:do{if((0|i[D>>2])>0){T=((0|I)<0)<<31>>31,b=o,x=h,B=o,k=o,E=h,S=o,r=o,g=o,m=h,y=h,_=h,o=h;e:for(;;){for(v=0|i[D>>2],d=0,A=0,a=0;;){u=(s=O)+56|0;do{i[s>>2]=0,s=s+4|0}while((0|s)<(0|u));if(0|P(l=0|i[(e=b+(d<<3)|0)>>2],e=0|i[e+4>>2],1,O,0)){u=(s=O)+56|0;do{i[s>>2]=0,s=s+4|0}while((0|s)<(0|u));0|(s=0|ye(7,4))&&(Z(l,e,1,O,s,7,0),me(s))}p=0;do{h=0|i[(f=O+(p<<3)|0)>>2],f=0|i[f+4>>2];n:do{if(!(0==(0|h)&0==(0|f))){if(l=0|we(0|h,0|f,0|I,0|T),w(),!(0==(0|(e=0|i[(u=s=n+(l<<3)|0)>>2]))&0==(0|(u=0|i[u+4>>2]))))for(c=0;;){if((0|c)>(0|I))break e;if((0|e)==(0|h)&(0|u)==(0|f))break n;if(0==(0|(e=0|i[(u=s=n+((l=(l+1|0)%(0|I)|0)<<3)|0)>>2]))&0==(0|(u=0|i[u+4>>2])))break;c=c+1|0}0==(0|h)&0==(0|f)||(Vt(h,f,F),0|oe(t,R,F)&&(i[(c=s)>>2]=h,i[c+4>>2]=f,i[(c=x+(a<<3)|0)>>2]=h,i[c+4>>2]=f,a=a+1|0))}}while(0);p=p+1|0}while(p>>>0<7);if((0|(A=A+1|0))>=(0|v))break;d=d+1|0}if((0|v)>0&&Te(0|B,0,v<<3|0),i[D>>2]=a,!((0|a)>0))break t;h=o,f=_,p=S,d=y,A=m,v=x,o=g,_=r,y=k,m=B,g=h,r=f,S=E,E=p,k=d,B=A,x=b,b=v}return me(k),me(E),me(R),M=z,0|(R=-1)}r=h}while(0);return me(R),me(o),me(r),R=0,M=z,0|R}(t|=0,e|=0,n|=0)){if(s=0|i[(l=t)+4>>2],i[(u=a)>>2]=i[l>>2],i[u+4>>2]=s,re(a,o),u=0|H(o,e),e=0|i[a>>2],(0|(s=0|i[t+8>>2]))>0){a=0|i[t+12>>2],o=0;do{e=(0|i[a+(o<<3)>>2])+e|0,o=o+1|0}while((0|o)!=(0|s))}(0|(e=(0|u)<(0|e)?e:u))<=-12||Te(0|n,0,8+(((0|(l=e+11|0))>0?l:0)<<3)|0),M=r}else M=r},_res0IndexCount:function(){return 122},_round:Me,_sbrk:Ie,_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,r,o){t|=0,n|=0,r|=0,o|=0;var a=0,s=0,u=0,l=0,c=0,h=0;if((0|(e|=0))<=0)return 0|(o=0);if((0|o)>=16){for(a=0;;){if(!(0==(0|i[(h=t+(a<<3)|0)>>2])&0==(0|i[h+4>>2]))){a=14;break}if((0|(a=a+1|0))>=(0|e)){s=0,a=16;break}}if(14==(0|a))return 0|((0|r)>0?-2:-1);if(16==(0|a))return 0|s}a=0,h=0;t:for(;;){s=0|i[(u=c=t+(h<<3)|0)>>2],u=0|i[u+4>>
22];do{if(!(0==(0|s)&0==(0|u))){if((0|a)>=(0|r)){s=-1,a=16;break t}if(l=0|Ce(0|s,0|u,52),w(),(0|(l&=15))>(0|o)){s=-2,a=16;break t}if((0|l)==(0|o)){i[(c=n+(a<<3)|0)>>2]=s,i[c+4>>2]=u,a=a+1|0;break}if((0|(s=(0|ee(7,o-l|0))+a|0))>(0|r)){s=-1,a=16;break t}Zt(0|i[c>>2],0|i[c+4>>2],o,n+(a<<3)|0),a=s}}while(0);if((0|(h=h+1|0))>=(0|e)){s=0,a=16;break}}return 16==(0|a)?0|s:0},establishStackSpace:function(t,e){M=t|=0},stackAlloc:function(t){var e;return e=M,M=(M=M+(t|=0)|0)+15&-16,0|e},stackRestore:function(t){M=t|=0},stackSave:function(){return 0|M}}}({Math:Math,Int8Array:Int8Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Float32Array:Float32Array,Float64Array:Float64Array},Y,v),tt=(n.___uremdi3=$.___uremdi3,n._bitshift64Lshr=$._bitshift64Lshr,n._bitshift64Shl=$._bitshift64Shl,n._calloc=$._calloc,n._cellAreaKm2=$._cellAreaKm2,n._cellAreaM2=$._cellAreaM2,n._cellAreaRads2=$._cellAreaRads2,n._compact=$._compact,n._destroyLinkedPolygon=$._destroyLinkedPolygon,n._edgeLengthKm=$._edgeLengthKm,n._edgeLengthM=$._edgeLengthM,n._emscripten_replace_memory=$._emscripten_replace_memory),et=(n._exactEdgeLengthKm=$._exactEdgeLengthKm,n._exactEdgeLengthM=$._exactEdgeLengthM,n._exactEdgeLengthRads=$._exactEdgeLengthRads,n._experimentalH3ToLocalIj=$._experimentalH3ToLocalIj,n._experimentalLocalIjToH3=$._experimentalLocalIjToH3,n._free=$._free,n._geoToH3=$._geoToH3,n._getDestinationH3IndexFromUnidirectionalEdge=$._getDestinationH3IndexFromUnidirectionalEdge,n._getH3IndexesFromUnidirectionalEdge=$._getH3IndexesFromUnidirectionalEdge,n._getH3UnidirectionalEdge=$._getH3UnidirectionalEdge,n._getH3UnidirectionalEdgeBoundary=$._getH3UnidirectionalEdgeBoundary,n._getH3UnidirectionalEdgesFromHexagon=$._getH3UnidirectionalEdgesFromHexagon,n._getOriginH3IndexFromUnidirectionalEdge=$._getOriginH3IndexFromUnidirectionalEdge,n._getPentagonIndexes=$._getPentagonIndexes,n._getRes0Indexes=$._getRes0Indexes,n._h3Distance=$._h3Distance,n._h3GetBaseCell=$._h3GetBaseCell,n._h3GetFaces=$._h3GetFaces,n._h3GetResolution=$._h3GetResolution,n._h3IndexesAreNeighbors=$._h3IndexesAreNeighbors,n._h3IsPentagon=$._h3IsPentagon,n._h3IsResClassIII=$._h3IsResClassIII,n._h3IsValid=$._h3IsValid,n._h3Line=$._h3Line,n._h3LineSize=$._h3LineSize,n._h3SetToLinkedGeo=$._h3SetToLinkedGeo,n._h3ToCenterChild=$._h3ToCenterChild,n._h3ToChildren=$._h3ToChildren,n._h3ToGeo=$._h3ToGeo,n._h3ToGeoBoundary=$._h3ToGeoBoundary,n._h3ToParent=$._h3ToParent,n._h3UnidirectionalEdgeIsValid=$._h3UnidirectionalEdgeIsValid,n._hexAreaKm2=$._hexAreaKm2,n._hexAreaM2=$._hexAreaM2,n._hexRing=$._hexRing,n._i64Subtract=$._i64Subtract,n._kRing=$._kRing,n._kRingDistances=$._kRingDistances,n._llvm_minnum_f64=$._llvm_minnum_f64,n._llvm_round_f64=$._llvm_round_f64,n._malloc=$._malloc,n._maxFaceCount=$._maxFaceCount,n._maxH3ToChildrenSize=$._maxH3ToChildrenSize,n._maxKringSize=$._maxKringSize,n._maxPolyfillSize=$._maxPolyfillSize,n._maxUncompactSize=$._maxUncompactSize,n._memcpy=$._memcpy,n._memset=$._memset,n._numHexagons=$._numHexagons,n._pentagonIndexCount=$._pentagonIndexCount,n._pointDistKm=$._pointDistKm,n._pointDistM=$._pointDistM,n._pointDistRads=$._pointDistRads,n._polyfill=$._polyfill,n._res0IndexCount=$._res0IndexCount,n._round=$._round,n._sbrk=$._sbrk,n._sizeOfCoordIJ=$._sizeOfCoordIJ,n._sizeOfGeoBoundary=$._sizeOfGeoBoundary,n._sizeOfGeoCoord=$._sizeOfGeoCoord,n._sizeOfGeoPolygon=$._sizeOfGeoPolygon,n._sizeOfGeofence=$._sizeOfGeofence,n._sizeOfH3Index=$._sizeOfH3Index,n._sizeOfLinkedGeoPolygon=$._sizeOfLinkedGeoPolygon,n._uncompact=$._uncompact,n.establishStackSpace=$.establishStackSpace,n.stackAlloc=$.stackAlloc),nt=n.stackRestore=$.stackRestore,rt=n.stackSave=$.stackSave;if(n.asm=$,n.cwrap=function(t,e,n,r){var i=(n=n||[]).every((function(t){return"number"===t}));return"string"!==e&&i&&!r?f(t):function(){return p(t,e,n,arguments)}},n.setValue=function(t,e,n,r){switch("*"===(n=n||"i8").charAt(n.length-1)&&(n="i32"),n){case"i1":case"i8":g[t>>0]=e;break;case"i16":y[t>>1]=e;break;case"i32":_[t>>2]=e;break;case"i64":z=[e>>>0,(R=e,+I(R)>=1?R>0?(0|D(+Z(R/4294967296),4294967295))>>>0:~~+P((R-+(~~R>>>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 g[t>>0];case"i16":return y[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=c,U){G(U)||(K=U,U=n.locateFile?n.locateFile(K,a):a+K),L++,n.monitorRunDependencies&&n.monitorRunDependencies(L);var it=function(t){t.byteLength&&(t=new Uint8Array(t)),m.set(t,8),n.memoryInitializerRequest&&delete n.memoryInitializerRequest.response,function(t){if(L--,n.monitorRunDependencies&&n.monitorRunDependencies(L),0==L&&(null!==O&&(clearInterval(O),O=null),F)){var e=F;F=null,e()}}()},ot=function(){i(U,it,(function(){throw"could not load memory initializer "+U}))},at=q(U);if(at)it(at.buffer);else if(n.memoryInitializerRequest){var st=function(){var t=n.memoryInitializerRequest,e=t.response;if(200!==t.status&&0!==t.status){var r=q(n.memoryInitializerRequestURL);if(!r)return console.warn("a problem seems to have happened with Module.memoryInitializerRequest, status: "+t.status+", retrying "+U),void ot();e=r.buffer}it(e)};n.memoryInitializerRequest.response?setTimeout(st,0):n.memoryInitializerRequest.addEventListener("load",st)}else ot()}function ut(t){function e(){X||(X=!0,h||(k(S),k(T),n.onRuntimeInitialized&&n.onRuntimeInitialized(),function(){if(n.postRun)for("function"==typeof n.postRu
2n&&(n.postRun=[n.postRun]);n.postRun.length;)t=n.postRun.shift(),M.unshift(t);var t;k(M)}()))}t=t||o,L>0||(!function(){if(n.preRun)for("function"==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)t=n.preRun.shift(),E.unshift(t);var t;k(E)}(),L>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),s(t+=""),u(t),h=!0,"abort("+t+"). Build with -s ASSERTIONS=1 for more info."}if(F=function t(){X||ut(),X||(F=t)},n.run=ut,n.abort=lt,n.preInit)for("function"==typeof n.preInit&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.pop()();return ut(),t}("object"===typeof rn?rn:{}),on="number",an={};[["sizeOfH3Index",on],["sizeOfGeoCoord",on],["sizeOfGeoBoundary",on],["sizeOfGeoPolygon",on],["sizeOfGeofence",on],["sizeOfLinkedGeoPolygon",on],["sizeOfCoordIJ",on],["h3IsValid",on,[on,on]],["geoToH3",on,[on,on,on]],["h3ToGeo",null,[on,on,on]],["h3ToGeoBoundary",null,[on,on,on]],["maxKringSize",on,[on]],["kRing",null,[on,on,on,on]],["kRingDistances",null,[on,on,on,on,on]],["hexRing",null,[on,on,on,on]],["maxPolyfillSize",on,[on,on]],["polyfill",null,[on,on,on]],["h3SetToLinkedGeo",null,[on,on,on]],["destroyLinkedPolygon",null,[on]],["compact",on,[on,on,on]],["uncompact",on,[on,on,on,on,on]],["maxUncompactSize",on,[on,on,on]],["h3IsPentagon",on,[on,on]],["h3IsResClassIII",on,[on,on]],["h3GetBaseCell",on,[on,on]],["h3GetResolution",on,[on,on]],["maxFaceCount",on,[on,on]],["h3GetFaces",null,[on,on,on]],["h3ToParent",on,[on,on,on]],["h3ToChildren",null,[on,on,on,on]],["h3ToCenterChild",on,[on,on,on]],["maxH3ToChildrenSize",on,[on,on,on]],["h3IndexesAreNeighbors",on,[on,on,on,on]],["getH3UnidirectionalEdge",on,[on,on,on,on]],["getOriginH3IndexFromUnidirectionalEdge",on,[on,on]],["getDestinationH3IndexFromUnidirectionalEdge",on,[on,on]],["h3UnidirectionalEdgeIsValid",on,[on,on]],["getH3IndexesFromUnidirectionalEdge",null,[on,on,on]],["getH3UnidirectionalEdgesFromHexagon",null,[on,on,on]],["getH3UnidirectionalEdgeBoundary",null,[on,on,on]],["h3Distance",on,[on,on,on,on]],["h3Line",on,[on,on,on,on,on]],["h3LineSize",on,[on,on,on,on]],["experimentalH3ToLocalIj",on,[on,on,on,on,on]],["experimentalLocalIjToH3",on,[on,on,on,on]],["hexAreaM2",on,[on]],["hexAreaKm2",on,[on]],["edgeLengthM",on,[on]],["edgeLengthKm",on,[on]],["pointDistM",on,[on,on]],["pointDistKm",on,[on,on]],["pointDistRads",on,[on,on]],["cellAreaM2",on,[on,on]],["cellAreaKm2",on,[on,on]],["cellAreaRads2",on,[on,on]],["exactEdgeLengthM",on,[on,on]],["exactEdgeLengthKm",on,[on,on]],["exactEdgeLengthRads",on,[on,on]],["numHexagons",on,[on]],["getRes0Indexes",null,[on]],["res0IndexCount",on],["getPentagonIndexes",null,[on,on]],["pentagonIndexCount",on]].forEach((function(t){an[t[0]]=rn.cwrap.apply(rn,t)}));var sn=16,un=4,ln=4,cn=8,hn=an.sizeOfH3Index(),fn=an.sizeOfGeoCoord(),pn=an.sizeOfGeoBoundary(),dn=(an.sizeOfGeoPolygon(),an.sizeOfGeofence(),an.sizeOfLinkedGeoPolygon()),An=(an.sizeOfCoordIJ(),"m"),vn="km";function gn(t){if("number"!==typeof t||t<0||t>15||Math.floor(t)!==t)throw new Error("Invalid resolution: "+t)}var mn=/[^0-9a-fA-F]/;function yn(t){if(Array.isArray(t)&&2===t.length&&Number.isInteger(t[0])&&Number.isInteger(t[1]))return t;if("string"!==typeof t||mn.test(t))return[0,0];var e=parseInt(t.substring(0,t.length-8),sn);return[parseInt(t.substring(t.length-8),sn),e]}function _n(t){if(t>=0)return t.toString(sn);var e=xn(8,(t&=2147483647).toString(sn));return e=(parseInt(e[0],sn)+8).toString(sn)+e.substring(1)}function bn(t,e){return _n(e)+xn(8,_n(t))}function xn(t,e){for(var n=t-e.length,r="",i=0;i<n;i++)r+="0";return r+=e}function wn(t){return[t,rn.getTempRet0()]}function Cn(t){var e=wn(t),n=e[0],r=e[1];return r?bn(n,r):null}function Bn(t,e,n){rn.HEAPU32.set(yn(t),e/un+2*n)}function kn(t,e){for(var n=e.length,r=0;r<n;r++)Bn(e[r],t,r)}function En(t){return 180*rn.getValue(t,"double")/Math.PI}function Sn(t){return[En(t),En(t+cn)]}function Tn(t){return[En(t+cn),En(t)]}function Mn(t,e,n){for(var r=rn.getValue(t,"i32"),i=t+cn,o=[],a=e?Tn:Sn,s=0;s<2*r;s+=2)o.push(a(i+cn*s));return n&&o.push(o[0]),o}function In(t){var e=yn(t),n=e[0],r=e[1];return Boolean(an.h3IsPentagon(n,r))}function Pn(t){var e=yn(t),n=e[0],r=e[1];return an.h3IsValid(n,r)?an.h3GetResolution(n,r):-1}function Zn(t){var e=rn._malloc(fn),n=yn(t),r=n[0],i=n[1];an.h3ToGeo(r,i,e);var o=Sn(e);return rn._free(e),o}function Dn(t,e){if(!t||!t.length)return[];var n=t.length,r=rn._calloc(n,hn);kn(r,t);var i=rn._calloc(dn),o=i;an.h3SetToLinkedGeo(r,n,i);var a=function(t,e){for(var n,r,i,o,a=[],s=e?Tn:Sn;t;){for(a.push(n=[]),r=rn.getValue(t,"i8*");r;){for(n.push(i=[]),o=rn.getValue(r,"i8*");o;)i.push(s(o)),o=rn.getValue(o+2*cn,"i8*");e&&i.push(i[0]),r=rn.getValue(r+2*ln,"i8*")}t=rn.getValue(t+2*ln,"i8*")}return a}(i,e);return an.destroyLinkedPolygon(o),rn._free(o),rn._free(r),a}function Ln(t,e){switch(gn(t),e){case An:return an.edgeLengthM(t);case vn:return an.edgeLengthKm(t);default:throw new Error("Unknown unit: "+e)}}function On(t){return t*Math.PI/180}var Fn=n(73115),Rn=n(35387);function zn(t,e){e=void 0===e?t[0][0]:e;var n,r=(0,j.Z)(t);try{for(r.s();!(n=r.n()).done;){var i=n.value,o=i[0]-e;o>180?i[0]-=360:o<-180&&(i[0]+=360)}}catch(a){r.e(a)}finally{r.f()}}function Un(t,e,n){var r=Zn(t(e,n)),i=(0,b.Z)(r,2),o=i[0];return[i[1],o]}function Nn(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=function(t,e){var n=rn._malloc(pn),r=yn(t),i=r[0],o=r[1];an.h3ToGeoBoundary(i,o,n);var a=Mn(n,e,e);return rn._free(n),a}(t,!0);return 1!==e?function(t,e,n){var r=Zn(t),i=(0,b.Z)(r,2),o=i[0],a=i[1],s=e.length;zn(e,a);for(var u=e[0]===e[s-1]?s-1:s,l=0;l<u;l++)e[l][0]=(0,Xt.t7)(a,e[l][0],n),e[l][1]=(0,Xt.t7)(o,e[l][1],n)}(t,n,e):zn(n),n}var Gn=(0,v.Z)((0,v.Z)({},m.Z.defaultProps),{},{highPrecision:"auto",coverage:{type:"number",min:0,max:1,value:1},centerHexagon:null,getHexagon:{type:"accessor",value:function(t){return t.hexagon}},extruded:!0}),jn=function(t){(0,f.Z)(n,t);var e=(0,p.Z)(n);function n(){var t;(0,h.Z)(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),(0,d.Z)((0,q.Z)(t),"state",void 0),t}return(0,c.Z)(n,[{key:"initializeState",value:function(){n._checkH3Lib(),this.state={edgeLengthKM:0,resolution:-1}}},{key:"shouldUpdateState",value:function(t){var e=t.changeFlags;return this._shouldUseHighPrecision()?e.propsOrDataChanged:e.somethingChanged}},{key:"updateState",value:function(t){var e=t.props,n=t.changeFlags;if(!0!==e.highPrecision&&(n.dataChanged||n.updateTriggersChanged&&n.updateTriggersChanged.getHexagon)){var r=this._calculateH3DataProps();this.setState(r)}this._updateVertices(this.context.viewport)}},{key:"_calculateH3DataProps",value:function(){var t,e=-1,n=!1,r=!1,i=(0,Fn.jB)(this.props.data),o=i.iterable,a=i.objectInfo,s=(0,j.Z)(o);try{for(s.s();!(t=s.n()).done;){var u=t.value;a.index++;var l=this.props.getHexagon(u,a),c=Pn(l);if(e<0){if(e=c,!this.props.highPrecision)break}else if(e!==c){r=!0;break}if(In(l)){n=!0;break}}}catch(h){s.e(h)}finally{s.f()}return{resolution:e,edgeLengthKM:e>=0?Ln(e,"km"):0,hasMultipleRes:r,hasPentagon:n}}},{key:"_shouldUseHighPrecision",value:function(){if("auto"===this.props.highPrecision){var t=this.state,e=t.resolution,n=t.hasPentagon,r=t.hasMultipleRes,i=this.context.viewport;return Boolean(null===i||void 0===i?void 0:i.resolution)||r||n||e>=0&&e<=5}return this.props.highPrecision}},{key:"_updateVertices",value:function(t){if(!this._shouldUseHighPrecision()){var e=this.state,n=e.resolution,r=e.edgeLengthKM,i=e.centerHex;if(!(n<0)){var o=this.props.centerHexagon||function(t,e,n){var r=rn._malloc(fn);rn.HEAPF64.set([t,e].map(On),r/cn);var i=Cn(an.geoToH3(r,n));return rn._free(r),i}(t.latitude,t.longitude,n);if(i!==o){if(i){var a=function(t,e){var n=yn(t),r=n[0],i=n[1],o=yn(e),a=o[0],s=o[1];return an.h3Distance(r,i,a,s)}(i,o);if(a>=0&&a*r<10)return}var s=t.distanceScales.unitsPerMeter,u=Nn(o),l=Zn(o),c=(0,b.Z)(l,2),h=c[0],f=c[1],p=t.projectFlat([f,h]),d=(0,b.Z)(p,2),A=d[0],v=d[1];u=u.map((function(e){var n=t.projectFlat(e);return[(n[0]-A)/s[0],(n[1]-v)/s[1]]})),this.setState({centerHex:o,vertices:u})}}}}},{key:"renderLayers",value:function(){return this._shouldUseHighPrecision()?this._renderPolygonLayer():this._renderColumnLayer()}},{key:"_getForwardProps",value:function(){var t=this.props,e=t.elevationScale,n=t.material,r=t.coverage,i=t.extruded,o=t.wireframe,a=t.stroked,s=t.filled,u=t.lineWidthUnits,l=t.lineWidthScale,c=t.lineWidthMinPixels,h=t.lineWidthMaxPixels,f=t.getFillColor,p=t.getElevation,d=t.getLineColor,A=t.getLineWidth,v=t.transitions,g=t.updateTriggers;return{elevationScale:e,extruded:i,coverage:r,wireframe:o,stroked:a,filled:s,lineWidthUnits:u,lineWidthScale:l,lineWidthMinPixels:c,lineWidthMaxPixels:h,material:n,getElevation:p,getFillColor:f,getLineColor:d,getLineWidth:A,transitions:v,updateTriggers:{getFillColor:g.getFillColor,getElevation:g.getElevation,getLineColor:g.getLineColor,getLineWidth:g.getLineWidth}}}},{key:"_renderPolygonLayer",value:function(){var t=this.props,e=t.data,n=t.getHexagon,r=t.updateTriggers,i=t.coverage,o=this.getSubLayerClass("hexagon-cell-hifi",m.Z),a=this._getForwardProps();return a.updateTriggers.getPolygon=function(t,e){return void 0===t||null===t?e:"object"===typeof t?(0,v.Z)((0,v.Z)({},t),{},{coverage:e}):{getHexagon:t,coverage:e}}
2(r.getHexagon,i),new o(a,this.getSubLayerProps({id:"hexagon-cell-hifi",updateTriggers:a.updateTriggers}),{data:e,_normalize:!1,_windingOrder:"CCW",positionFormat:"XY",getPolygon:function(t,e){return function(t){var e,n=new Float64Array(2*t.length),r=0,i=(0,j.Z)(t);try{for(i.s();!(e=i.n()).done;){var o=e.value;n[r++]=o[0],n[r++]=o[1]}}catch(a){i.e(a)}finally{i.f()}return n}(Nn(n(t,e),i))}})}},{key:"_renderColumnLayer",value:function(){var t=this.props,e=t.data,n=t.getHexagon,r=t.updateTriggers,i=this.getSubLayerClass("hexagon-cell",Rn.Z),o=this._getForwardProps();return o.updateTriggers.getPosition=r.getHexagon,new i(o,this.getSubLayerProps({id:"hexagon-cell",flatShading:!0,updateTriggers:o.updateTriggers}),{data:e,diskResolution:6,radius:1,vertices:this.state.vertices,getPosition:Un.bind(null,n)})}}]),n}(g.Z);(0,d.Z)(jn,"defaultProps",Gn),(0,d.Z)(jn,"layerName","H3HexagonLayer"),(0,d.Z)(jn,"_checkH3Lib",(function(){}));var Vn=function(t){(0,f.Z)(n,t);var e=(0,p.Z)(n);function n(){return(0,h.Z)(this,n),e.apply(this,arguments)}return(0,c.Z)(n,[{key:"initializeState",value:function(){jn._checkH3Lib()}},{key:"updateState",value:function(t){var e=t.props,n=t.changeFlags;if(n.dataChanged||n.updateTriggersChanged&&n.updateTriggersChanged.getHexagons){var r,i=e.data,o=e.getHexagons,a=[],s=(0,Fn.jB)(i),u=s.iterable,l=s.objectInfo,c=(0,j.Z)(u);try{for(c.s();!(r=c.n()).done;){var h=r.value;l.index++;var f,p=Dn(o(h,l),!0),d=(0,j.Z)(p);try{for(d.s();!(f=d.n()).done;){var A=f.value;a.push(this.getSubLayerRow({polygon:A},h,l.index))}}catch(v){d.e(v)}finally{d.f()}}}catch(v){c.e(v)}finally{c.f()}this.setState({polygons:a})}}},{key:"indexToBounds",value:function(){return{data:this.state.polygons,getPolygon:function(t){return t.polygon}}}}]),n}(_);(0,d.Z)(Vn,"layerName","H3ClusterLayer"),(0,d.Z)(Vn,"defaultProps",{getHexagons:{type:"accessor",value:function(t){return t.hexagons}}});var Hn=n(69296),Jn=n(11162),Wn=n(57309),Qn=n(92086),qn=n(78032),Kn=n(94557),Xn=n(36800);var Yn=function(t){(0,f.Z)(n,t);var e=(0,p.Z)(n);function n(){return(0,h.Z)(this,n),e.apply(this,arguments)}return(0,c.Z)(n,[{key:"getShaders",value:function(){var t=(0,tn.Z)((0,en.Z)(n.prototype),"getShaders",this).call(this);return t.modules.push(qn.b),(0,v.Z)((0,v.Z)({},t),{},{vs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\n\n// Scale the model\nuniform float sizeScale;\nuniform bool composeModelMatrix;\nuniform bool pickFeatureIds;\n\n// Primitive attributes\nin vec3 positions;\nin vec3 normals;\nin vec3 colors;\nin vec2 texCoords;\nin vec4 uvRegions;\nin vec3 featureIdsPickingColors;\n\n// Instance attributes\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\n\n// Outputs to fragment shader\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    // https://github.com/Esri/i3s-spec/blob/master/docs/1.7/geometryUVRegion.cmn.md\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);
2\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    // set PBR data\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\n// NOTE(Tarek): This is necessary because\n// headless.gl reports the extension as\n// available but does not support it in\n// the shader.\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"})}},{key:"initializeState",value:function(){var t=this.props.featureIds;(0,tn.Z)((0,en.Z)(n.prototype),"initializeState",this).call(this);var e=this.getAttributeManager();t&&e.add({featureIdsPickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateFeatureIdsPickingColors}})}},{key:"updateState",value:function(t){(0,tn.Z)((0,en.Z)(n.prototype),"updateState",this).call(this,t);var e=t.props,r=t.oldProps;e.pbrMaterial!==r.pbrMaterial&&this.updatePbrMaterialUniforms(e.pbrMaterial)}},{key:"draw",value:function(t){var e=this.props.featureIds;this.state.model&&(this.state.model.setUniforms({u_Camera:this.state.model.getUniforms().project_uCameraPosition,pickFeatureIds:Boolean(e)}),(0,tn.Z)((0,en.Z)(n.prototype),"draw",this).call(this,t))}},{key:"getModel",value:function(t){var e=this.props,n=e.id,r=e.pbrMaterial,i=this.parseMaterial(r,t);this.setState({materialParser:i});var o,a=this.getShaders();return(o=t.attributes).COLOR_0||o.colors||(o.colors={constant:!0,value:new Float32Array([1,1,1])}),new Kn.Z(this.context.gl,(0,v.Z)((0,v.Z)({},this.getShaders()),{},{id:n,geometry:t,defines:(0,v.Z)((0,v.Z)((0,v.Z)({},a.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}))}},{key:"updatePbrMaterialUniforms",value:function(t){var e=this.state.model;if(e){var n=this.props.mesh,r=this.parseMaterial(t,n);this.setState({materialParser:r}),e.setUniforms(r.uniforms)}}},{key:"parseMaterial",value:function(t,e){var n,r=Boolean(t.pbrMetallicRoughness&&t.pbrMetallicRoughness.baseColorTexture);return null===(n=this.state.materialParser)||void 0===n||n.delete(),new Qn.Z(this.context.gl,{attributes:{NORMAL:e.attributes.normals,TEXCOORD_0:e.attributes.texCoords},material:(0,v.Z)({unlit:r},t),pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1})}},{key:"calculateFeatureIdsPickingColors",value:function(t){for(var e=this.props.featureIds,n=new Uint8ClampedArray(e.length*t.size),r=[],i=0;i<e.length;i++)this.encodePickingColor(e[i],r),n[3*i]=r[0],n[3*i+1]=r[1],n[3*i+2]=r[2];t.value=n}},{key:"finalizeState",value:function(t){var e;(0,tn.Z)((0,en.Z)(n.prototype),"finalizeState",this).call(this,t),null===(e=this.state.materialParser)||void 0===e||e.delete(),this.setState({materialParser:null})}}]),n}(Xn.Z);(0,d.Z)(Yn,"layerName","MeshLayer"),(0,d.Z)(Yn,"defaultProps",{pbrMaterial:{type:"object",value:null},featureIds:{type:"array",value:null,optional:!0}});var $n=n(3685),tr=6378137,er=6378137,nr=6356752.314245179;Math.max(tr,er,nr);function rr(t){return t}new pt.Z;function ir(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:rr;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 or(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:rr;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}var ar=new pt.Z,sr=new pt.Z,ur=new pt.Z;var lr=new pt.Z,cr={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"}},hr={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},fr={east:new pt.Z,north:new pt.Z,up:new pt.Z,west:new pt.Z,south:new pt.Z,down:new pt.Z},pr=new pt.Z,dr=new pt.Z,Ar=new pt.Z;function vr(t,e,n,r,i,o){var a,s,u,l=cr[e]&&cr[e][n];
2(0,Kt.Z)(l&&(!r||r===l));var c=lr.copy(i);if((0,Xt.fS)(c.x,0,1e-14)&&(0,Xt.fS)(c.y,0,1e-14)){var h=Math.sign(c.z);a=pr.fromArray(hr[e]),"east"!==e&&"west"!==e&&a.scale(h),s=dr.fromArray(hr[n]),"east"!==n&&"west"!==n&&s.scale(h),u=Ar.fromArray(hr[r]),"east"!==r&&"west"!==r&&u.scale(h)}else{var f=fr.up,p=fr.east,d=fr.north;p.set(-c.y,c.x,0).normalize(),t.geodeticSurfaceNormal(c,f),d.copy(f).cross(p);var A=fr.west,v=fr.south;fr.down.copy(f).scale(-1),A.copy(p).scale(-1),v.copy(d).scale(-1),a=fr[e],s=fr[n],u=fr[r]}return o[0]=a.x,o[1]=a.y,o[2]=a.z,o[3]=0,o[4]=s.x,o[5]=s.y,o[6]=s.z,o[7]=0,o[8]=u.x,o[9]=u.y,o[10]=u.z,o[11]=0,o[12]=c.x,o[13]=c.y,o[14]=c.z,o[15]=1,o}var gr=new pt.Z,mr=new pt.Z,yr=new pt.Z,_r=new pt.Z,br=new pt.Z,xr=new pt.Z,wr=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;(0,h.Z)(this,t),(0,d.Z)(this,"radii",void 0),(0,d.Z)(this,"radiiSquared",void 0),(0,d.Z)(this,"radiiToTheFourth",void 0),(0,d.Z)(this,"oneOverRadii",void 0),(0,d.Z)(this,"oneOverRadiiSquared",void 0),(0,d.Z)(this,"minimumRadius",void 0),(0,d.Z)(this,"maximumRadius",void 0),(0,d.Z)(this,"centerToleranceSquared",oe.EPSILON1),(0,d.Z)(this,"squaredXOverSquaredZ",void 0),(0,Kt.Z)(e>=0),(0,Kt.Z)(n>=0),(0,Kt.Z)(r>=0),this.radii=new pt.Z(e,n,r),this.radiiSquared=new pt.Z(e*e,n*n,r*r),this.radiiToTheFourth=new pt.Z(e*e*e*e,n*n*n*n,r*r*r*r),this.oneOverRadii=new pt.Z(0===e?0:1/e,0===n?0:1/n,0===r?0:1/r),this.oneOverRadiiSquared=new pt.Z(0===e?0:1/(e*e),0===n?0:1/(n*n),0===r?0:1/(r*r)),this.minimumRadius=Math.min(e,n,r),this.maximumRadius=Math.max(e,n,r),0!==this.radiiSquared.z&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}return(0,c.Z)(t,[{key:"equals",value:function(t){return this===t||Boolean(t&&this.radii.equals(t.radii))}},{key:"toString",value:function(){return this.radii.toString()}},{key:"cartographicToCartesian",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0],n=mr,r=yr,i=(0,b.Z)(t,3)[2];this.geodeticSurfaceNormalCartographic(t,n),r.copy(this.radiiSquared).scale(n);var o=Math.sqrt(n.dot(r));return r.scale(1/o),n.scale(i),r.add(n),r.to(e)}},{key:"cartesianToCartographic",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];xr.from(t);var n=this.scaleToGeodeticSurface(xr,_r);if(n){var r=this.geodeticSurfaceNormal(n,mr),i=br;return i.copy(xr).subtract(n),function(t,e){return or(t,e,Xt.vc._cartographicRadians?rr:Xt.Ux)}([Math.atan2(r.y,r.x),Math.asin(r.z),Math.sign($.AK(i,xr))*$.kE(i)],e)}}},{key:"eastNorthUpToFixedFrame",value:function(t){return vr(this,"east","north","up",t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:new K.Z)}},{key:"localFrameToFixedFrame",value:function(t,e,n,r){return vr(this,t,e,n,r,arguments.length>4&&void 0!==arguments[4]?arguments[4]:new K.Z)}},{key:"geocentricSurfaceNormal",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return gr.from(t).normalize().to(e)}},{key:"geodeticSurfaceNormalCartographic",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0],n=function(t){return ir(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],Xt.vc._cartographicRadians?rr:Xt.Yr)}(t),r=n[0],i=n[1],o=Math.cos(i);return gr.set(o*Math.cos(r),o*Math.sin(r),Math.sin(i)).normalize(),gr.to(e)}},{key:"geodeticSurfaceNormal",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return gr.from(t).scale(this.oneOverRadiiSquared).normalize().to(e)}},{key:"scaleToGeodeticSurface",value:function(t,e){return function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=e.oneOverRadii,i=e.oneOverRadiiSquared,o=e.centerToleranceSquared;ar.from(t);var a=ar.x,s=ar.y,u=ar.z,l=r.x,c=r.y,h=r.z,f=a*a*l*l,p=s*s*c*c,d=u*u*h*h,A=f+p+d,v=Math.sqrt(1/A);
2if(Number.isFinite(v)){var g=sr;if(g.copy(t).scale(v),A<o)return g.to(n);var m=i.x,y=i.y,_=i.z,b=ur;b.set(g.x*m*2,g.y*y*2,g.z*_*2);var x,w,C,B,k=(1-v)*ar.len()/(.5*b.len()),E=0;do{var S=(x=1/(1+(k-=E)*m))*x,T=(w=1/(1+k*y))*w,M=(C=1/(1+k*_))*C;E=(B=f*S+p*T+d*M-1)/(-2*(f*(S*x)*m+p*(T*w)*y+d*(M*C)*_))}while(Math.abs(B)>oe.EPSILON12);return ar.scale([x,w,C]).to(n)}}(t,this,e)}},{key:"scaleToGeocentricSurface",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];_r.from(t);var n=_r.x,r=_r.y,i=_r.z,o=this.oneOverRadiiSquared,a=1/Math.sqrt(n*n*o.x+r*r*o.y+i*i*o.z);return _r.multiplyScalar(a).to(e)}},{key:"transformPositionToScaledSpace",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return _r.from(t).scale(this.oneOverRadii).to(e)}},{key:"transformPositionFromScaledSpace",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return _r.from(t).scale(this.radii).to(e)}},{key:"getSurfaceNormalIntersectionWithZAxis",value:function(t){var 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,Kt.Z)((0,Xt.fS)(this.radii.x,this.radii.y,oe.EPSILON15)),(0,Kt.Z)(this.radii.z>0),_r.from(t);var r=_r.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(r)>=this.radii.z-e))return _r.set(0,0,r).to(n)}}]),t}();function Cr(t,e){if(!t)throw new Error(e||"loader assertion failed.")}function Br(t){var e=t&&t.lastIndexOf("/");return e>=0?t.substr(0,e):""}(0,d.Z)(wr,"WGS84",new wr(tr,er,nr));var kr={id:"request-scheduler",throttleRequests:!0,maxRequests:6},Er=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,h.Z)(this,t),(0,d.Z)(this,"props",void 0),(0,d.Z)(this,"stats",void 0),(0,d.Z)(this,"activeRequestCount",0),(0,d.Z)(this,"requestQueue",[]),(0,d.Z)(this,"requestMap",new Map),(0,d.Z)(this,"deferredUpdate",null),this.props=(0,v.Z)((0,v.Z)({},kr),e),this.stats=new Ge.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")}return(0,c.Z)(t,[{key:"scheduleRequest",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return 0};if(!this.props.throttleRequests)return Promise.resolve({done:function(){}});if(this.requestMap.has(t))return this.requestMap.get(t);var n={handle:t,priority:0,getPriority:e},r=new Promise((function(t){return n.resolve=t,n}));return this.requestQueue.push(n),this.requestMap.set(t,r),this._issueNewRequests(),r}},{key:"_issueRequest",value:function(t){var e=this,n=t.handle,r=t.resolve,i=!1,o=function(){i||(i=!0,e.requestMap.delete(n),e.activeRequestCount--,e._issueNewRequests())};return this.activeRequestCount++,r?r({done:o}):Promise.resolve({done:o})}},{key:"_issueNewRequests",value:function(){var t=this;this.deferredUpdate||(this.deferredUpdate=setTimeout((function(){return t._issueNewRequestsAsync()}),0))}},{key:"_issueNewRequestsAsync",value:function(){this.deferredUpdate=null;var t=Math.max(this.props.maxRequests-this.activeRequestCount,0);if(0!==t){this._updateAllRequests();for(var e=0;e<t;++e){var n=this.requestQueue.shift();n&&this._issueRequest(n)}}}},{key:"_updateAllRequests",value:function(){for(var t=this.requestQueue,e=0;e<t.length;++e){var n=t[e];this._updateRequest(n)||(t.splice(e,1),this.requestMap.delete(n.handle),e--)}t.sort((function(t,e){return t.priority-e.priority}))}},{key:"_updateRequest",value:function(t){return t.priority=t.getPriority(t.handle),!(t.priority<0)||(t.resolve(null),!1)}}]),t}(),Sr=(0,c.Z)((function t(e,n,r){(0,h.Z)(this,t),(0,d.Z)(this,"item",void 0),(0,d.Z)(this,"previous",void 0),(0,d.Z)(this,"next",void 0),this.item=e,this.previous=n,this.next=r})),Tr=function(){function t(){(0,h.Z)(this,t),(0,d.Z)(this,"head",null),(0,d.Z)(this,"tail",null),(0,d.Z)(this,"_length",0)}return(0,c.Z)(t,[{key:"length",get:function(){return this._length}},{key:"add",value:function(t){var e=new Sr(t,this.tail,null);return this.tail?(this.tail.next=e,this.tail=e):(this.head=e,this.tail=e),++this._length,e}},{key:"remove",value:function(t){t&&(t.previous&&t.next?(t.previous.next=t.
2next,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)}},{key:"splice",value:function(t,e){t!==e&&(this.remove(e),this._insert(t,e))}},{key:"_insert",value:function(t,e){var n=t.next;t.next=e,this.tail===t?this.tail=e:n.previous=e,e.next=n,e.previous=t,++this._length}}]),t}();function Mr(t){return void 0!==t&&null!==t}var Ir=function(){function t(){(0,h.Z)(this,t),(0,d.Z)(this,"_list",void 0),(0,d.Z)(this,"_sentinel",void 0),(0,d.Z)(this,"_trimTiles",void 0),this._list=new Tr,this._sentinel=this._list.add("sentinel"),this._trimTiles=!1}return(0,c.Z)(t,[{key:"reset",value:function(){this._list.splice(this._list.tail,this._sentinel)}},{key:"touch",value:function(t){var e=t._cacheNode;Mr(e)&&this._list.splice(this._sentinel,e)}},{key:"add",value:function(t,e,n){Mr(e._cacheNode)||(e._cacheNode=this._list.add(e),n&&n(t,e))}},{key:"unloadTile",value:function(t,e,n){var r=e._cacheNode;Mr(r)&&(this._list.remove(r),e._cacheNode=void 0,n&&n(t,e))}},{key:"unloadTiles",value:function(t,e){var n=this._trimTiles;this._trimTiles=!1;for(var r=this._list,i=1024*t.maximumMemoryUsage*1024,o=this._sentinel,a=r.head;a!==o&&(t.gpuMemoryUsageInBytes>i||n);){var s=a.item;a=a.next,this.unloadTile(t,s,e)}}},{key:"trim",value:function(){this._trimTiles=!0}}]),t}();var Pr=new pt.Z,Zr=new pt.Z,Dr=new ie([new te,new te,new te,new te,new te,new te]);function Lr(t,e){var n=t.cameraDirection,r=t.cameraUp,i=t.height,o=t.distanceScales.metersPerUnit,a=Fr(t,t.center),s=wr.WGS84.eastNorthUpToFixedFrame(a),u=t.unprojectPosition(t.cameraPosition),l=wr.WGS84.cartographicToCartesian(u,new pt.Z),c=new pt.Z(s.transformAsVector(new pt.Z(n).scale(o))).normalize(),h=new pt.Z(s.transformAsVector(new pt.Z(r).scale(o))).normalize();return function(t){var e=t.getFrustumPlanes(),n=Or(e.near,t.cameraPosition),r=Fr(t,n),i=Fr(t,t.cameraPosition,Zr),o=0;for(var a in Dr.planes[o++].fromPointNormal(r,Pr.copy(r).subtract(i)),e)if("near"!==a){var s=Fr(t,Or(e[a],n,Zr),Zr);Dr.planes[o++].fromPointNormal(s,Pr.copy(r).subtract(s))}}(t),{camera:{position:l,direction:c,up:h},viewport:t,topDownViewport:new(0,t.constructor)({longitude:t.longitude,latitude:t.latitude,height:i,width:t.width,bearing:t.bearing,zoom:t.zoom,pitch:0}),height:i,cullingVolume:Dr,frameNumber:e,sseDenominator:1.15}}function Or(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new pt.Z,r=t.normal.dot(e);return n.copy(t.normal).scale(t.distance-r).add(e),n}function Fr(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new pt.Z,r=t.unprojectPosition(e);return wr.WGS84.cartographicToCartesian(r,n)}var Rr=6356752.314245179,zr=new pt.Z;function Ur(t,e){if(t instanceof qt){var n=function(t){t.getColumn(0,zr);var e=t.getColumn(1),n=t.getColumn(2);return zr.add(e).add(n).len()}(t.halfAxes);return Math.log2(Rr/(n+e[2]))}if(t instanceof _t){var r=t.radius;return Math.log2(Rr/(r+e[2]))}if(t.width&&t.height){var i=t.width,o=t.height;return(Math.log2(6378137/i)+Math.log2(6378137/o))/2}return 1}function Nr(t,e,n){var r=wr.WGS84.cartographicToCartesian([t.xmax,t.ymax,t.zmax],new pt.Z),i=Math.sqrt(Math.pow(r[0]-n[0],2)+Math.pow(r[1]-n[1],2)+Math.pow(r[2]-n[2],2));return Math.log2(Rr/(i+e[2]))}var Gr=0,jr=1,Vr=3,Hr=4,Jr=5,Wr={ADD:1,REPLACE:2},Qr={EMPTY:"empty",SCENEGRAPH:"scenegraph",POINTCLOUD:"pointcloud",MESH:"mesh"},qr={I3S:"I3S",TILES3D:"TILES3D"},Kr={GEOMETRIC_ERROR:"geometricError",MAX_SCREEN_THRESHOLD:"maxScreenThreshold"},Xr=1;function Yr(t){return void 0!==t&&null!==t}var $r=new pt.Z,ti=new pt.Z,ei=new pt.Z;function ni(t,e,n){if(Cr(t,"3D Tile: boundingVolume must be defined"),t.box)return function(t,e,n){var r=new pt.Z(t[0],t[1],t[2]);e.transform(r,r);var i=[];if(10===t.length){var o=t.slice(3,6),a=new Pt.Z;a.fromArray(t,6);var s=new pt.Z([1,0,0]),u=new pt.Z([0,1,0]),l=new pt.Z([0,0,1]);s.transformByQuaternion(a),s.scale(o[0]),u.transformByQuaternion(a),u.scale(o[1]),l.transformByQuaternion(a),l.scale(o[2]),i=[].concat((0,Q.Z)(s.toArray()),(0,Q.Z)(u.toArray()),(0,Q.Z)(l.toArray()))}else i=[].concat((0,Q.Z)(t.slice(3,6)),(0,Q.Z)(t.slice(6,9)),(0,Q.Z)(t.slice(9,12)));var c=e.transformAsVector(i.slice(0,3)),h=e.transformAsVector(i.slice(3,6)),f=e.transformAsVector(i.slice(6,9)),p=new Tt([c[0],c[
21],c[2],h[0],h[1],h[2],f[0],f[1],f[2]]);if(Yr(n))return n.center=r,n.halfAxes=p,n;return new qt(r,p)}(t.box,e,n);if(t.region){var r=(0,b.Z)(t.region,6),i=r[0],o=r[1],a=r[2],s=r[3],u=r[4],l=r[5],c=wr.WGS84.cartographicToCartesian([(0,Xt.RW)(i),(0,Xt.RW)(s),u],ti),h=wr.WGS84.cartographicToCartesian([(0,Xt.RW)(a),(0,Xt.RW)(o),l],ei),f=(new pt.Z).addVectors(c,h).multiplyScalar(.5),p=(new pt.Z).subVectors(c,h).len()/2;return ri([f[0],f[1],f[2],p],new K.Z)}if(t.sphere)return ri(t.sphere,e,n);throw new Error("3D Tile: boundingVolume must contain a sphere, region, or box")}function ri(t,e,n){var r=new pt.Z(t[0],t[1],t[2]);e.transform(r,r);var i=e.getScale($r),o=Math.max(Math.max(i[0],i[1]),i[2]),a=t[3]*o;return Yr(n)?(n.center=r,n.radius=a,n):new _t(r,a)}new pt.Z,new pt.Z,new K.Z,new pt.Z,new pt.Z,new pt.Z;function ii(t,e){if(t.dynamicScreenSpaceError&&t.dynamicScreenSpaceErrorComputedDensity){var n=t.dynamicScreenSpaceErrorComputedDensity,r=t.dynamicScreenSpaceErrorFactor,i=function(t,e){var n=t*e;return 1-Math.exp(-n*n)}(e,n)*r;return i}return 0}var oi=new pt.Z,ai=new pt.Z,si=new pt.Z,ui=new pt.Z,li=new pt.Z,ci=new K.Z,hi=new K.Z;function fi(t,e){var n=e.topDownViewport,r=t.header.mbs[1],i=t.header.mbs[0],o=t.header.mbs[2],a=t.header.mbs[3],s=(0,Q.Z)(t.boundingVolume.center),u=n.unprojectPosition(n.cameraPosition);wr.WGS84.cartographicToCartesian(u,oi),ai.copy(oi).subtract(s).normalize(),wr.WGS84.eastNorthUpToFixedFrame(s,ci),hi.copy(ci).invert(),si.copy(oi).transform(hi);var l=Math.sqrt(si[0]*si[0]+si[1]*si[1]),c=l*l/si[2];ui.copy([si[0],si[1],c]);var h=ui.transform(ci).subtract(s).normalize(),f=ai.cross(h).normalize().scale(a).add(s),p=wr.WGS84.cartesianToCartographic(f),d=n.project([i,r,o]),A=n.project(p);return li.copy(d).subtract(A).magnitude()}var pi=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;(0,h.Z)(this,t),(0,d.Z)(this,"_map",new Map),(0,d.Z)(this,"_array",void 0),(0,d.Z)(this,"_length",void 0),this._array=new Array(e),this._length=e}return(0,c.Z)(t,[{key:"length",get:function(){return this._length},set:function(t){this._length=t,t>this._array.length&&(this._array.length=t)}},{key:"values",get:function(){return this._array}},{key:"get",value:function(t){return Cr(t<this._array.length),this._array[t]}},{key:"set",value:function(t,e){Cr(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)}},{key:"delete",value:function(t){var e=this._map.get(t);e>=0&&(this._array.splice(e,1),this._map.delete(t),this.length--)}},{key:"peek",value:function(){return this._array[this._length-1]}},{key:"push",value:function(t){if(!this._map.has(t)){var e=this.length++;this._array[e]=t,this._map.set(t,e)}}},{key:"pop",value:function(){var t=this._array[--this.length];return this._map.delete(t),t}},{key:"reserve",value:function(t){Cr(t>=0),t>this._array.length&&(this._array.length=t)}},{key:"resize",value:function(t){Cr(t>=0),this.length=t}},{key:"trim",value:function(t){null!==t&&void 0!==t||(t=this.length),this._array.length=t}},{key:"reset",value:function(){this._array=[],this._map=new Map,this._length=0}},{key:"find",value:function(t){return this._map.has(t)}}]),t}(),di={loadSiblings:!1,skipLevelOfDetail:!1,maximumScreenSpaceError:2,updateTransforms:!0,onTraversalEnd:function(){},viewportTraversersMap:{},basePath:""},Ai=function(){function t(e){(0,h.Z)(this,t),(0,d.Z)(this,"options",void 0),(0,d.Z)(this,"root",void 0),(0,d.Z)(this,"requestedTiles",void 0),(0,d.Z)(this,"selectedTiles",void 0),(0,d.Z)(this,"emptyTiles",void 0),(0,d.Z)(this,"lastUpdate",(new Date).getTime()),(0,d.Z)(this,"updateDebounceTime",1e3),(0,d.Z)(this,"_traversalStack",void 0),(0,d.Z)(this,"_emptyTraversalStack",void 0),(0,d.Z)(this,"_frameNumber",void 0),this.options=(0,v.Z)((0,v.Z)({},di),e),this._traversalStack=new pi,this._emptyTraversalStack=new pi,this._frameNumber=null,this.root=null,this.selectedTiles={},this.requestedTiles={},this.emptyTiles={}}return(0,c.Z)(t,[{key:"traversalFinished",value:function(t){return!0}},{key:"traverse",value:function(t,e,n){this.root=t,this.options=(0,v.Z)((0,v.Z)({},this.options),n),this.reset(),this.updateTile(t,e),this._frameNumber=e.frameNumber,this.executeTraversal(t,e)}},{key:"reset",value:function(){this.requestedTiles={},this.selectedTiles={},this.emptyTiles={},this._traversalStack.reset(),this._emptyTraversalStack.reset()}},{key:"executeTraversal",value:function(t,e){var n=this._traversalStack;for(t._selectionDepth=1,n.push(t);n.length>0;){var r=n.pop(),i=!1;this.canTraverse(r,e)&&(this.updateChildTiles(r,e),i=this.updateAndPushChildren(r,e,n,r.hasRenderContent?r._selectionDepth+1:r._selectionDepth));var o=r.parent,a=Boolean(!o||o._shouldRefine),s=!i;r.hasRenderContent?r.refine===Wr.ADD?(this.loadTile(r,e),this.selectTile(r,e)):r.refine===Wr.REPLACE&&(this.loadTile(r,e),s&&this.selectTile(r,e)):(this.emptyTiles[r.id]=r,this.loadTile(r,e),s&&this.selectTile(r,e)),this.touchTile(r,e),r._shouldRefine=i&&a}var u=(new Date).getTime();(this.traversalFinished(e)||u-this.lastUpdate>this.updateDebounceTime)&&(this.lastUpdate=u,this.options.onTraversalEnd(e))}},{key:"updateChildTiles",value:function(t,e){var n,r=t.children,i=(0,j.Z)(r);try{for(i.s();!(n=i.n()).done;){var o=n.value;this.updateTile(o,e)}}catch(a){i.e(a)}finally{i.f()}return!0}},{key:"updateAndPushChildren",value:function(t,e,n,r){var i=this.options,o=i.loadSiblings,a=i.skipLevelOfDetail,s=t.children;s.sort(this.compareDistanceToCamera.bind(this));var u,l=t.refine===Wr.REPLACE&&t.hasRenderContent&&!a,c=!1,h=!0,f=(0,j.Z)(s);try{for(f.s();!(u=f.n()).done;){var p=u.value;if(p._selectionDepth=r,p.isVisibleAndInRequestVolume?(n.find(p)&&n.delete(p),n.push(p),c=!0):(l||o)&&(this.loadTile(p,e),this.touchTile(p,e)),l){var d=void 0;if(d=!!p._inRequestVolume&&(p.hasRenderContent?p.contentAvailable:this.executeEmptyTraversal(p,e)),!(h=h&&d))return!1}}}catch(A){f.e(A)}finally{f.f()}return c||(h=!1),h}},{key:"updateTile",value:function(t,e){this.updateTileVisibility(t,e)}},{key:"selectTile",value:function(t,e){this.shouldSelectTile(t)&&(t._selectedFrame=e.frameNumber,this.selectedTiles[t.id]=t)}},{key:"loadTile",value:function(t,e){this.shouldLoadTile(t)&&(t._requestedFrame=e.frameNumber,t._priority=t._getPri
2ority(),this.requestedTiles[t.id]=t)}},{key:"touchTile",value:function(t,e){t.tileset._cache.touch(t),t._touchedFrame=e.frameNumber}},{key:"canTraverse",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return!!t.hasChildren&&(t.hasTilesetContent?!t.contentExpired:!(!r&&!t.isVisibleAndInRequestVolume)&&this.shouldRefine(t,e,n))}},{key:"shouldLoadTile",value:function(t){return t.hasUnloadedContent||t.contentExpired}},{key:"shouldSelectTile",value:function(t){return t.contentAvailable&&!this.options.skipLevelOfDetail}},{key:"shouldRefine",value:function(t,e,n){var r=t._screenSpaceError;return n&&(r=t.getScreenSpaceError(e,!0)),r>this.options.maximumScreenSpaceError}},{key:"updateTileVisibility",value:function(t,e){var n=[];if(this.options.viewportTraversersMap)for(var r in this.options.viewportTraversersMap){this.options.viewportTraversersMap[r]===e.viewport.id&&n.push(r)}else n.push(e.viewport.id);t.updateVisibility(e,n)}},{key:"compareDistanceToCamera",value:function(t,e){return t._distanceToCamera-e._distanceToCamera}},{key:"anyChildrenVisible",value:function(t,e){var n,r=!1,i=(0,j.Z)(t.children);try{for(i.s();!(n=i.n()).done;){var o=n.value;o.updateVisibility(e),r=r||o.isVisibleAndInRequestVolume}}catch(a){i.e(a)}finally{i.f()}return r}},{key:"executeEmptyTraversal",value:function(t,e){var n=!0,r=this._emptyTraversalStack;for(r.push(t);r.length>0&&n;){var i=r.pop();if(this.updateTile(i,e),i.isVisibleAndInRequestVolume||this.loadTile(i,e),this.touchTile(i,e),!i.hasRenderContent&&this.canTraverse(i,e,!1,!0)){var o,a=i.children,s=(0,j.Z)(a);try{for(s.s();!(o=s.n()).done;){var u=o.value;r.find(u)&&r.delete(u),r.push(u)}}catch(l){s.e(l)}finally{s.f()}}else i.contentAvailable||(n=!1)}return n}}]),t}(),vi=new pt.Z;var gi=function(){function t(e,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";(0,h.Z)(this,t),(0,d.Z)(this,"tileset",void 0),(0,d.Z)(this,"header",void 0),(0,d.Z)(this,"id",void 0),(0,d.Z)(this,"url",void 0),(0,d.Z)(this,"parent",void 0),(0,d.Z)(this,"refine",void 0),(0,d.Z)(this,"type",void 0),(0,d.Z)(this,"contentUrl",void 0),(0,d.Z)(this,"lodMetricType",void 0),(0,d.Z)(this,"lodMetricValue",void 0),(0,d.Z)(this,"boundingVolume",void 0),(0,d.Z)(this,"content",void 0),(0,d.Z)(this,"contentState",void 0),(0,d.Z)(this,"gpuMemoryUsageInBytes",void 0),(0,d.Z)(this,"children",void 0),(0,d.Z)(this,"depth",void 0),(0,d.Z)(this,"viewportIds",void 0),(0,d.Z)(this,"transform",void 0),(0,d.Z)(this,"extensions",void 0),(0,d.Z)(this,"userData",void 0),(0,d.Z)(this,"computedTransform",void 0),(0,d.Z)(this,"hasEmptyContent",void 0),(0,d.Z)(this,"hasTilesetContent",void 0),(0,d.Z)(this,"traverser",void 0),(0,d.Z)(this,"_cacheNode",void 0),(0,d.Z)(this,"_frameNumber",void 0),(0,d.Z)(this,"_lodJudge",void 0),(0,d.Z)(this,"_expireDate",void 0),(0,d.Z)(this,"_expiredContent",void 0),(0,d.Z)(this,"_shouldRefine",void 0),(0,d.Z)(this,"_distanceToCamera",void 0),(0,d.Z)(this,"_centerZDepth",void 0),(0,d.Z)(this,"_screenSpaceError",void 0),(0,d.Z)(this,"_visibilityPlaneMask",void 0),(0,d.Z)(this,"_visible",void 0),(0,d.Z)(this,"_inRequestVolume",void 0),(0,d.Z)(this,"_stackLength",void 0),(0,d.Z)(this,"_selectionDepth",void 0),(0,d.Z)(this,"_touchedFrame",void 0),(0,d.Z)(this,"_visitedFrame",void 0),(0,d.Z)(this,"_selectedFrame",void 0),(0,d.Z)(this,"_requestedFrame",void 0),(0,d.Z)(this,"_priority",void 0),(0,d.Z)(this,"_contentBoundingVolume",void 0),(0,d.Z)(this,"_viewerRequestVolume",void 0),(0,d.Z)(this,"_initialTransform",void 0),this.header=n,this.tileset=e,this.id=i||n.id,this.url=n.url,this.parent=r,this.refine=this._getRefine(n.refine),this.type=n.type,this.contentUrl=n.contentUrl,this.lodMetricType="geometricError",this.lodMetricValue=0,this.boundingVolume=null,this.content=null,this.contentState=Gr,this.gpuMemoryUsageInBytes=0,this.children=[],this.hasEmptyContent=!1,this.hasTilesetContent=!1,this.depth=0,this.viewportIds=[],this.userData={},this.extensions=null,this._priority=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._requestedFrame=0,this._screenSpaceError=0,this._cacheNode=null,this._frameNumber=null,this._cacheNode=null,this.traverser=new Ai({}),this._shouldRefine=!1,this._distanceToCamera=0,this._centerZDepth=0,this._visible=void 0,this._inRequestVolume=!1,this._stackLength=0,this._selectionDepth=0,this._initialTransform=new K.Z,this.transform=new K.Z,this._initializeLodMetric(n),this._initializeTransforms(n),this._initializeBoundingVolumes(n),this._initializeContent(n),this._initializeRenderingState(n),this._lodJudge=null,this._expireDate=null,this._expiredContent=null,Object.seal(this)}return(0,c.Z)(t,[{key:"destroy",value:function(){this.header=null}},{key:"isDestroyed",value:function(){return null===this.header}},{key:"selected",get:function(){return this._selectedFrame===this.tileset._frameNumber}},{key:"isVisible",get:function(){return this._visible}},{key:"isVisibleAndInRequestVolume",get:function(){return this._visible&&this._inRequestVolume}},{key:"hasRenderContent",get:function(){return!this.hasEmptyContent&&!this.hasTilesetContent}},{key:"hasChildren",get:function(){return this.children.length>0||this.header.children&&this.header.children.length>0}},{key:"contentReady",get:function(){return this.contentState===Vr||this.hasEmptyContent}},{key:"contentAvailable",get:function(){return Boolean(this.contentReady&&this.hasRenderContent||this._expiredContent&&!this.contentFailed)}},{key:"hasUnloadedContent",get:function(){return this.hasRenderContent&&this.contentUnloaded}},{key:"contentUnloaded",get:function(){return this.contentState===Gr}},{key:"contentExpired",get:function(){return this.contentState===Hr}},{key:"contentFailed",get:function(){return this.contentState===Jr}},{key:"getScreenSpaceError",value:function(t,e){switch(this.tileset.type){case qr.I3S:return fi(this,t);case qr.TILES3D:return function(t,e,n){var r=t.tileset,i=t.parent&&t.parent.lodMetricValue||t.lodMetricValue,o=n?i:t.lodMetricValue;if(0===o)return 0;var a=Math.max(t._distanceToCamera,1e-7),s=e.height,u=e.sseDenominator,l=o*s*(r.options.viewDistanceScale||1)/(a*u);return l-ii(r,a)}(this,t,e);default:throw new Error("Unsupported tileset type")}}},{key:"unselect",value:function(){this._selectedFrame=0}},{key:"_getPriority",value:function(){var t=this.tileset._traverser,e=t.options.skipLevelOfDetail,n=this.refine===Wr.ADD||e;if(n&&!this.isVisible&&void 0!==this._visible)return-1;if(this.tileset._frameNumber-this._touchedFrame>=1)return-1;if(this.contentState===Gr)return-1;var r=this.parent,i=r&&(!n||0===this._screenSpaceError||r.hasTilesetContent)?r._screenSpaceError:this._screenSpaceError,o=t.root?t.root._screenSpaceError:0;return Math.max(o-i,0)}},{key:"loadContent",value:function(){var t=(0,H.Z)((0,V.Z)().mark((function t(){var e,n,r,i;return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.hasEmptyContent){t.next=2;break}return t.abrupt("return",!1);case 2:if(!this.content){t.next=4;break}return t.abrupt("return",!0);case 4:return this.contentExpired&&(this._expireDate=null),this.contentState=jr,t.next=9,this.tileset._requestScheduler.scheduleRequest(this.id,this._getPriority.bind(this));case 9:if(e=t.sent){t.next=13;break}return this.contentState=Gr,t.abrupt("return",!1);case 13:return t.prev=13,n=this.tileset.getTileUrl(this.contentUrl),r=this.tileset.loader,i=(0,v.Z)((0,v.Z)({},this.tileset.loadOptions),{},(0,d.Z)({},r.id,(0,v.Z)((0,v.Z)({},this.tileset.loadOptions[r.id]),{},{isTileset:"json"===this.type},this._getLoaderSpecificOptions(r.id)))),t.next=19,(0,$n.z)(n,r,i);case 19:if(this.content=t.sent,!this.tileset.options.contentLoader){t.next=23;break}return t.next=23,this.tileset.options.contentLoader(this);case 23:return this._isTileset()&&this.tileset._initializeTileHeaders(this.content,this),this.contentState=Vr,this._onContentLoaded(),t.abrupt("return",!0);case 29:throw t.prev=29,t.t0=t.catch(13),this.contentState=Jr,t.t0;case 33:return t.prev=33,e.done(),t.finish(33);case 36:case"end":return t.stop()}}),t,this,[[13,29,33,36]])})));return function(){return t.apply(this,arguments)}}()},{key:"unloadContent",value:function(){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=Gr,!0}},{key:"updateVisibility",value:function(t,e){if(this._frameNumber!==t.frameNumber){var n=this.parent,r=n?n._visibilityPlaneMask:ie.MASK_INDETERMINATE;if(this.tileset._traverser.options.updateTransforms){var i=n?n.computedTransform:this.tileset.modelMatrix;this._updateTransform(i)}this._distanceToCamera=this.distanceToTile(t),this._screenSpaceError=this.getScreenSpaceError(t,!1),this._visibilityPlaneMask=this.visibility(t,r),this._visible=this._visibilityPlaneMask!==ie.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(t),this._frameNumber=t.frameNumber,this.viewportIds=e}}},{key:"visibility",value:function(t,e){var n=t.cullingVolume,r=this.boundingVolume;return n.computeVisibilityWithPlaneMask(r,e)}},{key:"contentVisibility",value:function(){return!0}},{key:"distanceToTile",value:function(t){var e=this.boundingVolume;return Math.sqrt(Math.max(e.distanceSquaredTo(t.camera.position),0))}},{key:"cameraSpaceZDepth",value:function(t){var e=t.camera,n=this.boundingVolume;return vi.subVectors(n.center,e.position),e.direction.dot(vi)}},{key:"insideViewerRequestVolume",value:function(t){var e=this._viewerRequestVolume;return!e||e.distanceSquaredTo(t.camera.position)<=0}},{key:"updateExpiration",value:function(){if(function(t){return void 0!==t&&null!==t}(this._expireDate)&&this.contentReady&&!this.hasEmptyContent){var t=Date.now();Date.lessThan(this._expireDate,t)&&(this.contentState=Hr,this._expiredContent=this.content)}}},{key:"extras",get:function(){return this.header.extras}},{key:"_initializeLodMetric",value:function(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"))}},{key:"_initializeTransforms",value:function(t){this.transform=t.transform?new K.Z(t.transform):new K.Z;var e=this.parent,n=this.tileset,r=e&&e.computedTransform?e.computedTransform.clone():n.modelMatrix.clone();this.computedTransform=new K.Z(r).multiplyRight(this.transform);var i=e&&e._initialTransform?e._initialTransform.clone():new K.Z;this._initialTransform=new K.Z(i).multiplyRight(this.transform)}},{key:"_initializeBoundingVolumes",value:function(t){this._contentBoundingVolume=null,this._viewerRequestVolume=null,this._updateBoundingVolume(t)}},{key:"_initializeContent",value:function(t){this.content={_tileset:this.tileset,_tile:this},this.hasEmptyContent=!0,this.contentState=Gr,this.hasTilesetContent=!1,t.contentUrl&&(this.content=null,this.hasEmptyContent=!1)}},{key:"_initializeRenderingState",value:function(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=ie.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}},{key:"_getRefine",value:function(t){return t||this.parent&&this.parent.refine||Wr.REPLACE}},{key:"_isTileset",value:function(){return-1!==this.contentUrl.indexOf(".json")}},{key:"_onContentLoaded",value:function(){switch(this.content&&this.content.type){case"vctr":case"geom":this.tileset._traverser.disableSkipLevelOfDetail=!0}this._isTileset()&&(this.hasTilesetContent=!0)}},{key:"_updateBoundingVolume",value:function(t){this.boundingVolume=ni(t.boundingVolume,this.computedTransform,this.boundingVolume);var e=t.content;e&&(e.boundingVolume&&(this._contentBoundingVolume=ni(e.boundingVolume,this.computedTransform,this._contentBoundingVolume)),t.viewerRequestVolume&&(this._viewerRequestVolume=ni(t.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)))}},{key:"_updateTransform",value:function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:new K.Z).clone().multiplyRight(this.transform);!t.equals(this.computedTransform)&&(this.computedTransform=t,this._updateBoundingVolume(this.header))}},{key:"_getLoaderSpecificOptions",value:function(t){return"i3s"===t?(0,v.Z)((0,v.Z)({},this.tileset.options.i3s),{},{tile:this.header,tileset:this.tileset.tileset,isTileHeader:!1}):{assetGltfUpAxis:(e=this.tileset.tileset).asset&&e.asset.gltfUpAxis||"Y"};var e}}]),t}(),mi=function(t){(0,f.Z)(n,t);var e=(0,p.Z)(n);function n(){return(0,h.Z)(this,n),e.apply(this,arguments)}
2return(0,c.Z)(n,[{key:"compareDistanceToCamera",value:function(t,e){return 0===e._distanceToCamera&&0===t._distanceToCamera?e._centerZDepth-t._centerZDepth:e._distanceToCamera-t._distanceToCamera}},{key:"updateTileVisibility",value:function(t,e){if((0,tn.Z)((0,en.Z)(n.prototype),"updateTileVisibility",this).call(this,t,e),t.isVisibleAndInRequestVolume){var r=t.children.length>0;if(t.hasTilesetContent&&r){var i=t.children[0];return this.updateTileVisibility(i,e),void(t._visible=i._visible)}if(this.meetsScreenSpaceErrorEarly(t,e))t._visible=!1;else{var o=t.refine===Wr.REPLACE,a=t._optimChildrenWithinParent===Xr;o&&a&&r&&!this.anyChildrenVisible(t,e)&&(t._visible=!1)}}}},{key:"meetsScreenSpaceErrorEarly",value:function(t,e){var n=t.parent;return!(!n||n.hasTilesetContent||n.refine!==Wr.ADD)&&!this.shouldRefine(t,e,!0)}}]),n}(Ai),yi=function(){function t(){(0,h.Z)(this,t),(0,d.Z)(this,"frameNumberMap",new Map)}return(0,c.Z)(t,[{key:"register",value:function(t,e){var n=this.frameNumberMap.get(t)||new Map,r=n.get(e)||0;n.set(e,r+1),this.frameNumberMap.set(t,n)}},{key:"deregister",value:function(t,e){var n=this.frameNumberMap.get(t);if(n){var r=n.get(e)||1;n.set(e,r-1)}}},{key:"isZero",value:function(t,e){var n;return 0===((null===(n=this.frameNumberMap.get(t))||void 0===n?void 0:n.get(e))||0)}}]),t}(),_i="REQUESTED",bi="COMPLETED",xi="ERROR",wi=function(){function t(){(0,h.Z)(this,t),(0,d.Z)(this,"_statusMap",void 0),(0,d.Z)(this,"pendingTilesRegister",new yi),this._statusMap={}}return(0,c.Z)(t,[{key:"add",value:function(t,e,n,r){var i=this;if(!this._statusMap[e]){var o=r.frameNumber,a=r.viewport.id;this._statusMap[e]={request:t,callback:n,key:e,frameState:r,status:_i},this.pendingTilesRegister.register(a,o),t().then((function(t){i._statusMap[e].status=bi;var n=i._statusMap[e].frameState,o=n.frameNumber,a=n.viewport.id;i.pendingTilesRegister.deregister(a,o),i._statusMap[e].callback(t,r)})).catch((function(t){i._statusMap[e].status=xi;var r=i._statusMap[e].frameState,o=r.frameNumber,a=r.viewport.id;i.pendingTilesRegister.deregister(a,o),n(t)}))}}},{key:"update",value:function(t,e){if(this._statusMap[t]){var n=this._statusMap[t].frameState,r=n.frameNumber,i=n.viewport.id;this.pendingTilesRegister.deregister(i,r);var o=e.frameNumber,a=e.viewport.id;this.pendingTilesRegister.register(a,o),this._statusMap[t].frameState=e}}},{key:"find",value:function(t){return this._statusMap[t]}},{key:"hasPendingTiles",value:function(t,e){return!this.pendingTilesRegister.isZero(t,e)}}]),t}(),Ci=function(t){(0,f.Z)(n,t);var e=(0,p.Z)(n);function n(t){var r;return(0,h.Z)(this,n),r=e.call(this,t),(0,d.Z)((0,q.Z)(r),"_tileManager",void 0),r._tileManager=new wi,r}return(0,c.Z)(n,[{key:"traversalFinished",value:function(t){return!this._tileManager.hasPendingTiles(t.viewport.id,this._frameNumber||0)}},{key:"shouldRefine",value:function(t,e){return t._lodJudge=function(t,e){if(0===t.lodMetricValue||isNaN(t.lodMetricValue))return"DIG";var n=2*fi(t,e);return n<2?"OUT":!t.header.children||n<=t.lodMetricValue?"DRAW":t.header.children?"DIG":"OUT"}(t,e),"DIG"===t._lodJudge}},{key:"updateChildTiles",value:function(t,e){var n,r=this,i=t.header.children||[],o=t.children,a=t.tileset,s=(0,j.Z)(i);try{var u=function(){var i=n.value,s="".concat(i.id,"-").concat(e.viewport.id),u=o&&o.find((function(t){return t.id===s}));if(u)u&&r.updateTile(u,e);else{var l=function(){return r._loadTile(i.id,a)};r._tileManager.find(s)?r._tileManager.update(s,e):(a.tileset.nodePages&&(l=function(){return a.tileset.nodePagesTile.formTileFromNodePages(i.id)}),r._tileManager.add(l,s,(function(e){return r._onTileLoad(e,t,s)}),e))}};for(s.s();!(n=s.n()).done;)u()}catch(l){s.e(l)}finally{s.f()}return!1}},{key:"_loadTile",value:function(){var t=(0,H.Z)((0,V.Z)().mark((function t(e,n){var r,i,o;return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=n.loader,i=n.getTileUrl("".concat(n.url,"/nodes/").concat(e)),o=(0,v.Z)((0,v.Z)({},n.loadOptions),{},{i3s:(0,v.Z)((0,v.Z)({},n.loadOptions.i3s),{},{isTileHeader:!0,loadContent:!1})}),t.next=5,(0,$n.z)(i,r,o);case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}()},{key:"_onTileLoad",value:function(t,e,n){var r=new gi(e.tileset,t,e,n);e.children.push(r);
2var i=this._tileManager.find(r.id).frameState;this.updateTile(r,i),this._frameNumber===i.frameNumber&&(this.traversalFinished(i)||(new Date).getTime()-this.lastUpdate>this.updateDebounceTime)&&this.executeTraversal(r,i)}}]),n}(Ai),Bi={description:"",ellipsoid:wr.WGS84,modelMatrix:new K.Z,throttleRequests:!0,maxRequests:64,maximumMemoryUsage:32,maximumTilesSelected:0,debounceTime:0,onTileLoad:function(){},onTileUnload:function(){},onTileError:function(){},onTraversalComplete:function(t){return t},contentLoader:void 0,viewDistanceScale:1,maximumScreenSpaceError:8,loadTiles:!0,updateTransforms:!0,viewportTraversersMap:null,loadOptions:{fetch:{}},attributions:[],basePath:"",i3s:{}},ki="Tiles In Tileset(s)",Ei="Tiles In Memory",Si="Tiles In View",Ti="Tiles To Render",Mi="Tiles Loaded",Ii="Tiles Loading",Pi="Tiles Unloaded",Zi="Failed Tile Loads",Di="Points/Vertices",Li="Tile Memory Use",Oi=function(){function t(e,n){(0,h.Z)(this,t),(0,d.Z)(this,"options",void 0),(0,d.Z)(this,"loadOptions",void 0),(0,d.Z)(this,"type",void 0),(0,d.Z)(this,"tileset",void 0),(0,d.Z)(this,"loader",void 0),(0,d.Z)(this,"url",void 0),(0,d.Z)(this,"basePath",void 0),(0,d.Z)(this,"modelMatrix",void 0),(0,d.Z)(this,"ellipsoid",void 0),(0,d.Z)(this,"lodMetricType",void 0),(0,d.Z)(this,"lodMetricValue",void 0),(0,d.Z)(this,"refine",void 0),(0,d.Z)(this,"root",void 0),(0,d.Z)(this,"roots",void 0),(0,d.Z)(this,"asset",void 0),(0,d.Z)(this,"description",void 0),(0,d.Z)(this,"properties",void 0),(0,d.Z)(this,"extras",void 0),(0,d.Z)(this,"attributions",void 0),(0,d.Z)(this,"credits",void 0),(0,d.Z)(this,"stats",void 0),(0,d.Z)(this,"traverseCounter",void 0),(0,d.Z)(this,"geometricError",void 0),(0,d.Z)(this,"selectedTiles",void 0),(0,d.Z)(this,"updatePromise",null),(0,d.Z)(this,"tilesetInitializationPromise",void 0),(0,d.Z)(this,"cartographicCenter",void 0),(0,d.Z)(this,"cartesianCenter",void 0),(0,d.Z)(this,"zoom",void 0),(0,d.Z)(this,"boundingVolume",void 0),(0,d.Z)(this,"gpuMemoryUsageInBytes",void 0),(0,d.Z)(this,"dynamicScreenSpaceErrorComputedDensity",void 0),(0,d.Z)(this,"_traverser",void 0),(0,d.Z)(this,"_cache",void 0),(0,d.Z)(this,"_requestScheduler",void 0),(0,d.Z)(this,"_frameNumber",void 0),(0,d.Z)(this,"_queryParamsString",void 0),(0,d.Z)(this,"_queryParams",void 0),(0,d.Z)(this,"_extensionsUsed",void 0),(0,d.Z)(this,"_tiles",void 0),(0,d.Z)(this,"_pendingCount",void 0),(0,d.Z)(this,"lastUpdatedVieports",void 0),(0,d.Z)(this,"_requestedTiles",void 0),(0,d.Z)(this,"_emptyTiles",void 0),(0,d.Z)(this,"frameStateData",void 0),(0,d.Z)(this,"maximumMemoryUsage",void 0),Cr(e),this.options=(0,v.Z)((0,v.Z)({},Bi),n),this.tileset=e,this.loader=e.loader,this.type=e.type,this.url=e.url,this.basePath=e.basePath||Br(this.url),this.modelMatrix=this.options.modelMatrix,this.ellipsoid=this.options.ellipsoid,this.lodMetricType=e.lodMetricType,this.lodMetricValue=e.lodMetricValue,this.refine=e.root.refine,this.loadOptions=this.options.loadOptions||{},this.root=null,this.roots={},this.cartographicCenter=null,this.cartesianCenter=null,this.zoom=1,this.boundingVolume=null,this.traverseCounter=0,this.geometricError=0,this._traverser=this._initializeTraverser(),this._cache=new Ir,this._requestScheduler=new Er({throttleRequests:this.options.throttleRequests,maxRequests:this.options.maxRequests}),this._frameNumber=0,this._pendingCount=0,this._tiles={},this.selectedTiles=[],this._emptyTiles=[],this._requestedTiles=[],this.frameStateData={},this.lastUpdatedVieports=null,this._queryParams={},this._queryParamsString="",this.maximumMemoryUsage=this.options.maximumMemoryUsage||32,this.gpuMemoryUsageInBytes=0,this.stats=new Ge.Z({id:this.url}),this._initializeStats(),this._extensionsUsed=void 0,this.dynamicScreenSpaceErrorComputedDensity=0,this.extras=null,this.asset={},this.credits={},this.description=this.options.description||"",this.tilesetInitializationPromise=this._initializeTileSet(e)}return(0,c.Z)(t,[{key:"destroy",value:function(){this._destroy()}},{key:"isLoaded",value:function(){return 0===this._pendingCount&&0!==this._frameNumber&&0===this._requestedTiles.length}},{key:"tiles",get:function(){return Object.values(this._tiles)}},{key:"frameNumber",get:function(){return this._frameNumber}},{key:"queryParams",get:function(){return this._queryParamsString||(this._queryParamsString=function(t){for(var e=[],n=0,r=Object.keys(t);n<r.length;n++){var i=r[n];e.push("".concat(i,"=").concat(t[i]))}switch(e.length){case 0:return"";case 1:return"?".concat(e[0]);default:return"?".concat(e.join("&"))}}(this._queryParams)),this._queryParamsString}},{key:"setProps",value:function(t){this.options=(0,v.Z)((0,v.Z)({},this.options),t)}},{key:"setOptions",value:function(t){this.options=(0,v.Z)((0,v.Z)({},this.options),t)}},{key:"getTileUrl",value:function(t){return t.startsWith("data:")?t:"".concat(t).concat(this.queryParams)}},{key:"hasExtension",value:function(t){return Boolean(this._extensionsUsed&&this._extensionsUsed.indexOf(t)>-1)}},{key:"update",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.tilesetInitializationPromise.then((function(){!e&&t.lastUpdatedVieports?e=t.lastUpdatedVieports:t.lastUpdatedVieports=e,e&&t.doUpdate(e)}))}},{key:"selectTiles",value:function(){var t=(0,H.Z)((0,V.Z)().mark((function t(){var e,n=this,r=arguments;return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:null,t.next=3,this.tilesetInitializationPromise;case 3:return e&&(this.lastUpdatedVieports=e),this.updatePromise||(this.updatePromise=new Promise((function(t){setTimeout((function(){n.lastUpdatedVieports&&n.doUpdate(n.lastUpdatedVieports),t(n._frameNumber),n.updatePromise=null}),n.options.debounceTime)}))),t.abrupt("return",this.updatePromise);case 6:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"doUpdate",value:function(t){if((!("loadTiles"in this.options)||this.options.loadTiles)&&!(this.traverseCounter>0)){var e=t instanceof Array?t:[t];this._cache.reset(),this._frameNumber++,this.traverseCounter=e.length;var n,r=[],i=(0,j.Z)(e);try{for(i.s();!(n=i.n()).done;){var o=n.value.id;this._needTraverse(o)?r.push(o):this.traverseCounter--}}catch(h){i.e(h)}finally{i.f()}var a,s=(0,j.Z)(e);try{for(s.s();!(a=s.n()).done;){var u=a.value,l=u.id;if(this.roots[l]||(this.roots[l]=this._initializeTileHeaders(this.tileset,null)),r.includes(l)){var c=Lr(u,this._frameNumber);this._traverser.traverse(this.roots[l],c,this.options)}}}catch(h){s.e(h)}finally{s.f()}}}},{key:"_needTraverse",value:function(t){var e=t;return this.options.viewportTraversersMap&&(e=this.options.viewportTraversersMap[t]),e===t}},{key:"_onTraversalEnd",value:function(t){var e=t.viewport.id;this.frameStateData[e]||(this.frameStateData[e]={selectedTiles:[],_requestedTiles:[],_emptyTiles:[]});var n=this.frameStateData[e],r=function(t,e,n){if(0===n||t.length<=n)return[t,[]];var r,i=[],o=e.viewport,a=o.longitude,s=o.latitude,u=(0,j.Z)(t.entries());try{for(u.s();!(r=u.n()).done;){var l=(0,b.Z)(r.value,2),c=l[0],h=l[1],f=(0,b.Z)(h.header.mbs,2),p=f[0],d=f[1],A=Math.abs(a-p),v=Math.abs(s-d),g=Math.sqrt(v*v+A*A);i.push([c,g])}}catch(C){u.e(C)}finally{u.f()}for(var m=i.sort((function(t,e){return t[1]-e[1]})),y=[],_=0;_<n;_++)y.push(t[m[_][0]]);for(var x=[],w=n;w<m.length;w++)x.push(t[m[w][0]]);return[y,x]}(Object.values(this._traverser.selectedTiles),t,this.options.maximumTilesSelected),i=(0,b.Z)(r,2),o=i[0],a=i[1];n.selectedTiles=o;var s,u=(0,j.Z)(a);try{for(u.s();!(s=u.n()).done;){s.value.unselect()}}catch(l){u.e(l)}finally{u.f()}n._requestedTiles=Object.values(this._traverser.requestedTiles),n._emptyTiles=Object.values(this._traverser.emptyTiles),this.traverseCounter--,this.traverseCounter>0||this._updateTiles()}},{key:"_updateTiles",value:function(){for(var t in this.selectedTiles=[],this._requestedTiles=[],this._emptyTiles=[],this.frameStateData){var e=this.frameStateData[t];this.selectedTiles=this.selectedTiles.concat(e.selectedTiles),this._requestedTiles=this._requestedTiles.concat(e._requestedTiles),this._emptyTiles=this._emptyTiles.c
2oncat(e._emptyTiles)}this.selectedTiles=this.options.onTraversalComplete(this.selectedTiles);var n,r=(0,j.Z)(this.selectedTiles);try{for(r.s();!(n=r.n()).done;){var i=n.value;this._tiles[i.id]=i}}catch(o){r.e(o)}finally{r.f()}this._loadTiles(),this._unloadTiles(),this._updateStats()}},{key:"_tilesChanged",value:function(t,e){if(t.length!==e.length)return!0;var n=new Set(t.map((function(t){return t.id}))),r=new Set(e.map((function(t){return t.id}))),i=t.filter((function(t){return!r.has(t.id)})).length>0;return i=i||e.filter((function(t){return!n.has(t.id)})).length>0,i}},{key:"_loadTiles",value:function(){var t,e=(0,j.Z)(this._requestedTiles);try{for(e.s();!(t=e.n()).done;){var n=t.value;n.contentUnloaded&&this._loadTile(n)}}catch(r){e.e(r)}finally{e.f()}}},{key:"_unloadTiles",value:function(){this._cache.unloadTiles(this,(function(t,e){return t._unloadTile(e)}))}},{key:"_updateStats",value:function(){var t,e=0,n=0,r=(0,j.Z)(this.selectedTiles);try{for(r.s();!(t=r.n()).done;){var i=t.value;i.contentAvailable&&i.content&&(e++,i.content.pointCount?n+=i.content.pointCount:n+=i.content.vertexCount)}}catch(o){r.e(o)}finally{r.f()}this.stats.get(Si).count=this.selectedTiles.length,this.stats.get(Ti).count=e,this.stats.get(Di).count=n}},{key:"_initializeTileSet",value:function(){var t=(0,H.Z)((0,V.Z)().mark((function t(e){return(0,V.Z)().wrap((function(t){for(;;
2)switch(t.prev=t.next){case 0:if(this.type!==qr.I3S){t.next=5;break}return this.calculateViewPropsI3S(),t.next=4,e.root;case 4:e.root=t.sent;case 5:this.root=this._initializeTileHeaders(e,null),this.type===qr.TILES3D&&(this._initializeTiles3DTileset(e),this.calculateViewPropsTiles3D()),this.type===qr.I3S&&this._initializeI3STileset();case 8:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"calculateViewPropsI3S",value:function(){var t,e=this.tileset.fullExtent;if(e){var n=e.xmin,r=e.xmax,i=e.ymin,o=e.ymax,a=e.zmin,s=e.zmax;return this.cartographicCenter=new pt.Z(n+(r-n)/2,i+(o-i)/2,a+(s-a)/2),this.cartesianCenter=wr.WGS84.cartographicToCartesian(this.cartographicCenter,new pt.Z),void(this.zoom=Nr(e,this.cartographicCenter,this.cartesianCenter))}var u=null===(t=this.tileset.store)||void 0===t?void 0:t.extent;if(u){var l=(0,b.Z)(u,4),c=l[0],h=l[1],f=l[2],p=l[3];return this.cartographicCenter=new pt.Z(c+(f-c)/2,h+(p-h)/2,0),this.cartesianCenter=wr.WGS84.cartographicToCartesian(this.cartographicCenter,new pt.Z),void(this.zoom=function(t,e,n){var r=(0,b.Z)(t,4),i=r[0],o=r[1];return Nr({xmin:i,xmax:r[2],ymin:o,ymax:r[3],zmin:0,zmax:0},e,n)}(u,this.cartographicCenter,this.cartesianCenter))}console.warn("Extent is not defined in the tileset header"),this.cartographicCenter=new pt.Z,this.zoom=1}},{key:"calculateViewPropsTiles3D",value:function(){var t=this.root;Cr(t);var e=t.boundingVolume.center;if(!e)return console.warn("center was not pre-calculated for the root tile"),this.cartographicCenter=new pt.Z,void(this.zoom=1);0!==e[0]||0!==e[1]||0!==e[2]?this.cartographicCenter=wr.WGS84.cartesianToCartographic(e,new pt.Z):this.cartographicCenter=new pt.Z(0,0,-wr.WGS84.radii[0]),this.cartesianCenter=e,this.zoom=Ur(t.boundingVolume,this.cartographicCenter)}},{key:"_initializeStats",value:function(){this.stats.get(ki),this.stats.get(Ii),this.stats.get(Ei),this.stats.get(Si),this.stats.get(Ti),this.stats.get(Mi),this.stats.get(Pi),this.stats.get(Zi),this.stats.get(Di),this.stats.get(Li,"memory")}},{key:"_initializeTileHeaders",value:function(t,e){var n=new gi(this,t.root,e);if(e&&(e.children.push(n),n.depth=e.depth+1),this.type===qr.TILES3D){var r=[];for(r.push(n);r.length>0;){var i=r.pop();this.stats.get(ki).incrementCount();var o,a=i.header.children||[],s=(0,j.Z)(a);try{for(s.s();!(o=s.n()).done;){var u=o.value,l=new gi(this,u,i);i.children.push(l),l.depth=i.depth+1,r.push(l)}}catch(c){s.e(c)}finally{s.f()}}}return n}},{key:"_initializeTraverser",value:function(){var t;switch(this.type){case qr.TILES3D:t=mi;break;case qr.I3S:t=Ci;break;default:t=Ai}return new t({basePath:this.basePath,onTraversalEnd:this._onTraversalEnd.bind(this)})}},{key:"_destroyTileHeaders",value:function(t){this._destroySubtree(t)}},{key:"_loadTile",value:function(){var t=(0,H.Z)((0,V.Z)().mark((function t(e){var n;return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,this._onStartTileLoading(),t.next=4,e.loadContent();case 4:n=t.sent,t.next=10;break;case 7:t.prev=7,t.t0=t.catch(0),this._onTileLoadError(e,t.t0);case 10:return t.prev=10,this._onEndTileLoading(),this._onTileLoad(e,n),t.finish(10);case 14:case"end":return t.stop()}}),t,this,[[0,7,10,14]])})));return function(e){return t.apply(this,arguments)}}()},{key:"_onTileLoadError",value:function(t,e){this.stats.get(Zi).incrementCount();var n=e.message||e.toString(),r=t.url;console.error("A 3D tile failed to load: ".concat(t.url," ").concat(n)),this.options.onT
2ileError(t,n,r)}},{key:"_onTileLoad",value:function(t,e){if(e){if(this.type===qr.I3S){var n,r,i=(null===(n=this.tileset)||void 0===n||null===(r=n.nodePagesTile)||void 0===r?void 0:r.nodesInNodePages)||0;this.stats.get(ki).reset(),this.stats.get(ki).addCount(i)}t&&t.content&&function(t,e){Cr(t),Cr(e);var n=e.rtcCenter,r=e.gltfUpAxis,i=t.computedTransform,o=t.boundingVolume.center,a=new K.Z(i);switch(n&&a.translate(n),r){case"Z":default:break;case"Y":var s=(new K.Z).rotateX(Math.PI/2);a=a.multiplyRight(s);break;case"X":var u=(new K.Z).rotateY(-Math.PI/2);a=a.multiplyRight(u)}e.isQuantized&&a.translate(e.quantizedVolumeOffset).scale(e.quantizedVolumeScale);var l=new pt.Z(o);e.cartesianModelMatrix=a,e.cartesianOrigin=l;var c=wr.WGS84.cartesianToCartographic(l,new pt.Z),h=wr.WGS84.eastNorthUpToFixedFrame(l).invert();e.cartographicModelMatrix=h.multiplyRight(a),e.cartographicOrigin=c,e.coordinateSystem||(e.modelMatrix=e.cartographicModelMatrix)}(t,t.content),this._addTileToCache(t),this.options.onTileLoad(t)}}},{key:"_onStartTileLoading",value:function(){this._pendingCount++,this.stats.get(Ii).incrementCount()}},{key:"_onEndTileLoading",value:function(){this._pendingCount--,this.stats.get(Ii).decrementCount()}},{key:"_addTileToCache",value:function(t){this._cache.add(this,t,(function(e){return e._updateCacheStats(t)}))}},{key:"_updateCacheStats",value:function(t){this.stats.get(Mi).incrementCount(),this.stats.get(Ei).incrementCount(),this.gpuMemoryUsageInBytes+=t.content.byteLength||0,this.stats.get(Li).count=this.gpuMemoryUsageInBytes}},{key:"_unloadTile",value:function(t){this.gpuMemoryUsageInBytes-=t.content&&t.content.byteLength||0,this.stats.get(Ei).decrementCount(),this.stats.get(Pi).incrementCount(),this.stats.get(Li).count=this.gpuMemoryUsageInBytes,this.options.onT
2ileUnload(t),t.unloadContent()}},{key:"_destroy",value:function(){var t=[];for(this.root&&t.push(this.root);t.length>0;){var e,n=t.pop(),r=(0,j.Z)(n.children);try{for(r.s();!(e=r.n()).done;){var i=e.value;t.push(i)}}catch(o){r.e(o)}finally{r.f()}this._destroyTile(n)}this.root=null}},{key:"_destroySubtree",value:function(t){var e=t,n=[];for(n.push(e);n.length>0;){t=n.pop();var r,i=(0,j.Z)(t.children);try{for(i.s();!(r=i.n()).done;){var o=r.value;n.push(o)}}catch(a){i.e(a)}finally{i.f()}t!==e&&this._destroyTile(t)}e.children=[]}},{key:"_destroyTile",value:function(t){this._cache.unloadTile(this,t),this._unloadTile(t),t.destroy()}},{key:"_initializeTiles3DTileset",value:function(t){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}},{key:"_initializeI3STileset",value:function(){this.loadOptions.i3s&&"token"in this.loadOptions.i3s&&(this._queryParams.token=this.loadOptions.i3s.token)}}]),t}();var Fi="3.2.12",Ri={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect",GLTF:"glTF"};Object.keys(Ri);function zi(t,e,n){Cr(t instanceof ArrayBuffer);var r=new TextDecoder("utf8"),i=new Uint8Array(t,e,n);return r.decode(i)}function Ui(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,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)))}var Ni="3.2.12",Gi={name:"Draco",id:"draco",module:"draco",shapes:["mesh"],version:Ni,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}}};var ji,Vi=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new Map;(0,h.Z)(this,t),(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=e,this.type=n,this.nullable=r,this.metadata=i}return(0,c.Z)(t,[{key:"typeId",get:function(){return this.type&&this.type.typeId}},{key:"clone",value:function(){return new t(this.name,this.type,this.nullable,this.metadata)}},{key:"compareTo",value:function(t){return this.name===t.name&&this.type===t.type&&this.nullable===t.nullable&&this.metadata===t.metadata}},{key:"toString",value:function(){return"".concat(this.type).concat(this.nullable?", nullable":"").concat(this.metadata?", metadata: ".concat(this.metadata):"")}}]),t}();!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"}(ji||(ji={}));var Hi=function(){function t(){(0,h.Z)(this,t)}return(0,c.Z)(t,[{key:"typeId",get:function(){return ji.NONE}},{key:"compareTo",value:function(t){return this===t}}],[{key:"isNull",value:function(t){return t&&t.typeId===ji.Null}},{key:"isInt",value:function(t){return t&&t.typeId===ji.Int}},{key:"isFloat",value:function(t){return t&&t.typeId===ji.Float}},{key:"isBinary",value:function(t){return t&&t.typeId===ji.Binary}},{key:"isUtf8",value:function(t){return t&&t.typeId===ji.Utf8}},{key:"isBool",value:function(t){return t&&t.typeId===ji.Bool}},{key:"isDecimal",value:function(t){return t&&t.typeId===ji.Decimal}},{key:"isDate",value:function(t){return t&&t.typeId===ji.Date}},{key:"isTime",value:function(t){return t&&t.typeId===ji.Time}},{key:"isTimestamp",value:function(t){return t&&t.typeId===ji.Timestamp}},{key:"isInterval",value:function(t){return t&&t.typeId===ji.Interval}},{key:"isList",value:function(t){return t&&t.typeId===ji.List}},{key:"isStruct",value:function(t){return t&&t.typeId===ji.Struct}},{key:"isUnion",value:function(t){return t&&t.typeId===ji.Union}},{key:"isFixedSizeBinary",value:function(t){return t&&t.typeId===ji.FixedSizeBinary}},{key:"isFixedSizeList",value:function(t){return t&&t.typeId===ji.FixedSizeList}},{key:"isMap",value:function(t){return t&&t.typeId===ji.Map}},{key:"isDictionary",value:function(t){return t&&t.typeId===ji.Dictionary}}]),t}(),Ji=(Symbol.toStringTag,Symbol.toStringTag,function(t,e){(0,f.Z)(r,t);var n=(0,p.Z)(r);function r(t,e){var i;return(0,h.Z)(this,r),i=n.call(this),(0,d.Z)((0,q.Z)(i),"isSigned",void 0),(0,d.Z)((0,q.Z)(i),"bitWidth",void 0),i.isSigned=t,i.bitWidth=e,i}return(0,c.Z)(r,[{key:"typeId",get:function(){return ji.Int}},{key:e,get:function(){return"Int"}},{key:"toString",value:function(){return"".concat(this.isSigned?"I":"Ui","nt").concat(this.bitWidth)}}]),r}(Hi,Symbol.toStringTag)),Wi=function(t){(0,f.Z)(n,t);var e=(0,p.Z)(n);function n(){return(0,h.Z)(this,n),e.call(this,!0,8)}return(0,c.Z)(n)}(Ji),Qi=function(t){(0,f.Z)(n,t);var e=(0,p.Z)(n);function n(){return(0,h.Z)(this,n),e.call(this,!0,16)}return(0,c.Z)(n)}(Ji),qi=function(t){(0,f.Z)(n,t);var e=(0,p.Z)(n);function n(){return(0,h.Z)(this,n),e.call(this,!0,32)}return(0,c.Z)(n)}(Ji),Ki=function(t){(0,f.Z)(n,t);var e=(0,p.Z)(n);function n(){return(0,h.Z)(this,n),e.call(this,!1,8)}return(0,c.Z)(n)}(Ji),Xi=function(t){(0,f.Z)(n,t);var e=(0,p.Z)(n);function n(){return(0,h.Z)(this,n),e.call(this,!1,16)}return(0,c.Z)(n)}(Ji),Yi=function(t){(0,f.Z)(n,t);var e=(0,p.Z)(n);function n(){return(0,h.Z)(this,n),e.call(this,!1,32)}return(0,c.Z)(n)}(Ji),$i=32,to=64,eo=function(t,e){(0,f.Z)(r,t);var n=(0,p.Z)(r);function r(t){var e;return(0,h.Z)(this,r),e=n.call(this),(0,d.Z)((0,q.Z)(e),"precision",void 0),e.precision=t,e}return(0,c.Z)(r,[{key:"typeId",get:function(){return ji.Float}},{key:e,get:function(){return"Float"}},{key:"toString",value:function(){return"Float".concat(this.precision)}}]),r}(Hi,Symbol.toStringTag),no=function(t){(0,f.Z)(n,t);var e=(0,p.Z)(n);function n(){return(0,h.Z)(this,n),e.call(this,$i)}return(0,c.Z)(n)}(eo),ro=function(t){(0,f.Z)(n,t);var e=(0,p.Z)(n);function n(){return(0,h.Z)(this,n),e.call(this,to)}return(0,c.Z)(n)}(eo);Symbol.toStringTag,Symbol.toStringTag;Symbol.toStringTag;Symbol.toStringTag;Symbol.toStringTag;Symbol.toStringTag;var io=function(t,e){(0,f.Z)(r,t);var n=(0,p.Z)(r);function r(t,e){var i;return(0,h.Z)(this,r),i=n.call(this),(0,d.Z)((0,q.Z)(i),"listSize",void 0),(0,d.Z)((0,q.Z)(i),"children",void 0),i.listSize=t,i.children=[e],i}return(0,c.Z)(r,[{key:"typeId",get:function(){return ji.FixedSizeList}},{key:"valueType",get:function(){return this.children[0].type}},{key:"valueField",get:function(){return this.children[0]}},{key:e,get:function(){return"FixedSizeList"}},{key:"toString",value:function(){return"FixedSizeList[".concat(this.listSize,"]<").concat(this.valueType,">")}}]),r}(Hi,Symbol.toStringTag);Symbol.toStringTag;function oo(t,e,n){var r=function(t){switch(t.constructor){case Int8Array:return new Wi;case Uint8Array:return new Ki;case Int16Array:return new Qi;case Uint16Array:return new Xi;case Int32Array:return new qi;case Uint32Array:return new Yi;case Float32Array:return new no;case Float64Array:return new ro;default:throw new Error("array type not supported")}}(e.value),i=n||function(t){var 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);
2return new Vi(t,new io(e.size,new Vi("value",r)),!1,i)}var ao=function(){function t(e,n){(0,h.Z)(this,t),(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(e)),function(t){var e,n={},r=(0,j.Z)(t);try{for(r.s();!(e=r.n()).done;){var i=e.value;n[i.name]&&console.warn("Schema: duplicated field name",i.name,i),n[i.name]=!0}}catch(o){r.e(o)}finally{r.f()}}(e),this.fields=e,this.metadata=n||new Map}return(0,c.Z)(t,[{key:"compareTo",value:function(t){if(this.metadata!==t.metadata)return!1;if(this.fields.length!==t.fields.length)return!1;for(var e=0;e<this.fields.length;++e)if(!this.fields[e].compareTo(t.fields[e]))return!1;return!0}},{key:"select",value:function(){for(var e=Object.create(null),n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];for(var o=0,a=r;o<a.length;o++){var s=a[o];e[s]=!0}return new t(this.fields.filter((function(t){return e[t.name]})),this.metadata)}},{key:"selectAt",value:function(){for(var e=this,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return new t(r.map((function(t){return e.fields[t]})).filter(Boolean),this.metadata)}},{key:"assign",value:function(e){var n,r=this.metadata;if(e instanceof t){var i=e;n=i.fields,r=so(so(new Map,this.metadata),i.metadata)}else n=e;var o,a=Object.create(null),s=(0,j.Z)(this.fields);try{for(s.s();!(o=s.n()).done;){var u=o.value;a[u.name]=u}}catch(f){s.e(f)}finally{s.f()}var l,c=(0,j.Z)(n);try{for(c.s();!(l=c.n()).done;){var h=l.value;a[h.name]=h}}catch(f){c.e(f)}finally{c.f()}return new t(Object.values(a),r)}}]),t}();function so(t,e){return new Map([].concat((0,Q.Z)(t||new Map),(0,Q.Z)(e||new Map)))}function uo(t,e,n){return oo(t,e,n?lo(n.metadata):void 0)}function lo(t){var e=new Map;for(var n in t)e.set("".concat(n,".string"),JSON.stringify(t[n]));return e}var co={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},ho={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},fo=function(){function t(e){(0,h.Z)(this,t),(0,d.Z)(this,"draco",void 0),(0,d.Z)(this,"decoder",void 0),(0,d.Z)(this,"metadataQuerier",void 0),this.draco=e,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}return(0,c.Z)(t,[{key:"destroy",value:function(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}},{key:"parseSync",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new this.draco.DecoderBuffer;n.Init(new Int8Array(t),t.byteLength),this._disableAttributeTransforms(e);var r=this.decoder.GetEncodedGeometryType(n),i=r===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{var o;switch(r){case this.draco.TRIANGULAR_MESH:o=this.decoder.DecodeBufferToMesh(n,i);break;case this.draco.POINT_CLOUD:o=this.decoder.DecodeBufferToPointCloud(n,i);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!o.ok()||!i.ptr){var a="DRACO decompression failed: ".concat(o.error_msg());throw new Error(a)}var s=this._getDracoLoaderData(i,r,e),u=this._getMeshData(i,s,e),l=function(t){for(var e=1/0,n=1/0,r=1/0,i=-1/0,o=-1/0,a=-1/0,s=t.POSITION?t.POSITION.value:[],u=s&&s.length,l=0;l<u;l+=3){var c=s[l],h=s[l+1],f=s[l+2];e=c<e?c:e,n=h<n?h:n,r=f<r?f:r,i=c>i?c:i,o=h>o?h:o,a=f>a?f:a}return[[e,n,r],[i,o,a]]}(u.attributes),c=function(t,e,n){var r=lo(e.metadata),i=[],o=function(t){var e={};for(var n in t){var r=t[n];e[r.name||"undefined"]=r}return e}(e.attributes);for(var a in t){var s=uo(a,t[a],o[a]);i.push(s)}if(n){var u=uo("indices",n);i.push(u)}return new ao(i,r)}(u.attributes,s,u.indices);return(0,v.Z)((0,v.Z)({loader:"draco",loaderData:s,header:{vertexCount:i.num_points(),boundingBox:l}},u),{},{schema:c})}finally{this.draco.destroy(n),i&&this.draco.destroy(i)}}},{key:"_getDracoLoaderData",value:function(t,e,n){var r=this._getTopLevelMetadata(t),i=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:r,attributes:i}}},{key:"_getDracoAttributes",value:function(t,e){for(var n={},r=0;r<t.num_attributes();r++){var i=this.decoder.GetAttribute(t,r),o=this._getAttributeMetadata(t,r);n[i.unique_id()]={unique_id:i.unique_id(),attribute_type:i.attribute_type(),data_type:i.data_type(),num_components:i.num_c
2omponents(),byte_offset:i.byte_offset(),byte_stride:i.byte_stride(),normalized:i.normalized(),attribute_index:r,metadata:o};var a=this._getQuantizationTransform(i,e);a&&(n[i.unique_id()].quantization_transform=a);var s=this._getOctahedronTransform(i,e);s&&(n[i.unique_id()].octahedron_transform=s)}return n}},{key:"_getMeshData",value:function(t,e,n){var r=this._getMeshAttributes(e,t,n);if(!r.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:r,indices:{value:this._getTriangleStripIndices(t),size:1}}:{topology:"triangle-list",mode:5,attributes:r,indices:{value:this._getTriangleListIndices(t),size:1}}:{topology:"point-list",mode:0,attributes:r}}},{key:"_getMeshAttributes",value:function(t,e,n){for(var r={},i=0,o=Object.values(t.attributes);i<o.length;i++){var a=o[i],s=this._deduceAttributeName(a,n);a.name=s;var u=this._getAttributeValues(e,a),l=u.value,c=u.size;r[s]={value:l,size:c,byteOffset:a.byte_offset,byteStride:a.byte_stride,normalized:a.normalized}}return r}},{key:"_getTriangleListIndices",value:function(t){var e=3*t.num_faces(),n=4*e,r=this.draco._malloc(n);try{return this.decoder.GetTrianglesUInt32Array(t,n,r),new Uint32Array(this.draco.HEAPF32.buffer,r,e).slice()}finally{this.draco._free(r)}}},{key:"_getTriangleStripIndices",value:function(t){var e=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(t,e),function(t){for(var e=t.size(),n=new Int32Array(e),r=0;r<e;r++)n[r]=t.GetValue(r);return n}(e)}finally{this.draco.destroy(e)}}},{key:"_getAttributeValues",value:function(t,e){var n,r=ho[e.data_type],i=e.num_components,o=t.num_points()*i,a=o*r.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,r),u=this.draco._malloc(a);try{var l=this.decoder.GetAttribute(t,e.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(t,l,s,a,u),n=new r(this.draco.HEAPF32.buffer,u,o).slice()}finally{this.draco._free(u)}return{value:n,size:i}}},{key:"_deduceAttributeName",value:function(t,e){for(var n=t.unique_id,r=0,i=Object.entries(e.extraAttributes||{});r<i.length;r++){var o=(0,b.Z)(i[r],2),a=o[0];if(o[1]===n)return a}var s=t.attribute_type;for(var u in co){if(this.draco[u]===s)return co[u]}var l=e.attributeNameEntry||"name";return t.metadata[l]?t.metadata[l].string:"CUSTOM_ATTRIBUTE_".concat(n)}},{key:"_getTopLevelMetadata",value:function(t){var e=this.decoder.GetMetadata(t);return this._getDracoMetadata(e)}},{key:"_getAttributeMetadata",value:function(t,e){var n=this.decoder.GetAttributeMetadata(t,e);return this._getDracoMetadata(n)}},{key:"_getDracoMetadata",value:function(t){if(!t||!t.ptr)return{};for(var e={},n=this.metadataQuerier.NumEntries(t),r=0;r<n;r++){var i=this.metadataQuerier.GetEntryName(t,r);e[i]=this._getDracoMetadataField(t,i)}return e}},{key:"_getDracoMetadataField",value:function(t,e){var n=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(t,e,n);var r=function(t){for(var e=t.size(),n=new Int32Array(e),r=0;r<e;r++)n[r]=t.GetValue(r);return n}(n);return{int:this.metadataQuerier.GetIntEntry(t,e),string:this.metadataQuerier.GetStringEntry(t,e),double:this.metadataQuerier.GetDoubleEntry(t,e),intArray:r}}finally{this.draco.destroy(n)}}},{key:"_disableAttributeTransforms",value:function(t){var e,n=t.quantizedAttributes,r=void 0===n?[]:n,i=t.octahedronAttributes,o=void 0===i?[]:i,a=[].concat((0,Q.Z)(r),(0,Q.Z)(o)),s=(0,j.Z)(a);try{for(s.s();!(e=s.n()).done;){var u=e.value;this.decoder.SkipAttributeTransform(this.draco[u])}}catch(l){s.e(l)}finally{s.f()}}},{key:"_getQuantizationTransform",value:function(t,e){var n=this,r=e.quantizedAttributes,i=void 0===r?[]:r,o=t.attribute_type();if(i.map((function(t){return n.decoder[t]})).includes(o)){var a=new this.draco.AttributeQuantizationTransform;try{if(a.InitFromAttribute(t))return{quantization_bits:a.quantization_bits(),range:a.range(),min_values:new Float32Array([1,2,3]).map((function(t){return a.min_value(t)}))}}finally{this.draco.destroy(a)}}return null}},{key:"_getOctahedronTransform",value:function(t,e){var n=this,r=e.octahedronAttributes,i=void 0===r?[]:r,o=t.attribute_type();if(i.map((function(t){return n.decoder[t]})).includes(o)){var a=new this.draco.AttributeQuantizationTransform;try{if(a.InitFromAttribute(t))return{quantization_bits:a.quantization_bits()}}finally{this.draco.destroy(a)}}return null}}]),t}();var po={self:"undefined"!==typeof self&&self,window:"undefined"!==typeof window&&window,global:"undefined"!==typeof n.g&&n.g,document:"undefined"!==typeof document&&document},Ao=po.global||po.self||po.window||{},vo="object"!==typeof process||"[object process]"!==String(process)||process.browser,go="function"===typeof importScripts,mo=("undefined"!==typeof window&&window.orientation,"undefined"!==typeof process&&process.version&&/v([0-9]*)/.exec(process.version)),yo=(mo&&parseFloat(mo[1]),n(20035));var _o="3.2.12",bo={};function xo(t){return wo.apply(this,arguments)}function wo(){return wo=(0,H.Z)((0,V.Z)().mark((function t(e){var n,r,i=arguments;return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=i.length>2&&void 0!==i[2]?i[2]:{},(n=i.length>1&&void 0!==i[1]?i[1]:null)&&(e=Co(e,n,r)),bo[e]=bo[e]||Bo(e),t.next=6,bo[e];case 6:return t.abrupt("return",t.sent);case 7:case"end":return t.stop()}}),t)}))),wo.apply(this,arguments)}function Co(t,e,n){if(t.startsWith("http"))return t;var r=n.modules||{};return r[t]?r[t]:vo?n.CDN?(function(t,e){if(!t)throw new Error(e||"loaders.gl assertion failed.")}(n.CDN.startsWith("http")),"".concat(n.CDN,"/").concat(e,"@").concat(_o,"/dist/libs/").concat(t)):go?"../src/libs/".concat(t):"modules/".concat(e,"/src/libs/").concat(t):"modules/".concat(e,"/dist/libs/").concat(t)}function Bo(t){return ko.apply(this,arguments)}function ko(){return(ko=(0,H.Z)((0,V.Z)().mark((function t(e){var n,r,i;return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.endsWith("wasm")){t.next=7;break}return t.next=3,fetch(e);case 3:return n=t.sent,t.next=6,n.arrayBuffer();case 6:return t.abrupt("return",t.sent);case 7:if(vo){t.next=20;break}if(t.prev=8,t.t0=yo&&yo.requireFromFile,!t.t0){t.next=14;break}return t.next=13,yo.requireFromFile(e);case 13:t.t0=t.sent;case 14:return t.abrupt("return",t.t0);case 17:return t.prev=17,t.t1=t.catch(8),t.abrupt("return",null);case 20:if(!go){t.next=22;break}return t.abrupt("return",importScripts(e));case 22:return t.next=24,fetch(e);case 24:return r=t.sent,t.next=27,r.text();case 27:return i=t.sent,t.abrupt("return",Eo(i,e));case 29:case"end":return t.stop()}}),t,null,[[8,17]])})))).apply(this,arguments)}function Eo(t,e){if(!vo)return yo.requireFromString&&yo.requireFromString(t,e);if(go)return eval.call(Ao,t),null;var n=document.createElement("script");n.id=e;try{n.appendChild(document.createTextNode(t))}catch(r){n.text=t}return document.body.appendChild(n),null}
2var So,To="1.4.1",Mo="https://www.gstatic.com/draco/versioned/decoders/".concat(To,"/draco_decoder.js"),Io="https://www.gstatic.com/draco/versioned/decoders/".concat(To,"/draco_wasm_wrapper.js"),Po="https://www.gstatic.com/draco/versioned/decoders/".concat(To,"/draco_decoder.wasm");"https://raw.githubusercontent.com/google/draco/".concat(To,"/javascript/draco_encoder.js");function Zo(t){return Do.apply(this,arguments)}function Do(){return(Do=(0,H.Z)((0,V.Z)().mark((function t(e){var n;return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.modules||{},So=n.draco3d?So||n.draco3d.createDecoderModule({}).then((function(t){return{draco:t}})):So||Lo(e),t.next=4,So;case 4:return t.abrupt("return",t.sent);case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Lo(t){return Oo.apply(this,arguments)}function Oo(){return(Oo=(0,H.Z)((0,V.Z)().mark((function t(e){var n,r,i,o;return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:t.t0=e.draco&&e.draco.decoderType,t.next="js"===t.t0?3:(t.t0,7);break;case 3:return t.next=5,xo(Mo,"draco",e);case 5:return n=t.sent,t.abrupt("break",21);case 7:return t.t1=Promise,t.next=10,xo(Io,"draco",e);case 10:return t.t2=t.sent,t.next=13,xo(Po,"draco",e);case 13:return t.t3=t.sent,t.t4=[t.t2,t.t3],t.next=17,t.t1.all.call(t.t1,t.t4);case 17:i=t.sent,o=(0,b.Z)(i,2),n=o[0],r=o[1];case 21:return n=n||globalThis.DracoDecoderModule,t.next=24,Fo(n,r);case 24:return t.abrupt("return",t.sent);case 25:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Fo(t,e){var n={};return e&&(n.wasmBinary=e),new Promise((function(e){t((0,v.Z)((0,v.Z)({},n),{},{onModuleLoaded:function(t){return e({draco:t})}}))}))}var Ro=(0,v.Z)((0,v.Z)({},Gi),{},{parse:function(t,e){return zo.apply(this,arguments)}});function zo(){return(zo=(0,H.Z)((0,V.Z)().mark((function t(e,n){var r,i,o;return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Zo(n);case 2:return r=t.sent,i=r.draco,o=new fo(i),t.prev=5,t.abrupt("return",o.parseSync(e,null===n||void 0===n?void 0:n.draco));case 7:return t.prev=7,o.destroy(),t.finish(7);case 10:case"end":return t.stop()}}),t,null,[[5,,7,10]])})))).apply(this,arguments)}var Uo,No={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130},Go=(0,v.Z)((0,v.Z)({},{POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6}),No),jo=(Uo={},(0,d.Z)(Uo,No.DOUBLE,Float64Array),(0,d.Z)(Uo,No.FLOAT,Float32Array),(0,d.Z)(Uo,No.UNSIGNED_SHORT,Uint16Array),(0,d.Z)(Uo,No.UNSIGNED_INT,Uint32Array),(0,d.Z)(Uo,No.UNSIGNED_BYTE,Uint8Array),(0,d.Z)(Uo,No.BYTE,Int8Array),(0,d.Z)(Uo,No.SHORT,Int16Array),(0,d.Z)(Uo,No.INT,Int32Array),Uo),Vo={DOUBLE:No.DOUBLE,FLOAT:No.FLOAT,UNSIGNED_SHORT:No.UNSIGNED_SHORT,UNSIGNED_INT:No.UNSIGNED_INT,UNSIGNED_BYTE:No.UNSIGNED_BYTE,BYTE:No.BYTE,SHORT:No.SHORT,INT:No.INT},Ho="Failed to convert GL type",Jo=function(){function t(){(0,h.Z)(this,t)}return(0,c.Z)(t,null,[{key:"fromTypedArray",value:function(t){for(var e in t=ArrayBuffer.isView(t)?t.constructor:t,jo){if(jo[e]===t)return e}throw new Error(Ho)}},{key:"fromName",value:function(t){var e=Vo[t];if(!e)throw new Error(Ho);return e}},{key:"getArrayType",value:function(t){switch(t){case No.UNSIGNED_SHORT_5_6_5:case No.UNSIGNED_SHORT_4_4_4_4:case No.UNSIGNED_SHORT_5_5_5_1:return Uint16Array;default:var e=jo[t];if(!e)throw new Error(Ho);return e}}},{key:"getByteSize",value:function(e){return t.getArrayType(e).BYTES_PER_ELEMENT}},{key:"validate",value:function(e){return Boolean(t.getArrayType(e))}},{key:"createTypedArray",value:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3?arguments[3]:void 0;return void 0===i&&(i=(n.byteLength-r)/t.getByteSize(e)),new(t.getArrayType(e))(n,r,i)}}]),t}(),Wo=function(){function t(e,n){(0,h.Z)(this,t),(0,d.Z)(this,"json",void 0),(0,d.Z)(this,"buffer",void 0),(0,d.Z)(this,"featuresLength",0),(0,d.Z)(this,"_cachedTypedArrays",{}),this.json=e,this.buffer=n}return(0,c.Z)(t,[{key:"getExtension",value:function(t){return this.json.extensions&&this.json.extensions[t]}},{key:"hasProperty",value:function(t){return Boolean(this.json[t])}},{key:"getGlobalProperty",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Go.UNSIGNED_INT,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=this.json[t];return r&&Number.isFinite(r.byteOffset)?this._getTypedArrayFromBinary(t,e,n,1,r.byteOffset):r}},{key:"getPropertyArray",value:function(t,e,n){var r=this.json[t];return r&&Number.isFinite(r.byteOffset)?("componentType"in r&&(e=Jo.fromN
2ame(r.componentType)),this._getTypedArrayFromBinary(t,e,n,this.featuresLength,r.byteOffset)):this._getTypedArrayFromArray(t,e,r)}},{key:"getProperty",value:function(t,e,n,r,i){var o=this.json[t];if(!o)return o;var a=this.getPropertyArray(t,e,n);if(1===n)return a[r];for(var s=0;s<n;++s)i[s]=a[n*r+s];return i}},{key:"_getTypedArrayFromBinary",value:function(t,e,n,r,i){var o=this._cachedTypedArrays,a=o[t];return a||(a=Jo.createTypedArray(e,this.buffer.buffer,this.buffer.byteOffset+i,r*n),o[t]=a),a}},{key:"_getTypedArrayFromArray",value:function(t,e,n){var r=this._cachedTypedArrays,i=r[t];return i||(i=Jo.createTypedArray(e,n),r[t]=i),i}}]),t}(),Qo={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},qo={SCALAR:function(t,e){return t[e]},VEC2:function(t,e){return[t[2*e+0],t[2*e+1]]},VEC3:function(t,e){return[t[3*e+0],t[3*e+1],t[3*e+2]]},VEC4:function(t,e){return[t[4*e+0],t[4*e+1],t[4*e+2],t[4*e+3]]},MAT2:function(t,e){return[t[4*e+0],t[4*e+1],t[4*e+2],t[4*e+3]]},MAT3:function(t,e){return[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:function(t,e){return[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]]}},Ko={SCALAR:function(t,e,n){e[n]=t},VEC2:function(t,e,n){e[2*n+0]=t[0],e[2*n+1]=t[1]},VEC3:function(t,e,n){e[3*n+0]=t[0],e[3*n+1]=t[1],e[3*n+2]=t[2]},VEC4:function(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:function(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:function(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:function(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]}};var Xo=function(t){return void 0!==t};function Yo(t,e,n){if(!e)return null;var r=t.getExtension("3DTILES_batch_table_hierarchy"),i=e.HIERARCHY;return i&&(console.warn("3D Tile Parser: HIERARCHY is deprecated. Use 3DTILES_batch_table_hierarchy."),e.extensions=e.extensions||{},e.extensions["3DTILES_batch_table_hierarchy"]=i,r=i),r?function(t,e){var n,r,i,o=t.instancesLength,a=t.classes,s=t.classIds,u=t.parentCounts,l=t.parentIds,c=o;Xo(s.byteOffset)&&(s.componentType=defaultValue(s.componentType,GL.UNSIGNED_SHORT),s.type=AttributeType.SCALAR,s=getBinaryAccessor(s).createArrayBufferView(e.buffer,e.byteOffset+s.byteOffset,o));if(Xo(u))for(Xo(u.byteOffset)&&(u.componentType=defaultValue(u.componentType,GL.UNSIGNED_SHORT),u.type=AttributeType.SCALAR,u=getBinaryAccessor(u).createArrayBufferView(e.buffer,e.byteOffset+u.byteOffset,o)),i=new Uint16Array(o),c=0,n=0;n<o;++n)i[n]=c,c+=u[n];Xo(l)&&Xo(l.byteOffset)&&(l.componentType=defaultValue(l.componentType,GL.UNSIGNED_SHORT),l.type=AttributeType.SCALAR,l=getBinaryAccessor(l).createArrayBufferView(e.buffer,e.byteOffset+l.byteOffset,c));var h=a.length;for(n=0;n<h;++n){var f=a[n].length,p=a[n].instances,d=getBinaryProperties(f,p,e);a[n].instances=combine(d,p)}var A=new Array(h).fill(0),v=new Uint16Array(o);for(n=0;n<o;++n)r=s[n],v[n]=A[r],++A[r];var g={classes:a,classIds:s,classIndexes:v,parentCounts:u,parentIndexes:i,parentIds:l};return function(t){for(var e=t.classIds.length,n=0;n<e;++n)ta(t,n,stack)}(g),g}(r,n):null}function $o(t,e,n){if(t){var r=t.parentCounts;return t.parentIds?n(t,e):r>0?function(t,e,n){var r=t.classIds,i=t.parentCounts,o=t.parentIds,a=t.parentIndexes,s=r.length,u=scratchVisited;u.length=Math.max(u.length,s);var l=++marker,c=scratchStack;c.length=0,c.push(e);for(;c.length>0;)if(u[e=c.pop()]!==l){u[e]=l;var h=n(t,e);if(Xo(h))return h;for(var f=i[e],p=a[e],d=0;d<f;++d){var A=o[p+d];A!==e&&c.push(A)}}return null}(t,e,n):function(t,e,n){var r=!0;for(;r;){var i=n(t,e);if(Xo(i))return i;var o=t.parentIds[e];r=o!==e,e=o}throw new Error("traverseHierarchySingleParent")}(t,e,n)}}function ta(t,e,n){var r=t.parentCounts,i=t.parentIds,o=t.parentIndexes,a=t.classIds.length;if(Xo(i)){assert(e<a,"Parent index ".concat(e," exceeds the total number of instances: ").concat(a)),assert(-1===n.indexOf(e),"Circular dependency detected in the batch table hierarchy."),n.push(e);for(var s=Xo(r)?r[e]:1,u=Xo(r)?o[e]:e,l=0;l<s;++l){var c=i[u+l];c!==e&&ta(t,c,n)}n.pop(e)}}function ea(t){return void 0!==t&&null!==t}var na=function(t,e){return t},ra={HIERARCHY:!0,extensions:!0,extras:!0},ia=function(){function t(e,n,r){var i,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};for(var a in(0,h.Z)(this,t),(0,d.Z)(this,"json",void 0),(0,d.Z)(this,"binary",void 0),(0,d.Z)(this,"featureCount",void 0),(0,d.Z)(this,"_extensions",void 0),(0,d.Z)(this,"_properties",void 0),(0,d.Z)(this,"_binaryProperties",void 0),(0,d.Z)(this,"_hierarchy",void 0),Cr(r>=0),this.json=e||{},this.binary=n,this.featureCount=r,this._extensions=(null===(i=this.json)||void 0===i?void 0:i.extensions)||{},this._properties={},this.json)ra[a]||(this._properties[a]=this.json[a]);this._binaryProperties=this._initializeBinaryProperties(),o["3DTILES_batch_table_hierarchy"]&&(this._hierarchy=Yo(this,this.json,this.binary))}return(0,c.Z)(t,[{key:"getExtension",value:function(t){return this.json&&this.json.extensions&&this.json.extensions[t]}},{key:"memorySizeInBytes",value:function(){return 0}},{key:"isClass",value:function(t,e){return this._checkBatchId(t),Cr("string"===typeof e,e),!!this._hierarchy&&ea($o(this._hierarchy,t,(function(t,n){var r=t.classIds[n];return t.classes[r].name===e})))}},{key:"isExactClass",value:function(t,e){return Cr("string"===typeof e,e),this.getExactClassName(t)===e}},{key:"getExactClassName",value:function(t){if(this._checkBatchId(t),this._hierarchy){var e=this._hierarchy.classIds[t];return this._hierarchy.classes[e].name}}},{key:"hasProperty",value:function(t,e){return this._checkBatchId(t),Cr("string"===typeof e,e),ea(this._properties[e])||this._hasPropertyInHierarchy(t,e)}},{key:"getPropertyNames",value:function(t,e){var n;this._checkBatchId(t),(e=ea(e)?e:[]).length=0;var r=Object.keys(this._properties);return(n=e).push.apply(n,r),this._hierarchy&&this._getPropertyNamesInHierarchy(t,e),e}},{key:"getProperty",value:function(t,e){if(this._checkBatchId(t),Cr("string"===typeof e,e),this._binaryProperties){var n=this._binaryProperties[e];if(ea(n))return this._getBinaryProperty(n,t)}var r=this._properties[e];if(ea(r))return na(r[t]);if(this._hierarchy){var i=this._getHierarchyProperty(t,e);if(ea(i))return i}}},{key:"setProperty",value:function(t,e,n){var r=this.featureCount;if(this._checkBatchId(t),Cr("string"===typeof e,e),this._binaryProperties){var i=this._binaryProperties[e];if(i)return void this._setBinaryProperty(i,t,n)}if(!this._hierarchy||!this._setHierarchyProperty(this,t,e,n)){var o=this._properties[e];ea(o)||(this._properties[e]=new Array(r),o=this._properties[e]),o[t]=na(n)}}},{key:"_checkBatchId",value:function(t){if(!(t>=0&&t<this.featureCount))throw new Error("batchId not in range [0, featureCount - 1].")}},{key:"_getBinaryProperty",value:function(t,e){return t.unpack(t.typedArray,e)}},{key:"_setBinaryProperty",value:function(t,e,n){t.pack(n,t.typedArray,e)}},{key:"_initializeBinaryProperties",value:function(){var t=null;for(var e in this._properties){var n=this._properties[e],r=this._initializeBinaryProperty(e,n);r&&((t=t||{})[e]=r)}return t}},{key:"_initializeBinaryProperty",value:function(t,e){if("byteOffset"in e){var n=e;Cr(this.binary,"Property ".concat(t," requires a batch table binary.")),Cr(n.type,"Property ".concat(t," requires a type."));var r=function(t,e,n,r){var i=t.componentType;Cr(t.componentType);var o="string"===typeof i?Jo.fromName(i):i,a=Qo[t.type],s=qo[t.type],u=Ko[t.type];return n+=t.byteOffset,{values:Jo.createTypedArray(o,e,n,a*r),type:o,size:a,unpacker:s,packer:u}}(n,this.binary.buffer,0|this.binary.byteOffset,this.featureCount);return{typedArray:r.values,componentCount:r.size,unpack:r.unpacker,pack:r.packer}}return null}},{key:"_hasPropertyInHierarchy",value:function(t,e){if(!this._hierarchy)return!1;var n=$o(this._hierarchy,t,(function(t,n){var r=t.classIds[n];return ea(t.classes[r].instances[e])}));return ea(n)}},{key:"_getPropertyNamesInHierarchy",value:function(t,e){$o(this._hierarchy,t,(function(t,n){var r=t.classIds[n],i=t.classes[r].instances;for(var o in i)i.hasOwnProperty(o)&&-1===e.indexOf(o)&&e.push(o)}))}},{key:"_getHierarchyProperty",value:function(t,e){var n=this;return $o(this._hierarchy,t,(function(t,r){var i=t.classIds[r],o=t.classes[i],a=t.classIndexes[r],s=o.instances[e];return ea(s)?ea(s.typedArray)?n._getBinaryProperty(s,a):na(s[a]):null}))}},{key:"_setHierarchyProperty",value:function(t,e,n,r){var i=this,o=$o(this._hierarchy,e,(function(t,o){var a=t.classIds[o],s=t.classes[a],u=t.classIndexes[o],l=s.instances[n];return!!ea(l)&&(Cr(o===e,'Inherited property "'.concat(n,'" is read-only.')),ea(l.typedArray)?i._setBinaryProperty(l,u,r):l[u]=na(r),!0)}));return ea(o)}}]),t}(),oa=4;function aa(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=new DataView(e);if(t.magic=r.getUint32(n,!0),n+=oa,t.version=r.getUint32(n,!0),n+=oa,t.byteLength=r.getUint32(n,!0),n+=oa,1!==t.version)throw new Error("3D Tile Version ".concat(t.version," not supported"));return n}var sa=4,ua="b3dm tile in legacy format.";function la(t,e,n){var r,i=new DataView(e);t.header=t.header||{};var o=i.getUint32(n,!0);n+=sa;var a=i.getUint32(n,!0);n+=sa;var s=i.getUint32(n,!0);n+=sa;var u=i.getUint32(n,!0);return n+=sa,s>
2=570425344?(n-=2*sa,r=o,s=a,u=0,o=0,a=0,console.warn(ua)):u>=570425344&&(n-=sa,r=s,s=o,u=a,o=0,a=0,console.warn(ua)),t.header.featureTableJsonByteLength=o,t.header.featureTableBinaryByteLength=a,t.header.batchTableJsonByteLength=s,t.header.batchTableBinaryByteLength=u,t.header.batchLength=r,n}function ca(t,e,n,r){return n=function(t,e,n,r){var i=t.header,o=i.featureTableJsonByteLength,a=i.featureTableBinaryByteLength,s=i.batchLength;if(t.featureTableJson={BATCH_LENGTH:s||0},o>0){var u=zi(e,n,o);t.featureTableJson=JSON.parse(u)}return n+=o,t.featureTableBinary=new Uint8Array(e,n,a),n+=a,n}(t,e,n),n=function(t,e,n,r){var i=t.header,o=i.batchTableJsonByteLength,a=i.batchTableBinaryByteLength;if(o>0){var s=zi(e,n,o);t.batchTableJson=JSON.parse(s),n+=o,a>0&&(t.batchTableBinary=new Uint8Array(e,n,a),t.batchTableBinary=new Uint8Array(t.batchTableBinary),n+=a)}return n}(t,e,n),n}function ha(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0],n=t>>11&31,r=t>>5&63,i=31&t;return e[0]=n<<3,e[1]=r<<2,e[2]=i<<3,e}function fa(t,e,n){if(!e&&(!t||!t.batchIds||!n))return null;var r=t.batchIds,i=t.isRGB565,o=t.pointCount;if(r&&n){for(var a=new Uint8ClampedArray(3*o),s=0;s<o;s++){var u=r[s],l=n.getProperty(u,"dimensions").map((function(t){return 255*t}));a[3*s]=l[0],a[3*s+1]=l[1],a[3*s+2]=l[2]}return{type:Go.UNSIGNED_BYTE,value:a,size:3,normalized:!0}}if(i){for(var c=new Uint8ClampedArray(3*o),h=0;h<o;h++){var f=ha(e[h]);c[3*h]=f[0],c[3*h+1]=f[1],c[3*h+2]=f[2]}return{type:Go.UNSIGNED_BYTE,value:c,size:3,normalized:!0}}return e&&e.length===3*o?{type:Go.UNSIGNED_BYTE,value:e,size:3,normalized:!0}:{type:Go.UNSIGNED_BYTE,value:e,size:4,normalized:!0}}var pa=function(t){(0,f.Z)(n,t);var e=(0,p.Z)(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(0,h.Z)(this,n),t=e.call(this,2),(0,Xt.kJ)(r)&&1===arguments.length?t.copy(r):(Xt.vc.debug&&((0,xt.u5)(r),(0,xt.u5)(i)),t[0]=r,t[1]=i),t}return(0,c.Z)(n,[{key:"set",value:function(t,e){return this[0]=t,this[1]=e,this.check()}},{key:"copy",value:function(t){return this[0]=t[0],this[1]=t[1],this.check()}},{key:"fromObject",value:function(t){return Xt.vc.debug&&((0,xt.u5)(t.x),(0,xt.u5)(t.y)),this[0]=t.x,this[1]=t.y,this.check()}},{key:"toObject",value:function(t){return t.x=this[0],t.y=this[1],t}},{key:"ELEMENTS",get:function(){return 2}},{key:"horizontalAngle",value:function(){return Math.atan2(this.y,this.x)}},{key:"verticalAngle",value:function(){return Math.atan2(this.x,this.y)}},{key:"transform",value:function(t){return this.transformAsPoint(t)}},{key:"transformAsPoint",value:function(t){return Bt.fF(this,this,t),this.check()}},{key:"transformAsVector",value:function(t){return(0,wt.pb)(this,this,t),this.check()}},{key:"transformByMatrix3",value:function(t){return Bt.kK(this,this,t),this.check()}},{key:"transformByMatrix2x3",value:function(t){return Bt.iu(this,this,t),this.check()}},{key:"transformByMatrix2",value:function(t){return Bt.c(this,this,t),this.check()}}]),n}(n(95282).Z);new pa,new pt.Z,new pa,new pa,new Uint8Array(1);function da(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:255;return(0,Xt.uZ)(t,0,e)/e*2-1}function Aa(t){return t<0?-1:1}function va(t,e,n,r){if(function(t,e){if(!t)throw new Error("math.gl assertion failed. ".concat(e))}(r),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(r.x=da(t,n),r.y=da(e,n),r.z=1-(Math.abs(r.x)+Math.abs(r.y)),r.z<0){var i=r.x;r.x=(1-Math.abs(r.y))*Aa(i),r.y=(1-Math.abs(i))*Aa(r.y)}return r.normalize()}function ga(t,e,n){return va(t,e,255,n)}var ma=new pt.Z;function ya(t,e,n){return t.isQuantized?n["3d-tiles"]&&n["3d-tiles"].decodeQuantizedPositions?(t.isQuantized=!1,function(t,e){for(var n=new pt.Z,r=new Float32Array(3*t.pointCount),i=0;i<t.pointCount;i++)n.set(e[3*i],e[3*i+1],e[3*i+2]).scale(1/t.quantizedRange).multiply(t.quantizedVolumeScale).add(t.quantizedVolumeOffset).toArray(r,3*i);return r}(t,e)):{type:Go.UNSIGNED_SHORT,value:e,size:3,normalized:!0}:e}function _a(t,e,n,r,i){return ba.apply(this,arguments)}function ba(){return(ba=(0,H.Z)((0,V.Z)().mark((function t(e,n,r,i,o){var a,s,u;return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=aa(e,n,r),r=la(e,n,r),r=ca(e,n,r),xa(e),a=wa(e),s=a.featureTable,u=a.batchTable,t.next=7,Ea(e,s,u,i,o);case 7:return Ca(e,s,i),Ba(e,s,u),ka(e,s),t.abrupt("return",r);case 11:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function xa(t){t.attributes={positions:null,colors:null,normals:null,batchIds:null}
2,t.isQuantized=!1,t.isTranslucent=!1,t.isRGB565=!1,t.isOctEncoded16P=!1}function wa(t){var e=new Wo(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",Go.FLOAT,3);var r=function(t,e){var n=null;if(!t.batchIds&&e.hasProperty("BATCH_ID")&&(t.batchIds=e.getPropertyArray("BATCH_ID",Go.UNSIGNED_SHORT,1),t.batchIds)){var r=e.getGlobalProperty("BATCH_LENGTH");if(!r)throw new Error("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");var i=t.batchTableJson,o=t.batchTableBinary;n=new ia(i,o,r)}return n}(t,e);return{featureTable:e,batchTable:r}}function Ca(t,e,n){if(!t.attributes.positions)if(e.hasProperty("POSITION"))t.attributes.positions=e.getPropertyArray("POSITION",Go.FLOAT,3);else if(e.hasProperty("POSITION_QUANTIZED")){var r=e.getPropertyArray("POSITION_QUANTIZED",Go.UNSIGNED_SHORT,3);if(t.isQuantized=!0,t.quantizedRange=65535,t.quantizedVolumeScale=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Go.FLOAT,3),!t.quantizedVolumeScale)throw new Error("QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");if(t.quantizedVolumeOffset=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Go.FLOAT,3),!t.quantizedVolumeOffset)throw new Error("QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");t.attributes.positions=ya(t,r,n)}if(!t.attributes.positions)throw new Error("Either POSITION or POSITION_QUANTIZED must be defined.")}function Ba(t,e,n){if(!t.attributes.colors){var r=null;e.hasProperty("RGBA")?(r=e.getPropertyArray("RGBA",Go.UNSIGNED_BYTE,4),t.isTranslucent=!0):e.hasProperty("RGB")?r=e.getPropertyArray("RGB",Go.UNSIGNED_BYTE,3):e.hasProperty("RGB565")&&(r=e.getPropertyArray("RGB565",Go.UNSIGNED_SHORT,1),t.isRGB565=!0),t.attributes.colors=fa(t,r,n)}e.hasProperty("CONSTANT_RGBA")&&(t.constantRGBA=e.getGlobalProperty("CONSTANT_RGBA",Go.UNSIGNED_BYTE,4))}function ka(t,e){if(!t.attributes.normals){var n=null;e.hasProperty("NORMAL")?n=e.getPropertyArray("NORMAL",Go.FLOAT,3):e.hasProperty("NORMAL_OCT16P")&&(n=e.getPropertyArray("NORMAL_OCT16P",Go.UNSIGNED_BYTE,2),t.isOctEncoded16P=!0),t.attributes.normals=function(t,e){if(!e)return null;if(t.isOctEncoded16P){for(var n=new Float32Array(3*t.pointsLength),r=0;r<t.pointsLength;r++)ga(e[2*r],e[2*r+1],ma),ma.toArray(n,3*r);return{type:Go.FLOAT,size:2,value:n}}return{type:Go.FLOAT,size:2,value:e}}(t,n)}}function Ea(t,e,n,r,i){return Sa.apply(this,arguments)}function Sa(){return(Sa=(0,H.Z)((0,V.Z)().mark((function t(e,n,r,i,o){var a,s,u,l,c,h,f,p;return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((l=e.batchTableJson&&e.batchTableJson.extensions&&e.batchTableJson.extensions["3DTILES_draco_point_compression"])&&(u=l.properties),!(c=n.getExtension("3DTILES_draco_point_compression"))){t.next=15;break}if(s=c.properties,h=c.byteOffset,f=c.byteLength,s&&Number.isFinite(h)&&f){t.next=9;break}throw new Error("Draco properties, byteOffset, and byteLength must be defined");case 9:a=e.featureTableBinary.slice(h,h+f),e.hasPositions=Number.isFinite(s.POSITION),e.hasColors=Number.isFinite(s.RGB)||Number.isFinite(s.RGBA),e.hasNormals=Number.isFinite(s.NORMAL),e.hasBatchIds=Number.isFinite(s.BATCH_ID),e.isTranslucent=Number.isFinite(s.RGBA);case 15:if(a){t.next=17;break}return t.abrupt("return",!0);case 17:return p={buffer:a,properties:(0,v.Z)((0,v.Z)({},s),u),featureTableProperties:s,batchTableProperties:u,dequantizeInShader:!1},t.next=20,Ta(e,p,i,o);case 20:return t.abrupt("return",t.sent);case 21:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Ta(t,e,n,r){return Ma.apply(this,arguments)}function Ma(){return Ma=(0,H.Z)((0,V.Z)().mark((function t(e,n,r,i){var o,a,s,u,l,c,h,f,p,d,A,g,m,y,_;return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=i.parse,delete(a=(0,v.Z)((0,v.Z)({},r),{},{draco:(0,v.Z)((0,v.Z)({},r.draco),{},{extraAttributes:n.batchTableProperties||{}})}))["3d-tiles"],t.next=5,o(n.buffer,Ro,a);case 5:if(s=t.sent,u=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,h=s.attributes.BATCH_ID&&s.attributes.BATCH_ID.value,f=u&&s.attributes.POSITION.value.quantization,p=c&&s.attributes.NORMAL.value.quantization,f&&(d=s.POSITION.data.quantization,A=d.range,e.quantizedVolumeScale=new pt.Z(A,A,A),e.quantizedVolumeOffset=new pt.Z(d.minValues),e.quantizedRange=(1<<d.quantizationBits)-1,e.isQuantizedDraco=!0),p&&(e.octEncodedRange=(1<<s.NORMAL.data.quantization.quantizationBits)-1,e.isOctEncodedDraco=!0),g={},n.batchTableProperties)for(m=0,y=Object.keys(n.batchTableProperties);m<y.length;m++)_=y[m],s.attributes[_]&&s.attributes[_].value&&(g[_.toLowerCase()]=s.attributes[_].value);e.attributes=(0,v.Z)({positions:u,colors:fa(e,l,void 0),normals:c,batchIds:h},g);case 17:case"end":return t.stop()}}),t)}))),Ma.apply(this,arguments)}var Ia={self:"undefined"!==typeof self&&self,window:"undefined"!==typeof window&&window,global:"undefined"!==typeof n.g&&n.g,document:"undefined"!==typeof document&&document},Pa=Ia.global||Ia.self||Ia.window||{},Za="object"!==typeof process||"[object process]"!==String(process)||process.browser,Da="function"===typeof importScripts,La=("undefined"!==typeof window&&window.orientation,"undefined"!==typeof process&&process.version&&/v([0-9]*)/.exec(process.version)),Oa=(La&&parseFloat(La[1]),n(2090));var Fa="3.2.12",Ra={};function za(t){return Ua.apply(this,arguments)}function Ua(){return Ua=(0,H.Z)((0,V.Z)().mark((function t(e){var n,r,i=arguments;return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=i.length>2&&void 0!==i[2]?i[2]:{},(n=i.length>1&&void 0!==i[1]?i[1]:null)&&(e=Na(e,n,r)),Ra[e]=Ra[e]||Ga(e),t.next=6,Ra[e];case 6:return t.abrupt("return",t.sent);case 7:case"end":return t.stop()}}),t)}))),Ua.apply(this,arguments)}function Na(t,e,n){if(t.startsWith("http"))return t;var r=n.modules||{};return r[t]?r[t]:Za?n.CDN?(function(t,e){if(!t)throw new Error(e||"loaders.gl assertion failed.")}(n.CDN.startsWith("http")),"".concat(n.CDN,"/").concat(e,"@").concat(Fa,"/dist/libs/").concat(t)):Da?"../src/libs/".concat(t):"modules/".concat(e,"/src/libs/").concat(t):"modules/".concat(e,"/dist/libs/").concat(t)}function Ga(t){return ja.apply(this,arguments)}function ja(){return(ja=(0,H.Z)((0,V.Z)().mark((function t(e){var n,r,i;return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.endsWith("wasm")){t.next=7;break}return t.next=3,fetch(e);case 3:return n=t.sent,t.next=6,n.arrayBuffer();case 6:return t.abrupt("return",t.sent);case 7:if(Za){t.next=20;break}if(t.prev=8,t.t0=Oa&&Oa.requireFromFile,!t.t0){t.next=14;break}return t.next=13,Oa.requireFromFile(e);case 13:t.t0=t.sent;case 14:return t.abrupt("return",t.t0);case 17:return t.prev=17,t.t1=t.catch(8),t.abrupt("return",null);case 20:if(!Da){t.next=22;break}return t.abrupt("return",importScripts(e));case 22:return t.next=24,fetch(e);case 24:return r=t.sent,t.next=27,r.text();case 27:return i=t.sent,t.abrupt("return",Va(i,e));case 29:case"end":return t.stop()}}),t,null,[[8,17]])})))).apply(this,arguments)}function Va(t,e){if(!Za)return Oa.requireFromString&&Oa.requireFromString(t,e);if(Da)return eval.call(Pa,t),null;var n=document.createElement("script");n.id=e;try{n.appendChild(document.createTextNode(t))}catch(r){n.text=t}return document.body.appendChild(n),null}var Ha,Ja,Wa="3.2.12",Qa="https://unpkg.com/@loaders.gl/textures@".concat(Wa,"/dist/libs/basis_encoder.wasm"),qa="https://unpkg.com/@loaders.gl/textures@".concat(Wa,"/dist/libs/basis_encoder.js");function Ka(t){return Xa.apply(this,arguments)}function Xa(){return(Xa=(0,H.Z)((0,V.Z)().mark((function t(e){var n;return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(n=e.modules||{}).basis){t.next=3;break}return t.abrupt("return",n.basis);case 3:return Ha=Ha||Ya(e),t.next=6,Ha;case 6:return t.abrupt("return",t.sent);case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Ya(t){return $a.apply(this,arguments)}function $a(){return($a=(0,H.Z)((0,V.Z)().mark((function t(e){var n,r,i,o;return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=null,r=null,t.t0=Promise,t.next=5,za("basis_transcoder.js","textures",e);case 5:return t.t1=t.sent,t.next=8,za("basis_transcoder.wasm","textures",e);case 8:return t.t2=t.sent,t.t3=[t.t1,t.t2],t.next=12,t.t0.all.call(t.t0,t.t3);case 12:return i=t.sent,o=(0,b.Z)(i,2),n=o[0],r=o[1],n=n||globalThis.BASIS,t.next=19,ts(n,r);case 19:return t.abrupt("return",t.sent);case 20:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function ts(t,e){var n={};return e&&(n.wasmBinary=e),new Promise((function(e){t(n).then((function(t){var n=t.BasisFile;(0,t.initializeBasis)(),e({BasisFile:n})}))}))}function es(t){return ns.apply(this,arguments)}function ns(){return(ns=(0,H.Z)((0,V.Z)().mark((function t(e){var n;return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(n=e.modules||{}).basisEncoder){t.next=3;break}return t.abrupt("return",n.basisEncoder);case 3:return Ja=Ja||rs(e),t.next=6,Ja;case 6:return t.abrupt("return",t.sent);case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function rs(t){return is.apply(this,arguments)}function is(){return(is=(0,H.Z)((0,V.Z)().mark((function t(e){var n,r,i,o;return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=null,r=null,t.t0=Promise,t.next=5,za(qa,"textures",e);case 5:return t.t1=t.sent,t.next=8,za(Qa,"textures",e);case 8:return t.t2=t.sent,t.t3=[t.t1,t.t2],t.next=12,t.t0.all.call(t.t0,t.t3);case 12:return i=t.sent,o=(0,b.Z)(i,2),n=o[0],r=o[1],n=n||globalThis.BASIS,t.next=19,os(n,r);case 19:return t.abrupt("return",t.sent);case 20:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function os(t,e){var n={};return e&&(n.wasmBinary=e),new Promise((function(e){t(n).then((function(t){var n=t.BasisFile,r=t.KTX2File,i=t.initializeBasis,o=t.BasisEncoder;i(),e({BasisFile:n,KTX2File:r,BasisEncoder:o})}))}))}var as=33776,ss=33779,us=35840,ls=35842,cs=36196,hs=37808,fs=["","WEBKIT_","MOZ_"],ps={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"},ds=null;function As(t){if(!ds){t=t||function(){try{return document.createElement("canvas").getContext("webgl")}catch(t){return null}}()||void 0,ds=new Set;var e,n=(0,j.Z)(fs);try{for(n.s();!(e=n.n()).done;){var r=e.value;for(var i in ps)if(t&&t.getExtension("".concat(r).concat(i))){var o=ps[i];ds.add(o)}}}catch(a){n.e(a)}finally{n.f()}}return ds}n(88687);var vs=[171,75,84,88,32,50,48,187,13,10,26,10];function gs(t){var e=new Uint8Array(t);return!(e.byteLength<vs.length||e[0]!==vs[0]||e[1]!==vs[1]||e[2]!==vs[2]||e[3]!==v
2s[3]||e[4]!==vs[4]||e[5]!==vs[5]||e[6]!==vs[6]||e[7]!==vs[7]||e[8]!==vs[8]||e[9]!==vs[9]||e[10]!==vs[10]||e[11]!==vs[11])}var ms={etc1:{basisFormat:0,compressed:!0,format:cs},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:as},bc3:{basisFormat:3,compressed:!0,format:ss},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:us},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:ls},"astc-4x4":{basisFormat:10,compressed:!0,format:hs},"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 ys(){return(ys=(0,H.Z)((0,V.Z)().mark((function t(e,n){var r,i,o,a,s,u;return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("auto"!==n.basis.containerFormat){t.next=11;break}if(!gs(e)){t.next=6;break}return t.next=4,es(n);case 4:return r=t.sent,t.abrupt("return",xs(r.KTX2File,e,n));case 6:return t.next=8,Ka(n);case 8:return i=t.sent,o=i.BasisFile,t.abrupt("return",_s(o,e,n));case 11:t.t0=n.basis.module,t.next="encoder"===t.t0?14:(t.t0,22);break;case 14:return t.next=16,es(n);case 16:a=t.sent,t.t1=n.basis.containerFormat,t.next="ktx2"===t.t1?20:(t.t1,21);break;case 20:return t.abrupt("return",xs(a.KTX2File,e,n));case 21:return t.abrupt("return",_s(a.BasisFile,e,n));case 22:return t.next=24,Ka(n);case 24:return s=t.sent,u=s.BasisFile,t.abrupt("return",_s(u,e,n));case 27:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function _s(t,e,n){var r=new t(new Uint8Array(e));try{if(!r.startTranscoding())throw new Error("Failed to start basis transcoding");for(var i=r.getNumImages(),o=[],a=0;a<i;a++){for(var s=r.getNumLevels(a),u=[],l=0;l<s;l++)u.push(bs(r,a,l,n));o.push(u)}return o}finally{r.close(),r.delete()}}function bs(t,e,n,r){var i=t.getImageWidth(e,n),o=t.getImageHeight(e,n),a=t.getHasAlpha(),s=Cs(r,a),u=s.compressed,l=s.format,c=s.basisFormat,h=t.getImageTranscodedSizeInBytes(e,n,c),f=new Uint8Array(h);if(!t.transcodeImage(f,e,n,c,0,0))throw new Error("failed to start Basis transcoding");return{width:i,height:o,data:f,compressed:u,format:l,hasAlpha:a}}function xs(t,e,n){var r=new t(new Uint8Array(e));try{if(!r.startTranscoding())throw new Error("failed to start KTX2 transcoding");for(var i=r.getLevels(),o=[],a=0;a<i;a++){o.push(ws(r,a,n));break}return[o]}finally{r.close(),r.delete()}}function ws(t,e,n){var r=t.getImageLevelInfo(e,0,0),i=r.alphaFlag,o=r.height,a=r.width,s=Cs(n,i),u=s.compressed,l=s.format,c=s.basisFormat,h=t.getImageTranscodedSizeInBytes(e,0,0,c),f=new Uint8Array(h);if(!t.transcodeImage(f,e,0,0,c,0,-1,-1))throw new Error("Failed to transcode KTX2 image");return{width:a,height:o,data:f,compressed:u,hasAlpha:i,format:l}}function Cs(t,e){var n=t&&t.basis&&t.basis.format;return"auto"===n&&(n=Bs()),"object"===typeof n&&(n=e?n.alpha:n.noAlpha),n=n.toLowerCase(),ms[n]}function Bs(){var t=As();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"}var ks={name:"Basis",id:"basis",module:"textures",version:"3.2.12",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"}}},Es=(0,v.Z)((0,v.Z)({},ks),{},{parse:function(t,e){return ys.apply(this,arguments)}}),Ss=("undefined"!==typeof self&&self,"undefined"!==typeof window&&window,"undefined"!==typeof n.g&&n.g,"undefined"!==typeof document&&document,Boolean("object"!==typeof process||"[object process]"!==String(process)||process.browser)),Ts="undefined"!==typeof process&&process.version&&/v([0-9]*)/.exec(process.version),Ms=(Ts&&parseFloat(Ts[1]),globalThis._parseImageNode),Is="undefined"!==typeof Image,Ps="undefined"!==typeof ImageBitmap,Zs=Boolean(Ms),Ds=!!Ss||Zs;function Ls(t){var e=Fs(t);if(!e)throw new Error("Not an image");return e}function Os(t){switch(Ls(t)){case"data":return t;case"image":case"imagebitmap":var 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 Fs(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}var Rs=/^data:image\/svg\+xml/,zs=/\.svg((\?|#).*)?$/;function Us(t){return t&&(Rs.test(t)||zs.test(t))}function Ns(t,e){if(Us(e)){var n=(new TextDecoder).decode(t);try{"function"===typeof unescape&&"function"===typeof encodeURIComponent&&(n=unescape(encodeURIComponent(n)))}catch(r){throw new Error(r.message)}return"data:image/svg+xml;base64,".concat(btoa(n))}return Gs(t,e)}function Gs(t,e){if(Us(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(t)])}function js(t,e,n){return Vs.apply(this,arguments)}function Vs(){return(Vs=(0,H.Z)((0,V.Z)().mark((function t(e,n,r){var i,o,a;return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=Ns(e,r),o=self.URL||self.webkitURL,a="string"!==typeof i&&o.createObjectURL(i),t.prev=3,t.next=6,Hs(a||i,n);case 6:return t.abrupt("return",t.sent);case 7:return t.prev=7,a&&o.revokeObjectURL(a),t.finish(7);case 10:case"end":return t.stop()}}),t,null,[[3,,7,10]])})))).apply(this,arguments)}function Hs(t,e){return Js.apply(this,arguments)}function Js(){return(Js=(0,H.Z)((0,V.Z)().mark((function t(e,n){var r;return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((r=new Image).src=e,!(n.image&&n.image.decode&&r.decode)){t.next=6;break}return t.next=5,r.decode();case 5:return t.abrupt("return",r);case 6:return t.next=8,new Promise((function(t,n){try{r.onload=function(){return t(r)},r.onerror=function(t){return n(new Error("Could not load image ".concat(e,": ").concat(t)))}}catch(i){n(i)}}));case 8:return t.abrupt("return",t.sent);case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var Ws={},Qs=!0;function qs(t,e,n){return Ks.apply(this,arguments)}function Ks(){return(Ks=(0,H.Z)((0,V.Z)().mark((function t(e,n,r){var i,o,a;return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!Us(r)){t.next=7;break}return t.next=3,js(e,n,r);case 3:o=t.sent,i=o,t.next=8;break;case 7:i=Gs(e,r);case 8:return a=n&&n.imagebitmap,t.next=11,Xs(i,a);case 11:return t.abrupt("return",t.sent);case 12:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Xs(t){return Ys.apply(this,arguments)}function Ys(){return Ys=(0,H.Z)((0,V.Z)().mark((function t(e){var n,r=arguments;return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!$s(n=r.length>1&&void 0!==r[1]?r[1]:null)&&Qs||(n=null),!n){t.next=13;break}return t.prev=3,t.next=6,createImageBitmap(e,n);case 6:return t.abrupt("return",t.sent);case 9:t.prev=9,t.t0=t.catch(3),console.warn(t.t0),Qs=!1;case 13:return t.next=15,createImageBitmap(e);case 15:return t.abrupt("return",t.sent);case 16:case"end":return t.stop()}}),t,null,[[3,9]])}))),Ys.apply(this,arguments)}function $s(t){for(var e in t||Ws)return!1;return!0}var tu=!1,eu=!0;function nu(t){var e=ru(t);return function(t){var e=ru(t),n=e.byteLength>=24&&2303741511===e.getUint32(0,tu);if(!n)return null;return{mimeType:"image/png",width:e.getUint32(16,tu),height:e.getUint32(20,tu)}}(e)||function(t){var e=ru(t),n=e.byteLength>=3&&65496===e.getUint16(0,tu)&&255===e.getUint8(2);if(!n)return null;var r=function(){for(var t=new Set([65499,65476,65484,65501,65534]),e=65504;e<65520;++e)t.add(e);var n=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:t,sofMarkers:n}}(),i=r.tableMarkers,o=r.sofMarkers,a=2;for(;a+9<e.byteLength;){var s=e.getUint16(a,tu);if(o.has(s))return{mimeType:"image/jpeg",height:e.getUint16(a+5,tu),width:e.getUint16(a+7,tu)};if(!i.has(s))return null;a+=2,a+=e.getUint16(a,tu)}return null}(e)||function(t){var e=ru(t),n=e.byteLength>=10&&1195984440===e.getUint32(0,tu);if(!n)return null;return{mimeType:"image/gif",width:e.getUint16(6,eu),height:e.getUint16(8,eu)}}(e)||function(t){var e=ru(t),n=e.byteLength>=14&&16973===e.getUint16(0,tu)&&e.getUint32(2,eu)===e.byteLength;if(!n)return null;return{mimeType:"image/bmp",width:e.getUint32(18,eu),height:e.getUint32(22,eu)}}(e)}function ru(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")}function iu(t,e){return ou.apply(this,arguments)}function ou(){return ou=(0,H.Z)((0,V.Z)().mark((function t(e,n){var r,i,o;return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=nu(e)||{},i=r.mimeType,Cr(o=globalThis._parseImageNode),t.next=5,o(e,i);case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}}),t)}))),ou.apply(this,arguments)}function au(){return(au=(0,H.Z)((0,V.Z)().mark((function t(e,n,r){var i,o,a,s,u;return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=(n=n||{}).image||{},o=i.type||"auto",a=(r||{}).url,s=su(o),t.t0=s,t.next="imagebitmap"===t.t0?8:"image"===t.t0?12:"data"===t.t0?16:20;break;case 8:return t.next=10,qs(e,n,a);case 10:return u=t.sent,t.abrupt("break",21);case 12:return t.next=14,js(e,n,a);case 14:return u=t.sent,t.abrupt("break",21);case 16:return t.next=18,iu(e,n);case 18:return u=t.sent,t.abrupt("break",21);case 20:Cr(!1);case 21:return"data"===o&&(u=Os(u)),t.abrupt("return",u);case 23:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function su(t){switch(t){case"auto":case"data":return function(){if(Ps)return"imagebitmap";if(Is)return"image";if(Ds)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(t){switch(t){case"auto":return Ps||Is||Ds;case"imagebitmap":return Ps;case"image":return Is;case"data":return Ds;default:throw new Error("@loaders.gl/images: image ".concat(t," not supported in this environment"))}}(t),t}}
2var uu={id:"image",module:"images",name:"Images",version:"3.2.12",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:function(t,e,n){return au.apply(this,arguments)},tests:[function(t){return Boolean(nu(new DataView(t)))}],options:{image:{type:"auto",decode:!0}}};function lu(t,e,n){if(t.byteLength<=e+n)return"";for(var r=new DataView(t),i="",o=0;o<n;o++)i+=String.fromCharCode(r.getUint8(e+o));return i}function cu(t){try{return JSON.parse(t)}catch(e){throw new Error('Failed to parse JSON from data starting with "'.concat(function(t){var 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 lu(t.buffer,t.byteOffset,e);if(t instanceof ArrayBuffer)return lu(t,0,e);return""}(t),'"'))}}function hu(t,e,n){var r=void 0!==n?new Uint8Array(t).subarray(e,e+n):new Uint8Array(t).subarray(e);return new Uint8Array(r).buffer}function fu(t,e){if(!t)throw new Error(e||"assert failed: gltf")}function pu(t,e){if(t.startsWith("data:")||t.startsWith("http:")||t.startsWith("https:"))return t;var 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 du(t,e,n){var r=t.bufferViews[n];fu(r);var i=e[r.buffer];fu(i);var o=(r.byteOffset||0)+i.byteOffset;return new Uint8Array(i.arrayBuffer,o,r.byteLength)}function Au(t,e){return Cr(t>=0),Cr(e>0),t+(e-1)&~(e-1)}function vu(t,e,n){var r;if(t instanceof ArrayBuffer)r=new Uint8Array(t);else{var i=t.byteOffset,o=t.byteLength;r=new Uint8Array(t.buffer||t.arrayBuffer,i,o)}return e.set(r,n),n+Au(r.byteLength,4)}var gu=["SCALAR","VEC2","VEC3","VEC4"],mu=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],yu=new Map(mu),_u={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},bu={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},xu={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function wu(t){return gu[t-1]||gu[0]}function Cu(t){var e=yu.get(t.constructor);if(!e)throw new Error("Illegal typed array");return e}function Bu(t,e){var n=xu[t.componentType],r=_u[t.type],i=bu[t.componentType],o=t.count*r,a=t.count*r*i;return fu(a>=0&&a<=e.byteLength),{ArrayType:n,length:o,byteLength:a}}var ku,Eu={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]},Su=function(){function t(e){(0,h.Z)(this,t),(0,d.Z)(this,"gltf",void 0),(0,d.Z)(this,"sourceBuffers",void 0),(0,d.Z)(this,"byteLength",void 0),this.gltf=e||{json:(0,v.Z)({},Eu),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]])}return(0,c.Z)(t,[{key:"json",get:function(){return this.gltf.json}},{key:"getApplicationData",value:function(t){return this.json[t]}},{key:"getExtraData",value:function(t){return(this.json.extras||{})[t]}},{key:"getExtension",value:function(t){var e=this.getUsedExtensions().find((function(e){return e===t})),n=this.json.extensions||{};return e?n[t]||!0:null}},{key:"getRequiredExtension",value:function(t){return this.getRequiredExtensions().find((function(e){return e===t}))?this.getExtension(t):null}},{key:"getRequiredExtensions",value:function(){return this.json.extensionsRequired||[]}},{key:"getUsedExtensions",value:function(){return this.json.extensionsUsed||[]}},{key:"getObjectExtension",value:function(t,e){return(t.extensions||{})[e]}},{key:"getScene",value:function(t){return this.getObject("scenes",t)}},{key:"getNode",value:function(t){return this.getObject("nodes",t)}},{key:"getSkin",value:function(t){return this.getObject("skins",t)}},{key:"getMesh",value:function(t){return this.getObject("meshes",t)}},{key:"getMaterial",value:function(t){return this.getObject("materials",t)}},{key:"getAccessor",value:function(t){return this.getObject("accessors",t)}},{key:"getTexture",value:function(t){return this.getObject("textures",t)}},{key:"getSampler",value:function(t){return this.getObject("samplers",t)}},{key:"getImage",value:function(t){return this.getObject("images",t)}},{key:"getBufferView",value:function(t){return this.getObject("bufferViews",t)}},{key:"getBuffer",value:function(t){return this.getObject("buffers",t)}},{key:"getObject",value:function(t,e){if("object"===typeof e)return e;var 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}},{key:"getTypedArrayForBufferView",value:function(t){var e=(t=this.getBufferView(t)).buffer,n=this.gltf.buffers[e];fu(n);var r=(t.byteOffset||0)+n.byteOffset;return new Uint8Array(n.arrayBuffer,r,t.byteLength)}},{key:"getTypedArrayForAccessor",value:function(t){t=this.getAccessor(t);var e=this.getBufferView(t.bufferView),n=this.getBuffer(e.buffer).data,r=Bu(t,e),i=r.ArrayType,o=r.length;return new i(n,e.byteOffset+t.byteOffset,o)}},{key:"getTypedArrayForImageData",value:function(t){t=this.getAccessor(t);var e=this.getBufferView(t.bufferView),n=this.getBuffer(e.buffer).data,r=e.byteOffset||0;return new Uint8Array(n,r,e.byteLength)}},{key:"addApplicationData",value:function(t,e){return this.json[t]=e,this}},{key:"addExtraData",value:function(t,e){return this.json.extras=this.json.extras||{},this.json.extras[t]=e,this}},{key:"addObjectExtension",value:function(t,e,n){return t.extensions=t.extensions||{},t.extensions[e]=n,this.registerUsedExtension(e),this}},{key:"setObjectExtension",value:function(t,e,n){(t.extensions||{})[e]=n}},{key:"removeObjectExtension",value:function(t,e){var n=t.extensions||{},r=n[e];return delete n[e],r}},{key:"addExtension",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return fu(e),this.json.extensions=this.json.extensions||{},this.json.extensions[t]=e,this.registerUsedExtension(t),e}},{key:"addRequiredExtension",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return fu(e),this.addExtension(t,e),this.registerRequiredExtension(t),e}},{key:"registerUsedExtension",value:function(t){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find((function(e){return e===t}))||this.json.extensionsUsed.push(t)}},{key:"registerRequiredExtension",value:function(t){this.registerUsedExtension(t),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find((function(e){return e===t}))||this.json.extensionsRequired.push(t)}},{key:"removeExtension",value:function(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]}},{key:"setDefaultScene",value:function(t){this.json.scene=t}},{key:"addScene",value:function(t){var e=t.nodeIndices;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:e}),this.json.scenes.length-1}},{key:"addNode",value:function(t){var e=t.meshIndex,n=t.matrix;this.json.nodes=this.json.nodes||[];var r={mesh:e};return n&&(r.matrix=n),this.json.nodes.push(r),this.json.nodes.length-1}},{key:"addMesh",value:function(t){var e=t.attributes,n=t.indices,r=t.material,i=t.mode,o=void 0===i?4:i,a={primitives:[{attributes:this._addAttributes(e),mode:o}]};if(n){var s=this._addIndices(n);a.primitives[0].indices=s}return Number.isFinite(r)&&(a.primitives[0].material=r),this.json.meshes=this.json.meshes||[],this.json.meshes.push(a),this.json.meshes.length-1}},{key:"addPointCloud",value:function(t){var 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}},{key:"addImage",value:function(t,e){var n=nu(t),r=e||(null===n||void 0===n?void 0:n.mimeType),i={bufferView:this.addBufferView(t),mimeType:r};return this.json.images=this.json.images||[],this.json.images.push(i),this.json.images.length-1}},{key:"addBufferView",value:function(t){var e=t.byteLength;fu(Number.isFinite(e)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(t);var n={buffer:0,byteOffset:this.byteLength,byteLength:e};return this.byteLength+=Au(e,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(n),this.json.bufferViews.length-1}},{key:"addAccessor",value:function(t,e){var n={bufferView:t,type:wu(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}},{key:"addBinaryBuffer",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{size:3},n=this.addBufferView(t),r={min:e.min,max:e.max};r.min&&r.max||(r=this._getAccessorMinMax(t,e.size));var i={size:e.size,componentType:Cu(t),count:Math.round(t.length/e.size),min:r.min,max:r.max};return this.addAccessor(n,Object.assign(i,e))}},{key:"addTexture",value:function(t){var e={source:t.imageIndex};return this.json.textures=this.json.textures||[],this.json.textures.push(e),this.json.textures.length-1}},{key:"addMaterial",value:function(t){return this.json.materials=this.json.materials||[],this.json.materials.push(t),this.json.materials.length-1}},{key:"createBinaryChunk",value:function(){var t,e;this.gltf.buffers=[];var n,r=this.byteLength,i=new ArrayBuffer(r),o=new Uint8Array(i),a=0,s=(0,j.Z)(this.sourceBuffers||[]);try{for(s.s();!(n=s.n()).done;){a=vu(n.value,o,a)}}catch(u){s.e(u)}finally{s.f()}null!==(t=this.json)&&void 0!==t&&null!==(e=t.buffers)&&void 0!==e&&e[0]?this.json.buffers[0].byteLength=r:this.json.buffers=[{byteLength:r}
2],this.gltf.binary=i,this.sourceBuffers=[i]}},{key:"_removeStringFromArray",value:function(t,e){for(var n=!0;n;){var r=t.indexOf(e);r>-1?t.splice(r,1):n=!1}}},{key:"_addAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e={};for(var n in t){var r=t[n],i=this._getGltfAttributeName(n),o=this.addBinaryBuffer(r.value,r);e[i]=o}return e}},{key:"_addIndices",value:function(t){return this.addBinaryBuffer(t,{size:1})}},{key:"_getGltfAttributeName",value:function(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}}},{key:"_getAccessorMinMax",value:function(t,e){var n={min:null,max:null};if(t.length<e)return n;n.min=[],n.max=[];var r,i=t.subarray(0,e),o=(0,j.Z)(i);try{for(o.s();!(r=o.n()).done;){var a=r.value;n.min.push(a),n.max.push(a)}}catch(l){o.e(l)}finally{o.f()}for(var s=e;s<t.length;s+=e)for(var u=0;u<e;u++)n.min[0+u]=Math.min(n.min[0+u],t[s+u]),n.max[0+u]=Math.max(n.max[0+u],t[s+u]);return n}}]),t}(),Tu="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9
2LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+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",Mu
vendor: 10,662 bytes, line 2
2="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",
2Iu=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]),Pu=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]),Zu={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},Du={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};function Lu(t,e,n,r,i){return Ou.apply(this,arguments)}function Ou(){return Ou=(0,H.Z)((0,V.Z)().mark((function t(e,n,r,i,o){var a,s,u=arguments;return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=u.length>5&&void 0!==u[5]?u[5]:"NONE",t.next=3,Fu();case 3:Gu(s=t.sent,s.exports[Du[o]],e,n,r,i,s.exports[Zu[a||"NONE"]]);case 5:case"end":return t.stop()}}),t)}))),Ou.apply(this,arguments)}function Fu(){return Ru.apply(this,arguments)}function Ru(){return(Ru=(0,H.Z)((0,V.Z)().mark((function t(){return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return ku||(ku=zu()),t.abrupt("return",ku);case 2:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function zu(){return Uu.apply(this,arguments)}function Uu(){return(Uu=(0,H.Z)((0,V.Z)().mark((function t(){var e,n;return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=Tu,WebAssembly.validate(Iu)&&(e=Mu,console.log("Warning: meshopt_decoder is using experimental SIMD support")),t.next=4,WebAssembly.instantiate(Nu(e),{});case 4:return n=t.sent,t.next=7,n.instance.exports.__wasm_call_ctors();case 7:return t.abrupt("return",n.instance);case 8:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Nu(t){for(var e=new Uint8Array(t.length),n=0;n<t.length;++n){var r=t.charCodeAt(n);e[n]=r>96?r-71:r>64?r-65:r>47?r+4:r>46?63:62}for(var i=0,o=0;o<t.length;++o)e[i++]=e[o]<60?Pu[e[o]]:64*(e[o]-60)+e[++o];return e.buffer.slice(0,i)}function Gu(t,e,n,r,i,o,a){var s=t.exports.sbrk,u=r+3&-4,l=s(u*i),c=s(o.length),h=new Uint8Array(t.exports.memory.buffer);h.set(o,c);var f=e(l,r,i,c,o.length);if(0===f&&a&&a(l,u,i),n.set(h.subarray(l,l+r*i)),s(l-s(0)),0!==f)throw new Error("Malformed buffer data: ".concat(f))}var ju="EXT_meshopt_compression",Vu=ju;function Hu(t,e){return Ju.apply(this,arguments)}function Ju(){return(Ju=(0,H.Z)((0,V.Z)().mark((function t(e,n){var r,i,o,a,s,u;return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=new Su(e),null!==n&&void 0!==n&&null!==(r=n.gltf)&&void 0!==r&&r.decompressMeshes){t.next=3;break}return t.abrupt("return");case 3:o=[],a=(0,j.Z)(e.json.bufferViews||[]);try{for(a.s();!(s=a.n()).done;)u=s.value,o.push(Wu(i,u))}catch(l){a.e(l)}finally{a.f()}return t.next=8,Promise.all(o);case 8:i.removeExtension(ju);case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Wu(t,e){return Qu.apply(this,arguments)}function Qu(){return(Qu=(0,H.Z)((0,V.Z)().mark((function t(e,n){var r,i,o,a,s,u,l,c,h,f,p,d,A,v;return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(r=e.getObjectExtension(n,ju))){t.next=9;break}return i=r.byteOffset,o=void 0===i?0:i,a=r.byteLength,s=void 0===a?0:a,u=r.byteStride,l=r.count,c=r.mode,h=r.filter,f=void 0===h?"NONE":h,p=r.buffer,d=e.gltf.buffers[p],A=new Uint8Array(d.arrayBuffer,d.byteOffset+o,s),v=new Uint8Array(e.gltf.buffers[n.buffer].arrayBuffer,n.byteOffset,n.byteLength),t.next=8,Lu(v,l,u,A,c,f);case 8:return t.abrupt("return",v);case 9:return t.abrupt("return",null);case 10:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var qu=["image/png","image/jpeg","image/gif"],Ku={};function Xu(t){return void 0===Ku[t]&&(Ku[t]=function(t){switch(t){case"image/webp":return function(){if(!Ss)return!1;try{return 0===document.createElement("canvas").toDataURL("image/webp").indexOf("data:image/webp")}catch(t){return!1}}();case"image/svg":return Ss;default:if(!Ss){var e=globalThis._parseImageNode;return Boolean(e)&&qu.includes(t)}return!0}}(t)),Ku[t]}var Yu="EXT_texture_webp",$u=Yu;function tl(t,e){var n=new Su(t);if(Xu("image/webp")){var r,i=n.json,o=(0,j.Z)(i.textures||[]);try{for(o.s();!(r=o.n()).done;){var a=r.value,s=n.getObjectExtension(a,Yu);s&&(a.source=s.source),n.removeObjectExtension(a,Yu)}}catch(u){o.e(u)}finally{o.f()}n.removeExtension(Yu)}else if(n.getRequiredExtensions().includes(Yu))throw new Error("gltf: Required extension ".concat(Yu," not supported by browser"))}var el="KHR_texture_basisu",nl=el;function rl(t,e){var n,r=new Su(t),i=r.json,o=(0,j.Z)(i.textures||[]);try{for(o.s();!(n=o.n()).done;){var a=n.value,s=r.getObjectExtension(a,el);s&&(a.source=s.source),r.removeObjectExtension(a,el)}}catch(u){o.e(u)}finally{o.f()}r.removeExtension(el)}function il(t){var e={};for(var n in t){var r=t[n];if("indices"!==n){var i=ol(r);e[n]=i}}return e}function ol(t){var e=function(t){var e=t,n=1,r=0;t&&t.value&&(e=t.value,n=t.size||1);e&&(ArrayBuffer.isView(e)||(e=function(t,e){var 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)),r=e.length/n);return{buffer:e,size:n,count:r}}(t),n=e.buffer,r=e.size;return{value:n,size:r,byteOffset:0,count:e.count,type:wu(r),componentType:Cu(n)}}var al=(0,V.Z)().mark(gl),sl="KHR_draco_mesh_compression",ul=sl;function ll(t,e,n){var r,i=new Su(t),o=(0,j.Z)(gl(i));try{for(o.s();!(r=o.n()).done;){var a=r.value;i.getObjectExtension(a,sl)}}catch(s){o.e(s)}finally{o.f()}}function cl(t,e,n){return hl.apply(this,arguments)}
2function hl(){return(hl=(0,H.Z)((0,V.Z)().mark((function t(e,n,r){var i,o,a,s,u,l;return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null!==n&&void 0!==n&&null!==(i=n.gltf)&&void 0!==i&&i.decompressMeshes){t.next=2;break}return t.abrupt("return");case 2:o=new Su(e),a=[],s=(0,j.Z)(gl(o));try{for(s.s();!(u=s.n()).done;)l=u.value,o.getObjectExtension(l,sl)&&a.push(pl(o,l,n,r))}catch(c){s.e(c)}finally{s.f()}return t.next=8,Promise.all(a);case 8:o.removeExtension(sl);case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function fl(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=new Su(t),i=(0,j.Z)(r.json.meshes||[]);try{for(i.s();!(e=i.n()).done;){Al(e.value,n),r.addRequiredExtension(sl)}}catch(o){i.e(o)}finally{i.f()}}function pl(t,e,n,r){return dl.apply(this,arguments)}function dl(){return dl=(0,H.Z)((0,V.Z)().mark((function t(e,n,r,i){var o,a,s,u,l,c,h,f,p,d,A,g,m,y;return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=e.getObjectExtension(n,sl)){t.next=3;break}return t.abrupt("return");case 3:return a=e.getTypedArrayForBufferView(o.bufferView),s=hu(a.buffer,a.byteOffset),u=i.parse,delete(l=(0,v.Z)({},r))["3d-tiles"],t.next=10,u(s,Ro,l,i);case 10:for(c=t.sent,h=il(c.attributes),f=0,p=Object.entries(h);f<p.length;f++)d=(0,b.Z)(p[f],2),A=d[0],g=d[1],A in n.attributes&&(m=n.attributes[A],null!==(y=e.getAccessor(m))&&void 0!==y&&y.min&&null!==y&&void 0!==y&&y.max&&(g.min=y.min,g.max=y.max));n.attributes=h,c.indices&&(n.indices=ol(c.indices)),vl(n);case 16:case"end":return t.stop()}}),t)}))),dl.apply(this,arguments)}function Al(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4,i=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;if(!i.DracoWriter)throw new Error("options.gltf.DracoWriter not provided");var a=i.DracoWriter.encodeSync({attributes:t}),s=null===o||void 0===o||null===(n=o.parseSync)||void 0===n?void 0:n.call(o,{attributes:t}),u=i._addFauxAttributes(s.attributes),l=i.addBufferView(a);return{primitives:[{attributes:u,mode:r,extensions:(0,d.Z)({},sl,{bufferView:l,attributes:u})}]}}function vl(t){if(!t.attributes&&Object.keys(t.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function gl(t){var e,n,r,i,o,a;return(0,V.Z)().wrap((function(s){for(;;)switch(s.prev=s.next){case 0:e=(0,j.Z)(t.json.meshes||[]),s.prev=1,e.s();case 3:if((n=e.n()).done){s.next=24;break}r=n.value,i=(0,j.Z)(r.primitives),s.prev=6,i.s();case 8:if((o=i.n()).done){s.next=14;break}return a=o.value,s.next=12,a;case 12:s.next=8;break;case 14:s.next=19;break;case 16:s.prev=16,s.t0=s.catch(6),i.e(s.t0);case 19:return s.prev=19,i.f(),s.finish(19);case 22:s.next=3;break;case 24:s.next=29;break;case 26:s.prev=26,s.t1=s.catch(1),e.e(s.t1);case 29:return s.prev=29,e.f(),s.finish(29);case 32:case"end":return s.stop()}}),al,null,[[1,26,29,32],[6,16,19,22]])}var ml="KHR_lights_punctual",yl=ml;function _l(t){return bl.apply(this,arguments)}function bl(){return(bl=(0,H.Z)((0,V.Z)().mark((function t(e){var n,r,i,o,a,s,u;return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=new Su(e),r=n.json,(i=n.getExtension(ml))&&(n.json.lights=i.lights,n.removeExtension(ml)),o=(0,j.Z)(r.nodes||[]);try{for(o.s();!(a=o.n()).done;)s=a.value,(u=n.getObjectExtension(s,ml))&&(s.light=u.light),n.removeObjectExtension(s,ml)}catch(l){o.e(l)}finally{o.f()}case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function xl(t){return wl.apply(this,arguments)}function wl(){return(wl=(0,H.Z)((0,V.Z)().mark((function t(e){var n,r,i,o,a,s,u;return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=new Su(e),(r=n.json).lights&&(fu(!(i=n.addExtension(ml)).lights),i.lights=r.lights,delete r.lights),n.json.lights){o=(0,j.Z)(n.json.lights);try{for(o.s();!(a=o.n()).done;)s=a.value,u=s.node,n.addObjectExtension(u,ml,s)}catch(l){o.e(l)}finally{o.f()}delete n.json.lights}case 4:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var Cl="KHR_materials_unlit",Bl=Cl;function kl(t){return El.apply(this,arguments)}function El(){return(El=(0,H.Z)((0,V.Z)().mark((function t(e){var n,r,i,o,a;return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=new Su(e),r=n.json,n.removeExtension(Cl),i=(0,j.Z)(r.materials||[]);try{for(i.s();!(o=i.n()).done;)a=o.value,a.extensions&&a.extensions.KHR_materials_unlit&&(a.unlit=!0),n.removeObjectExtension(a,Cl)}catch(s){i.e(s)}finally{i.f()}case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Sl(t){var e=new Su(t),n=e.json;if(e.materials){var r,i=(0,j.Z)(n.materials||[]);try{for(i.s();!(r=i.n()).done;){var o=r.value;o.unlit&&(delete o.unlit,e.addObjectExtension(o,Cl,{}),e.addExtension(Cl))}}catch(a){i.e(a)}finally{i.f()}}}var Tl="KHR_techniques_webgl",Ml=Tl;function Il(t){return Pl.apply(this,arguments)}function Pl(){return(Pl=(0,H.Z)((0,V.Z)().mark((function t(e){var n,r,i,o,a,s,u,l;return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=new Su(e),r=n.json,i=n.getExtension(Tl)){o=Ll(i,n),a=(0,j.Z)(r.materials||[]);try{for(a.s();!(s=a.n()).done;)u=s.value,(l=n.getObjectExtension(u,Tl))&&(u.technique=Object.assign({},l,o[l.technique]),u.technique.values=Ol(u.technique,n)),n.removeObjectExtension(u,Tl)}catch(c){a.e(c)}finally{a.f()}n.removeExtension(Tl)}case 4:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Zl(t,e){return Dl.apply(this,arguments)}function Dl(){return(Dl=(0,H.Z)((0,V.Z)().mark((function t(e,n){return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Ll(t,e){var n=t.programs,r=void 0===n?[]:n,i=t.shaders,o=void 0===i?[]:i,a=t.techniques,s=void 0===a?[]:a,u=new TextDecoder;return o.forEach((function(t){if(!Number.isFinite(t.bufferView))throw new Error("KHR_techniques_webgl: no shader code");t.code=u.decode(e.getTypedArrayForBufferView(t.bufferView))}
2)),r.forEach((function(t){t.fragmentShader=o[t.fragmentShader],t.vertexShader=o[t.vertexShader]})),s.forEach((function(t){t.program=r[t.program]})),s}function Ol(t,e){var n=Object.assign({},t.values);return Object.keys(t.uniforms||{}).forEach((function(e){t.uniforms[e].value&&!(e in n)&&(n[e]=t.uniforms[e].value)})),Object.keys(n).forEach((function(t){"object"===typeof n[t]&&void 0!==n[t].index&&(n[t].texture=e.getTexture(n[t].index))})),n}var Fl=[r,i,o,a,s,u,l];function Rl(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0,i=Fl.filter((function(t){return Nl(t.name,n)})),o=(0,j.Z)(i);try{for(o.s();!(e=o.n()).done;){var a,s=e.value;null===(a=s.preprocess)||void 0===a||a.call(s,t,n,r)}}catch(u){o.e(u)}finally{o.f()}}function zl(t){return Ul.apply(this,arguments)}function Ul(){return Ul=(0,H.Z)((0,V.Z)().mark((function t(e){var n,r,i,o,a,s,u,l=arguments;return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=l.length>1&&void 0!==l[1]?l[1]:{},r=l.length>2?l[2]:void 0,i=Fl.filter((function(t){return Nl(t.name,n)})),o=(0,j.Z)(i),t.prev=4,o.s();case 6:if((a=o.n()).done){t.next=12;break}return s=a.value,t.next=10,null===(u=s.decode)||void 0===u?void 0:u.call(s,e,n,r);case 10:t.next=6;break;case 12:t.next=17;break;case 14:t.prev=14,t.t0=t.catch(4),o.e(t.t0);case 17:return t.prev=17,o.f(),t.finish(17);case 20:case"end":return t.stop()}}),t,null,[[4,14,17,20]])}))),Ul.apply(this,arguments)}function Nl(t,e){var n,r=(null===e||void 0===e||null===(n=e.gltf)||void 0===n?void 0:n.excludeExtensions)||{};return!(t in r&&!r[t])}var Gl="KHR_binary_glTF";var jl,Vl={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},Hl={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"},Jl=function(){function t(){(0,h.Z)(this,t),(0,d.Z)(this,"idToIndexMap",{animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}}),(0,d.Z)(this,"json",void 0)}return(0,c.Z)(t,[{key:"normalize",value:function(t,e){this.json=t.json;var 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){var e,n=new Su(t),r=n.json,i=(0,j.Z)(r.images||[]);try{for(i.s();!(e=i.n()).done;){var o=e.value,a=n.getObjectExtension(o,Gl);a&&Object.assign(o,a),n.removeObjectExtension(o,Gl)}}catch(s){i.e(s)}finally{i.f()}r.buffers&&r.buffers[0]&&delete r.buffers[0].uri,n.removeExtension(Gl)}(t),this._convertObjectIdsToArrayIndices(n),this._updateObjects(n),this._updateMaterial(n)}},{key:"_addAsset",value:function(t){t.asset=t.asset||{},t.asset.version="2.0",t.asset.generator=t.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}},{key:"_convertTopLevelObjectsToArrays",value:function(t){for(var e in Vl)this._convertTopLevelObjectToArray(t,e)}},{key:"_convertTopLevelObjectToArray",value:function(t,e){var n=t[e];if(n&&!Array.isArray(n))for(var r in t[e]=[],n){var i=n[r];i.id=i.id||r;var o=t[e].length;t[e].push(i),this.idToIndexMap[e][r]=o}}},{key:"_convertObjectIdsToArrayIndices",value:function(t){for(var e in Vl)this._convertIdsToIndices(t,e);"scene"in t&&(t.scene=this._convertIdToIndex(t.scene,"scene"));var n,r=(0,j.Z)(t.textures);try{for(r.s();!(n=r.n()).done;){var i=n.value;this._convertTextureIds(i)}}catch(d){r.e(d)}finally{r.f()}var o,a=(0,j.Z)(t.meshes);try{for(a.s();!(o=a.n()).done;){var s=o.value;this._convertMeshIds(s)}}catch(d){a.e(d)}finally{a.f()}var u,l=(0,j.Z)(t.nodes);try{for(l.s();!(u=l.n()).done;){var c=u.value;this._convertNodeIds(c)}}
2catch(d){l.e(d)}finally{l.f()}var h,f=(0,j.Z)(t.scenes);try{for(f.s();!(h=f.n()).done;){var p=h.value;this._convertSceneIds(p)}}catch(d){f.e(d)}finally{f.f()}}},{key:"_convertTextureIds",value:function(t){t.source&&(t.source=this._convertIdToIndex(t.source,"image"))}},{key:"_convertMeshIds",value:function(t){var e,n=(0,j.Z)(t.primitives);try{for(n.s();!(e=n.n()).done;){var r=e.value,i=r.attributes,o=r.indices,a=r.material;for(var s in i)i[s]=this._convertIdToIndex(i[s],"accessor");o&&(r.indices=this._convertIdToIndex(o,"accessor")),a&&(r.material=this._convertIdToIndex(a,"material"))}}catch(u){n.e(u)}finally{n.f()}}},{key:"_convertNodeIds",value:function(t){var e=this;t.children&&(t.children=t.children.map((function(t){return e._convertIdToIndex(t,"node")}))),t.meshes&&(t.meshes=t.meshes.map((function(t){return e._convertIdToIndex(t,"mesh")})))}},{key:"_convertSceneIds",value:function(t){var e=this;t.nodes&&(t.nodes=t.nodes.map((function(t){return e._convertIdToIndex(t,"node")})))}},{key:"_convertIdsToIndices",value:function(t,e){t[e]||(console.warn("gltf v1: json doesn't contain attribute ".concat(e)),t[e]=[]);var n,r=(0,j.Z)(t[e]);try{for(r.s();!(n=r.n()).done;){var i=n.value;for(var o in i){var a=i[o],s=this._convertIdToIndex(a,o);i[o]=s}}}catch(u){r.e(u)}finally{r.f()}}},{key:"_convertIdToIndex",value:function(t,e){var n=Hl[e];if(n in this.idToIndexMap){var r=this.idToIndexMap[n][t];if(!Number.isFinite(r))throw new Error("gltf v1: failed to resolve ".concat(e," with id ").concat(t));return r}return t}},{key:"_updateObjects",value:function(t){var e,n=(0,j.Z)(this.json.buffers);try{for(n.s();!(e=n.n()).done;){delete e.value.type}}catch(r){n.e(r)}finally{n.f()}}},{key:"_updateMaterial",value:function(t){var e,n=(0,j.Z)(t.materials);try{var r=function(){var n=e.value;n.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};var r=(null===(i=n.values)||void 0===i?void 0:i.tex)||(null===(o=n.values)||void 0===o?void 0:o.texture2d_0)||(null===(a=n.values)||void 0===a?void 0:a.diffuseTex),s=t.textures.findIndex((function(t){return t.id===r}));-1!==s&&(n.pbrMetallicRoughness.baseColorTexture={index:s})};for(n.s();!(e=n.n()).done;){var i,o,a;r()}}catch(s){n.e(s)}finally{n.f()}}}]),t}();function Wl(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(new Jl).normalize(t,e)}var Ql={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},ql={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Kl=10240,Xl=10241,Yl=10242,$l=10243,tc=10497,ec=9729,nc=9986,rc={magFilter:Kl,minFilter:Xl,wrapS:Yl,wrapT:$l},ic=(jl={},(0,d.Z)(jl,Kl,ec),(0,d.Z)(jl,Xl,nc),(0,d.Z)(jl,Yl,tc),(0,d.Z)(jl,$l,tc),jl);var oc=function(){function t(){(0,h.Z)(this,t),(0,d.Z)(this,"baseUri",""),(0,d.Z)(this,"json",{}),(0,d.Z)(this,"buffers",[]),(0,d.Z)(this,"images",[])}return(0,c.Z)(t,[{key:"postProcess",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.json,r=t.buffers,i=void 0===r?[]:r,o=t.images,a=void 0===o?[]:o,s=t.baseUri,u=void 0===s?"":s;return fu(n),this.baseUri=u,this.json=n,this.buffers=i,this.images=a,this._resolveTree(this.json,e),this.json}},{key:"_resolveTree",value:function(t){var e=this;t.bufferViews&&(t.bufferViews=t.bufferViews.map((function(t,n){return e._resolveBufferView(t,n)}))),t.images&&(t.images=t.images.map((function(t,n){return e._resolveImage(t,n)}))),t.samplers&&(t.samplers=t.samplers.map((function(t,n){return e._resolveSampler(t,n)}))),t.textures&&(t.textures=t.textures.map((function(t,n){return e._resolveTexture(t,n)}))),t.accessors&&(t.accessors=t.accessors.map((function(t,n){return e._resolveAccessor(t,n)}))),t.materials&&(t.materials=t.materials.map((function(t,n){return e._resolveMaterial(t,n)}))),t.meshes&&(t.meshes=t.meshes.map((function(t,n){return e._resolveMesh(t,n)}))),t.nodes&&(t.nodes=t.nodes.map((function(t,n){return e._resolveNode(t,n)}))),t.skins&&(t.skins=t.skins.map((function(t,n){return e._resolveSkin(t,n)}))),t.scenes&&(t.scenes=t.scenes.map((function(t,n){return e._resolveScene(t,n)}))),void 0!==t.scene&&(t.scene=t.scenes[this.json.scene])}},{key:"getScene",value:function(t){return this._get("scenes",t)}},{key:"getNode",value:function(t){return this._get("nodes",t)}},{key:"getSkin",value:function(t){return this._get("skins",t)}},{key:"getMesh",value:function(t){return this._get("meshes",t)}},{key:"getMaterial",value:function(t){return this._get("materials",t)}},{key:"getAccessor",value:function(t){return this._get("accessors",t)}},{key:"getCamera",value:function(t){return null}},{key:"getTexture",value:function(t){return this._get("textures",t)}},{key:"getSampler",value:function(t){return this._get("samplers",t)}},{key:"getImage",value:function(t){return this._get("images",t)}},{key:"getBufferView",value:function(t){return this._get("bufferViews",t)}},{key:"getBuffer",value:function(t){return this._get("buffers",t)}},{key:"_get",value:function(t,e){if("object"===typeof e)return e;var n=this.json[t]&&this.json[t][e];return n||console.warn("glTF file error: Could not find ".concat(t,"[").concat(e,"]")),n}},{key:"_resolveScene",value:function(t,e){var n=this;return t.id=t.id||"scene-".concat(e),t.nodes=(t.nodes||[]).map((function(t){return n.getNode(t)})),t}},{key:"_resolveNode",value:function(t,e){var n=this;return t.id=t.id||"node-".concat(e),t.children&&(t.children=t.children.map((function(t){return n.getNode(t)}))),void 0!==t.mesh?t.mesh=this.getMesh(t.mesh):void 0!==t.meshes&&t.meshes.length&&(t.mesh=t.meshes.reduce((function(t,e){var r=n.getMesh(e);return t.id=r.id,t.primitives=t.primitives.concat(r.primitives),t}),{primitives:[]})),void 0!==t.camera&&(t.camera=this.getCamera(t.camera)),void 0!==t.skin&&(t.skin=this.getSkin(t.skin)),t}},{key:"_resolveSkin",value:function(t,e){return t.id=t.id||"skin-".concat(e),t.inverseBindMatrices=this.getAccessor(t.inverseBindMatrices),t}},{key:"_resolveMesh",value:function(t,e){var n=this;return t.id=t.id||"mesh-".concat(e),t.primitives&&(t.primitives=t.primitives.map((function(t){var e=(t=(0,v.Z)({},t)).attributes;for(var r in t.attributes={},e)t.attributes[r]=n.getAccessor(e[r]);return void 0!==t.indices&&(t.indices=n.getAccessor(t.indices)),void 0!==t.material&&(t.material=n.getMaterial(t.material)),t}))),t}},{key:"_resolveMaterial",value:function(t,e){if(t.id=t.id||"material-".concat(e),t.normalTexture&&(t.normalTexture=(0,v.Z)({},t.normalTexture),t.normalTexture.texture=this.getTexture(t.normalTexture.index)),t.occlusionTexture&&(t.occlustionTexture=(0,v.Z)({},t.occlustionTexture),t.occlusionTexture.texture=this.getTexture(t.occlusionTexture.index)),t.emissiveTexture&&(t.emmisiveTexture=(0,v.Z)({},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=(0,v.Z)({},t.pbrMetallicRoughness);var n=t.pbrMetallicRoughness;n.baseColorTexture&&(n.baseColorTexture=(0,v.Z)({},n.baseColorTexture),n.baseColorTexture.texture=this.getTexture(n.baseColorTexture.index)),n.metallicRoughnessTexture&&(n.metallicRoughnessTexture=(0,v.Z)({},n.metallicRoughnessTexture),n.metallicRoughnessTexture.texture=this.getTexture(n.metallicRoughnessTexture.index))}return t}},{key:"_resolveAccessor",value:function(t,e){var n,r;if(t.id=t.id||"accessor-".concat(e),void 0!==t.bufferView&&(t.bufferView=this.getBufferView(t.bufferView)),t.bytesPerComponent=(n=t.componentType,ql[n]),t.components=(r=t.type,Ql[r]),t.bytesPerElement=t.bytesPerComponent*t.components,t.bufferView){var i=t.bufferView.buffer,o=Bu(t,t.bufferView),a=o.ArrayType,s=o.byteLength,u=(t.bufferView.byteOffset||0)+(t.byteOffset||0)+i.byteOffset,l=i.arrayBuffer.slice(u,u+s);t.bufferView.byteStride&&(l=this._getValueFromInterleavedBuffer(i,u,t.bufferView.byteStride,t.bytesPerElement,t.count)),t.value=new a(l)}return t}},{key:"_getValueFromInterleavedBuffer",value:function(t,e,n,r,i){for(var o=new Uint8Array(i*r),a=0;a<i;a++){var s=e+a*n;o.set(new Uint8Array(t.arrayBuffer.slice(s,s+r)),a*r)}return o.buffer}},{key:"_resolveTexture",value:function(t,e){return t.id=t.id||"texture-".concat(e),t.sampler="sampler"in t?this.get
2Sampler(t.sampler):ic,t.source=this.getImage(t.source),t}},{key:"_resolveSampler",value:function(t,e){for(var n in t.id=t.id||"sampler-".concat(e),t.parameters={},t){var r=this._enumSamplerParameter(n);void 0!==r&&(t.parameters[r]=t[n])}return t}},{key:"_enumSamplerParameter",value:function(t){return rc[t]}},{key:"_resolveImage",value:function(t,e){t.id=t.id||"image-".concat(e),void 0!==t.bufferView&&(t.bufferView=this.getBufferView(t.bufferView));var n=this.images[e];return n&&(t.image=n),t}},{key:"_resolveBufferView",value:function(t,e){var n=t.buffer,r=(0,v.Z)((0,v.Z)({id:"bufferView-".concat(e)},t),{},{buffer:this.buffers[n]}),i=this.buffers[n].arrayBuffer,o=this.buffers[n].byteOffset||0;return"byteOffset"in t&&(o+=t.byteOffset),r.data=new Uint8Array(i,o,t.byteLength),r}},{key:"_resolveCamera",value:function(t,e){return t.id=t.id||"camera-".concat(e),t.perspective,t.orthographic,t}}]),t}();function ac(t,e){return(new oc).postProcess(t,e)}var sc=1735152710,uc=12,lc=8,cc=1313821514,hc=5130562,fc=0,pc=1,dc=0,Ac=!0;function vc(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=new DataView(e),i=function(t){var 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),o=r.getUint32(n+4,Ac),a=r.getUint32(n+8,Ac);switch(Object.assign(t,{header:{byteOffset:n,byteLength:a,hasBinChunk:!1},type:i,version:o,json:{},binChunks:[]}),n+=uc,t.version){case 1:return function(t,e,n){Cr(t.header.byteLength>uc+lc);var r=e.getUint32(n+0,Ac),i=e.getUint32(n+4,Ac);return n+=lc,Cr(i===dc),gc(t,e,n,r),n+=r,n+=mc(t,e,n,t.header.byteLength),n}(t,r,n);case 2:return function(t,e,n,r){return Cr(t.header.byteLength>uc+lc),function(t,e,n,r){for(;n+8<=t.header.byteLength;){var i=e.getUint32(n+0,Ac),o=e.getUint32(n+4,Ac);switch(n+=lc,o){case cc:gc(t,e,n,i);break;case hc:mc(t,e,n,i);break;case fc:r.strict||gc(t,e,n,i);break;case pc:r.strict||mc(t,e,n,i)}n+=Au(i,4)}}(t,e,n,r),n+t.header.byteLength}(t,r,n,{});default:throw new Error("Invalid GLB version ".concat(t.version,". Only supports v1 and v2."))}}function gc(t,e,n,r){var i=new Uint8Array(e.buffer,n,r),o=new TextDecoder("utf8").decode(i);return t.json=JSON.parse(o),Au(r,4)}function mc(t,e,n,r){return t.header.hasBinChunk=!0,t.binChunks.push({byteOffset:n,byteLength:r,arrayBuffer:e.buffer}),Au(r,4)}function yc(t,e){return _c.apply(this,arguments)}function _c(){return _c=(0,H.Z)((0,V.Z)().mark((function t(e,n){var r,i,o,a,s,u,l,c,h,f=arguments;return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=f.length>4?f[4]:void 0,bc(e,n,f.length>2&&void 0!==f[2]?f[2]:0,r=f.length>3?f[3]:void 0),Wl(e,{normalize:null===r||void 0===r||null===(o=r.gltf)||void 0===o?void 0:o.normalize}),Rl(e,r,i),l=[],null===r||void 0===r||null===(a=r.gltf)||void 0===a||!a.loadBuffers||!e.json.buffers){t.next=10;break}return t.next=10,xc(e,r,i);case 10:return null!==r&&void 0!==r&&null!==(s=r.gltf)&&void 0!==s&&s.loadImages&&(c=Cc(e,r,i),l.push(c)),h=zl(e,r,i),l.push(h),t.next=15,Promise.all(l);case 15:return t.abrupt("return",null!==r&&void 0!==r&&null!==(u=r.gltf)&&void 0!==u&&u.postProcess?ac(e,r):e);case 16:case"end":return t.stop()}}),t)}))),_c.apply(this,arguments)}function bc(t,e,n,r){(r.uri&&(t.baseUri=r.uri),e instanceof ArrayBuffer&&!function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=new DataView(t),i=n.magic,o=void 0===i?sc:i,a=r.getUint32(e,!1);return a===o||a===sc}(e,n,r))&&(e=(new TextDecoder).decode(e));if("string"===typeof e)t.json=cu(e);else if(e instanceof ArrayBuffer){var i={};n=vc(i,e,n,r.glb),fu("glTF"===i.type,"Invalid GLB magic string ".concat(i.type)),t._glb=i,t.json=i.json}else fu(!1,"GLTF: must be ArrayBuffer or string");var o=t.json.buffers||[];if(t.buffers=new Array(o.length).fill(null),t._glb&&t._glb.header.hasBinChunk){var a=t._glb.binChunks;t.buffers[0]={arrayBuffer:a[0].arrayBuffer,byteOffset:a[0].byteOffset,byteLength:a[0].byteLength}}var s=t.json.images||[];t.images=new Array(s.length).fill({})}function xc(t,e,n){return wc.apply(this,arguments)}function wc(){return wc=(0,H.Z)((0,V.Z)().mark((function t(e,n,r){var i,o,a,s,u,l,c,h;return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=e.json.buffers||[],o=0;case 2:if(!(o<i.length)){t.next=22;break}if(!(a=i[o]).uri){t.next=18;break}return fu(r.fetch),l=pu(a.uri,n),t.next=10,null===r||void 0===r||null===(s=r.fetch)||void 0===s?void 0:s.call(r,l);case 10:return c=t.sent,t.next=13,null===c||void 0===c||null===(u=c.arrayBuffer)||void 0===u?void 0:u.call(c);case 13:h=t.sent,e.buffers[o]={arrayBuffer:h,byteOffset:0,byteLength:h.byteLength},delete a.uri,t.next=19;break;case 18:null===e.buffers[o]&&(e.buffers[o]={arrayBuffer:new ArrayBuffer(a.byteLength),byteOffset:0,byteLength:a.byteLength});case 19:++o,t.next=2;break;case 22:case"end":return t.stop()}}),t)}))),wc.apply(this,arguments)}function Cc(t,e,n){return Bc.apply(this,arguments)}function Bc(){return(Bc=(0,H.Z)((0,V.Z)().mark((function t(e,n,r){var i,o,a,s,u,l;return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=kc(e),o=e.json.images||[],a=[],s=(0,j.Z)(i);try{for(s.s();!(u=s.n()).done;)l=u.value,a.push(Ec(e,o[l],l,n,r))}catch(c){s.e(c)}finally{s.f()}return t.next=7,Promise.all(a);case 7:return t.abrupt("return",t.sent);case 8:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function kc(t){var e,n=new Set,r=t.json.textures||[],i=(0,j.Z)(r);try{for(i.s();!(e=i.n()).done;){var o=e.value;void 0!==o.source&&n.add(o.source)}}catch(a){i.e(a)}finally{i.f()}return Array.from(n).sort()}function Ec(t,e,n,r,i){return Sc.apply(this,arguments)}function Sc(){return Sc=(0,H.Z)((0,V.Z)().mark((function t(e,n,r,i,o){var a,s,u,l,c,h,f;return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=o.fetch,s=o.parse,!n.uri||n.hasOwnProperty("bufferView")){t.next=9;break}return l=pu(n.uri,i),t.next=5,a(l);case 5:return c=t.sent,t.next=8,c.arrayBuffer();case 8:u=t.sent;
2case 9:return Number.isFinite(n.bufferView)&&(h=du(e.json,e.buffers,n.bufferView),u=hu(h.buffer,h.byteOffset,h.byteLength)),fu(u,"glTF image has no data"),t.next=13,s(u,[uu,Es],{mimeType:n.mimeType,basis:i.basis||{format:Bs()}},o);case 13:(f=t.sent)&&f[0]&&(f={compressed:!0,mipmaps:!1,width:f[0].width,height:f[0].height,data:f[0]}),e.images=e.images||[],e.images[r]=f;case 17:case"end":return t.stop()}}),t)}))),Sc.apply(this,arguments)}var Tc={name:"glTF",id:"gltf",module:"gltf",version:"3.2.12",extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:function(t){return Mc.apply(this,arguments)},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"}}};function Mc(){return Mc=(0,H.Z)((0,V.Z)().mark((function t(e){var n,r,i,o,a,s=arguments;return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=s.length>1&&void 0!==s[1]?s[1]:{},r=s.length>2?s[2]:void 0,(n=(0,v.Z)((0,v.Z)({},Tc.options),n)).gltf=(0,v.Z)((0,v.Z)({},Tc.options.gltf),n.gltf),i=n.byteOffset,o=void 0===i?0:i,a={},t.next=8,yc(a,e,o,n,r);case 8:return t.abrupt("return",t.sent);case 9:case"end":return t.stop()}}),t)}))),Mc.apply(this,arguments)}var Ic={URI:0,EMBEDDED:1};function Pc(t,e,n,r){t.rotateYtoZ=!0;var i=t.byteOffset+t.byteLength-n;if(0===i)throw new Error("glTF byte length must be greater than 0.");return t.gltfUpAxis=r["3d-tiles"]&&r["3d-tiles"].assetGltfUpAxis?r["3d-tiles"].assetGltfUpAxis:"Y",t.gltfArrayBuffer=hu(e,n,i),t.gltfByteOffset=0,t.gltfByteLength=i,n%4===0||console.warn("".concat(t.type,": embedded glb is not aligned to a 4-byte boundary.")),t.byteOffset+t.byteLength}function Zc(t,e,n,r){return Dc.apply(this,arguments)}function Dc(){return Dc=(0,H.Z)((0,V.Z)().mark((function t(e,n,r,i){var o,a,s;return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=r["3d-tiles"]||{},Lc(e,n,r),!o.loadGLTF){t.next=16;break}if(a=i.parse,s=i.fetch,!e.gltfUrl){t.next=9;break}return t.next=7,s(e.gltfUrl,r);case 7:e.gltfArrayBuffer=t.sent,e.gltfByteOffset=0;case 9:if(!e.gltfArrayBuffer){t.next=16;break}return t.next=12,a(e.gltfArrayBuffer,Tc,r,i);case 12:e.gltf=t.sent,delete e.gltfArrayBuffer,delete e.gltfByteOffset,delete e.gltfByteLength;case 16:case"end":return t.stop()}}),t)}))),Dc.apply(this,arguments)}function Lc(t,e,n){switch(e){case Ic.URI:var r=new Uint8Array(t.gltfArrayBuffer,t.gltfByteOffset),i=(new TextDecoder).decode(r);t.gltfUrl=i.replace(/[\s\0]+$/,""),delete t.gltfArrayBuffer,delete t.gltfByteOffset,delete t.gltfByteLength;break;case Ic.EMBEDDED:break;default:throw new Error("b3dm: Illegal glTF format field")}}function Oc(t,e,n,r,i){return Fc.apply(this,arguments)}function Fc(){return(Fc=(0,H.Z)((0,V.Z)().mark((function t(e,n,r,i,o){var a,s;return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=Rc(e,n,r,i,o),t.next=3,Zc(e,Ic.EMBEDDED,i,o);case 3:return(s=null===e||void 0===e||null===(a=e.gltf)||void 0===a?void 0:a.extensions)&&s.CESIUM_RTC&&(e.rtcCenter=s.CESIUM_RTC.center),t.abrupt("return",r);case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Rc(t,e,n,r,i){n=Pc(t,e,n=ca(t,e,n=la(t,e,n=aa(t,e,n))),r);var o=new Wo(t.featureTableJson,t.featureTableBinary);return t.rtcCenter=o.getGlobalProperty("RTC_CENTER",Go.FLOAT,3),n}function zc(t,e,n,r,i){return Uc.apply(this,arguments)}function Uc(){return(Uc=(0,H.Z)((0,V.Z)().mark((function t(e,n,r,i,o){return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=Nc(e,n,r,i,o),t.next=3,Zc(e,e.gltfFormat,i,o);case 3:return t.abrupt("return",r);case 4:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Nc(t,e,n,r,i){if(n=aa(t,e,n),1!==t.version)throw new Error("Instanced 3D Model version ".concat(t.version," is not supported"));n=la(t,e,n);var o=new DataView(e);if(t.gltfFormat=o.getUint32(n,!0),n=Pc(t,e,n=ca(t,e,n+=4),r),0===t.featureTableJsonByteLength)throw new Error("i3dm parser: featureTableJsonByteLength is zero.");var a=new Wo(t.featureTableJson,t.featureTableBinary),s=a.getGlobalProperty("INSTANCES_LENGTH");
2if(a.featuresLength=s,!Number.isFinite(s))throw new Error("i3dm parser: INSTANCES_LENGTH must be defined");t.eastNorthUp=a.getGlobalProperty("EAST_NORTH_UP"),t.rtcCenter=a.getGlobalProperty("RTC_CENTER",Go.FLOAT,3);new ia(t.batchTableJson,t.batchTableBinary,s);return function(t,e,n,r){for(var i=[new Array(r),t._batchTable][0],o=new pt.Z,a=new pt.Z,s=new pt.Z,u=new pt.Z,l=new Tt,c=new Pt.Z,h=new pt.Z,f={},p=new K.Z,d=[],A=[],v=new pt.Z,g=new pt.Z,m=0;m<r;m++){var y=void 0;if(e.hasProperty("POSITION"))y=e.getProperty("POSITION",Go.FLOAT,3,m,o);else if(e.hasProperty("POSITION_QUANTIZED")){y=e.getProperty("POSITION_QUANTIZED",Go.UNSIGNED_SHORT,3,m,o);var _=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Go.FLOAT,3,v);if(!_)throw new Error("i3dm parser: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");var b=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Go.FLOAT,3,g);if(!b)throw new Error("i3dm parser: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");for(var x=65535,w=0;w<3;w++)y[w]=y[w]/x*b[w]+_[w]}if(!y)throw new Error("i3dm: POSITION or POSITION_QUANTIZED must be defined for each instance.");o.copy(y),f.translation=o,t.normalUp=e.getProperty("NORMAL_UP",Go.FLOAT,3,m,d),t.normalRight=e.getProperty("NORMAL_RIGHT",Go.FLOAT,3,m,A);var C=!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",Go.UNSIGNED_SHORT,2,d),t.octNormalRight=e.getProperty("NORMAL_RIGHT_OCT32P",Go.UNSIGNED_SHORT,2,A),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?(wr.WGS84.eastNorthUpToFixedFrame(o,p),p.getRotationMatrix3(l)):l.identity()}C&&(u.copy(a).cross(s).normalize(),l.setColumn(0,a),l.setColumn(1,s),l.setColumn(2,u)),c.fromMatrix3(l),f.rotation=c,h.set(1,1,1);var B=e.getProperty("SCALE",Go.FLOAT,1,m);Number.isFinite(B)&&h.multiplyByScalar(B);var k=e.getProperty("SCALE_NON_UNIFORM",Go.FLOAT,3,m,d);k&&h.scale(k),f.scale=h;var E=e.getProperty("BATCH_ID",Go.UNSIGNED_SHORT,1,m);void 0===E&&(E=m);var S=(new K.Z).fromQuaternion(f.rotation);p.identity(),p.translate(f.translation),p.multiplyRight(S),p.scale(f.scale);var T=p.clone();i[m]={modelMatrix:T,batchId:E}}t.instances=i}(t,a,0,s),n}function Gc(t,e,n,r,i,o){return jc.apply(this,arguments)}function jc(){return jc=(0,H.Z)((0,V.Z)().mark((function t(e,n,r,i,o,a){var s,u;return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=aa(e,n,r),s=new DataView(n),e.tilesLength=s.getUint32(r,!0),r+=4,e.tiles=[];case 5:if(!(e.tiles.length<e.tilesLength&&e.byteLength-r>12)){t.next=13;break}return u={},e.tiles.push(u),t.next=10,a(n,r,i,o,u);case 10:r=t.sent,t.next=5;break;case 13:return t.abrupt("return",r);case 14:case"end":return t.stop()}}),t)}))),jc.apply(this,arguments)}function Vc(t,e,n,r){return Hc.apply(this,arguments)}function Hc(){return Hc=(0,H.Z)((0,V.Z)().mark((function t(e,n,r,i){var o;return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.rotateYtoZ=!0,e.gltfUpAxis=r["3d-tiles"]&&r["3d-tiles"].assetGltfUpAxis?r["3d-tiles"].assetGltfUpAxis:"Y",o=i.parse,t.next=5,o(n,Tc,r,i);case 5:e.gltf=t.sent;case 6:case"end":return t.stop()}}),t)}))),Hc.apply(this,arguments)}function Jc(t){return Wc.apply(this,arguments)}function Wc(){return Wc=(0,H.Z)((0,V.Z)().mark((function t(e){var n,r,i,o,a=arguments;return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=a.length>1&&void 0!==a[1]?a[1]:0,r=a.length>2?a[2]:void 0,i=a.length>3?a[3]:void 0,(o=a.length>4&&void 0!==a[4]?a[4]:{}).byteOffset=n,o.type=Ui(e,n),t.t0=o.type,t.next=t.t0===Ri.COMPOSITE?9:t.t0===Ri.BATCHED_3D_MODEL?12:t.t0===Ri.GLTF?15:t.t0===Ri.INSTANCED_3D_MODEL?18:t.t0===Ri.POINT_CLOUD?21:24;break;case 9:return t.next=11,Gc(o,e,n,r,i,Jc);case 11:case 14:case 17:case 20:case 23:return t.abrupt("return",t.sent);case 12:return t.next=14,Oc(o,e,n,r,i);case 15:return t.next=17,Vc(o,e,r,i);case 18:return t.next=20,zc(o,e,n,r,i);case 21:return t.next=23,_a(o,e,n,r,i);case 24:throw new Error("3DTileLoader: unknown type ".concat(o.type));case 25:case"end":return t.stop()}}),t)}))),Wc.apply(this,arguments)}var Qc=n(6386),qc=1952609651,Kc=1;function Xc(){return(Xc=(0,H.Z)((0,V.Z)().mark((function t(e){var n,r,i,o,a,s,u;return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(new Uint32Array(e.slice(0,4))[0]===qc){t.next=3;break}throw new Error("Wrong subtree file magic number");case 3:if(new Uint32Array(e.slice(4,8))[0]===Kc){t.next=6;break}throw new Error("Wrong subtree file verson, must be 1");
2case 6:if(n=th(e.slice(8,16)),r=new Uint8Array(e,24,n),i=new TextDecoder("utf8"),o=i.decode(r),a=JSON.parse(o),s=th(e.slice(16,24)),u=new ArrayBuffer(0),s&&(u=e.slice(24+n)),!("bufferView"in a.tileAvailability)){t.next=18;break}return t.next=17,Yc(a,"tileAvailability",u);case 17:a.tileAvailability.explicitBitstream=t.sent;case 18:if(!("bufferView"in a.contentAvailability)){t.next=22;break}return t.next=21,Yc(a,"contentAvailability",u);case 21:a.contentAvailability.explicitBitstream=t.sent;case 22:if(!("bufferView"in a.childSubtreeAvailability)){t.next=26;break}return t.next=25,Yc(a,"childSubtreeAvailability",u);case 25:a.childSubtreeAvailability.explicitBitstream=t.sent;case 26:return t.abrupt("return",a);case 27:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Yc(t,e,n){return $c.apply(this,arguments)}function $c(){return($c=(0,H.Z)((0,V.Z)().mark((function t(e,n,r){var i,o,a,s,u;return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=e[n].bufferView,o=e.bufferViews[i],!(a=e.buffers[o.buffer]).uri){t.next=11;break}return t.next=6,(0,Qc.d)(a.uri);case 6:return s=t.sent,t.next=9,s.arrayBuffer();case 9:return u=t.sent,t.abrupt("return",new Uint8Array(u,o.byteOffset,o.byteLength));case 11:return t.abrupt("return",new Uint8Array(r,o.byteOffset,o.byteLength));case 12:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function th(t){var e=new DataView(t),n=e.getUint32(0,!0),r=e.getUint32(4,!0);return n+Math.pow(2,32)*r}var eh={id:"3d-tiles-subtree",name:"3D Tiles Subtree",module:"3d-tiles",version:Fi,extensions:["subtree"],mimeTypes:["application/octet-stream"],tests:["subtree"],parse:function(t){return Xc.apply(this,arguments)},options:{}},nh={QUADTREE:4,OCTREE:8};function rh(t){return ih.apply(this,arguments)}function ih(){return ih=(0,H.Z)((0,V.Z)().mark((function t(e){var n,r,i,o,a,s,u,l,c,h,f,p,d,A,v,g,m,y,_,b,x,w,C,B,k,E,S,T,M,I,P,Z,D,L,O,F,R,z,U,N;return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.options,r=e.parentData,i=void 0===r?{mortonIndex:0,x:0,y:0,z:0}:r,o=e.childIndex,a=void 0===o?0:o,s=e.globalData,u=void 0===s?{level:0,mortonIndex:0,x:0,y:0,z:0}:s,l=e.subtree,c=e.level,h=void 0===c?0:c,f=n.subdivisionScheme,p=n.subtreeLevels,d=n.maximumLevel,A=n.contentUrlTemplate,v=n.subtreesUriTemplate,g=n.basePath,m={children:[],lodMetricValue:0,contentUrl:""},y=nh[f],_=1&a,b=a>>1&1,x=a>>2&1,w=(Math.pow(y,h)-1)/(y-1),C=sh(i.mortonIndex,a),B=w+C,k=sh(i.x,_),E=sh(i.y,b),S=sh(i.z,x),T=!1,h+1>p&&(T=oh(l.childSubtreeAvailability,C)),M=sh(u.x,k),I=sh(u.y,E),P=sh(u.z,S),Z=h+u.level,!T){t.next=38;break}return D="".concat(g,"/").concat(v),L=uh(D,Z,M,I,P),t.next=25,(0,$n.z)(L,eh);case 25:O=t.sent,l=O,u.mortonIndex=C,u.x=k,u.y=E,u.z=S,u.level=h,C=0,B=0,k=0,E=0,S=0,h=0;case 38:if(oh(l.tileAvailability,B)&&!(h>d)){t.next=41;break}return t.abrupt("return",m);case 41:oh(l.contentAvailability,B)&&(m.contentUrl=uh(A,Z,M,I,P)),F=h+1,R={mortonIndex:C,x:k,y:E,z:S},z=0;case 46:if(!(z<y)){t.next=54;break}return t.next=49,rh({subtree:l,options:n,parentData:R,childIndex:z,level:F,globalData:u});case 49:((U=t.sent).contentUrl||U.children.length)&&(N=ah(U,Z+1,{childTileX:k,childTileY:E,childTileZ:S},n),m.children.push(N));case 51:z++,t.next=46;break;case 54:return t.abrupt("return",m);case 55:case"end":return t.stop()}}),t)}))),ih.apply(this,arguments)}function oh(t,e){return"constant"in t?Boolean(t.constant):!!t.explicitBitstream&&function(t,e){var n=Math.floor(t/8),r=t%8;return 1===(e[n]>>r&1)}(e,t.explicitBitstream)}function ah(t,e,n,r){var i=r.basePath,o=r.refine,a=r.getRefine,s=r.lodMetricType,u=r.getTileType,l=r.rootLodMetricValue,c=r.rootBoundingVolume,h=t.contentUrl&&t.contentUrl.replace("".concat(i,"/"),""),f=l/Math.pow(2,e),p=function(t,e,n){if(e.region){var r=n.childTileX,i=n.childTileY,o=n.childTileZ,a=(0,b.Z)(e.region,6),s=a[0],u=a[1],l=a[2],c=a[3],h=a[4],f=a[5],p=Math.pow(2,t),d=(l-s)/p,A=(c-u)/p,v=(f-h)/p;return{region:[s+d*r,u+A*i,s+d*(r+1),u+A*(i+1),h+v*o,h+v*(o+1)]}}return console.warn("Unsupported bounding volume type: ",e),null}(e,c,n);return{children:t.children,contentUrl:t.contentUrl,content:{uri:h},id:t.contentUrl,refine:a(o),type:u(t),lodMetricType:s,lodMetricValue:f,boundingVolume:p}}function sh(t,e){return parseInt(t.toString(2)+e.toString(2),2)}function uh(t,e,n,r,i){var o=function(t){var e={};for(var n in t)e["{".concat(n,"}")]=t[n];return e}({level:e,x:n,y:r,z:i});return t.replace(/{level}|{x}
2|{y}|{z}/gi,(function(t){return o[t]}))}function lh(t){if(!t.contentUrl)return Qr.EMPTY;var e=t.contentUrl.split(".").pop();switch(e){case"pnts":return Qr.POINTCLOUD;case"i3dm":case"b3dm":case"glb":case"gltf":return Qr.SCENEGRAPH;default:return e}}function ch(t){switch(t){case"REPLACE":case"replace":return Wr.REPLACE;case"ADD":case"add":return Wr.ADD;default:return t}}function hh(t,e){if(/^[a-z][0-9a-z+.-]*:/i.test(e)){var n=new URL(t,"".concat(e,"/"));return decodeURI(n.toString())}return t.startsWith("/")?t:"".concat(e,"/").concat(t)}function fh(t,e){if(!t)return null;if(t.content){var n=t.content.uri||t.content.url;t.contentUrl=hh(n,e.basePath)}return t.id=t.contentUrl,t.lodMetricType=Kr.GEOMETRIC_ERROR,t.lodMetricValue=t.geometricError,t.transformMatrix=t.transform,t.type=lh(t),t.refine=ch(t.refine),t}function ph(t){var e=t.basePath,n=fh(t.root,t),r=[];for(r.push(n);r.length>0;){var i,o=(r.pop()||{}).children||[],a=(0,j.Z)(o);try{for(a.s();!(i=a.n()).done;){var s=i.value;fh(s,{basePath:e}),r.push(s)}}catch(u){a.e(u)}finally{a.f()}}return n}function dh(t){return Ah.apply(this,arguments)}function Ah(){return(Ah=(0,H.Z)((0,V.Z)().mark((function t(e){var n,r,i,o,a,s,u,l,c,h,f,p,d,A;return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.root){t.next=2;break}return t.abrupt("return",null);case 2:return n=e.basePath,r=e.root.extensions["3DTILES_implicit_tiling"],i=r.subdivisionScheme,o=r.maximumLevel,a=r.subtreeLevels,s=r.subtrees.uri,u=uh(s,0,0,0,0),l=hh(u,n),t.next=9,(0,$n.z)(l,eh);case 9:return c=t.sent,h=hh(e.root.content.uri,n),f=e.root.refine,p=e.root.geometricError,d=e.root.boundingVolume,A={contentUrlTemplate:h,subtreesUriTemplate:s,subdivisionScheme:i,subtreeLevels:a,maximumLevel:o,refine:f,basePath:n,lodMetricType:Kr.GEOMETRIC_ERROR,rootLodMetricValue:p,rootBoundingVolume:d,getTileType:lh,getRefine:ch},t.next=17,vh(e.root,c,A);case 17:return t.abrupt("return",t.sent);case 18:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function vh(t,e,n){return gh.apply(this,arguments)}function gh(){return(gh=(0,H.Z)((0,V.Z)().mark((function t(e,n,r){var i,o,a;return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e){t.next=2;break}return t.abrupt("return",null);case 2:return e.lodMetricType=Kr.GEOMETRIC_ERROR,e.lodMetricValue=e.geometricError,e.transformMatrix=e.transform,t.next=7,rh({subtree:n,options:r});case 7:return i=t.sent,o=i.children,(a=i.contentUrl)&&(e.contentUrl=a,e.content={uri:a.replace("".concat(r.basePath,"/"),"")}),e.refine=ch(e.refine),e.type=lh(e),e.children=o,e.id=e.contentUrl,t.abrupt("return",e);case 16:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var mh="3DTILES_implicit_tiling",yh={id:"3d-tiles",name:"3D Tiles",module:"3d-tiles",version:Fi,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],tests:["cmpt","pnts","b3dm","i3dm"],parse:function(t,e,n){return Ch.apply(this,arguments)},options:{"3d-tiles":{loadGLTF:!0,decodeQuantizedPositions:!1,isTileset:"auto",assetGltfUpAxis:null}}};function _h(t,e,n){return bh.apply(this,arguments)}function bh(){return(bh=(0,H.Z)((0,V.Z)().mark((function t(e,n,r){var i;return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i={content:{featureIds:null}},0,t.next=4,Jc(e,0,n,r,i.content);case 4:return t.abrupt("return",i.content);case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function xh(t,e,n){return wh.apply(this,arguments)}function wh(){return(wh=(0,H.Z)((0,V.Z)().mark((function t(e,n,r){var i,o;return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((o=JSON.parse((new TextDecoder).decode(e))).loader=n.loader||yh,o.url=r.url,o.basePath=Br(o.url),!Bh(o)){t.next=10;break}return t.next=7,dh(o);case 7:t.t0=t.sent,t.next=11;break;case 10:t.t0=ph(o);case 11:return o.root=t.t0,o.type=qr.TILES3D,o.lodMetricType=Kr.GEOMETRIC_ERROR,o.lodMetricValue=(null===(i=o.root)||void 0===i?void 0:i.lodMetricValue)||0,t.abrupt("return",o);case 16:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Ch(){return(Ch=(0,H.Z)((0,V.Z)().mark((function t(e,n,r){var i;return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=n["3d-tiles"]||{},!("auto"===i.isTileset?r.url&&-1!==r.url.indexOf(".json"):i.isTileset)){t.next=8;break}return t.next=5,xh(e,n,r);case 5:e=t.sent,t.next=11;break;case 8:return t.next=10,_h(e,n,r);case 10:e=t.sent;case 11:return t.abrupt("return",e);case 12:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Bh(t){var e,n;return(null===t||void 0===t||null===(e=t.extensionsRequired)||void 0===e?void 0:e.includes(mh))&&(null===t||void 0===t||null===(n=t.extensionsUsed)||void 0===n?void 0:n.includes(mh))}var kh=[0],Eh={getPointColor:{type:"accessor",value:[0,0,0,255]},pointSize:1,data:null,loader:yh,onTilesetLoad:{type:"function",value:function(t){},compare:!1},onTileLoad:{type:"function",value:function(t){},compare:!1},onTileUnload:{type:"function",value:function(t){},compare:!1},onTileError:{type:"function",value:function(t,e,n){},compare:!1},_getMeshColor:{type:"function",value:function(t){return[255,255,255]},compare:!1}},Sh=function(t){(0,f.Z)(n,t);var e=(0,p.Z)(n);function n(){var t;(0,h.Z)(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),(0,d.Z)((0,q.Z)(t),"state",void 0),t}return(0,c.Z)(n,[{key:"initializeState",value:function(){"onTileLoadFail"in this.props&&J.Z.removed("onTileLoadFail","onTileError")(),this.state={layerMap:{},tileset3d:null,activeViewports:{},lastUpdatedViewports:null}}},{key:"isLoaded",get:function(){var t=this.state.tileset3d;return null!==t&&t.isLoaded()}},{key:"shouldUpdateState",value:function(t){return t.changeFlags.somethingChanged}},{key:"updateState",value:function(t){var e=t.props,n=t.oldProps,r=t.changeFlags;if(e.data&&e.data!==n.data&&this._loadTileset(e.data),r.viewportChanged){var i=this.state.activeViewports;Object.keys(i).length&&(this._updateTileset(i),this.state.lastUpdatedViewports=i,this.state.activeViewports={})}if(r.propsChanged){var o=this.state.layerMap;for(var a in o)o[a].needsUpdate=!0}}},{key:"activateViewport",value:function(t){var e=this.state,n=e.activeViewports,r=e.lastUpdatedViewports;this.internalState.viewport=t,n[t.id]=t;var i=null===r||void 0===r?void 0:r[t.id];i&&t.equals(i)||(this.setChangeFlags({viewportChanged:!0}),this.setNeedsUpdate())}},{key:"getPickingInfo",value:function(t){var e=t.info,n=t.sourceLayer,r=this.state.layerMap,i=n&&n.id;if(i){var o=i.substring(this.id.length+1),a=o.substring(o.indexOf("-")+1);e.object=r[a]&&r[a].tile}return e}},{key:"filterSubLayer",value:function(t){var e=t.layer,n=t.viewport,r=e.props.tile,i=n.id;return r.selected&&r.viewportIds.includes(i)}},{key:"_updateAutoHighlight",value:function(t){t.sourceLayer&&t.sourceLayer.updateAutoHighlight(t)}},{key:"_loadTileset",value:function(){var t=(0,H.Z)((0,V.Z)().mark((function t(e){var n,r,i,o,a,s,u;return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=this.props.loadOptions,r=void 0===n?{}:n,i=this.props.loader||this.props.loaders,Array.isArray(i)&&(i=i[0]),o={loadOptions:(0,v.Z)({},r)},!i.preload){t.next=10;break}return t.next=7,i.preload(e,r);case 7:(a=t.sent).headers&&(o.loadOptions.fetch=(0,v.Z)((0,v.Z)({},o.loadOptions.fetch),{},{headers:a.headers})),Object.assign(o,a);case 10:return t.next=12,(0,$n.z)(e,i,o.loadOptions);case 12:s=t.sent,u=new Oi(s,(0,v.Z)({onTileLoad:this._onTileLoad.bind(this),onTileUnload:this._onTileUnload.bind(this),onTileError:this.props.onTileError},o)),this.setState({tileset3d:u,layerMap:{}}),this._updateTileset(this.state.activeViewports),this.props.onTilesetLoad(u);case 17:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"_onTileLoad",value:function(t){var e=this.state.lastUpdatedViewports;this.props.onTileLoad(t),this._updateTileset(e),this.setNeedsUpdate()}},{key:"_onTileUnload",value:function(t){delete this.state.layerMap[t.id],this.props.onTileUnload(t)}},{key:"_updateTileset",value:function(t){var e=this;if(t){var n=this.state.tileset3d,r=this.context.timeline,i=Object.keys(t).length;r&&i&&n&&n.selectTiles(Object.values(t)).then((function(t){e.state.frameNumber!==t&&e.setState({frameNumber:t})}))}}},{key:"_getSubLayer",value:function(t,e){if(!t.content)return null;switch(t.type){case Qr.POINTCLOUD:return this._makePointCloudLayer(t,e);case Qr.SCENEGRAPH:return this._make3DModelLayer(t);case Qr.MESH:return this._makeSimpleMeshLayer(t,e);default:throw new Error("Tile3DLayer: Failed to render layer of type ".concat(t.content.type))}}},{key:"_makePointCloudLayer",value:function(t,e){var n=t.content,r=n.attributes,i=n.pointCount,o=n.constantRGBA,a=n.cartographicOrigin,s=n.modelMatrix,u=r.positions,l=r.normals,c=r.colors;if(!u)return null;var h=e&&e.props.data||{header:{vertexCount:i},attributes:{POSITION:u,NORMAL:l,COLOR_0:c}
2},f=this.props,p=f.pointSize,d=f.getPointColor;return new(this.getSubLayerClass("pointcloud",Jn.Z))({pointSize:p},this.getSubLayerProps({id:"pointcloud"}),{id:"".concat(this.id,"-pointcloud-").concat(t.id),tile:t,data:h,coordinateSystem:Y.Df.METER_OFFSETS,coordinateOrigin:a,modelMatrix:s,getColor:o||d,_offset:0})}},{key:"_make3DModelLayer",value:function(t){var e=t.content,n=e.gltf,r=e.instances,i=e.cartographicOrigin,o=e.modelMatrix;return new(this.getSubLayerClass("scenegraph",Wn.Z))({_lighting:"pbr"},this.getSubLayerProps({id:"scenegraph"}),{id:"".concat(this.id,"-scenegraph-").concat(t.id),tile:t,data:r||kh,scenegraph:n,coordinateSystem:Y.Df.METER_OFFSETS,coordinateOrigin:i,modelMatrix:o,getTransformMatrix:function(t){return t.modelMatrix},getPosition:[0,0,0],_offset:0})}},{key:"_makeSimpleMeshLayer",value:function(t,e){var n=t.content,r=n.attributes,i=n.indices,o=n.modelMatrix,a=n.cartographicOrigin,s=n.coordinateSystem,u=void 0===s?Y.Df.METER_OFFSETS:s,l=n.material,c=n.featureIds,h=this.props._getMeshColor,f=e&&e.props.mesh||new Hn.Z({drawMode:4,attributes:Th(r),indices:i});return new(this.getSubLayerClass("mesh",Yn))(this.getSubLayerProps({id:"mesh"}),{id:"".concat(this.id,"-mesh-").concat(t.id),tile:t,mesh:f,data:kh,getColor:h(t),pbrMaterial:l,modelMatrix:o,coordinateOrigin:a,coordinateSystem:u,featureIds:c,_offset:0})}},{key:"renderLayers",value:function(){var t=this,e=this.state,n=e.tileset3d,r=e.layerMap;return n?n.tiles.map((function(e){var n=r[e.id]=r[e.id]||{tile:e},i=n.layer;return e.selected&&(i?n.needsUpdate&&(i=t._getSubLayer(e,i),n.needsUpdate=!1):i=t._getSubLayer(e)),n.layer=i,i})).filter(Boolean):null}}]),n}(g.Z);function Th(t){var e={};return e.positions=(0,v.Z)((0,v.Z)({},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,d.Z)(Sh,"defaultProps",Eh),(0,d.Z)(Sh,"layerName","Tile3DLayer");var Mh={name:"Terrain",id:"terrain",module:"terrain",version:"3.2.12",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}}},Ih=[1],Ph=(0,v.Z)((0,v.Z)({},$e.defaultProps),{},{elevationData:Ie,texture:(0,v.Z)((0,v.Z)({},Ie),{},{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:{type:"string",value:null},wireframe:!1,material:!0,loaders:[Mh]});function Zh(t){return Array.isArray(t)?t.join(";"):t||""}var Dh=function(t){(0,f.Z)(n,t);var e=(0,p.Z)(n);function n(){var t;(0,h.Z)(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),(0,d.Z)((0,q.Z)(t),"state",void 0),t}return(0,c.Z)(n,[{key:"updateState",value:function(t){var e=t.props,n=t.oldProps,r=e.elevationData!==n.elevationData;if(r){var i=e.elevationData,o=i&&(Array.isArray(i)||i.includes("{x}")&&i.includes("{y}"));this.setState({isTiled:o})}var a=r||e.meshMaxError!==n.meshMaxError||e.elevationDecoder!==n.elevationDecoder||e.bounds!==n.bounds;if(!this.state.isTiled&&a){var s=this.loadTerrain(e);this.setState({terrain:s})}e.workerUrl&&J.Z.removed("workerUrl","loadOptions.terrain.workerUrl")()}},{key:"loadTerrain",value:function(t){var e,n=t.elevationData,r=t.bounds,i=t.elevationDecoder,o=t.meshMaxError,a=t.signal;if(!n)return null;var s=this.getLoadOptions();return s=(0,v.Z)((0,v.Z)({},s),{},{terrain:(0,v.Z)((0,v.Z)({skirtHeight:this.state.isTiled?2*o:0},null===(e=s)||void 0===e?void 0:e.terrain),{},{bounds:r,meshMaxError:o,elevationDecoder:i})}),(0,this.props.fetch)(n,{propName:"elevationData",layer:this,loadOptions:s,signal:a})}},{key:"getTiledTerrainData",value:function(t){var e=this.props,n=e.elevationData,r=e.fetch,i=e.texture,o=e.elevationDecoder,a=e.meshMaxError,s=this.context.viewport,u=Ze(n,t),l=i&&Ze(i,t),c=t.signal,h=[0,0],f=[0,0];if(s.isGeospatial){var p=t.bbox;h=s.projectFlat([p.west,p.south]),f=s.projectFlat([p.east,p.north])}else{var d=t.bbox;
2h=[d.left,d.bottom],f=[d.right,d.top]}var A=[h[0],h[1],f[0],f[1]],v=this.loadTerrain({elevationData:u,bounds:A,elevationDecoder:o,meshMaxError:a,signal:c}),g=l?r(l,{propName:"texture",layer:this,loaders:[],signal:c}).catch((function(t){return null})):Promise.resolve(null);return Promise.all([v,g])}},{key:"renderSubLayers",value:function(t){var e=this.getSubLayerClass("mesh",Xn.Z),n=this.props,r=n.color,i=n.wireframe,o=n.material,a=t.data;if(!a)return null;var s=(0,b.Z)(a,2),u=s[0],l=s[1];return new e(t,{data:Ih,mesh:u,texture:l,_instanced:!1,coordinateSystem:Y.Df.CARTESIAN,getPosition:function(t){return[0,0,0]},getColor:r,wireframe:i,material:o})}},{key:"onViewportLoad",value:function(t){if(t){var e=this.state.zRange,n=t.map((function(t){return t.content})).filter(Boolean).map((function(t){return t[0].header.boundingBox.map((function(t){return t[2]}))}));if(0!==n.length){var r=Math.min.apply(Math,(0,Q.Z)(n.map((function(t){return t[0]})))),i=Math.max.apply(Math,(0,Q.Z)(n.map((function(t){return t[1]}))));(!e||r<e[0]||i>e[1])&&this.setState({zRange:[r,i]})}}}},{key:"renderLayers",value:function(){var t=this.props,e=t.color,n=t.material,r=t.elevationData,i=t.texture,o=t.wireframe,a=t.meshMaxError,s=t.elevationDecoder,u=t.tileSize,l=t.maxZoom,c=t.minZoom,h=t.extent,f=t.maxRequests,p=t.onTileLoad,d=t.onTileUnload,A=t.onTileError,v=t.maxCacheSize,g=t.maxCacheByteSize,m=t.refinementStrategy;return this.state.isTiled?new $e(this.getSubLayerProps({id:"tiles"}),{getTileData:this.getTiledTerrainData.bind(this),renderSubLayers:this.renderSubLayers.bind(this),updateTriggers:{getTileData:{elevationData:Zh(r),texture:Zh(i),meshMaxError:a,elevationDecoder:s}},onViewportLoad:this.onViewportLoad.bind(this),zRange:this.state.zRange||null,tileSize:u,maxZoom:l,minZoom:c,extent:h,maxRequests:f,onTileLoad:p,onTileUnload:d,onTileError:A,maxCacheSize:v,maxCacheByteSize:g,refinementStrategy:m}):new(this.getSubLayerClass("mesh",Xn.Z))(this.getSubLayerProps({id:"mesh"}),{data:Ih,mesh:this.state.terrain,texture:i,_instanced:!1,getPosition:function(t){return[0,0,0]},getColor:e,material:n,wireframe:o})}}]),n}(g.Z);(0,d.Z)(Dh,"defaultProps",Ph),(0,d.Z)(Dh,"layerName","TerrainLayer");var Lh=n(23595);function Oh(t,e,n){var r=Fh(t),i=Object.keys(r).filter((function(t){return r[t]!==Array}));return function(t,e,n){for(var r=e.pointPositionsCount,i=e.pointFeaturesCount,o=e.linePositionsCount,a=e.linePathsCount,s=e.lineFeaturesCount,u=e.polygonPositionsCount,l=e.polygonObjectsCount,c=e.polygonRingsCount,h=e.polygonFeaturesCount,f=e.propArrayTypes,p=e.coordLength,d=n.numericPropKeys,A=void 0===d?[]:d,g=n.PositionDataType,m=void 0===g?Float32Array:g,y=(t[0]&&"id"in t[0]),_=t.length>65535?Uint32Array:Uint16Array,b={type:"Point",positions:new m(r*p),globalFeatureIds:new _(r),featureIds:i>65535?new Uint32Array(r):new Uint16Array(r),numericProps:{},properties:[],fields:[]},x={type:"LineString",pathIndices:o>65535?new Uint32Array(a+1):new Uint16Array(a+1),positions:new m(o*p),globalFeatureIds:new _(o),featureIds:s>65535?new Uint32Array(o):new Uint16Array(o),numericProps:{},properties:[],fields:[]},w={type:"Polygon",polygonIndices:u>65535?new Uint32Array(l+1):new Uint16Array(l+1),primitivePolygonIndices:u>65535?new Uint32Array(c+1):new Uint16Array(c+1),positions:new m(u*p),triangles:[],globalFeatureIds:new _(u),featureIds:h>65535?new Uint32Array(u):new Uint16Array(u),numericProps:{},properties:[],fields:[]},C=0,B=[b,x,w];C<B.length;C++){var k,E=B[C],S=(0,j.Z)(A);try{for(S.s();!(k=S.n()).done;){var T=k.value,M=f[T];E.numericProps[T]=new M(E.positions.length/p)}}catch(F){S.e(F)}finally{S.f()}}x.pathIndices[a]=o,w.polygonIndices[l]=u,w.primitivePolygonIndices[c]=u;var I,P={pointPosition:0,pointFeature:0,linePosition:0,linePath:0,lineFeature:0,polygonPosition:0,polygonObject:0,polygonRing:0,polygonFeature:0,feature:0},Z=(0,j.Z)(t);try{for(Z.s();!(I=Z.n()).done;){var D=I.value,L=D.geometry,O=D.properties||{};switch(L.type){case"Point":Rh(L,b,P,p,O),b.properties.push(Vh(O,A)),y&&b.fields.push({id:D.id}),P.pointFeature++;break;case"LineString":zh(L,x,P,p,O),x.properties.push(Vh(O,A)),y&&x.fields.push({id:D.id}),P.lineFeature++;break;case"Polygon":Uh(L,w,P,p,O),w.properties.push(Vh(O,A)),y&&w.fields.push({id:D.id}),P.polygonFeature++;break;default:throw new Error("Invalid geometry type")}P.feature++}}catch(F){Z.e(F)}finally{Z.f()}return function(t,e,n,r){return{points:(0,v.Z)((0,v.Z)({},t),{},{positions:{value:t.positions,size:r},globalFeatureIds:{value:t.globalFeatureIds,size:1},featureIds:{value:t.featureIds,size:1},numericProps:Gh(t.numericProps,1)}),lines:(0,v.Z)((0,v.Z)({},e),{},{positions:{value:e.positions,size:r},pathIndices:{value:e.pathIndices,size:1},globalFeatureIds:{value:e.globalFeatureIds,size:1},featureIds:{value:e.featureIds,size:1},numericProps:Gh(e.numericProps,1)}),polygons:(0,v.Z)((0,v.Z)({},n),{},{positions:{value:n.positions,size:r},polygonIndices:{value:n.polygonIndices,size:1},primitivePolygonIndices:{value:n.primitivePolygonIndices,size:1},triangles:{value:new Uint32Array(n.triangles),size:1},globalFeatureIds:{value:n.globalFeatureIds,size:1},featureIds:{value:n.featureIds,size:1},numericProps:Gh(n.numericProps,1)})}}(b,x,w,p)}(t,(0,v.Z)({propArrayTypes:r},e),{numericPropKeys:n&&n.numericPropKeys||i,PositionDataType:n?n.PositionDataType:Float32Array})}function Fh(t){var e,n={},r=(0,j.Z)(t);try{for(r.s();!(e=r.n()).done;){var i=e.value;if(i.properties)for(var o in i.properties){var a=i.properties[o];n[o]=Hh(a,n[o])}}}catch(s){r.e(s)}finally{r.f()}return n}function Rh(t,e,n,r,i){e.positions.set(t.data,n.pointPosition*r);var o=t.data.length/r;jh(e,i,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 zh(t,e,n,r,i){e.positions.set(t.data,n.linePosition*r);var o=t.data.length/r;jh(e,i,n.linePosition,o),e.globalFeatureIds.fill(n.feature,n.linePosition,n.linePosition+o),e.featureIds.fill(n.lineFeature,n.linePosition,n.linePosition+o);for(var a=0,s=t.indices.length;a<s;++a){var u=t.indices[a],l=a===s-1?t.data.length:t.indices[a+1];e.pathIndices[n.linePath++]=n.linePosition,n.linePosition+=(l-u)/r}}function Uh(t,e,n,r,i){e.positions.set(t.data,n.polygonPosition*r);var o=t.data.length/r;jh(e,i,n.polygonPosition,o),e.globalFeatureIds.fill(n.feature,n.pol
2ygonPosition,n.polygonPosition+o),e.featureIds.fill(n.polygonFeature,n.polygonPosition,n.polygonPosition+o);for(var a=0,s=t.indices.length;a<s;++a){var u=n.polygonPosition;e.polygonIndices[n.polygonObject++]=u;for(var l=t.areas[a],c=t.indices[a],h=t.indices[a+1],f=0,p=c.length;f<p;++f){var d=c[f],A=f===p-1?void 0===h?t.data.length:h[0]:c[f+1];e.primitivePolygonIndices[n.polygonRing++]=n.polygonPosition,n.polygonPosition+=(A-d)/r}Nh(e,l,c,{startPosition:u,endPosition:n.polygonPosition,coordLength:r})}}function Nh(t,e,n,r){for(var i=r.startPosition,o=r.endPosition,a=r.coordLength,s=i*a,u=o*a,l=t.positions.subarray(s,u),c=n[0],h=n.slice(1).map((function(t){return(t-c)/a})),f=(0,Lh.OT)(l,h,a,e),p=0,d=f.length;p<d;++p)t.triangles.push(i+f[p])}function Gh(t,e){var n={};for(var r in t)n[r]={value:t[r],size:e};return n}function jh(t,e,n,r){for(var i in t.numericProps)if(i in e){var o=e[i];t.numericProps[i].fill(o,n,n+r)}}function Vh(t,e){var n={};for(var r in t)e.includes(r)||(n[r]=t[r]);return n}function Hh(t,e){return e!==Array&&Number.isFinite(t)?e===Float64Array||Math.fround(t)!==t?Float64Array:Float32Array:Array}var Jh=n(32408),Wh=n.n(Jh);function Qh(t){for(var e,n,r=0,i=0,o=t.length-1;i<t.length;o=i++)e=t[i],r+=((n=t[o])[0]-e[0])*(e[1]+n[1]);return r}function qh(t,e,n){e&&n&&(1===t?e.id=n.readVarint():2===t?function(t,e){var n=t.readVarint()+t.pos;for(;t.pos<n;){var r=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[r]=i}}(n,e):3===t?e.type=n.readVarint():4===t&&(e._geometry=n.pos))}var Kh=function(){function t(e,n,r,i,o){(0,h.Z)(this,t),(0,d.Z)(this,"properties",void 0),(0,d.Z)(this,"extent",void 0),(0,d.Z)(this,"type",void 0),(0,d.Z)(this,"id",void 0),(0,d.Z)(this,"_pbf",void 0),(0,d.Z)(this,"_geometry",void 0),(0,d.Z)(this,"_keys",void 0),(0,d.Z)(this,"_values",void 0),this.properties={},this.extent=r,this.type=0,this.id=null,this._pbf=e,this._geometry=-1,this._keys=i,this._values=o,e.readFields(qh,this,n)}return(0,c.Z)(t,[{key:"loadGeometry",value:function(){var t=this._pbf;t.pos=this._geometry;for(var e,n=t.readVarint()+t.pos,r=1,i=0,o=0,a=0,s=[];t.pos<n;){if(i<=0){var u=t.readVarint();r=7&u,i=u>>3}if(i--,1===r||2===r)o+=t.readSVarint(),a+=t.readSVarint(),1===r&&(e&&s.push(e),e=[]),e&&e.push([o,a]);else{if(7!==r)throw new Error("unknown command ".concat(r));e&&e.push(e[0].slice())}}return e&&s.push(e),s}},{key:"bbox",value:function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,n=1,r=0,i=0,o=0,a=1/0,s=-1/0,u=1/0,l=-1/0;t.pos<e;){if(r<=0){var c=t.readVarint();n=7&c,r=c>>3}if(r--,1===n||2===n)(i+=t.readSVarint())<a&&(a=i),i>s&&(s=i),(o+=t.readSVarint())<u&&(u=o),o>l&&(l=o);else if(7!==n)throw new Error("unknown command ".concat(n))}return[a,u,s,l]}},{key:"_toGeoJSON",value:function(e){var n,r,i=this.loadGeometry(),o=t.types[this.type];switch(this.type){case 1:var a=[];for(n=0;n<i.length;n++)a[n]=i[n][0];e(i=a,this);break;case 2:for(n=0;n<i.length;n++)e(i[n],this);break;case 3:for(i=function(t){var e=t.length;if(e<=1)return[t];for(var n,r,i=[],o=0;o<e;o++){var a=Qh(t[o]);0!==a&&(void 0===r&&(r=a<0),r===a<0?(n&&i.push(n),n=[t[o]]):n&&n.push(t[o]))}return n&&i.push(n),i}(i),n=0;n<i.length;n++)for(r=0;r<i[n].length;r++)e(i[n][r],this)}1===i.length?i=i[0]:o="Multi".concat(o);var s={type:"Feature",geometry:{type:o,coordinates:i},properties:this.properties};return null!==this.id&&(s.id=this.id),s}},{key:"toGeoJSON",value:function(t){if("function"===typeof t)return this._toGeoJSON(t);var e=t.x,n=t.y,r=t.z,i=this.extent*Math.pow(2,r),o=this.extent*e,a=this.extent*n;return this._toGeoJSON((function(t){for(var e=0;e<t.length;e++){var n=t[e];n[0]=360*(n[0]+o)/i-180;var r=180-360*(n[1]+a)/i;n[1]=360/Math.PI*Math.atan(Math.exp(r*Math.PI/180))-90}}))}}],[{key:"types",get:function(){return["Unknown","Point","LineString","Polygon"]}}]),t}(),Xh=function(){function t(e,n){(0,h.Z)(this,t),(0,d.Z)(this,"version",void 0),(0,d.Z)(this,"name",void 0),(0,d.Z)(this,"extent",void 0),(0,d.Z)(this,"length",void 0),(0,d.Z)(this,"_pbf",void 0),(0,d.Z)(this,"_keys",void 0),(0,d.Z)(this,"_values",void 0),(0,d.Z)(this,"_features",void 0),this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(Yh,this,n),this.length=this._features.length}return(0,c.Z)(t,[{key:"feature",value: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 Kh(this._pbf,e,this.extent,this._keys,this._values)}}]),t}();
2function Yh(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){var e=null,n=t.readVarint()+t.pos;for(;t.pos<n;){var r=t.readVarint()>>3;e=1===r?t.readString():2===r?t.readFloat():3===r?t.readDouble():4===r?t.readVarint64():5===r?t.readVarint():6===r?t.readSVarint():7===r?t.readBoolean():null}return e}(n)))}var $h,tf,ef,nf,rf,of,af,sf=(0,c.Z)((function t(e,n){(0,h.Z)(this,t),(0,d.Z)(this,"layers",void 0),this.layers=e.readFields(uf,{},n)}));function uf(t,e,n){if(3===t&&n){var r=new Xh(n,n.readVarint()+n.pos);r.length&&e&&(e[r.name]=r)}}function lf(t){var e=t.indices.length,n="Polygon";if(e<=1)return{type:n,data:t.data,areas:[[(0,Lh.ap)(t.data)]],indices:[t.indices]};for(var r,i,o,a=[],s=[],u=[],l=[],c=0,h=0;h<e;h++){o=t.indices[h]-c,i=t.indices[h+1]-c||t.data.length;var f=t.data.slice(o,i),p=(0,Lh.ap)(f);if(0!==p)void 0===r&&(r=p<0),r===p<0?(l.length&&(a.push(u),s.push(l)),l=[o],u=[p]):(u.push(p),l.push(o));else{var d=t.data.slice(0,o),A=t.data.slice(i);t.data=d.concat(A),c+=i-o}}return u&&a.push(u),l.length&&s.push(l),{type:n,areas:a,indices:s,data:t.data}}function cf(t,e,n){e&&n&&(1===t?e.id=n.readVarint():2===t?function(t,e){var n=t.readVarint()+t.pos;for(;t.pos<n;){var r=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[r]=i}}(n,e):3===t?e.type=n.readVarint():4===t&&(e._geometry=n.pos))}var hf=function(){function t(e,n,r,i,o,a){(0,h.Z)(this,t),(0,d.Z)(this,"properties",void 0),(0,d.Z)(this,"extent",void 0),(0,d.Z)(this,"type",void 0),(0,d.Z)(this,"id",void 0),(0,d.Z)(this,"_pbf",void 0),(0,d.Z)(this,"_geometry",void 0),(0,d.Z)(this,"_keys",void 0),(0,d.Z)(this,"_values",void 0),(0,d.Z)(this,"_geometryInfo",void 0),this.properties={},this.extent=r,this.type=0,this.id=null,this._pbf=e,this._geometry=-1,this._keys=i,this._values=o,this._geometryInfo=a,e.readFields(cf,this,n)}return(0,c.Z)(t,[{key:"loadGeometry",value:function(){var t=this._pbf;t.pos=this._geometry,$h=t.readVarint()+t.pos,tf=1,nf=0,rf=0,of=0,af=0;for(var e=[],n=[];t.pos<$h;)if(nf<=0&&(ef=t.readVarint(),tf=7&ef,nf=ef>>3),nf--,1===tf||2===tf)rf+=t.readSVarint(),of+=t.readSVarint(),1===tf&&e.push(af),n.push(rf,of),af+=2;else{if(7!==tf)throw new Error("unknown command ".concat(tf));if(af>0){var r=e[e.length-1];n.push(n[r],n[r+1]),af+=2}}return{data:n,indices:e}}},{key:"_toBinaryCoordinates",value:function(t){var e,n=this.loadGeometry();t(n.data,this);switch(this.type){case 1:this._geometryInfo.pointFeaturesCount++,this._geometryInfo.pointPositionsCount+=n.indices.length,e=(0,v.Z)({type:"Point"},n);break;case 2:this._geometryInfo.lineFeaturesCount++,this._geometryInfo.linePathsCount+=n.indices.length,this._geometryInfo.linePositionsCount+=n.data.length/2,e=(0,v.Z)({type:"LineString"},n);break;case 3:e=lf(n),this._geometryInfo.polygonFeaturesCount++,this._geometryInfo.polygonObjectsCount+=e.indices.length;var r,i=(0,j.Z)(e.indices);try{for(i.s();!(r=i.n()).done;){var o=r.value;this._geometryInfo.polygonRingsCount+=o.length}}catch(s){i.e(s)}finally{i.f()}this._geometryInfo.polygonPositionsCount+=e.data.length/2;break;default:throw new Error("Invalid geometry type: ".concat(this.type))}var a={type:"Feature",geometry:e,properties:this.properties};return null!==this.id&&(a.id=this.id),a}},{key:"toBinaryCoordinates",value:function(t){if("function"===typeof t)return this._toBinaryCoordinates(t);var e=t.x,n=t.y,r=t.z,i=this.extent*Math.pow(2,r),o=this.extent*e,a=this.extent*n;return this._toBinaryCoordinates((function(t){return function(t,e,n,r){for(var i=0,o=t.length;i<o;i+=2){t[i]=360*(t[i]+e)/r-180;var a=180-360*(t[i+1]+n)/r;t[i+1]=360/Math.PI*Math.atan(Math.exp(a*Math.PI/180))-90}}(t,o,a,i)}))}}]),t}(),ff=function(){function t(e,n){(0,h.Z)(this,t),(0,d.Z)(this,"version",void 0),(0,d.Z)(this,"name",void 0),(0,d.Z)(this,"extent",void 0),(0,d.Z)(this,"length",void 0),(0,d.Z)(this,"_pbf",void 0),(0,d.Z)(this,"_keys",void 0),(0,d.Z)(this,"_values",void 0),(0,d.Z)(this,"_features",void 0),this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(pf,this,n),this.length=this._features.length}return(0,c.Z)(t,[{key:"feature",value:function(t,e){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var n=this._pbf.readVarint()+this._pbf.pos;return new hf(this._pbf,n,this.extent,this._keys,this._values,e)}}]),t}();
2function pf(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){var e=null,n=t.readVarint()+t.pos;for(;t.pos<n;){var r=t.readVarint()>>3;e=1===r?t.readString():2===r?t.readFloat():3===r?t.readDouble():4===r?t.readVarint64():5===r?t.readVarint():6===r?t.readSVarint():7===r?t.readBoolean():null}return e}(n)))}var df=(0,c.Z)((function t(e,n){(0,h.Z)(this,t),(0,d.Z)(this,"layers",void 0),this.layers=e.readFields(Af,{},n)}));function Af(t,e,n){if(3===t&&n){var r=new ff(n,n.readVarint()+n.pos);r.length&&e&&(e[r.name]=r)}}function vf(t,e){var n,r,i=function(t){var e;if(null===t||void 0===t||!t.mvt)throw new Error("mvt options required");var n="wgs84"===(null===(e=t.mvt)||void 0===e?void 0:e.coordinates),r=t.mvt.tileIndex,i=r&&Number.isFinite(r.x)&&Number.isFinite(r.y)&&Number.isFinite(r.z);if(n&&!i)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===(r=e.mvt)||void 0===r?void 0:r.shape);switch(o){case"columnar-table":return{shape:"columnar-table",data:gf(t,i)};case"geojson-row-table":return{shape:"geojson-row-table",data:mf(t,i)};case"geojson":return mf(t,i);case"binary-geometry":case"binary":return gf(t,i);default:throw new Error(o)}}function gf(t,e){var n=function(t,e){var n=[],r={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,r];var i=new df(new(Wh())(t)),o=e&&Array.isArray(e.layers)?e.layers:Object.keys(i.layers);return o.forEach((function(t){var o=i.layers[t];if(o)for(var a=0;a<o.length;a++){var s=_f(o.feature(a,r),e,t);n.push(s)}})),[n,r]}(t,e),r=(0,b.Z)(n,2),i=Oh(r[0],r[1]);return i.byteLength=t.byteLength,i}function mf(t,e){if(t.byteLength<=0)return[];var n=[],r=new sf(new(Wh())(t));return(Array.isArray(e.layers)?e.layers:Object.keys(r.layers)).forEach((function(t){var i=r.layers[t];if(i)for(var o=0;o<i.length;o++){var a=yf(i.feature(o),e,t);n.push(a)}})),n}function yf(t,e,n){var r=t.toGeoJSON("wgs84"===e.coordinates?e.tileIndex:bf);return e.layerProperty&&(r.properties[e.layerProperty]=n),r}function _f(t,e,n){var r=t.toBinaryCoordinates("wgs84"===e.coordinates?e.tileIndex:xf);return e.layerProperty&&r.properties&&(r.properties[e.layerProperty]=n),r}function bf(t,e){for(var n=e.extent,r=0;r<t.length;r++){var i=t[r];i[0]/=n,i[1]/=n}}function xf(t,e){for(var n=e.extent,r=0,i=t.length;r<i;++r)t[r]/=n}var wf={name:"Mapbox Vector Tile",id:"mvt",module:"mvt",version:"3.2.12",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}}};(0,v.Z)((0,v.Z)({},wf),{},{parse:function(){var t=(0,H.Z)((0,V.Z)().mark((function t(e,n){return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",vf(e,n));case 1:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),parseSync:vf,binary:!0});function Cf(t,e){var n=null===e||void 0===e?void 0:e.globalFeatureId;return void 0!==n?function(t,e){var n,r=Ef(t),i=(0,j.Z)(r);try{for(i.s();!(n=i.n()).done;){for(var o=n.value,a=0,s=o.featureIds.value[0],u=0;u<o.featureIds.value.length;u++){var l=o.featureIds.value[u];if(l!==s){if(e===o.globalFeatureIds.value[a])return Sf(o,a,u);a=u,s=l}}if(e===o.globalFeatureIds.value[a])return Sf(o,a,o.featureIds.value.length)}}catch(c){i.e(c)}finally{i.f()}throw new Error("featureId:".concat(e," not found"))}(t,n):Bf(t,null===e||void 0===e?void 0:e.type)}function Bf(t,e){return function(t){var e,n=[],r=(0,j.Z)(t);try{for(r.s();!(e=r.n()).done;){var i=e.value;if(0!==i.featureIds.value.length){for(var o=0,a=i.featureIds.value[0],s=0;s<i.featureIds.value.length;s++){var u=i.featureIds.value[s];u!==a&&(n.push(Sf(i,o,s)),o=s,a=u)}n.push(Sf(i,o,i.featureIds.value.length))}}}catch(l){r.e(l)}finally{r.f()}return n}(Ef(t,e))}function kf(t,e,n){switch(t.type){case"Point":return function(t,e,n){var r=t.positions,i=Mf(r,e,n);if(i.length>1)return{type:"MultiPoint",coordinates:i};return{type:"Point",coordinates:i[0]}}(t,e,n);case"LineString":return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1/0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,r=t.positions,i=t.pathIndices.value.filter((function(t){return t>=e&&t<=n}));if(!(i.length>2)){return{type:"LineString",coordinates:Mf(r,i[0],i[1])}}for(var o=[],a=0;a<i.length-1;a++){var s=Mf(r,i[a],i[a+1]);o.push(s)}return{type:"MultiLineString",coordinates:o}}(t,e,n);case"Polygon":return Tf(t,e,n);default:throw new Error("Unsupported geometry type: ".concat(null===t||void 0===t?void 0:t.type))}}function Ef(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];var n=[];return t.points&&(t.points.type="Point",n.push(t.points)),t.lines&&
2(t.lines.type="LineString",n.push(t.lines)),t.polygons&&(t.polygons.type="Polygon",n.push(t.polygons)),n}function Sf(t,e,n){var r=kf(t,e,n),i=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=Object.assign({},t.properties[t.featureIds.value[e]]);for(var r in t.numericProps)n[r]=t.numericProps[r].value[e];return n}(t,e,n),o=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t.fields&&t.fields[t.featureIds.value[e]]}(t,e,n);return(0,v.Z)({type:"Feature",geometry:r,properties:i},o)}function Tf(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1/0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,r=t.positions,i=t.polygonIndices.value.filter((function(t){return t>=e&&t<=n})),o=t.primitivePolygonIndices.value.filter((function(t){return t>=e&&t<=n}));if(!(i.length>2)){for(var a=[],s=0;s<o.length-1;s++){var u=Mf(r,o[s],o[s+1]);a.push(u)}return{type:"Polygon",coordinates:a}}for(var l=[],c=0;c<i.length-1;c++){var h=Tf(t,i[c],i[c+1]).coordinates;l.push(h)}return{type:"MultiPolygon",coordinates:l}}function Mf(t,e,n){e=e||0,n=n||t.value.length/t.size;for(var r=[],i=e;i<n;i++){for(var o=Array(),a=i*t.size;a<(i+1)*t.size;a++)o.push(Number(t.value[a]));r.push(o)}return r}var If=n(98949),Pf=function(){function t(e){(0,h.Z)(this,t),(0,d.Z)(this,"opts",void 0),e&&(this.opts=e)}return(0,c.Z)(t,[{key:"equals",value:function(t){return this===t||this.constructor===t.constructor&&(0,If.v)(this.opts,t.opts)}},{key:"getShaders",value:function(t){return null}},{key:"getSubLayerProps",value:function(t){var e=t.constructor.defaultProps,n={updateTriggers:{}};for(var r in e)if(r in this.props){var i=e[r],o=this.props[r];n[r]=o,i&&"accessor"===i.type&&(n.updateTriggers[r]=this.props.updateTriggers[r],"function"===typeof o&&(n[r]=this.getSubLayerAccessor(o)))}return n}},{key:"initializeState",value:function(t,e){}},{key:"updateState",value:function(t,e){}},{key:"draw",value:function(t,e){}},{key:"finalizeState",value:function(t,e){}}]),t}();(0,d.Z)(Pf,"defaultProps",{});var Zf={clipBounds:[0,0,1,1]},Df="\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",Lf={name:"clip-vs",vs:Df},Of={"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"},Ff={name:"clip-fs",fs:Df},Rf={"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"},zf=function(t){(0,f.Z)(n,t);var e=(0,p.Z)(n);function n(){return(0,h.Z)(this,n),e.apply(this,arguments)}return(0,c.Z)(n,[{key:"getShaders",value:function(){var t="instancePositions"in this.getAttributeManager().attributes;return"clipByInstance"in this.props&&(t=this.props.clipByInstance),this.state.clipByInstance=t,t?{modules:[Lf],inject:Of}:{modules:[Ff],inject:Rf}}},{key:"draw",value:function(t){var e=t.uniforms,n=this.props.clipBounds,r=void 0===n?Zf.clipBounds:n;if(this.state.clipByInstance)e.clip_bounds=r;else{var i=this.projectPosition([r[0],r[1],0]),o=this.projectPosition([r[2],r[3],0]);e.clip_bounds=[Math.min(i[0],o[0]),Math.min(i[1],o[1]),Math.max(i[0],o[0]),Math.max(i[1],o[1])]}}}]),n}(Pf);(0,d.Z)(zf,"defaultProps",Zf),(0,d.Z)(zf,"extensionName","ClipExtension");var Uf={Point:Nf,MultiPoint:function(t,e,n){return Gf(t,e,n)},LineString:jf,MultiLineString:function(t,e,n){return t.map((function(t){return jf(t,e,n)}))},Polygon:Vf,MultiPolygon:function(t,e,n){return t.map((function(t){return Vf(t,e,n)}))}};function Nf(t,e,n){var r=(0,b.Z)(t,2),i=r[0],o=r[1],a=(0,b.Z)(e,2),s=a[0],u=a[1],l=(0,Xt.t7)(s[0],u[0],i),c=(0,Xt.t7)(s[1],u[1],o);return n.unprojectFlat([l,c])}function Gf(t,e,n){return t.map((function(t){return Nf(t,e,n)}
2))}function jf(t,e,n){return Gf(t,e,n)}function Vf(t,e,n){return t.map((function(t){return Gf(t,e,n)}))}var Hf=["points","lines","polygons"];function Jf(t,e,n,r){var i=t.featureIds.value;if(!i.length)return-1;var o=0,a=i[i.length-1]+1;if(r){var s=function(t,e){if(!t.__layers){for(var n={},r=t.properties,i=0;i<r.length;i++){var o=r[i].layerName;o&&(n[o]?n[o][1]=i:n[o]=[i,i])}t.__layers=n}return t.__layers[e]}(t,r);if(!s)return-1;o=s[0],a=s[1]+1}var u=-1;if(e in t.numericProps){var l=t.numericProps[e].value.findIndex((function(t,e){return t===n&&i[e]>=o&&i[e]<a}));return l>=0?t.globalFeatureIds.value[l]:-1}return e?u=Wf(t.properties,(function(t){return t[e]===n}),o,a):t.fields&&(u=Wf(t.fields,(function(t){return t.id===n}),o,a)),u>=0?function(t,e){if(!t.__ids){for(var n=[],r=t.featureIds.value,i=t.globalFeatureIds.value,o=0;o<r.length;o++)n[r[o]]=i[o];t.__ids=n}return t.__ids[e]}(t,u):-1}function Wf(t,e,n,r){for(var i=n;i<r;i++)if(e(t[i],i))return i;return-1}var Qf=(0,v.Z)((0,v.Z)({},G.Z.defaultProps),{},{onDataLoad:{type:"function",value:null,optional:!0,compare:!1},uniqueIdProperty:"",highlightedFeatureId:null,loaders:[wf],binary:!0}),qf=function(t){(0,f.Z)(n,t);var e=(0,p.Z)(n);function n(){return(0,h.Z)(this,n),e.apply(this,arguments)}return(0,c.Z)(n,[{key:"initializeState",value:function(){(0,tn.Z)((0,en.Z)(n.prototype),"initializeState",this).call(this);var t=void 0===this.context.viewport.resolution&&this.props.binary;this.setState({binary:t,data:null,tileJSON:null})}},{key:"isLoaded",get:function(){return this.state&&this.state.data&&this.state.tileset&&(0,tn.Z)((0,en.Z)(n.prototype),"isLoaded",this)}},{key:"updateState",value:function(t){var e,r=t.props,i=t.oldProps,o=t.context,a=t.changeFlags;a.dataChanged&&this._updateTileData(),null!==(e=this.state)&&void 0!==e&&e.data&&((0,tn.Z)((0,en.Z)(n.prototype),"updateState",this).call(this,{props:r,oldProps:i,context:o,changeFlags:a}),this._setWGS84PropertyForTiles());var s=r.highlightColor;s!==i.highlightColor&&Array.isArray(s)&&this.setState({highlightColor:s})}},{key:"_updateTileData",value:function(){var t=(0,H.Z)((0,V.Z)().mark((function t(){var e,n,r,i,o;return(0,V.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=this.props.data,n=null,"string"!==typeof e||/(?=.*{z})(?=.*{x})(?=.*({y}|{-y}))/.test(e)){t.next=18;break}return r=this.props,i=r.onDataLoad,o=r.fetch,this.setState({data:null,tileJSON:null}),t.prev=5,t.next=8,o(e,{propName:"data",layer:this,loaders:[]});case 8:n=t.sent,t.next=15;break;case 11:t.prev=11,t.t0=t.catch(5),this.raiseError(t.t0,"loading TileJSON"),e=null;case 15:i&&i(n,{propName:"data",layer:this}),t.next=19;break;case 18:e.tilejson&&(n=e);case 19:n&&(e=n.tiles),this.setState({data:e,tileJSON:n});case 21:case"end":return t.stop()}}),t,this,[[5,11]])})));return function(){return t.apply(this,arguments)}}()},{key:"_getTilesetOptions",value:function(){var t=(0,tn.Z)((0,en.Z)(n.prototype),"_getTilesetOptions",this).call(this),e=this.state.tileJSON,r=this.props,i=r.minZoom,o=r.maxZoom;return e&&(Number.isFinite(e.minzoom)&&e.minzoom>i&&(t.minZoom=e.minzoom),Number.isFinite(e.maxzoom)&&(!Number.isFinite(o)||e.maxzoom<o)&&(t.maxZoom=e.maxzoom)),t}},{key:"renderLayers",value:function(){var t;return null!==(t=this.state)&&void 0!==t&&t.data?(0,tn.Z)((0,en.Z)(n.prototype),"renderLayers",this).call(this):null}},{key:"getTileData",value:function(t){var e,n=this.state,r=n.data,i=n.binary,o=t.index,a=t.signal,s=Ze(r,t);if(!s)return Promise.reject("Invalid URL");var u=this.getLoadOptions();return(0,this.props.fetch)(s,{propName:"data",layer:this,loadOptions:u=(0,v.Z)((0,v.Z)({},u),{},{mimeType:"application/x-protobuf",mvt:(0,v.Z)((0,v.Z)({},null===(e=u)||void 0===e?void 0:e.mvt),{},{coordinates:this.context.viewport.resolution?"wgs84":"local",tileIndex:o}),gis:i?{format:"binary"}:{}}),signal:a})}},{key:"renderSubLayers",value:function(t){var e=t.tile.index,r=e.x,i=e.y,o=e.z,a=Math.pow(2,o),s=512/a,u=-s,l=512*r/a,c=512*(1-i/a),h=(new K.Z).scale([s,u,1]);t.autoHighlight=!1,this.context.viewport.resolution||(t.modelMatrix=h,t.coordinateOrigin=[l,c,0],t.coordinateSystem=Y.Df.CARTESIAN,t.extensions=[].concat((0,Q.Z)(t.extensions||[]),[new zf]));var f=(0,tn.Z)((0,en.Z)(n.prototype),"renderSubLayers",this).call(this,t);return!this.state.binary||f instanceof G.Z||J.Z.warn("renderSubLayers() must return GeoJsonLayer when using binary:true")(),f}},{key:"_updateAutoHighlight",value:function(t){var e,n,r=this.props.uniqueIdProperty,i=this.state,o=i.hoveredFeatureId,a=i.hoveredFeatureLayerName,s=t.object;s&&(e=Kf(s,r),n=Xf(s));var u=this.props.highlightColor;"function"===typeof u&&(u=u(t)),o===e&&a===n||this.setState({highlightColor:u,hoveredFeatureId:e,hoveredFeatureLayerName:n})}},{key:"getPickingInfo",value:function(t){var e=(0,tn.Z)((0,en.Z)(n.prototype),"getPickingInfo",this).call(this,t),r=Boolean(this.context.viewport.resolution);if(this.state.binary&&-1!==e.index){var i=t.sourceLayer.props.data;e.object=Cf(i,{globalFeatureId:e.index})}return e.object&&!r&&(e.object=$f(e.object,e.tile.bbox,this.context.viewport)),e}},{key:"getSubLayerPropsByTile",value:function(t){return{highlightedObjectIndex:this.getHighlightedObjectIndex(t),highlightColor:this.state.highlightColor}}},{key:"getHighlightedObjectIndex",value:function(t){var e=this.state,n=e.hoveredFeatureId,r=e.hoveredFeatureLayerName,i=e.binary,o=this.props,a=o.uniqueIdProperty,s=o.highlightedFeatureId,u=t.content,l=Yf(s);if(!(Yf(n)||l))return-1;var c=l?s:n;return Array.isArray(u)?u.findIndex((function(t){var e=Kf(t,a)===c,n=l||Xf(t)===r;return e&&n})):u&&i?function(t,e,n,r){var i,o=(0,j.Z)(Hf);try{for(o.s();!(i=o.n()).done;){var a=i.value,s=t[a]&&Jf(t[a],e,n,r);if(s>=0)return s}}catch(u){o.e(u)}finally{o.f()}return-1}(u,a,c,l?"":r):-1}},{key:"_pickObjects",value:function(t){var e=this.context,n=e.deck,r=e.viewport,i=r.width,o=r.height,a=r.x,s=r.y,u=[this.id];return n.pickObjects({x:a,y:s,width:i,height:o,layerIds:u,maxObjects:t})}},{key:"getRenderedFeatures",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=this._pickObjects(e),r=new Set,i=[],o=(0,j.Z)(n);try{for(o.s();!(t=o.n()).done;){var a=t.value,s=Kf(a.object,this.props.uniqueIdProperty);void 0===s?i.push(a.object):r.has(s)||(r.add(s),i.push(a.object))}}catch(u){o.e(u)}finally{o.f()}return i}},{key:"_setWGS84PropertyForTiles",value:function(){var t=this,e="dataInWGS84";
2this.state.tileset.selectedTiles.forEach((function(n){n.hasOwnProperty(e)||Object.defineProperty(n,e,{get:function(){if(!n.content)return null;if(t.state.binary&&Array.isArray(n.content)&&!n.content.length)return[];var e,r=n.bbox;if(void 0===n._contentWGS84&&(e=r,Number.isFinite(e.west)&&Number.isFinite(e.north)&&Number.isFinite(e.east)&&Number.isFinite(e.south))){var i=t.state.binary?Cf(n.content):n.content;n._contentWGS84=i.map((function(e){return $f(e,r,t.context.viewport)}))}return n._contentWGS84}})}))}}]),n}($e);function Kf(t,e){return t.properties&&e?t.properties[e]:"id"in t?t.id:void 0}function Xf(t){var e;return(null===(e=t.properties)||void 0===e?void 0:e.layerName)||null}function Yf(t){return void 0!==t&&null!==t&&""!==t}function $f(t,e,n){var r=(0,v.Z)((0,v.Z)({},t),{},{geometry:{type:t.geometry.type}});return Object.defineProperty(r.geometry,"coordinates",{get:function(){var r=function(t,e,n){var r=[n.projectFlat([e.west,e.north]),n.projectFlat([e.east,e.south])];return(0,v.Z)((0,v.Z)({},t),{},{coordinates:Uf[t.type](t.coordinates,r,n)})}(t.geometry,e,n);return r.coordinates}}),r}(0,d.Z)(qf,"layerName","MVTLayer"),(0,d.Z)(qf,"defaultProps",Qf);for(var tp="0123456789bcdefghjkmnpqrstuvwxyz",ep={},np=0;np<32;np++)ep[tp.charAt(np)]=np;var rp=-90,ip=90,op=-180,ap=180;function sp(t){var e=function(t){for(var e,n=!0,r=ip,i=rp,o=ap,a=op,s=0,u=0,l=t.length;u<l;u++){var c=t[u].toLowerCase();s=ep[c];for(var h=4;h>=0;h--){var f=s>>h&1;n?(e=(o+a)/2,1===f?a=e:o=e):(e=(r+i)/2,1===f?i=e:r=e),n=!n}}return[i,a,r,o]}(t),n=(0,b.Z)(e,4),r=n[0],i=n[1],o=n[2],a=n[3];return[a,o,a,r,i,r,i,o,a,o]}var up=function(t){(0,f.Z)(n,t);var e=(0,p.Z)(n);function n(){return(0,h.Z)(this,n),e.apply(this,arguments)}return(0,c.Z)(n,[{key:"indexToBounds",value:function(){var t=this.props,e=t.data,n=t.getGeohash;return{data:e,_normalize:!1,positionFormat:"XY",getPolygon:function(t,e){return sp(n(t,e))}}}}]),n}(_);(0,d.Z)(up,"layerName","GeohashLayer"),(0,d.Z)(up,"defaultProps",{getGeohash:{type:"accessor",value:function(t){return t.geohash}}})},84977:function(t,e){var n,r,i;r=[],void 0===(i="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={},r={};function i(t,e){var i,o,s;return e?(s=0<=(t>>>=0)&&t<256)&&(o=r[t])?o:(i=a(t,(0|t)<0?-1:0,!0),s&&(r[t]=i),i):(s=-128<=(t|=0)&&t<128)&&(o=n[t])?o:(i=a(t,t<0?-1:0,!1),s&&(n[t]=i),i)}function o(t,e){if(isNaN(t)||!isFinite(t))return e?v:A;if(e){if(t<0)return v;if(t>=f)return b}else{if(t<=-p)return x;if(t+1>=p)return _}return t<0?o(-t,e).neg():a(t%h|0,t/h|0,e)}function a(e,n,r){return new t(e,n,r)}t.fromInt=i,t.fromNumber=o,t.fromBits=a;var s=Math.pow;function u(t,e,n){if(0===t.length)throw Error("empty string");if("NaN"===t||"Infinity"===t||"+Infinity"===t||"-Infinity"===t)return A;if("number"===typeof e?(n=e,e=!1):e=!!e,(n=n||10)<2||36<n)throw RangeError("radix");var r;if((r=t.indexOf("-"))>0)throw Error("interior hyphen");if(0===r)return u(t.substring(1),e,n).neg();for(var i=o(s(n,8)),a=A,l=0;l<t.length;l+=8){var c=Math.min(8,t.length-l),h=parseInt(t.substring(l,l+c),n);if(c<8){var f=o(s(n,c));a=a.mul(f).add(o(h))}else a=(a=a.mul(i)).add(o(h))}return a.unsigned=e,a}function l(e){return e instanceof t?e:"number"===typeof e?o(e):"string"===typeof e?u(e):a(e.low,e.high,e.unsigned)}t.fromString=u,t.fromValue=l;var c=65536,h=c*c,f=h*h,p=f/2,d=i(1<<24),A=i(0);t.ZERO=A;var v=i(0,!0);t.UZERO=v;var g=i(1);t.ONE=g;var m=i(1,!0);t.UONE=m;var y=i(-1);t.NEG_ONE=y;var _=a(-1,2147483647,!1);t.MAX_VALUE=_;var b=a(-1,-1,!0);t.MAX_UNSIGNED_VALUE=b;var x=a(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),r=n.mul(e).sub(this);return n.toString(t)+r.toInt().toString(t)}return"-"+this.neg().toString(t)}for(var i=o(s(t,6),this.unsigned),a=this,u="";;){var l=a.div(i),c=(a.sub(l.mul(i)).toInt()>>>0).toString(t);if((a=l).isZero())return c+u;for(;c.length<6;)c="0"+c;u=""+c+u}},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=l(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=l(t)),this.eq(t))return 0;var n=this.isNegative(),r=t.isNegative();return n&&!r?-1:!n&&r?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(g)},w.neg=w.negate,w.add=function(t){e(t)||(t=l(t));var n=this.high>>>16,r=65535&this.high,i=this.low>>>16,o=65535&this.low,s=t.high>>>16,u=65535&t.high,c=t.low>>>16,h=0,f=0,p=0,d=0;return p+=(d+=o+(65535&t.low))>>>16,f+=(p+=i+c)>>>16,h+=(f+=r+u)>>>16,h+=n+s,a((p&=65535)<<16|(d&=65535),(h&=65535)<<16|(f&=65535),this.unsigned)},w.subtract=function(t){return e(t)||(t=l(t)),this.add(t.neg())},w.sub=w.subtract,w.multiply=function(t){if(this.isZero())return A;if(e(t)||(t=l(t)),t.isZero())return A;if(this.eq(x))return t.isOdd()?x:A;if(t.eq(x))return this.isOdd()?x:A;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(d)&&t.lt(d))return o(this.toNumber()*t.toNumber(),this.unsigned);var n=this.high>>>16,r=65535&this.high,i=this.low>>>16,s=65535&this.low,u=t.high>>>16,c=65535&t.high,h=t.low>>>16,f=65535&t.low,p=0,v=0,g=0,m=0;return g+=(m+=s*f)>>>16,v+=(g+=i*f)>>>16,g&=65535,v+=(g+=s*h)>>>16,p+=(v+=r*f)>>>16,v&=65535,p+=(v+=i*h)>>>16,v&=65535,p+=(v+=s*c)>>>16,p+=n*f+r*h+i*c+s*u,a((g&=65535)<<16|(m&=65535),(p&=65535)<<16|(v&=65535),this.unsigned)},w.mul=w.multiply,w.divide=function(t){if(e(t)||(t=l(t)),t.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?v:A;var n,r,i;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return v;if(t.gt(this.shru(1)))return m;i=v}else{if(this.eq(x))return t.eq(g)||t.eq(y)?x:t.eq(x)?g:(n=this.shr(1).div(t).shl(1)).eq(A)?t.isNegative()?g:y:(r=this.sub(t.mul(n)),i=n.add(r.div(t)));if(t.eq(x))return this.unsigned?v:A;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=A}for(r=this;r.gte(t);){n=Math.max(1,Math.floor(r.toNumber()/t.toNumber()));for(var a=Math.ceil(Math.log(n)/Math.LN2),u=a<=48?1:s(2,a-48),c=o(n),h=c.mul(t);h.isNegative()||h.gt(r);)h=(c=o(n-=u,this.unsigned)).mul(t);c.isZero()&&(c=g),i=i.add(c),r=r.sub(h)}return i},w.div=w.divide,w.modulo=function(t){return e(t)||(t=l(t)),this.sub(this.div(t).mul(t))},w.mod=w.modulo,w.not=function(){return a(~this.low,~this.high,this.unsigned)},w.and=function(t){return e(t)||(t=l(t)),a(this.low&t.low,this.high&t.high,this.unsigned)},w.or=function(t){return e(t)||(t=l(t)),a(this.low|t.low,this.high|t.high,this.unsigned)},w.xor=function(t){return e(t)||(t=l(t)),a(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?a(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):a(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?a(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):a(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?a(this.low>>>t|n<<32-t,n>>>t,this.unsigned):a(32===t?n:n>>>t-32,0,this.unsigned)},w.shru=w.shiftRightUnsigned,w.toSigned=function(){return this.unsigned?a(this.low,this.high,!1):this},w.toUnsigned=function(){return this.unsigned?this:a(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,r):n)||(t.exports=i)},80248:function(t,e,n){"use strict";n.d(e,{Z:function(){return k}});var r=n(11026),i=n(50189),o=n(22951),a=n(91976);function s(t){if(!t)throw new Error("JSON conversion error ".concat(arguments.length>1&&void 0!==arguments[1]?arguments[1]:""))}var u=n(60726);function l(t,e){var n,r=function(t){if("string"===typeof t){var e=h[t];return e||(e=t.split("."),h[t]=e),e}return Array.isArray(t)?t:[t]}(e),i=t,o=(0,u.Z)(r);try{for(o.s();!(n=o.n()).done;){var a=n.value;i=c(i)?i[a]:void 0}}catch(s){o.e(s)}finally{o.f()}return i}function c(t){return null!==t&&"object"===typeof t}var h={};var f=n(61521),p=n.n(f),d={"-":function(t){return t}};function A(t,e){if(t in d)return d[t];var n,r=p().parse(t);return r.right||r.left||"Identifier"!==r.type?(v(r,(function(t){if("CallExpression"===t.type)throw new Error("Function calls not allowed in JSON expressions")})),n=function(t){return p().eval(r,t)}):n=function(e){return l(e,t)},d[t]=n,n}function v(t,e){if(Array.isArray(t))t.forEach((function(t){return v(t,e)}));else if(t&&"object"===typeof t)for(var n in t.type&&e(t),t)v(t[n],e)}var g="@@=",m="@@#",y="@@function",_=function(t){return t&&"object"===typeof t},b=function(){function t(){(0,o.Z)(this,t),this.typeKey="@@type",this.functionKey=y,this.log=console,this.classes={},this.reactComponents={},this.enumerations={},this.constants={},this.functions={},this.convertFunction=A,this.preProcessClassProps=function(t,e){return e},this.postProcessConvertedJson=function(t){return t};for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];for(var i=0,a=n;i<a.length;i++){var s=a[i];
2this.merge(s)}}return(0,a.Z)(t,[{key:"merge",value:function(t){for(var e in t)switch(e){case"layers":case"views":Object.assign(this.classes,t[e]);break;default:if(e in this){var n=t[e];this[e]=_(this[e])?Object.assign(this[e],n):n}}}},{key:"validate",value:function(t){return s(!this.typeKey||"string"===typeof this.typeKey),s(_(this.classes)),!0}}]),t}();function x(t){return t.replace(g,"")}function w(t,e){var n,r={};for(var i in t){var o=t[i];"string"===typeof(n=o)&&n.startsWith(g)&&(o=A(o=x(o))),r[i]=o}return r}function C(t,e,n){var r=n.classes[t],i=n.reactComponents[t];if(!r&&!i){var o=n.log;if(o){var a=JSON.stringify(e,null,0).slice(0,40);o.warn("JSON converter: No registered class of type ".concat(t,"(").concat(a,"...)  "))}return null}return r?function(t,e,n){n.preProcessClassProps&&(e=n.preProcessClassProps(t,e,n));return e=w(e),new t(e)}(r,e,n):function(t,e,n){var r=n.React,i=e,o=i.children,a=void 0===o?[]:o;delete e.children,n.preProcessClassProps&&(e=n.preProcessClassProps(t,e,n));return e=w(e),r.createElement(t,e,a)}(i,e,n)}var B=function(t){return t&&"object"===typeof t},k=function(){function t(e){(0,o.Z)(this,t),this.log=console,this.configuration={},this.onJSONChange=function(){},this.json=null,this.convertedJson=null,this.setProps(e)}return(0,a.Z)(t,[{key:"finalize",value:function(){}},{key:"setProps",value:function(t){"configuration"in t&&(this.configuration=t.configuration instanceof b?t.configuration:new b(t.configuration)),"onJSONChange"in t&&(this.onJSONChange=t.onJSONChange)}},{key:"mergeConfiguration",value:function(t){this.configuration.merge(t)}},{key:"convert",value:function(t){if(!t||t===this.json)return this.convertedJson;this.json=t;var e=function(t){return"string"===typeof t?JSON.parse(t):t}(t),n=function(t,e){return e=new b(e),E(t,"",e)}(e,this.configuration);return n=this.configuration.postProcessConvertedJson(n),this.convertedJson=n,n}},{key:"convertJson",value:function(t){return this.convert(t)}}]),t}();function E(t,e,n){return Array.isArray(t)?t.map((function(t,e){return E(t,String(e),n)})):function(t,e){var n=e.typeKey,r=B(t)&&Boolean(t[n]);return r}(t,n)?function(t,e){var n=e.typeKey,r=t[n],o=(0,i.Z)({},t);return delete o[n],o=S(o,e),C(r,o,e)}(t,n):B(t)?y in t?function(t,e){var n=e.functionKey,r=t[n],o=(0,i.Z)({},t);return delete o[n],o=S(o,e),function(t,e,n){var r=n.functions[t];if(!r){var i=n.log;if(i){var o=JSON.stringify(e,null,0).slice(0,40);i.warn("JSON converter: No registered function ".concat(t,"(").concat(o,"...)  "))}return null}return r(e)}(r,o,e)}(t,n):S(t,n):"string"===typeof t?function(t,e,n){if(t.startsWith(g)&&n.convertFunction)return t=t.replace(g,""),n.convertFunction(t,n);if(t.startsWith(m)){if(t=t.replace(m,""),n.constants[t])return n.constants[t];var i=t.split("."),o=(0,r.Z)(i,2),a=o[0],s=o[1];return n.enumerations[a][s]}return t}(t,0,n):t}function S(t,e){s(B(t));var n={};for(var r in t){var i=t[r];n[r]=E(i,0,e)}return n}},73351:function(t,e,n){"use strict";n.d(e,{Z:function(){return _}});var r=n(50189),i=n(22951),o=n(91976),a=n(47169),s=n(83138),u=n(27597),l=n(67591),c=n(94337),h=n(64649),f=n(2123),p=n(2578),d=n(18252),A=n(90031),v=n(94557),g=n(69296),m=[0,0,0,255],y={getSourcePosition:{type:"accessor",value:function(t){return t.sourcePosition}},getTargetPosition:{type:"accessor",value:function(t){return t.targetPosition}},getSourceColor:{type:"accessor",value:m},getTargetColor:{type:"accessor",value:m},getWidth:{type:"accessor",value:1},getHeight:{type:"accessor",value:1},getTilt:{type:"accessor",value:0},greatCircle:!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}},_=function(t){(0,l.Z)(n,t);var e=(0,c.Z)(n);function n(){var t;(0,i.Z)(this,n);for(var r=arguments.length,o=new Array(r),s=0;s<r;s++)o[s]=arguments[s];return t=e.call.apply(e,[this].concat(o)),(0,h.Z)((0,a.Z)(t),"state",void 0),t}return(0,o.Z)(n,[{key:"getShaders",value:function(){return(0,s.Z)((0,u.Z)(n.prototype),"getShaders",this).call(this,{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;
2\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  // d: distance on the xy plane\n  // r: ratio of the current point\n  // p: ratio of the peak of the arc\n  // h: height multiplier\n  // z = f(r) = sqrt(r * (p * 2 - r)) * d * h\n  // f(0) = 0\n  // f(1) = dz\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\n  // sqrt does not deal with negative values, manually flip source and target if delta.z < 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}\n\n// offset vector by strokeWidth pixels\n// offset_direction is -1 (left) or 1 (right)\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) {\n  // normalized direction of the line\n  vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize);\n  // rotate by 90 degrees\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}\n\n/* Great circle interpolation\n * http://www.movable-type.co.uk/scripts/latlong.html\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;
2\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\n  // if the angularDist is PI, linear interpolation is applied. otherwise, use spherical interpolation\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\n/* END GREAT CIRCLE */\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\n  // if it's the first point, use next - current as direction\n  // otherwise use current - prev\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      // split at the 180th meridian\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.
20) - 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\n    // common x at longitude=-180\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\n  // Multiply out width and clamp to limits\n  // mercator pixels are interpreted as screen pixels\n  float widthPixels = clamp(\n    project_size_to_pixel(instanceWidths * widthScale, widthUnits),\n    widthMinPixels, widthMaxPixels\n  );\n\n  // extrude\n  vec3 offset = vec3(\n    getExtrusionOffset((next.xy - curr.xy) * indexDir, positions.y, widthPixels),\n    0.0);\n  DECKGL_FILTER_SIZE(offset, geometry);\n  gl_Position = curr + vec4(project_pixel_size_to_clipspace(offset.xy), 0.0, 0.0);\n  DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\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:[f.Z,p.Z]})}},{key:"wrapLongitude",get:function(){return!1}},{key:"initializeState",value:function(){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:m},instanceTargetColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getTargetColor",defaultValue:m},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}})}},{key:"updateState",value:function(t){if((0,s.Z)((0,u.Z)(n.prototype),"updateState",this).call(this,t),t.changeFlags.extensionsChanged){var e,r=this.context.gl;null===(e=this.state.model)||void 0===e||e.delete(),this.state.model=this._getModel(r),this.getAttributeManager().invalidateAll()}}},{key:"draw",value:function(t){var e=t.uniforms,n=this.props,r=n.widthUnits,i=n.widthScale,o=n.widthMinPixels,a=n.widthMaxPixels,s=n.greatCircle,u=n.wrapLongitude;this.state.model.setUniforms(e).setUniforms({greatCircle:s,widthUnits:d.iI[r],widthScale:i,widthMinPixels:o,widthMaxPixels:a,useShortestPath:u}).draw()}},{key:"_getModel",value:function(t){for(var e=[],n=0;n<50;n++)e=e.concat([n,1,0,n,-1,0]);var i=new v.Z(t,(0,r.Z)((0,r.Z)({}
2,this.getShaders()),{},{id:this.props.id,geometry:new g.Z({drawMode:5,attributes:{positions:new Float32Array(e)}}),isInstanced:!0}));return i.setUniforms({numSegments:50}),i}}]),n}(A.Z);(0,h.Z)(_,"layerName","ArcLayer"),(0,h.Z)(_,"defaultProps",y)},35387:function(t,e,n){"use strict";n.d(e,{Z:function(){return E}});var r=n(50189),i=n(22951),o=n(91976),a=n(83138),s=n(27597),u=n(67591),l=n(94337),c=n(64649),h=n(2123),f=n(54976),p=n(2578),d=n(18252),A=n(90031),v=n(28007),g=n(12308),m=n(70353),y=n(94557),_=n(21970),b=n(79666),x=n(69296),w=n(23595),C=function(t){(0,u.Z)(n,t);var e=(0,l.Z)(n);function n(t){(0,i.Z)(this,n);var o=t.id,a=void 0===o?(0,b.hQ)("column-geometry"):o,s=function(t){var e=t.radius,n=t.height,r=void 0===n?1:n,i=t.nradial,o=void 0===i?10:i,a=t.vertices;a&&(_.Z.assert(a.length>=o),a=a.flatMap((function(t){return[t[0],t[1]]})),(0,w.Ny)(a,w.wG.COUNTER_CLOCKWISE));var s=r>0,u=o+1,l=s?3*u+1:o,c=2*Math.PI/o,h=new Uint16Array(s?3*o*2:0),f=new Float32Array(3*l),p=new Float32Array(3*l),d=0;if(s){for(var A=0;A<u;A++)for(var v=A*c,g=A%o,m=Math.sin(v),y=Math.cos(v),b=0;b<2;b++)f[d+0]=a?a[2*g]:y*e,f[d+1]=a?a[2*g+1]:m*e,f[d+2]=(.5-b)*r,p[d+0]=a?a[2*g]:y,p[d+1]=a?a[2*g+1]:m,d+=3;f[d+0]=f[d-3],f[d+1]=f[d-2],f[d+2]=f[d-1],d+=3}for(var x=s?0:1;x<u;x++){var C=Math.floor(x/2)*Math.sign(.5-x%2),B=C*c,k=(C+o)%o,E=Math.sin(B),S=Math.cos(B);f[d+0]=a?a[2*k]:S*e,f[d+1]=a?a[2*k+1]:E*e,f[d+2]=r/2,p[d+2]=1,d+=3}if(s)for(var T=0,M=0;M<o;M++)h[T++]=2*M+0,h[T++]=2*M+2,h[T++]=2*M+0,h[T++]=2*M+1,h[T++]=2*M+1,h[T++]=2*M+3;return{indices:h,attributes:{POSITION:{size:3,value:f},NORMAL:{size:3,value:p}}}}(t),u=s.indices,l=s.attributes;return e.call(this,(0,r.Z)((0,r.Z)({},t),{},{id:a,indices:u,attributes:l}))}return(0,o.Z)(n)}(x.Z);var B=[0,0,0,255],k={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:function(t){return t.position}},getFillColor:{type:"accessor",value:B},getLineColor:{type:"accessor",value:B},getLineWidth:{type:"accessor",value:1},getElevation:{type:"accessor",value:1e3},material:!0,getColor:{deprecatedFor:["getFillColor","getLineColor"]}},E=function(t){(0,u.Z)(n,t);var e=(0,l.Z)(n);function n(){return(0,i.Z)(this,n),e.apply(this,arguments)}return(0,o.Z)(n,[{key:"getShaders",value:function(){var t=this.context.gl,e=!(0,v.D0)(t),r={},i=this.props.flatShading&&(0,g.U6)(t,m.h.GLSL_DERIVATIVES);return i&&(r.FLAT_SHADING=1),(0,a.Z)((0,s.Z)(n.prototype),"getShaders",this).call(this,{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;\n\n// Custom uniforms\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;\n\n// Result\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  // rotate primitive position and normal\n  mat2 rotationMatrix = mat2(cos(angle), sin(angle), -sin(angle), cos(angle));\n\n  // calculate elevation, if 3d not enabled set to 0\n  // cylindar gemoetry height are between -1.0 to 1.0, transform it to between 0, 1\n  float elevation = 0.0;\n  // calculate stroke offset\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\n  // if alpha == 0.0 or z < 0.0, do not render element\n  float shouldRender = float(color.a > 0.0 && instanceElevations >= 0.0);
2\n  float dotRadius = radius * coverage * shouldRender;\n\n  geometry.pickingColor = instancePickingColors;\n\n  // project center of column\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\n  // Light calculations\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:r,transpileToGLSL100:e,modules:[h.Z,i?f.s:f.N,p.Z]})}},{key:"initializeState",value:function(){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:B},instanceLineColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getLineColor",defaultValue:B},instanceStrokeWidths:{size:1,accessor:"getLineWidth",transition:!0}})}},{key:"updateState",value:function(t){(0,a.Z)((0,s.Z)(n.prototype),"updateState",this).call(this,t);var e=t.props,r=t.oldProps,i=t.changeFlags.extensionsChanged||e.flatShading!==r.flatShading;if(i){var o,u=this.context.gl;null===(o=this.state.model)||void 0===o||o.delete(),this.state.model=this._getModel(u),this.getAttributeManager().invalidateAll()}(i||e.diskResolution!==r.diskResolution||e.vertices!==r.vertices||(e.extruded||e.stroked)!==(r.extruded||r.stroked))&&this._updateGeometry(e)}},{key:"getGeometry",value:function(t,e,n){var r=new C({radius:1,height:n?2:0,vertices:e,nradial:t}),i=0;if(e)for(var o=0;o<t;o++){var a=e[o];i+=Math.sqrt(a[0]*a[0]+a[1]*a[1])/t}else i=1;return this.setState({edgeDistance:Math.cos(Math.PI/t)*i}),r}},{key:"_getModel",value:function(t){return new y.Z(t,(0,r.Z)((0,r.Z)({},this.getShaders()),{},{id:this.props.id,isInstanced:!0}))}},{key:"_updateGeometry",value:function(t){var e=t.diskResolution,n=t.vertices,r=t.extruded,i=t.stroked,o=this.getGeometry(e,n,r||i);this.setState({fillVertexCount:o.attributes.POSITION.value.length/3,wireframeVertexCount:o.indices.value.length}),this.state.model.setProps({geometry:o})}},{key:"draw",value:function(t){var e=t.uniforms,n=this.props,r=n.lineWidthUnits,i=n.lineWidthScale,o=n.lineWidthMinPixels,a=n.lineWidthMaxPixels,s=n.radiusUnits,u=n.elevationScale,l=n.extruded,c=n.filled,h=n.stroked,f=n.wireframe,p=n.offset,A=n.coverage,v=n.radius,g=n.angle,m=this.state,y=m.model,_=m.fillVertexCount,b=m.wireframeVertexCount,x=m.edgeDistance;y.setUniforms(e).setUniforms({radius:v,angle:g/180*Math.PI,offset:p,extruded:l,stroked:h,coverage:A,elevationScale:u,edgeDistance:x,radiusUnits:d.iI[s],widthUnits:d.iI[r],widthScale:i,widthMinPixels:o,widthMaxPixels:a}),l&&f&&(y.setProps({isIndexed:!0}),y.setVertexCount(b).setDrawMode(1).setUniforms({isStroke:!0}).draw()),c&&(y.setProps({isIndexed:!1}
2),y.setVertexCount(_).setDrawMode(5).setUniforms({isStroke:!1}).draw()),!l&&h&&(y.setProps({isIndexed:!1}),y.setVertexCount(2*_/3).setDrawMode(5).setUniforms({isStroke:!0}).draw())}}]),n}(A.Z);(0,c.Z)(E,"layerName","ColumnLayer"),(0,c.Z)(E,"defaultProps",k)},90555:function(t,e,n){"use strict";n.d(e,{Z:function(){return c}});var r=n(22951),i=n(91976),o=n(67591),a=n(94337),s=n(64649),u=n(34819),l=n(18252),c=function(t){(0,o.Z)(n,t);var e=(0,a.Z)(n);function n(){return(0,r.Z)(this,n),e.apply(this,arguments)}return(0,i.Z)(n,[{key:"getGeometry",value:function(t){return new u.Z}},{key:"draw",value:function(t){var e=t.uniforms,n=this.props,r=n.elevationScale,i=n.extruded,o=n.offset,a=n.coverage,s=n.cellSize,u=n.angle,c=n.radiusUnits;this.state.model.setUniforms(e).setUniforms({radius:s/2,radiusUnits:l.iI[c],angle:u,offset:o,extruded:i,coverage:a,elevationScale:r,edgeDistance:1,isWireframe:!1}).draw()}}]),n}(n(35387).Z);(0,s.Z)(c,"layerName","GridCellLayer"),(0,s.Z)(c,"defaultProps",{cellSize:{type:"number",min:0,value:1e3},offset:{type:"array",value:[1,1]}})},43610:function(t,e,n){"use strict";n.d(e,{Z:function(){return L}});var r=n(53782),i=n(60726),o=n(22951),a=n(91976),s=n(83138),u=n(27597),l=n(67591),c=n(94337),h=n(50189),f=n(64649),p=n(79366),d=n(66535);function A(t,e){if(!t)return null;var n="startIndices"in t?t.startIndices[e]:e,r=t.featureIds.value[n];return-1!==n?function(t,e,n){var r={properties:(0,h.Z)({},t.properties[e])};for(var i in t.numericProps)r.properties[i]=t.numericProps[i].value[n];return r}(t,r,n):null}var v=n(32296),g=n(87403),m=n(8086),y=n(69554),_=n(3453),b={circle:{type:g.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:v.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:m.Z,props:{textSizeMaxPixels:"sizeMaxPixels",textSizeMinPi
2xels:"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"}}},x={type:y.Z,props:{lineWidthUnits:"widthUnits",lineWidthScale:"widthScale",lineWidthMinPixels:"widthMinPixels",lineWidthMaxPixels:"widthMaxPixels",lineJointRounded:"jointRounded",lineCapRounded:"capRounded",lineMiterLimit:"miterLimit",lineBillboard:"billboard",getLineColor:"getColor",getLineWidth:"getWidth"}},w={type:_.Z,props:{extruded:"extruded",filled:"filled",wireframe:"wireframe",elevationScale:"elevationScale",material:"material",getElevation:"getElevation",getFillColor:"getFillColor",getLineColor:"getLineColor"}};function C(t){var e=t.type,n=t.props,r={};for(var i in n)r[i]=e.defaultProps[n[i]];return r}function B(t,e){var n=t.props,r=n.transitions,i=n.updateTriggers,o={updateTriggers:{},transitions:r&&{getPosition:r.geometry}};for(var a in e){var s=e[a],u=t.props[a];a.startsWith("get")&&(u=t.getSubLayerAccessor(u),o.updateTriggers[s]=i[a],r&&(o.transitions[s]=r[a])),o[s]=u}return o}var k=n(21970);function E(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={pointFeatures:[],lineFeatures:[],polygonFeatures:[],polygonOutlineFeatures:[]},i=n.startRow,o=void 0===i?0:i,a=n.endRow,s=void 0===a?t.length:a,u=o;u<s;u++){var l=t[u],c=l.geometry;if(c)if("GeometryCollection"===c.type){k.Z.assert(Array.isArray(c.geometries),"GeoJSON does not have geometries array");for(var h=c.geometries,f=0;f<h.length;f++){S(h[f],r,e,l,u)}}else S(c,r,e,l,u)}return r}function S(t,e,n,r,i){var o=t.type,a=t.coordinates,s=e.pointFeatures,u=e.lineFeatures,l=e.polygonFeatures,c=e.polygonOutlineFeatures;if(function(t,e){var n=T[t];k.Z.assert(n,"Unknown GeoJSON type ".concat(t));for(;e&&--n>0;)e=e[0];return e&&Number.isFinite(e[0])}(o,a))switch(o){case"Point":s.push(n({geometry:t},r,i));break;case"MultiPoint":a.forEach((function(t){s.push(n({geometry:{type:"Point",coordinates:t}},r,i))}));break;case"LineString":u.push(n({geometry:t},r,i));break;case"MultiLineString":a.forEach((function(t){u.push(n({geometry:{type:"LineString",coordinates:t}},r,i))}));break;case"Polygon":l.push(n({geometry:t},r,i)),a.forEach((function(t){c.push(n({geometry:{type:"LineString",coordinates:t}},r,i))}));break;case"MultiPolygon":a.forEach((function(t){l.push(n({geometry:{type:"Polygon",coordinates:t}},r,i)),t.forEach((function(t){c.push(n({geometry:{type:"LineString",coordinates:t}},r,i))}))}))}else k.Z.warn("".concat(o," coordinates are malformed"))()}var T={Point:1,MultiPoint:2,LineString:2,MultiLineString:3,Polygon:3,MultiPolygon:4};function M(t){return t.geometry.coordinates}function I(t,e){var n={points:{},lines:{},polygons:{},polygonsOutline:{}},r=t.points,i=t.lines,o=t.polygons,a=function(t,e){var n={points:null,lines:null,polygons:null};for(var r in n){var i=t[r].globalFeatureIds.value;n[r]=new Uint8ClampedArray(3*i.length);for(var o=[],a=0;a<i.length;a++)e(i[a],o),n[r][3*a+0]=o[0],n[r][3*a+1]=o[1],n[r][3*a+2]=o[2]}return n}(t,e);return n.points.data={length:r.positions.value.length/r.positions.size,attributes:(0,h.Z)((0,h.Z)({},r.attributes),{},{getPosition:r.positions,instancePickingColors:{size:3,value:a.points}}),properties:r.properties,numericProps:r.numericProps,featureIds:r.featureIds},n.lines.data={length:i.pathIndices.value.length-1,startIndices:i.pathIndices.value,attributes:(0,h.Z)((0,h.Z)({},i.attributes),{},{getPath:i.positions,instancePickingColors:{size:3,value:a.lines}}),properties:i.properties,numericProps:i.numericProps,featureIds:i.featureIds}
2,n.lines._pathType="open",n.polygons.data={length:o.polygonIndices.value.length-1,startIndices:o.polygonIndices.value,attributes:(0,h.Z)((0,h.Z)({},o.attributes),{},{getPolygon:o.positions,pickingColors:{size:3,value:a.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:(0,h.Z)((0,h.Z)({},o.attributes),{},{getPath:o.positions,instancePickingColors:{size:3,value:a.polygons}}),properties:o.properties,numericProps:o.numericProps,featureIds:o.featureIds},n.polygonsOutline._pathType="open",n}var P=["instancePickingColors"],Z=["points","linestrings","polygons"],D=(0,h.Z)((0,h.Z)((0,h.Z)((0,h.Z)((0,h.Z)((0,h.Z)({},C(b.circle)),C(b.icon)),C(b.text)),C(x)),C(w)),{},{stroked:!0,filled:!0,extruded:!1,wireframe:!1,iconAtlas:{type:"object",value:null},iconMapping:{type:"object",value:{}},getIcon:{type:"accessor",value:function(t){return t.properties.icon}},getText:{type:"accessor",value:function(t){return t.properties.text}},pointType:"circle",getRadius:{deprecatedFor:"getPointRadius"}}),L=function(t){(0,l.Z)(n,t);var e=(0,c.Z)(n);function n(){return(0,o.Z)(this,n),e.apply(this,arguments)}return(0,a.Z)(n,[{key:"initializeState",value:function(){this.state={layerProps:{},features:{}}}},{key:"updateState",value:function(t){var e=t.props,n=t.changeFlags;if(n.dataChanged){var r=this.props.data,i=r&&"points"in r&&"polygons"in r&&"lines"in r;this.setState({binary:i}),i?this._updateStateBinary({props:e,changeFlags:n}):this._updateStateJSON({props:e,changeFlags:n})}}},{key:"_updateStateBinary",value:function(t){var e=t.props,n=(t.changeFlags,I(e.data,this.encodePickingColor));this.setState({layerProps:n})}},{key:"_updateStateJSON",value:function(t){var e=t.props,n=t.changeFlags,r=function(t){if(Array.isArray(t))return t;switch(k.Z.assert(t.type,"GeoJSON does not have type"),t.type){case"Feature":return[t];case"FeatureCollection":return k.Z.assert(Array.isArray(t.features),"GeoJSON does not have features array"),t.features;default:return[{geometry:t}]}}(e.data),o=this.getSubLayerRow.bind(this),a={},s={};if(Array.isArray(n.dataChanged)){var u=this.state.features;for(var l in u)a[l]=u[l].slice(),s[l]=[];var c,h=(0,i.Z)(n.dataChanged);try{for(h.s();!(c=h.n()).done;){var f=c.value,p=E(r,o,f);for(var A in u)s[A].push((0,d.b)({data:a[A],getIndex:function(t){return t.__source.index},dataRange:f,replace:p[A]}))}}catch(g){h.e(g)}finally{h.f()}}else a=E(r,o);var v=function(t,e){var n={points:{},lines:{},polygons:{},polygonsOutline:{}},r=t.pointFeatures,i=t.lineFeatures,o=t.polygonFeatures,a=t.polygonOutlineFeatures;return n.points.data=r,n.points._dataDiff=e.pointFeatures&&function(){return e.pointFeatures},n.points.getPosition=M,n.lines.data=i,n.lines._dataDiff=e.lineFeatures&&function(){return e.lineFeatures},n.lines.getPath=M,n.polygons.data=o,n.polygons._dataDiff=e.polygonFeatures&&function(){return e.polygonFeatures},n.polygons.getPolygon=M,n.polygonsOutline.data=a,n.polygonsOutline._dataDiff=e.polygonOutlineFeatures&&function(){return e.polygonOutlineFeatures},n.polygonsOutline.getPath=M,n}(a,s);this.setState({features:a,featuresDiff:s,layerProps:v})}},{key:"getPickingInfo",value:function(t){var e=this,r=(0,s.Z)((0,u.Z)(n.prototype),"getPickingInfo",this).call(this,t),i=r.index,o=r.sourceLayer;return r.featureType=Z.find((function(t){return o.id.startsWith("".concat(e.id,"-").concat(t,"-"))})),i>=0&&o.id.startsWith("".concat(this.id,"-points-text"))&&this.state.binary&&(r.index=this.props.data.points.globalFeatureIds.value[i]),r}},{key:"_updateAutoHighlight",value:function(t){var e,n="".concat(this.id,"-points-"),r="points"===t.featureType,o=(0,i.Z)(this.getSubLayers());try{for(o.s();!(e=o.n()).done;){var a=e.value;a.id.startsWith(n)===r&&a.updateAutoHighlight(t)}}catch(s){o.e(s)}finally{o.f()}}},{key:"_renderPolygonLayer",value:function(){var t=this.props,e=t.extruded,n=t.wireframe,r=this.state.layerProps,i="polygons-fill",o=this.shouldRenderSubLayer(i,r.polygons.data)&&this.get
2SubLayerClass(i,w.type);if(o){var a=B(this,w.props),s=e&&n;return s||delete a.getLineColor,a.updateTriggers.lineColors=s,new o(a,this.getSubLayerProps({id:i,updateTriggers:a.updateTriggers}),r.polygons)}return null}},{key:"_renderLineLayers",value:function(){var t=this.props,e=t.extruded,n=t.stroked,r=this.state.layerProps,i="polygons-stroke",o="linestrings",a=!e&&n&&this.shouldRenderSubLayer(i,r.polygonsOutline.data)&&this.getSubLayerClass(i,x.type),s=this.shouldRenderSubLayer(o,r.lines.data)&&this.getSubLayerClass(o,x.type);if(a||s){var u=B(this,x.props);return[a&&new a(u,this.getSubLayerProps({id:i,updateTriggers:u.updateTriggers}),r.polygonsOutline),s&&new s(u,this.getSubLayerProps({id:o,updateTriggers:u.updateTriggers}),r.lines)]}return null}},{key:"_renderPointLayers",value:function(){var t=this.props.pointType,e=this.state,n=e.layerProps,o=e.binary,a=this.props.highlightedObjectIndex;!o&&Number.isFinite(a)&&(a=n.points.data.findIndex((function(t){return t.__source.index===a})));var s,u=new Set(t.split("+")),l=[],c=(0,i.Z)(u);try{for(c.s();!(s=c.n()).done;){var f=s.value,p="points-".concat(f),d=b[f],A=d&&this.shouldRenderSubLayer(p,n.points.data)&&this.getSubLayerClass(p,d.type);if(A){var v=B(this,d.props),g=n.points;if("text"===f&&o){var m=g.data.attributes,y=(m.instancePickingColors,(0,r.Z)(m,P));g=(0,h.Z)((0,h.Z)({},g),{},{data:(0,h.Z)((0,h.Z)({},g.data),{},{attributes:y})})}l.push(new A(v,this.getSubLayerProps({id:p,updateTriggers:v.updateTriggers,highlightedObjectIndex:a}),g))}}}catch(_){c.e(_)}finally{c.f()}return l}},{key:"renderLayers",value:function(){var t=this.props.extruded,e=this._renderPolygonLayer();return[!t&&e,this._renderLineLayers(),this._renderPointLayers(),t&&e]}},{key:"getSubLayerAccessor",value:function(t){return this.state.binary&&"function"===typeof t?function(e,n){var r=A(n.data,n.index);return t(r,n)}:(0,s.Z)((0,u.Z)(n.prototype),"getSubLayerAccessor",this).call(this,t)}}]),n}(p.Z);(0,f.Z)(L,"layerName","GeoJsonLayer"),(0,f.Z)(L,"defaultProps",D)},32296:function(t,e,n){"use strict";n.d(e,{Z:function(){return Z}});var r,i=n(50189),o=n(22951),a=n(91976),s=n(47169),u=n(83138),l=n(27597),c=n(67591),h=n(94337),f=n(64649),p=n(2123),d=n(2578),A=n(18252),v=n(21970),g=n(90031),m=n(94557),y=n(69296),_=n(60726),b=n(58300),x=n(56474),w=n(21440),C=n(3685),B=n(73115),k=function(){},E=(r={},(0,f.Z)(r,10241,9987),(0,f.Z)(r,10240,9729),(0,f.Z)(r,10242,33071),(0,f.Z)(r,10243,33071),r);function S(t){return t&&(t.id||t.url)}function T(t,e,n){for(var r=0;r<e.length;r++){var o=e[r],a=o.icon,s=o.xOffset;t[S(a)]=(0,i.Z)((0,i.Z)({},a),{},{x:s,y:n})}}var M=function(){function t(e,n){var r=n.onUpdate,i=void 0===r?k:r,a=n.onError,s=void 0===a?k:a;(0,o.Z)(this,t),(0,f.Z)(this,"gl",void 0),(0,f.Z)(this,"onUpdate",void 0),(0,f.Z)(this,"onError",void 0),(0,f.Z)(this,"_loadOptions",null),(0,f.Z)(this,"_texture",null),(0,f.Z)(this,"_externalTexture",null),(0,f.Z)(this,"_mapping",{}),(0,f.Z)(this,"_textureParameters",null),(0,f.Z)(this,"_pendingCount",0),(0,f.Z)(this,"_autoPacking",!1),(0,f.Z)(this,"_xOffset",0),(0,f.Z)(this,"_yOffset",0),(0,f.Z)(this,"_rowHeight",0),(0,f.Z)(this,"_buffer",4),(0,f.Z)(this,"_canvasWidth",1024),(0,f.Z)(this,"_canvasHeight",0),(0,f.Z)(this,"_canvas",null),this.gl=e,this.onUpdate=i,this.onError=s}return(0,a.Z)(t,[{key:"finalize",value:function(){var t;null===(t=this._texture)||void 0===t||t.delete()}},{key:"getTexture",value:function(){return this._texture||this._externalTexture}},{key:"getIconMapping",value:function(t){var e=this._autoPacking?S(t):t;return this._mapping[e]||{}}},{key:"setProps",value:function(t){var e,n=t.loadOptions,r=t.autoPacking,i=t.iconAtlas,o=t.iconMapping,a=t.textureParameters;(n&&(this._loadOptions=n),void 0!==r&&(this._autoPacking=r),o&&(this._mapping=o),i)&&(null===(e=this._texture)||void 0===e||e.delete(),this._texture=null,this._externalTexture=i);a&&(this._textureParameters=a)}},{key:"isLoaded",get:function(){return 0===this._pendingCount}},{key:"packIcons",value:function(t,e){if(this._autoPacking&&"undefined"!==typeof document){var n=Object.values(function(t,e,n){if(!t||!e)return null;n=n||{};var r,o={},a=(0,B.jB)(t),s=a.iterable,u=a.objectInfo,l=(0,_.Z)(s);try{for(l.s();!(r=l.n()).done;){var c=r.value;u.index++;var h=e(c,u),f=S(h);if(!h)throw new Error("Icon is missing.");if(!h.url)throw new Error("Icon url is missing.");o[f]||n[f]&&h.url===n[f].url||(o[f]=(0,i.Z)((0,i.Z)({},h),{},{source:c,sourceIndex:u.index}))}}catch(p){l.e(p)}finally{l.f()}return o}(t,e,this._mapping)||{});if(n.length>
20){var r=function(t){for(var e,n=t.icons,r=t.buffer,i=t.mapping,o=void 0===i?{}:i,a=t.xOffset,s=void 0===a?0:a,u=t.yOffset,l=void 0===u?0:u,c=t.rowHeight,h=void 0===c?0:c,f=t.canvasWidth,p=[],d=0;d<n.length;d++){var A=n[d];if(!o[S(A)]){var v=A.height,g=A.width;s+g+r>f&&(T(o,p,l),s=0,l=h+l+r,h=0,p=[]),p.push({icon:A,xOffset:s}),s=s+g+r,h=Math.max(h,v)}}return p.length>0&&T(o,p,l),{mapping:o,rowHeight:h,xOffset:s,yOffset:l,canvasWidth:f,canvasHeight:(e=h+l+r,Math.pow(2,Math.ceil(Math.log2(e))))}}({icons:n,buffer:this._buffer,canvasWidth:this._canvasWidth,mapping:this._mapping,rowHeight:this._rowHeight,xOffset:this._xOffset,yOffset:this._yOffset}),o=r.mapping,a=r.xOffset,s=r.yOffset,u=r.rowHeight,l=r.canvasHeight;this._rowHeight=u,this._mapping=o,this._xOffset=a,this._yOffset=s,this._canvasHeight=l,this._texture||(this._texture=new b.Z(this.gl,{width:this._canvasWidth,height:this._canvasHeight,parameters:this._textureParameters||E})),this._texture.height!==this._canvasHeight&&(this._texture=function(t,e,n,r){var i=t.width,o=t.height,a=new b.Z(t.gl,{width:e,height:n,parameters:r});return(0,x.Lv)(t,a,{targetY:0,width:i,height:o}),t.delete(),a}(this._texture,this._canvasWidth,this._canvasHeight,this._textureParameters||E)),this.onUpdate(),this._canvas=this._canvas||document.createElement("canvas"),this._loadIcons(n)}}}},{key:"_loadIcons",value:function(t){var e,n=this,r=this._canvas.getContext("2d"),i=(0,_.Z)(t);try{var o=function(){var t=e.value;n._pendingCount++,(0,C.z)(t.url,w.S,n._loadOptions).then((function(e){var i=S(t),o=n._mapping[i],a=o.x,s=o.y,u=o.width,l=o.height,c=function(t,e,n,r){return n===e.width&&r===e.height?e:(t.canvas.height=r,t.canvas.width=n,t.clearRect(0,0,t.canvas.width,t.canvas.height),t.drawImage(e,0,0,e.width,e.height,0,0,n,r),t.canvas)}(r,e,u,l);n._texture.setSubImageData({data:c,x:a,y:s,width:u,height:l}),n._texture.generateMipmap(),n.onUpdate()})).catch((function(e){n.onError({url:t.url,source:t.source,sourceIndex:t.sourceIndex,loadOptions:n._loadOptions,error:e})})).finally((function(){n._pendingCount--}))};for(i.s();!(e=i.n()).done;)o()}catch(a){i.e(a)}finally{i.f()}}}]),t}(),I=[0,0,0,255],P={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:function(t){return t.position}},getIcon:{type:"accessor",value:function(t){return t.icon}},getColor:{type:"accessor",value:I},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0},getPixelOffset:{type:"accessor",value:[0,0]},onIconError:{type:"function",value:null,compare:!1,optional:!0}},Z=function(t){(0,c.Z)(n,t);var e=(0,h.Z)(n);function n(){var t;(0,o.Z)(this,n);for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];return t=e.call.apply(e,[this].concat(i)),(0,f.Z)((0,s.Z)(t),"state",void 0),t}return(0,a.Z)(n,[{key:"getShaders",value:function(){return(0,u.Z)((0,l.Z)(n.prototype),"getShaders",this).call(this,{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  // convert size in meters to pixels, then scaled and clamp\n \n  // project meters to pixels and clamp to limits \n  float sizePixels = clamp(\n    project_size_to_pixel(instanceSizes * sizeScale, sizeUnits), \n    sizeMinPi
2xels, sizeMaxPixels\n  );\n\n  // scale icon height to match instanceSize\n  float instanceScale = iconSize.y == 0.0 ? 0.0 : sizePixels / iconSize.y;\n\n  // scale and rotate vertex in "pixel" value and convert back to fraction in clipspace\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    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  }\n  DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\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\n  // if colorMode == 0, use pixel color from the texture\n  // if colorMode == 1 or rendering picking buffer, use texture as transparency mask\n  vec3 color = mix(texColor.rgb, vColor.rgb, vColorMode);\n  // Take the global opacity and the alpha from vColor into account for the alpha component\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:[p.Z,d.Z]})}},{key:"initializeState",value:function(){this.state={iconManager:new M(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:I},instanceAngles:{size:1,transition:!0,accessor:"getAngle"},instancePixelOffset:{size:2,transition:!0,accessor:"getPixelOffset"}})}},{key:"updateState",value:function(t){(0,u.Z)((0,l.Z)(n.prototype),"updateState",this).call(this,t);var e=t.props,r=t.oldProps,i=t.changeFlags,o=this.getAttributeManager(),a=e.iconAtlas,s=e.iconMapping,c=e.data,h=e.getIcon,f=e.textureParameters,p=this.state.iconManager,d=a||this.internalState.isAsyncPropLoading("iconAtlas");if(p.setProps({loadOptions:e.loadOptions,autoPacking:!d,iconAtlas:a,iconMapping:d?s:null,textureParameters:f}),d?r.iconMapping!==e.iconMapping&&o.invalidate("getIcon"):(i.dataChanged||i.updateTriggersChanged&&(i.updateTriggersChanged.all||i.updateTriggersChanged.getIcon))&&p.packIcons(c,h),i.extensionsChanged){var A,v=this.context.gl;null===(A=this.state.model)||void 0===A||A.delete(),this.state.model=this._getModel(v),o.invalidateAll()}}},{key:"isLoaded",get:function(){return(0,u.Z)((0,l.Z)(n.prototype),"isLoaded",this)&&this.state.iconManager.isLoaded}},{key:"finalizeState",value:function(t){(0,u.Z)((0,l.Z)(n.prototype),"finalizeState",this).call(this,t),this.state.iconManager.finalize()}},{key:"draw",value:function(t){var e=t.uniforms,n=this.props,r=n.sizeScale,i=n.sizeMinPi
2xels,o=n.sizeMaxPixels,a=n.sizeUnits,s=n.billboard,u=n.alphaCutoff,l=this.state.iconManager.getTexture();l&&this.state.model.setUniforms(e).setUniforms({iconsTexture:l,iconsTextureDim:[l.width,l.height],sizeUnits:A.iI[a],sizeScale:r,sizeMinPixels:i,sizeMaxPixels:o,billboard:s,alphaCutoff:u}).draw()}},{key:"_getModel",value:function(t){return new m.Z(t,(0,i.Z)((0,i.Z)({},this.getShaders()),{},{id:this.props.id,geometry:new y.Z({drawMode:6,attributes:{positions:{size:2,value:new Float32Array([-1,-1,-1,1,1,1,1,-1])}}}),isInstanced:!0}))}},{key:"_onUpdate",value:function(){this.setNeedsRedraw()}},{key:"_onError",value:function(t){var e,n=null===(e=this.getCurrentLayer())||void 0===e?void 0:e.props.onIconError;n?n(t):v.Z.error(t.error.message)()}},{key:"getInstanceOffset",value:function(t){var e=this.state.iconManager.getIconMapping(t),n=e.width,r=e.height,i=e.anchorX,o=void 0===i?n/2:i,a=e.anchorY;return[n/2-o,r/2-(void 0===a?r/2:a)]}},{key:"getInstanceColorMode",value:function(t){return this.state.iconManager.getIconMapping(t).mask?1:0}},{key:"getInstanceIconFrame",value:function(t){var e=this.state.iconManager.getIconMapping(t);return[e.x,e.y,e.width,e.height]}}]),n}(g.Z);(0,f.Z)(Z,"defaultProps",P),(0,f.Z)(Z,"layerName","IconLayer")},43536:function(t,e,n){"use strict";n.r(e),n.d(e,{ArcLayer:function(){return r.Z},BitmapLayer:function(){return S},ColumnLayer:function(){return D.Z},GeoJsonLayer:function(){return R.Z},GridCellLayer:function(){return L.Z},IconLayer:function(){return M.Z},LineLayer:function(){return I.Z},PathLayer:function(){return O.Z},PointCloudLayer:function(){return P.Z},PolygonLayer:function(){return F.Z},ScatterplotLayer:function(){return Z.Z},SolidPolygonLayer:function(){return U.Z},TextLayer:function(){return z.Z},_MultiIconLayer:function(){return N.Z},_TextBackgroundLayer:function(){return G.Z}});var r=n(73351),i=n(11026),o=n(50189),a=n(22951),s=n(91976),u=n(47169),l=n(83138),c=n(27597),h=n(67591),f=n(94337),p=n(64649),d=n(18252),A=n(2123),v=n(2578),g=n(90031),m=n(94557),y=n(69296),_=n(75818),b=n(47410),x=new Uint16Array([0,2,1,0,3,2]),w=new Float32Array([0,1,0,0,1,0,1,1]);function C(t,e){if(!e)return function(t){for(var e=new Float64Array(12),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:x,texCoords:w}}(t);for(var n=Math.max(Math.abs(t[0][0]-t[3][0]),Math.abs(t[1][0]-t[2][0])),r=Math.max(Math.abs(t[1][1]-t[0][1]),Math.abs(t[2][1]-t[3][1])),i=Math.ceil(n/e)+1,o=Math.ceil(r/e)+1,a=(i-1)*(o-1)*6,s=new Uint32Array(a),u=new Float32Array(i*o*2),l=new Float64Array(i*o*3),c=0,h=0,f=0;f<i;f++)for(var p=f/(i-1),d=0;d<o;d++){var A=d/(o-1),v=B(t,p,A);l[3*c+0]=v[0],l[3*c+1]=v[1],l[3*c+2]=v[2]||0,u[2*c+0]=p,u[2*c+1]=1-A,f>0&&d>0&&(s[h++]=c-o,s[h++]=c-o-1,s[h++]=c-1,s[h++]=c-o,s[h++]=c-1,s[h++]=c),c++}return{vertexCount:a,positions:l,indices:s,texCoords:u}}function B(t,e,n){return(0,b.t7)((0,b.t7)(t[0],t[1],n),(0,b.t7)(t[3],t[2],n),e)}var k="\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}
2\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  return mix(transparentColor, vec4(color, 1.0), alpha);\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) {\n    // Since instance information is not used, we can use picking color for pixel index\n    gl_FragColor.rgb = packUVsIntoRGB(uv);\n  }\n}\n"),E={image:{type:"image",value:null,async:!0},bounds:{type:"array",value:[1,0,0,1],compare:!0},_imageCoordinateSystem:d.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]}},S=function(t){(0,h.Z)(n,t);var e=(0,f.Z)(n);function n(){var t;(0,a.Z)(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),(0,p.Z)((0,u.Z)(t),"state",void 0),t}return(0,s.Z)(n,[{key:"getShaders",value:function(){return(0,l.Z)((0,c.Z)(n.prototype),"getShaders",this).call(this,{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:k,modules:[A.Z,v.Z]})}},{key:"initializeState",value:function(){var t=this,e=this.getAttributeManager();e.remove(["instancePickingColors"]);var n=!0;e.add({indices:{size:1,isIndexed:!0,update:function(e){return e.value=t.state.mesh.indices},noAlloc:n},positions:{size:3,type:5130,fp64:this.use64bitPositions(),update:function(e){return e.value=t.state.mesh.positions},noAlloc:n},texCoords:{size:2,update:function(e){return e.value=t.state.mesh.texCoords},noAlloc:n}})}},{key:"updateState",value:function(t){var e=t.props,n=t.oldProps,r=t.changeFlags,i=this.getAttributeManager();if(r.extensionsChanged){var a,s=this.context.gl;null===(a=this.state.model)||void 0===a||a.delete(),this.state.model=this._getModel(s),i.invalidateAll()}if(e.bounds!==n.bounds){var u=this.state.mesh,l=this._createMesh();for(var c in this.state.model.setVertexCount(l.vertexCount),l)u&&u[c]!==l[c]&&i.invalidate(c);this.setState((0,o.Z)({mesh:l},this._getCoordinateUniforms()))}else e._imageCoordinateSystem!==n._imageCoordinateSystem&&this.setState(this._getCoordinateUniforms())}},{key:"getPickingInfo",value:function(t){var e=this.props.image,n=t.
2info;if(!n.color||!e)return n.bitmap=null,n;var r=e.width,o=e.height;n.index=0;var a=function(t){var e=(0,i.Z)(t,3),n=e[0],r=e[1],o=e[2];return[(n+(15&o)/16)/256,(r+(240&o)/256)/256]}(n.color),s=[Math.floor(a[0]*r),Math.floor(a[1]*o)];return n.bitmap={size:{width:r,height:o},uv:a,pixel:s},n}},{key:"disablePickingIndex",value:function(){this.setState({disablePicking:!0})}},{key:"restorePickingColors",value:function(){this.setState({disablePicking:!1})}},{key:"_updateAutoHighlight",value:function(t){(0,l.Z)((0,c.Z)(n.prototype),"_updateAutoHighlight",this).call(this,(0,o.Z)((0,o.Z)({},t),{},{color:this.encodePickingColor(0)}))}},{key:"_createMesh",value:function(){var t=this.props.bounds,e=t;return T(t)&&(e=[[t[0],t[1]],[t[0],t[3]],[t[2],t[3]],[t[2],t[1]]]),C(e,this.context.viewport.resolution)}},{key:"_getModel",value:function(t){return t?new m.Z(t,(0,o.Z)((0,o.Z)({},this.getShaders()),{},{id:this.props.id,geometry:new y.Z({drawMode:4,vertexCount:6}),isInstanced:!1})):null}},{key:"draw",value:function(t){var e=t.uniforms,n=t.moduleParameters,r=this.state,i=r.model,o=r.coordinateConversion,a=r.bounds,s=r.disablePicking,u=this.props,l=u.image,c=u.desaturate,h=u.transparentColor,f=u.tintColor;n.pickingActive&&s||l&&i&&i.setUniforms(e).setUniforms({bitmapTexture:l,desaturate:c,transparentColor:h.map((function(t){return t/255})),tintColor:f.slice(0,3).map((function(t){return t/255})),coordinateConversion:o,bounds:a}).draw()}},{key:"_getCoordinateUniforms",value:function(){var t=d.Df.LNGLAT,e=d.Df.CARTESIAN,n=d.Df.DEFAULT,r=this.props._imageCoordinateSystem;if(r!==n){var i=this.props.bounds;if(!T(i))throw new Error("_imageCoordinateSystem only supports rectangular bounds");var o=this.context.viewport.resolution?t:e;if((r=r===t?t:e)===t&&o===e)return{coordinateConversion:-1,bounds:i};if(r===e&&o===t){var a=(0,_.w5)([i[0],i[1]]),s=(0,_.w5)([i[2],i[3]]);return{coordinateConversion:1,bounds:[a[0],a[1],s[0],s[1]]}}}return{coordinateConversion:0,bounds:[0,0,0,0]}}}]),n}(g.Z);function T(t){return Number.isFinite(t[0])}(0,p.Z)(S,"layerName","BitmapLayer"),(0,p.Z)(S,"defaultProps",E);var M=n(32296),I=n(24985),P=n(11162),Z=n(87403),D=n(35387),L=n(90555),O=n(69554),F=n(94300),R=n(43610),z=n(8086),U=n(3453),N=n(20377),G=n(56394)},24985:function(t,e,n){"use strict";n.d(e,{Z:function(){return m}});var r=n(50189),i=n(22951),o=n(91976),a=n(83138),s=n(27597),u=n(67591),l=n(94337),c=n(64649),h=n(2123),f=n(2578),p=n(18252),d=n(90031),A=n(94557),v=n(69296),g={getSourcePosition:{type:"accessor",value:function(t){return t.sourcePosition}},getTargetPosition:{type:"accessor",value:function(t){return 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}},m=function(t){(0,u.Z)(n,t);var e=(0,l.Z)(n);function n(){return(0,i.Z)(this,n),e.apply(this,arguments)}return(0,o.Z)(n,[{key:"getShaders",value:function(){return(0,a.Z)((0,s.Z)(n.prototype),"getShaders",this).call(this,{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;\n\n// offset vector by strokeWidth pixels\n// offset_direction is -1 (left) or 1 (right)\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) {\n  // normalized direction of the line\n  vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize);\n  // rotate by 90 degrees\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.
20) - 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      // Line is not split, abort\n      gl_Position = vec4(0.);\n      return;\n    }\n  }\n\n  // Position\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  \n  // linear interpolation of source & target to pick right coord\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\n  // Multiply out width and clamp to limits\n  float widthPixels = clamp(\n    project_size_to_pixel(instanceWidths * widthScale, widthUnits),\n    widthMinPixels, widthMaxPixels\n  );\n\n  // extrude\n  vec3 offset = vec3(\n    getExtrusionOffset(target.xy - source.xy, positions.y, widthPixels),\n    0.0);\n  DECKGL_FILTER_SIZE(offset, geometry);\n  gl_Position = p + vec4(project_pixel_size_to_clipspace(offset.xy), 0.0, 0.0);\n  DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n  // Color\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:[h.Z,f.Z]})}},{key:"wrapLongitude",get:function(){return!1}},{key:"initializeState",value:function(){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}})}},{key:"updateState",value:function(t){if((0,a.Z)((0,s.Z)(n.prototype),"updateState",this).call(this,t),t.changeFlags.extensionsChanged){var e,r=this.context.gl;null===(e=this.state.model)||void 0===e||e.delete(),this.state.model=this._getModel(r),this.getAttributeManager().invalidateAll()}}},{key:"draw",value:function(t){var e=t.uniforms,n=this.props,r=n.widthUnits,i=n.widthScale,o=n.widthMinPixels,a=n.widthMaxPixels,s=n.wrapLongitude;this.state.model.setUniforms(e).setUniforms({widthUnits:p.iI[r],widthScale:i,widthMinPixels:o,widthMaxPixels:a,useShortestPath:s?1:0}).draw(),s&&this.state.model.setUniforms({useShortestPath:-1}).draw()}},{key:"_getModel",value:function(t){return new A.Z(t,(0,r.Z)((0,r.Z)({},this.getShaders()),{},{id:this.props.id,geometry:new v.Z({drawMode:5,attributes:{positions:new Float32Array([0,-1,0,0,1,0,1,-1,0,1,1,0])}}),isInstanced:!0}))}}]),n}(d.Z);(0,c.Z)(m,"layerName","LineLayer"),(0,c.Z)(m,"defaultProps",g)},69554:function(t,e,n){"use strict";n.d(e,{Z:function(){return k}});var r=n(50189),i=n(22951),o=n(91976),a=n(47169),s=n(83138),u=n(27597),l=n(67591),c=n(94337),h=n(64649),f=n(2123),p=n(2578),d=n(18252),A=n(90031),v=n(94557),g=n(69296),m=n(60726),y=n(55678),_=n(23595);var b=function(t){(0,l.Z)(n,t);var e=(0,c.Z)(n);function n(t){return(0,i.Z)(this,n),e.call(this,(0,r.Z)((0,r.Z)({},t),{},{attributes:{positions:{size:3,padding:18,initialize:!0,type:t.fp64?Float64Array:Float32Array},segmentTypes:{size:1,type:Uint8ClampedArray}}}))}return(0,o.Z)(n,[{key:"get",value:function(t){return this.attributes[t]}},{key:"getGeometryFromBuffer",value:function(t){return this.normalize?(0,s.Z)((0,u.Z)(n.prototype),"getGeometryFromBuffer",this).call(this,t):null}},{key:"normalizeGeometry",value:function(t){return this.normalize?function(t,e,n,r){var i;if(Array.isArray(t[0])){var o=t.length*e;i=new Array(o);for(var a=0;a<t.length;a++)for(var s=0;s<e;s++)i[a*e+s]=t[a][s]||0}else i=t;
2return n?(0,_.dj)(i,{size:e,gridResolution:n}):r?(0,_.ct)(i,{size:e}):i}(t,this.positionSize,this.opts.resolution,this.opts.wrapLongitude):t}},{key:"getGeometrySize",value:function(t){if(x(t)){var e,n=0,r=(0,m.Z)(t);try{for(r.s();!(e=r.n()).done;){var i=e.value;n+=this.getGeometrySize(i)}}catch(a){r.e(a)}finally{r.f()}return n}var o=this.getPathLength(t);return o<2?0:this.isClosed(t)?o<3?0:o+2:o}},{key:"updateGeometryAttributes",value:function(t,e){if(0!==e.geometrySize)if(t&&x(t)){var n,r=(0,m.Z)(t);try{for(r.s();!(n=r.n()).done;){var i=n.value,o=this.getGeometrySize(i);e.geometrySize=o,this.updateGeometryAttributes(i,e),e.vertexStart+=o}}catch(a){r.e(a)}finally{r.f()}}else this._updateSegmentTypes(t,e),this._updatePositions(t,e)}},{key:"_updateSegmentTypes",value:function(t,e){var n=this.attributes.segmentTypes,r=!!t&&this.isClosed(t),i=e.vertexStart,o=e.geometrySize;n.fill(0,i,i+o),r?(n[i]=4,n[i+o-2]=4):(n[i]+=1,n[i+o-2]+=2),n[i+o-1]=4}},{key:"_updatePositions",value:function(t,e){var n=this.attributes.positions;if(n&&t)for(var r=e.vertexStart,i=e.geometrySize,o=new Array(3),a=r,s=0;s<i;a++,s++)this.getPointOnPath(t,s,o),n[3*a]=o[0],n[3*a+1]=o[1],n[3*a+2]=o[2]}},{key:"getPathLength",value:function(t){return t.length/this.positionSize}},{key:"getPointOnPath",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=this.positionSize;e*r>=t.length&&(e+=1-t.length/r);var i=e*r;return n[0]=t[i],n[1]=t[i+1],n[2]=3===r&&t[i+2]||0,n}},{key:"isClosed",value:function(t){if(!this.normalize)return Boolean(this.opts.loop);var e=this.positionSize,n=t.length-e;return t[0]===t[n]&&t[1]===t[n+1]&&(2===e||t[2]===t[n+2])}}]),n}(y.Z);function x(t){return Array.isArray(t[0])}var w=[0,0,0,255],C={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:function(t){return t.path}},getColor:{type:"accessor",value:w},getWidth:{type:"accessor",value:1},rounded:{deprecatedFor:["jointRounded","capRounded"]}},B={enter:function(t,e){return e.length?e.subarray(e.length-t.length):t}},k=function(t){(0,l.Z)(n,t);var e=(0,c.Z)(n);function n(){var t;(0,i.Z)(this,n);for(var r=arguments.length,o=new Array(r),s=0;s<r;s++)o[s]=arguments[s];return t=e.call.apply(e,[this].concat(o)),(0,h.Z)((0,a.Z)(t),"state",void 0),t}return(0,o.Z)(n,[{key:"getShaders",value:function(){return(0,s.Z)((0,u.Z)(n.prototype),"getShaders",this).call(this,{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}\n\n// calculate line join positions\nvec3 lineJoin(\n  vec3 prevPoint, vec3 currPoint, vec3 nextPoint,\n  vec2 width\n) {\n  bool isEnd = positions.x > 0.0;\n  // side of the segment - -1: left, 0: center, 1: right\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\n  // tangent of the corner\n  vec2 tangent = dirA + dirB;\n  tangent = length(tangent) > 0. ? normalize(tangent) : perpA;\n  // direction of the corner\n  vec2 miterVec = vec2(-tangent.y, tangent.x);\n  // direction of the segment\n  vec2 dir = isEnd ? dirA : dirB;\n  // direction of the extrusion\n  vec2 perp = isEnd ? perpA : perpB;\n  // length of the segment\n  float L = isEnd ? lenA : lenB;\n\n  // A = angle of the corner\n  float sinHalfA = abs(dot(miterVec, perp));\n  float cosHalfA = abs(dot(dirA, miterVec));\n\n  // -1: right, 1: left\n  float turnDirection = flipIfTrue(dirA.x * dirB.y >= dirA.y * dirB.x);\n\n  // relative position to the corner:\n  // -1: inside (smaller side of the angle)\n  // 0: center\n  // 1: outside (bigger side of the angle)\n  float cornerPosition = sideOfPath * turnDirection;\n\n  float miterSize = 1.0 / max(sinHalfA, EPSILON);\n  // trim if inside corner extends further than the line segment\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\n  // special treatment for start cap and end cap\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\n  // extend out a triangle to envelope the round cap\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\n  // Generate variables for fragment shader\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 currPoint + offset;\n}\n\n// In clipspace extrusion, if a line extends behind the camera, clip it to avoid visual artifacts\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    // Extrude in clipspace\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 pos = lineJoin(\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    gl_Position = vec4(pos * currPositionScreen.w, currPositionScreen.w);\n  } else {\n    // Extrude in commonspace\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    vec4 pos = vec4(\n      lineJoin(prevPosition, currPosition, nextPosition, width.xy),\n      1.0);\n    geometry.position = pos;\n    gl_Position = project_common_position_to_clipspace(pos);\n  }\n  DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n  DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#define SHADER_NAME path-layer-fragment-shader\n\nprecision highp float;\n\nuniform float miterLimit;
2\n\nvarying vec4 vColor;\nvarying vec2 vCornerOffset;\nvarying float vMiterLength;\n/*\n * vPathPosition represents the relative coordinates of the current fragment on the path segment.\n * vPathPosition.x - position along the width of the path, between [-1, 1]. 0 is the center line.\n * vPathPosition.y - position along the length of the path, between [0, L / width].\n */\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 joint is rounded, test distance from the corner\n    if (vJointType > 0.5 && length(vCornerOffset) > 1.0) {\n      discard;\n    }\n    // trim miter\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:[f.Z,p.Z]})}},{key:"wrapLongitude",get:function(){return!1}},{key:"initializeState",value:function(){var t=this;this.getAttributeManager().addInstanced({positions:{size:3,vertexOffset:1,type:5130,fp64:this.use64bitPositions(),transition:B,accessor:"getPath",update:this.calculatePositions,noAlloc:true,shaderAttributes:{instanceLeftPositions:{vertexOffset:0},instanceStartPositions:{vertexOffset:1},instanceEndPositions:{vertexOffset:2},instanceRightPositions:{vertexOffset:3}}},instanceTypes:{size:1,type:5121,update:this.calculateSegmentTypes,noAlloc:true},instanceStrokeWidths:{size:1,accessor:"getWidth",transition:B,defaultValue:1},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,accessor:"getColor",transition:B,defaultValue:w},instancePickingColors:{size:3,type:5121,accessor:function(e,n){var r=n.index,i=n.target;return t.encodePickingColor(e&&e.__source?e.__source.index:r,i)}}}),this.setState({pathTesselator:new b({fp64:this.use64bitPositions()})})}},{key:"updateState",value:function(t){(0,s.Z)((0,u.Z)(n.prototype),"updateState",this).call(this,t);var e=t.props,r=t.changeFlags,i=this.getAttributeManager();if(r.dataChanged||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged.getPath)){var o=this.state.pathTesselator,a=e.data.attributes||{};o.updateGeometry({data:e.data,geometryBuffer:a.getPath,buffers:a,normalize:!e._pathType,loop:"loop"===e._pathType,getGeometry:e.getPath,positionFormat:e.positionFormat,wrapLongitude:e.wrapLongitude,resolution:this.context.viewport.resolution,dataChanged:r.dataChanged}),this.setState({numInstances:o.instanceCount,startIndices:o.vertexStarts}),r.dataChanged||i.invalidateAll()}if(r.extensionsChanged){var l,c=this.context.gl;null===(l=this.state.model)||void 0===l||l.delete(),this.state.model=this._getModel(c),i.invalidateAll()}}},{key:"getPickingInfo",value:function(t){var e=(0,s.Z)((0,u.Z)(n.prototype),"getPickingInfo",this).call(this,t),r=e.index,i=this.props.data;return i[0]&&i[0].__source&&(e.object=i.find((function(t){return t.__source.index===r}))),e}},{key:"disablePickingIndex",value:function(t){var e=this.props.data;if(e[0]&&e[0].__source)for(var n=0;n<e.length;n++)e[n].__source.index===t&&this._disablePickingIndex(n);else this._disablePickingIndex(t)}},{key:"draw",value:function(t){var e=t.uniforms,n=this.props,r=n.jointRounded,i=n.capRounded,o=n.billboard,a=n.miterLimit,s=n.widthUnits,u=n.widthScale,l=n.widthMinPixels,c=n.widthMaxPixels;this.state.model.setUniforms(e).setUniforms({jointType:Number(r),capType:Number(i),billboard:o,widthUnits:d.iI[s],widthScale:u,miterLimit:a,widthMinPixels:l,widthMaxPixels:c}).draw()}},{key:"_getModel",value:function(t){return new v.Z(t,(0,r.Z)((0,r.Z)({},this.getShaders()),{},{id:this.props.id,geometry:new g.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}))}},{key:"calculatePositions",value:function(t){var e=this.state.pathTesselator;t.startIndices=e.vertexStarts,t.value=e.get("positions")}},{key:"calculateSegmentTypes",value:function(t){var e=this.state.pathTesselator;t.startIndices=e.vertexStarts,t.value=e.get("segmentTypes")}}]),n}(A.Z);(0,h.Z)(k,"defaultProps",C),(0,h.Z)(k,"layerName","PathLayer")},11162:function(t,e,n){"use strict";n.d(e,{Z:function(){return b}});var r=n(50189),i=n(22951),o=n(91976),a=n(83138),s=n(27597),u=n(67591),l=n(94337),c=n(64649),h=n(2123),f=n(54976),p=n(2578),d=n(18252),A=n(90031),v=n(94557),g=n(69296),m=[0,0,0,255],y=[0,0,1],_={sizeUnits:"pixels",pointSize:{type:"number",min:0,value:10},getPosition:{type:"accessor",value:function(t){return t.position}},getNormal:{type:"accessor",value:y},getColor:{type:"accessor",value:m},material:!0,radiusPixels:{deprecatedFor:"pointSize"}};var b=function(t){(0,u.Z)(n,t);var e=(0,l.Z)(n);function n(){return(0,i.Z)(this,n),e.apply(this,arguments)}return(0,o.Z)(n,[{key:"getShaders",value:function(){return(0,a.Z)((0,s.Z)(n.prototype),"getShaders",this).call(this,{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\n  // position on the containing square in [-1, 1] space\n  unitPosition = positions.xy;\n  geometry.uv = unitPosition;\n  geometry.pickingColor = instancePickingColors;\n\n  // Find the center of the point and add the current vertex\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  gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n  DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n  // Apply lighting\n  vec3 lightColor = lighting_getLightColor(instanceColors.rgb, project_uCameraPosition, geometry.position.xyz, geometry.normal);\n\n  // Apply opacity to instance color, or return instance picking color\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:[h.Z,f.N,p.Z]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceNormals:{size:3,transition:!0,accessor:"getNormal",defaultValue:y},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getColor",defaultValue:m}})}},{key:"updateState",value:function(t){var e=t.changeFlags,r=t.props;if((0,a.Z)((0,s.Z)(n.prototype),"updateState",this).call(this,t),e.extensionsChanged){var i,o=this.context.gl;null===(i=this.state.model)||void 0===i||i.delete(),this.state.model=this._getModel(o),this.getAttributeManager().invalidateAll()}e.dataChanged&&function(t){var e=t.header,n=t.attributes;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))}(r.data)}},{key:"draw",value:function(t){var e=t.uniforms,n=this.props,r=n.pointSize,i=n.sizeUnits;this.state.model.setUniforms(e).setUniforms({sizeUnits:d.iI[i],radiusPixels:r}).draw()}},{key:"_getModel",value:function(t){for(var e=[],n=0;n<3;n++){var i=n/3*Math.PI*2;e.push(2*Math.cos(i),2*Math.sin(i),0)}return new v.Z(t,(0,r.Z)((0,r.Z)({}
2,this.getShaders()),{},{id:this.props.id,geometry:new g.Z({drawMode:4,attributes:{positions:new Float32Array(e)}}),isInstanced:!0}))}}]),n}(A.Z);(0,c.Z)(b,"layerName","PointCloudLayer"),(0,c.Z)(b,"defaultProps",_)},94300:function(t,e,n){"use strict";n.d(e,{Z:function(){return m}});var r=n(60726),i=n(22951),o=n(91976),a=n(67591),s=n(94337),u=n(64649),l=n(21970),c=n(73115),h=n(79366),f=n(3453),p=n(69554),d=n(32643),A=n(66535),v=[0,0,0,255],g={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:function(t){return t.polygon}},getFillColor:{type:"accessor",value:[0,0,0,255]},getLineColor:{type:"accessor",value:v},getLineWidth:{type:"accessor",value:1},getElevation:{type:"accessor",value:1e3},material:!0},m=function(t){(0,a.Z)(n,t);var e=(0,s.Z)(n);function n(){return(0,i.Z)(this,n),e.apply(this,arguments)}return(0,o.Z)(n,[{key:"initializeState",value:function(){this.state={paths:[]},this.props.getLineDashArray&&l.Z.removed("getLineDashArray","PathStyleExtension")()}},{key:"updateState",value:function(t){var e=this,n=t.changeFlags,r=n.dataChanged||n.updateTriggersChanged&&(n.updateTriggersChanged.all||n.updateTriggersChanged.getPolygon);if(r&&Array.isArray(n.dataChanged)){var i=this.state.paths.slice(),o=n.dataChanged.map((function(t){return(0,A.b)({data:i,getIndex:function(t){return t.__source.index},dataRange:t,replace:e._getPaths(t)})}));this.setState({paths:i,pathsDiff:o})}else r&&this.setState({paths:this._getPaths(),pathsDiff:null})}},{key:"_getPaths",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=this.props,i=n.data,o=n.getPolygon,a=n.positionFormat,s=n._normalize,u=[],l="XY"===a?2:3,h=e.startRow,f=e.endRow,p=(0,c.jB)(i,h,f),A=p.iterable,v=p.objectInfo,g=(0,r.Z)(A);try{for(g.s();!(t=g.n()).done;){var m=t.value;v.index++;var y=o(m,v);s&&(y=d.Fv(y,l));var _=y.holeIndices,b=y.positions||y;if(_)for(var x=0;x<=_.length;x++){var w=b.slice(_[x-1]||0,_[x]||b.length);u.push(this.getSubLayerRow({path:w},m,v.index))}else u.push(this.getSubLayerRow({path:b},m,v.index))}}catch(C){g.e(C)}finally{g.f()}return u}},{key:"renderLayers",value:function(){var t=this.props,e=t.data,n=t._dataDiff,r=t.stroked,i=t.filled,o=t.extruded,a=t.wireframe,s=t._normalize,u=t._windingOrder,l=t.elevationScale,c=t.transitions,h=t.positionFormat,d=this.props,A=d.lineWidthUnits,g=d.lineWidthScale,m=d.lineWidthMinPixels,y=d.lineWidthMaxPixels,_=d.lineJointRounded,b=d.lineMiterLimit,x=d.lineDashJustified,w=this.props,C=w.getFillColor,B=w.getLineColor,k=w.getLineWidth,E=w.getLineDashArray,S=w.getElevation,T=w.getPolygon,M=w.updateTriggers,I=w.material,P=this.state,Z=P.paths,D=P.pathsDiff,L=this.getSubLayerClass("fill",f.Z),O=this.getSubLayerClass("stroke",p.Z),F=this.shouldRenderSubLayer("fill",Z)&&new L({_dataDiff:n,extruded:o,elevationScale:l,filled:i,wireframe:a,_normalize:s,_windingOrder:u,getElevation:S,getFillColor:C,getLineColor:o&&a?B:v,material:I,transitions:c},this.getSubLayerProps({id:"fill",updateTriggers:M&&{getPolygon:M.getPolygon,getElevation:M.getElevation,getFillColor:M.getFillColor,lineColors:o&&a,getLineColor:M.getLineColor}}),{data:e,positionFormat:h,getPolygon:T});return[!o&&F,!o&&r&&this.shouldRenderSubLayer("stroke",Z)&&new O({_dataDiff:D&&function(){return D},widthUnits:A,widthScale:g,widthMinPixels:m,widthMaxPixels:y,jointRounded:_,miterLimit:b,dashJustified:x,_pathType:"loop",transitions:c&&{getWidth:c.getLineWidth,getColor:c.getLineColor,getPath:c.getPolygon},getColor:this.getSubLayerAccessor(B),getWidth:this.getSubLayerAccessor(k),getDashArray:this.getSubLayerAccessor(E)}
2,this.getSubLayerProps({id:"stroke",updateTriggers:M&&{getWidth:M.getLineWidth,getColor:M.getLineColor,getDashArray:M.getLineDashArray}}),{data:Z,positionFormat:h,getPath:function(t){return t.path}}),o&&F]}}]),n}(h.Z);(0,u.Z)(m,"layerName","PolygonLayer"),(0,u.Z)(m,"defaultProps",g)},87403:function(t,e,n){"use strict";n.d(e,{Z:function(){return y}});var r=n(50189),i=n(22951),o=n(91976),a=n(83138),s=n(27597),u=n(67591),l=n(94337),c=n(64649),h=n(2123),f=n(2578),p=n(18252),d=n(90031),A=n(94557),v=n(69296),g=[0,0,0,255],m={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:function(t){return t.position}},getRadius:{type:"accessor",value:1},getFillColor:{type:"accessor",value:g},getLineColor:{type:"accessor",value:g},getLineWidth:{type:"accessor",value:1},strokeWidth:{deprecatedFor:"getLineWidth"},outline:{deprecatedFor:"stroked"},getColor:{deprecatedFor:["getFillColor","getLineColor"]}},y=function(t){(0,u.Z)(n,t);var e=(0,l.Z)(n);function n(){return(0,i.Z)(this,n),e.apply(this,arguments)}return(0,o.Z)(n,[{key:"getShaders",value:function(){return(0,a.Z)((0,s.Z)(n.prototype),"getShaders",this).call(this,{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;
2\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\n  // Multiply out radius and clamp to limits\n  outerRadiusPixels = clamp(\n    project_size_to_pixel(radiusScale * instanceRadius, radiusUnits),\n    radiusMinPixels, radiusMaxPixels\n  );\n  \n  // Multiply out line width and clamp to limits\n  float lineWidthPixels = clamp(\n    project_size_to_pixel(lineWidthScale * instanceLineWidths, lineWidthUnits),\n    lineWidthMinPixels, lineWidthMaxPixels\n  );\n\n  // outer radius needs to offset by half stroke width\n  outerRadiusPixels += stroked * lineWidthPixels / 2.0;\n\n  // Expand geometry to accomodate edge smoothing\n  float edgePadding = antialiasing ? (outerRadiusPixels + SMOOTH_EDGE_RADIUS) / outerRadiusPixels : 1.0;\n\n  // position on the containing square in [-1, 1] space\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    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  }\n\n  DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n  // Apply opacity to instance color, or return instance picking color\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    gl_FragColor = vFillColor;\n  } else {\n    discard;\n  }\n\n  gl_FragColor.a *= inCircle;\n  DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[h.Z,f.Z]})}},{key:"initializeState",value:function(){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}})}},{key:"updateState",value:function(t){if((0,a.Z)((0,s.Z)(n.prototype),"updateState",this).call(this,t),t.changeFlags.extensionsChanged){var e,r=this.context.gl;null===(e=this.state.model)||void 0===e||e.delete(),this.state.model=this._getModel(r),this.getAttributeManager().invalidateAll()}}},{key:"draw",value:function(t){var e=t.uniforms,n=this.props,r=n.radiusUnits,i=n.radiusScale,o=n.radiusMinPixels,a=n.radiusMaxPixels,s=n.stroked,u=n.filled,l=n.billboard,c=n.antialiasing,h=n.lineWidthUnits,f=n.lineWidthScale,d=n.lineWidthMinPixels,A=n.lineWidthMaxPixels;this.state.model.setUniforms(e).setUniforms({stroked:s?1:0,filled:u,billboard:l,antialiasing:c,radiusUnits:p.iI[r],radiusScale:i,radiusMinPixels:o,radiusMaxPixels:a,lineWidthUnits:p.iI[h
2],lineWidthScale:f,lineWidthMinPixels:d,lineWidthMaxPixels:A}).draw()}},{key:"_getModel",value:function(t){return new A.Z(t,(0,r.Z)((0,r.Z)({},this.getShaders()),{},{id:this.props.id,geometry:new v.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}))}}]),n}(d.Z);(0,c.Z)(y,"defaultProps",m),(0,c.Z)(y,"layerName","ScatterplotLayer")},32643:function(t,e,n){"use strict";n.d(e,{Fv:function(){return A},Gd:function(){return f},k8:function(){return h},mD:function(){return v}});var r=n(11026),i=n(60726),o=n(25880),a=n.n(o),s=n(23595),u=s.wG.CLOCKWISE,l=s.wG.COUNTER_CLOCKWISE,c={isClosed:!0};function h(t){return"positions"in t?t.positions:t}function f(t){return"holeIndices"in t?t.holeIndices:null}function p(t,e,n,r,i){for(var o=e,a=n.length,u=0;u<a;u++)for(var l=0;l<r;l++)t[o++]=n[u][l]||0;if(!function(t){var e=t[0],n=t[t.length-1];return e[0]===n[0]&&e[1]===n[1]&&e[2]===n[2]}(n))for(var h=0;h<r;h++)t[o++]=n[0][h]||0;return c.start=e,c.end=o,c.size=r,(0,s.Ny)(t,i,c),o}function d(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=arguments.length>5?arguments[5]:void 0,a=arguments.length>6?arguments[6]:void 0,u=(o=o||n.length)-i;if(u<=0)return e;for(var l=e,h=0;h<u;h++)t[l++]=n[i+h];if(!function(t,e,n,r){for(var i=0;i<e;i++)if(t[n+i]!==t[r-e+i])return!1;return!0}(n,r,i,o))for(var f=0;f<r;f++)t[l++]=n[i+f];return c.start=e,c.end=l,c.size=r,(0,s.Ny)(t,a,c),l}function A(t,e){!function(t){if(t=t&&t.positions||t,!Array.isArray(t)&&!ArrayBuffer.isView(t))throw new Error("invalid polygon")}(t);var n=[],o=[];if("positions"in t){var a=t,s=a.positions,c=a.holeIndices;if(c){for(var h=0,f=0;f<=c.length;f++)h=d(n,h,s,e,c[f-1],c[f],0===f?u:l),o.push(h);return o.pop(),{positions:n,holeIndices:o}}t=s}if(!function(t){return Array.isArray(t[0])}(t))return d(n,0,t,e,0,n.length,u),n;if(!function(t){return t.length>=1&&t[0].length>=2&&Number.isFinite(t[0][0])}(t)){var A,v=0,g=(0,i.Z)(t.entries());try{for(g.s();!(A=g.n()).done;){var m=(0,r.Z)(A.value,2),y=m[0];v=p(n,v,m[1],e,0===y?u:l),o.push(v)}}catch(_){g.e(_)}finally{g.f()}return o.pop(),{positions:n,holeIndices:o}}return p(n,0,t,e,u),n}function v(t,e,n){var r=f(t);r&&(r=r.map((function(t){return t/e})));var i=h(t);if(n){var o=i.length;i=i.slice();for(var s=[],u=0;u<o;u+=e){s[0]=i[u],s[1]=i[u+1];var l=n(s);i[u]=l[0],i[u+1]=l[1]}}return a()(i,r,e)}},3453:function(t,e,n){"use strict";n.d(e,{Z:function(){return Z}});var r=n(50189),i=n(22951),o=n(91976),a=n(47169),s=n(83138),u=n(27597),l=n(67591),c=n(94337),h=n(64649),f=n(2123),p=n(54976),d=n(2578),A=n(18252),v=n(90031),g=n(12308),m=n(70353),y=n(94557),_=n(69296),b=n(60726),x=n(32643),w=n(55678),C=n(23595),B=function(t){(0,l.Z)(n,t);var e=(0,c.Z)(n);function n(t){(0,i.Z)(this,n);var o=t.fp64,a=t.IndexType,s=void 0===a?Uint32Array:a;return e.call(this,(0,r.Z)((0,r.Z)({},t),{},{attributes:{positions:{size:3,type:o?Float64Array:Float32Array},vertexValid:{type:Uint8ClampedArray,size:1},indices:{type:s,size:1}}}))}return(0,o.Z)(n,[{key:"get",value:function(t){var e=this.attributes;return"indices"===t?e.indices&&e.indices.subarray(0,this.vertexCount):e[t]}},{key:"updateGeometry",value:function(t){(0,s.Z)((0,u.Z)(n.prototype),"updateGeometry",this).call(this,t);var e=this.buffers.indices;if(e)this.vertexCount=(e.value||e).length;else if(this.data&&!this.getGeometry)throw new Error("missing indices buffer")}},{key:"normalizeGeometry",value:function(t){if(this.normalize){var e=x.Fv(t,this.positionSize);return this.opts.resolution?(0,C.WZ)(x.k8(e),x.Gd(e),{size:this.positionSize,gridResolution:this.opts.resolution,edgeTypes:!0}):this.opts.wrapLongitude?(0,C.GU)(x.k8(e),x.Gd(e),{size:this.positionSize,maxLatitude:86,edgeTypes:!0}):e}return t}},{key:"getGeometrySize",value:function(t){if(k(t)){var e,n=0,r=(0,b.Z)(t);try{for(r.s();!(e=r.n()).done;){var i=e.value;n+=this.getGeometrySize(i)}}catch(o){r.e(o)}finally{r.f()}return n}return x.k8(t).length/this.positionSize}},{key:"getGeometryFromBuffer",value:function(t){return this.normalize||!this.buffers.indices?(0,s.Z)((0,u.Z)(n.prototype),"getGeometryFromBuffer",this).call(this,t):null}},{key:"updateGeometryAttributes",value:function(t,e){if(t&&k(t)){var n,r=(0,b.Z)(t);try{for(r.s();!(n=r.n()).done;){var i=n.value,o=this.getGeometrySize(i);e.geometrySize=o,this.updateGeometryAttributes(i,e),e.vertexStart+=o,e.indexStart=this.indexStarts[e.geometryIndex+1]}}catch(a){r.e(a)}finally{r.f()}}else this._updateIndices(t,e),this._updatePositions(t,e),this._updateVertexValid(t,e)}},{key:"_updateIndices",value:function(t,e){var n=e.geometryIndex,r=e.vertexStart,i=e.indexStart,o=this.attributes,a=this.indexStarts,s=this.typedArrayManager,u=o.indices;if(u&&t){var l=i,c=x.mD(t,this.positionSize,this.opts.preproject);u=s.allocate(u,i+c.length,{copy:!0});for(var h=0;h<c.length;h++)u[l++]=c[h]+r;a[n+1]=i+c.length,o.indices=u}}},{key:"_updatePositions",value:function(t,e){var n=e.vertexStart,r=e.geometrySize,i=this.attributes.positions,o=this.positionSize;if(i&&t)for(var a=x.k8(t),s=n,u=0;u<r;s++,u++){var l=a[u*o],c=a[u*o+1],h=o>2?a[u*o+2]:0;i[3*s]=l,i[3*s+1]=c,i[3*s+2]=h}}},{key:"_updateVertexValid",value:function(t,e){var n=e.vertexStart,r=e.geometrySize,i=this.positionSize,o=this.attributes.vertexValid,a=t&&x.Gd(t);if(t&&t.edgeTypes?o.set(t.edgeTypes,n):o.fill(1,n,n+r),a)for(var s=0;s<a.length;s++)o[n+a[s]/i-1]=0;o[n+r-1]=0}}]),n}(w.Z);function k(t){return Array.isArray(t)&&t.length>0&&!Number.isFinite(t[0])}var E="\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    // normals generated by the polygon tesselator are in lnglat offsets instead of meters\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",S="#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(E,"\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"),T="#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(E,"\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}
2\n"),M=[0,0,0,255],I={filled:!0,extruded:!1,wireframe:!1,_normalize:!0,_windingOrder:"CW",elevationScale:{type:"number",min:0,value:1},getPolygon:{type:"accessor",value:function(t){return t.polygon}},getElevation:{type:"accessor",value:1e3},getFillColor:{type:"accessor",value:M},getLineColor:{type:"accessor",value:M},material:!0},P={enter:function(t,e){return e.length?e.subarray(e.length-t.length):t}},Z=function(t){(0,l.Z)(n,t);var e=(0,c.Z)(n);function n(){var t;(0,i.Z)(this,n);for(var r=arguments.length,o=new Array(r),s=0;s<r;s++)o[s]=arguments[s];return t=e.call.apply(e,[this].concat(o)),(0,h.Z)((0,a.Z)(t),"state",void 0),t}return(0,o.Z)(n,[{key:"getShaders",value:function(t){return(0,s.Z)((0,u.Z)(n.prototype),"getShaders",this).call(this,{vs:"top"===t?S:T,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:[f.Z,p.N,d.Z]})}},{key:"wrapLongitude",get:function(){return!1}},{key:"initializeState",value:function(){var t=this,e=this.context,n=e.gl,r=e.viewport,i=this.props.coordinateSystem;r.isGeospatial&&i===A.Df.DEFAULT&&(i=A.Df.LNGLAT),this.setState({numInstances:0,polygonTesselator:new B({preproject:i===A.Df.LNGLAT&&r.projectFlat.bind(r),fp64:this.use64bitPositions(),IndexType:!n||(0,g.ag)(n,m.h.ELEMENT_INDEX_UINT32)?Uint32Array:Uint16Array})});var o=this.getAttributeManager(),a=!0;o.remove(["instancePickingColors"]),o.add({indices:{size:1,isIndexed:!0,update:this.calculateIndices,noAlloc:a},positions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:P,accessor:"getPolygon",update:this.calculatePositions,noAlloc:a,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:a},elevations:{size:1,transition:P,accessor:"getElevation",shaderAttributes:{elevations:{divisor:0},instanceElevations:{divisor:1}}},fillColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:P,accessor:"getFillColor",defaultValue:M,shaderAttributes:{fillColors:{divisor:0},instanceFillColors:{divisor:1}}},lineColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:P,accessor:"getLineColor",defaultValue:M,shaderAttributes:{lineColors:{divisor:0},instanceLineColors:{divisor:1}}},pickingColors:{size:3,type:5121,accessor:function(e,n){var r=n.index,i=n.target;return t.encodePickingColor(e&&e.__source?e.__source.index:r,i)},shaderAttributes:{pickingColors:{divisor:0},instancePickingColors:{divisor:1}}}})}},{key:"getPickingInfo",value:function(t){var e=(0,s.Z)((0,u.Z)(n.prototype),"getPickingInfo",this).call(this,t),r=e.index,i=this.props.data;return i[0]&&i[0].__source&&(e.object=i.find((function(t){return t.__source.index===r}))),e}},{key:"disablePickingIndex",value:function(t){var e=this.props.data;if(e[0]&&e[0].__source)for(var n=0;n<e.length;n++)e[n].__source.index===t&&this._disablePickingIndex(n);else this._disablePickingIndex(t)}},{key:"draw",value:function(t){var e=t.uniforms,n=this.props,i=n.extruded,o=n.filled,a=n.wireframe,s=n.elevationScale,u=this.state,l=u.topModel,c=u.sideModel,h=u.polygonTesselator,f=(0,r.Z)((0,r.Z)({},e),{},{extruded:Boolean(i),elevationScale:s});c&&(c.setInstanceCount(h.instanceCount-1),c.setUniforms(f),a&&(c.setDrawMode(3),c.setUniforms({isWireframe:!0}).draw()),o&&(c.setDrawMode(6),c.setUniforms({isWireframe:!1}).draw())),l&&(l.setVertexCount(h.vertexCount),l.setUniforms(f).draw())}},{key:"updateState",value:function(t){(0,s.Z)((0,u.Z)(n.prototype),"updateState",this).call(this,t),this.updateGeometry(t);var e,r=t.props,i=t.oldProps,o=t.changeFlags,a=this.getAttributeManager();(o.extensionsChanged||r.filled!==i.filled||r.extruded!==i.extruded)&&(null===(e=this.state.models)||void 0===e||e.forEach((function(t){return t.delete()})),this.setState(this._getModels(this.context.gl)),a.invalidateAll())}},{key:"updateGeometry",value:function(t){var e=t.props,n=(t.oldProps,t.changeFlags);if(n.dataChanged||n.updateTriggersChanged&&(n.updateTriggersChanged.all||n.updateTriggersChanged.getPolygon)){var r=this.state.polygonTesselator,i=e.data.attributes||{};r.updateGeometry({data:e.data,normalize:e._normalize,geometryBuffer:i.getPolygon,buffers:i,getGeometry:e.getPolygon,positionFormat:e.positionFormat,wrapLongitude:e.wrapLongitude,resolution:this.context.viewport.resolution,fp64:this.use64bitPositions(),dataChanged:n.dataChanged}),this.setState({numInstances:r.instanceCount,startIndices:r.vertexStarts}),n.dataChanged||this.getAttributeManager().invalidateAll()}}},{key:"_getModels",value:function(t){var e,n,i=this.props,o=i.id,a=i.filled,s=i.extruded;if(a){var u=this.getShaders("top");u.defines.NON_INSTANCED_MODEL=1,e=new y.Z(t,(0,r.Z)((0,r.Z)({},u),{},{id:"".concat(o,"-top"),drawMode:4,attributes:{vertexPositions:new Float32Array([0,1])},uniforms:{isWireframe:!1,isSideVertex:!1},vertexCount:0,isIndexed:!0}))}return s&&((n=new y.Z(t,(0,r.Z)((0,r.Z)({}
2,this.getShaders("side")),{},{id:"".concat(o,"-side"),geometry:new _.Z({drawMode:1,vertexCount:4,attributes:{vertexPositions:{size:2,value:new Float32Array([1,0,0,0,0,1,1,1])}}}),instanceCount:0,isInstanced:1}))).userData.excludeAttributes={indices:!0}),{models:[n,e].filter(Boolean),topModel:e,sideModel:n}}},{key:"calculateIndices",value:function(t){var e=this.state.polygonTesselator;t.startIndices=e.indexStarts,t.value=e.get("indices")}},{key:"calculatePositions",value:function(t){var e=this.state.polygonTesselator;t.startIndices=e.vertexStarts,t.value=e.get("positions")}},{key:"calculateVertexValid",value:function(t){t.value=this.state.polygonTesselator.get("vertexValid")}}]),n}(v.Z);(0,h.Z)(Z,"defaultProps",I),(0,h.Z)(Z,"layerName","SolidPolygonLayer")},20377:function(t,e,n){"use strict";n.d(e,{Z:function(){return A}});var r=n(50189),i=n(22951),o=n(91976),a=n(47169),s=n(83138),u=n(27597),l=n(67591),c=n(94337),h=n(64649),f=n(21970),p=n(32296),d=[],A=function(t){(0,l.Z)(n,t);var e=(0,c.Z)(n);function n(){var t;(0,i.Z)(this,n);for(var r=arguments.length,o=new Array(r),s=0;s<r;s++)o[s]=arguments[s];return t=e.call.apply(e,[this].concat(o)),(0,h.Z)((0,a.Z)(t),"state",void 0),t}return(0,o.Z)(n,[{key:"getShaders",value:function(){return(0,r.Z)((0,r.Z)({},(0,s.Z)((0,u.Z)(n.prototype),"getShaders",this).call(this)),{},{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 buffer;\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\n    // if enable sdf (signed distance fields)\n    if (sdf) {\n      float distance = alpha;\n      alpha = smoothstep(buffer - gamma, buffer + 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\n    // Take the global opacity and the alpha from color into account for the alpha component\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"})}},{key:"initializeState",value:function(){var t=this;(0,s.Z)((0,u.Z)(n.prototype),"initializeState",this).call(this),this.getAttributeManager().addInstanced({instanceOffsets:{size:2,accessor:"getIconOffsets"},instancePickingColors:{type:5121,size:3,accessor:function(e,n){var r=n.index,i=n.target;return t.encodePickingColor(r,i)}}})}},{key:"updateState",value:function(t){(0,s.Z)((0,u.Z)(n.prototype),"updateState",this).call(this,t);var e=t.props,r=t.oldProps,i=e.outlineColor;i!==r.outlineColor&&((i=i.map((function(t){return t/255})))[3]=Number.isFinite(i[3])?i[3]:1,this.setState({outlineColor:i})),!e.sdf&&e.outlineWidth&&f.Z.warn("".concat(this.id,": fontSettings.sdf is required to render outline"))()}},{key:"draw",value:function(t){var e=this.props,i=e.sdf,o=e.smoothing,a=e.outlineWidth,l=this.state.outlineColor;t.uniforms=(0,r.Z)((0,r.Z)({},t.uniforms),{},{buffer:.75,outlineBuffer:a?Math.max(o,.75*(1-a)):-1,gamma:o,sdf:Boolean(i),outlineColor:l}),(0,s.Z)((0,u.Z)(n.prototype),"draw",this).call(this,t)}},{key:"getInstanceOffset",value:function(t){var e=this;return t?Array.from(t).flatMap((function(t){return(0,s.Z)((0,u.Z)(n.prototype),"getInstanceOffset",e).call(e,t)})):d}},{key:"getInstanceColorMode",value:function(t){return 1}},{key:"getInstanceIconFrame",value:function(t){var e=this;return t?Array.from(t).flatMap((function(t){return(0,s.Z)((0,u.Z)(n.prototype),"getInstanceIconFrame",e).call(e,t)})):d}}]),n}(p.Z);(0,h.Z)(A,"defaultProps",{getIconOffsets:{type:"accessor",value:function(t){return t.offsets}},alphaCutoff:.001,smoothing:.1,outlineWidth:0,outlineColor:{type:"color",value:[0,0,0,255]}}),(0,h.Z)(A,"layerName","MultiIconLayer")},56394:function(t,e,n){"use strict";n.d(e,{Z:function(){return y}});var r=n(50189),i=n(22951),o=n(91976),a=n(47169),s=n(83138),u=n(27597),l=n(67591),c=n(94337),h=n(64649),f=n(2123),p=n(2578),d=n(18252),A=n(90031),v=n(94557),g=n(69296),m={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPi
2xels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,padding:{type:"array",value:[0,0,0,0]},getPosition:{type:"accessor",value:function(t){return 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}},y=function(t){(0,l.Z)(n,t);var e=(0,c.Z)(n);function n(){var t;(0,i.Z)(this,n);for(var r=arguments.length,o=new Array(r),s=0;s<r;s++)o[s]=arguments[s];return t=e.call.apply(e,[this].concat(o)),(0,h.Z)((0,a.Z)(t),"state",void 0),t}return(0,o.Z)(n,[{key:"getShaders",value:function(){return(0,s.Z)((0,u.Z)(n.prototype),"getShaders",this).call(this,{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;
2\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\n  // convert size in meters to pixels, then scaled and clamp\n\n  // project meters to pixels and clamp to limits\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    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  }\n  DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n  // Apply opacity to instance color, or return instance picking color\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:[f.Z,p.Z]})}},{key:"initializeState",value:function(){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}})}},{key:"updateState",value:function(t){if((0,s.Z)((0,u.Z)(n.prototype),"updateState",this).call(this,t),t.changeFlags.extensionsChanged){var e,r=this.context.gl;null===(e=this.state.model)||void 0===e||e.delete(),this.state.model=this._getModel(r),this.getAttributeManager().invalidateAll()}}},{key:"draw",value:function(t){var e=t.uniforms,n=this.props,r=n.billboard,i=n.sizeScale,o=n.sizeUnits,a=n.sizeMinPi
2xels,s=n.sizeMaxPixels,u=n.getLineWidth,l=this.props.padding;l.length<4&&(l=[l[0],l[1],l[0],l[1]]),this.state.model.setUniforms(e).setUniforms({billboard:r,stroked:Boolean(u),padding:l,sizeUnits:d.iI[o],sizeScale:i,sizeMinPixels:a,sizeMaxPixels:s}).draw()}},{key:"_getModel",value:function(t){return new v.Z(t,(0,r.Z)((0,r.Z)({},this.getShaders()),{},{id:this.props.id,geometry:new g.Z({drawMode:6,vertexCount:4,attributes:{positions:{size:2,value:new Float32Array([0,0,1,0,1,1,0,1])}}}),isInstanced:!0}))}}]),n}(A.Z);(0,h.Z)(y,"defaultProps",m),(0,h.Z)(y,"layerName","TextBackgroundLayer")},8086:function(t,e,n){"use strict";n.d(e,{Z:function(){return O}});var r=n(60726),i=n(50189),o=n(11026),a=n(22951),s=n(91976),u=n(47169),l=n(67591),c=n(94337),h=n(64649),f=n(73115),p=n(79366),d=n(20377),A=n(30116),v=n.n(A),g=n(21970),m=32,y=[];function _(t,e,n,r){for(var i=0,o=e;o<n;o++){var a;i+=(null===(a=r[t[o]])||void 0===a?void 0:a.width)||0}return i}function b(t,e,n,r,i,o){for(var a=e,s=0,u=e;u<n;u++){var l=_(t,u,u+1,i);s+l>r&&(a<u&&o.push(u),a=u,s=0),s+=l}return s}function x(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=arguments.length>5?arguments[5]:void 0;void 0===o&&(o=t.length);var a=[];return"break-all"===e?b(t,i,o,n,r,a):function(t,e,n,r,i,o){for(var a=e,s=e,u=e,l=0,c=e;c<n;c++)if(" "===t[c]?u=c+1:" "!==t[c+1]&&c+1!==n||(u=c+1),u>s){var h=_(t,s,u,i);l+h>r&&(a<s&&(o.push(s),a=s,l=0),h>r&&(h=b(t,s,u,r,i,o),a=o[o.length-1])),s=u,l+=h}}(t,i,o,n,r,a),a}function w(t,e,n,r,i,o){for(var a=0,s=0,u=e;u<n;u++){var l=t[u],c=r[l];c?(s||(s=c.height),i[u]=a+c.width/2,a+=c.width):(g.Z.warn("Missing character: ".concat(l," (").concat(l.codePointAt(0),")"))(),i[u]=a,a+=m)}o[0]=a,o[1]=s}function C(t,e,n,r,i){for(var o=Array.from(t),a=o.length,s=new Array(a),u=new Array(a),l=new Array(a),c=("break-word"===n||"break-all"===n)&&isFinite(r)&&r>0,h=[0,0],f=[0,0],p=0,d=0,A=0,v=0;v<=a;v++){var g=o[v];if("\n"!==g&&v!==a||(A=v),A>d){for(var m=c?x(o,n,r,i,d,A):y,_=0;_<=m.length;_++){var b=0===_?d:m[_-1],C=_<m.length?m[_]:A;w(o,b,C,i,s,f);for(var B=b;B<C;B++)u[B]=p+f[1]/2,l[B]=f[0];p+=f[1]*e,h[0]=Math.max(h[0],f[0])}d=A}"\n"===g&&(s[d]=0,u[d]=0,l[d]=0,d++)}return h[1]=p,{x:s,y:u,rowWidth:l,size:h}}var B=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5;(0,a.Z)(this,t),(0,h.Z)(this,"limit",void 0),(0,h.Z)(this,"_cache",{}),(0,h.Z)(this,"_order",[]),this.limit=e}return(0,s.Z)(t,[{key:"get",value:function(t){var e=this._cache[t];return e&&(this._deleteOrder(t),this._appendOrder(t)),e}},{key:"set",value:function(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))}},{key:"delete",value:function(t){this._cache[t]&&(delete this._cache[t],this._deleteOrder(t))}},{key:"_deleteOrder",value:function(t){var e=this._order.indexOf(t);e>=0&&this._order.splice(e,1)}},{key:"_appendOrder",value:function(t){this._order.push(t)}}]),t}();var k={fontFamily:"Monaco, monospace",fontWeight:"normal",characterSet:function(){for(var t=[],e=32;e<128;e++)t.push(String.fromCharCode(e));return t}(),fontSize:64,buffer:4,sdf:!1,cutoff:.25,radius:12,smoothing:.1},E=new B(3);function S(t,e){for(var n=0;n<t.length;n++)e.data[4*n+3]=t[n]}function T(t,e,n,r){t.font="".concat(r," ").concat(n,"px ").concat(e),t.fillStyle="#000",t.textBaseline="alphabetic",t.textAlign="left"}var M=function(){function t(){(0,a.Z)(this,t),(0,h.Z)(this,"props",(0,i.Z)({},k)),(0,h.Z)(this,"_key",void 0),(0,h.Z)(this,"_atlas",void 0)}return(0,s.Z)(t,[{key:"texture",get:function(){return this._atlas}},{key:"mapping",get:function(){return this._atlas&&this._atlas.mapping}},{key:"scale",get:function(){return 1.2}},{key:"setProps",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.assign(this.props,t);var e=this._key;this._key=this._getKey();var n=function(t,e){var n;n="string"===typeof e?new Set(Array.from(e)):new Set(e);var r=E.get(t);if(!r)return n;for(var i in r.mapping)n.has(i)&&n.delete(i);return n}(this._key,this.props.characterSet),r=E.get(this._key);if(r&&0===n.size)this._key!==e&&(this._atlas=r);else{var i=this._generateFontAtlas(this._key,n,r);this._atlas=i,E.set(this._key,i)}}},{key:"_generateFontAtlas",value:function(t,e,n){var o=this.props,a=o.fontFamily,s=o.fontWeight,u=o.fontSize,l=o.buffer,c=o.sdf,h=o.radius,f=o.cutoff,p=n&&n.data;p||((p=document.createElement("canvas")).width=1024);var d=p.getContext("2d");T(d,a,u,s);var A=function(t){var e,n=t.characterSet,i=t.getFontWidth,o=t.fontHeight,a=t.buffer,s=t.maxCanvasWidth,u=t.mapping,l=void 0===u?{}:u,c=t.xOffset,h=void 0===c?0:c,f=t.yOffset,p=void 0===f?0:f,d=0,A=h,v=(0,r.Z)(n);try{for(v.s();!(e=v.n()).done;){var g=e.value;if(!l[g]){var m=i(g);A+m+2*a>s&&(A=0,d++),l[g]={x:A+a,y:p+d*(o+2*a)+a,width:m,height:o},A+=m+2*a}}}catch(b){v.e(b)}finally{v.f()}var y,_=o+2*a;return{mapping:l,xOffset:A,yOffset:p+d*_,canvasHeight:(y=p+(d+1)*_,Math.pow(2,Math.ceil(Math.log2(y))))}}((0,i.Z)({getFontWidth:function(t){return d.measureText(t).width},fontHeight:1.2*u,buffer:l,characterSet:e,maxCanvasWidth:1024},n&&{mapping:n.mapping,xOffset:n.xOffset,yOffset:n.yOffset})),g=A.mapping,m=A.canvasHeight,y=A.xOffset,_=A.yOffset;if(p.height!==m){var b=d.getImageData(0,0,p.width,p.height);p.height=m,d.putImageData(b,0,0)}if(T(d,a,u,s),c){var x,w=new(v())(u,l,h,f,a,s),C=d.getImageData(0,0,w.size,w.size),B=(0,r.Z)(e);try{for(B.s();!(x=B.n()).done;){var k=x.value;S(w.draw(k),C),d.putImageData(C,g[k].x-l,g[k].y+l)}}catch(P){B.e(P)}finally{B.f()}}else{var E,M=(0,r.Z)(e);try{for(M.s();!(E=M.n()).done;){var I=E.value;d.fillText(I,g[I].x,g[I].y+.9*u)}}catch(P){M.e(P)}finally{M.f()}}return{xOffset:y,yOffset:_,mapping:g,data:p,width:p.width,height:p.height}}},{key:"_getKey",value:function(){var t=this.props,e=t.fontFamily,n=t.fontWeight,r=t.fontSize,i=t.buffer,o=t.s
2df,a=t.radius,s=t.cutoff;return o?"".concat(e," ").concat(n," ").concat(r," ").concat(i," ").concat(a," ").concat(s):"".concat(e," ").concat(n," ").concat(r," ").concat(i)}}]),t}(),I=n(56394),P={start:1,middle:0,end:-1},Z={top:1,center:0,bottom:-1},D=[0,0,0,255],L={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:D},getBorderWidth:{type:"accessor",value:0},backgroundPadding:{type:"array",value:[0,0,0,0]},characterSet:{type:"object",value:k.characterSet},fontFamily:k.fontFamily,fontWeight:k.fontWeight,lineHeight:1,outlineWidth:{type:"number",value:0,min:0},outlineColor:{type:"color",value:D},fontSettings:{},wordBreak:"break-word",maxWidth:{type:"number",value:-1},getText:{type:"accessor",value:function(t){return t.text}},getPosition:{type:"accessor",value:function(t){return t.position}},getColor:{type:"accessor",value:D},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"]}},O=function(t){(0,l.Z)(n,t);var e=(0,c.Z)(n);function n(){var t;(0,a.Z)(this,n);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return t=e.call.apply(e,[this].concat(i)),(0,h.Z)((0,u.Z)(t),"state",void 0),(0,h.Z)((0,u.Z)(t),"getBoundingRect",(function(e,n){var r=t.state.fontAtlasManager.mapping,i=t.state.getText,a=t.props,s=a.wordBreak,u=a.maxWidth,l=a.lineHeight,c=a.getTextAnchor,h=a.getAlignmentBaseline,f=C(i(e,n)||"",l,s,u,r),p=(0,o.Z)(f.size,2),d=p[0],A=p[1];return[(P["function"===typeof c?c(e,n):c]-1)*d/2,(Z["function"===typeof h?h(e,n):h]-1)*A/2,d,A]})),(0,h.Z)((0,u.Z)(t),"getIconOffsets",(function(e,n){for(var r=t.state.fontAtlasManager.mapping,i=t.state.getText,a=t.props,s=a.wordBreak,u=a.maxWidth,l=a.lineHeight,c=a.getTextAnchor,h=a.getAlignmentBaseline,f=C(i(e,n)||"",l,s,u,r),p=f.x,d=f.y,A=f.rowWidth,v=(0,o.Z)(f.size,2),g=v[0],m=v[1],y=P["function"===typeof c?c(e,n):c],_=Z["function"===typeof h?h(e,n):h],b=p.length,x=new Array(2*b),w=0,B=0;B<b;B++){var k=(1-y)*(g-A[B])/2;x[w++]=(y-1)*g/2+k+p[B],x[w++]=(_-1)*m/2+d[B]}return x})),t}return(0,s.Z)(n,[{key:"initializeState",value:function(){this.state={styleVersion:0,fontAtlasManager:new M}}},{key:"updateState",value:function(t){var e=t.props,n=t.oldProps,r=t.changeFlags;(r.dataChanged||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.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})}},{key:"getPickingInfo",value:function(t){var e=t.info;return e.object=e.index>=0?this.props.data[e.index]:null,e}},{key:"_updateFontAtlas",value:function(){var t=this.props,e=t.fontSettings,n=t.fontFamily,r=t.fontWeight,o=this.state,a=o.fontAtlasManager,s=o.characterSet,u=(0,i.Z)((0,i.Z)({},e),{},{characterSet:s,fontFamily:n,fontWeight:r});if(!a.mapping)return a.setProps(u),!0;for(var l in u)if(u[l]!==a.props[l])return a.setProps(u),!0;return!1}},{key:"_updateText",value:function(){var t,e,n=this.props,o=n.data,a=n.characterSet,s=null===(t=o.attributes)||void 0===t?void 0:t.getText,u=this.props.getText,l=o.startIndices,c="auto"===a&&new Set;if(s&&l){var h=function(t){var e=t.value,n=t.length,i=t.stride,o=t.offset,a=t.startIndices,s=t.characterSet,u=e.BYTES_PER_ELEMENT,l=i?i/u:1,c=o?o/u:0,h=a[n]||Math.ceil((e.length-c)/l),f=s&&new Set,p=new Array(n),d=e;if(l>1||c>0){d=new(0,e.constructor)(h);for(var A=0;A<h;A++)d[A]=e[A*l+c]}for(var v=0;v<n;v++){var g=a[v],m=a[v+1]||h,y=d.subarray(g,m);p[v]=String.fromCodePoint.apply(null,y),f&&y.forEach(f.add,f)}if(f){var _,b=(0,r.Z)(f);try{for(b.s();!(_=b.n()).done;){var x=_.value;s.add(String.fromCodePoint(x))}}catch(w){b.e(w)}finally{b.f()}}return{texts:p,characterCount:h}}((0,i.Z)((0,i.Z)({},ArrayBuffer.isView(s)?{value:s}:s),{},{length:o.length,startIndices:l,characterSet:c})),p=h.texts;e=h.characterCount,u=function(t,e){var n=e.index;return p[n]}}else{var d=(0,f.jB)(o),A=d.iterable,v=d.objectInfo;l=[0],e=0;var g,m=(0,r.Z)(A);try{for(m.s();!(g=m.n()).done;){var y=g.value;v.index++;var _=Array.from(u(y,v)||"");c&&_.forEach(c.add,c),e+=_.length,l.push(e)}}
2catch(b){m.e(b)}finally{m.f()}}this.setState({getText:u,startIndices:l,numInstances:e,characterSet:c||a})}},{key:"renderLayers",value:function(){var t=this.state,e=t.startIndices,n=t.numInstances,r=t.getText,i=t.fontAtlasManager,o=i.scale,a=i.texture,s=i.mapping,u=t.styleVersion,l=this.props,c=l.data,h=l._dataDiff,f=l.getPosition,p=l.getColor,A=l.getSize,v=l.getAngle,g=l.getPixelOffset,m=l.getBackgroundColor,y=l.getBorderColor,_=l.getBorderWidth,b=l.backgroundPadding,x=l.background,w=l.billboard,C=l.fontSettings,B=l.outlineWidth,E=l.outlineColor,S=l.sizeScale,T=l.sizeUnits,M=l.sizeMinPixels,P=l.sizeMaxPixels,Z=l.transitions,D=l.updateTriggers,L=this.getSubLayerClass("characters",d.Z),O=this.getSubLayerClass("background",I.Z);return[x&&new O({getFillColor:m,getLineColor:y,getLineWidth:_,padding:b,getPosition:f,getSize:A,getAngle:v,getPixelOffset:g,billboard:w,sizeScale:S/this.state.fontAtlasManager.props.fontSize,sizeUnits:T,sizeMinPixels:M,sizeMaxPixels:P,transitions:Z&&{getPosition:Z.getPosition,getAngle:Z.getAngle,getSize:Z.getSize,getFillColor:Z.getBackgroundColor,getLineColor:Z.getBorderColor,getLineWidth:Z.getBorderWidth,getPixelOffset:Z.getPixelOffset}},this.getSubLayerProps({id:"background",updateTriggers:{getPosition:D.getPosition,getAngle:D.getAngle,getSize:D.getSize,getFillColor:D.getBackgroundColor,getLineColor:D.getBorderColor,getLineWidth:D.getBorderWidth,getPixelOffset:D.getPixelOffset,getBoundingRect:{getText:D.getText,getTextAnchor:D.getTextAnchor,getAlignmentBaseline:D.getAlignmentBaseline,styleVersion:u}}}),{data:c.attributes&&c.attributes.background?{length:c.length,attributes:c.attributes.background}:c,_dataDiff:h,autoHighlight:!1,getBoundingRect:this.getBoundingRect}),new L({sdf:C.sdf,smoothing:Number.isFinite(C.smoothing)?C.smoothing:k.smoothing,outlineWidth:B,outlineColor:E,iconAtlas:a,iconMapping:s,getPosition:f,getColor:p,getSize:A,getAngle:v,getPixelOffset:g,billboard:w,sizeScale:S*o,sizeUnits:T,sizeMinPixels:M*o,sizeMaxPixels:P*o,transitions:Z&&{getPosition:Z.getPosition,getAngle:Z.getAngle,getColor:Z.getColor,getSize:Z.getSize,getPixelOffset:Z.getPixelOffset}},this.getSubLayerProps({id:"characters",updateTriggers:{getIcon:D.getText,getPosition:D.getPosition,getAngle:D.getAngle,getColor:D.getColor,getSize:D.getSize,getPixelOffset:D.getPixelOffset,getIconOffsets:{getText:D.getText,getTextAnchor:D.getTextAnchor,getAlignmentBaseline:D.getAlignmentBaseline,styleVersion:u}}}),{data:c,_dataDiff:h,startIndices:e,numInstances:n,getIconOffsets:this.getIconOffsets,getIcon:r})]}}],[{key:"fontAtlasCacheLimit",set:function(t){!function(t){g.Z.assert(Number.isFinite(t)&&t>=3,"Invalid cache limit"),E=new B(t)}(t)}}]),n}(p.Z);(0,h.Z)(O,"defaultProps",L),(0,h.Z)(O,"layerName","TextLayer")},66535:function(t,e,n){"use strict";function r(t){for(var e=t.data,n=t.getIndex,r=t.dataRange,i=t.replace,o=r.startRow,a=void 0===o?0:o,s=r.endRow,u=void 0===s?1/0:s,l=e.length,c=l,h=l,f=0;f<l;f++){var p=n(e[f]);if(c>f&&p>=a&&(c=f),p>=u){h=f;break}}for(var d=c,A=h-c!==i.length?e.slice(h):void 0,v=0;v<i.length;v++)e[d++]=i[v];if(A){for(var g=0;g<A.length;g++)e[d++]=A[g];e.length=d}return{startRow:c,endRow:c+i.length}}n.d(e,{b:function(){return r}})},47203:function(t,e,n){"use strict";n.r(e),n.d(e,{ScenegraphLayer:function(){return i.Z},SimpleMeshLayer:function(){return r.Z}});var r=n(36800),i=n(57309)},57309:function(t,e,n){"use strict";n.d(e,{Z:function(){return $}});var r=n(50189),i=n(22951),o=n(91976),a=n(47169),s=n(83138),u=n(27597),l=n(67591),c=n(94337),h=n(64649),f=n(2123),p=n(2578),d=n(21970),A=n(90031),v=n(28007),g=n(78032),m=n(431),y=n(12987),_=n(79666),b=n(81301),x=function(){function t(){(0,i.Z)(this,t);var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.id;this.id=n||(0,_.hQ)(this.constructor.name),this.display=!0,this.position=new m.Z,this.rotation=new m.Z,this.scale=new m.Z(1,1,1),this.matrix=new y.Z,this.userData={},this.props={},this._setScenegraphNodeProps(e)}return(0,o.Z)(t,[{key:"delete",value:function(){}},{key:"setProps",value:function(t){return this._setScenegraphNodeProps(t),this}},{key:"toString",value:function(){return"{type: ScenegraphNode, id: ".concat(this.id,")}")}},{key:"setPosition",value:function(t){return(0,b.h)(3===t.length,"setPosition requires vector argument"),this.position=t,this}},{key:"setRotation",value:function(t){return(0,b.h)(3===t.length,"setRotation requires vector argument"),this.rotation=t,this}},{key:"setScale",value:function(t){return(0,b.h)(3===t.length,"setScale requires vector argument"),this.scale=t,this}},{key:"setMatrix",value:function(t){!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?this.matrix.copy(t):this.matrix=t}},{key:"setMatrixComponents",value:function(t){var e=t.position,n=t.rotation,r=t.scale,i=t.update,o=void 0===i||i;return e&&this.setPosition(e),n&&this.setRotation(n),r&&this.setScale(r),o&&this.updateMatrix(),this}},{key:"updateMatrix",value:function(){var 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}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.position,n=t.rotation,r=t.scale;return e&&this.setPosition(e),n&&this.setRotation(n),r&&this.setScale(r),this.updateMatrix(),this}},{key:"getCoordinateUniforms",value:function(t,e){(0,b.h)(t),e=e||this.matrix;var n=new y.Z(t).multiplyRight(e),r=n.invert(),i=r.transpose();return{viewMatrix:t,modelMatrix:e,objectMatrix:e,worldMatrix:n,worldInverseMatrix:r,worldInverseTransposeMatrix:i}}},{key:"_setScenegraphNodeProps",value:function(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)}}]),t}(),w=n(33839),C=n(77462),B=n(60726),k=n(649),E=function(t){(0,l.Z)(n,t);var e=(0,c.Z)(n);function n(){var t;(0,i.Z)(this,n);var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=(r=Array.isArray(r)?{children:r}:r).children,a=void 0===o?[]:o;return v.cM.assert(a.every((function(t){return t instanceof x})),"every child must an instance of ScenegraphNode"),(t=e.call(this,r)).children=a,t}return(0,o.Z)(n,[{key:"add",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0,i=e;r<i.length;r++){var o=i[r];Array.isArray(o)?this.add.apply(this,(0,k.Z)(o)):this.children.push(o)}return this}},{key:"remove",value:function(t){var e=this.children,n=e.indexOf(t);return n>-1&&e.splice(n,1),this}},{key:"removeAll",value:function(){return this.children=[],this}}
2,{key:"delete",value:function(){this.children.forEach((function(t){return t.delete()})),this.removeAll(),(0,s.Z)((0,u.Z)(n.prototype),"delete",this).call(this)}},{key:"traverse",value:function(t){var e,r=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).worldMatrix,i=void 0===r?new y.Z:r,o=new y.Z(i).multiplyRight(this.matrix),a=(0,B.Z)(this.children);try{for(a.s();!(e=a.n()).done;){var s=e.value;s instanceof n?s.traverse(t,{worldMatrix:o}):t(s,{worldMatrix:o})}}catch(u){a.e(u)}finally{a.f()}}}]),n}(x),S=n(34980),T={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},M={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function I(t){if(!t._animation){var e=M[t.componentType],n=T[t.type],r=n*t.count,i=t.bufferView.data,o=new e(i.buffer,i.byteOffset+(t.byteOffset||0),r);if(1===n)t._animation=Array.from(o);else{for(var a=[],s=0;s<o.length;s+=n)a.push(Array.from(o.slice(s,s+n)));t._animation=a}}return t._animation}var P=new y.Z;var Z=new S.Z;function D(t,e,n,r){var i=e.input,o=e.interpolation,a=e.output,s=t%i[i.length-1],u=i.findIndex((function(t){return t>=s})),l=Math.max(0,u-1);if(!Array.isArray(n[r]))switch(r){case"translation":n[r]=[0,0,0];break;case"rotation":n[r]=[0,0,0,1];break;case"scale":n[r]=[1,1,1];break;default:v.cM.warn("Bad animation path ".concat(r))()}(0,b.h)(n[r].length===a[l].length);var c=i[l],h=i[u];switch(o){case"STEP":!function(t,e,n){for(var r=0;r<n.length;r++)t[e][r]=n[r]}(n,r,a[l]);break;case"LINEAR":if(h>c){var f=(s-c)/(h-c);!function(t,e,n,r,i){if("rotation"===e){Z.slerp({start:n,target:r,ratio:i});for(var o=0;o<Z.length;o++)t[e][o]=Z[o]}else for(var a=0;a<n.length;a++)t[e][a]=i*r[a]+(1-i)*n[a]}(n,r,a[l],a[u],f)}break;case"CUBICSPLINE":if(h>c){var p=(s-c)/(h-c),d=h-c;!function(t,e,n){for(var r=n.p0,i=n.outTangent0,o=n.inTangent1,a=n.p1,s=n.tDiff,u=n.ratio,l=0;l<t[e].length;l++){var c=i[l]*s,h=o[l]*s;t[e][l]=(2*Math.pow(u,3)-3*Math.pow(u,2)+1)*r[l]+(Math.pow(u,3)-2*Math.pow(u,2)+u)*c+(-2*Math.pow(u,3)+3*Math.pow(u,2))*a[l]+(Math.pow(u,3)-Math.pow(u,2))*h}}(n,r,{p0:a[3*l+1],outTangent0:a[3*l+2],inTangent1:a[3*u+0],p1:a[3*u+1],tDiff:d,ratio:p})}break;default:v.cM.warn("Interpolation ".concat(o," not supported"))()}}var L=function(){function t(e){(0,i.Z)(this,t),this.startTime=0,this.playing=!0,this.speed=1,this.channels=[],Object.assign(this,e)}return(0,o.Z)(t,[{key:"animate",value:function(t){if(this.playing){var e=(t/1e3-this.startTime)*this.speed;this.channels.forEach((function(t){var n=t.sampler,r=t.target,i=t.path;D(e,n,r,i),function(t,e){if(e.matrix.identity(),t.translation&&e.matrix.translate(t.translation),t.rotation){var n=P.fromQuaternion(t.rotation);e.matrix.multiplyRight(n)}t.scale&&e.matrix.scale(t.scale)}(r,r._node)}))}}}]),t}(),O=function(){function t(e){(0,i.Z)(this,t),this.animations=e.animations.map((function(t,n){var r=t.name||"Animation-".concat(n),i=t.samplers.map((function(t){var n=t.input,r=t.interpolation,i=void 0===r?"LINEAR":r,o=t.output;return{input:I(e.accessors[n]),interpolation:i,output:I(e.accessors[o])}})),o=t.channels.map((function(t){var n=t.sampler,r=t.target;return{sampler:i[n],target:e.nodes[r.node],path:r.path}}));return new L({name:r,channels:o})}))}return(0,o.Z)(t,[{key:"animate",value:function(t){this.setTime(t)}},{key:"setTime",value:function(t){this.animations.forEach((function(e){return e.animate(t)}))}},{key:"getAnimations",value:function(){return this.animations}}]),t}(),F=n(94557),R=function(t){(0,l.Z)(n,t);var e=(0,c.Z)(n);function n(t){var r;(0,i.Z)(this,n);var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(r=e.call(this,o)).onBeforeRender=null,r.AfterRender=null,t instanceof F.Z?(r.model=t,r._setModelNodeProps(o)):r.model=new F.Z(t,o),r.managedResources=o.managedResources||[],r}return(0,o.Z)(n,[{key:"setProps",value:function(t){return(0,s.Z)((0,u.Z)(n.prototype),"setProps",this).call(this,t),this._setModelNodeProps(t),this}},{key:"delete",value:function(){this.model&&(this.model.delete(),this.model=null),this.managedResources.forEach((function(t){return t.delete()})),this.managedResources=[]}},{key:"draw",value:function(){var t;return(t=this.model).draw.apply(t,arguments)}},{key:"setUniforms",value:function(){var t;return(t=this.model).setUniforms.apply(t,arguments),this}},{key:"setAttributes",value:function(){var t;return(t=this.model).setAttributes.apply(t,arguments),this}},{key:"updateModuleSettings",value:function(){var t;return(t=this.model).updateModuleSettings.apply(t,arguments),this}},{key:"_setModelNodeProps",value:function(t){this.model.setProps(t)}}]),n}(x),z=n(92086);function U(t,e){return(0,v.D0)(t)?"#version 300 es\n".concat(e):e}var N={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},G={modelOptions:{},pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1},j=function(){function t(e){(0,i.Z)(this,t);var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.gl=e,this.options=Object.assign({},G,n)}return(0,o.Z)(t,[{key:"instantiate",value:function(t){var e=this;return this.gltf=t,(t.scenes||[]).map((function(t){return e.createScene(t)}))}},{key:"createAnimator",value:function(){return Array.isArray(this.gltf.animations)?new O(this.gltf):null}},{key:"createScene",value:function(t){var e=this,n=(t.nodes||[]).map((function(t){return e.createNode(t)}));return new E({id:t.name||t.id,children:n})}},{key:"createNode",value:function(t){var e=this;if(!t._node){var n=(t.children||[]).map((function(t){return e.createNode(t)}));t.mesh&&n.push(this.createMesh(t.mesh));var r=new E({id:t.name||t.id,children:n});
2if(t.matrix)r.setMatrix(t.matrix);else{if(r.matrix.identity(),t.translation&&r.matrix.translate(t.translation),t.rotation){var i=(new y.Z).fromQuaternion(t.rotation);r.matrix.multiplyRight(i)}t.scale&&r.matrix.scale(t.scale)}t._node=r}return t._node}},{key:"createMesh",value:function(t){var e=this;if(!t._mesh){var n=(t.primitives||[]).map((function(n,r){return e.createPrimitive(n,r,t)})),r=new E({id:t.name||t.id,children:n});t._mesh=r}return t._mesh}},{key:"getVertexCount",value:function(t){v.cM.warn("getVertexCount() not found")()}},{key:"createPrimitive",value:function(t,e,n){return function(t,e){var n=e.id,r=e.drawMode,i=e.vertexCount,o=e.attributes,a=e.modelOptions,s=new z.Z(t,e);v.cM.info(4,"createGLTFModel defines: ",s.defines)();var u=[];u.push.apply(u,(0,k.Z)(s.generatedTextures)),u.push.apply(u,(0,k.Z)(Object.values(o).map((function(t){return t.buffer}))));var l=new R(t,Object.assign({id:n,drawMode:r,vertexCount:i,modules:[g.b],defines:s.defines,parameters:s.parameters,vs:U(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:U(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:u},a));return l.setProps({attributes:o}),l.setUniforms(s.uniforms),l}(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))}},{key:"createAttributes",value:function(t,e){var n=this,r={};return Object.keys(t).forEach((function(e){r[e]=n.createAccessor(t[e],n.createBuffer(t[e],n.gl.ARRAY_BUFFER))})),e&&(r.indices=this.createAccessor(e,this.createBuffer(e,this.gl.ELEMENT_ARRAY_BUFFER))),v.cM.info(4,"glTF Attributes",{attributes:t,indices:e,generated:r})(),r}},{key:"createBuffer",value:function(t,e){t.bufferView||(t.bufferView={});var n=t.bufferView;return n.lumaBuffers||(n.lumaBuffers={}),n.lumaBuffers[e]||(n.lumaBuffers[e]=new w.Z(this.gl,{id:"from-".concat(n.id),data:n.data||t.value,target:e})),n.lumaBuffers[e]}},{key:"createAccessor",value:function(t,e){return new C.Z({buffer:e,offset:t.byteOffset||0,stride:t.bufferView.byteStride||0,type:t.componentType,size:N[t.type]})}},{key:"createSampler",value:function(t){return t}},{key:"needsPOT",value:function(){return!1}}]),t}();var V=n(82595),H=n(11092),J=n(27791);function W(){return W=(0,J.Z)((0,H.Z)().mark((function t(e){var n;return(0,H.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=[],e.scenes.forEach((function(t){t.traverse((function(t){Object.values(t.model.getUniforms()).forEach((function(t){!1===t.loaded&&n.push(t)}))}))})),t.next=4,Q((function(){return n.some((function(t){return!t.loaded}))}));case 4:return t.abrupt("return",t.sent);case 5:case"end":return t.stop()}}),t)}))),W.apply(this,arguments)}function Q(t){return q.apply(this,arguments)}function q(){return(q=(0,J.Z)((0,H.Z)().mark((function t(e){return(0,H.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e()){t.next=5;break}return t.next=3,new Promise((function(t){return requestAnimationFrame(t)}));case 3:t.next=0;break;case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var K=n(7614),X=[255,255,255,255],Y={scenegraph:{type:"object",value:null,async:!0},getScene:function(t){return t&&t.scenes?"object"===typeof t.scene?t.scene:t.scenes[t.scene||0]:t},getAnimator:function(t){return t&&t.animator},_animations:null,sizeScale:{type:"number",value:1,min:0}
2,sizeMinPixels:{type:"number",min:0,value:0},sizeMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},getPosition:{type:"accessor",value:function(t){return t.position}},getColor:{type:"accessor",value:X},_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:[V.E]},$=function(t){(0,l.Z)(n,t);var e=(0,c.Z)(n);function n(){var t;(0,i.Z)(this,n);for(var r=arguments.length,o=new Array(r),s=0;s<r;s++)o[s]=arguments[s];return t=e.call.apply(e,[this].concat(o)),(0,h.Z)((0,a.Z)(t),"state",void 0),t}return(0,o.Z)(n,[{key:"getShaders",value:function(){var t=[f.Z,p.Z];return"pbr"===this.props._lighting&&t.push(g.b),{vs:"#version 300 es\n\n// Instance attributes\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\n\n// Uniforms\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform mat4 sceneModelMatrix;\nuniform bool composeModelMatrix;\n\n// Attributes\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\n\n// Varying\nout vec4 vColor;\n\n// MODULE_PBR contains all the varying definitions needed\n#ifndef MODULE_PBR\n  #ifdef HAS_UV\n    out vec2 vTEXCOORD_0;\n  #endif\n#endif\n\n// Main\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);
2\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    // using instancePositions as world coordinates\n    // when using globe mode, this branch does not re-orient the model to align with the surface of the earth\n    // call project_normal before setting position to avoid rotation\n    geometry.normal = project_normal(normal);\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    // set PBR data\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\n\n// Uniforms\nuniform float opacity;\n\n// Varying\nin vec4 vColor;\n\nout vec4 fragmentColor;\n\n// MODULE_PBR contains all the varying definitions needed\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}}},{key:"initializeState",value:function(){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:X,transition:!0},instanceModelMatrix:K.P})}},{key:"updateState",value:function(t){(0,s.Z)((0,u.Z)(n.prototype),"updateState",this).call(this,t);var e=t.props,r=t.oldProps;e.scenegraph!==r.scenegraph?this._updateScenegraph():e._animations!==r._animations&&this._applyAnimationsProp(this.state.scenegraph,this.state.animator,e._animations)}},{key:"finalizeState",value:function(t){(0,s.Z)((0,u.Z)(n.prototype),"finalizeState",this).call(this,t),this._deleteScenegraph()}},{key:"_updateScenegraph",value:function(){var t=this,e=this.props,n=this.context.gl,i=null;if(e.scenegraph instanceof x)i={scenes:[e.scenegraph]};else if(e.scenegraph&&!e.scenegraph.gltf){var o=e.scenegraph,a=function(t,e,n){var r=new j(t,n);return{scenes:r.instantiate(e),animator:r.createAnimator()}}(n,o,this._getModelOptions());i=(0,r.Z)({gltf:o},a),function(t){return W.apply(this,arguments)}(a).then((function(){return t.setNeedsRedraw()}))}else e.scenegraph&&(d.Z.deprecated("ScenegraphLayer.props.scenegraph","Use GLTFLoader instead of GLTFScenegraphLoader")(),i=e.scenegraph);var s={layer:this,gl:n},u=e.getScene(i,s),l=e.getAnimator(i,s);u instanceof x?(this._deleteScenegraph(),this._applyAllAttributes(u),this._applyAnimationsProp(u,l,e._animations),this.setState({scenegraph:u,animator:l})):null!==u&&d.Z.warn("invalid scenegraph:",u)()}},{key:"_applyAllAttributes",value:function(t){var e=this;if(this.state.attributesAvailable){var n=this.getAttributeManager().getAttributes();t.traverse((function(t){e._setModelAttributes(t.model,n)}))}}},{key:"_applyAnimationsProp",value:function(t,e,n){if(t&&e&&n){var r=e.getAnimations();
2Object.keys(n).sort().forEach((function(t){var e=n[t];if("*"===t)r.forEach((function(t){Object.assign(t,e)}));else if(Number.isFinite(Number(t))){var i=Number(t);i>=0&&i<r.length?Object.assign(r[i],e):d.Z.warn("animation ".concat(t," not found"))()}else{var o=r.find((function(e){return e.name===t}));o?Object.assign(o,e):d.Z.warn("animation ".concat(t," not found"))()}}))}}},{key:"_deleteScenegraph",value:function(){var t=this.state.scenegraph;t instanceof x&&t.delete()}},{key:"_getModelOptions",value:function(){var t=this.props._imageBasedLightingEnvironment,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:(0,r.Z)({isInstanced:!0,transpileToGLSL100:!(0,v.D0)(this.context.gl)},this.getShaders()),useTangents:!1}}},{key:"updateAttributes",value:function(t){var e=this;this.setState({attributesAvailable:!0}),this.state.scenegraph&&this.state.scenegraph.traverse((function(n){e._setModelAttributes(n.model,t)}))}},{key:"draw",value:function(t){var e=t.moduleParameters,n=void 0===e?null:e,r=t.parameters,i=void 0===r?{}:r,o=t.context;if(this.state.scenegraph){this.props._animations&&this.state.animator&&(this.state.animator.animate(o.timeline.getTime()),this.setNeedsRedraw());var a=this.context.viewport,s=this.props,u=s.sizeScale,l=s.sizeMinPi
2xels,c=s.sizeMaxPixels,h=s.opacity,f=s.coordinateSystem,p=this.getNumInstances();this.state.scenegraph.traverse((function(t,e){var r=e.worldMatrix;t.model.setInstanceCount(p),t.updateModuleSettings(n),t.draw({parameters:i,uniforms:{sizeScale:u,opacity:h,sizeMinPixels:l,sizeMaxPixels:c,composeModelMatrix:(0,K.X)(a,f),sceneModelMatrix:r,u_Camera:t.model.getUniforms().project_uCameraPosition}})}))}}}]),n}(A.Z);(0,h.Z)($,"defaultProps",Y),(0,h.Z)($,"layerName","ScenegraphLayer")},36800:function(t,e,n){"use strict";n.d(e,{Z:function(){return E}});var r=n(50189),i=n(22951),o=n(91976),a=n(47169),s=n(83138),u=n(27597),l=n(67591),c=n(94337),h=n(64649),f=n(21970),p=n(2123),d=n(54976),A=n(2578),v=n(90031),g=n(69296),m=n(28007),y=n(58300),_=n(94557),b=n(12308),x=n(70353),w=n(7614);function C(t,e){(t.COLOR_0||t.colors)&&e||(t.colors={constant:!0,value:new Float32Array([1,1,1])}),f.Z.assert(t.positions||t.POSITION,'no "postions" or "POSITION" attribute in mesh')}function B(t,e){if(t.attributes)return C(t.attributes,e),t instanceof g.Z?t:new g.Z(t);if(t.positions||t.POSITION)return C(t,e),new g.Z({attributes:t});throw Error("Invalid mesh")}var k={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:function(t){return 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:[]}},E=function(t){(0,l.Z)(n,t);var e=(0,c.Z)(n);function n(){var t;(0,i.Z)(this,n);for(var r=arguments.length,o=new Array(r),s=0;s<r;s++)o[s]=arguments[s];return t=e.call.apply(e,[this].concat(o)),(0,h.Z)((0,a.Z)(t),"state",void 0),t}return(0,o.Z)(n,[{key:"getShaders",value:function(){var t=!(0,m.D0)(this.context.gl),e={};return(0,b.U6)(this.context.gl,x.h.GLSL_DERIVATIVES)&&(e.DERIVATIVES_AVAILABLE=1),(0,s.Z)((0,u.Z)(n.prototype),"getShaders",this).call(this,{vs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\n\n// Scale the model\nuniform float sizeScale;\nuniform bool composeModelMatrix;\n\n// Primitive attributes\nin vec3 positions;\nin vec3 normals;\nin vec3 colors;\nin vec2 texCoords;\n\n// Instance attributes\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\n\n// Outputs to fragment shader\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    // using instancePositions as world coordinates\n    // when using globe mode, this branch does not re-orient the model to align with the surface of the earth\n    // call project_normal before setting position to avoid rotation\n    normals_commonspace = project_normal(instanceModelMatrix * normals);\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\n// NOTE(Tarek): This is necessary because\n// headless.gl reports the extension as\n// available but does not support it in\n// the shader.\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  DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n",modules:[p.Z,d.s,A.Z],transpileToGLSL100:t,defines:e})}},{key:"initializeState",value:function(){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:w.P}),this.setState({emptyTexture:new y.Z(this.context.gl,{data:new Uint8Array(4),width:1,height:1})})}},{key:"updateState",value:function(t){(0,s.Z)((0,u.Z)(n.prototype),"updateState",this).call(this,t);var e=t.props,r=t.oldProps,i=t.changeFlags;if(e.mesh!==r.mesh||i.extensionsChanged){var o;if(null===(o=this.state.model)||void 0===o||o.delete(),e.mesh){this.state.model=this.getModel(e.mesh);var a=e.mesh.attributes||e.mesh;this.setState({hasNormals:Boolean(a.NORMAL||a.normals)})}this.getAttributeManager().invalidateAll()}e.texture!==r.texture&&this.setTexture(e.texture),this.state.model&&this.state.model.setDrawMode(this.props.wireframe?3:4)}},{key:"finalizeState",value:function(t){(0,s.Z)((0,u.Z)(n.prototype),"finalizeState",this).call(this,t),this.state.emptyTexture.delete()}},{key:"draw",value:function(t){var e=t.uniforms;if(this.state.model){var n=this.context.viewport,r=this.props,i=r.sizeScale,o=r.coordinateSystem,a=r._instanced;this.state.model.setUniforms(e).setUniforms({sizeScale:i,composeModelMatrix:!a||(0,w.X)(n,o),flatShading:!this.state.hasNormals}).draw()}}},{key:"getModel",value:function(t){var e=new _.Z(this.context.gl,(0,r.Z)((0,r.Z)({}
2,this.getShaders()),{},{id:this.props.id,geometry:B(t,this.props._useMeshColors),isInstanced:!0})),n=this.props.texture,i=this.state.emptyTexture;return e.setUniforms({sampler:n||i,hasTexture:Boolean(n)}),e}},{key:"setTexture",value:function(t){var e=this.state,n=e.emptyTexture,r=e.model;r&&r.setUniforms({sampler:t||n,hasTexture:Boolean(t)})}}]),n}(v.Z);(0,h.Z)(E,"defaultProps",k),(0,h.Z)(E,"layerName","SimpleMeshLayer")},7614:function(t,e,n){"use strict";n.d(e,{P:function(){return h},X:function(){return f}});var r=n(60726),i=n(73115),o=n(18252),a=Math.PI/180,s=new Float32Array(16),u=new Float32Array(12);function l(t,e,n){var r=e[0]*a,i=e[1]*a,o=e[2]*a,s=Math.sin(o),u=Math.sin(r),l=Math.sin(i),c=Math.cos(o),h=Math.cos(r),f=Math.cos(i),p=n[0],d=n[1],A=n[2];t[0]=p*f*h,t[1]=p*l*h,t[2]=p*-u,t[3]=d*(-l*c+f*u*s),t[4]=d*(f*c+l*u*s),t[5]=d*h*s,t[6]=A*(l*s+f*u*c),t[7]=A*(-f*s+l*u*c),t[8]=A*h*c}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)}var h={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:function(t,e){var n=e.startRow,o=e.endRow,a=this.props,h=a.data,f=a.getOrientation,p=a.getScale,d=a.getTranslation,A=a.getTransformMatrix,v=Array.isArray(A),g=v&&16===A.length,m=Array.isArray(p),y=Array.isArray(f),_=Array.isArray(d),b=g||!v&&Boolean(A(h[0]));t.constant=b?g:y&&m&&_;var x=t.value;if(t.constant){var w;if(b)s.set(A),w=c(s);else l(w=u,f,p),w.set(d,9);t.value=new Float32Array(w)}else{var C,B=n*t.size,k=(0,i.jB)(h,n,o),E=k.iterable,S=k.objectInfo,T=(0,r.Z)(E);try{for(T.s();!(C=T.n()).done;){var M=C.value;S.index++;var I=void 0;if(b)s.set(g?A:A(M,S)),I=c(s);else l(I=u,y?f:f(M,S),m?p:p(M,S)),I.set(_?d:d(M,S),9);x[B++]=I[0],x[B++]=I[1],x[B++]=I[2],x[B++]=I[3],x[B++]=I[4],x[B++]=I[5],x[B++]=I[6],x[B++]=I[7],x[B++]=I[8],x[B++]=I[9],x[B++]=I[10],x[B++]=I[11]}}catch(P){T.e(P)}finally{T.f()}}}};function f(t,e){return e===o.Df.CARTESIAN||e===o.Df.METER_OFFSETS||e===o.Df.DEFAULT&&!t.isGeospatial}},59109:function(t,e,n){"use strict";n.d(e,{Z:function(){return qe}});var r=n(11026),i=n(50189),o=n(66845),a=n(64649),s=n(60726),u=n(22951),l=n(91976),c=1,h=1,f=function(){function t(){(0,u.Z)(this,t),this.time=0,this.channels=new Map,this.animations=new Map,this.playing=!1,this.lastEngineTime=-1}return(0,l.Z)(t,[{key:"addChannel",value:function(t){var e=t.delay,n=void 0===e?0:e,r=t.duration,i=void 0===r?Number.POSITIVE_INFINITY:r,o=t.rate,a=void 0===o?1:o,s=t.repeat,u=c++,l={time:0,delay:n,duration:i,rate:a,repeat:void 0===s?1:s};return this._setChannelTime(l,this.time),this.channels.set(u,l),u}},{key:"removeChannel",value:function(t){this.channels.delete(t);var e,n=(0,s.Z)(this.animations);try{for(n.s();!(e=n.n()).done;){var i=(0,r.Z)(e.value,2),o=i[0];i[1].channel===t&&this.detachAnimation(o)}}catch(a){n.e(a)}finally{n.f()}}},{key:"isFinished",value:function(t){var e=this.channels.get(t);return void 0!==e&&this.time>=e.delay+e.duration*e.repeat}},{key:"getTime",value:function(t){if(void 0===t)return this.time;var e=this.channels.get(t);return void 0===e?-1:e.time}},{key:"setTime",value:function(t){this.time=Math.max(0,t);var e,n=this.channels.values(),r=(0,s.Z)(n);try{for(r.s();!(e=r.n()).done;){var i=e.value;this._setChannelTime(i,this.time)}}catch(f){r.e(f)}finally{r.f()}var o,a=this.animations.values(),u=(0,s.Z)(a);try{for(u.s();!(o=u.n()).done;){var l=o.value,c=l.animation,h=l.channel;c.setTime(this.getTime(h))}}catch(f){u.e(f)}finally{u.f()}}},{key:"play",value:function(){this.playing=!0}},{key:"pause",value:function(){this.playing=!1,this.lastEngineTime=-1}},{key:"reset",value:function(){this.setTime(0)}},{key:"attachAnimation",value:function(t,e){var n=h++;return this.animations.set(n,{animation:t,channel:e}),t.setTime(this.getTime(e)),n}},{key:"detachAnimation",value:function(t){this.animations.delete(t)}},{key:"update",value:function(t){this.playing&&(-1===this.lastEngineTime&&(this.lastEngineTime=t),this.setTime(this.time+(t-this.lastEngineTime)),this.lastEngineTime=t)}},{key:"_setChannelTime",value:function(t,e){var 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)}}]),t}(),p=n(48915),d=n(21970),A=n(23427),v=n(18757),g=n(92138),m=n(3685),y=function(){function t(e,n,r){(0,u.Z)(this,t),(0,a.Z)(this,"id",void 0),(0,a.Z)(this,"context",void 0),(0,a.Z)(this,"isLoaded",void 0),(0,a.Z)(this,"persistent",void 0),(0,a.Z)(this,"_loadCount",0),(0,a.Z)(this,"_subscribers",new Set),(0,a.Z)(this,"_data",void 0),(0,a.Z)(this,"_loader",void 0),(0,a.Z)(this,"_error",void 0),(0,a.Z)(this,"_content",void 0),this.id=e,this.context=r,this.setData(n)}return(0,l.Z)(t,[{key:"subscribe",value:function(t){this._subscribers.add(t)}},{key:"unsubscribe",value:function(t){this._subscribers.delete(t)}},{key:"inUse",value:function(){return this._subscribers.size>0}},{key:"delete",value:function(){}},{key:"getData",value:function(){var t=this;return this.isLoaded?this._error?Promise.reject(this._error):this._content:this._loader.then((function(){return t.getData()}))}},{key:"setData",value:function(t,e){var n=this;if(t!==this._data||e){this._data=t;var r=++this._loadCount,i=t;"string"===typeof t&&(i=(0,m.z)(t)),i instanceof Promise?(this.isLoaded=!1,this._loader=i.then((function(t){n._loadCount===r&&(n.isLoaded=!0,n._error=void 0,n._content=t)}
2)).catch((function(t){n._loadCount===r&&(n.isLoaded=!0,n._error=t||!0)}))):(this.isLoaded=!0,this._error=void 0,this._content=t);var o,a=(0,s.Z)(this._subscribers);try{for(a.s();!(o=a.n()).done;){o.value.onChange(this.getData())}}catch(u){a.e(u)}finally{a.f()}}}}]),t}(),_=function(){function t(e){var n=e.gl,r=e.protocol;(0,u.Z)(this,t),(0,a.Z)(this,"protocol",void 0),(0,a.Z)(this,"_context",void 0),(0,a.Z)(this,"_resources",void 0),(0,a.Z)(this,"_consumers",void 0),(0,a.Z)(this,"_pruneRequest",void 0),this.protocol=r||"resource://",this._context={gl:n,resourceManager:this},this._resources={},this._consumers={},this._pruneRequest=null}return(0,l.Z)(t,[{key:"contains",value:function(t){return!!t.startsWith(this.protocol)||t in this._resources}},{key:"add",value:function(t){var e=t.resourceId,n=t.data,r=t.forceUpdate,i=void 0!==r&&r,o=t.persistent,a=void 0===o||o,s=this._resources[e];s?s.setData(n,i):(s=new y(e,n,this._context),this._resources[e]=s),s.persistent=a}},{key:"remove",value:function(t){var e=this._resources[t];e&&(e.delete(),delete this._resources[t])}},{key:"unsubscribe",value:function(t){var e=t.consumerId,n=this._consumers[e];if(n){for(var r in n){var i=n[r],o=this._resources[i.resourceId];o&&o.unsubscribe(i)}delete this._consumers[e],this.prune()}}},{key:"subscribe",value:function(t){var e=t.resourceId,n=t.onChange,r=t.consumerId,i=t.requestId,o=void 0===i?"default":i,a=this._resources,s=this.protocol;e.startsWith(s)&&(a[e=e.replace(s,"")]||this.add({resourceId:e,data:null,persistent:!1}));var u=a[e];if(this._track(r,o,u,n),u)return u.getData()}},{key:"prune",value:function(){var t=this;this._pruneRequest||(this._pruneRequest=setTimeout((function(){return t._prune()}),0))}},{key:"finalize",value:function(){for(var t in this._resources)this._resources[t].delete()}},{key:"_track",value:function(t,e,n,r){var i=this._consumers,o=i[t]=i[t]||{},a=o[e]||{},s=a.resourceId&&this._resources[a.resourceId];s&&(s.unsubscribe(a),this.prune()),n&&(o[e]=a,a.onChange=r,a.resourceId=n.id,n.subscribe(a))}},{key:"_prune",value:function(){this._pruneRequest=null;for(var t=0,e=Object.keys(this._resources);t<e.length;t++){var n=e[t],r=this._resources[n];r.persistent||r.inUse()||(r.delete(),delete this._resources[n])}}}]),t}(),b=n(83427),x=n(37330),w=n(66199),C=[w.Z],B=["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 k(t){var e,n=x.Z.getDefaultProgramManager(t),r=(0,s.Z)(C);try{for(r.s();!(e=r.n()).done;){var i=e.value;n.addDefaultModule(i)}}catch(l){r.e(l)}finally{r.f()}var o,a=(0,s.Z)(B);try{for(a.s();!(o=a.n()).done;){var u=o.value;n.addShaderHook(u)}}catch(l){a.e(l)}finally{a.f()}return n}var E=function(){function t(e){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.deck,o=r.stats,s=r.viewport,l=r.timeline;(0,u.Z)(this,t),(0,a.Z)(this,"layers",void 0),(0,a.Z)(this,"context",void 0),(0,a.Z)(this,"resourceManager",void 0),(0,a.Z)(this,"_lastRenderedLayers",[]),(0,a.Z)(this,"_needsRedraw",!1),(0,a.Z)(this,"_needsUpdate",!1),(0,a.Z)(this,"_nextLayers",null),(0,a.Z)(this,"_debug",!1),(0,a.Z)(this,"activateViewport",(function(t){(0,A.Z)("layerManager.activateViewport",n,t),t&&(n.context.viewport=t)})),this.layers=[],this.resourceManager=new _({gl:e,protocol:"deck://"}),this.context={mousePosition:null,userData:{},layerManager:this,gl:e,deck:i,programManager:e&&k(e),stats:o||new g.Z({id:"deck.gl"}),viewport:s||new b.Z({id:"DEFAULT-INITIAL-VIEWPORT"}),timeline:l||new f,resourceManager:this.resourceManager,onError:void 0},Object.seal(this)}return(0,l.Z)(t,[{key:"finalize",value:function(){this.resourceManager.finalize();var t,e=(0,s.Z)(this.layers);try{for(e.s();!(t=e.n()).done;){var n=t.value;this._finalizeLayer(n)}}catch(r){e.e(r)}finally{e.f()}}},{key:"needsRedraw",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},e=this._needsRedraw;t.clearRedrawFlags&&(this._needsRedraw=!1);var n,r=(0,s.Z)(this.layers);try{for(r.s();!(n=r.n()).done;){var i=n.value.getNeedsRedraw(t);e=e||i}}catch(o){r.e(o)}finally{r.f()}return e}},{key:"needsUpdate",value:function(){return this._nextLayers&&this._nextLayers!==this._lastRenderedLayers?"layers changed":this._needsUpdate}},{key:"setNeedsRedraw",value:function(t){this._needsRedraw=this._needsRedraw||t}},{key:"setNeedsUpdate",value:function(t){this._needsUpdate=this._needsUpdate||t}},{key:"getLayers",value:function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).layerIds;return t?this.layers.filter((function(e){return t.find((function(t){return 0===e.id.indexOf(t)}))}
2)):this.layers}},{key:"setProps",value:function(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)}},{key:"setLayers",value:function(t,e){(0,A.Z)("layerManager.setLayers",this,e,t),this._lastRenderedLayers=t;var n,r=(0,v.x)(t,Boolean),i=(0,s.Z)(r);try{for(i.s();!(n=i.n()).done;){n.value.context=this.context}}catch(o){i.e(o)}finally{i.f()}this._updateLayers(this.layers,r)}},{key:"updateLayers",value:function(){var t=this.needsUpdate();t&&(this.setNeedsRedraw("updating layers: ".concat(t)),this.setLayers(this._nextLayers||this._lastRenderedLayers,t)),this._nextLayers=null}},{key:"_handleError",value:function(t,e,n){n.raiseError(e,"".concat(t," of ").concat(n))}},{key:"_updateLayers",value:function(t,e){var n,r={},i=(0,s.Z)(t);try{for(i.s();!(n=i.n()).done;){var o=n.value;r[o.id]?d.Z.warn("Multiple old layers with same id ".concat(o.id))():r[o.id]=o}}catch(f){i.e(f)}finally{i.f()}var a=[];this._updateSublayersRecursively(e,r,a),this._finalizeOldLayers(r);for(var u=!1,l=0,c=a;l<c.length;l++){var h=c[l];if(h.hasUniformTransition()){u="Uniform transition in ".concat(h);break}}this._needsUpdate=u,this.layers=a}},{key:"_updateSublayersRecursively",value:function(t,e,n){var r,i=(0,s.Z)(t);try{for(i.s();!(r=i.n()).done;){var o=r.value;o.context=this.context;var a=e[o.id];null===a&&d.Z.warn("Multiple new layers with same id ".concat(o.id))(),e[o.id]=null;var u=null;try{this._debug&&a!==o&&o.validateProps(),a?(this._transferLayerState(a,o),this._updateLayer(o)):this._initializeLayer(o),n.push(o),u=o.isComposite?o.getSubLayers():null}catch(l){this._handleError("matching",l,o)}u&&this._updateSublayersRecursively(u,e,n)}}catch(l){i.e(l)}finally{i.f()}}},{key:"_finalizeOldLayers",value:function(t){for(var e in t){var n=t[e];n&&this._finalizeLayer(n)}}},{key:"_initializeLayer",value:function(t){try{t._initialize(),t.lifecycle=p.dt.INITIALIZED}catch(e){this._handleError("initialization",e,t)}}},{key:"_transferLayerState",value:function(t,e){e._transferState(t),e.lifecycle=p.dt.MATCHED,e!==t&&(t.lifecycle=p.dt.AWAITING_GC)}},{key:"_updateLayer",value:function(t){try{t._update()}catch(e){this._handleError("update",e,t)}}},{key:"_finalizeLayer",value:function(t){this._needsRedraw=this._needsRedraw||"finalized ".concat(t),t.lifecycle=p.dt.AWAITING_FINALIZATION;try{t._finalize(),t.lifecycle=p.dt.FINALIZED}catch(e){this._handleError("finalization",e,t)}}}]),t}(),S=n(98949),T=function(){function t(e){(0,u.Z)(this,t),(0,a.Z)(this,"width",void 0),(0,a.Z)(this,"height",void 0),(0,a.Z)(this,"views",void 0),(0,a.Z)(this,"viewState",void 0),(0,a.Z)(this,"controllers",void 0),(0,a.Z)(this,"timeline",void 0),(0,a.Z)(this,"_viewports",void 0),(0,a.Z)(this,"_viewportMap",void 0),(0,a.Z)(this,"_isUpdating",void 0),(0,a.Z)(this,"_needsRedraw",void 0),(0,a.Z)(this,"_needsUpdate",void 0),(0,a.Z)(this,"_eventManager",void 0),(0,a.Z)(this,"_eventCallbacks",void 0),this.views=[],this.width=100,this.height=100,this.viewState={},this.controllers={},this.timeline=e.timeline,this._viewports=[],this._viewportMap={},this._isUpdating=!1,this._needsRedraw="First render",this._needsUpdate="Initialize",this._eventManager=e.eventManager,this._eventCallbacks={onViewStateChange:e.onViewStateChange,onInteractionStateChange:e.onInteractionStateChange},Object.seal(this),this.setProps(e)}return(0,l.Z)(t,[{key:"finalize",value:function(){for(var t in this.controllers){var e=this.controllers[t];e&&e.finalize()}this.controllers={}}},{key:"needsRedraw",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},e=this._needsRedraw;return t.clearRedrawFlags&&(this._needsRedraw=!1),e}},{key:"setNeedsUpdate",value:function(t){this._needsUpdate=this._needsUpdate||t,this._needsRedraw=this._needsRedraw||t}},{key:"updateViewStates",value:function(){for(var t in this.controllers){var e=this.controllers[t];e&&e.updateTransition()}}},{key:"getViewports",value:function(t){return t?this._viewports.filter((function(e){return e.containsPixel(t)})):this._viewports}},{key:"getViews",value:function(){var t={};return this.views.forEach((function(e){t[e.id]=e})),t}},{key:"getView",value:function(t){return this.views.find((function(e){return e.id===t}))}},{key:"getViewState",value:function(t){var e="string"===typeof t?this.getView(t):t,n=e&&this.viewState[e.getViewStateId()]||this.viewState;return e?e.filterViewState(n):n}},{key:"getViewport",value:function(t){return this._viewportMap[t]}},{key:"unproject",value:function(t,e){for(var n=this.getViewports(),r={x:t[0],y:t[1]},i=n.length-1;i>=0;--i){var o=n[i];if(o.containsPixel(r)){var a=t.slice();return a[0]-=o.x,a[1]-=o.y,o.unproject(a,e)}}return null}}
2,{key:"setProps",value:function(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()}},{key:"_update",value:function(){this._isUpdating=!0,this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._isUpdating=!1}},{key:"_setSize",value:function(t,e){t===this.width&&e===this.height||(this.width=t,this.height=e,this.setNeedsUpdate("Size changed"))}},{key:"_setViews",value:function(t){t=(0,v.x)(t,Boolean),this._diffViews(t,this.views)&&this.setNeedsUpdate("views changed"),this.views=t}},{key:"_setViewState",value:function(t){t?(!(0,S.v)(t,this.viewState)&&this.setNeedsUpdate("viewState changed"),this.viewState=t):d.Z.warn("missing `viewState` or `initialViewState`")()}},{key:"_onViewStateChange",value:function(t,e){this._eventCallbacks.onViewStateChange&&this._eventCallbacks.onViewStateChange((0,i.Z)((0,i.Z)({},e),{},{viewId:t}))}},{key:"_createController",value:function(t,e){var n=this;return new(0,e.type)({timeline:this.timeline,eventManager:this._eventManager,onViewStateChange:this._onViewStateChange.bind(this,e.id),onStateChange:this._eventCallbacks.onInteractionStateChange,makeViewport:function(e){var r;return null===(r=n.getView(t.id))||void 0===r?void 0:r.makeViewport({viewState:e,width:n.width,height:n.height})}})}},{key:"_updateController",value:function(t,e,n,r){var o=t.controller;if(o){var a=(0,i.Z)((0,i.Z)((0,i.Z)({},e),o),{},{id:t.id,x:n.x,y:n.y,width:n.width,height:n.height});return r||(r=this._createController(t,a)),r&&r.setProps(a),r}return null}},{key:"_rebuildViewports",value:function(){var t=this.views,e=this.controllers;this._viewports=[],this.controllers={};for(var n=!1,r=t.length;r--;){var i=t[r],o=this.getViewState(i),a=i.makeViewport({viewState:o,width:this.width,height:this.height}),s=e[i.id],u=Boolean(i.controller);u&&!s&&(n=!0),!n&&u||!s||(s.finalize(),s=null),this.controllers[i.id]=this._updateController(i,o,a,s),this._viewports.unshift(a)}for(var l in e){var c=e[l];c&&!this.controllers[l]&&c.finalize()}this._buildViewportMap()}},{key:"_buildViewportMap",value:function(){var t=this;this._viewportMap={},this._viewports.forEach((function(e){e.id&&(t._viewportMap[e.id]=t._viewportMap[e.id]||e)}))}},{key:"_diffViews",value:function(t,e){return t.length!==e.length||t.some((function(n,r){return!t[r].equals(e[r])}))}}]),t}(),M=n(67591),I=n(94337),P=/([0-9]+\.?[0-9]*)(%|px)/;function Z(t){switch(typeof t){case"number":return{position:t,relative:!1};case"string":var e=P.exec(t);if(e&&e.length>=3){var n="%"===e[2],r=parseFloat(e[1]);return{position:n?r/100:r,relative:n}}default:throw new Error("Could not parse position string ".concat(t))}}function D(t,e){return t.relative?Math.round(t.position*e):t.position}var L=n(12997),O=function(){function t(e){(0,u.Z)(this,t),(0,a.Z)(this,"id",void 0),(0,a.Z)(this,"viewportInstance",void 0),(0,a.Z)(this,"_x",void 0),(0,a.Z)(this,"_y",void 0),(0,a.Z)(this,"_width",void 0),(0,a.Z)(this,"_height",void 0),(0,a.Z)(this,"_padding",void 0),(0,a.Z)(this,"props",void 0);var n=e||{},r=n.id,o=n.x,s=void 0===o?0:o,l=n.y,c=void 0===l?0:l,h=n.width,f=void 0===h?"100%":h,p=n.height,d=void 0===p?"100%":p,A=n.padding,v=void 0===A?null:A,g=n.viewportInstance;(0,L.Z)(!g||g instanceof b.Z),this.viewportInstance=g,this.id=r||this.constructor.displayName||"view",this.props=(0,i.Z)((0,i.Z)({},e),{},{id:this.id}),this._x=Z(s),this._y=Z(c),this._width=Z(f),this._height=Z(d),this._padding=v&&{left:Z(v.left||0),right:Z(v.right||0),top:Z(v.top||0),bottom:Z(v.bottom||0)},this.equals=this.equals.bind(this),Object.seal(this)}return(0,l.Z)(t,[{key:"equals",value:function(t){return this===t||(this.viewportInstance?!!t.viewportInstance&&this.viewportInstance.equals(t.viewportInstance):this.ViewportType===t.ViewportType&&(0,S.v)(this.props,t.props))}},{key:"makeViewport",value:function(t){var e=t.width,n=t.height,r=t.viewState;if(this.viewportInstance)return this.viewportInstance;r=this.filterViewState(r);var o=this.getDimensions({width:e,height:n});return new this.ViewportType((0,i.Z)((0,i.Z)((0,i.Z)({},r),this.props),o))}},{key:"getViewStateId",value:function(){var t=this.props.viewState;return"string"===typeof t?t:(null===t||void 0===t?void 0:t.id)||this.id}},{key:"filterViewState",value:function(t){if(this.props.viewState&&"object"===typeof this.props.viewState){if(!this.props.viewState.id)return this.props.viewState;var e=(0,i.Z)({},t);for(var n in this.props.viewState)"id"!==n&&(e[n]=this.props.viewState[n]);return e}return t}},{key:"getDimensions",value:function(t){var e=t.width,n=t.height,r={x:D(this._x,e),y:D(this._y,n),width:D(this._width,e),height:D(this._height,n)};return this._padding&&(r.padding={left:D(this._padding.left,e),top:D(this._padding.top,n),right:D(this._padding.right,e),bottom:D(this._padding.bottom,n)}),r}},{key:"controller",get:function(){var t=this.props.controller;return t?!0===t?{type:this.ControllerType}:"function"===typeof t?{type:t}:(0,i.Z)({type:this.ControllerType},t):null}}]),t}(),F=n(52310),R=n(83138),z=n(27597),U=n(47169),N=n(47410),G=n(99188),j=function(){},V=2,H=3,J=function(t){return t},W=1,Q=function(){function t(e){var n=this;(0,u.Z)(this,t),(0,a.Z)(this,"getControllerState",void 0),(0,a.Z)(this,"props",void 0),(0,a.Z)(this,"propsInTransition",void 0),(0,a.Z)(this,"transition",void 0),(0,a.Z)(this,"onViewStateChange",void 0),(0,a.Z)(this,"onStateChange",void 0),(0,a.Z)(this,"_onTransitionUpdate",(function(t){var e=t.time,r=t.settings,o=r.interpolator,a=r.
2startProps,s=r.endProps,u=r.duration,l=(0,r.easing)(e/u),c=o.interpolateProps(a,s,l);n.propsInTransition=n.getControllerState((0,i.Z)((0,i.Z)({},n.props),c)).getViewportProps(),n.onViewStateChange({viewState:n.propsInTransition,oldViewState:n.props})})),this.getControllerState=e.getControllerState,this.propsInTransition=null,this.transition=new G.Z(e.timeline),this.onViewStateChange=e.onViewStateChange||j,this.onStateChange=e.onStateChange||j}return(0,l.Z)(t,[{key:"finalize",value:function(){this.transition.cancel()}},{key:"getViewportInTransition",value:function(){return this.propsInTransition}},{key:"processViewStateChange",value:function(t){var e=!1,n=this.props;if(this.props=t,!n||this._shouldIgnoreViewportChange(n,t))return!1;if(this._isTransitionEnabled(t)){var r=n;if(this.transition.inProgress){var o=this.transition.settings,a=o.interruption,s=o.endProps;r=(0,i.Z)((0,i.Z)({},n),a===V?s:this.propsInTransition||n)}this._triggerTransition(r,t),e=!0}else this.transition.cancel();return e}},{key:"updateTransition",value:function(){this.transition.update()}},{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.transition.inProgress||!this.propsInTransition)&&this.transition.settings.interpolator.arePropsEqual(t,this.propsInTransition)}},{key:"_shouldIgnoreViewportChange",value:function(t,e){return this.transition.inProgress?this.transition.settings.interruption===H||this._isUpdateDueToCurrentTransition(e):!this._isTransitionEnabled(e)||e.transitionInterpolator.arePropsEqual(t,e)}},{key:"_triggerTransition",value:function(t,e){var n=this.getControllerState(t),r=this.getControllerState(e).shortestPathFrom(n),i=e.transitionInterpolator,o=i.getDuration?i.getDuration(t,e):e.transitionDuration;if(0!==o){var a=i.initializeProps(t,r);this.propsInTransition={};var s={duration:o,easing:e.transitionEasing||J,interpolator:i,interruption:e.transitionInterruption||W,startProps:a.start,endProps:a.end,onStart:e.onTransitionStart,onUpdate:this._onTransitionUpdate,onInterrupt:this._onTransitionEnd(e.onTransitionInterrupt),onEnd:this._onTransitionEnd(e.onTransitionEnd)};this.transition.start(s),this.onStateChange({inTransition:!0}),this.updateTransition()}}},{key:"_onTransitionEnd",value:function(t){var e=this;return function(n){e.propsInTransition=null,e.onStateChange({inTransition:!1,isZooming:!1,isPanning:!1,isRotating:!1}),null===t||void 0===t||t(n)}}}]),t}(),q=["longitude","latitude","zoom","bearing","pitch"],K=["longitude","latitude","zoom"],X=function(t){(0,M.Z)(n,t);var e=(0,I.Z)(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,u.Z)(this,n);var i=Array.isArray(r)?r:r.transitionProps,o=Array.isArray(r)?{}:r;return o.transitionProps=Array.isArray(i)?{compare:i,required:i}:i||{compare:q,required:K},t=e.call(this,o.transitionProps),(0,a.Z)((0,U.Z)(t),"opts",void 0),t.opts=o,t}return(0,l.Z)(n,[{key:"initializeProps",value:function(t,e){var r=(0,R.Z)((0,z.Z)(n.prototype),"initializeProps",this).call(this,t,e),i=this.opts,o=i.makeViewport,a=i.around;if(o&&a){var s=o(t),u=o(e),l=s.unproject(a);r.start.around=a,Object.assign(r.end,{around:u.project(l),aroundPosition:l,width:e.width,height:e.height})}return r}},{key:"interpolateProps",value:function(t,e,n){var r,o={},a=(0,s.Z)(this._propsToExtract);try{for(a.s();!(r=a.n()).done;){var u=r.value;o[u]=(0,N.t7)(t[u]||0,e[u]||0,n)}}catch(c){a.e(c)}finally{a.f()}if(e.aroundPosition&&this.opts.makeViewport){var l=this.opts.makeViewport((0,i.Z)((0,i.Z)({},e),o));Object.assign(o,l.panByPosition(e.aroundPosition,(0,N.t7)(t.around,e.around,n)))}return o}}]),n}(function(){function t(e){(0,u.Z)(this,t),(0,a.Z)(this,"_propsToCompare",void 0),(0,a.Z)(this,"_propsToExtract",void 0),(0,a.Z)(this,"_requiredProps",void 0);var n=e.compare,r=e.extract,i=e.required;this._propsToCompare=n,this._propsToExtract=r||n,this._requiredProps=i}return(0,l.Z)(t,[{key:"arePropsEqual",value:function(t,e){var n,r=(0,s.Z)(this._propsToCompare);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(!(i in t)||!(i in e)||!(0,N.fS)(t[i],e[i]))return!1}}catch(o){r.e(o)}finally{r.f()}return!0}},{key:"initializeProps",value:function(t,e){var n,r={},i={},o=(0,s.Z)(this._propsToExtract);try{for(o.s();!(n=o.n()).done;){var a=n.value;(a in t||a in e)&&(r[a]=t[a],i[a]=e[a])}}catch(u){o.e(u)}finally{o.f()}return this._checkRequiredProps(r),this._checkRequiredProps(i),{start:r,end:i}}},{key:"getDuration",value:function(t,e){return e.transitionDuration}},{key:"_checkRequiredProps",value:function(t){this._requiredProps&&this._requiredProps.forEach((function(e){var n=t[e];(0,L.Z)(Number.isFinite(n)||Array.isArray(n),"".concat(e," is required for transition"))}))}}]),t}()),Y={transitionDuration:0},$=function(t){return 1-(1-t)*(1-t)},tt=["wheel"],et=["panstart","panmove","panend"],nt=["pinchstart","pinchmove","pinchend"],rt=["tripanstart","tripanmove","tripanend"],it=["doubletap"],ot=["keydown"],at={},st=function(){function t(e){var n=this;(0,u.Z)(this,t),(0,a.Z)(this,"props",void 0),(0,a.Z)(this,"state",{}),(0,a.Z)(this,"transitionManager",void 0),(0,a.Z)(this,"eventManager",void 0),(0,a.Z)(this,"onViewStateChange",void 0),(0,a.Z)(this,"onStateChange",void 0),(0,a.Z)(this,"makeViewport",void 0),(0,a.Z)(this,"_controllerState",void 0),(0,a.Z)(this,"_events",{}),(0,a.Z)(this,"_interactionState",{isDragging:!1}),(0,a.Z)(this,"_customEvents",[]),(0,a.Z)(this,"_eventStartBlocked",null),(0,a.Z)(this,"_panMove",!1),(0,a.Z)(this,"invertPan",!1),(0,a.Z)(this,"dragMode","rotate"),(0,a.Z)(this,"inertia",0),(0,a.Z)(this,"scrollZoom",!0),(0,a.Z)(this,"dragPan",!0),(0,a.Z)(this,"dragRotate",!0),(0,a.Z)(this,"doubleClickZoom",!0),(0,a.Z)(this,"touchZoom",!0),(0,a.Z)(this,"touchRotate",!1),(0,a.Z)(this,"keyboard",!0),this.transitionManager=new Q((0,i.Z)((0,i.Z)({},e),{},{getControllerState:function(t){return new n.ControllerState(t)},onViewStateChange:this._onTransition.bind(this),onStateChange:this._setInteractionState.bind(this)})),this.handleEvent=this.handleEvent.bind(this),this.eventManager=e.eventManager,this.onViewStateChange=e.onViewStateChange||function(){},this.onStateChange=e.onStateChange||function(){},this.makeViewport=e.makeViewport}return(0,l.Z)(t,[{key:"events",set:function(t){this.toggleEvents(this._customEvents,!1),this.toggleEvents(t,!0),this._customEvents=t,this.props&&this.setProps(this.props)}},{key:"finalize",value:function(){for(var t in this._events){var e;if(this._events[t])null===(e=this.eventManager)||void 0===e||e.off(t,this.handleEvent)}this.transitionManager.finalize()}},{key:"handleEvent",value:function(t){this._controllerState=void 0;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:"controllerState",get:function(){return this._controllerState=this._controllerState||new this.ControllerState((0,i.Z)((0,i.Z)({makeViewport:this.makeViewport},this.props),this.state)),this._controllerState}},{key:"getCenter",value:function(t){var e=this.props,n=e.x,r=e.y,i=t.offsetCenter;return[i.x-n,i.y-r]}},{key:"isPointInBounds",value:function(t,e){var n=this.props,r=n.width,i=n.height;if(e&&e.handled)return!1;var o=t[0]>=0&&t[0]<=r&&t[1]>=0&&t[1]<=i;return o&&e&&e.stopPropagation(),o}},{key:"isFunctionKeyPressed",value:function(t){var e=t.srcEvent;return Boolean(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}},{key:"isDragging",value:function(){return this._interactionState.isDragging||!1}},{key:"blockEvents",value:function(t){var e=this,n=setTimeout((function(){e._eventStartBlocked===n&&(e._eventStartBlocked=null)}),t);this._eventStartBlocked=n}},{key:"setProps",value:function(t){t.dragMode&&(this.dragMode=t.dragMode),this.props=t,"transitionInterpolator"in t||(t.transitionInterpolator=this._getTransitionProps().transitionInterpolator),this.transitionManager.processViewStateChange(t);var e=t.inertia;this.inertia=Number.isFinite(e)?e:!0===e?300:0;var n=t.scrollZoom,r=void 0===n||n,i=t.dragPan,o=void 0===i||i,a=t.dragRotate,s=void 0===a||a,u=t.doubleClickZoom,l=void 0===u||u,c=t.touchZoom,h=void 0===c||c,f=t.touchRotate,p=void 0!==f&&f,d=t.keyboard,A=void 0===d||d,v=Boolean(this.onViewStateChange);this.toggleEvents(tt,v&&r),this.toggleEvents(et,v&&(o||s)),this.toggleEvents(nt,v&&(h||p)),this.toggleEvents(rt,v&&p),this.toggleEvents(it,v&&l),this.toggleEvents(ot,v&&A),this.scrollZoom=r,this.dragPan=o,this.dragRotate=s,this.doubleClickZoom=l,this.touchZoom=h,this.touchRotate=p,this.keyboard=A}},{key:"updateTransition",value:function(){this.transitionManager.updateTransition()}},{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:"updateViewport",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=(0,i.Z)((0,i.Z)({},t.getViewportProps()),e),o=this.controllerState!==t;if(this.state=t.getState(),this._setInteractionState(n),o){var a=this.controllerState&&this.controllerState.getViewportProps();this.onViewStateChange&&this.onViewStateChange({viewState:r,interactionState:this._interactionState,oldViewState:a})}}},{key:"_onTransition",value:function(t){this.onViewStateChange((0,i.Z)((0,i.Z)({},t),{},{interactionState:this._interactionState}))}},{key:"_setInteractionState",value:function(t){Object.assign(this._interactionState,t),this.onStateChange(this._interactionState)}},{key:"_onPanStart",value:function(t){var e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;var n=this.isFunctionKeyPressed(t)||t.rightButton||!1;(this.invertPan||"pan"===this.dragMode)&&(n=!n);var r=this.controllerState[n?"panStart":"rotateStart"]({pos:e});return this._panMove=n,this.updateViewport(r,Y,{isDragging:!0}),!0}},{key:"_onPan",value:function(t){return!!this.isDragging()&&(this._panMove?this._onPanMove(t):this._onPanRotate(t))}},{key:"_onPanEnd",value:function(t){return!!this.isDragging()&&(this._panMove?this._onPanMoveEnd(t):this._onPanRotateEnd(t))}},{key:"_onPanMove",value:function(t){if(!this.dragPan)return!1;var e=this.getCenter(t),n=this.controllerState.pan({pos:e});return this.updateViewport(n,Y,{isDragging:!0,isPanning:!0}),!0}},{key:"_onPanMoveEnd",value:function(t){var e=this.inertia;if(this.dragPan&&e&&t.velocity){var n=this.getCenter(t),r=[n[0]+t.velocityX*e/2,n[1]+t.velocityY*e/2],o=this.controllerState.pan({pos:r}).panEnd();this.updateViewport(o,(0,i.Z)((0,i.Z)({},this._getTransitionProps()),{},{transitionDuration:e,transitionEasing:$}),{isDragging:!1,isPanning:!0})}else{var a=this.controllerState.panEnd();this.updateViewport(a,null,{isDragging:!1,isPanning:!1})}return!0}},{key:"_onPanRotate",value:function(t){if(!this.dragRotate)return!1;var e=this.getCenter(t),n=this.controllerState.rotate({pos:e});return this.updateViewport(n,Y,{isDragging:!0,isRotating:!0}),!0}},{key:"_onPanRotateEnd",value:function(t){var e=this.inertia;if(this.dragRotate&&e&&t.velocity){var n=this.getCenter(t),r=[n[0]+t.velocityX*e/2,n[1]+t.velocityY*e/2],o=this.controllerState.rotate({pos:r}).rotateEnd();this.updateViewport(o,(0,i.Z)((0,i.Z)({},this._getTransitionProps()),{},{transitionDuration:e,transitionEasing:$}),{isDragging:!1,isRotating:!0})}else{var a=this.controllerState.rotateEnd();this.updateViewport(a,null,{isDragging:!1,isRotating:!1})}return!0}},{key:"_onWheel",value:function(t){if(!this.scrollZoom)return!1;t.srcEvent.preventDefault();var e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;var n=!0===this.scrollZoom?{}:this.scrollZoom,r=n.speed,o=void 0===r?.01:r,a=n.smooth,s=void 0!==a&&a,u=t.delta,l=2/(1+Math.exp(-Math.abs(u*o)));u<0&&0!==l&&(l=1/l);var c=this.controllerState.zoom({pos:e,scale:l});return this.updateViewport(c,(0,i.Z)((0,i.Z)({},this._getTransitionProps({around:e})),{},{transitionDuration:s?250:1}),{isZooming:!0,isPanning:!0}),!0}},{key:"_onTriplePanStart",value:function(t){var e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;var n=this.controllerState.rotateStart({pos:e});return this.updateViewport(n,Y,{isDragging:!0}),!0}},{key:"_onTriplePan",value:function(t){if(!this.touchRotate)return!1;if(!this.isDragging())return!1;var e=this.getCenter(t);e[0]-=t.deltaX;var n=this.controllerState.rotate({pos:e});return this.updateViewport(n,Y,{isDragging:!0,isRotating:!0}),!0}},{key:"_onTriplePanEnd",value:function(t){if(!this.isDragging())return!1;var e=this.inertia;if(this.touchRotate&&e&&t.velocityY){var n=this.getCenter(t),r=[n[0],n[1]+=t.velocityY*e/2],o=this.controllerState.rotate({pos:r});this.updateViewport(o,(0,i.Z)((0,i.Z)({},this._getTransitionProps()),{},{transitionDuration:e,transitionEasing:$}),{isDragging:!1,isRotating:!0}),this.blockEvents(e)}else{var a=this.controllerState.rotateEnd();this.updateViewport(a,null,{isDragging:!1,isRotating:!1})}return!0}},{key:"_onPinchStart",value:function(t){var e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;var n=this.controllerState.zoomStart({pos:e}).rotateStart({pos:e});return at._startPinchRotation=t.rotation,at._lastPinchEvent=t,this.updateViewport(n,Y,{isDragging:!0}),!0}},{key:"_onPinch",value:function(t){if(!this.touchZoom&&!this.touchRotate)return!1;if(!this.isDragging())return!1;var e=this.controllerState;if(this.touchZoom){var n=t.scale,r=this.getCenter(t);e=e.zoom({pos:r,scale:n})}if(this.touchRotate){var i=t.rotation;e=e.rotate({deltaAngleX:at._startPinchRotation-i})}return this.updateViewport(e,Y,{isDragging:!0,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:this.touchRotate}),at._lastPinchEvent=t,!0}},{key:"_onPinchEnd",value:function(t){if(!this.isDragging())return!1;var e=this.inertia,n=at._lastPinchEvent;if(this.touchZoom&&e&&n&&t.scale!==n.scale){var r=this.getCenter(t),o=this.controllerState.rotateEnd(),a=Math.log2(t.scale),s=(a-Math.log2(n.scale))/(t.deltaTime-n.deltaTime),u=Math.pow(2,a+s*e/2);o=o.zoom({pos:r,scale:u}).zoomEnd(),this.updateViewport(o,(0,i.Z)((0,i.Z)({},this._getTransitionProps({around:r})),{},{transitionDuration:e,transitionEasing:$}),{isDragging:!1,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:!1}),this.blockEvents(e)}else{var l=this.controllerState.zoomEnd().rotateEnd();this.updateViewport(l,null,{isDragging:!1,isPanning:!1,isZooming:!1,isRotating:!1})}return at._startPinchRotation=null,at._lastPinchEvent=null,!0}},{key:"_onDoubleTap",value:function(t){if(!this.doubleClickZoom)return!1;var e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;var n=this.isFunctionKeyPressed(t),r=this.controllerState.zoom({pos:e,scale:n?.5:2});return this.updateViewport(r,this._getTransitionProps({around:e}),{isZooming:!0,isPanning:!0}),this.blockEvents(100),!0}},{key:"_onKeyDown",value:function(t){if(!this.keyboard)return!1;var e,n=this.isFunctionKeyPressed(t),r=!0===this.keyboard?{}:this.keyboard,i=r.zoomSpeed,o=r.moveSpeed,a=r.rotateSpeedX,s=r.rotateSpeedY,u=this.controllerState,l={};switch(t.srcEvent.code){case"Minus":e=n?u.zoomOut(i).zoomOut(i):u.zoomOut(i),l.isZooming=!0;break;case"Equal":e=n?u.zoomIn(i).zoomIn(i):u.zoomIn(i),l.isZooming=!0;break;case"ArrowLeft":n?(e=u.rotateLeft(a),l.isRotating=!0):(e=u.moveLeft(o),l.isPanning=!0);break;case"ArrowRight":n?(e=u.rotateRight(a),l.isRotating=!0):(e=u.moveRight(o),l.isPanning=!0);break;case"ArrowUp":n?(e=u.rotateUp(s),l.isRotating=!0):(e=u.moveUp(o),l.isPanning=!0);break;case"ArrowDown":n?(e=u.rotateDown(s),l.isRotating=!0):(e=u.moveDown(o),l.isPanning=!0);break;default:return!1}return this.updateViewport(e,this._getTransitionProps(),l),!0}},{key:"_getTransitionProps",value:function(t){var e=this.transition;return e&&e.transitionInterpolator?t?(0,i.Z)((0,i.Z)({},e),{},{transitionInterpolator:new X((0,i.Z)((0,i.Z)((0,i.Z)({},t),e.transitionInterpolator.opts),{},{makeVi
2ewport:this.controllerState.makeViewport}))}):e:Y}}]),t}(),ut=function(){function t(e,n){(0,u.Z)(this,t),(0,a.Z)(this,"_viewportProps",void 0),(0,a.Z)(this,"_state",void 0),this._viewportProps=this.applyConstraints(e),this._state=n}return(0,l.Z)(t,[{key:"getViewportProps",value:function(){return this._viewportProps}},{key:"getState",value:function(){return this._state}}]),t}(),lt=n(75818),ct=function(t){(0,M.Z)(n,t);var e=(0,I.Z)(n);function n(t){var r;(0,u.Z)(this,n);var i=t.width,o=t.height,s=t.latitude,l=t.longitude,c=t.zoom,h=t.bearing,f=void 0===h?0:h,p=t.pitch,d=void 0===p?0:p,A=t.altitude,v=void 0===A?1.5:A,g=t.position,m=void 0===g?[0,0,0]:g,y=t.maxZoom,_=void 0===y?20:y,b=t.minZoom,x=void 0===b?0:b,w=t.maxPitch,C=void 0===w?60:w,B=t.minPitch,k=void 0===B?0:B,E=t.startPanLngLat,S=t.startZoomLngLat,T=t.startRotatePos,M=t.startBearing,I=t.startPitch,P=t.startZoom,Z=t.normalize,D=void 0===Z||Z;return(0,L.Z)(Number.isFinite(l)),(0,L.Z)(Number.isFinite(s)),(0,L.Z)(Number.isFinite(c)),r=e.call(this,{width:i,height:o,latitude:s,longitude:l,zoom:c,bearing:f,pitch:d,altitude:v,maxZoom:_,minZoom:x,maxPitch:C,minPitch:k,normalize:D,position:m},{startPanLngLat:E,startZoomLngLat:S,startRotatePos:T,startBearing:M,startPitch:I,startZoom:P}),(0,a.Z)((0,U.Z)(r),"makeViewport",void 0),r.makeViewport=t.makeViewport,r}return(0,l.Z)(n,[{key:"panStart",value:function(t){var e=t.pos;return this._getUpdatedState({startPanLngLat:this._unproject(e)})}},{key:"pan",value:function(t){var e=t.pos,n=t.startPos,r=this.getState().startPanLngLat||this._unproject(n);if(!r)return this;var i=this.makeViewport(this.getViewportProps()).panByPosition(r,e);return this._getUpdatedState(i)}},{key:"panEnd",value:function(){return this._getUpdatedState({startPanLngLat:null})}},{key:"rotateStart",value:function(t){var e=t.pos;return this._getUpdatedState({startRotatePos:e,startBearing:this.getViewportProps().bearing,startPitch:this.getViewportProps().pitch})}},{key:"rotate",value:function(t){var e,n=t.pos,r=t.deltaAngleX,i=void 0===r?0:r,o=t.deltaAngleY,a=void 0===o?0:o,s=this.getState(),u=s.startRotatePos,l=s.startBearing,c=s.startPitch;return u&&void 0!==l&&void 0!==c?(e=n?this._getNewRotation(n,u,c,l):{bearing:l+i,pitch:c+a},this._getUpdatedState(e)):this}},{key:"rotateEnd",value:function(){return this._getUpdatedState({startBearing:null,startPitch:null})}},{key:"zoomStart",value:function(t){var e=t.pos;return this._getUpdatedState({startZoomLngLat:this._unproject(e),startZoom:this.getViewportProps().zoom})}},{key:"zoom",value:function(t){var e=t.pos,n=t.startPos,r=t.scale,o=this.getState(),a=o.startZoom,s=o.startZoomLngLat;if(s||(a=this.getViewportProps().zoom,s=this._unproject(n)||this._unproject(e)),!s)return this;var u=this.getViewportProps(),l=u.maxZoom,c=u.minZoom,h=a+Math.log2(r);h=(0,N.uZ)(h,c,l);var f=this.makeViewport((0,i.Z)((0,i.Z)({},this.getViewportProps()),{},{zoom:h}));return this._getUpdatedState((0,i.Z)({zoom:h},f.panByPosition(s,e)))}},{key:"zoomEnd",value:function(){return this._getUpdatedState({startZoomLngLat:null,startZoom:null})}},{key:"zoomIn",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2;return this._zoomFromCenter(t)}},{key:"zoomOut",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2;return this._zoomFromCenter(1/t)}},{key:"moveLeft",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;return this._panFromCenter([t,0])}},{key:"moveRight",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;return this._panFromCenter([-t,0])}},{key:"moveUp",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;return this._panFromCenter([0,t])}},{key:"moveDown",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;return this._panFromCenter([0,-t])}},{key:"rotateLeft",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15;return this._getUpdatedState({bearing:this.getViewportProps().bearing-t})}},{key:"rotateRight",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15;
2return this._getUpdatedState({bearing:this.getViewportProps().bearing+t})}},{key:"rotateUp",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return this._getUpdatedState({pitch:this.getViewportProps().pitch+t})}},{key:"rotateDown",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return this._getUpdatedState({pitch:this.getViewportProps().pitch-t})}},{key:"shortestPathFrom",value:function(t){var e=t.getViewportProps(),n=(0,i.Z)({},this.getViewportProps()),r=n.bearing,o=n.longitude;return Math.abs(r-e.bearing)>180&&(n.bearing=r<0?r+360:r-360),Math.abs(o-e.longitude)>180&&(n.longitude=o<0?o+360:o-360),n}},{key:"applyConstraints",value:function(t){var e=t.maxZoom,n=t.minZoom,r=t.zoom;t.zoom=(0,N.uZ)(r,n,e);var i=t.maxPitch,o=t.minPitch,a=t.pitch;t.pitch=(0,N.uZ)(a,o,i);var s=t.normalize;return(void 0===s||s)&&Object.assign(t,(0,lt.QA)(t)),t}},{key:"_zoomFromCenter",value:function(t){var e=this.getViewportProps(),n=e.width,r=e.height;return this.zoom({pos:[n/2,r/2],scale:t})}},{key:"_panFromCenter",value:function(t){var e=this.getViewportProps(),n=e.width,r=e.height;return this.pan({startPos:[n/2,r/2],pos:[n/2+t[0],r/2+t[1]]})}},{key:"_getUpdatedState",value:function(t){return new this.constructor((0,i.Z)((0,i.Z)((0,i.Z)({makeViewport:this.makeViewport},this.getViewportProps()),this.getState()),t))}},{key:"_unproject",value:function(t){var e=this.makeViewport(this.getViewportProps());return t&&e.unproject(t)}},{key:"_getNewRotation",value:function(t,e,n,r){var i=t[0]-e[0],o=t[1]-e[1],a=t[1],s=e[1],u=this.getViewportProps(),l=u.width,c=u.height,h=i/l,f=0;o>0?Math.abs(c-s)>5&&(f=o/(s-c)*1.2):o<0&&s>5&&(f=1-a/s),f=(0,N.uZ)(f,-1,1);var p=this.getViewportProps(),d=p.minPitch,A=p.maxPitch,v=n;return f>0?v=n+f*(A-n):f<0&&(v=n-f*(d-n)),{pitch:v,bearing:r+180*h}}}]),n}(ut),ht=function(t){(0,M.Z)(n,t);var e=(0,I.Z)(n);function n(){var t;(0,u.Z)(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),(0,a.Z)((0,U.Z)(t),"ControllerState",ct),(0,a.Z)((0,U.Z)(t),"transition",{transitionDuration:300,transitionInterpolator:new X({transitionProps:{compare:["longitude","latitude","zoom","bearing","pitch","position"],required:["longitude","latitude","zoom"]}})}),(0,a.Z)((0,U.Z)(t),"dragMode","pan"),t}return(0,l.Z)(n,[{key:"setProps",value:function(t){t.position=t.position||[0,0,0];var e=this.props;(0,R.Z)((0,z.Z)(n.prototype),"setProps",this).call(this,t),(!e||e.height!==t.height)&&this.updateViewport(new this.ControllerState((0,i.Z)((0,i.Z)({makeViewport:this.makeViewport},t),this.state)))}}]),n}(st),ft=function(t){(0,M.Z)(n,t);var e=(0,I.Z)(n);function n(){return(0,u.Z)(this,n),e.apply(this,arguments)}return(0,l.Z)(n,[{key:"ViewportType",get:function(){return F.Z}},{key:"ControllerType",get:function(){return ht}}]),n}(O);(0,a.Z)(ft,"displayName","MapView");var pt=n(58300),dt=[255,255,255],At=0,vt=(0,l.Z)((function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,u.Z)(this,t),(0,a.Z)(this,"id",void 0),(0,a.Z)(this,"color",void 0),(0,a.Z)(this,"intensity",void 0),(0,a.Z)(this,"type","ambient");var n=e.color,r=void 0===n?dt:n,i=e.intensity,o=void 0===i?1:i;this.id=e.id||"ambient-".concat(At++),this.color=r,this.intensity=o})),gt=n(431),mt=[255,255,255],yt=[0,0,-1],_t=0,bt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,u.Z)(this,t),(0,a.Z)(this,"id",void 0),(0,a.Z)(this,"color",void 0),(0,a.Z)(this,"intensity",void 0),(0,a.Z)(this,"type","directional"),(0,a.Z)(this,"direction",void 0),(0,a.Z)(this,"shadow",void 0);var n=e.color,r=void 0===n?mt:n,i=e.intensity,o=void 0===i?1:i,s=e.direction,l=void 0===s?yt:s,c=e._shadow,h=void 0!==c&&c;this.id=e.id||"directional-".concat(_t++),this.color=r,this.intensity=o,this.type="directional",this.direction=new gt.Z(l).normalize().toArray(),this.shadow=h}return(0,l.Z)(t,[{key:"getProjectedLight",value:function(t){return this}}]),t}(),xt=n(12987),wt=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{id:"pass"};(0,u.Z)(this,t),(0,a.Z)(this,"id",void 0),(0,a.Z)(this,"gl",void 0),(0,a.Z)(this,"props",void 0);var r=n.id;this.id=r,this.gl=e,this.props=(0,i.Z)({},n)}return(0,l.Z)(t,[{key:"setProps",value:function(t){Object.assign(this.props,t)}},{key:"render",value:function(t){}}
2,{key:"cleanup",value:function(){}}]),t}(),Ct=n(28007),Bt=n(97756),kt=function(t){(0,M.Z)(n,t);var e=(0,I.Z)(n);function n(){var t;(0,u.Z)(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),(0,a.Z)((0,U.Z)(t),"_lastRenderIndex",-1),t}return(0,l.Z)(n,[{key:"render",value:function(t){var e=this.gl;return(0,Ct.dR)(e,{framebuffer:t.target}),this._drawLayers(t)}},{key:"_drawLayers",value:function(t){var e=t.target,n=t.moduleParameters,r=t.viewports,i=t.views,o=t.onViewportActive,a=t.clearStack,u=void 0===a||a,l=t.clearCanvas,c=void 0===l||l;t.pass=t.pass||"unknown";var h=this.gl;c&&function(t){var e=t.drawingBufferWidth,n=t.drawingBufferHeight;(0,Ct.dR)(t,{viewport:[0,0,e,n]}),t.clear(16640)}(h),u&&(this._lastRenderIndex=-1);var f,p=[],d=(0,s.Z)(r);try{for(d.s();!(f=d.n()).done;){var A=f.value,v=i&&i[A.id];o(A);var g,m=this._getDrawLayerParams(A,t),y=A.subViewports||[A],_=(0,s.Z)(y);try{for(_.s();!(g=_.n()).done;){var b=g.value,x=this._drawLayersInViewport(h,{target:e,moduleParameters:n,viewport:b,view:v,pass:t.pass,layers:t.layers},m);p.push(x)}}catch(w){_.e(w)}finally{_.f()}}}catch(w){d.e(w)}finally{d.f()}return p}},{key:"_getDrawLayerParams",value:function(t,e){for(var n=e.layers,r=e.pass,i=e.layerFilter,o=e.cullRect,a=e.effects,s=e.moduleParameters,u=[],l=Et(this._lastRenderIndex+1),c={layer:n[0],viewport:t,isPicking:r.startsWith("picking"),renderPass:r,cullRect:o},h={},f=0;f<n.length;f++){var p=n[f],d=this._shouldDrawLayer(p,c,i,h),A={shouldDrawLayer:d};d&&(A.layerRenderIndex=l(p,d),A.moduleParameters=this._getModuleParameters(p,a,r,s),A.layerParameters=this.getLayerParameters(p,f,t)),u[f]=A}return u}},{key:"_drawLayersInViewport",value:function(t,e,n){var r=e.layers,i=e.moduleParameters,o=e.pass,a=e.target,s=e.viewport,u=e.view,l=function(t,e){var n=e.moduleParameters,r=e.target,i=e.viewport,o=r&&"default-framebuffer"!==r.id,a=n&&n.devicePixelRatio||(0,Ct.w)(t),s=o?r.height:t.drawingBufferHeight,u=i;return[u.x*a,s-(u.y+u.height)*a,u.width*a,u.height*a]}(t,{moduleParameters:i,target:a,viewport:s});if(u&&u.props.clear){var c=!0===u.props.clear?{color:!0,depth:!0}:u.props.clear;(0,Ct.s8)(t,{scissorTest:!0,scissor:l},(function(){return(0,Bt.Z)(t,c)}))}var h={totalCount:r.length,visibleCount:0,compositeCount:0,pickableCount:0};(0,Ct.dR)(t,{viewport:l});for(var f=0;f<r.length;f++){var p=r[f],d=n[f],A=d.shouldDrawLayer,v=d.layerRenderIndex,g=d.moduleParameters,m=d.layerParameters;if(A&&p.props.pickable&&h.pickableCount++,p.isComposite)h.compositeCount++;else if(A){h.visibleCount++,this._lastRenderIndex=Math.max(this._lastRenderIndex,v),g.viewport=s;try{p._drawLayer({moduleParameters:g,uniforms:{layerIndex:v},parameters:m})}catch(y){p.raiseError(y,"drawing ".concat(p," to ").concat(o))}}}return h}},{key:"shouldDrawLayer",value:function(t){return!0}},{key:"getModuleParameters",value:function(t,e){return null}},{key:"getLayerParameters",value:function(t,e,n){return t.props.parameters}},{key:"_shouldDrawLayer",value:function(t,e,n,r){if(!(t.props.visible&&this.shouldDrawLayer(t)))return!1;e.layer=t;for(var i=t.parent;i;){if(!i.props.visible||!i.filterSubLayer(e))return!1;e.layer=i,i=i.parent}if(n){var o=e.layer.id;if(o in r||(r[o]=n(e)),!r[o])return!1}return t.activateViewport(e.viewport),!0}},{key:"_getModuleParameters",value:function(t,e,n,r){var i,o=Object.assign(Object.create((null===(i=t.internalState)||void 0===i?void 0:i.propsInTransition)||t.props),{autoWrapLongitude:t.wrapLongitude,viewport:t.context.viewport,mousePosition:t.context.mousePosition,pickingActive:0,devicePixelRatio:(0,Ct.w)(this.gl)});if(e){var a,u=(0,s.Z)(e);try{for(u.s();!(a=u.n()).done;){var l,c=a.value;Object.assign(o,null===(l=c.getModuleParameters)||void 0===l?void 0:l.call(c,t))}}catch(h){u.e(h)}finally{u.f()}}return Object.assign(o,this.getModuleParameters(t,e),r)}}]),n}(wt);function Et(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={};return function r(i,o){var a,s=i.props._offset,u=i.id,l=i.parent&&i.parent.id;if(l&&!(l in e)&&r(i.parent,!1),l in n){var c=n[l]=n[l]||Et(e[l],e);a=c(i,o),n[u]=c}else Number.isFinite(s)?(a=s+(e[l]||0),n[u]=null):a=t;return o&&a>=t&&(t=a+1),e[u]=a,a}}var St=n(38332),Tt=n(79078),Mt=function(t){(0,M.Z)(n,t);var e=(0,I.Z)(n);function n(t,r){var i,o,s;return(0,u.Z)(this,n),s=e.call(this,t,r),(0,a.Z)((0,U.Z)(s),"shadowMap",void 0),(0,a.Z)((0,U.Z)(s),"depthBuffer",void 0),(0,a.Z)((0,U.Z)(s),"fbo",void 0),s.shadowMap=new pt.Z(t,{width:1,height:1,parameters:(i={},(0,a.Z)(i,10241,9729),(0,a.Z)(i,10240,9729),(0,a.Z)(i,10242,33071),(0,a.Z)(i,10243,33071),i)}),s.depthBuffer=new St.Z(t,{format:33189,width:1,height:1}),s.fbo=new Tt.Z(t,{id:"shadowmap",width:1,height:1,attachments:(o={},(0,a.Z)(o,36064,s.shadowMap),(0,a.Z)(o,36096,s.depthBuffer),o)}),s}return(0,l.Z)(n,[{key:"render",value:function(t){var e=this,r=this.fbo;(0,Ct.s8)(this.gl,{depthRange:[0,1],depthTest:!0,blend:!1,clearColor:[1,1,1,1]},(function(){var o=t.viewports[0],a=(0,Ct.w)(e.gl),s=o.width*a,u=o.height*a;s===r.width&&u===r.height||r.resize({width:s,height:u}),(0,R.Z)((0,z.Z)(n.prototype),"render",e).call(e,(0,i.Z)((0,i.Z)({},t),{},{target:r,pass:"shadow"}))}))}},{key:"shouldDrawLayer",value:function(t){return!1!==t.props.shadowEnabled}},{key:"getModuleParameters",value:function(){return{drawToShadowMap:!0}}},{key:"delete",value:function(){this.fbo&&(this.fbo.delete(),this.fbo=null),this.shadowMap&&(this.shadowMap.delete(),this.shadowMap=null),this.depthBuffer&&(this.depthBuffer.delete(),this.depthBuffer=null)}}]),n}(kt),It=n(649),Pt=n(18252),Zt=n(18188),Dt=(0,Zt.Z)((function(t){var e=t.viewport,n=t.center;return new xt.Z(e.viewProjectionMatrix).invert().transform(n)})),Lt=(0,Zt.Z)((function(t){var e,n=t.viewport,i=t.shadowMatrices,o=[],a=n.pixelUnprojectionMatrix,u=n.isGeospatial?void 0:1,l=[[0,0,u],[n.width,0,u],[0,n.height,u],[n.width,n.height,u],[0,0,-1],[n.width,0,-1],[0,n.height,-1],[n.width,n.height,-1]].map((function(t){return function(t,e){var n=(0,r.Z)(t,3),i=n[0],o=n[1],a=n[2],s=(0,lt.CT)([i,o,a],e);
2if(Number.isFinite(a))return s;return[s[0],s[1],0]}(t,a)})),c=(0,s.Z)(i);try{var h=function(){var t=e.value,r=t.clone().translate(new gt.Z(n.center).negate()),i=l.map((function(t){return r.transform(t)})),a=(new xt.Z).ortho({left:Math.min.apply(Math,(0,It.Z)(i.map((function(t){return t[0]})))),right:Math.max.apply(Math,(0,It.Z)(i.map((function(t){return t[0]})))),bottom:Math.min.apply(Math,(0,It.Z)(i.map((function(t){return t[1]})))),top:Math.max.apply(Math,(0,It.Z)(i.map((function(t){return t[1]})))),near:Math.min.apply(Math,(0,It.Z)(i.map((function(t){return-t[2]})))),far:Math.max.apply(Math,(0,It.Z)(i.map((function(t){return-t[2]}))))});o.push(a.multiplyRight(t))};for(c.s();!(e=c.n()).done;)h()}catch(f){c.e(f)}finally{c.f()}return o})),Ot=[0,0,0,1],Ft=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0];var Rt={name:"shadow",dependencies:[w.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(){var 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){var n=t.shadowEnabled;if(void 0!==n&&!n||!t.shadowMatrices||!t.shadowMatrices.length)return{shadow_uDrawShadowMap:!1,shadow_uUseShadowMap:!1};for(var r={shadow_uDrawShadowMap:Boolean(t.drawToShadowMap),shadow_uUseShadowMap:!!t.shadowMaps&&t.shadowMaps.length>0,shadow_uColor:t.shadowColor||Ot,shadow_uLightId:t.shadowLightId||0,shadow_uLightCount:t.shadowMatrices.length},i=Dt({viewport:t.viewport,center:e.project_uCenter}),o=[],a=Lt({shadowMatrices:t.shadowMatrices,viewport:t.viewport}).slice(),s=0;s<t.shadowMatrices.length;s++){var u=a[s],l=u.clone().translate(new gt.Z(t.viewport.center).negate());e.project_uCoordinateSystem===Pt.Df.LNGLAT&&e.project_uProjectionMode===Pt.zG.WEB_MERCATOR?(a[s]=l,o[s]=i):(a[s]=u.clone().multiplyRight(Ft),o[s]=l.transform(i))}for(var c=0;c<a.length;c++)r["shadow_uViewProjectionMatrices[".concat(c,"]")]=a[c],r["shadow_uProjectCenters[".concat(c,"]")]=o[c],t.shadowMaps&&t.shadowMaps.length>0?r["shadow_uShadowMap".concat(c)]=t.shadowMaps[c]:r["shadow_uShadowMap".concat(c)]=t.dummyShadowMap;return r}(t,e):{}}},zt={color:[255,255,255],intensity:1},Ut=[{color:[255,255,255],intensity:1,direction:[-1,3,-1]},{color:[255,255,255],intensity:.9,direction:[1,-8,-2.5]}],Nt=[0,0,0,200/255],Gt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};for(var n in(0,u.Z)(this,t),(0,a.Z)(this,"id","lighting-effect"),(0,a.Z)(this,"props",null),(0,a.Z)(this,"shadowColor",Nt),(0,a.Z)(this,"shadow",void 0),(0,a.Z)(this,"ambientLight",null),(0,a.Z)(this,"directionalLights",[]),(0,a.Z)(this,"pointLights",[]),(0,a.Z)(this,"shadowPasses",[]),(0,a.Z)(this,"shadowMaps",[]),(0,a.Z)(this,"dummyShadowMap",null),(0,a.Z)(this,"programManager",void 0),(0,a.Z)(this,"shadowMatrices",void 0),e){var r=e[n];switch(r.type){case"ambient":this.ambientLight=r;break;case"directional":this.directionalLights.push(r);break;case"point":this.pointLights.push(r)}}this._applyDefaultLights(),this.shadow=this.directionalLights.some((function(t){return t.shadow}))}return(0,l.Z)(t,[{key:"preRender",value:function(t,e){var n=e.layers,r=e.layerFilter,i=e.viewports,o=e.onViewportActive,a=e.views;if(this.shadow){this.shadowMatrices=this._calculateMatrices(),0===this.shadowPasses.length&&this._createShadowPasses(t),this.programManager||(this.programManager=x.Z.getDefaultProgramManager(t),Rt&&this.programManager.addDefaultModule(Rt)),this.dummyShadowMap||(this.dummyShadowMap=new pt.Z(t,{width:1,height:1}));for(var s=0;s<this.shadowPasses.length;s++){this.shadowPasses[s].render({layers:n,layerFilter:r,viewports:i,onViewportActive:o,views:a,moduleParameters:{shadowLightId:s,dummyShadowMap:this.dummyShadowMap,shadowMatrices:this.shadowMatrices}})}}}},{key:"getModuleParameters",value:function(t){var 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((function(e){return e.getProjectedLight({layer:t})})),pointLights:this.pointLights.map((function(e){return e.getProjectedLight({layer:t})}))},e}},{key:"cleanup",value:function(){var t,e=(0,s.Z)(this.shadowPasses);try{for(e.s();!(t=e.n()).done;){t.value.delete()}}catch(n){e.e(n)}finally{e.f()}this.shadowPasses.length=0,this.shadowMaps.length=0,this.dummyShadowMap&&(this.dummyShadowMap.delete(),this.dummyShadowMap=null),this.shadow&&this.programManager&&(this.programManager.removeDefaultModule(Rt),this.programManager=null)}},{key:"_calculateMatrices",value:function(){var t,e=[],n=(0,s.Z)(this.directionalLights);try{for(n.s();!(t=n.n()).done;){var r=t.value,i=(new xt.Z).lookAt({eye:new gt.Z(r.direction).negate()});e.push(i)}}catch(o){n.e(o)}finally{n.f()}return e}},{key:"_createShadowPasses",value:function(t){for(var e=0;e<this.directionalLights.length;e++){var n=new Mt(t);this.shadowPasses[e]=n,this.shadowMaps[e]=n.shadowMap}}},{key:"_applyDefaultLights",value:function(){var t=this.ambientLight,e=this.pointLights,n=this.directionalLights;t||0!==e.length||0!==n.length||(this.ambientLight=new vt(zt),this.directionalLights.push(new bt(Ut[0]),new bt(Ut[1])))}}]),t}(),jt=function(t){(0,M.Z)(n,t);var e=(0,I.Z)(n);function n(t,r){var i,o;(0,u.Z)(this,n),o=e.call(this,t,r),(0,a.Z)((0,U.Z)(o),"maskMap",void 0),(0,a.Z)((0,U.Z)(o),"fbo",void 0);var s=r.mapSize,l=void 0===s?2048:s;return o.maskMap=new pt.Z(t,{width:l,height:l,parameters:(i={},(0,a.Z)(i,10241,9729),(0,a.Z)(i,10240,9729),(0,a.Z)(i,10242,33071),(0,a.Z)(i,10243,33071),i)}),o.fbo=new Tt.Z(t,{id:"maskmap",width:l,height:l,attachments:(0,a.Z)({},36064,o.maskMap)}),o}return(0,l.Z)(n,[{key:"render",value:function(t){var e=this,r=this.gl,o=[!1,!1,
2!1,!1];return o[t.channel]=!0,(0,Ct.s8)(r,{clearColor:[255,255,255,255],blend:!0,blendFunc:[0,1],blendEquation:32778,colorMask:o,depthTest:!1},(function(){return(0,R.Z)((0,z.Z)(n.prototype),"render",e).call(e,(0,i.Z)((0,i.Z)({},t),{},{target:e.fbo,pass:"mask"}))}))}},{key:"shouldDrawLayer",value:function(t){return t.props.operation===Pt.k8.MASK}},{key:"delete",value:function(){this.fbo.delete(),this.maskMap.delete()}}]),n}(kt),Vt=n(77548),Ht=(new xt.Z).lookAt({eye:[0,0,1]});function Jt(t){var e=t.width,n=t.height,r=t.near,i=t.far,o=t.padding,a=-e/2,s=e/2,u=-n/2,l=n/2;if(o){var c=o.left,h=void 0===c?0:c,f=o.right,p=void 0===f?0:f,d=o.top,A=void 0===d?0:d,v=o.bottom,g=void 0===v?0:v,m=(0,N.uZ)((h+e-p)/2,0,e)-e/2,y=(0,N.uZ)((A+n-g)/2,0,n)-n/2;a-=m,s-=m,u+=y,l+=y}return(new xt.Z).ortho({left:a,right:s,bottom:u,top:l,near:r,far:i})}var Wt=function(t){(0,M.Z)(n,t);var e=(0,I.Z)(n);function n(t){(0,u.Z)(this,n);var r,o=t.width,a=t.height,s=t.near,l=void 0===s?.1:s,c=t.far,h=void 0===c?1e3:c,f=t.zoom,p=void 0===f?0:f,d=t.target,A=void 0===d?[0,0,0]:d,v=t.padding,g=void 0===v?null:v,m=t.flipY,y=void 0===m||m,_=Array.isArray(p)?p[0]:p,b=Array.isArray(p)?p[1]:p,x=Math.min(_,b),w=Math.pow(2,x);if(_!==b){var C=Math.pow(2,_),B=Math.pow(2,b);r={unitsPerMeter:[C/w,B/w,1],metersPerUnit:[w/C,w/B,1]}}return e.call(this,(0,i.Z)((0,i.Z)({},t),{},{longitude:void 0,position:A,viewMatrix:Ht.clone().scale([w,w*(y?-1:1),w]),projectionMatrix:Jt({width:o||1,height:a||1,padding:g,near:l,far:h}),zoom:x,distanceScales:r}))}return(0,l.Z)(n,[{key:"projectFlat",value:function(t){var e=(0,r.Z)(t,2),n=e[0],i=e[1],o=this.distanceScales.unitsPerMeter;return[n*o[0],i*o[1]]}},{key:"unprojectFlat",value:function(t){var e=(0,r.Z)(t,2),n=e[0],i=e[1],o=this.distanceScales.metersPerUnit;return[n*o[0],i*o[1]]}},{key:"panByPosition",value:function(t,e){var n=(0,lt.CT)(e,this.pixelUnprojectionMatrix),r=this.projectFlat(t),i=Vt.IH([],r,Vt.tk([],n)),o=Vt.IH([],this.center,i);return{target:this.unprojectFlat(o)}}}]),n}(b.Z),Qt=n(64441),qt=function(t){(0,M.Z)(n,t);var e=(0,I.Z)(n);function n(t){var r;(0,u.Z)(this,n);var i=t.width,o=t.height,s=t.rotationX,l=void 0===s?0:s,c=t.rotationOrbit,h=void 0===c?0:c,f=t.target,p=void 0===f?[0,0,0]:f,d=t.zoom,A=void 0===d?0:d,v=t.minRotationX,g=void 0===v?-90:v,m=t.maxRotationX,y=void 0===m?90:m,_=t.minZoom,b=void 0===_?-1/0:_,x=t.maxZoom,w=void 0===x?1/0:x,C=t.startPanPosition,B=t.startRotatePos,k=t.startRotationX,E=t.startRotationOrbit,S=t.startZoomPosition,T=t.startZoom;return r=e.call(this,{width:i,height:o,rotationX:l,rotationOrbit:h,target:p,zoom:A,minRotationX:g,maxRotationX:y,minZoom:b,maxZoom:w},{startPanPosition:C,startRotatePos:B,startRotationX:k,startRotationOrbit:E,startZoomPosition:S,startZoom:T}),(0,a.Z)((0,U.Z)(r),"makeViewport",void 0),r.makeViewport=t.makeViewport,r}return(0,l.Z)(n,[{key:"panStart",value:function(t){var e=t.pos;return this._getUpdatedState({startPanPosition:this._unproject(e)})}},{key:"pan",value:function(t){var e=t.pos,n=t.startPosition,r=this.getState().startPanPosition||n;if(!r)return this;var i=this.makeViewport(this.getViewportProps()).panByPosition(r,e);return this._getUpdatedState(i)}},{key:"panEnd",value:function(){return this._getUpdatedState({startPanPosition:null})}},{key:"rotateStart",value:function(t){var e=t.pos;return this._getUpdatedState({startRotatePos:e,startRotationX:this.getViewportProps().rotationX,startRotationOrbit:this.getViewportProps().rotationOrbit})}},{key:"rotate",value:function(t){var e,n=t.pos,r=t.deltaAngleX,i=void 0===r?0:r,o=t.deltaAngleY,a=void 0===o?0:o,s=this.getState(),u=s.startRotatePos,l=s.startRotationX,c=s.startRotationOrbit,h=this.getViewportProps(),f=h.width,p=h.height;if(!u||void 0===l||void 0===c)return this;if(n){var d=(n[0]-u[0])/f;(l<-90||l>90)&&(d*=-1),e={rotationX:l+180*((n[1]-u[1])/p),rotationOrbit:c+180*d}}else e={rotationX:l+a,rotationOrbit:c+i};return this._getUpdatedState(e)}},{key:"rotateEnd",value:function(){return this._getUpdatedState({startRotationX:null,startRotationOrbit:null})}},{key:"shortestPathFrom",value:function(t){var e=t.getViewportProps(),n=(0,i.Z)({},this.getViewportProps()),r=n.rotationOrbit;return Math.abs(r-e.rotationOrbit)>180&&(n.rotationOrbit=r<0?r+360:r-360),n}},{key:"zoomStart",value:function(t){var e=t.pos;
2return this._getUpdatedState({startZoomPosition:this._unproject(e),startZoom:this.getViewportProps().zoom})}},{key:"zoom",value:function(t){var e=t.pos,n=t.startPos,r=t.scale,o=this.getState(),a=o.startZoom,s=o.startZoomPosition;if(s||(a=this.getViewportProps().zoom,s=this._unproject(n)||this._unproject(e)),!s)return this;var u=this._calculateNewZoom({scale:r,startZoom:a}),l=this.makeViewport((0,i.Z)((0,i.Z)({},this.getViewportProps()),{},{zoom:u}));return this._getUpdatedState((0,i.Z)({zoom:u},l.panByPosition(s,e)))}},{key:"zoomEnd",value:function(){return this._getUpdatedState({startZoomPosition:null,startZoom:null})}},{key:"zoomIn",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2;return this._getUpdatedState({zoom:this._calculateNewZoom({scale:t})})}},{key:"zoomOut",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2;return this._getUpdatedState({zoom:this._calculateNewZoom({scale:1/t})})}},{key:"moveLeft",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50;return this._panFromCenter([-t,0])}},{key:"moveRight",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50;return this._panFromCenter([t,0])}},{key:"moveUp",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50;return this._panFromCenter([0,-t])}},{key:"moveDown",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50;return this._panFromCenter([0,t])}},{key:"rotateLeft",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15;return this._getUpdatedState({rotationOrbit:this.getViewportProps().rotationOrbit-t})}},{key:"rotateRight",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15;return this._getUpdatedState({rotationOrbit:this.getViewportProps().rotationOrbit+t})}},{key:"rotateUp",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return this._getUpdatedState({rotationX:this.getViewportProps().rotationX-t})}},{key:"rotateDown",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return this._getUpdatedState({rotationX:this.getViewportProps().rotationX+t})}},{key:"_unproject",value:function(t){var e=this.makeViewport(this.getViewportProps());return t&&e.unproject(t)}},{key:"_calculateNewZoom",value:function(t){var e=t.scale,n=t.startZoom,r=this.getViewportProps(),i=r.maxZoom,o=r.minZoom;void 0===n&&(n=this.getViewportProps().zoom);var a=n+Math.log2(e);return(0,N.uZ)(a,o,i)}},{key:"_panFromCenter",value:function(t){var e=this.getViewportProps(),n=e.width,r=e.height,i=e.target;return this.pan({startPosition:i,pos:[n/2+t[0],r/2+t[1]]})}},{key:"_getUpdatedState",value:function(t){return new this.constructor((0,i.Z)((0,i.Z)((0,i.Z)({makeViewport:this.makeViewport},this.getViewportProps()),this.getState()),t))}},{key:"applyConstraints",value:function(t){var e=t.maxZoom,n=t.minZoom,r=t.zoom,i=t.maxRotationX,o=t.minRotationX,a=t.rotationOrbit;return t.zoom=Array.isArray(r)?[(0,N.uZ)(r[0],n,e),(0,N.uZ)(r[1],n,e)]:(0,N.uZ)(r,n,e),t.rotationX=(0,N.uZ)(t.rotationX,o,i),(a<-180||a>180)&&(t.rotationOrbit=(0,Qt.wQ)(a+180,360)-180),t}}]),n}(ut),Kt=function(t){(0,M.Z)(n,t);var e=(0,I.Z)(n);function n(t){var r;return(0,u.Z)(this,n),r=e.call(this,t),(0,a.Z)((0,U.Z)(r),"zoomAxis",void 0),r.zoomAxis=t.zoomAxis||"all",r}return(0,l.Z)(n,[{key:"_calculateNewZoom",value:function(t){var e=t.scale,n=t.startZoom,i=this.getViewportProps(),o=i.maxZoom,a=i.minZoom;void 0===n&&(n=this.getViewportProps().zoom);var s=Math.log2(e);if(Array.isArray(n)){var u=n,l=(0,r.Z)(u,2),c=l[0],h=l[1];switch(this.zoomAxis){case"X":c=(0,N.uZ)(c+s,a,o);break;case"Y":h=(0,N.uZ)(h+s,a,o);break;default:var f=Math.min(c+s,h+s);f<a&&(s+=a-f),(f=Math.max(c+s,h+s))>o&&(s+=o-f),c+=s,h+=s}return[c,h]}return(0,N.uZ)(n+s,a,o)}}]),n}(qt),Xt=function(t){(0,M.Z)(n,t);var e=(0,I.Z)(n);function n(){var t;(0,u.Z)(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),(0,a.Z)((0,U.Z)(t),"ControllerState",Kt),(0,a.Z)((0,U.Z)(t),"transition",{transitionDuration:300,transitionInterpolator:new X(["target","zoom"])}),(0,a.Z)((0,U.Z)(t),"dragMode","pan"),t}return(0,l.Z)(n,[{key:"_onPanRotate",value:function(){return!1}}]),n}(st),Yt=function(t){(0,M.Z)(n,t);var e=(0,I.Z)(n);function n(){return(0,u.Z)(this,n),e.apply(this,arguments)}return(0,l.Z)(n,[{key:"ViewportType",get:function(){return Wt}},{key:"ControllerType",get:function(){return Xt}}]),n}(O);
2(0,a.Z)(Yt,"displayName","OrthographicView");var $t=function(){function t(){(0,u.Z)(this,t),(0,a.Z)(this,"id","mask-effect"),(0,a.Z)(this,"props",null),(0,a.Z)(this,"useInPicking",!0),(0,a.Z)(this,"dummyMaskMap",void 0),(0,a.Z)(this,"channels",[]),(0,a.Z)(this,"masks",null),(0,a.Z)(this,"maskPass",void 0),(0,a.Z)(this,"maskMap",void 0),(0,a.Z)(this,"lastViewport",void 0)}return(0,l.Z)(t,[{key:"preRender",value:function(t,e){var n=e.layers,r=e.layerFilter,i=e.viewports,o=e.onViewportActive,a=e.views;this.dummyMaskMap||(this.dummyMaskMap=new pt.Z(t,{width:1,height:1}));var s=n.filter((function(t){return t.props.visible&&t.props.operation===Pt.k8.MASK}));if(0===s.length)return this.masks=null,void(this.channels.length=0);this.masks={},this.maskPass||(this.maskPass=new jt(t,{id:"default-mask"}),this.maskMap=this.maskPass.maskMap);var u=this._sortMaskChannels(s),l=i[0],c=!this.lastViewport||!this.lastViewport.equals(l);for(var h in u)this._renderChannel(u[h],{layerFilter:r,onViewportActive:o,views:a,viewport:l,viewportChanged:c})}},{key:"_renderChannel",value:function(t,e){var n=e.layerFilter,r=e.onViewportActive,i=e.views,o=e.viewport,a=e.viewportChanged,u=this.channels[t.index];if(u){var l=t===u||u.layers.length!==t.layers.length||t.layerBounds.some((function(t,e){return t!==u.layerBounds[e]}));if(t.bounds=u.bounds,t.maskBounds=u.maskBounds,this.channels[t.index]=t,(l||a)&&(this.lastViewport=o,t.bounds=function(t){var e,n=t.layers,r=t.viewport,i=null,o=(0,s.Z)(n);try{for(o.s();!(e=o.n()).done;){var a=e.value.getBounds();a&&(i?(i[0]=Math.min(i[0],a[0][0]),i[1]=Math.min(i[1],a[0][1]),i[2]=Math.max(i[2],a[1][0]),i[3]=Math.max(i[3],a[1][1])):i=[a[0][0],a[0][1],a[1][0],a[1][1]])}}catch(c){o.e(c)}finally{o.f()}var u=r.getBounds();if(!i)return u;var l=function(t){var e={x:t[2]-t[0],y:t[3]-t[1]},n={x:t[0]+.5*e.x,y:t[1]+.5*e.y};return[n.x-e.x,n.y-e.y,n.x+e.x,n.y+e.y]}(u);return i[2]-i[0]<l[2]-l[0]||i[3]-i[1]<l[3]-l[1]||(i[0]=Math.max(i[0],l[0]),i[1]=Math.max(i[1],l[1]),i[2]=Math.min(i[2],l[2]),i[3]=Math.min(i[3],l[3])),i}({layers:t.layers,viewport:o}),l||!(0,N.fS)(t.bounds,u.bounds))){var c=this.maskPass,h=this.maskMap,f=function(t){var e=t.bounds,n=t.viewport,r=t.width,i=t.height;if(e[2]<=e[0]||e[3]<=e[1])return null;if(r-=2,i-=2,n instanceof F.Z){var o=(0,lt.Xg)({width:r,height:i,bounds:[[e[0],e[1]],[e[2],e[3]]],maxZoom:20}),a=o.longitude,s=o.latitude,u=o.zoom;return new F.Z({longitude:a,latitude:s,zoom:u,x:1,y:1,width:r,height:i})}var l=[(e[0]+e[2])/2,(e[1]+e[3])/2,0],c=Math.min(20,r/(e[2]-e[0]),i/(e[3]-e[1]));return new Yt({x:1,y:1}).makeViewport({width:r,height:i,viewState:{target:l,zoom:Math.log2(c)}})}({bounds:t.bounds,viewport:o,width:h.width,height:h.height});t.maskBounds=f?f.getBounds():[0,0,1,1],c.render({pass:"mask",channel:t.index,layers:t.layers,layerFilter:n,viewports:f?[f]:[],onViewportActive:r,views:i,moduleParameters:{devicePixelRatio:1}})}this.masks[t.id]={index:t.index,bounds:t.maskBounds,coordinateOrigin:t.coordinateOrigin,coordinateSystem:t.coordinateSystem}}}},{key:"_sortMaskChannels",value:function(t){var e,n=this,r={},i=0,o=(0,s.Z)(t);try{var a=function(){var t=e.value,o=t.root.id,a=r[o];if(!a){if(++i>4)return d.Z.warn("Too many mask layers. The max supported is 4")(),"continue";a={id:o,index:n.channels.findIndex((function(t){return(null===t||void 0===t?void 0:t.id)===o})),layers:[],layerBounds:[],coordinateOrigin:t.root.props.coordinateOrigin,coordinateSystem:t.root.props.coordinateSystem},r[o]=a}a.layers.push(t),a.layerBounds.push(t.getBounds())};for(o.s();!(e=o.n()).done;)a()}catch(f){o.e(f)}finally{o.f()}for(var u=0;u<4;u++){var l=this.channels[u];l&&l.id in r||(this.channels[u]=null)}for(var c in r){var h=r[c];h.index<0&&(h.index=this.channels.findIndex((function(t){return!t})),this.channels[h.index]=h)}return r}},{key:"getModuleParameters",value:function(){return{maskMap:this.masks?this.maskMap:this.dummyMaskMap,maskChannels:this.masks}}},{key:"cleanup",value:function(){this.dummyMaskMap&&(this.dummyMaskMap.delete(),this.dummyMaskMap=void 0),this.maskPass&&(this.maskPass.delete(),this.maskPass=void 0,this.maskMap=void 0),this.lastViewport=void 0,this.masks=null,this.channels.length=0}}]),t}(),te=new Gt,ee=function(){function t(){(0,u.Z)(this,t),(0,a.Z)(this,"effects",void 0),(0,a.Z)(this,"_internalEffects",void 0),(0,a.Z)(this,"_needsRedraw",void 0),this.effects=[],this._internalEffects=[],this._needsRedraw="Initial render",this.setEffects()}return(0,l.Z)(t,[{key:"setProps",value:function(t){"effects"in t&&(t.effects.length===this.effects.length&&(0,S.v)(t.effects,this.effects)||(this.setEffects(t.effects),this._needsRedraw="effects changed"))}},{key:"needsRedraw",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},e=this._needsRedraw;return t.clearRedrawFlags&&(this._needsRedraw=!1),e}},{key:"getEffects",value:function(){return this._internalEffects}},{key:"finalize",value:function(){this.cleanup()}},{key:"setEffects",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.cleanup(),this.effects=t,this._internalEffects=t.slice(),this._internalEffects.push(new $t),t.some((function(t){return t instanceof Gt}))||this._internalEffects.push(te)}},{key:"cleanup",value:function(){var t,e=(0,s.Z)(this.effects);try{for(e.s();!(t=e.n()).done;){t.value.cleanup()}}catch(i){e.e(i)}finally{e.f()}var n,r=(0,s.Z)(this._internalEffects);try{for(r.s();!(n=r.n()).done;){n.value.cleanup()}}catch(i){r.e(i)}finally{r.f()}this.effects.length=0,this._internalEffects.length=0}}]),t}(),ne=function(t){(0,M.Z)(n,t);var e=(0,I.Z)(n);function n(){return(0,u.Z)(this,n),e.apply(this,arguments)}return(0,l.Z)(n,[{key:"shouldDrawLayer",value:function(t){return t.props.operation===Pt.k8.DRAW}}]),n}(kt),re={blendFunc:[1,0,32771,0],blendEquation:32774},ie=function(t){(0,M.Z)(n,t);var e=(0,I.Z)(n);function n(){var t;(0,u.Z)(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return t=e.call.apply(e,[this].concat(i)),(0,a.Z)((0,U.Z)(t),"pickZ",void 0),(0,a.Z)((0,U.Z)(t),"_colors",null),t}return(0,l.Z)(n,[{key:"render",value:function(t){return t.pickingFBO?this._drawPickingBuffer(t):(0,R.Z)((0,z.Z)(n.prototype),"render",this).call(this,t)}},{key:"_drawPickingBuffer",value:function(t){var e=this,r=t.layers,o=t.layerFilter,a=t.views,s=t.viewports,u=t.onViewportActive,l=t.pickingFBO,c=t.deviceRect,h=c.x,f=c.y,p=c.width,d=c.height,A=t.cullRect,v=t.effects,g=t.pass,m=void 0===g?"picking":g,y=t.pickZ,_=this.gl;this.pickZ=y;var b=y?null:{byLayer:new Map,byAlpha:[]};this._colors=b;var x=(0,Ct.s8)(_,(0,i.Z)((0,i.Z)({scissorTest:!0,scissor:[h,f,p,d],clearColor:[0,0,0,0],depthMask:!0,depthTest:!0,depthRange:[0,1],colorMask:[!0,!0,!0,!0]},re),{},{blend:!y}),(function(){return(0,R.Z)((0,z.Z)(n.prototype),"render",e).call(e,{target:l,layers:r,layerFilter:o,views:a,viewports:s,onViewportActive:u,cullRect:A,effects:null===v||void 0===v?void 0:v.filter((function(t){return t.useInPicking})),pass:m})}));return this._colors=null,{decodePickingColor:b&&oe.bind(null,b),stats:x}}},{key:"shouldDrawLayer",value:function(t){return t.props.pickable&&t.props.operation===Pt.k8.DRAW}},{key:"getModuleParameters",value:function(){return{pickingActive:1,pickingAttribute:this.pickZ,lightSources:{}}}},{key:"getLayerParameters",value:function(t,e,n){var r=(0,i.Z)({},t.props.parameters);return this._colors?(Object.assign(r,re),r.blend=!0,r.blendColor=function(t,e,n){var r,i=t.byLayer,o=t.byAlpha,a=i.get(e);a?(a.viewports.push(n),r=a.a):(r=i.size+1)<=255?(a={a:r,layer:e,viewports:[n]},i.set(e,a),o[r]=a):(d.Z.warn("Too many pickable layers, only picking the first 255")(),r=0);return[0,0,0,r/255]}(this._colors,t,n)):r.blend=!1,r}}]),n}(kt);function oe(t,e){var n=t.byAlpha[e[3]];return n&&{pickedLayer:n.layer,pickedViewports:n.viewports,pickedObjectIndex:n.layer.decodePickingColor(e)}}var ae=function(){function t(e){(0,u.Z)(this,t),this.gl=e,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new ne(e),this.pickLayersPass=new ie(e),this.renderCount=0,this._needsRedraw="Initial render",this.renderBuffers=[],this.lastPostProcessEffect=null}return(0,l.Z)(t,[{key:"setProps",value:function(t){"layerFilter"in t&&this.layerFilter!==t.layerFilter&&(this.layerFilter=t.layerFilter,this._needsRedraw="layerFilter changed"),"drawPickingColors"in t&&this.drawPickingColors!==t.drawPickingColors&&(this.drawPickingColors=t.drawPickingColors,this._needsRedraw="drawPickingColors changed")}},{key:"renderLayers",value:function(t){var e=this.drawPickingColors?this.pickLayersPass:this.drawLayersPass;t.layerFilter=t.layerFilter||this.layerFilter,t.effects=t.effects||[],t.target=t.target||Tt.Z.getDefaultFramebuffer(this.gl),this._preRender(t.effects,t);var n=this.lastPostProcessEffect?this.renderBuffers[0]:t.target,r=e.render((0,i.Z)((0,i.Z)({},t),{},{target:n}));this._postRender(t.effects,t),this.renderCount++,(0,A.Z)("deckRenderer.renderLayers",this,r,t)}},{key:"needsRedraw",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},e=this._needsRedraw;return t.clearRedrawFlags&&(this._needsRedraw=!1),e}},{key:"finalize",value:function(){var t,e=this.renderBuffers,n=(0,s.Z)(e);try{for(n.s();!(t=n.n()).done;){t.value.delete()}}catch(r){n.e(r)}finally{n.f()}e.length=0}},{key:"_preRender",value:function(t,e){var n,r=null,i=(0,s.Z)(t);try{for(i.s();!(n=i.n()).done;){var o=n.value;o.preRender(this.gl,e),o.postRender&&(r=o)}}catch(a){i.e(a)}finally{i.f()}r&&this._resizeRenderBuffers(),this.lastPostProcessEffect=r}},{key:"_resizeRenderBuffers",value:function(){var t=this.renderBuffers;0===t.length&&t.push(new Tt.Z(this.gl),new Tt.Z(this.gl));var e,n=(0,s.Z)(t);try{for(n.s();!(e=n.n()).done;){e.value.resize()}}catch(r){n.e(r)}finally{n.f()}}},{key:"_postRender",value:function(t,e){var n,r=this.renderBuffers,i={inputBuffer:r[0],swapBuffer:r[1],target:null},o=(0,s.Z)(t);try{for(o.s();!(n=o.n()).done;){var a=n.value;if(a.postRender){if(a===this.lastPostProcessEffect){i.target=e.target,a.postRender(this.gl,i);break}var u=a.postRender(this.gl,i);i.inputBuffer=u,i.swapBuffer=u===r[0]?r[1]:r[0]}}}catch(l){o.e(l)}finally{o.f()}}}]),t}(),se=n(56474),ue={pickedColor:null,pickedObjectIndex:-1};function le(t){for(var e=t.pickedColors,n=t.decodePickingColor,r=t.deviceX,o=t.deviceY,a=t.deviceRadius,s=t.deviceRect,u=s.x,l=s.y,c=s.width,h=s.height,f=a*a,p=-1,A=0,v=0;v<h;v++){var g=v+l-o,m=g*g;if(m>f)A+=4*c;else for(var y=0;y<c;y++){if(e[A+3]-1>=0){var _=y+u-r,b=_*_+m;b<=f&&(f=b,p=A)}A+=4}}if(p>=0){var x=e.slice(p,p+4),w=n(x);if(w){var C=Math.floor(p/4/c),B=p/4-C*c;return(0,i.Z)((0,i.Z)({},w),{},{pickedColor:x,pickedX:u+B,pickedY:l+C})}d.Z.error("Picked non-existent layer. Is picking buffer corrupt?")()}return ue}function ce(t){var e,n=t.pickInfo,r=t.viewports,i=t.pixelRatio,o=t.x,a=t.y,s=t.z,u=r[0];if(r.length>1&&(u=function(t,e){for(var n=t.length-1;n>=0;n--){var r=t[n];if(r.containsPixel(e))return r}return t[0]}((null===n||void 0===n?void 0:n.pickedViewports)||r,{x:o,y:a})),u){var l=[o-u.x,a-u.y];void 0!==s&&(l[2]=s),e=u.unproject(l)}return{color:null,layer:null,viewport:u,index:-1,picked:!1,x:o,y:a,pixel:[o,a],coordinate:e,devicePixel:n&&"pickedX"in n?[n.pickedX,n.pickedY]:void 0,pixelRatio:i}}function he(t){var e=t.pickInfo,n=t.lastPickedInfo,r=t.mode,o=t.layers,a=e.pickedColor,s=e.pickedLayer,u=e.pickedObjectIndex,l=s?[s]:[];if("hover"===r){var c=n.index,h=n.layerId,f=s?s.props.id:null;if(f!==h||u!==c){if(f!==h){var p=o.find((function(t){return t.props.id===h}));p&&l.unshift(p)}n.layerId=f,n.index=u,n.info=null}}var d=ce(t),A=new Map;
2return A.set(null,d),l.forEach((function(t){var e=(0,i.Z)({},d);t===s&&(e.color=a,e.index=u,e.picked=!0);var o=(e=fe({layer:t,info:e,mode:r})).layer;t===s&&"hover"===r&&(n.info=e),A.set(o.id,e),"hover"===r&&o.updateAutoHighlight(e)})),A}function fe(t){for(var e=t.layer,n=t.info,r=t.mode;e&&n;){var i=n.layer||null;n.sourceLayer=i,n.layer=e,n=e.getPickingInfo({info:n,mode:r,sourceLayer:i}),e=e.parent}return n}var pe=function(){function t(e){(0,u.Z)(this,t),(0,a.Z)(this,"gl",void 0),(0,a.Z)(this,"pickingFBO",void 0),(0,a.Z)(this,"depthFBO",void 0),(0,a.Z)(this,"pickLayersPass",void 0),(0,a.Z)(this,"layerFilter",void 0),(0,a.Z)(this,"lastPickedInfo",void 0),(0,a.Z)(this,"_pickable",!0),this.gl=e,this.pickLayersPass=new ie(e),this.lastPickedInfo={index:-1,layerId:null,info:null}}return(0,l.Z)(t,[{key:"setProps",value:function(t){"layerFilter"in t&&(this.layerFilter=t.layerFilter),"_pickable"in t&&(this._pickable=t._pickable)}},{key:"finalize",value:function(){this.pickingFBO&&this.pickingFBO.delete(),this.depthFBO&&(this.depthFBO.color.delete(),this.depthFBO.delete())}}
2,{key:"pickObject",value:function(t){return this._pickClosestObject(t)}},{key:"pickObjects",value:function(t){return this._pickVisibleObjects(t)}},{key:"getLastPickedObject",value:function(t){var e=t.x,n=t.y,r=t.layers,o=t.viewports,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.lastPickedInfo.info,s=a&&a.layer&&a.layer.id,u=a&&a.viewport&&a.viewport.id,l=s?r.find((function(t){return t.id===s})):null,c=u&&o.find((function(t){return t.id===u}))||o[0],h=c&&c.unproject([e-c.x,n-c.y]),f={x:e,y:n,viewport:c,coordinate:h,layer:l};return(0,i.Z)((0,i.Z)({},a),f)}},{key:"_resizeBuffer",value:function(){var t,e,n=this.gl;if(!this.pickingFBO&&(this.pickingFBO=new Tt.Z(n),Tt.Z.isSupported(n,{colorBufferFloat:!0}))){var r=new Tt.Z(n);r.attach((0,a.Z)({},36064,new pt.Z(n,{format:(0,Ct.D0)(n)?34836:6408,type:5126}))),this.depthFBO=r}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})}},{key:"_getPickable",value:function(t){if(!1===this._pickable)return null;var e=t.filter((function(t){return t.isPickable()&&!t.isComposite}));return e.length?e:null}},{key:"_pickClosestObject",value:function(t){var e=t.layers,n=t.views,r=t.viewports,o=t.x,a=t.y,u=t.radius,l=void 0===u?0:u,c=t.depth,h=void 0===c?1:c,f=t.mode,p=void 0===f?"query":f,d=t.unproject3D,A=t.onViewportActive,v=t.effects,g=this._getPickable(e),m=(0,Ct.w)(this.gl);if(!g)return{result:[],emptyInfo:ce({viewports:r,x:o,y:a,pixelRatio:m})};this._resizeBuffer();for(var y,_=(0,Ct.JY)(this.gl,[o,a],!0),b=[_.x+Math.floor(_.width/2),_.y+Math.floor(_.height/2)],x=Math.round(l*m),w=this.pickingFBO,C=w.width,B=w.height,k=this._getPickingRect({deviceX:b[0],deviceY:b[1],deviceRadius:x,deviceWidth:C,deviceHeight:B}),E={x:o-l,y:a-l,width:2*l+1,height:2*l+1},S=[],T=new Set,M=0;M<h;M++){var I=void 0;if(k){var P=this._drawAndSample({layers:g,views:n,viewports:r,onViewportActive:A,deviceRect:k,cullRect:E,effects:v,pass:"picking:".concat(p)});I=le((0,i.Z)((0,i.Z)({},P),{},{deviceX:b[0],deviceY:b[1],deviceRadius:x,deviceRect:k}))}else I={pickedColor:null,pickedObjectIndex:-1};var Z=void 0;if(I.pickedLayer&&d&&this.depthFBO)Z=this._drawAndSample({layers:[I.pickedLayer],views:n,viewports:r,onViewportActive:A,deviceRect:{x:I.pickedX,y:I.pickedY,width:1,height:1},cullRect:E,effects:v,pass:"picking:".concat(p,":z")},!0).pickedColors[0];I.pickedLayer&&M+1<h&&(T.add(I.pickedLayer),I.pickedLayer.disablePickingIndex(I.pickedObjectIndex)),y=he({pickInfo:I,lastPickedInfo:this.lastPickedInfo,mode:p,layers:g,viewports:r,x:o,y:a,z:Z,pixelRatio:m});var D,L=(0,s.Z)(y.values());try{for(L.s();!(D=L.n()).done;){var O=D.value;O.layer&&S.push(O)}}catch(z){L.e(z)}finally{L.f()}if(!I.pickedColor)break}var F,R=(0,s.Z)(T);try{for(R.s();!(F=R.n()).done;){F.value.restorePickingColors()}}catch(z){R.e(z)}finally{R.f()}return{result:S,emptyInfo:y.get(null)}}},{key:"_pickVisibleObjects",value:function(t){var e=t.layers,n=t.views,r=t.viewports,o=t.x,a=t.y,s=t.width,u=void 0===s?1:s,l=t.height,c=void 0===l?1:l,h=t.mode,f=void 0===h?"query":h,p=t.maxObjects,A=void 0===p?null:p,v=t.onViewportActive,g=t.effects,m=this._getPickable(e);if(!m)return[];this._resizeBuffer();for(var y=(0,Ct.w)(this.gl),_=(0,Ct.JY)(this.gl,[o,a],!0),b=_.x,x=_.y+_.height,w=(0,Ct.JY)(this.gl,[o+u,a+c],!0),C=w.x+w.width,B=w.y,k={x:b,y:B,width:C-b,height:x-B},E=function(t){var e=t.pickedColors,n=t.decodePickingColor,r=new Map;if(e)for(var o=0;o<e.length;o+=4)if(e[o+3]-1>=0){var a=e.slice(o,o+4),s=a.join(",");if(!r.has(s)){var u=n(a);u?r.set(s,(0,i.Z)((0,i.Z)({},u),{},{color:a})):d.Z.error("Picked non-existent layer. Is picking buffer corrupt?")()}}return Array.from(r.values())}(this._drawAndSample({layers:m,views:n,viewports:r,onViewportActive:v,deviceRect:k,cullRect:{x:o,y:a,width:u,height:c},effects:g,pass:"picking:".concat(f)})),S=new Map,T=Number.isFinite(A),M=0;M<E.length&&!(T&&A&&S.size>=A);M++){var I=E[M],P={color:I.pickedColor,layer:null,index:I.pickedObjectIndex,picked:!0,x:o,y:a,pixelRatio:y};P=fe({layer:I.pickedLayer,info:P,mode:f}),S.has(P.object)||S.set(P.object,P)}return Array.from(S.values())}},{key:"_drawAndSample",value:function(t){var e=t.layers,n=t.views,r=t.viewports,i=t.onViewportActive,o=t.deviceRect,a=t.cullRect,s=t.effects,u=t.pass,l=arguments.length>1&&void 0!==arguments[1]&&arguments[1],c=l?this.depthFBO:this.pickingFBO,h=this.pickLayersPass.render({layers:e,layerFilter:this.layerFilter,views:n,viewports:r,onViewportActive:i,pickingFBO:c,deviceRect:o,cullRect:a,effects:s,pass:u,pickZ:l}).decodePickingColor,f=o.x,p=o.y,d=o.width,A=o.height,v=new(l?Float32Array:Uint8Array)(d*A*4);return(0,se.z6)(c,{sourceX:f,sourceY:p,sourceWidth:d,sourceHeight:A,target:v}),{pickedColors:v,decodePickingColor:h}}},{key:"_getPickingRect",value:function(t){var e=t.deviceX,n=t.deviceY,r=t.deviceRadius,i=t.deviceWidth,o=t.deviceHeight,a=Math.max(0,e-r),s=Math.max(0,n-r),u=Math.min(i,e+r+1)-a,l=Math.min(o,n+r+1)-s;return u<=0||l<=0?null:{x:a,y:s,width:u,height:l}}}]),t}(),de={zIndex:"1",position:"absolute",pointerEvents:"none",color:"#a0a7b4",backgroundColor:"#29323c",padding:"10px",top:"0",left:"0",display:"none"},Ae=function(){function t(e){(0,u.Z)(this,t),(0,a.Z)(this,"el",null),(0,a.Z)(this,"isVisible",!1);var n=e.parentElement;n&&(this.el=document.createElement("div"),this.el.className="deck-tooltip",Object.assign(this.el.style,de),n.appendChild(this.el))}return(0,l.Z)(t,[{key:"setTooltip",value:function(t,e,n){var r=this.el;if(r){if("string"===typeof t)r.innerText=t;else{if(!t)return this.isVisible=!1,void(r.style.display="none");t.text&&(r.innerText=t.text),t.html&&(r.innerHTML=t.html),t.className&&(r.className=t.className),Object.assign(r.style,t.style)}
2this.isVisible=!0,r.style.display="block",r.style.transform="translate(".concat(e,"px, ").concat(n,"px)")}}},{key:"remove",value:function(){this.el&&(this.el.remove(),this.el=null)}}]),t}(),ve=n(28321),ge=n(19754),me=n(21440);var ye={id:"JSON",name:"JSON",module:"",version:"",options:{},extensions:["json","geojson"],mimeTypes:["application/json","application/geo+json"],testText:function(t){var e=t[0],n=t[t.length-1];return"{"===e&&"}"===n||"["===e&&"]"===n},parseTextSync:JSON.parse},_e="8.8.23",be=globalThis.deck&&globalThis.deck.VERSION;if(be&&be!==_e)throw new Error("deck.gl - multiple versions detected: ".concat(be," vs ").concat(_e));be||(d.Z.log(1,"deck.gl ".concat(_e))(),globalThis.deck=(0,i.Z)((0,i.Z)({},globalThis.deck),{},{VERSION:_e,version:_e,log:d.Z,_registerLoggers:A.z}),(0,ge.fh)([ye,[me.S,{imagebitmap:{premultiplyAlpha:"none"}}]]));var xe=globalThis.deck,we=n(93594),Ce=n(11092),Be=n(27791),ke=n(48546),Ee=n(81301),Se=n(35572),Te=n(12308),Me=n(70353),Ie=function(t,e){(0,M.Z)(r,t);var n=(0,I.Z)(r);function r(t){var e;(0,u.Z)(this,r);var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(e=n.call(this,t,i)).target=null,e._queryPending=!1,e._pollingPromise=null,Object.seal((0,U.Z)(e)),e}return(0,l.Z)(r,[{key:e,get:function(){return"Query"}},{key:"beginTimeElapsedQuery",value:function(){return this.begin(35007)}},{key:"beginOcclusionQuery",value:function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).conservative,e=void 0!==t&&t;return this.begin(e?36202:35887)}},{key:"beginTransformFeedbackQuery",value:function(){return this.begin(35976)}},{key:"begin",value:function(t){return this._queryPending||(this.target=t,this.gl2.beginQuery(this.target,this.handle)),this}},{key:"end",value:function(){return this._queryPending||this.target&&(this.gl2.endQuery(this.target),this.target=null,this._queryPending=!0),this}},{key:"isResultAvailable",value:function(){if(!this._queryPending)return!1;var t=this.gl2.getQueryParameter(this.handle,34919);return t&&(this._queryPending=!1),t}},{key:"isTimerDisjoint",value:function(){return this.gl2.getParameter(36795)}},{key:"getResult",value:function(){return this.gl2.getQueryParameter(this.handle,34918)}},{key:"getTimerMilliseconds",value:function(){return this.getResult()/1e6}},{key:"createPoll",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Number.POSITIVE_INFINITY;if(this._pollingPromise)return this._pollingPromise;var n=0;return this._pollingPromise=new Promise((function(r,i){requestAnimationFrame((function o(){t.isResultAvailable()?(r(t.getResult()),t._pollingPromise=null):n++>e?(i("Timed out"),t._pollingPromise=null):requestAnimationFrame(o)}))})),this._pollingPromise}},{key:"_createHandle",value:function(){return r.isSupported(this.gl)?this.gl2.createQuery():null}},{key:"_deleteHandle",value:function(){this.gl2.deleteQuery(this.handle)}}],[{key:"isSupported",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=(0,Ct.D0)(t),i=(0,Te.ag)(t,Me.h.TIMER_QUERY),o=r||i,a=(0,s.Z)(n);try{for(a.s();!(e=a.n()).done;){switch(e.value){case"queries":o=o&&r;break;case"timers":o=o&&i;break;default:(0,Ee.h)(!1)}}}catch(u){a.e(u)}finally{a.f()}return o}}]),r}(Se.Z,Symbol.toStringTag);var Pe=(0,n(11515).Z)()&&"undefined"!==typeof document,Ze=0,De=function(){function t(){(0,u.Z)(this,t);var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.onCreateContext,r=void 0===n?function(t){return(0,Ct.s9)(t)}:n,i=e.onAddHTML,o=void 0===i?null:i,a=e.onInitialize,s=void 0===a?function(){}:a,l=e.onRender,c=void 0===l?function(){}:l,h=e.onFinalize,f=void 0===h?function(){}:h,p=e.onError,d=e.gl,A=void 0===d?null:d,v=e.glOptions,g=void 0===v?{}:v,m=e.debug,y=void 0!==m&&m,_=e.createFramebuffer,b=void 0!==_&&_,x=e.autoResizeViewport,w=void 0===x||x,C=e.autoResizeDrawingBuffer,B=void 0===C||C,k=e.stats,E=void 0===k?ke.lR.get("animation-loop-".concat(Ze++)):k,S=e.useDevicePixels,T=void 0===S||S;"useDevicePixelRatio"in e&&(Ct.cM.deprecated("useDevicePixelRatio","useDevicePixels")(),T=e.useDevicePixelRatio),this.props={onCreateContext:r,onAddHTML:o,onInitialize:s,onRender:c,onFinalize:f,onError:p,gl:A,glOptions:g,debug:y,createFramebuffer:b},this.gl=A,this.needsRedraw=null,this.timeline=null,this.stats=E,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:w,autoResizeDrawingBuffer:B,useDevicePixels:T}),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)}return(0,l.Z)(t,[{key:"delete",value:function(){this.stop(),this._setDisplay(null)}},{key:"setNeedsRedraw",value:function(t){return(0,Ee.h)("string"===typeof t),this.needsRedraw=this.needsRedraw||t,this}},{key:"setProps",value:function(t){return"autoResizeViewport"in t&&(this.autoResizeViewport=t.autoResizeViewport),"autoResizeDrawingBuffer"in t&&(this.autoResizeDrawingBuffer=t.autoResizeDrawingBuffer),"useDevicePixels"in t&&(this.useDevicePixels=t.useDevicePixels),this}},{key:"start",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this._running)return this;this._running=!0;var n=this._getPageLoadPromise().then((function(){return!t._running||t._initialized?null:(t._createWebGLContext(e),t._createFramebuffer(),t._startEventHandling(),t._initializeCallbackData(),t._updateCallbackData(),t._resizeCanvasDrawingBuffer(),t._resizeViewport(),t._gpuTimeQuery=Ie.isSupported(t.gl,["timers"])?new Ie(t.gl):null,t._initialized=!0,t.onInitialize(t.animationProps))})).then((function(e){t._running&&(t._addCallbackData(e||{}),!1!==e&&t._startLoop())}));return this.props.onError&&n.catch(this.props.onError),this}},{key:"redraw",value:function(){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}},{key:"stop",value:function(){return this._running&&(this._finalizeCallbackData(),this._cancelAnimationFrame(this._animationFrameId),this._nextFramePromise=null,this._resolveNextFrame=null,this._animationFrameId=null,this._running=!1),this}},{key:"attachTimeline",value:function(t){return this.timeline=t,this.timeline}},{key:"detachTimeline",value:function(){this.timeline=null}},{key:"waitForRender",value:function(){var t=this;return this.setNeedsRedraw("waitForRender"),this._nextFramePromise||(this._nextFramePromise=new Promise((function(e){t._resolveNextFrame=e}))),this._nextFramePromise}},{key:"toDataURL",value:function(){var t=(0,Be.Z)((0,Ce.Z)().mark((function t(){return(0,Ce.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.setNeedsRedraw("toDataURL"),t.next=3,this.waitForRender();case 3:return t.abrupt("return",this.gl.canvas.toDataURL());case 4:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}()},{key:"isContextLost",value:function(){return this.gl.isContextLost()}},{key:"onCreateContext",value:function(){var t;return(t=this.props).onCreateContext.apply(t,arguments)}},{key:"onInitialize",value:function(){var t;return(t=this.props).onInitialize.apply(t,arguments)}},{key:"onRender",value:function(){var t;return(t=this.props).onRender.apply(t,arguments)}},{key:"onFinalize",value:function(){var t;return(t=this.props).onFinalize.apply(t,arguments)}},{key:"getHTMLControlValue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=document.getElementById(t);return n?Number(n.value):e}}
2,{key:"setViewParameters",value:function(){return Ct.cM.removed("AnimationLoop.setViewParameters","AnimationLoop.setProps")(),this}},{key:"_startLoop",value:function(){var t=this;this._cancelAnimationFrame(this._animationFrameId),this._animationFrameId=this._requestAnimationFrame((function e(){t._running&&(t.redraw(),t._animationFrameId=t._requestAnimationFrame(e))}))}},{key:"_getPageLoadPromise",value:function(){return this._pageLoadPromise||(this._pageLoadPromise=Pe?new Promise((function(t,e){Pe&&"complete"===document.readyState?t(document):window.addEventListener("load",(function(){t(document)}))})):Promise.resolve({})),this._pageLoadPromise}},{key:"_setDisplay",value:function(t){this.display&&(this.display.delete(),this.display.animationLoop=null),t&&(t.animationLoop=this),this.display=t}},{key:"_cancelAnimationFrame",value:function(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}},{key:"_requestAnimationFrame",value:function(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}},{key:"_renderFrame",value:function(){var t;this.display?(t=this.display)._renderFrame.apply(t,arguments):this.onRender.apply(this,arguments)}},{key:"_clearNeedsRedraw",value:function(){this.needsRedraw=null}},{key:"_setupFrame",value:function(){this._resizeCanvasDrawingBuffer(),this._resizeViewport(),this._resizeFramebuffer()}},{key:"_initializeCallbackData",value:function(){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}}},{key:"_updateCallbackData",value:function(){var t=this._getSizeAndAspect(),e=t.width,n=t.height,r=t.aspect;e===this.animationProps.width&&n===this.animationProps.height||this.setNeedsRedraw("drawing buffer resized"),r!==this.animationProps.aspect&&this.setNeedsRedraw("drawing buffer aspect changed"),this.animationProps.width=e,this.animationProps.height=n,this.animationProps.aspect=r,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}},{key:"_finalizeCallbackData",value:function(){this.onFinalize(this.animationProps)}},{key:"_addCallbackData",value:function(t){"object"===typeof t&&null!==t&&(this.animationProps=Object.assign({},this.animationProps,t))}},{key:"_createWebGLContext",value:function(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,Ct.yW)(this.props.gl,t):this.onCreateContext(t),!(0,Ct.UF)(this.gl))throw new Error("AnimationLoop.onCreateContext - illegal context returned");(0,Ct.kL)(this.gl),this._createInfoDiv()}},{key:"_createInfoDiv",value:function(){if(this.gl.canvas&&this.props.onAddHTML){var t=document.createElement("div");document.body.appendChild(t),t.style.position="relative";var 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);var n=this.props.onAddHTML(e);n&&(e.innerHTML=n)}}},{key:"_getSizeAndAspect",value:function(){var t=this.gl.drawingBufferWidth,e=this.gl.drawingBufferHeight,n=1,r=this.gl.canvas;return r&&r.clientHeight?n=r.clientWidth/r.clientHeight:t>0&&e>0&&(n=t/e),{width:t,height:e,aspect:n}}},{key:"_resizeViewport",value:function(){this.autoResizeViewport&&this.gl.viewport(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight)}},{key:"_resizeCanvasDrawingBuffer",value:function(){this.autoResizeDrawingBuffer&&(0,Ct.aQ)(this.gl,{useDevicePixels:this.useDevicePixels})}},{key:"_createFramebuffer",value:function(){this.props.createFramebuffer&&(this.framebuffer=new Tt.Z(this.gl))}},{key:"_resizeFramebuffer",value:function(){this.framebuffer&&this.framebuffer.resize({width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight})}},{key:"_beginTimers",value:function(){this.frameRate.timeEnd(),this.frameRate.timeStart(),this._gpuTimeQuery&&this._gpuTimeQuery.isResultAvailable()&&!this._gpuTimeQuery.isTimerDisjoint(
2)&&this.stats.get("GPU Time").addTime(this._gpuTimeQuery.getTimerMilliseconds()),this._gpuTimeQuery&&this._gpuTimeQuery.beginTimeElapsedQuery(),this.cpuTime.timeStart()}},{key:"_endTimers",value:function(){this.cpuTime.timeEnd(),this._gpuTimeQuery&&this._gpuTimeQuery.end()}},{key:"_startEventHandling",value:function(){var t=this.gl.canvas;t&&(t.addEventListener("mousemove",this._onMousemove),t.addEventListener("mouseleave",this._onMouseleave))}},{key:"_onMousemove",value:function(t){this.animationProps._mousePosition=[t.offsetX,t.offsetY]}},{key:"_onMouseleave",value:function(t){this.animationProps._mousePosition=null}}]),t}(),Le=n(48331);function Oe(){}var Fe={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:Oe,onResize:Oe,onViewStateChange:Oe,onInteractionStateChange:Oe,onBeforeRender:Oe,onAfterRender:Oe,onLoad:Oe,onError:function(t){return d.Z.error(t.message)()},onHover:null,onClick:null,onDragStart:null,onDrag:null,onDragEnd:null,_onMetrics:null,getCursor:function(t){return t.isDragging?"grabbing":"grab"},getTooltip:null,debug:!1,drawPickingColors:!1},Re=function(){function t(e){var n=this;(0,u.Z)(this,t),(0,a.Z)(this,"props",void 0),(0,a.Z)(this,"width",0),(0,a.Z)(this,"height",0),(0,a.Z)(this,"userData",{}),(0,a.Z)(this,"canvas",null),(0,a.Z)(this,"viewManager",null),(0,a.Z)(this,"layerManager",null),(0,a.Z)(this,"effectManager",null),(0,a.Z)(this,"deckRenderer",null),(0,a.Z)(this,"deckPicker",null),(0,a.Z)(this,"eventManager",null),(0,a.Z)(this,"tooltip",null),(0,a.Z)(this,"metrics",void 0),(0,a.Z)(this,"animationLoop",void 0),(0,a.Z)(this,"stats",void 0),(0,a.Z)(this,"viewState",void 0),(0,a.Z)(this,"cursorState",void 0),(0,a.Z)(this,"_needsRedraw",void 0),(0,a.Z)(this,"_pickRequest",void 0),(0,a.Z)(this,"_lastPointerDownInfo",null),(0,a.Z)(this,"_metricsCounter",void 0),(0,a.Z)(this,"_onPointerMove",(function(t){var e=n._pickRequest;if("pointerleave"===t.type)e.x=-1,e.y=-1,e.radius=0;else{if(t.leftButton||t.rightButton)return;var r=t.offsetCenter;if(!r)return;e.x=r.x,e.y=r.y,e.radius=n.props.pickingRadius}n.layerManager&&(n.layerManager.context.mousePosition={x:e.x,y:e.y}),e.event=t})),(0,a.Z)(this,"_onEvent",(function(t){var e=Pt.FP[t.type],r=t.offsetCenter;if(e&&r&&n.layerManager){var i=n.layerManager.getLayers(),o=n.deckPicker.getLastPickedObject({x:r.x,y:r.y,layers:i,viewports:n.getViewports(r)},n._lastPointerDownInfo),a=o.layer,s=a&&(a[e.handler]||a.props[e.handler]),u=n.props[e.handler],l=!1;s&&(l=s.call(a,o,t)),!l&&u&&u(o,t)}})),(0,a.Z)(this,"_onPointerDown",(function(t){var e=t.offsetCenter,r=n._pick("pickObject","pickObject Time",{x:e.x,y:e.y,radius:n.props.pickingRadius});n._lastPointerDownInfo=r.result[0]||r.emptyInfo})),this.props=(0,i.Z)((0,i.Z)({},Fe),e),e=this.props,this._needsRedraw="Initial render",this._pickRequest={mode:"hover",x:-1,y:-1,radius:0,event:null},this.cursorState={isHovering:!1,isDragging:!1},e.viewState&&e.initialViewState&&d.Z.warn("View state tracking is disabled. Use either `initialViewState` for auto update or `viewState` for manual update.")(),"IE"===(0,we.Z)()&&d.Z.warn("IE 11 is not supported")(),this.viewState=e.initialViewState,e.gl||"undefined"!==typeof document&&(this.canvas=this._createCanvas(e)),this.animationLoop=this._createAnimationLoop(e),this.stats=new g.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(e),e._typedArrayManagerProps&&ve.Z.setOptions(e._typedArrayManagerProps),this.animationLoop.start()}return(0,l.Z)(t,[{key:"finalize",value:function(){var t,e,n,r,i,o,a,s;(this.animationLoop.stop(),this.animationLoop=null,this._lastPointerDownInfo=null,null===(t=this.layerManager)||void 0===t||t.finalize(),this.layerManager=null,null===(e=this.viewManager)||void 0===e||e.finalize(),this.viewManager=null,null===(n=this.effectManager)||void 0===n||n.finalize(),this.effectManager=null,null===(r=this.deckRenderer)||void 0===r||r.finalize(),this.deckRenderer=null,null===(i=this.deckPicker)||void 0===i||i.finalize(),this.deckPicker=null,null===(o=this.eventManager)||void 0===o||o.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===(s=this.canvas.parentElement)||void 0===s||s.removeChild(this.canvas),this.canvas=null)}},{key:"setProps",value:function(t){this.stats.get("setProps Time").timeStart(),"onLayerHover"in t&&d.Z.removed("onLayerHover","onHover")(),"onLayerClick"in t&&d.Z.removed("onLayerClick","onClick")(),t.initialViewState&&!(0,S.v)(this.props.initialViewState,t.initialViewState)&&(this.viewState=t.initialViewState),Object.assign(this.props,t),this._setCanvasSize(this.props);var 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()}},{key:"needsRedraw",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};if(!this.layerManager)return!1;if(this.props._animate)return"Deck._animate";var e=this._needsRedraw;t.clearRedrawFlags&&(this._needsRedraw=!1);var n=this.viewManager.needsRedraw(t),r=this.layerManager.needsRedraw(t),i=this.effectManager.needsRedraw(t),o=this.deckRenderer.needsRedraw(t);return e=e||n||r||i||o}},{key:"redraw",value:function(t){if(this.layerManager){var e=this.needsRedraw({clearRedrawFlags:!0});(e=t||e)&&(this.stats.get("Redraw Count").incrementCount(),this.props._customRender?this.props._customRender(e):this._drawLayers(e))}}},{key:"isInitialized",get:function(){return null!==this.viewManager}},{key:"getViews",value:function(){return(0,L.Z)(this.viewManager),this.viewManager.views}},{key:"getViewports",value:function(t){return(0,L.Z)(this.viewManager),this.viewManager.getViewports(t)}},{key:"pickObject",value:function(t){var e=this._pick("pickObject","pickObject Time",t).result;return e.length?e[0]:null}},{key:"pickMultipleObjects",value:function(t){return t.depth=t.depth||10,this._pick("pickObject","pickMultipleObjects Time",t).result}},{key:"pickObjects",value:function(t){return this._pick("pickObjects","pickObjects Time",t)}},{key:"_addResources",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];for(var n in t)this.layerManager.resourceManager.add({resourceId:n,data:t[n],force
2Update:e})}},{key:"_removeResources",value:function(t){var e,n=(0,s.Z)(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;this.layerManager.resourceManager.remove(r)}}catch(i){n.e(i)}finally{n.f()}}},{key:"_pick",value:function(t,e,n){(0,L.Z)(this.deckPicker);var r=this.stats;r.get("Pick Count").incrementCount(),r.get(e).timeStart();var o=this.deckPicker[t]((0,i.Z)({layers:this.layerManager.getLayers(n),views:this.viewManager.getViews(),viewports:this.getViewports(n),onViewportActive:this.layerManager.activateViewport,effects:this.effectManager.getEffects()},n));return r.get(e).timeEnd(),o}},{key:"_createCanvas",value:function(t){var e=t.canvas;("string"===typeof e&&(e=document.getElementById(e),(0,L.Z)(e)),e)||((e=document.createElement("canvas")).id=t.id||"deckgl-overlay",(t.parent||document.body).appendChild(e));return Object.assign(e.style,t.style),e}},{key:"_setCanvasSize",value:function(t){if(this.canvas){var e=t.width,n=t.height;if(e||0===e){var r=Number.isFinite(e)?"".concat(e,"px"):e;this.canvas.style.width=r}if(n||0===n){var i,o=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=o}}}},{key:"_updateCanvasSize",value:function(){var t=this.canvas;if(t){var e,n=t.clientWidth||t.width,r=t.clientHeight||t.height;if(n!==this.width||r!==this.height)this.width=n,this.height=r,null===(e=this.viewManager)||void 0===e||e.setProps({width:n,height:r}),this.props.onResize({width:n,height:r})}}},{key:"_createAnimationLoop",value:function(t){var e=this,n=t.width,r=t.height,o=t.gl,a=t.glOptions,s=t.debug,u=t.onError,l=t.onBeforeRender,c=t.onAfterRender,h=t.useDevicePixels;return new De({width:n,height:r,useDevicePixels:h,autoResizeViewport:!1,gl:o,onCreateContext:function(t){return(0,Ct.s9)((0,i.Z)((0,i.Z)((0,i.Z)({},a),t),{},{canvas:e.canvas,debug:s,onContextLost:function(){return e._onContextLost()}}))},onInitialize:function(t){return e._setGLContext(t.gl)},onRender:this._onRenderFrame.bind(this),onBeforeRender:l,onAfterRender:c,onError:u})}},{key:"_getViewState",value:function(){return this.props.viewState||this.viewState}},{key:"_getViews",value:function(){var t=this.props.views||[new ft({id:"default-view"})];return(t=Array.isArray(t)?t:[t]).length&&this.props.controller&&(t[0].props.controller=this.props.controller),t}},{key:"_onContextLost",value:function(){var t=this.props.onError;this.animationLoop&&t&&t(new Error("WebGL context is lost"))}},{key:"_pickAndCallback",value:function(){var t=this._pickRequest;if(t.event){var e=this._pick("pickObject","pickObject Time",t),n=e.result,r=e.emptyInfo;this.cursorState.isHovering=n.length>0;var i,o=r,a=!1,u=(0,s.Z)(n);try{for(u.s();!(i=u.n()).done;){var l,c=i.value;o=c,a=(null===(l=c.layer)||void 0===l?void 0:l.onHover(c,t.event))||a}}catch(f){u.e(f)}finally{u.f()}if(!a&&this.props.onHover&&this.props.onHover(o,t.event),this.props.getTooltip&&this.tooltip){var h=this.props.getTooltip(o);this.tooltip.setTooltip(h,o.x,o.y)}t.event=null}}},{key:"_updateCursor",value:function(){var t=this.props.parent||this.canvas;t&&(t.style.cursor=this.props.getCursor(this.cursorState))}},{key:"_setGLContext",value:function(t){if(!this.layerManager){this.canvas||(this.canvas=t.canvas,(0,Ct.yW)(t,{enable:!0,copyState:!0})),this.tooltip=new Ae(this.canvas),(0,Ct.dR)(t,{blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onWebGLInitialized(t);var e=new f;for(var n in e.play(),this.animationLoop.attachTimeline(e),this.eventManager=new Le.Q(this.props.parent||t.canvas,{touchAction:this.props.touchAction,recognizerOptions:this.props.eventRecognizerOptions,events:{pointerdown:this._onPointerDown,pointermove:this._onPointerMove,pointerleave:this._onPointerMove}}),Pt.FP)this.eventManager.on(n,this._onEvent);this.viewManager=new T({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});var r=this.viewManager.getViewports()[0];this.layerManager=new E(t,{deck:this,stats:this.stats,viewport:r,timeline:e}),this.effectManager=new ee,this.deckRenderer=new ae(t),this.deckPicker=new pe(t),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}}},{key:"_drawLayers",value:function(t,e){var n=this.layerManager.context.gl;(0,Ct.dR)(n,this.props.parameters),this.props.onBeforeRender({gl:n}),this.deckRenderer.renderLayers((0,i.Z)({target:this.props._framebuffer,layers:this.layerManager.getLayers(),viewports:this.viewManager.getViewports(),onViewportActive:this.layerManager.activateViewport,views:this.viewManager.getViews(),pass:"screen",redrawReason:t,effects:this.effectManager.getEffects()},e)),this.props.onAfterRender({gl:n})}},{key:"_onRenderFrame",value:function(t){this._getFrameStats(),this._metricsCounter++%60===0&&(this._getMetrics(),this.stats.reset(),d.Z.table(4,this.metrics)(),this.props._onMetrics&&this.props._onMetrics(this.metrics)),this._updateCanvasSize(),this._updateCursor(
2),this.tooltip.isVisible&&this.viewManager.needsRedraw()&&this.tooltip.setTooltip(null),this.layerManager.updateLayers(),this._pickAndCallback(),this.redraw(),this.viewManager&&this.viewManager.updateViewStates()}},{key:"_onViewStateChange",value:function(t){var e=this.props.onViewStateChange(t)||t.viewState;this.viewState&&(this.viewState=(0,i.Z)((0,i.Z)({},this.viewState),{},(0,a.Z)({},t.viewId,e)),this.props.viewState||this.viewManager&&this.viewManager.setProps({viewState:this.viewState}))}},{key:"_onInteractionStateChange",value:function(t){this.cursorState.isDragging=t.isDragging||!1,this.props.onInteractionStateChange(t)}},{key:"_getFrameStats",value:function(){var t=this.stats;t.get("frameRate").timeEnd(),t.get("frameRate").timeStart();var e=this.animationLoop.stats;t.get("GPU Time").addTime(e.get("GPU Time").lastTiming),t.get("CPU Time").addTime(e.get("CPU Time").lastTiming)}},{key:"_getMetrics",value:function(){var t=this.metrics,e=this.stats;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();var n=ke.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}}]),t}();(0,a.Z)(Re,"defaultProps",Fe),(0,a.Z)(Re,"VERSION",xe.VERSION);var ze="undefined"!==typeof window?o.useLayoutEffect:o.useEffect;function Ue(t,e){for(;t;){if(t===e)return!0;t=Object.getPrototypeOf(t)}return!1}var Ne=n(90031),Ge={position:"absolute",zIndex:-1};function je(t,e){if("function"===typeof t)return t(e);if(Array.isArray(t))return t.map((function(t){return je(t,e)}));if(Ve(t)){if(function(t){var e=t.type,n=e&&e.defaultProps;return n&&n.mapStyle}(t))return e.style=Ge,(0,o.cloneElement)(t,e);if(function(t){var e=t.type;return e&&e.deckGLViewProps}(t))return(0,o.cloneElement)(t,e)}return t}function Ve(t){return t&&"object"===typeof t&&"type"in t||!1}function He(t){if("function"===typeof t)return(0,o.createElement)(O,{},t);if(Array.isArray(t))return t.map(He);if(Ve(t)){if(t.type===o.Fragment)return He(t.props.children);if(Ue(t.type,O))return t}return t}var Je={mixBlendMode:null};function We(t){t.redrawReason&&(t.deck._drawLayers(t.redrawReason),t.redrawReason=null)}var Qe=(0,o.forwardRef)((function(t,e){var n=(0,o.useState)(0),a=(0,r.Z)(n,2),u=a[0],l=a[1],c=(0,o.useRef)({control:null,version:u,forceUpdate:function(){return l((function(t){return t+1}))}}).current,h=(0,o.useRef)(null),f=(0,o.useRef)(null),p=(0,o.useMemo)((function(){return function(t){var e=t.children,n=t.layers,r=void 0===n?[]:n,i=t.views,a=void 0===i?null:i,s=[],u=[],l={};return o.Children.forEach(He(e),(function(t){if(Ve(t)){var e=t.type;if(Ue(e,Ne.Z)){var n=function(t,e){var n={},r=t.defaultProps||{};for(var i in e)r[i]!==e[i]&&(n[i]=e[i]);return new t(n)}(e,t.props);u.push(n)}else s.push(t);if(Ue(e,O)&&e!==O&&t.props.id){var r=new e(t.props);l[r.id]=r}}else t&&s.push(t)})),Object.keys(l).length>0&&(Array.isArray(a)?a.forEach((function(t){l[t.id]=t})):a&&(l[a.id]=a),a=Object.values(l)),{layers:r=u.length>0?[].concat(u,(0,It.Z)(r)):r,children:s,views:a}}(t)}),[t.layers,t.views,t.children]),d=!0,A=function(e){var n;return d&&t.viewState?(c.viewStateUpdateRequested=e,null):(c.viewStateUpdateRequested=null,null===(n=t.onViewStateChange)||void 0===n?void 0:n.call(t,e))},v=function(e){var n;d?c.interactionStateUpdateRequested=e:(c.interactionStateUpdateRequested=null,null===(n=t.onInteractionStateChange)||void 0===n||n.call(t,e))},g=(0,o.useMemo)((function(){var e=(0,i.Z)((0,i.Z)({},t),{},{style:null,width:"100%",height:"100%",parent:h.current,canvas:f.current,layers:p.layers,views:p.views,onViewStateChange:A,onInteractionStateChange:v});return delete e._customRender,c.deck&&c.deck.setProps(e),e}),[t]);(0,o.useEffect)((function(){var e=t.Deck||Re;return c.deck=function(t,e,n){var r=new e((0,i.Z)((0,i.Z)({},n),{},{_customRender:function(e){t.redrawReason=e;var n=r.getViewports();t.lastRenderedViewports!==n?t.forceUpdate():We(t)}
2}));return r}(c,e,(0,i.Z)((0,i.Z)({},g),{},{parent:h.current,canvas:f.current})),function(){var t;return null===(t=c.deck)||void 0===t?void 0:t.finalize()}}),[]),ze((function(){We(c);var t=c.viewStateUpdateRequested,e=c.interactionStateUpdateRequested;t&&A(t),e&&v(e)})),(0,o.useImperativeHandle)(e,(function(){return function(t){return{get deck(){return t.deck},pickObject:function(e){return t.deck.pickObject(e)},pickMultipleObjects:function(e){return t.deck.pickMultipleObjects(e)},pickObjects:function(e){return t.deck.pickObjects(e)}}}(c)}),[]);var m=c.deck&&c.deck.isInitialized?c.deck.getViewports():void 0,y=t.ContextProvider,_=t.width,b=t.height,x=t.id,w=t.style,C=(0,o.useMemo)((function(){return function(t){var e=t.width,n=t.height,r=t.style,i={position:"absolute",zIndex:0,left:0,top:0,width:e,height:n},o={left:0,top:0};if(r)for(var a in r)a in Je?o[a]=r[a]:i[a]=r[a];return{containerStyle:i,canvasStyle:o}}({width:_,height:b,style:w})}),[_,b,w]),B=C.containerStyle,k=C.canvasStyle;if(!c.viewStateUpdateRequested&&c.lastRenderedViewports===m||c.version!==u){c.lastRenderedViewports=m,c.version=u;var E=function(t){var e=t.children,n=t.deck,r=t.ContextProvider,i=(n||{}).viewManager;if(!i||!i.views.length)return[];var a,u={},l=i.views[0].id,c=(0,s.Z)(e);try{for(c.s();!(a=c.n()).done;){var h=a.value,f=l,p=h;Ve(h)&&Ue(h.type,O)&&(f=h.props.id||l,p=h.props.children);var d=i.getViewport(f),A=i.getViewState(f);d&&(A.padding=d.padding,p=je(p,{x:d.x,y:d.y,width:d.width,height:d.height,viewport:d,viewState:A}),u[f]||(u[f]={viewport:d,children:[]}),u[f].children.push(p))}}catch(v){c.e(v)}finally{c.f()}return Object.keys(u).map((function(t){var e=u[t],i=e.viewport,a=e.children,s={position:"absolute",left:i.x,top:i.y,width:i.width,height:i.height},l="view-".concat(t),c=o.createElement.apply(void 0,["div",{key:l,id:l,style:s}].concat((0,It.Z)(a)));if(r){var h={viewport:i,container:n.canvas.offsetParent,eventManager:n.eventManager,onViewStateChange:function(e){e.viewId=t,n._onViewStateChange(e)}};return(0,o.createElement)(r,{key:l,value:h},c)}return c}))}({children:p.children,deck:c.deck,ContextProvider:y}),S=(0,o.createElement)("canvas",{key:"canvas",id:x||"deckgl-overlay",ref:f,style:k});c.control=(0,o.createElement)("div",{id:"".concat(x||"deckgl","-wrapper"),ref:h,style:B},[S,E])}return d=!1,c.control}));Qe.defaultProps=Re.defaultProps;var qe=Qe},78788:function(t,e,n){"use strict";n.d(e,{D0:function(){return u},Ew:function(){return l},Kn:function(){return o},Lj:function(){return c},Os:function(){return f},Ss:function(){return a},TW:function(){return s},zH:function(){return h}});var r=function(t){return"boolean"===typeof t},i=function(t){return"function"===typeof t},o=function(t){return null!==t&&"object"===typeof t},a=function(t){return o(t)&&t.constructor==={}.constructor},s=function(t){return t&&"function"===typeof t[Symbol.iterator]},u=function(t){return t&&"function"===typeof t[Symbol.asyncIterator]},l=function(t){return"undefined"!==typeof Response&&t instanceof Response||t&&t.arrayBuffer&&t.text&&t.json},c=function(t){return"undefined"!==typeof Blob&&t instanceof Blob},h=function(t){return t&&"object"===typeof t&&t.isBuffer},f=function(t){return function(t){return"undefined"!==typeof ReadableStream&&t instanceof ReadableStream||o(t)&&i(t.tee)&&i(t.cancel)&&i(t.getReader)}(t)||function(t){return o(t)&&i(t.read)&&i(t.pipe)&&r(t.readable)}(t)}},3685:function(t,e,n){"use strict";n.d(e,{z:function(){return Tt}});var r=n(11092),i=n(27791),o=n(78788),a=n(35669),s=n(74168),u=n(73599),l="3.2.13";function c(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:l;(0,u.h)(t,"no worker provided");var n=t.version;return!(!e||!n)}var h=n(89596),f=n(60726),p=n(50189),d=n(22951),A=n(91976),v=n(64649),g=(0,A.Z)((function t(){(0,d.Z)(this,t)})),m=new Map;function y(t){(0,u.h)(t.source&&!t.url||!t.source&&t.url);var e=m.get(t.source||t.url);return e||(t.url&&(e=function(t){if(!t.startsWith("http"))return t;return _((e=t,"try {\n  importScripts('".concat(e,"');\n} catch (error) {\n  console.error(error);\n  throw error;\n}")));var e}(t.url),m.set(t.url,e)),t.source&&(e=_(t.source),m.set(t.source,e))),(0,u.h)(e),e}function _(t){var e=new Blob([t],{type:"application/javascript"});return URL.createObjectURL(e)}function b(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0,r=n||new Set;if(t){if(x(t))r.add(t);else if(x(t.buffer))r.add(t.buffer);else if(ArrayBuffer.isView(t));else if(e&&"object"===typeof t)for(var i in t)b(t[i],e,r)}else;return void 0===n?Array.from(r):[]}function x(t){return!!t&&(t instanceof ArrayBuffer||("undefined"!==typeof MessagePort&&t instanceof MessagePort||("undefined"!==typeof ImageBitmap&&t instanceof ImageBitmap||"undefined"!==typeof OffscreenCanvas&&t instanceof OffscreenCanvas)))}var w=function(){},C=function(){function t(e){(0,d.Z)(this,t),(0,v.Z)(this,"name",void 0),(0,v.Z)(this,"source",void 0),(0,v.Z)(this,"url",void 0),(0,v.Z)(this,"terminated",!1),(0,v.Z)(this,"worker",void 0),(0,v.Z)(this,"onMessage",void 0),(0,v.Z)(this,"onError",void 0),(0,v.Z)(this,"_loadableURL","");var n=e.name,r=e.source,i=e.url;(0,u.h)(r||i),this.name=n,this.source=r,this.url=i,this.onMessage=w,this.onError=function(t){return console.log(t)},this.worker=h.jU?this._createBrowserWorker():this._createNodeWorker()}return(0,A.Z)(t,[{key:"destroy",value:function(){this.onMessage=w,this.onError=w,this.worker.terminate(),this.terminated=!0}},{key:"isRunning",get:function(){return Boolean(this.onMessage)}},{key:"postMessage",value:function(t,e){e=e||b(t),this.worker.postMessage(t,e)}},{key:"_getErrorFromErrorEvent",value:function(t){var 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)}},{key:"_createBrowserWorker",value:function(){var t=this;this._loadableURL=y({source:this.source,url:this.url});var e=new Worker(this._loadableURL,{name:this.name});return e.onmessage=function(e){e.data?t.onMessage(e.data):t.onError(new Error("No data received"))},e.onerror=function(e){t.onError(t._getErrorFromErrorEvent(e)),t.terminated=!0},e.onmessageerror=function(t){return console.error(t)},e}},{key:"_createNodeWorker",value:function(){var t,e=this;if(this.url){var n=this.url.includes(":/")||this.url.startsWith("/")?this.url:"./".concat(this.url);t=new g(n,{eval:!1})}else{if(!this.source)throw new Error("no worker");t=new g(this.source,{eval:!0})}return t.on("message",(function(t){e.onMessage(t)})),t.on("error",(function(t){e.onError(t)})),t.on("exit",(function(t){})),t}}],[{key:"isSupported",value:function(){return"undefined"!==typeof Worker&&h.jU||"undefined"!==typeof g&&!h.jU}}]),t}(),B=function(){function t(e,n){var r=this;(0,d.Z)(this,t),(0,v.Z)(this,"name",void 0),(0,v.Z)(this,"workerThread",void 0),(0,v.Z)(this,"isRunning",!0),(0,v.Z)(this,"result",void 0),(0,v.Z)(this,"_resolve",(function(){})),(0,v.Z)(this,"_reject",(function(){})),this.name=e,this.workerThread=n,this.result=new Promise((function(t,e){r._resolve=t,r._reject=e}))}return(0,A.Z)(t,[{key:"postMessage",value:function(t,e){this.workerThread.postMessage({source:"loaders.gl",type:t,payload:e})}},{key:"done",value:function(t){(0,u.h)(this.isRunning),this.isRunning=!1,this._resolve(t)}},{key:"error",value:function(t){(0,u.h)(this.isRunning),this.isRunning=!1,this._reject(t)}}]),t}(),k=function(){function t(e){(0,d.Z)(this,t),(0,v.Z)(this,"name","unnamed"),(0,v.Z)(this,"source",void 0),(0,v.Z)(this,"url",void 0),(0,v.Z)(this,"maxConcurrency",1),(0,v.Z)(this,"maxMobileConcurrency",1),(0,v.Z)(this,"onDebug",(function(){})),(0,v.Z)(this,"reuseWorkers",!0),(0,v.Z)(this,"props",{}),(0,v.Z)(this,"jobQueue",[]),(0,v.Z)(this,"idleQueue",[]),(0,v.Z)(this,"count",0),(0,v.Z)(this,"isDestroyed",!1),this.source=e.source,this.url=e.url,this.setProps(e)}return(0,A.Z)(t,[{key:"destroy",value:function(){this.idleQueue.forEach((function(t){return t.destroy()})),this.isDestroyed=!0}},{key:"setProps",value:function(t){this.props=(0,p.Z)((0,p.Z)({},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)}},{key:"startJob",value:function(){var t=(0,i.Z)((0,r.Z)().mark((function t(e){var n,i,o,a=this,s=arguments;return(0,r.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=s.length>1&&void 0!==s[1]?s[1]:function(t,e,n){return t.done(n)},i=s.length>2&&void 0!==s[2]?s[2]:function(t,e){return t.error(e)},o=new Promise((function(t){return a.jobQueue.push({name:e,onMessage:n,onError:i,onStart:t}),a})),this._startQueuedJob(),t.next=6,o;case 6:return t.abrupt("return",t.sent);case 7:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"_startQueuedJob",value:function(){var t=(0,i.Z)((0,r.Z)().mark((function t(){var e,n,i;return(0,r.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.jobQueue.length){t.next=2;break}return t.abrupt("return");case 2:if(e=this._getAvailableWorker()){t.next=5;break}return t.abrupt("return");case 5:if(!(n=this.jobQueue.shift())){t.next=18;break}return this.onDebug({message:"Starting job",name:n.name,workerThread:e,backlog:this.jobQueue.length}),i=new B(n.name,e),e.onMessage=function(t){return n.onMessage(i,t.type,t.payload)},e.onError=function(t){return n.onError(i,t)},n.onStart(i),t.prev=12,t.next=15,i.result;
2case 15:return t.prev=15,this.returnWorkerToQueue(e),t.finish(15);case 18:case"end":return t.stop()}}),t,this,[[12,,15,18]])})));return function(){return t.apply(this,arguments)}}()},{key:"returnWorkerToQueue",value:function(t){this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(t.destroy(),this.count--):this.idleQueue.push(t),this.isDestroyed||this._startQueuedJob()}},{key:"_getAvailableWorker",value:function(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count<this._getMaxConcurrency()){this.count++;var t="".concat(this.name.toLowerCase()," (#").concat(this.count," of ").concat(this.maxConcurrency,")");return new C({name:t,source:this.source,url:this.url})}return null}},{key:"_getMaxConcurrency",value:function(){return h.tq?this.maxMobileConcurrency:this.maxConcurrency}}],[{key:"isSupported",value:function(){return C.isSupported()}}]),t}(),E={maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:function(){}},S=function(){function t(e){(0,d.Z)(this,t),(0,v.Z)(this,"props",void 0),(0,v.Z)(this,"workerPools",new Map),this.props=(0,p.Z)({},E),this.setProps(e),this.workerPools=new Map}return(0,A.Z)(t,[{key:"destroy",value:function(){var t,e=(0,f.Z)(this.workerPools.values());try{for(e.s();!(t=e.n()).done;){t.value.destroy()}}catch(n){e.e(n)}finally{e.f()}this.workerPools=new Map}},{key:"setProps",value:function(t){this.props=(0,p.Z)((0,p.Z)({},this.props),t);var e,n=(0,f.Z)(this.workerPools.values());try{for(n.s();!(e=n.n()).done;){e.value.setProps(this._getWorkerPoolProps())}}catch(r){n.e(r)}finally{n.f()}}},{key:"getWorkerPool",value:function(t){var e=t.name,n=t.source,r=t.url,i=this.workerPools.get(e);return i||((i=new k({name:e,source:n,url:r})).setProps(this._getWorkerPoolProps()),this.workerPools.set(e,i)),i}},{key:"_getWorkerPoolProps",value:function(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}}],[{key:"isSupported",value:function(){return C.isSupported()}},{key:"getWorkerFarm",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t._workerFarm=t._workerFarm||new t({}),t._workerFarm.setProps(e),t._workerFarm}}]),t}();(0,v.Z)(S,"_workerFarm",void 0);var T="latest";function M(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e[t.id]||{},r="".concat(t.id,"-worker.js"),i=n.workerUrl;if(i||"compression"!==t.id||(i=e.workerUrl),"test"===e._workerType&&(i="modules/".concat(t.module,"/dist/").concat(r)),!i){var o=t.version;"latest"===o&&(o=T);var a=o?"@".concat(o):"";i="https://unpkg.com/@loaders.gl/".concat(t.module).concat(a,"/dist/").concat(r)}return(0,u.h)(i),i}function I(t,e){return!!S.isSupported()&&(!!(h.jU||null!==e&&void 0!==e&&e._nodeWorkers)&&(t.worker&&(null===e||void 0===e?void 0:e.worker)))}function P(t,e,n,r,i){return Z.apply(this,arguments)}function Z(){return(Z=(0,i.Z)((0,r.Z)().mark((function t(e,n,i,o,a){var s,u,l,c,h,f;return(0,r.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s=e.id,u=M(e,i),l=S.getWorkerFarm(i),c=l.getWorkerPool({name:s,url:u}),i=JSON.parse(JSON.stringify(i)),o=JSON.parse(JSON.stringify(o||{})),t.next=8,c.startJob("process-on-worker",D.bind(null,a));case 8:return(h=t.sent).postMessage("process",{input:n,options:i,context:o}),t.next=12,h.result;case 12:return f=t.sent,t.next=15,f.result;case 15:return t.abrupt("return",t.sent);case 16:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function D(t,e,n,r){return L.apply(this,arguments)}function L(){return(L=(0,i.Z)((0,r.Z)().mark((function t(e,n,i,o){var a,s,u,l,c;return(0,r.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:t.t0=i,t.next="done"===t.t0?3:"error"===t.t0?5:"process"===t.t0?7:20;break;case 3:return n.done(o),t.abrupt("break",21);case 5:return n.error(new Error(o.error)),t.abrupt("break",21);case 7:return a=o.id,s=o.input,u=o.options,t.prev=8,t.next=11,e(s,u);case 11:l=t.sent,n.postMessage("done",{id:a,result:l}),t.next=19;break;case 15:t.prev=15,t.t1=t.catch(8),c=t.t1 instanceof Error?t.t1.message:"unknown error",n.postMessage("error",{id:a,error:c});case 19:return t.abrupt("break",21);
2case 20:console.warn("parse-with-worker unknown message ".concat(i));case 21:case"end":return t.stop()}}),t,null,[[8,15]])})))).apply(this,arguments)}var O=n(187);n(72709);function F(t){return t&&"object"===typeof t&&t.isBuffer}function R(t){if(F(t))return F(e=t)?new Uint8Array(e.buffer,e.byteOffset,e.length).slice().buffer:e;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){var n=t;return(new TextEncoder).encode(n).buffer}if(t&&"object"===typeof t&&t._toArrayBuffer)return t._toArrayBuffer();throw new Error("toArrayBuffer")}function z(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r,i=e.map((function(t){return t instanceof ArrayBuffer?new Uint8Array(t):t})),o=i.reduce((function(t,e){return t+e.byteLength}),0),a=new Uint8Array(o),s=0,u=(0,f.Z)(i);try{for(u.s();!(r=u.n()).done;){var l=r.value;a.set(l,s),s+=l.byteLength}}catch(c){u.e(c)}finally{u.f()}return a.buffer}function U(t){return N.apply(this,arguments)}function N(){return(N=(0,i.Z)((0,r.Z)().mark((function t(e){var n,i,o,a,s,u,l;return(0,r.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=[],i=!1,o=!1,t.prev=3,s=(0,O.Z)(e);case 5:return t.next=7,s.next();case 7:if(!(i=!(u=t.sent).done)){t.next=13;break}l=u.value,n.push(l);case 10:i=!1,t.next=5;break;case 13:t.next=19;break;case 15:t.prev=15,t.t0=t.catch(3),o=!0,a=t.t0;case 19:if(t.prev=19,t.prev=20,!i||null==s.return){t.next=24;break}return t.next=24,s.return();case 24:if(t.prev=24,!o){t.next=27;break}throw a;case 27:return t.finish(24);case 28:return t.finish(19);case 29:return t.abrupt("return",z.apply(void 0,n));case 30:case"end":return t.stop()}}),t,null,[[3,15,19,29],[20,,24,28]])})))).apply(this,arguments)}var G=(0,r.Z)().mark(V),j=262144;function V(t,e){var n,i,o,a,s;return(0,r.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:n=(null===e||void 0===e?void 0:e.chunkSize)||j,i=0,o=new TextEncoder;case 3:if(!(i<t.length)){r.next=11;break}return a=Math.min(t.length-i,n),s=t.slice(i,i+a),i+=a,r.next=9,o.encode(s);case 9:r.next=3;break;case 11:case"end":return r.stop()}}),G)}var H=262144;function J(t,e){this.v=t,this.k=e}function W(t){return new J(t,0)}function Q(t){var e,n;function r(e,n){try{var o=t[e](n),a=o.value,s=a instanceof J;Promise.resolve(s?a.v:a).then((function(n){if(s){var u="return"===e?"return":"next";if(!a.k||n.done)return r(u,n);n=t[u](n).value}i(o.done?"return":"normal",n)}),(function(t){r("throw",t)}))}catch(u){i("throw",u)}}function i(t,i){switch(t){case"return":e.resolve({value:i,done:!0});break;case"throw":e.reject(i);break;default:e.resolve({value:i,done:!1})}(e=e.next)?r(e.key,e.arg):n=null}this._invoke=function(t,i){return new Promise((function(o,a){var s={key:t,arg:i,resolve:o,reject:a,next:null};n?n=n.next=s:(e=n=s,r(t,i))}))},"function"!=typeof t.return&&(this.return=void 0)}function q(t){return function(){return new Q(t.apply(this,arguments))}}Q.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},Q.prototype.next=function(t){return this._invoke("next",t)},Q.prototype.throw=function(t){return this._invoke("throw",t)},Q.prototype.return=function(t){return this._invoke("return",t)};var K=1048576;function X(){return(X=q((0,r.Z)().mark((function t(e,n){var i,o,a,s;return(0,r.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=(null===n||void 0===n?void 0:n.chunkSize)||K,o=0;case 2:if(!(o<e.size)){t.next=12;break}return a=o+i,t.next=6,W(e.slice(o,a).arrayBuffer());case 6:return s=t.sent,o=a,t.next=10,s;case 10:t.next=2;break;case 12:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var Y=n(27759);function $(t,e){return Y.jU?function(t,e){return tt.apply(this,arguments)}(t,e):function(t,e){return et.apply(this,arguments)}(t,e)}function tt(){return(tt=q((0,r.Z)().mark((function t(e,n){var i,o,a,s,u,l;return(0,r.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=e.getReader(),t.prev=1;case 2:return a=o||i.read(),null!==n&&void 0!==n&&n._streamReadAhead&&(o=i.read()),t.next=7,W(a);case 7:if(s=t.sent,u=s.done,l=s.value,!u){t.next=12;break}return t.abrupt("return");case 12:return t.next=14,R(l);case 14:t.next=2;break;case 16:t.next=21;break;case 18:t.prev=18,t.t0=t.catch(1),i.releaseLock();case 21:case"end":return t.stop()}}
2),t,null,[[1,18]])})))).apply(this,arguments)}function et(){return(et=q((0,r.Z)().mark((function t(e,n){var i,o,a,s,u,l;return(0,r.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=!1,o=!1,t.prev=2,s=(0,O.Z)(e);case 4:return t.next=6,W(s.next());case 6:if(!(i=!(u=t.sent).done)){t.next=13;break}return l=u.value,t.next=10,R(l);case 10:i=!1,t.next=4;break;case 13:t.next=19;break;case 15:t.prev=15,t.t0=t.catch(2),o=!0,a=t.t0;case 19:if(t.prev=19,t.prev=20,!i||null==s.return){t.next=24;break}return t.next=24,W(s.return());case 24:if(t.prev=24,!o){t.next=27;break}throw a;case 27:return t.finish(24);case 28:return t.finish(19);case 29:case"end":return t.stop()}}),t,null,[[2,15,19,29],[20,,24,28]])})))).apply(this,arguments)}function nt(t,e){if("string"===typeof t)return V(t,e);if(t instanceof ArrayBuffer)return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,r.Z)().mark((function n(){var i,o,a,s,u,l;return(0,r.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:i=e.chunkSize,o=void 0===i?H:i,a=0;case 2:if(!(a<t.byteLength)){n.next=13;break}return s=Math.min(t.byteLength-a,o),u=new ArrayBuffer(s),l=new Uint8Array(t,a,s),new Uint8Array(u).set(l),a+=s,n.next=11,u;case 11:n.next=2;break;case 13:case"end":return n.stop()}}),n)}))()}(t,e);if((0,o.Lj)(t))return function(t,e){return X.apply(this,arguments)}(t,e);if((0,o.Os)(t))return $(t,e);if((0,o.Ew)(t))return $(t.body,e);throw new Error("makeIterator")}var rt=n(73309),it="Cannot convert supplied data type";function ot(t,e,n){if(e.text&&"string"===typeof t)return t;if((0,o.zH)(t)&&(t=t.buffer),t instanceof ArrayBuffer){var r=t;return e.text&&!e.binary?new TextDecoder("utf8").decode(r):r}if(ArrayBuffer.isView(t)){if(e.text&&!e.binary)return new TextDecoder("utf8").decode(t);var i=t.buffer,a=t.byteLength||t.length;return 0===t.byteOffset&&a===i.byteLength||(i=i.slice(t.byteOffset,t.byteOffset+a)),i}throw new Error(it)}function at(t,e,n){return st.apply(this,arguments)}function st(){return(st=(0,i.Z)((0,r.Z)().mark((function t(e,n,i){var a,s;return(0,r.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=e instanceof ArrayBuffer||ArrayBuffer.isView(e),"string"!==typeof e&&!a){t.next=3;break}return t.abrupt("return",ot(e,n));case 3:if(!(0,o.Lj)(e)){t.next=7;break}return t.next=6,(0,rt.L1)(e);case 6:e=t.sent;case 7:if(!(0,o.Ew)(e)){t.next=21;break}return s=e,t.next=11,(0,rt.mm)(s);case 11:if(!n.binary){t.next=17;break}return t.next=14,s.arrayBuffer();case 14:t.t0=t.sent,t.next=20;break;case 17:return t.next=19,s.text();case 19:t.t0=t.sent;case 20:return t.abrupt("return",t.t0);case 21:if((0,o.Os)(e)&&(e=nt(e,i)),!(0,o.TW)(e)&&!(0,o.D0)(e)){t.next=24;break}return t.abrupt("return",U(e));case 24:throw new Error(it);case 25:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var ut=n(649);function lt(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(n)return n;var r=(0,p.Z)({fetch:(0,s.bV)(e,t)},t);return Array.isArray(r.loaders)||(r.loaders=null),r}function ct(t,e){if(!e&&t&&!Array.isArray(t))return t;var n;if(t&&(n=Array.isArray(t)?t:[t]),e&&e.loaders){var r=Array.isArray(e.loaders)?e.loaders:[e.loaders];n=n?[].concat((0,ut.Z)(n),(0,ut.Z)(r)):r}return n&&n.length?n:null}var ht=n(44037);var ft=new(n(87294).Z)({id:"loaders.gl"}),pt=n(19754),dt=/\.([^.]+)$/;function At(t){return vt.apply(this,arguments)}function vt(){return vt=(0,i.Z)((0,r.Z)().mark((function t(e){var n,i,a,s,u=arguments;return(0,r.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=u.length>1&&void 0!==u[1]?u[1]:[],i=u.length>2?u[2]:void 0,a=u.length>3?u[3]:void 0,mt(e)){t.next=5;break}return t.abrupt("return",null);case 5:if(!(s=gt(e,n,(0,p.Z)((0,p.Z)({},i),{},{nothrow:!0}),a))){t.next=8;break}return t.abrupt("return",s);case 8:if(!(0,o.Lj)(e)){t.next=13;break}return t.next=11,e.slice(0,10).arrayBuffer();case 11:e=t.sent,s=gt(e,n,i,a);case 13:if(s||null!==i&&void 0!==i&&i.nothrow){t.next=15;break}throw new Error(yt(e));case 15:return t.abrupt("return",s);case 16:case"end":return t.stop()}}),t)}))),vt.apply(this,arguments)}function gt(t){var 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(!mt(t))return null;if(e&&!Array.isArray(e))return(0,a.T)(e);var i,o=[];(e&&(o=o.concat(e)),null!==n&&void 0!==n&&n.ignoreRegisteredLoaders)||(i=o).push.apply(i,(0,ut.Z)((0,pt.kO)()));!function(t){var e,n=(0,f.Z)(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;(0,a.T)(r)}}catch(i){n.e(i)}finally{n.f()}}(o);var s=function(t,e,n,r){var i,o=(0,ht.l)(t),a=o.url,s=o.type,u=a||(null===r||void 0===r?void 0:r.url),l=null,c="";null!==n&&void 0!==n&&n.mimeType&&(l=_t(e,null===n||void 0===n?void 0:n.mimeType),c="match forced by supplied MIME type ".concat(null===n||void 0===n?void 0:n.mimeType));l=l||function(t,e){var n=e&&dt.exec(e),r=n&&n[1];return r?function(t,e){e=e.toLowerCase();var n,r=(0,f.Z)(t);try{for(r.s();!(n=r.n()).done;){var i,o=n.value,a=(0,f.Z)(o.extensions);try{for(a.s();!(i=a.n()).done;){if(i.value.toLowerCase()===e)return o}}catch(s){a.e(s)}finally{a.f()}}}catch(s){r.e(s)}finally{r.f()}return null}(t,r):null}(e,u),c=c||(l?"matched url ".concat(u):""),l=l||_t(e,s),c=c||(l?"matched MIME type ".concat(s):""),l=l||function(t,e){if(!e)return null;var n,r=(0,f.Z)(t);try{for(r.s();!(n=r.n()).done;){var i=n.value;if("string"===typeof e){if(bt(e,i))return i}else if(ArrayBuffer.isView(e)){if(xt(e.buffer,e.byteOffset,i))return i}else if(e instanceof ArrayBuffer){if(xt(e,0,i))return i}}}catch(o){r.e(o)}finally{r.f()}return null}(e,t),c=c||(l?"matched initial data ".concat(wt(t)):""),l=l||_t(e,null===n||void 0===n?void 0:n.fallbackMimeType),c=c||(l?"matched fallback MIME type ".concat(s):""),c&&ft.log(1,"selectLoader selected ".concat(null===(i=l)||void 0===i?void 0:i.name,": ").concat(c,"."));return l}(t,o,n,r);if(!s&&(null===n||void 0===n||!n.nothrow))throw new Error(yt(t));return s}function mt(t){return!(t instanceof Response&&204===t.status)}function yt(t){var e=(0,ht.l)(t),n=e.url,r=e.type,i="No valid loader found (";i+=n?"".concat(function(t){var e=t&&t.lastIndexOf("/");return e>=0?t.substr(e+1):""}(n),", "):"no url provided, ",i+="MIME type: ".concat(r?'"'.concat(r,'"'):"not provided",", ");var o=t?wt(t):"";return i+=o?' first bytes: "'.concat(o,'"'):"first bytes: not available",i+=")"}function _t(t,e){var n,r=(0,f.Z)(t);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(i.mimeTypes&&i.mimeTypes.includes(e))return i;if(e==="application/x.".concat(i.id))return i}}catch(o){r.e(o)}finally{r.f()}return null}function bt(t,e){return e.testText?e.testText(t):(Array.isArray(e.tests)?e.tests:[e.tests]).some((function(e){return t.startsWith(e)}))}function xt(t,e,n){return(Array.isArray(n.tests)?n.tests:[n.tests]).some((function(r){return function(t,e,n,r){if(r instanceof ArrayBuffer)return function(t,e,n){if(n=n||t.byteLength,t.byteLength<n||e.byteLength<n)return!1;
2for(var r=new Uint8Array(t),i=new Uint8Array(e),o=0;o<r.length;++o)if(r[o]!==i[o])return!1;return!0}(r,t,r.byteLength);switch(typeof r){case"function":return r(t,n);case"string":return r===Ct(t,e,r.length);default:return!1}}(t,e,n,r)}))}function wt(t){var 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 Ct(t.buffer,t.byteOffset,e);if(t instanceof ArrayBuffer){return Ct(t,0,e)}return""}function Ct(t,e,n){if(t.byteLength<e+n)return"";for(var r=new DataView(t),i="",o=0;o<n;o++)i+=String.fromCharCode(r.getUint8(e+o));return i}function Bt(t,e,n,r){return kt.apply(this,arguments)}function kt(){return(kt=(0,i.Z)((0,r.Z)().mark((function t(e,n,i,o){var l,c,h,f;return(0,r.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(0,u.h)(!o||"object"===typeof o),!n||Array.isArray(n)||(0,a.C)(n)||(o=void 0,i=n,n=void 0),t.next=4,e;case 4:return e=t.sent,i=i||{},l=(0,ht.l)(e),c=l.url,h=ct(n,o),t.next=11,At(e,h,i);case 11:if(f=t.sent){t.next=14;break}return t.abrupt("return",null);case 14:return i=(0,s.GR)(i,f,h,c),o=lt({url:c,parse:Bt,loaders:h},i,o),t.next=18,Et(f,e,i,o);case 18:return t.abrupt("return",t.sent);case 19:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Et(t,e,n,r){return St.apply(this,arguments)}function St(){return(St=(0,i.Z)((0,r.Z)().mark((function t(e,n,i,a){var s,l,h,f,p,d,A,v;return(0,r.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return c(e),(0,o.Ew)(n)&&(l=(s=n).ok,h=s.redirected,f=s.status,p=s.statusText,d=s.type,A=s.url,v=Object.fromEntries(s.headers.entries()),a.response={headers:v,ok:l,redirected:h,status:f,statusText:p,type:d,url:A}),t.next=4,at(n,e,i);case 4:if(n=t.sent,!e.parseTextSync||"string"!==typeof n){t.next=8;break}return i.dataType="text",t.abrupt("return",e.parseTextSync(n,i,a,e));case 8:if(!I(e,i)){t.next=12;break}return t.next=11,P(e,n,i,a,Bt);case 11:case 15:case 19:return t.abrupt("return",t.sent);case 12:if(!e.parseText||"string"!==typeof n){t.next=16;break}return t.next=15,e.parseText(n,i,a,e);case 16:if(!e.parse){t.next=20;break}return t.next=19,e.parse(n,i,a,e);case 20:throw(0,u.h)(!e.parseSync),new Error("".concat(e.id," loader - no parser found and worker is disabled"));case 22:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Tt(t,e,n,r){return Mt.apply(this,arguments)}function Mt(){return(Mt=(0,i.Z)((0,r.Z)().mark((function t(e,n,i,u){var l,c;return(0,r.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(Array.isArray(n)||(0,a.C)(n)||(void 0,i=n,n=void 0),l=(0,s.bV)(i),c=e,"string"!==typeof e){t.next=7;break}return t.next=6,l(e);case 6:c=t.sent;case 7:if(!(0,o.Lj)(e)){t.next=11;break}return t.next=10,l(e);case 10:c=t.sent;case 11:return t.next=13,Bt(c,n,i);case 13:return t.abrupt("return",t.sent);case 14:case"end":return t.stop()}}),t)})))).apply(this,arguments)}},19754:function(t,e,n){"use strict";n.d(e,{fh:function(){return s},kO:function(){return u}});var r=n(60726),i=n(35669),o=n(74168),a=function(){var t=(0,o.rx)();return t.loaderRegistry=t.loaderRegistry||[],t.loaderRegistry};function s(t){var e=a();t=Array.isArray(t)?t:[t];var n,o=(0,r.Z)(t);try{var s=function(){var t=n.value,r=(0,i.T)(t);e.find((function(t){return r===t}))||e.unshift(r)};for(o.s();!(n=o.n()).done;)s()}catch(u){o.e(u)}finally{o.f()}}function u(){return a()}},6386:function(t,e,n){"use strict";n.d(e,{d:function(){return l}});var r=n(11092),i=n(27791),o="",a={};function s(t){for(var e in a)if(t.startsWith(e)){var n=a[e];t=t.replace(e,n)}return t.startsWith("http://")||t.startsWith("https://")||(t="".concat(o).concat(t)),t}var u=n(73309);function l(t,e){return c.apply(this,arguments)}function c(){return(c=(0,i.Z)((0,r.Z)().mark((function t(e,n){var i;return(0,r.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("string"!==typeof e){t.next=7;break}return e=s(e),i=n,null!==n&&void 0!==n&&n.fetch&&"function"!==typeof(null===n||void 0===n?void 0:n.fetch)&&(i=n.fetch),t.next=6,fetch(e,i);case 6:case 9:return t.abrupt("return",t.sent);case 7:return t.next=9,(0,u.L1)(e);case 10:case"end":return t.stop()}}),t)})))).apply(this,arguments)}},35669:function(t,e,n){"use strict";n.d(e,{C:function(){return o},T:function(){return a}});var r=n(50189);function i(t,e){if(!t)throw new Error(e||"loader assertion failed.")}function o(t){var e;return!!t&&(Array.isArray(t)&&(t=t[0]),Array.isArray(null===(e=t)||void 0===e?void 0:e.extensions))}function a(t){var e,n,a;return i(t,"null loader"),i(o(t),"invalid loader"),Array.isArray(t)&&(a=t[1],t=t[0],t=(0,r.Z)((0,r.Z)({},t),{},{options:(0,r.Z)((0,r.Z)({},t.options),a)})),(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}}
2,74168:function(t,e,n){"use strict";n.d(e,{bV:function(){return y},rx:function(){return v},GR:function(){return m}});var r=n(60726),i=n(50189),o=n(78788),a=n(6386),s=n(22951),u=n(91976),l=n(64649),c=new(n(87294).Z)({id:"loaders.gl"}),h=function(){function t(){(0,s.Z)(this,t)}return(0,u.Z)(t,[{key:"log",value:function(){return function(){}}},{key:"info",value:function(){return function(){}}},{key:"warn",value:function(){return function(){}}},{key:"error",value:function(){return function(){}}}]),t}(),f=function(){function t(){(0,s.Z)(this,t),(0,l.Z)(this,"console",void 0),this.console=console}return(0,u.Z)(t,[{key:"log",value:function(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=this.console.log).bind.apply(t,[this.console].concat(n))}},{key:"info",value:function(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=this.console.info).bind.apply(t,[this.console].concat(n))}},{key:"warn",value:function(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=this.console.warn).bind.apply(t,[this.console].concat(n))}},{key:"error",value:function(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=this.console.error).bind.apply(t,[this.console].concat(n))}}]),t}(),p=n(27759),d={fetch:null,mimeType:void 0,nothrow:!1,log:new f,CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:p.jU,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},A={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 v(){globalThis.loaders=globalThis.loaders||{};var t=globalThis.loaders;return t._state=t._state||{},t._state}var g=function(){var t=v();return t.globalOptions=t.globalOptions||(0,i.Z)({},d),t.globalOptions};function m(t,e,n,i){return n=n||[],function(t,e){_(t,null,d,A,e);var n,i=(0,r.Z)(e);try{for(i.s();!(n=i.n()).done;){var o=n.value,a=t&&t[o.id]||{},s=o.options&&o.options[o.id]||{},u=o.deprecatedOptions&&o.deprecatedOptions[o.id]||{};_(a,o.id,s,u,e)}}catch(l){i.e(l)}finally{i.f()}}(t,n=Array.isArray(n)?n:[n]),x(e,t,i)}function y(t,e){var n=g(),r=t||n;return"function"===typeof r.fetch?r.fetch:(0,o.Kn)(r.fetch)?function(t){return(0,a.d)(t,r)}:null!==e&&void 0!==e&&e.fetch?null===e||void 0===e?void 0:e.fetch:a.d}function _(t,e,n,r,i){var a=e||"Top level",s=e?"".concat(e,"."):"";for(var u in t){var l=!e&&(0,o.Kn)(t[u]);if(!(u in n)&&!("baseUri"===u&&!e)&&!("workerUrl"===u&&e))if(u in r)c.warn("".concat(a," loader option '").concat(s).concat(u,"' no longer supported, use '").concat(r[u],"'"))();else if(!l){var h=b(u,i);c.warn("".concat(a," loader option '").concat(s).concat(u,"' not recognized. ").concat(h))()}}}function b(t,e){var n,i=t.toLowerCase(),o="",a=(0,r.Z)(e);try{for(a.s();!(n=a.n()).done;){var s=n.value;for(var u in s.options){if(t===u)return"Did you mean '".concat(s.id,".").concat(u,"'?");var l=u.toLowerCase();(i.startsWith(l)||l.startsWith(i))&&(o=o||"Did you mean '".concat(s.id,".").concat(u,"'?"))}}}catch(c){a.e(c)}finally{a.f()}return o}function x(t,e,n){var r=t.options||{},o=(0,i.Z)({},r);return function(t,e){e&&!("baseUri"in t)&&(t.baseUri=e)}(o,n),null===o.log&&(o.log=new h),w(o,g()),w(o,e),o}function w(t,e){for(var n in e)if(n in e){var r=e[n];(0,o.Ss)(r)&&(0,o.Ss)(t[n])?t[n]=(0,i.Z)((0,i.Z)({},t[n]),e[n]):t[n]=e[n]}}},44037:function(t,e,n){"use strict";n.d(e,{C:function(){return c},l:function(){return l}});var r=n(78788),i=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,o=/^([-\w.]+\/[-\w.+]+)/;function a(t){var e=o.exec(t);return e?e[1]:t}function s(t){var e=i.exec(t);return e?e[1]:""}var u=/\?.*/;function l(t){if((0,r.Ew)(t)){var e=h(t.url||"");return{url:e,type:a(t.headers.get("content-type")||"")||s(e)}}return(0,r.Lj)(t)?{url:h(t.name||""),type:t.type||""}:"string"===typeof t?{url:h(t),type:s(t)}:{url:"",type:""}}function c(t){return(0,r.Ew)(t)?t.headers["content-length"]||-1:(0,r.Lj)(t)?t.size:"string"===typeof t?t.length:t instanceof ArrayBuffer||ArrayBuffer.isView(t)?t.byteLength:-1}function h(t){return t.replace(u,"")}},73309:function(t,e,n){"use strict";n.d(e,{L1:function(){return s},mm:function(){return l}});var r=n(11092),i=n(27791),o=n(78788),a=n(44037);function s(t){return u.apply(this,arguments)}function u(){return(u=(0,i.Z)((0,r.Z)().mark((function t(e){var n,i,s,u,l,c,h;return(0,r.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(0,o.Ew)(e)){t.next=2;break}return t.abrupt("return",e);case 2:return n={},(i=(0,a.C)(e))>=0&&(n["content-length"]=String(i)),s=(0,a.l)(e),u=s.url,(l=s.type)&&(n["content-type"]=l),t.next=9,p(e);case 9:return(c=t.sent)&&(n["x-first-bytes"]=c),"string"===typeof e&&(e=(new TextEncoder).encode(e)),h=new Response(e,{headers:n}),Object.defineProperty(h,"url",{value:u}),t.abrupt("return",h);case 15:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function l(t){return c.apply(this,arguments)}function c(){return(c=(0,i.Z)((0,r.Z)().mark((function t(e){var n;return(0,r.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.ok){t.next=5;break}return t.next=3,h(e);case 3:throw n=t.sent,new Error(n);case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function h(t){return f.apply(this,arguments)}function f(){return(f=(0,i.Z)((0,r.Z)().mark((function t(e){var n,i,o;return(0,r.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n="Failed to fetch resource ".concat(e.url," (").concat(e.status,"): "),t.prev=1,i=e.headers.get("Content-Type"),o=e.statusText,!i.includes("application/json")){t.next=11;break}return t.t0=o,t.t1=" ",t.next=9,e.text();case 9:t.t2=t.sent,o=t.t0+=t.t1.concat.call(t.t1,t.t2);case 11:n=(n+=o).length>60?"".concat(n.slice(0,60),"..."):n,t.next=17;break;case 15:t.prev=15,t.t3=t.catch(1);case 17:return t.abrupt("return",n);case 18:case"end":return t.stop()}}),t,null,[[1,15]])})))).apply(this,arguments)}function p(t){return d.apply(this,arguments)}function d(){return(d=(0,i.Z)((0,r.Z)().mark((function t(e){var n,i,o,a;return(0,r.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=5,"string"!==typeof e){t.next=3;break}return t.abrupt("return","data:,".concat(e.slice(0,n)));case 3:if(!(e instanceof Blob)){t.next=8;break}return i=e.slice(0,5),t.next=7,new Promise((function(t){var e=new FileReader;e.onload=function(e){var n;return t(null===e||void 0===e||null===(n=e.target)||void 0===n?void 0:n.result)}
2,e.readAsDataURL(i)}));case 7:return t.abrupt("return",t.sent);case 8:if(!(e instanceof ArrayBuffer)){t.next=12;break}return o=e.slice(0,n),a=A(o),t.abrupt("return","data:base64,".concat(a));case 12:return t.abrupt("return",null);case 13:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function A(t){for(var e="",n=new Uint8Array(t),r=0;r<n.byteLength;r++)e+=String.fromCharCode(n[r]);return btoa(e)}},27759:function(t,e,n){"use strict";n.d(e,{jU:function(){return r}});"undefined"!==typeof self&&self,"undefined"!==typeof window&&window,"undefined"!==typeof n.g&&n.g,"undefined"!==typeof document&&document;var r=Boolean("object"!==typeof process||"[object process]"!==String(process)||process.browser),i="undefined"!==typeof process&&process.version&&/v([0-9]*)/.exec(process.version);i&&parseFloat(i[1])},61355:function(t,e,n){"use strict";n.d(e,{w:function(){return O}});var r=n(50189),i=n(11092),o=n(27791);function a(t,e){if(!t)throw new Error("null row");if(!e)throw new Error("no headers");for(var n={},r=0;r<e.length;r++)n[e[r]]=t[r];return n}function s(t,e){if(!t)throw new Error("null row");if(!e)throw new Error("no headers");for(var n=new Array(e.length),r=0;r<e.length;r++)n[r]=t[e[r]];return n}var u=n(22951),l=n(91976),c=n(67591),h=n(94337),f=n(90434),p=n(64649),d=function(t){(0,c.Z)(n,t);var e=(0,h.Z)(n);function n(){return(0,u.Z)(this,n),e.apply(this,arguments)}return(0,l.Z)(n,[{key:"enqueue",value:function(t){return this.push(t)}},{key:"dequeue",value:function(){return this.shift()}}]),n}((0,f.Z)(Array)),A=function(t){function e(){(0,u.Z)(this,e),(0,p.Z)(this,"_values",void 0),(0,p.Z)(this,"_settlers",void 0),(0,p.Z)(this,"_closed",void 0),this._values=new d,this._settlers=new d,this._closed=!1}return(0,l.Z)(e,[{key:"close",value:function(){for(;this._settlers.length>0;)this._settlers.dequeue().resolve({done:!0});this._closed=!0}},{key:t,value:function(){return this}},{key:"enqueue",value:function(t){if(this._closed)throw new Error("Closed");if(this._settlers.length>0){if(this._values.length>0)throw new Error("Illegal internal state");var e=this._settlers.dequeue();t instanceof Error?e.reject(t):e.resolve({value:t})}else this._values.enqueue(t)}},{key:"next",value:function(){var t=this;if(this._values.length>0){var e=this._values.dequeue();return e instanceof Error?Promise.reject(e):Promise.resolve({value:e})}if(this._closed){if(this._settlers.length>0)throw new Error("Illegal internal state");return Promise.resolve({done:!0})}return new Promise((function(e,n){t._settlers.enqueue({resolve:e,reject:n})}))}}]),e}(Symbol.asyncIterator);var v=function(){function t(e,n){if((0,u.Z)(this,t),(0,p.Z)(this,"schema",void 0),(0,p.Z)(this,"options",void 0),(0,p.Z)(this,"length",0),(0,p.Z)(this,"rows",null),(0,p.Z)(this,"cursor",0),(0,p.Z)(this,"_headers",[]),this.options=n,this.schema=e,!Array.isArray(e))for(var r in this._headers=[],e)this._headers[e[r].index]=e[r].name}return(0,l.Z)(t,[{key:"rowCount",value:function(){return this.length}},{key:"addArrayRow",value:function(t,e){Number.isFinite(e)&&(this.cursor=e),this.rows=this.rows||new Array(100),this.rows[this.length]=t,this.length++}},{key:"addObjectRow",value:function(t,e){Number.isFinite(e)&&(this.cursor=e),this.rows=this.rows||new Array(100),this.rows[this.length]=t,this.length++}},{key:"getBatch",value:function(){var t=this.rows;return t?(t=t.slice(0,this.length),this.rows=null,{shape:this.options.shape,batchType:"data",data:t,length:this.length,schema:this.schema,cursor:this.cursor}):null}}]),t}(),g=function(){function t(e,n){if((0,u.Z)(this,t),(0,p.Z)(this,"schema",void 0),(0,p.Z)(this,"options",void 0),(0,p.Z)(this,"length",0),(0,p.Z)(this,"objectRows",null),(0,p.Z)(this,"arrayRows",null),(0,p.Z)(this,"cursor",0),(0,p.Z)(this,"_headers",[]),this.options=n,this.schema=e,!Array.isArray(e))for(var r in this._headers=[],e)this._headers[e[r].index]=e[r].name}return(0,l.Z)(t,[{key:"rowCount",value:function(){return this.length}},{key:"addArrayRow",value:function(t,e){switch(Number.isFinite(e)&&(this.cursor=e),this.options.shape){case"object-row-table":var n=a(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++}}},{key:"addObjectRow",value:function(t,e){switch(Number.isFinite(e)&&(this.cursor=e),this.options.shape){case"array-row-table":var n=s(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++}}},{key:"getBatch",value:function(){var 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}}]),t}(),m=n(11026),y=function(){function t(e,n){(0,u.Z)(this,t),(0,p.Z)(this,"schema",void 0),(0,p.Z)(this,"length",0),(0,p.Z)(this,"allocated",0),(0,p.Z)(this,"columns",{}),this.schema=e,this._reallocateColumns()}return(0,l.Z)(t,[{key:"rowCount",value:function(){return this.length}},{key:"addArrayRow",value:function(t){this._reallocateColumns();var e=0;for(var n in this.columns)this.columns[n][this.length]=t[e++];this.length++}},{key:"addObjectRow",value:function(t){for(var e in this._reallocateColumns(),t)this.columns[e][this.length]=t[e];this.length++}},{key:"getBatch",value:function(){this._pruneColumns();var t=Array.isArray(this.schema)?this.columns:{};if(!Array.isArray(this.schema))for(var e in this.schema){var n=this.schema[e];t[n.name]=this.columns[n.index]}return this.columns={},{shape:"columnar-table",batchType:"data",data:t,schema:this.schema,length:this.length}}},{key:"_reallocateColumns",value:function(){if(!(this.length<this.allocated))for(var t in this.allocated=this.allocated>0?this.allocated*=2:100,this.columns={},this.schema){var e=this.schema[t],n=e.type||Float32Array,r=this.columns[e.index];if(r&&ArrayBuffer.isView(r)){var i=new n(this.allocated);i.set(r),this.columns[e.index]=i}else r?(r.length=this.allocated,this.columns[e.index]=r):this.columns[e.index]=new n(this.allocated)}}},{key:"_pruneColumns",value:function(){for(var t=0,e=Object.entries(this.columns);t<e.length;t++){var n=(0,m.Z)(e[t],2),r=n[0],i=n[1];this.columns[r]=i.slice(0,this.length)}}}]),t}(),_={shape:"array-row-table",batchSize:"auto",batchDebounceMs:0,limit:0,_limitMB:0},b="TableBatchBuilder",x=function(){function t(e,n){(0,u.Z)(this,t),(0,p.Z)(this,"schema",void 0),(0,p.Z)(this,"options",void 0),(0,p.Z)(this,"aggregator",null),(0,p.Z)(this,"batchCount",0),(0,p.Z)(this,"bytesUsed",0),(0,p.Z)(this,"isChunkComplete",!1),(0,p.Z)(this,"lastBatchEmittedMs",Date.now()),(0,p.Z)(this,"totalLength",0),(0,p.Z)(this,"totalBytes",0),(0,p.Z)(this,"rowBytes",0),this.schema=e,this.options=(0,r.Z)((0,r.Z)({},_),n)}return(0,l.Z)(t,[{key:"limitReached",value:function(){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)}},{key:"addRow",value:function(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))}},{key:"addArrayRow",value:function(t){if(!this.aggregator){var e=this._getTableBatchType();this.aggregator=new e(this.schema,this.options)}this.aggregator.addArrayRow(t)}},{key:"addObjectRow",value:function(t){if(!this.aggregator){var e=this._getTableBatchType();this.aggregator=new e(this.schema,this.options)}this.aggregator.addObjectRow(t)}},{key:"chunkComplete",value:function(t){t instanceof ArrayBuffer&&(this.bytesUsed+=t.byteLength),"string"===typeof t&&(this.bytesUsed+=t.length),this.isChunkComplete=!0}},{key:"getFullBatch",value:function(t){return this._isFull()?this._getBatch(t):null}},{key:"getFinalBatch",value:function(t){return this._getBatch(t)}},{key:"_estimateRowMB",value:function(t){return Array.isArray(t)?8*t.length:8*Object.keys(t).length}},{key:"_isFull",value:function(){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)}},{key:"_getBatch",value:function(t){if(!this.aggregator)return null;null!==t&&void 0!==t&&t.bytesUsed&&(this.bytesUsed=t.bytesUsed);var e=this.aggregator.getBatch();return e.count=this.batchCount,e.bytesUsed=this.bytesUsed,Object.assign(e,t),this.batchCount++,this.aggregator=null,e}},{key:"_getTableBatchType",value:function(){switch(this.options.shape){case"row-table":return v;case"array-row-table":case"object-row-table":return g;case"columnar-table":return y;case"arrow-table":if(!t.ArrowBatch)throw new Error(b);return t.ArrowBatch;default:throw new Error(b)}}}]),t}();(0,p.Z)(x,"ArrowBatch",void 0);var w={parse:function(t,e,n){var r=(e=e||{}).dynamicTyping||!1;I(r)&&(e.dynamicTypingFunction=r,r={});if(e.dynamicTyping=r,e.transform=!!I(e.transform)&&e.transform,e.worker&&w.WORKERS_SUPPORTED){var i=newWorker();return i.userStep=e.step,i.userChunk=e.chunk,i.userComplete=e.complete,i.userError=e.error,e.step=I(e.step),e.chunk=I(e.chunk),e.complete=I(e.complete),e.error=I(e.error),delete e.worker,void i.postMessage({input:t,config:e,workerId:i.id})}var o=null;"string"===typeof t&&(o=new k(e));o||(o=new n(e));return o.stream(t)},unparse:function(t,e){var n=!1,r=!0,i=",",o="\r\n",a='"',s=a+a,u=!1,l=null;!function(){if("object"!==typeof e)return;"string"!==typeof e.delimiter||w.BAD_DELIMITERS.filter((function(t){return-1!==e.delimiter.indexOf(t)})).length||(i=e.delimiter);("boolean"===typeof e.quotes||Array.isArray(e.quotes))&&(n=e.quotes);"boolean"!==typeof e.skipEmptyLines&&"string"!==typeof e.skipEmptyLines||(u=e.skipEmptyLines);"string"===typeof e.newline&&(o=e.newline);"string"===typeof e.quoteChar&&(a=e.quoteChar);"boolean"===typeof e.header&&(r=e.header);if(Array.isArray(e.columns)){if(0===e.columns.length)throw new Error("Option columns is empty");l=e.columns}void 0!==e.escapeChar&&(s=e.escapeChar+a)}();var c=new RegExp(S(a),"g");"string"===typeof t&&(t=JSON.parse(t));if(Array.isArray(t)){if(!t.length||Array.isArray(t[0]))return f(null,t,u);if("object"===typeof t[0])return f(l||h(t[0]),t,u)}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])),f(t.fields||[],t.data||[],u);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 f(t,e,n){var a="";"string"===typeof t&&(t=JSON.parse(t)),"string"===typeof e&&(e=JSON.parse(e));var s=Array.isArray(t)&&t.length>0,u=!Array.isArray(e[0]);if(s&&r){for(var l=0;l<t.length;l++)l>0&&(a+=i),a+=p(t[l],l);e.length>0&&(a+=o)}for(var c=0;c<e.length;c++){var h=s?t.length:e[c].length,f=!1,d=s?0===Object.keys(e[c]).length:0===e[c].length;if(n&&!s&&(f="greedy"===n?""===e[c].join("").trim():1===e[c].length&&0===e[c][0].length),"greedy"===n&&s){for(var A=[],v=0;v<h;v++){var g=u?t[v]:v;A.push(e[c][g])}f=""===A.join("").trim()}if(!f){for(var m=0;m<h;m++){m>0&&!d&&(a+=i);var y=s&&u?t[m]:m;a+=p(e[c][y],m)}c<e.length-1&&(!n||h>
20&&!d)&&(a+=o)}}return a}function p(t,e){if("undefined"===typeof t||null===t)return"";if(t.constructor===Date)return JSON.stringify(t).slice(1,25);t=t.toString().replace(c,s);var r="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,w.BAD_DELIMITERS)||t.indexOf(i)>-1||" "===t.charAt(0)||" "===t.charAt(t.length-1);return r?a+t+a: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:T,ParserHandle:E,ChunkStreamer:B,StringStreamer:k},C=w;function B(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=M(t);e.chunkSize=parseInt(e.chunkSize),t.step||t.chunk||(e.chunkSize=null);this._handle=new E(e),this._handle.streamer=this,this._config=e}.call(this,t),this.parseChunk=function(t,e){if(this.isFirstChunk&&I(this._config.beforeFirstChunk)){var n=this._config.beforeFirstChunk(t);void 0!==n&&(t=n)}this.isFirstChunk=!1;var r=this._partialLine+t;this._partialLine="";var i=this._handle.parse(r,this._baseIndex,!this._finished);if(!this._handle.paused()&&!this._handle.aborted()){var o=i.meta.cursor;this._finished||(this._partialLine=r.substring(o-this._baseIndex),this._baseIndex=o),i&&i.data&&(this._rowCount+=i.data.length);var a=this._finished||this._config.preview&&this._rowCount>=this._config.preview;if(I(this._config.chunk)&&!e){if(this._config.chunk(i,this._handle),this._handle.paused()||this._handle.aborted())return;i=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(i.data),this._completeResults.errors=this._completeResults.errors.concat(i.errors),this._completeResults.meta=i.meta),this._completed||!a||!I(this._config.complete)||i&&i.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),a||i&&i.meta.paused||this._nextChunk(),i}},this._sendError=function(t){I(this._config.error)&&this._config.error(t)}}function k(t){var e;t=t||{},B.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 E(t){var e,n,r,i=/^\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))/,a=this,s=0,u=0,l=!1,c=!1,h=[],f={data:[],errors:[],meta:{}};if(I(t.step)){var p=t.step;t.step=function(e){if(f=e,v())A();else{if(A(),!f.data||0===f.data.length)return;s+=e.data.length,t.preview&&s>t.preview?n.abort():p(f,a)}}}function d(e){return"greedy"===t.skipEmptyLines?""===e.join("").trim():1===e.length&&0===e[0].length}function A(){if(f&&r&&(m("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+w.DefaultDelimiter+"'"),r=!1),t.skipEmptyLines)for(var e=0;e<f.data.length;e++)d(f.data[e])&&f.data.splice(e--,1);return v()&&function(){if(!f)return;function e(e){I(t.transformHeader)&&(e=t.transformHeader(e)),h.push(e)}if(Array.isArray(f.data[0])){for(var n=0;v()&&n<f.data.length;n++)f.data[n].forEach(e);f.data.splice(0,1)}else f.data.forEach(e)}(),function(){if(!f||!f.data||!t.header&&!t.dynamicTyping&&!t.transform)return f;function e(e,n){var r,i=t.header?{}:[];for(r=0;r<e.length;r++){var o=r,a=e[r];t.header&&(o=r>=h.length?"__parsed_extra":h[r]),t.transform&&(a=t.transform(a,o)),a=g(o,a),"__parsed_extra"===o?(i[o]=i[o]||[],i[o].push(a)):i[o]=a}return t.header&&(r>h.length?m("FieldMismatch","TooManyFields","Too many fields: expected "+h.length+" fields but parsed "+r,u+n):r<h.length&&m("FieldMismatch","TooFewFields","Too few fields: expected "+h.length+" fields but parsed "+r,u+n)),i}var n=1;!f.data[0]||Array.isArray(f.data[0])?(f.data=f.data.map(e),n=f.data.length):f.data=e(f.data,0);t.header&&f.meta&&(f.meta.fields=h);return u+=n,f}()}function v(){return t.header&&0===h.length}function g(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&&(i.test(n)?parseFloat(n):o.test(n)?new Date(n):""===n?null:n):n}function m(t,e,n,r){f.errors.push({type:t,code:e,message:n,row:r})}this.parse=function(i,o,a){var s=t.quoteChar||'"';if(t.newline||(t.newline=function(t,e){t=t.substr(0,1048576);var n=new RegExp(S(e)+"([^]*?)"+S(e),"gm");t=t.replace(n,"");var r=t.split("\r"),i=t.split("\n"),o=i.length>1&&i[0].length<r[0].length;if(1===r.length||o)return"\n";for(var a=0,s=0;s<r.length;s++)"\n"===r[s][0]&&a++;return a>=r.length/2?"\r\n":"\r"}(i,s)),r=!1,t.delimiter)I(t.delimiter)&&(t.delimiter=t.delimiter(i),f.meta.delimiter=t.delimiter);else{var u=function(e,n,r,i,o){var a,s,u;o=o||[",","\t","|",";",w.RECORD_SEP,w.UNIT_SEP];for(var l=0;l<o.length;l++){var c=o[l],h=0,f=0,p=0;u=void 0;for(var A=new T({comments:i,delimiter:c,newline:n,preview:10}).parse(e),v=0;v<A.data.length;v++)if(r&&d(A.data[v]))p++;else{var g=A.data[v].length;f+=g,"undefined"!==typeof u?g>1&&(h+=Math.abs(g-u),u=g):u=0}A.data.length>0&&(f/=A.data.length-p),("undefined"===typeof s||h>s)&&f>1.99&&(s=h,a=c)}return t.delimiter=a,{successful:!!a,bestDelimiter:a}}(i,t.newline,t.skipEmptyLines,t.comments,t.delimitersToGuess);u.successful?t.delimiter=u.bestDelimiter:(r=!0,t.delimiter=w.DefaultDelimiter),f.meta.delimiter=t.delimiter}var c=M(t);return t.preview&&t.header&&c.preview++,e=i,n=new T(c),f=n.parse(e,o,a),A(),l?{meta:{paused:!0}}:f||{meta:{paused:!1}}},this.paused=function(){return l},this.pause=function(){l=!0,n.abort(),e=e.substr(n.getCharIndex())},this.resume=function(){l=!1,a.streamer.parseChunk(e,!0)},this.aborted=function(){return c},this.abort=function(){c=!0,n.abort(),f.meta.aborted=!0,I(t.complete)&&t.complete(f),e=""}}function S(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function T(t){var e,n=(t=t||{}).delimiter,r=t.newline,i=t.comments,o=t.step,a=t.preview,s=t.fastMode,u=e=void 0===t.quoteChar?'"':t.quoteChar;if(void 0!==t.escapeChar&&(u=t.escapeChar),("string"!==typeof n||w.BAD_DELIMITERS.indexOf(n)>-1)&&(n=","),i===n)throw new Error("Comment character same as delimiter");!0===i?i="#":("string"!==typeof i||w.BAD_DELIMITERS.indexOf(i)>-1)&&(i=!1),"\n"!==r&&"\r"!==r&&"\r\n"!==r&&(r="\n");var l=0,c=!1;this.parse=function(t,h,f){if("string"!==typeof t)throw new Error("Input must be a string");var p=t.length,d=n.length,A=r.length,v=i.length,g=I(o);l=0;var m=[],y=[],_=[],b=0;if(!t)return O();if(s||!1!==s&&-1===t.indexOf(e)){for(var x=t.split(r),w=0;w<x.length;w++){if(_=x[w],l+=_.length,w!==x.length-1)l+=r.length;else if(f)return O();if(!i||_.substr(0,v)!==i){if(g){if(m=[],P(_.split(n)),F(),c)return O()}else P(_.split(n));if(a&&w>=a)return m=m.slice(0,a),O(!0)}}return O()}for(var C,B=t.indexOf(n,l),k=t.indexOf(r,l),E=new RegExp(S(u)+S(e),"g");;)if(t[l]!==e)if(i&&0===_.length&&t.substr(l,v)===i){if(-1===k)return O();l=k+A,k=t.indexOf(r,l),B=t.indexOf(n,l)}else if(-1!==B&&(B<k||-1===k))_.push(t.substring(l,B)),l=B+d,B=t.indexOf(n,l);else{if(-1===k)break;if(_.push(t.substring(l,k)),L(k+A),g&&(F(),c))return O();if(a&&m.length>=a)return O(!0)}else{for(C=l,l++;;){if(-1===(C=t.indexOf(e,C+1)))return f||y.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:m.length,index:l}),D();
2if(C===p-1)return D(t.substring(l,C).replace(E,e));if(e!==u||t[C+1]!==u){if(e===u||0===C||t[C-1]!==u){var T=Z(-1===k?B:Math.min(B,k));if(t[C+1+T]===n){if(_.push(t.substring(l,C).replace(E,e)),l=C+1+T+d,B=t.indexOf(n,l),k=t.indexOf(r,l),g&&(F(),c))return O();if(a&&m.length>=a)return O(!0);break}var M=Z(k);if(t.substr(C+1+M,A)===r){if(_.push(t.substring(l,C).replace(E,e)),L(C+1+M+A),B=t.indexOf(n,l),g&&(F(),c))return O();if(a&&m.length>=a)return O(!0);break}y.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:m.length,index:l}),C++}}else C++}if(g&&(F(),c))return O();if(a&&m.length>=a)return O(!0)}return D();function P(t){m.push(t),b=l}function Z(e){var n=0;if(-1!==e){var r=t.substring(C+1,e);r&&""===r.trim()&&(n=r.length)}return n}function D(e){return f||("undefined"===typeof e&&(e=t.substr(l)),_.push(e),l=p,P(_),g&&F()),O()}function L(e){l=e,P(_),_=[],k=t.indexOf(r,l)}function O(t,e){return{data:e||!1?m[0]:m,errors:y,meta:{delimiter:n,linebreak:r,aborted:c,truncated:!!t,cursor:b+(h||0)}}}function F(){o(O(void 0,!0)),m=[],y=[]}},this.abort=function(){c=!0},this.getCharIndex=function(){return l}}function M(t){if("object"!==typeof t||null===t)return t;var e=Array.isArray(t)?[]:{};for(var n in t)e[n]=M(t[n]);return e}function I(t){return"function"===typeof t}k.prototype=Object.create(k.prototype),k.prototype.constructor=k;var P=n(187),Z=C.ChunkStreamer;function D(t){t=t||{},Z.call(this,t),this.textDecoder=new TextDecoder(this._config.encoding),this.stream=function(){var t=(0,o.Z)((0,i.Z)().mark((function t(e){var n,r,o,a,s,u;return(0,i.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this._input=e,t.prev=1,n=!1,r=!1,t.prev=4,a=(0,P.Z)(e);case 6:return t.next=8,a.next();case 8:if(!(n=!(s=t.sent).done)){t.next=14;break}u=s.value,this.parseChunk(this.getStringChunk(u));case 11:n=!1,t.next=6;break;case 14:t.next=20;break;case 16:t.prev=16,t.t0=t.catch(4),r=!0,o=t.t0;case 20:if(t.prev=20,t.prev=21,!n||null==a.return){t.next=25;break}return t.next=25,a.return();case 25:if(t.prev=25,!r){t.next=28;break}throw o;case 28:return t.finish(25);case 29:return t.finish(20);case 30:this._finished=!0,this.parseChunk(""),t.next=37;break;case 34:t.prev=34,t.t1=t.catch(1),this._sendError(t.t1);case 37:case"end":return t.stop()}}),t,this,[[1,34],[4,16,20,30],[21,,25,29]])})));return function(e){return t.apply(this,arguments)}}(),this._nextChunk=function(){},this.getStringChunk=function(t){return"string"===typeof t?t:this.textDecoder.decode(t,{stream:!0})}}D.prototype=Object.create(Z.prototype),D.prototype.constructor=D;var L={csv:{shape:"object-row-table",optimizeMemoryUsage:!1,header:"auto",columnPrefix:"column",quoteChar:'"',escapeChar:'"',dynamicTyping:!0,comments:!1,skipEmptyLines:!0,delimitersToGuess:[",","\t","|",";"]}},O={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:function(){var t=(0,o.Z)((0,i.Z)().mark((function t(e,n){return(0,i.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",F((new TextDecoder).decode(e),n));case 1:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),parseText:function(t,e){return F(t,e)},parseInBatches:function(t,e){var n;"auto"===(e=(0,r.Z)({},e)).batchSize&&(e.batchSize=4e3);var i=(0,r.Z)((0,r.Z)({},L.csv),null===(n=e)||void 0===n?void 0:n.csv),o=new A,a=!0,s=null,u=null,l=null,c=(0,r.Z)((0,r.Z)({},i),{},{header:!1,download:!1,chunkSize:5242880,skipEmptyLines:!1,step:function(t){var n=t.data;if(i.skipEmptyLines&&""===n.flat().join("").trim())return;var c=t.meta.cursor;if(a&&!s&&("auto"===i.header?z(n):Boolean(i.header)))return void(s=n.map(N()));a&&(a=!1,s||(s=G(i.columnPrefix,n.length)),l=function(t,e){for(var n=e?{}:[],r=0;r<t.length;r++){var i=e&&e[r]||r;switch(typeof t[r]){case"number":case"boolean":n[i]={name:String(i),index:r,type:Float32Array};break;default:n[i]={name:String(i),index:r,type:Array}}}return n}(n,s)),i.optimizeMemoryUsage&&(n=JSON.parse(JSON.stringify(n))),u=u||new x(l,(0,r.Z)({shape:i.shape||"array-row-table"},e));try{u.addRow(n);var h=u&&u.getFullBatch({bytesUsed:c});h&&o.enqueue(h)}catch(f){o.enqueue(f)}},complete:function(t){try{var e=t.meta.cursor,n=u&&u.getFinalBatch({bytesUsed:e});n&&o.enqueue(n)}catch(r){o.enqueue(r)}o.close()}});return C.parse(t,c,D),o},options:L};function F(t,e){return R.apply(this,arguments)}function R(){return(R=(0,o.Z)((0,i.Z)().mark((function t(e,n){var o,u,l,c,h,f,p,d;return(0,i.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:o=(0,r.Z)((0,r.Z)({},L.csv),null===n||void 0===n?void 0:n.csv),u=U(e),l="auto"===o.header?z(u):Boolean(o.header),c=l,h=(0,r.Z)((0,r.Z)({},o),{},{header:c,download:!1,transformHeader:c?N():void 0,error:function(t){throw new Error(t)}}),f=C.parse(e,h),p=f.data,d=f.meta.fields||G(o.columnPrefix,u.length),t.t0=o.shape,t.next="object-row-table"===t.t0?11:"array-row-table"===t.t0?13:15;break;case 11:return p=p.map((function(t){return Array.isArray(t)?a(t,d):t})),t.abrupt("break",15);case 13:return p=p.map((function(t){return Array.isArray(t)?t:s(t,d)})),t.abrupt("break",15);case 15:return t.abrupt("return",p);case 16:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function z(t){return t&&t.every((function(t){return"string"===typeof t}))}function U(t){return C.parse(t,{download:!1,dynamicTyping:!0,preview:1}).data[0]}function N(){var t=new Set;return function(e){for(var n=e,r=1;t.has(n);)n="".concat(e,".").concat(r),r++;return t.add(n),n}}function G(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=[],r=0;r<e;r++)n.push("".concat(t).concat(r+1));return n}},82595:function(t,e,n){"use strict";n.d(e,{E:function(){return Br}});var r={};n.r(r),n.d(r,{decode:function(){return Xt},name:function(){return Kt}});var i={};n.r(i),n.d(i,{name:function(){return ae},preprocess:function(){return se}});var o={};n.r(o),n.d(o,{name:function(){return le},preprocess:function(){return ce}});var a={};n.r(a),n.d(a,{decode:function(){return an},encode:function(){return un},name:function(){return rn},preprocess:function(){return on}});var s={};n.r(s),n.d(s,{decode:function(){return vn},encode:function(){return mn},name:function(){return An}});var u={};n.r(u),n.d(u,{decode:function(){return xn},encode:function(){return Cn},name:function(){return bn}});var l={};n.r(l),n.d(l,{decode:function(){return En},encode:function(){return Tn},name:function(){return kn}});var c=n(11092),h=n(50189),f=n(27791),p=n(60726),d=n(11026),A=n(89596),v=n(72672),g=n(73599),m="3.2.13",y={};function _(t){return b.apply(this,arguments)}function b(){return b=(0,f.Z)((0,c.Z)().mark((function t(e){var n,r,i=arguments;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=i.length>2&&void 0!==i[2]?i[2]:{},(n=i.length>1&&void 0!==i[1]?i[1]:null)&&(e=x(e,n,r)),y[e]=y[e]||w(e),t.next=6,y[e];case 6:return t.abrupt("return",t.sent);case 7:case"end":return t.stop()}}),t)}))),b.apply(this,arguments)}function x(t,e,n){if(t.startsWith("http"))return t;var r=n.modules||{};return r[t]?r[t]:A.jU?n.CDN?((0,g.h)(n.CDN.startsWith("http")),"".concat(n.CDN,"/").concat(e,"@").concat(m,"/dist/libs/").concat(t)):A.hJ?"../src/libs/".concat(t):"modules/".concat(e,"/src/libs/").concat(t):"modules/".concat(e,"/dist/libs/").concat(t)}function w(t){return C.apply(this,arguments)}function C(){return(C=(0,f.Z)((0,c.Z)().mark((function t(e){var n,r,i;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.endsWith("wasm")){t.next=7;break}return t.next=3,fetch(e);case 3:return n=t.sent,t.next=6,n.arrayBuffer();case 6:return t.abrupt("return",t.sent);case 7:if(A.jU){t.next=20;break}if(t.prev=8,t.t0=v&&v.requireFromFile,!t.t0){t.next=14;break}return t.next=13,v.requireFromFile(e);case 13:t.t0=t.sent;case 14:return t.abrupt("return",t.t0);case 17:return t.prev=17,t.t1=t.catch(8),t.abrupt("return",null);case 20:if(!A.hJ){t.next=22;break}return t.abrupt("return",importScripts(e));case 22:return t.next=24,fetch(e);case 24:return r=t.sent,t.next=27,r.text();case 27:return i=t.sent,t.abrupt("return",B(i,e));case 29:case"end":return t.stop()}}),t,null,[[8,17]])})))).apply(this,arguments)}function B(t,e){if(!A.jU)return v.requireFromString&&v.requireFromString(t,e);if(A.hJ)return eval.call(A.CO,t),null;var n=document.createElement("script");n.id=e;try{n.appendChild(document.createTextNode(t))}catch(r){n.text=t}return document.body.appendChild(n),null}var k,E,S="3.2.13",T="https://unpkg.com/@loaders.gl/textures@".concat(S,"/dist/libs/basis_encoder.wasm"),M="https://unpkg.com/@loaders.gl/textures@".concat(S,"/dist/libs/basis_encoder.js");function I(t){return P.apply(this,arguments)}function P(){return(P=(0,f.Z)((0,c.Z)().mark((function t(e){var n;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(n=e.modules||{}).basis){t.next=3;break}return t.abrupt("return",n.basis);case 3:return k=k||Z(e),t.next=6,k;case 6:return t.abrupt("return",t.sent);case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Z(t){return D.apply(this,arguments)}function D(){return(D=(0,f.Z)((0,c.Z)().mark((function t(e){var n,r,i,o;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=null,r=null,t.t0=Promise,t.next=5,_("basis_transcoder.js","textures",e);case 5:return t.t1=t.sent,t.next=8,_("basis_transcoder.wasm","textures",e);case 8:return t.t2=t.sent,t.t3=[t.t1,t.t2],t.next=12,t.t0.all.call(t.t0,t.t3);case 12:return i=t.sent,o=(0,d.Z)(i,2),n=o[0],r=o[1],n=n||globalThis.BASIS,t.next=19,L(n,r);case 19:return t.abrupt("return",t.sent);case 20:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function L(t,e){var n={};return e&&(n.wasmBinary=e),new Promise((function(e){t(n).then((function(t){var n=t.BasisFile;(0,t.initializeBasis)(),e({BasisFile:n})}))}))}function O(t){return F.apply(this,arguments)}function F(){return(F=(0,f.Z)((0,c.Z)().mark((function t(e){var n;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(n=e.modules||{}).basisEncoder){t.next=3;break}return t.abrupt("return",n.basisEncoder);case 3:return E=E||R(e),t.next=6,E;case 6:return t.abrupt("return",t.sent);case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function R(t){return z.apply(this,arguments)}function z(){return(z=(0,f.Z)((0,c.Z)().mark((function t(e){var n,r,i,o;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=null,r=null,t.t0=Promise,t.next=5,_(M,"textures",e);case 5:return t.t1=t.sent,t.next=8,_(T,"textures",e);case 8:return t.t2=t.sent,t.t3=[t.t1,t.t2],t.next=12,t.t0.all.call(t.t0,t.t3);case 12:return i=t.sent,o=(0,d.Z)(i,2),n=o[0],r=o[1],n=n||globalThis.BASIS,t.next=19,U(n,r);case 19:return t.abrupt("return",t.sent);case 20:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function U(t,e){var n={};return e&&(n.wasmBinary=e),new Promise((function(e){t(n).then((function(t){var n=t.BasisFile,r=t.KTX2File,i=t.initializeBasis,o=t.BasisEncoder;i(),e({BasisFile:n,KTX2File:r,BasisEncoder:o})}))}))}var N=33776,G=33779,j=35840,V=35842,H=36196,J=37808,W=["","WEBKIT_","MOZ_"],Q={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"},q=null;function K(t){if(!q){t=t||function(){try{return document.createElement("canvas").getContext("webgl")}catch(t){return null}}()||void 0,q=new Set;var e,n=(0,p.Z)(W);try{for(n.s();!(e=n.n()).done;){var r=e.value;for(var i in Q)if(t&&t.getExtension("".concat(r).concat(i))){var o=Q[i];q.add(o)}}}catch(a){n.e(a)}finally{n.f()}}return q}n(88687);var X=[171,75,84,88,32,50,48,187,13,10,26,10];function Y(t){var e=new Uint8Array(t);return!(e.byteLength<X.length||e[0]!==X[0]||e[1]!==X[1]||e[2]!==X[2]||e[3]!==X[3]||e[4]!==X[4]||e[5]!==X[5]||e[6]!==X[6]||e[7]!==X[7]||e[8]!==X[8]||e[9]!==X[9]||e[10]!==X[10]||e[11]!==X[11])}var $={etc1:{basisFormat:0,compressed:!0,format:H},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:N},bc3:{basisFormat:3,compressed:!0,format:G},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:j},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:V},"astc-4x4":{basisFormat:10,compressed:!0,format:J},"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 tt(){return(tt=(0,f.Z)((0,c.Z)().mark((function t(e,n){var r,i,o,a,s,u;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("auto"!==n.basis.containerFormat){t.next=11;break}if(!Y(e)){t.next=6;break}return t.next=4,O(n);case 4:return r=t.sent,t.abrupt("return",rt(r.KTX2File,e,n));case 6:return t.next=8,I(n);case 8:return i=t.sent,o=i.BasisFile,t.abrupt("return",et(o,e,n));case 11:t.t0=n.basis.module,t.next="encoder"===t.t0?14:(t.t0,22);break;case 14:return t.next=16,O(n);case 16:a=t.sent,t.t1=n.basis.containerFormat,t.next="ktx2"===t.t1?20:(t.t1,21);break;case 20:return t.abrupt("return",rt(a.KTX2File,e,n));case 21:return t.abrupt("return",et(a.BasisFile,e,n));case 22:return t.next=24,I(n);case 24:return s=t.sent,u=s.BasisFile,t.abrupt("return",et(u,e,n));case 27:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function et(t,e,n){var r=new t(new Uint8Array(e));try{if(!r.startTranscoding())throw new Error("Failed to start basis transcoding");for(var i=r.getNumImages(),o=[],a=0;a<i;a++){for(var s=r.getNumLevels(a),u=[],l=0;l<s;l++)u.push(nt(r,a,l,n));o.push(u)}return o}finally{r.close(),r.delete()}}function nt(t,e,n,r){var i=t.getImageWidth(e,n),o=t.getImageHeight(e,n),a=t.getHasAlpha(),s=ot(r,a),u=s.compressed,l=s.format,c=s.basisFormat,h=t.getImageTranscodedSizeInBytes(e,n,c),f=new Uint8Array(h);if(!t.transcodeImage(f,e,n,c,0,0))throw new Error("failed to start Basis transcoding");return{width:i,height:o,data:f,compressed:u,format:l,hasAlpha:a}}function rt(t,e,n){var r=new t(new Uint8Array(e));try{if(!r.startTranscoding())throw new Error("failed to start KTX2 transcoding");for(var i=r.getLevels(),o=[],a=0;a<i;a++){o.push(it(r,a,n));break}return[o]}finally{r.close(),r.delete()}}function it(t,e,n){var r=t.getImageLevelInfo(e,0,0),i=r.alphaFlag,o=r.height,a=r.width,s=ot(n,i),u=s.compressed,l=s.format,c=s.basisFormat,h=t.getImageTranscodedSizeInBytes(e,0,0,c),f=new Uint8Array(h);if(!t.transcodeImage(f,e,0,0,c,0,-1,-1))throw new Error("Failed to transcode KTX2 image");return{width:a,height:o,data:f,compressed:u,hasAlpha:i,format:l}}function ot(t,e){var n=t&&t.basis&&t.basis.format;return"auto"===n&&(n=at()),"object"===typeof n&&(n=e?n.alpha:n.noAlpha),n=n.toLowerCase(),$[
2n]}function at(){var t=K();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"}var st={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"}}},ut=(0,h.Z)((0,h.Z)({},st),{},{parse:function(t,e){return tt.apply(this,arguments)}}),lt=n(21440);function ct(t,e,n){if(t.byteLength<=e+n)return"";for(var r=new DataView(t),i="",o=0;o<n;o++)i+=String.fromCharCode(r.getUint8(e+o));return i}function ht(t){try{return JSON.parse(t)}catch(e){throw new Error('Failed to parse JSON from data starting with "'.concat(function(t){var 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 ct(t.buffer,t.byteOffset,e);if(t instanceof ArrayBuffer)return ct(t,0,e);return""}(t),'"'))}}function ft(t,e,n){var r=void 0!==n?new Uint8Array(t).subarray(e,e+n):new Uint8Array(t).subarray(e);return new Uint8Array(r).buffer}function pt(t,e){if(!t)throw new Error(e||"assert failed: gltf")}function dt(t,e){if(t.startsWith("data:")||t.startsWith("http:")||t.startsWith("https:"))return t;var 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 At(t,e,n){var r=t.bufferViews[n];pt(r);var i=e[r.buffer];pt(i);var o=(r.byteOffset||0)+i.byteOffset;return new Uint8Array(i.arrayBuffer,o,r.byteLength)}var vt=n(22951),gt=n(91976),mt=n(64649),yt=n(43835);function _t(t,e){if(!t)throw new Error(e||"loader assertion failed.")}function bt(t,e){return _t(t>=0),_t(e>0),t+(e-1)&~(e-1)}function xt(t,e,n){var r;if(t instanceof ArrayBuffer)r=new Uint8Array(t);else{var i=t.byteOffset,o=t.byteLength;r=new Uint8Array(t.buffer||t.arrayBuffer,i,o)}return e.set(r,n),n+bt(r.byteLength,4)}var wt=["SCALAR","VEC2","VEC3","VEC4"],Ct=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],Bt=new Map(Ct),kt={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},St={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function Tt(t){return wt[t-1]||wt[0]}function Mt(t){var e=Bt.get(t.constructor);if(!e)throw new Error("Illegal typed array");return e}function It(t,e){var n=St[t.componentType],r=kt[t.type],i=Et[t.componentType],o=t.count*r,a=t.count*r*i;return pt(a>=0&&a<=e.byteLength),{ArrayType:n,length:o,byteLength:a}}var Pt,Zt={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]},Dt=function(){function t(e){(0,vt.Z)(this,t),(0,mt.Z)(this,"gltf",void 0),(0,mt.Z)(this,"sourceBuffers",void 0),(0,mt.Z)(this,"byteLength",void 0),this.gltf=e||{json:(0,h.Z)({},Zt),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]])}return(0,gt.Z)(t,[{key:"json",get:function(){return this.gltf.json}},{key:"getApplicationData",value:function(t){return this.json[t]}},{key:"getExtraData",value:function(t){return(this.json.extras||{})[t]}},{key:"getExtension",value:function(t){var e=this.getUsedExtensions().find((function(e){return e===t})),n=this.json.extensions||{};return e?n[t]||!0:null}},{key:"getRequiredExtension",value:function(t){return this.getRequiredExtensions().find((function(e){return e===t}))?this.getExtension(t):null}},{key:"getRequiredExtensions",value:function(){return this.json.extensionsRequired||[]}},{key:"getUsedExtensions",value:function(){return this.json.extensionsUsed||[]}},{key:"getObjectExtension",value:function(t,e){return(t.extensions||{})[e]}},{key:"getScene",value:function(t){return this.getObject("scenes",t)}},{key:"getNode",value:function(t){return this.getObject("nodes",t)}},{key:"getSkin",value:function(t){return this.getObject("skins",t)}},{key:"getMesh",value:function(t){return this.getObject("meshes",t)}},{key:"getMaterial",value:function(t){return this.getObject("materials",t)}},{key:"getAccessor",value:function(t){return this.getObject("accessors",t)}},{key:"getTexture",value:function(t){return this.getObject("textures",t)}},{key:"getSampler",value:function(t){return this.getObject("samplers",t)}},{key:"getImage",value:function(t){return this.getObject("images",t)}},{key:"getBufferView",value:function(t){return this.getObject("bufferViews",t)}},{key:"getBuffer",value:function(t){return this.getObject("buffers",t)}},{key:"getObject",value:function(t,e){if("object"===typeof e)return e;var 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}},{key:"getTypedArrayForBufferView",value:function(t){var e=(t=this.getBufferView(t)).buffer,n=this.gltf.buffers[e];pt(n);var r=(t.byteOffset||0)+n.byteOffset;return new Uint8Array(n.arrayBuffer,r,t.byteLength)}},{key:"getTypedArrayForAccessor",value:function(t){t=this.getAccessor(t);var e=this.getBufferView(t.bufferView),n=this.getBuffer(e.buffer).data,r=It(t,e),i=r.ArrayType,o=r.length;return new i(n,e.byteOffset+t.byteOffset,o)}},{key:"getTypedArrayForImageData",value:function(t){t=this.getAccessor(t);var e=this.getBufferView(t.bufferView),n=this.getBuffer(e.buffer).data,r=e.byteOffset||0;return new Uint8Array(n,r,e.byteLength)}},{key:"addApplicationData",value:function(t,e){return this.json[t]=e,this}},{key:"addExtraData",value:function(t,e){return this.json.extras=this.json.extras||{},this.json.extras[t]=e,this}},{key:"addObjectExtension",value:function(t,e,n){return t.extensions=t.extensions||{},t.extensions[e]=n,this.registerUsedExtension(e),this}},{key:"setObjectExtension",value:function(t,e,n){(t.extensions||{})[e]=n}},{key:"removeObjectExtension",value:function(t,e){var n=t.extensions||{},r=n[e];return delete n[e],r}},{key:"addExtension",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return pt(e),this.json.extensions=this.json.extensions||{},this.json.extensions[t]=e,this.registerUsedExtension(t),e}},{key:"addRequiredExtension",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return pt(e),this.addExtension(t,e),this.registerRequiredExtension(t),e}},{key:"registerUsedExtension",value:function(t){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find((function(e){return e===t}))||this.json.extensionsUsed.push(t)}},{key:"registerRequiredExtension",value:function(t){this.registerUsedExtension(t),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find((function(e){return e===t}))||this.json.extensionsRequired.push(t)}},{key:"removeExtension",value:function(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]}},{key:"setDefaultScene",value:function(t){this.json.scene=t}},{key:"addScene",value:function(t){var e=t.nodeIndices;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:e}),this.json.scenes.length-1}},{key:"addNode",value:function(t){var e=t.meshIndex,n=t.matrix;this.json.nodes=this.json.nodes||[];var r={mesh:e};return n&&(r.matrix=n),this.json.nodes.push(r),this.json.nodes.length-1}},{key:"addMesh",value:function(t){var e=t.attributes,n=t.indices,r=t.material,i=t.mode,o=void 0===i?4:i,a={primitives:[{attributes:this._addAttributes(e),mode:o}]};if(n){var s=this._addIndices(n);a.primitives[0].indices=s}return Number.isFinite(r)&&(a.primitives[0].material=r),this.json.meshes=this.json.meshes||[],this.json.meshes.push(a),this.json.meshes.length-1}},{key:"addPointCloud",value:function(t){var 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}},{key:"addImage",value:function(t,e){var n=(0,yt.I)(t),r=e||(null===n||void 0===n?void 0:n.mimeType),i={bufferView:this.addBufferView(t),mimeType:r};return this.json.images=this.json.images||[],this.json.images.push(i),this.json.images.length-1}},{key:"addBufferView",value:function(t){var e=t.byteLength;pt(Number.isFinite(e)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(t);var n={buffer:0,byteOffset:this.byteLength,byteLength:e};return this.byteLength+=bt(e,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(n),this.json.bufferViews.length-1}},{key:"addAccessor",value:function(t,e){var n={bufferView:t,type:Tt(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}},{key:"addBinaryBuffer",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{size:3},n=this.addBufferView(t),r={min:e.min,max:e.max};r.min&&r.max||(r=this._getAccessorMinMax(t,e.size));var i={size:e.size,componentType:Mt(t),count:Math.round(t.length/e.size),min:r.min,max:r.max};return this.addAccessor(n,Object.assign(i,e))}},{key:"addTexture",value:function(t){var e={source:t.imageIndex};return this.json.textures=this.json.textures||[],this.json.textures.push(e),this.json.textures.length-1}},{key:"addMaterial",value:function(t){return this.json.materials=this.json.materials||[],this.json.materials.push(t),this.json.materials.length-1}},{key:"createBinaryChunk",value:function(){var t,e;this.gltf.buffers=[];var n,r=this.byteLength,i=new ArrayBuffer(r),o=new Uint8Array(i),a=0,s=(0,p.Z)(this.sourceBuffers||[]);try{for(s.s();!(n=s.n()).done;){a=xt(n.value,o,a)}}catch(u){s.e(u)}finally{s.f()}null!==(t=this.json)&&void 0!==t&&null!==(e=t.buffers)&&void 0!==e&&e[0]?this.json.buffers[0].byteLength=r:this.json.buffers=[{byteLength:r}
2],this.gltf.binary=i,this.sourceBuffers=[i]}},{key:"_removeStringFromArray",value:function(t,e){for(var n=!0;n;){var r=t.indexOf(e);r>-1?t.splice(r,1):n=!1}}},{key:"_addAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e={};for(var n in t){var r=t[n],i=this._getGltfAttributeName(n),o=this.addBinaryBuffer(r.value,r);e[i]=o}return e}},{key:"_addIndices",value:function(t){return this.addBinaryBuffer(t,{size:1})}},{key:"_getGltfAttributeName",value:function(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}}},{key:"_getAccessorMinMax",value:function(t,e){var n={min:null,max:null};if(t.length<e)return n;n.min=[],n.max=[];var r,i=t.subarray(0,e),o=(0,p.Z)(i);try{for(o.s();!(r=o.n()).done;){var a=r.value;n.min.push(a),n.max.push(a)}}catch(l){o.e(l)}finally{o.f()}for(var s=e;s<t.length;s+=e)for(var u=0;u<e;u++)n.min[0+u]=Math.min(n.min[0+u],t[s+u]),n.max[0+u]=Math.max(n.max[0+u],t[s+u]);return n}}]),t}(),Lt="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9
2LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+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",Ot
vendor: 10,662 bytes, line 2
2="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",
2Ft=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]),zt={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"};function Nt(t,e,n,r,i){return Gt.apply(this,arguments)}function Gt(){return Gt=(0,f.Z)((0,c.Z)().mark((function t(e,n,r,i,o){var a,s,u=arguments;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=u.length>5&&void 0!==u[5]?u[5]:"NONE",t.next=3,jt();case 3:Qt(s=t.sent,s.exports[Ut[o]],e,n,r,i,s.exports[zt[a||"NONE"]]);case 5:case"end":return t.stop()}}),t)}))),Gt.apply(this,arguments)}function jt(){return Vt.apply(this,arguments)}function Vt(){return(Vt=(0,f.Z)((0,c.Z)().mark((function t(){return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Pt||(Pt=Ht()),t.abrupt("return",Pt);case 2:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Ht(){return Jt.apply(this,arguments)}function Jt(){return(Jt=(0,f.Z)((0,c.Z)().mark((function t(){var e,n;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=Lt,WebAssembly.validate(Ft)&&(e=Ot,console.log("Warning: meshopt_decoder is using experimental SIMD support")),t.next=4,WebAssembly.instantiate(Wt(e),{});case 4:return n=t.sent,t.next=7,n.instance.exports.__wasm_call_ctors();case 7:return t.abrupt("return",n.instance);case 8:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Wt(t){for(var e=new Uint8Array(t.length),n=0;n<t.length;++n){var r=t.charCodeAt(n);e[n]=r>96?r-71:r>64?r-65:r>47?r+4:r>46?63:62}for(var i=0,o=0;o<t.length;++o)e[i++]=e[o]<60?Rt[e[o]]:64*(e[o]-60)+e[++o];return e.buffer.slice(0,i)}function Qt(t,e,n,r,i,o,a){var s=t.exports.sbrk,u=r+3&-4,l=s(u*i),c=s(o.length),h=new Uint8Array(t.exports.memory.buffer);h.set(o,c);var f=e(l,r,i,c,o.length);if(0===f&&a&&a(l,u,i),n.set(h.subarray(l,l+r*i)),s(l-s(0)),0!==f)throw new Error("Malformed buffer data: ".concat(f))}var qt="EXT_meshopt_compression",Kt=qt;function Xt(t,e){return Yt.apply(this,arguments)}function Yt(){return(Yt=(0,f.Z)((0,c.Z)().mark((function t(e,n){var r,i,o,a,s,u;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=new Dt(e),null!==n&&void 0!==n&&null!==(r=n.gltf)&&void 0!==r&&r.decompressMeshes){t.next=3;break}return t.abrupt("return");case 3:o=[],a=(0,p.Z)(e.json.bufferViews||[]);try{for(a.s();!(s=a.n()).done;)u=s.value,o.push($t(i,u))}catch(l){a.e(l)}finally{a.f()}return t.next=8,Promise.all(o);case 8:i.removeExtension(qt);case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function $t(t,e){return te.apply(this,arguments)}function te(){return(te=(0,f.Z)((0,c.Z)().mark((function t(e,n){var r,i,o,a,s,u,l,h,f,p,d,A,v,g;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(r=e.getObjectExtension(n,qt))){t.next=9;break}return i=r.byteOffset,o=void 0===i?0:i,a=r.byteLength,s=void 0===a?0:a,u=r.byteStride,l=r.count,h=r.mode,f=r.filter,p=void 0===f?"NONE":f,d=r.buffer,A=e.gltf.buffers[d],v=new Uint8Array(A.arrayBuffer,A.byteOffset+o,s),g=new Uint8Array(e.gltf.buffers[n.buffer].arrayBuffer,n.byteOffset,n.byteLength),t.next=8,Nt(g,l,u,v,h,p);case 8:return t.abrupt("return",g);case 9:return t.abrupt("return",null);case 10:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var ee=n(80285),ne=["image/png","image/jpeg","image/gif"],re={};function ie(t){return void 0===re[t]&&(re[t]=function(t){switch(t){case"image/webp":return function(){if(!ee.jU)return!1;try{return 0===document.createElement("canvas").toDataURL("image/webp").indexOf("data:image/webp")}catch(t){return!1}}();case"image/svg":return ee.jU;default:if(!ee.jU){var e=globalThis._parseImageNode;return Boolean(e)&&ne.includes(t)}return!0}}(t)),re[t]}var oe="EXT_texture_webp",ae=oe;function se(t,e){var n=new Dt(t);if(ie("image/webp")){var r,i=n.json,o=(0,p.Z)(i.textures||[]);try{for(o.s();!(r=o.n()).done;){var a=r.value,s=n.getObjectExtension(a,oe);s&&(a.source=s.source),n.removeObjectExtension(a,oe)}}catch(u){o.e(u)}finally{o.f()}n.removeExtension(oe)}else if(n.getRequiredExtensions().includes(oe))throw new Error("gltf: Required extension ".concat(oe," not supported by browser"))}var ue="KHR_texture_basisu",le=ue;function ce(t,e){var n,r=new Dt(t),i=r.json,o=(0,p.Z)(i.textures||[]);try{for(o.s();!(n=o.n()).done;){var a=n.value,s=r.getObjectExtension(a,ue);s&&(a.source=s.source),r.removeObjectExtension(a,ue)}}catch(u){o.e(u)}finally{o.f()}r.removeExtension(ue)}var he="3.2.13",fe={name:"Draco",id:"draco",module:"draco",shapes:["mesh"],version:he,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}}}
2,pe=n(649);var de,Ae=function(){function t(e,n){var r=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,t),(0,mt.Z)(this,"name",void 0),(0,mt.Z)(this,"type",void 0),(0,mt.Z)(this,"nullable",void 0),(0,mt.Z)(this,"metadata",void 0),this.name=e,this.type=n,this.nullable=r,this.metadata=i}return(0,gt.Z)(t,[{key:"typeId",get:function(){return this.type&&this.type.typeId}},{key:"clone",value:function(){return new t(this.name,this.type,this.nullable,this.metadata)}},{key:"compareTo",value:function(t){return this.name===t.name&&this.type===t.type&&this.nullable===t.nullable&&this.metadata===t.metadata}},{key:"toString",value:function(){return"".concat(this.type).concat(this.nullable?", nullable":"").concat(this.metadata?", metadata: ".concat(this.metadata):"")}}]),t}(),ve=n(47169),ge=n(67591),me=n(94337);!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"}(de||(de={}));var ye=function(){function t(){(0,vt.Z)(this,t)}return(0,gt.Z)(t,[{key:"typeId",get:function(){return de.NONE}},{key:"compareTo",value:function(t){return this===t}}],[{key:"isNull",value:function(t){return t&&t.typeId===de.Null}},{key:"isInt",value:function(t){return t&&t.typeId===de.Int}},{key:"isFloat",value:function(t){return t&&t.typeId===de.Float}},{key:"isBinary",value:function(t){return t&&t.typeId===de.Binary}},{key:"isUtf8",value:function(t){return t&&t.typeId===de.Utf8}},{key:"isBool",value:function(t){return t&&t.typeId===de.Bool}},{key:"isDecimal",value:function(t){return t&&t.typeId===de.Decimal}},{key:"isDate",value:function(t){return t&&t.typeId===de.Date}},{key:"isTime",value:function(t){return t&&t.typeId===de.Time}},{key:"isTimestamp",value:function(t){return t&&t.typeId===de.Timestamp}},{key:"isInterval",value:function(t){return t&&t.typeId===de.Interval}},{key:"isList",value:function(t){return t&&t.typeId===de.List}},{key:"isStruct",value:function(t){return t&&t.typeId===de.Struct}},{key:"isUnion",value:function(t){return t&&t.typeId===de.Union}},{key:"isFixedSizeBinary",value:function(t){return t&&t.typeId===de.FixedSizeBinary}},{key:"isFixedSizeList",value:function(t){return t&&t.typeId===de.FixedSizeList}},{key:"isMap",value:function(t){return t&&t.typeId===de.Map}},{key:"isDictionary",value:function(t){return t&&t.typeId===de.Dictionary}}]),t}(),_e=(Symbol.toStringTag,Symbol.toStringTag,function(t,e){(0,ge.Z)(r,t);var n=(0,me.Z)(r);function r(t,e){var i;return(0,vt.Z)(this,r),i=n.call(this),(0,mt.Z)((0,ve.Z)(i),"isSigned",void 0),(0,mt.Z)((0,ve.Z)(i),"bitWidth",void 0),i.isSigned=t,i.bitWidth=e,i}return(0,gt.Z)(r,[{key:"typeId",get:function(){return de.Int}},{key:e,get:function(){return"Int"}},{key:"toString",value:function(){return"".concat(this.isSigned?"I":"Ui","nt").concat(this.bitWidth)}}]),r}(ye,Symbol.toStringTag)),be=function(t){(0,ge.Z)(n,t);var e=(0,me.Z)(n);function n(){return(0,vt.Z)(this,n),e.call(this,!0,8)}return(0,gt.Z)(n)}(_e),xe=function(t){(0,ge.Z)(n,t);var e=(0,me.Z)(n);function n(){return(0,vt.Z)(this,n),e.call(this,!0,16)}return(0,gt.Z)(n)}(_e),we=function(t){(0,ge.Z)(n,t);var e=(0,me.Z)(n);function n(){return(0,vt.Z)(this,n),e.call(this,!0,32)}return(0,gt.Z)(n)}(_e),Ce=function(t){(0,ge.Z)(n,t);var e=(0,me.Z)(n);function n(){return(0,vt.Z)(this,n),e.call(this,!1,8)}return(0,gt.Z)(n)}(_e),Be=function(t){(0,ge.Z)(n,t);var e=(0,me.Z)(n);function n(){return(0,vt.Z)(this,n),e.call(this,!1,16)}return(0,gt.Z)(n)}(_e),ke=function(t){(0,ge.Z)(n,t);var e=(0,me.Z)(n);function n(){return(0,vt.Z)(this,n),e.call(this,!1,32)}return(0,gt.Z)(n)}(_e),Ee=32,Se=64,Te=function(t,e){(0,ge.Z)(r,t);var n=(0,me.Z)(r);function r(t){var e;return(0,vt.Z)(this,r),e=n.call(this),(0,mt.Z)((0,ve.Z)(e),"precision",void 0),e.precision=t,e}return(0,gt.Z)(r,[{key:"typeId",get:function(){return de.Float}},{key:e,get:function(){return"Float"}},{key:"toString",value:function(){return"Float".concat(this.precision)}}]),r}(ye,Symbol.toStringTag),Me=function(t){(0,ge.Z)(n,t);var e=(0,me.Z)(n);function n(){return(0,vt.Z)(this,n),e.call(this,Ee)}return(0,gt.Z)(n)}(Te),Ie=function(t){(0,ge.Z)(n,t);var e=(0,me.Z)(n);function n(){return(0,vt.Z)(this,n),e.call(this,Se)}return(0,gt.Z)(n)}(Te);Symbol.toStringTag,Symbol.toStringTag;Symbol.toStringTag;Symbol.toStringTag;Symbol.toStringTag;Symbol.toStringTag;var Pe=function(t,e){(0,ge.Z)(r,t);var n=(0,me.Z)(r);function r(t,e){var i;return(0,vt.Z)(this,r),i=n.call(this),(0,mt.Z)((0,ve.Z)(i),"listSize",void 0),(0,mt.Z)((0,ve.Z)(i),"children",void 0),i.listSize=t,i.children=[e],i}return(0,gt.Z)(r,[{key:"typeId",get:function(){return de.FixedSizeList}},{key:"valueType",get:function(){return this.children[0].type}},{key:"valueField",get:function(){return this.children[0]}},{key:e,get:function(){return"FixedSizeList"}},{key:"toString",value:function(){return"FixedSizeList[".concat(this.listSize,"]<").concat(this.valueType,">")}}]),r}(ye,Symbol.toStringTag);Symbol.toStringTag;function Ze(t,e,n){var r=function(t){switch(t.constructor){case Int8Array:return new be;case Uint8Array:return new Ce;case Int16Array:return new xe;case Uint16Array:return new Be;case Int32Array:return new we;case Uint32Array:return new ke;case Float32Array:return new Me;case Float64Array:return new Ie;default:throw new Error("array type not supported")}}(e.value),i=n||function(t){var 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 Ae(t,new Pe(e.size,new Ae("value",r)),!1,i)}var De=function(){function t(e,n){(0,vt.Z)(this,t),(0,mt.Z)(this,"fields",void 0),(0,mt.Z)(this,"metadata",void 0),function(t,e){if(!t)throw new Error(e||"loader assertion failed.")}(Array.isArray(e)),function(t){var e,n={},r=(0,p.Z)(t);try{for(r.s();!(e=r.n()).done;){var i=e.value;n[i.name]&&console.warn("Schema: duplicated field name",i.name,i),n[i.name]=!0}}catch(o){r.e(o)}finally{r.f()}}(e),this.fields=e,this.metadata=n||new Map}
2return(0,gt.Z)(t,[{key:"compareTo",value:function(t){if(this.metadata!==t.metadata)return!1;if(this.fields.length!==t.fields.length)return!1;for(var e=0;e<this.fields.length;++e)if(!this.fields[e].compareTo(t.fields[e]))return!1;return!0}},{key:"select",value:function(){for(var e=Object.create(null),n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];for(var o=0,a=r;o<a.length;o++){var s=a[o];e[s]=!0}return new t(this.fields.filter((function(t){return e[t.name]})),this.metadata)}},{key:"selectAt",value:function(){for(var e=this,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return new t(r.map((function(t){return e.fields[t]})).filter(Boolean),this.metadata)}},{key:"assign",value:function(e){var n,r=this.metadata;if(e instanceof t){var i=e;n=i.fields,r=Le(Le(new Map,this.metadata),i.metadata)}else n=e;var o,a=Object.create(null),s=(0,p.Z)(this.fields);try{for(s.s();!(o=s.n()).done;){var u=o.value;a[u.name]=u}}catch(f){s.e(f)}finally{s.f()}var l,c=(0,p.Z)(n);try{for(c.s();!(l=c.n()).done;){var h=l.value;a[h.name]=h}}catch(f){c.e(f)}finally{c.f()}return new t(Object.values(a),r)}}]),t}();function Le(t,e){return new Map([].concat((0,pe.Z)(t||new Map),(0,pe.Z)(e||new Map)))}function Oe(t,e,n){return Ze(t,e,n?Fe(n.metadata):void 0)}function Fe(t){var e=new Map;for(var n in t)e.set("".concat(n,".string"),JSON.stringify(t[n]));return e}var Re={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},ze={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},Ue=function(){function t(e){(0,vt.Z)(this,t),(0,mt.Z)(this,"draco",void 0),(0,mt.Z)(this,"decoder",void 0),(0,mt.Z)(this,"metadataQuerier",void 0),this.draco=e,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}return(0,gt.Z)(t,[{key:"destroy",value:function(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}},{key:"parseSync",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new this.draco.DecoderBuffer;n.Init(new Int8Array(t),t.byteLength),this._disableAttributeTransforms(e);var r=this.decoder.GetEncodedGeometryType(n),i=r===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{var o;switch(r){case this.draco.TRIANGULAR_MESH:o=this.decoder.DecodeBufferToMesh(n,i);break;case this.draco.POINT_CLOUD:o=this.decoder.DecodeBufferToPointCloud(n,i);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!o.ok()||!i.ptr){var a="DRACO decompression failed: ".concat(o.error_msg());throw new Error(a)}var s=this._getDracoLoaderData(i,r,e),u=this._getMeshData(i,s,e),l=function(t){for(var e=1/0,n=1/0,r=1/0,i=-1/0,o=-1/0,a=-1/0,s=t.POSITION?t.POSITION.value:[],u=s&&s.length,l=0;l<u;l+=3){var c=s[l],h=s[l+1],f=s[l+2];e=c<e?c:e,n=h<n?h:n,r=f<r?f:r,i=c>i?c:i,o=h>o?h:o,a=f>a?f:a}return[[e,n,r],[i,o,a]]}(u.attributes),c=function(t,e,n){var r=Fe(e.metadata),i=[],o=function(t){var e={};for(var n in t){var r=t[n];e[r.name||"undefined"]=r}return e}(e.attributes);for(var a in t){var s=Oe(a,t[a],o[a]);i.push(s)}if(n){var u=Oe("indices",n);i.push(u)}return new De(i,r)}(u.attributes,s,u.indices);return(0,h.Z)((0,h.Z)({loader:"draco",loaderData:s,header:{vertexCount:i.num_points(),boundingBox:l}},u),{},{schema:c})}finally{this.draco.destroy(n),i&&this.draco.destroy(i)}}},{key:"_getDracoLoaderData",value:function(t,e,n){var r=this._getTopLevelMetadata(t),i=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:r,attributes:i}}},{key:"_getDracoAttributes",value:function(t,e){for(var n={},r=0;r<t.num_attributes();r++){var i=this.decoder.GetAttribute(t,r),o=this._getAttributeMetadata(t,r);n[i.unique_id()]={unique_id:i.unique_id(),attribute_type:i.attribute_type(),data_type:i.data_type(),num_components:i.num_components(),byte_offset:i.byte_offset(),byte_stride:i.byte_stride(),normalized:i.normalized(),attribute_index:r,metadata:o};var a=this._getQuantizationTransform(i,e);a&&(n[i.unique_id()].quantization_transform=a);var s=this._getOctahedronTransform(i,e);
2s&&(n[i.unique_id()].octahedron_transform=s)}return n}},{key:"_getMeshData",value:function(t,e,n){var r=this._getMeshAttributes(e,t,n);if(!r.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:r,indices:{value:this._getTriangleStripIndices(t),size:1}}:{topology:"triangle-list",mode:5,attributes:r,indices:{value:this._getTriangleListIndices(t),size:1}}:{topology:"point-list",mode:0,attributes:r}}},{key:"_getMeshAttributes",value:function(t,e,n){for(var r={},i=0,o=Object.values(t.attributes);i<o.length;i++){var a=o[i],s=this._deduceAttributeName(a,n);a.name=s;var u=this._getAttributeValues(e,a),l=u.value,c=u.size;r[s]={value:l,size:c,byteOffset:a.byte_offset,byteStride:a.byte_stride,normalized:a.normalized}}return r}},{key:"_getTriangleListIndices",value:function(t){var e=3*t.num_faces(),n=4*e,r=this.draco._malloc(n);try{return this.decoder.GetTrianglesUInt32Array(t,n,r),new Uint32Array(this.draco.HEAPF32.buffer,r,e).slice()}finally{this.draco._free(r)}}},{key:"_getTriangleStripIndices",value:function(t){var e=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(t,e),function(t){for(var e=t.size(),n=new Int32Array(e),r=0;r<e;r++)n[r]=t.GetValue(r);return n}(e)}finally{this.draco.destroy(e)}}},{key:"_getAttributeValues",value:function(t,e){var n,r=ze[e.data_type],i=e.num_components,o=t.num_points()*i,a=o*r.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,r),u=this.draco._malloc(a);try{var l=this.decoder.GetAttribute(t,e.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(t,l,s,a,u),n=new r(this.draco.HEAPF32.buffer,u,o).slice()}finally{this.draco._free(u)}return{value:n,size:i}}},{key:"_deduceAttributeName",value:function(t,e){for(var n=t.unique_id,r=0,i=Object.entries(e.extraAttributes||{});r<i.length;r++){var o=(0,d.Z)(i[r],2),a=o[0];if(o[1]===n)return a}var s=t.attribute_type;for(var u in Re){if(this.draco[u]===s)return Re[u]}var l=e.attributeNameEntry||"name";return t.metadata[l]?t.metadata[l].string:"CUSTOM_ATTRIBUTE_".concat(n)}},{key:"_getTopLevelMetadata",value:function(t){var e=this.decoder.GetMetadata(t);return this._getDracoMetadata(e)}},{key:"_getAttributeMetadata",value:function(t,e){var n=this.decoder.GetAttributeMetadata(t,e);return this._getDracoMetadata(n)}},{key:"_getDracoMetadata",value:function(t){if(!t||!t.ptr)return{};for(var e={},n=this.metadataQuerier.NumEntries(t),r=0;r<n;r++){var i=this.metadataQuerier.GetEntryName(t,r);e[i]=this._getDracoMetadataField(t,i)}return e}},{key:"_getDracoMetadataField",value:function(t,e){var n=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(t,e,n);var r=function(t){for(var e=t.size(),n=new Int32Array(e),r=0;r<e;r++)n[r]=t.GetValue(r);return n}(n);return{int:this.metadataQuerier.GetIntEntry(t,e),string:this.metadataQuerier.GetStringEntry(t,e),double:this.metadataQuerier.GetDoubleEntry(t,e),intArray:r}}finally{this.draco.destroy(n)}}},{key:"_disableAttributeTransforms",value:function(t){var e,n=t.quantizedAttributes,r=void 0===n?[]:n,i=t.octahedronAttributes,o=void 0===i?[]:i,a=[].concat((0,pe.Z)(r),(0,pe.Z)(o)),s=(0,p.Z)(a);try{for(s.s();!(e=s.n()).done;){var u=e.value;this.decoder.SkipAttributeTransform(this.draco[u])}}catch(l){s.e(l)}finally{s.f()}}},{key:"_getQuantizationTransform",value:function(t,e){var n=this,r=e.quantizedAttributes,i=void 0===r?[]:r,o=t.attribute_type();if(i.map((function(t){return n.decoder[t]})).includes(o)){var a=new this.draco.AttributeQuantizationTransform;try{if(a.InitFromAttribute(t))return{quantization_bits:a.quantization_bits(),range:a.range(),min_values:new Float32Array([1,2,3]).map((function(t){return a.min_value(t)}))}}finally{this.draco.destroy(a)}}return null}},{key:"_getOctahedronTransform",value:function(t,e){var n=this,r=e.octahedronAttributes,i=void 0===r?[]:r,o=t.attribute_type();if(i.map((function(t){return n.decoder[t]})).includes(o)){var a=new this.draco.AttributeQuantizationTransform;try{if(a.InitFromAttribute(t))return{quantization_bits:a.quantization_bits()}}finally{this.draco.destroy(a)}}return null}}]),t}();
2var Ne,Ge="1.4.1",je="https://www.gstatic.com/draco/versioned/decoders/".concat(Ge,"/draco_decoder.js"),Ve="https://www.gstatic.com/draco/versioned/decoders/".concat(Ge,"/draco_wasm_wrapper.js"),He="https://www.gstatic.com/draco/versioned/decoders/".concat(Ge,"/draco_decoder.wasm");"https://raw.githubusercontent.com/google/draco/".concat(Ge,"/javascript/draco_encoder.js");function Je(t){return We.apply(this,arguments)}function We(){return(We=(0,f.Z)((0,c.Z)().mark((function t(e){var n;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.modules||{},Ne=n.draco3d?Ne||n.draco3d.createDecoderModule({}).then((function(t){return{draco:t}})):Ne||Qe(e),t.next=4,Ne;case 4:return t.abrupt("return",t.sent);case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Qe(t){return qe.apply(this,arguments)}function qe(){return(qe=(0,f.Z)((0,c.Z)().mark((function t(e){var n,r,i,o;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:t.t0=e.draco&&e.draco.decoderType,t.next="js"===t.t0?3:(t.t0,7);break;case 3:return t.next=5,_(je,"draco",e);case 5:return n=t.sent,t.abrupt("break",21);case 7:return t.t1=Promise,t.next=10,_(Ve,"draco",e);case 10:return t.t2=t.sent,t.next=13,_(He,"draco",e);case 13:return t.t3=t.sent,t.t4=[t.t2,t.t3],t.next=17,t.t1.all.call(t.t1,t.t4);case 17:i=t.sent,o=(0,d.Z)(i,2),n=o[0],r=o[1];case 21:return n=n||globalThis.DracoDecoderModule,t.next=24,Ke(n,r);case 24:return t.abrupt("return",t.sent);case 25:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Ke(t,e){var n={};return e&&(n.wasmBinary=e),new Promise((function(e){t((0,h.Z)((0,h.Z)({},n),{},{onModuleLoaded:function(t){return e({draco:t})}}))}))}A.jU;var Xe=(0,h.Z)((0,h.Z)({},fe),{},{parse:function(t,e){return Ye.apply(this,arguments)}});function Ye(){return(Ye=(0,f.Z)((0,c.Z)().mark((function t(e,n){var r,i,o;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Je(n);case 2:return r=t.sent,i=r.draco,o=new Ue(i),t.prev=5,t.abrupt("return",o.parseSync(e,null===n||void 0===n?void 0:n.draco));case 7:return t.prev=7,o.destroy(),t.finish(7);case 10:case"end":return t.stop()}}),t,null,[[5,,7,10]])})))).apply(this,arguments)}function $e(t){var e={};for(var n in t){var r=t[n];if("indices"!==n){var i=tn(r);e[n]=i}}return e}function tn(t){var e=function(t){var e=t,n=1,r=0;t&&t.value&&(e=t.value,n=t.size||1);e&&(ArrayBuffer.isView(e)||(e=function(t,e){var 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)),r=e.length/n);return{buffer:e,size:n,count:r}}(t),n=e.buffer,r=e.size;return{value:n,size:r,byteOffset:0,count:e.count,type:Tt(r),componentType:Mt(n)}}var en=(0,c.Z)().mark(pn),nn="KHR_draco_mesh_compression",rn=nn;function on(t,e,n){var r,i=new Dt(t),o=(0,p.Z)(pn(i));try{for(o.s();!(r=o.n()).done;){var a=r.value;i.getObjectExtension(a,nn)}}catch(s){o.e(s)}finally{o.f()}}function an(t,e,n){return sn.apply(this,arguments)}function sn(){return(sn=(0,f.Z)((0,c.Z)().mark((function t(e,n,r){var i,o,a,s,u,l;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null!==n&&void 0!==n&&null!==(i=n.gltf)&&void 0!==i&&i.decompressMeshes){t.next=2;break}return t.abrupt("return");case 2:o=new Dt(e),a=[],s=(0,p.Z)(pn(o));try{for(s.s();!(u=s.n()).done;)l=u.value,o.getObjectExtension(l,nn)&&a.push(ln(o,l,n,r))}catch(c){s.e(c)}finally{s.f()}return t.next=8,Promise.all(a);case 8:o.removeExtension(nn);case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function un(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}
2,r=new Dt(t),i=(0,p.Z)(r.json.meshes||[]);try{for(i.s();!(e=i.n()).done;){hn(e.value,n),r.addRequiredExtension(nn)}}catch(o){i.e(o)}finally{i.f()}}function ln(t,e,n,r){return cn.apply(this,arguments)}function cn(){return cn=(0,f.Z)((0,c.Z)().mark((function t(e,n,r,i){var o,a,s,u,l,f,p,A,v,g,m,y,_,b;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=e.getObjectExtension(n,nn)){t.next=3;break}return t.abrupt("return");case 3:return a=e.getTypedArrayForBufferView(o.bufferView),s=ft(a.buffer,a.byteOffset),u=i.parse,delete(l=(0,h.Z)({},r))["3d-tiles"],t.next=10,u(s,Xe,l,i);case 10:for(f=t.sent,p=$e(f.attributes),A=0,v=Object.entries(p);A<v.length;A++)g=(0,d.Z)(v[A],2),m=g[0],y=g[1],m in n.attributes&&(_=n.attributes[m],null!==(b=e.getAccessor(_))&&void 0!==b&&b.min&&null!==b&&void 0!==b&&b.max&&(y.min=b.min,y.max=b.max));n.attributes=p,f.indices&&(n.indices=tn(f.indices)),fn(n);case 16:case"end":return t.stop()}}),t)}))),cn.apply(this,arguments)}function hn(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4,i=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;if(!i.DracoWriter)throw new Error("options.gltf.DracoWriter not provided");var a=i.DracoWriter.encodeSync({attributes:t}),s=null===o||void 0===o||null===(n=o.parseSync)||void 0===n?void 0:n.call(o,{attributes:t}),u=i._addFauxAttributes(s.attributes),l=i.addBufferView(a);return{primitives:[{attributes:u,mode:r,extensions:(0,mt.Z)({},nn,{bufferView:l,attributes:u})}]}}function fn(t){if(!t.attributes&&Object.keys(t.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function pn(t){var e,n,r,i,o,a;return(0,c.Z)().wrap((function(s){for(;;)switch(s.prev=s.next){case 0:e=(0,p.Z)(t.json.meshes||[]),s.prev=1,e.s();case 3:if((n=e.n()).done){s.next=24;break}r=n.value,i=(0,p.Z)(r.primitives),s.prev=6,i.s();case 8:if((o=i.n()).done){s.next=14;break}return a=o.value,s.next=12,a;case 12:s.next=8;break;case 14:s.next=19;break;case 16:s.prev=16,s.t0=s.catch(6),i.e(s.t0);case 19:return s.prev=19,i.f(),s.finish(19);case 22:s.next=3;break;case 24:s.next=29;break;case 26:s.prev=26,s.t1=s.catch(1),e.e(s.t1);case 29:return s.prev=29,e.f(),s.finish(29);case 32:case"end":return s.stop()}}),en,null,[[1,26,29,32],[6,16,19,22]])}var dn="KHR_lights_punctual",An=dn;function vn(t){return gn.apply(this,arguments)}function gn(){return(gn=(0,f.Z)((0,c.Z)().mark((function t(e){var n,r,i,o,a,s,u;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=new Dt(e),r=n.json,(i=n.getExtension(dn))&&(n.json.lights=i.lights,n.removeExtension(dn)),o=(0,p.Z)(r.nodes||[]);try{for(o.s();!(a=o.n()).done;)s=a.value,(u=n.getObjectExtension(s,dn))&&(s.light=u.light),n.removeObjectExtension(s,dn)}catch(l){o.e(l)}finally{o.f()}case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function mn(t){return yn.apply(this,arguments)}function yn(){return(yn=(0,f.Z)((0,c.Z)().mark((function t(e){var n,r,i,o,a,s,u;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=new Dt(e),(r=n.json).lights&&(pt(!(i=n.addExtension(dn)).lights),i.lights=r.lights,delete r.lights),n.json.lights){o=(0,p.Z)(n.json.lights);try{for(o.s();!(a=o.n()).done;)s=a.value,u=s.node,n.addObjectExtension(u,dn,s)}catch(l){o.e(l)}finally{o.f()}delete n.json.lights}case 4:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var _n="KHR_materials_unlit",bn=_n;function xn(t){return wn.apply(this,arguments)}function wn(){return(wn=(0,f.Z)((0,c.Z)().mark((function t(e){var n,r,i,o,a;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=new Dt(e),r=n.json,n.removeExtension(_n),i=(0,p.Z)(r.materials||[]);try{for(i.s();!(o=i.n()).done;)a=o.value,a.extensions&&a.extensions.KHR_materials_unlit&&(a.unlit=!0),n.removeObjectExtension(a,_n)}catch(s){i.e(s)}finally{i.f()}case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Cn(t){var e=new Dt(t),n=e.json;if(e.materials){var r,i=(0,p.Z)(n.materials||[]);try{for(i.s();!(r=i.n()).done;){var o=r.value;o.unlit&&(delete o.unlit,e.addObjectExtension(o,_n,{}),e.addExtension(_n))}}catch(a){i.e(a)}finally{i.f()}}}var Bn="KHR_techniques_webgl",kn=Bn;function En(t){return Sn.apply(this,arguments)}function Sn(){return(Sn=(0,f.Z)((0,c.Z)().mark((function t(e){var n,r,i,o,a,s,u,l;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=new Dt(e),r=n.json,i=n.getExtension(Bn)){o=In(i,n),a=(0,p.Z)(r.materials||[]);try{for(a.s();!(s=a.n()).done;)u=s.value,(l=n.getObjectExtension(u,Bn))&&(u.technique=Object.assign({},l,o[l.technique]),u.technique.values=Pn(u.technique,n)),n.removeObjectExtension(u,Bn)}catch(c){a.e(c)}finally{a.f()}n.removeExtension(Bn)}case 4:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Tn(t,e){return Mn.apply(this,arguments)}function Mn(){return(Mn=(0,f.Z)((0,c.Z)().mark((function t(e,n){return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function In(t,e){var n=t.programs,r=void 0===n?[]:n,i=t.shaders,o=void 0===i?[]:i,a=t.techniques,s=void 0===a?[]:a,u=new TextDecoder;return o.forEach((function(t){if(!Number.isFinite(t.bufferView))throw new Error("KHR_techniques_webgl: no shader code");t.code=u.decode(e.getTypedArrayForBufferView(t.bufferView))}
2)),r.forEach((function(t){t.fragmentShader=o[t.fragmentShader],t.vertexShader=o[t.vertexShader]})),s.forEach((function(t){t.program=r[t.program]})),s}function Pn(t,e){var n=Object.assign({},t.values);return Object.keys(t.uniforms||{}).forEach((function(e){t.uniforms[e].value&&!(e in n)&&(n[e]=t.uniforms[e].value)})),Object.keys(n).forEach((function(t){"object"===typeof n[t]&&void 0!==n[t].index&&(n[t].texture=e.getTexture(n[t].index))})),n}var Zn=[r,i,o,a,s,u,l];function Dn(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0,i=Zn.filter((function(t){return Fn(t.name,n)})),o=(0,p.Z)(i);try{for(o.s();!(e=o.n()).done;){var a,s=e.value;null===(a=s.preprocess)||void 0===a||a.call(s,t,n,r)}}catch(u){o.e(u)}finally{o.f()}}function Ln(t){return On.apply(this,arguments)}function On(){return On=(0,f.Z)((0,c.Z)().mark((function t(e){var n,r,i,o,a,s,u,l=arguments;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=l.length>1&&void 0!==l[1]?l[1]:{},r=l.length>2?l[2]:void 0,i=Zn.filter((function(t){return Fn(t.name,n)})),o=(0,p.Z)(i),t.prev=4,o.s();case 6:if((a=o.n()).done){t.next=12;break}return s=a.value,t.next=10,null===(u=s.decode)||void 0===u?void 0:u.call(s,e,n,r);case 10:t.next=6;break;case 12:t.next=17;break;case 14:t.prev=14,t.t0=t.catch(4),o.e(t.t0);case 17:return t.prev=17,o.f(),t.finish(17);case 20:case"end":return t.stop()}}),t,null,[[4,14,17,20]])}))),On.apply(this,arguments)}function Fn(t,e){var n,r=(null===e||void 0===e||null===(n=e.gltf)||void 0===n?void 0:n.excludeExtensions)||{};return!(t in r&&!r[t])}var Rn="KHR_binary_glTF";var zn,Un={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},Nn={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"},Gn=function(){function t(){(0,vt.Z)(this,t),(0,mt.Z)(this,"idToIndexMap",{animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}}),(0,mt.Z)(this,"json",void 0)}return(0,gt.Z)(t,[{key:"normalize",value:function(t,e){this.json=t.json;var 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){var e,n=new Dt(t),r=n.json,i=(0,p.Z)(r.images||[]);try{for(i.s();!(e=i.n()).done;){var o=e.value,a=n.getObjectExtension(o,Rn);a&&Object.assign(o,a),n.removeObjectExtension(o,Rn)}}catch(s){i.e(s)}finally{i.f()}r.buffers&&r.buffers[0]&&delete r.buffers[0].uri,n.removeExtension(Rn)}(t),this._convertObjectIdsToArrayIndices(n),this._updateObjects(n),this._updateMaterial(n)}},{key:"_addAsset",value:function(t){t.asset=t.asset||{},t.asset.version="2.0",t.asset.generator=t.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}},{key:"_convertTopLevelObjectsToArrays",value:function(t){for(var e in Un)this._convertTopLevelObjectToArray(t,e)}},{key:"_convertTopLevelObjectToArray",value:function(t,e){var n=t[e];if(n&&!Array.isArray(n))for(var r in t[e]=[],n){var i=n[r];i.id=i.id||r;var o=t[e].length;t[e].push(i),this.idToIndexMap[e][r]=o}}},{key:"_convertObjectIdsToArrayIndices",value:function(t){for(var e in Un)this._convertIdsToIndices(t,e);"scene"in t&&(t.scene=this._convertIdToIndex(t.scene,"scene"));var n,r=(0,p.Z)(t.textures);try{for(r.s();!(n=r.n()).done;){var i=n.value;this._convertTextureIds(i)}}catch(A){r.e(A)}finally{r.f()}var o,a=(0,p.Z)(t.meshes);try{for(a.s();!(o=a.n()).done;){var s=o.value;this._convertMeshIds(s)}}catch(A){a.e(A)}finally{a.f()}var u,l=(0,p.Z)(t.nodes);try{for(l.s();!(u=l.n()).done;){var c=u.value;this._convertNodeIds(c)}}catch(A){l.e(A)}finally{l.f()}var h,f=(0,p.Z)(t.scenes);try{for(f.s();!(h=f.n()).done;){var d=h.value;this._convertSceneIds(d)}}catch(A){f.e(A)}finally{f.f()}}},{key:"_convertTextureIds",value:function(t){t.source&&(t.source=this._convertIdToIndex(t.source,"image"))}},{key:"_convertMeshIds",value:function(t){var e,n=(0,p.Z)(t.primitives);try{for(n.s();!(e=n.n()).done;){var r=e.value,i=r.attributes,o=r.indices,a=r.material;for(var s in i)i[s]=this._convertIdToIndex(i[s],"accessor");o&&(r.indices=this._convertIdToIndex(o,"accessor")),a&&(r.material=this._convertIdToIndex(a,"material"))}}catch(u){n.e(u)}finally{n.f()}}},{key:"_convertNodeIds",value:function(t){var e=this;t.children&&(t.children=t.children.map((function(t){return e._convertIdToIndex(t,"
2node")}))),t.meshes&&(t.meshes=t.meshes.map((function(t){return e._convertIdToIndex(t,"mesh")})))}},{key:"_convertSceneIds",value:function(t){var e=this;t.nodes&&(t.nodes=t.nodes.map((function(t){return e._convertIdToIndex(t,"node")})))}},{key:"_convertIdsToIndices",value:function(t,e){t[e]||(console.warn("gltf v1: json doesn't contain attribute ".concat(e)),t[e]=[]);var n,r=(0,p.Z)(t[e]);try{for(r.s();!(n=r.n()).done;){var i=n.value;for(var o in i){var a=i[o],s=this._convertIdToIndex(a,o);i[o]=s}}}catch(u){r.e(u)}finally{r.f()}}},{key:"_convertIdToIndex",value:function(t,e){var n=Nn[e];if(n in this.idToIndexMap){var r=this.idToIndexMap[n][t];if(!Number.isFinite(r))throw new Error("gltf v1: failed to resolve ".concat(e," with id ").concat(t));return r}return t}},{key:"_updateObjects",value:function(t){var e,n=(0,p.Z)(this.json.buffers);try{for(n.s();!(e=n.n()).done;){delete e.value.type}}catch(r){n.e(r)}finally{n.f()}}},{key:"_updateMaterial",value:function(t){var e,n=(0,p.Z)(t.materials);try{var r=function(){var n=e.value;n.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};var r=(null===(i=n.values)||void 0===i?void 0:i.tex)||(null===(o=n.values)||void 0===o?void 0:o.texture2d_0)||(null===(a=n.values)||void 0===a?void 0:a.diffuseTex),s=t.textures.findIndex((function(t){return t.id===r}));-1!==s&&(n.pbrMetallicRoughness.baseColorTexture={index:s})};for(n.s();!(e=n.n()).done;){var i,o,a;r()}}catch(s){n.e(s)}finally{n.f()}}}]),t}();function jn(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(new Gn).normalize(t,e)}var Vn={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Hn={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Jn=10240,Wn=10241,Qn=10242,qn=10243,Kn=10497,Xn=9729,Yn=9986,$n={magFilter:Jn,minFilter:Wn,wrapS:Qn,wrapT:qn},tr=(zn={},(0,mt.Z)(zn,Jn,Xn),(0,mt.Z)(zn,Wn,Yn),(0,mt.Z)(zn,Qn,Kn),(0,mt.Z)(zn,qn,Kn),zn);var er=function(){function t(){(0,vt.Z)(this,t),(0,mt.Z)(this,"baseUri",""),(0,mt.Z)(this,"json",{}),(0,mt.Z)(this,"buffers",[]),(0,mt.Z)(this,"images",[])}return(0,gt.Z)(t,[{key:"postProcess",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.json,r=t.buffers,i=void 0===r?[]:r,o=t.images,a=void 0===o?[]:o,s=t.baseUri,u=void 0===s?"":s;return pt(n),this.baseUri=u,this.json=n,this.buffers=i,this.images=a,this._resolveTree(this.json,e),this.json}},{key:"_resolveTree",value:function(t){var e=this;t.bufferViews&&(t.bufferViews=t.bufferViews.map((function(t,n){return e._resolveBufferView(t,n)}))),t.images&&(t.images=t.images.map((function(t,n){return e._resolveImage(t,n)}))),t.samplers&&(t.samplers=t.samplers.map((function(t,n){return e._resolveSampler(t,n)}))),t.textures&&(t.textures=t.textures.map((function(t,n){return e._resolveTexture(t,n)}))),t.accessors&&(t.accessors=t.accessors.map((function(t,n){return e._resolveAccessor(t,n)}))),t.materials&&(t.materials=t.materials.map((function(t,n){return e._resolveMaterial(t,n)}))),t.meshes&&(t.meshes=t.meshes.map((function(t,n){return e._resolveMesh(t,n)}))),t.nodes&&(t.nodes=t.nodes.map((function(t,n){return e._resolveNode(t,n)}))),t.skins&&(t.skins=t.skins.map((function(t,n){return e._resolveSkin(t,n)}))),t.scenes&&(t.scenes=t.scenes.map((function(t,n){return e._resolveScene(t,n)}))),void 0!==t.scene&&(t.scene=t.scenes[this.json.scene])}},{key:"getScene",value:function(t){return this._get("scenes",t)}},{key:"getNode",value:function(t){return this._get("nodes",t)}},{key:"getSkin",value:function(t){return this._get("skins",t)}},{key:"getMesh",value:function(t){return this._get("meshes",t)}},{key:"getMaterial",value:function(t){return this._get("materials",t)}},{key:"getAccessor",value:function(t){return this._get("accessors",t)}},{key:"getCamera",value:function(t){return null}},{key:"getTexture",value:function(t){return this._get("textures",t)}},{key:"getSampler",value:function(t){return this._get("samplers",t)}},{key:"getImage",value:function(t){return this._get("images",t)}},{key:"getBufferView",value:function(t){return this._get("bufferViews",t)}},{key:"getBuffer",value:function(t){return this._get("buffers",t)}},{key:"_get",value:function(t,e){if("object"===typeof e)return e;var n=this.json[t]&&this.json[t][e];return n||console.warn("glTF file error: Could not find ".concat(t,"[").concat(e,"]")),n}},{key:"_resolveScene",value:function(t,e){var n=this;return t.id=t.id||"scene-".concat(e),t.nodes=(t.nodes||[]).map((function(t){return n.getNode(t)})),t}},{key:"_resolveNode",value:function(t,e){var n=this;return t.id=t.id||"node-".concat(e),t.children&&(t.children=t.children.map((function(t){return n.getNode(t)}))),void 0!==t.mesh?t.mesh=this.getMesh(t.mesh):void 0!==t.meshes&&t.meshes.length&&(t.mesh=t.meshes.reduce((function(t,e){var r=n.getMesh(e);return t.id=r.id,t.primitives=t.primitives.concat(r.primitives),t}),{primitives:[]})),void 0!==t.camera&&(t.camera=this.getCamera(t.camera)),void 0!==t.skin&&(t.skin=this.getSkin(t.skin)),t}},{key:"_resolveSkin",value:function(t,e){return t.id=t.id||"skin-".concat(e),t.inverseBindMatrices=this.getAccessor(t.inverseBindMatrices),t}},{key:"_resolveMesh",value:function(t,e){var n=this;return t.id=t.id||"mesh-".concat(e),t.primitives&&(t.primitives=t.primitives.map((function(t){var e=(t=(0,h.Z)({},t)).attributes;for(var r in t.attributes={},e)t.attributes[r]=n.getAccessor(e[r]);return void 0!==t.indices&&(t.indices=n.getAccessor(t.indices)),void 0!==t.material&&(t.material=n.getMaterial(t.material)),t}))),t}},{key:"_resolveMaterial",value:function(t,e){if(t.id=t.id||"material-".concat(e),t.normalTexture&&(t.normalTexture=(0,h.Z)({},t.normalTexture),t.normalTexture.texture=this.getTexture(t.normalTexture.index)),t.occlusionTexture&&(t.occlustionTexture=(0,h.Z)({},t.occlustionTexture),t.occlusionTexture.texture=this.getTexture(t.occlusionTexture.index)),t.emissiveTexture&&(t.emmisiveTexture=(0,h.Z)({},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=(0,h.Z)({},t.pbrMetallicRoughness);var n=t.pbrMetallicRoughness;n.baseColorTexture&&(n.baseColorTexture=(0,h.Z)({},n.baseColorTexture),n.baseColorTexture.texture=this.getTexture(n.baseColorTexture.index)),n.metallicRoughnessTexture&&(n.metallicRoughnessTexture=(0,h.Z)({},n.metallicRoughnessTexture),n.metallicRoughnessTexture.texture=this.getTexture(n.metallicRoughnessTexture.index))}return t}},{key:"_resolveAccessor",value:function(t,e){var n,r;if(t.id=t.id||"accessor-".concat(e),void 0!==t.bufferView&&(t.bufferView=this.getBufferView(t.bufferView)),t.bytesPerComponent=(n=t.componentType,Hn[n]),t.components=(r=t.type,Vn[r]),t.bytesPerElement=t.bytesPerComponent*t.components,t.bufferView){var i=t.bufferView.buffer,o=It(t,t.bufferView),a=o.ArrayType,s=o.byteLength,u=(t.bufferView.byteOffset||0)+(t.byteOffset||0)+i.byteOffset,l=i.arrayBuffer.slice(u,u+s);t.bufferView.byteStride&&(l=this._getValueFromInterleavedBuffer(i,u,t.bufferView.byteStride,t.bytesPerElement,t.count)),t.value=new a(l)}return t}},{key:"_getValueFromInterleavedBuffer",value:function(t,e,n,r,i){for(var o=new Uint8Array(i*r),a=0;a<i;a++){var s=e+a*n;o.set(new Uint8Array(t.arrayBuffer.slice(s,s+r)),a*r)}return o.buffer}},{key:"_resolveTexture",value:function(t,e){return t.id=t.id||"texture-".concat(e),t.sampler="sampler"in t?this.get
2Sampler(t.sampler):tr,t.source=this.getImage(t.source),t}},{key:"_resolveSampler",value:function(t,e){for(var n in t.id=t.id||"sampler-".concat(e),t.parameters={},t){var r=this._enumSamplerParameter(n);void 0!==r&&(t.parameters[r]=t[n])}return t}},{key:"_enumSamplerParameter",value:function(t){return $n[t]}},{key:"_resolveImage",value:function(t,e){t.id=t.id||"image-".concat(e),void 0!==t.bufferView&&(t.bufferView=this.getBufferView(t.bufferView));var n=this.images[e];return n&&(t.image=n),t}},{key:"_resolveBufferView",value:function(t,e){var n=t.buffer,r=(0,h.Z)((0,h.Z)({id:"bufferView-".concat(e)},t),{},{buffer:this.buffers[n]}),i=this.buffers[n].arrayBuffer,o=this.buffers[n].byteOffset||0;return"byteOffset"in t&&(o+=t.byteOffset),r.data=new Uint8Array(i,o,t.byteLength),r}},{key:"_resolveCamera",value:function(t,e){return t.id=t.id||"camera-".concat(e),t.perspective,t.orthographic,t}}]),t}();function nr(t,e){return(new er).postProcess(t,e)}var rr=1735152710,ir=12,or=8,ar=1313821514,sr=5130562,ur=0,lr=1,cr=0,hr=!0;function fr(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=new DataView(e),i=function(t){var 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),o=r.getUint32(n+4,hr),a=r.getUint32(n+8,hr);switch(Object.assign(t,{header:{byteOffset:n,byteLength:a,hasBinChunk:!1},type:i,version:o,json:{},binChunks:[]}),n+=ir,t.version){case 1:return function(t,e,n){_t(t.header.byteLength>ir+or);var r=e.getUint32(n+0,hr),i=e.getUint32(n+4,hr);return n+=or,_t(i===cr),pr(t,e,n,r),n+=r,n+=dr(t,e,n,t.header.byteLength),n}(t,r,n);case 2:return function(t,e,n,r){return _t(t.header.byteLength>ir+or),function(t,e,n,r){for(;n+8<=t.header.byteLength;){var i=e.getUint32(n+0,hr),o=e.getUint32(n+4,hr);switch(n+=or,o){case ar:pr(t,e,n,i);break;case sr:dr(t,e,n,i);break;case ur:r.strict||pr(t,e,n,i);break;case lr:r.strict||dr(t,e,n,i)}n+=bt(i,4)}}(t,e,n,r),n+t.header.byteLength}(t,r,n,{});default:throw new Error("Invalid GLB version ".concat(t.version,". Only supports v1 and v2."))}}function pr(t,e,n,r){var i=new Uint8Array(e.buffer,n,r),o=new TextDecoder("utf8").decode(i);return t.json=JSON.parse(o),bt(r,4)}function dr(t,e,n,r){return t.header.hasBinChunk=!0,t.binChunks.push({byteOffset:n,byteLength:r,arrayBuffer:e.buffer}),bt(r,4)}function Ar(t,e){return vr.apply(this,arguments)}function vr(){return vr=(0,f.Z)((0,c.Z)().mark((function t(e,n){var r,i,o,a,s,u,l,h,f,p=arguments;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=p.length>4?p[4]:void 0,gr(e,n,p.length>2&&void 0!==p[2]?p[2]:0,r=p.length>3?p[3]:void 0),jn(e,{normalize:null===r||void 0===r||null===(o=r.gltf)||void 0===o?void 0:o.normalize}),Dn(e,r,i),l=[],null===r||void 0===r||null===(a=r.gltf)||void 0===a||!a.loadBuffers||!e.json.buffers){t.next=10;break}return t.next=10,mr(e,r,i);case 10:return null!==r&&void 0!==r&&null!==(s=r.gltf)&&void 0!==s&&s.loadImages&&(h=_r(e,r,i),l.push(h)),f=Ln(e,r,i),l.push(f),t.next=15,Promise.all(l);case 15:return t.abrupt("return",null!==r&&void 0!==r&&null!==(u=r.gltf)&&void 0!==u&&u.postProcess?nr(e,r):e);case 16:case"end":return t.stop()}}),t)}))),vr.apply(this,arguments)}function gr(t,e,n,r){(r.uri&&(t.baseUri=r.uri),e instanceof ArrayBuffer&&!function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=new DataView(t),i=n.magic,o=void 0===i?rr:i,a=r.getUint32(e,!1);return a===o||a===rr}(e,n,r))&&(e=(new TextDecoder).decode(e));if("string"===typeof e)t.json=ht(e);else if(e instanceof ArrayBuffer){var i={};n=fr(i,e,n,r.glb),pt("glTF"===i.type,"Invalid GLB magic string ".concat(i.type)),t._glb=i,t.json=i.json}else pt(!1,"GLTF: must be ArrayBuffer or string");var o=t.json.buffers||[];if(t.buffers=new Array(o.length).fill(null),t._glb&&t._glb.header.hasBinChunk){var a=t._glb.binChunks;t.buffers[0]={arrayBuffer:a[0].arrayBuffer,byteOffset:a[0].byteOffset,byteLength:a[0].byteLength}}var s=t.json.images||[];t.images=new Array(s.length).fill({})}function mr(t,e,n){return yr.apply(this,arguments)}function yr(){return(yr=(0,f.Z)((0,c.Z)().mark((function t(e,n,r){var i,o,a,s,u,l,h,f;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=e.json.buffers||[],o=0;case 2:if(!(o<i.length)){t.next=22;break}if(!(a=i[o]).uri){t.next=18;break}return pt(r.fetch),l=dt(a.uri,n),t.next=10,null===r||void 0===r||null===(s=r.fetch)||void 0===s?void 0:s.call(r,l);case 10:return h=t.sent,t.next=13,null===h||void 0===h||null===(u=h.arrayBuffer)||void 0===u?void 0:u.call(h);case 13:f=t.sent,e.buffers[o]={arrayBuffer:f,byteOffset:0,byteLength:f.byteLength},delete a.uri,t.next=19;break;case 18:null===e.buffers[o]&&(e.buffers[o]={arrayBuffer:new ArrayBuffer(a.byteLength),byteOffset:0,byteLength:a.byteLength});case 19:++o,t.next=2;break;case 22:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function _r(t,e,n){return br.apply(this,arguments)}function br(){return(br=(0,f.Z)((0,c.Z)().mark((function t(e,n,r){var i,o,a,s,u,l;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=xr(e),o=e.json.images||[],a=[],s=(0,p.Z)(i);try{for(s.s();!(u=s.n()).done;)l=u.value,a.push(wr(e,o[l],l,n,r))}catch(c){s.e(c)}finally{s.f()}return t.next=7,Promise.all(a);case 7:return t.abrupt("return",t.sent);case 8:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function xr(t){var e,n=new Set,r=t.json.textures||[],i=(0,p.Z)(r);try{for(i.s();!(e=i.n()).done;){var o=e.value;void 0!==o.source&&n.add(o.source)}}catch(a){i.e(a)}finally{i.f()}return Array.from(n).sort()}function wr(t,e,n,r,i){return Cr.apply(this,arguments)}function Cr(){return Cr=(0,f.Z)((0,c.Z)().mark((function t(e,n,r,i,o){var a,s,u,l,h,f,p;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=o.fetch,s=o.parse,!n.uri||n.hasOwnProperty("bufferView")){t.next=9;break}return l=dt(n.uri,i),t.next=5,a(l);case 5:return h=t.sent,t.next=8,h.arrayBuffer();case 8:u=t.sent;
2case 9:return Number.isFinite(n.bufferView)&&(f=At(e.json,e.buffers,n.bufferView),u=ft(f.buffer,f.byteOffset,f.byteLength)),pt(u,"glTF image has no data"),t.next=13,s(u,[lt.S,ut],{mimeType:n.mimeType,basis:i.basis||{format:at()}},o);case 13:(p=t.sent)&&p[0]&&(p={compressed:!0,mipmaps:!1,width:p[0].width,height:p[0].height,data:p[0]}),e.images=e.images||[],e.images[r]=p;case 17:case"end":return t.stop()}}),t)}))),Cr.apply(this,arguments)}var Br={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:function(t){return kr.apply(this,arguments)},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"}}};function kr(){return kr=(0,f.Z)((0,c.Z)().mark((function t(e){var n,r,i,o,a,s=arguments;return(0,c.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=s.length>1&&void 0!==s[1]?s[1]:{},r=s.length>2?s[2]:void 0,(n=(0,h.Z)((0,h.Z)({},Br.options),n)).gltf=(0,h.Z)((0,h.Z)({},Br.options.gltf),n.gltf),i=n.byteOffset,o=void 0===i?0:i,a={},t.next=8,Ar(a,e,o,n,r);case 8:return t.abrupt("return",t.sent);case 9:case"end":return t.stop()}}),t)}))),kr.apply(this,arguments)}},21440:function(t,e,n){"use strict";n.d(e,{S:function(){return O}});var r=n(11092),i=n(27791);function o(t,e){if(!t)throw new Error(e||"loader assertion failed.")}var a=n(80285),s=globalThis._parseImageNode,u="undefined"!==typeof Image,l="undefined"!==typeof ImageBitmap,c=Boolean(s),h=!!a.jU||c;function f(t){var e=d(t);if(!e)throw new Error("Not an image");return e}function p(t){switch(f(t)){case"data":return t;case"image":case"imagebitmap":var 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}var A=/^data:image\/svg\+xml/,v=/\.svg((\?|#).*)?$/;function g(t){return t&&(A.test(t)||v.test(t))}function m(t,e){if(g(e)){var n=(new TextDecoder).decode(t);try{"function"===typeof unescape&&"function"===typeof encodeURIComponent&&(n=unescape(encodeURIComponent(n)))}catch(r){throw new Error(r.message)}return"data:image/svg+xml;base64,".concat(btoa(n))}return y(t,e)}function y(t,e){if(g(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(t)])}function _(t,e,n){return b.apply(this,arguments)}function b(){return(b=(0,i.Z)((0,r.Z)().mark((function t(e,n,i){var o,a,s;return(0,r.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=m(e,i),a=self.URL||self.webkitURL,s="string"!==typeof o&&a.createObjectURL(o),t.prev=3,t.next=6,x(s||o,n);case 6:return t.abrupt("return",t.sent);case 7:return t.prev=7,s&&a.revokeObjectURL(s),t.finish(7);case 10:case"end":return t.stop()}}),t,null,[[3,,7,10]])})))).apply(this,arguments)}function x(t,e){return w.apply(this,arguments)}function w(){return(w=(0,i.Z)((0,r.Z)().mark((function t(e,n){var i;return(0,r.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((i=new Image).src=e,!(n.image&&n.image.decode&&i.decode)){t.next=6;break}return t.next=5,i.decode();case 5:return t.abrupt("return",i);case 6:return t.next=8,new Promise((function(t,n){try{i.onload=function(){return t(i)},i.onerror=function(t){return n(new Error("Could not load image ".concat(e,": ").concat(t)))}}catch(r){n(r)}}));case 8:return t.abrupt("return",t.sent);case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var C={},B=!0;function k(t,e,n){return E.apply(this,arguments)}function E(){return(E=(0,i.Z)((0,r.Z)().mark((function t(e,n,i){var o,a,s;return(0,r.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!g(i)){t.next=7;break}return t.next=3,_(e,n,i);case 3:a=t.sent,o=a,t.next=8;break;case 7:o=y(e,i);case 8:return s=n&&n.imagebitmap,t.next=11,S(o,s);case 11:return t.abrupt("return",t.sent);case 12:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function S(t){return T.apply(this,arguments)}function T(){return T=(0,i.Z)((0,r.Z)().mark((function t(e){var n,i=arguments;return(0,r.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!M(n=i.length>1&&void 0!==i[1]?i[1]:null)&&B||(n=null),!n){t.next=13;break}return t.prev=3,t.next=6,createImageBitmap(e,n);case 6:return t.abrupt("return",t.sent);case 9:t.prev=9,t.t0=t.catch(3),console.warn(t.t0),B=!1;case 13:return t.next=15,createImageBitmap(e);case 15:return t.abrupt("return",t.sent);case 16:case"end":return t.stop()}}),t,null,[[3,9]])}))),T.apply(this,arguments)}function M(t){for(var e in t||C)return!1;return!0}var I=n(43835);function P(t,e){return Z.apply(this,arguments)}function Z(){return Z=(0,i.Z)((0,r.Z)().mark((function t(e,n){var i,a,s;return(0,r.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=(0,I.I)(e)||{},a=i.mimeType,o(s=globalThis._parseImageNode),t.next=5,s(e,a);case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}}),t)}))),Z.apply(this,arguments)}function D(){return(D=(0,i.Z)((0,r.Z)().mark((function t(e,n,i){var a,s,u,l,c;return(0,r.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a=(n=n||{}).image||{},s=a.type||"auto",u=(i||{}).url,l=L(s),t.t0=l,t.next="imagebitmap"===t.t0?8:"image"===t.t0?12:"data"===t.t0?16:20;break;case 8:return t.next=10,k(e,n,u);case 10:return c=t.sent,t.abrupt("break",21);case 12:return t.next=14,_(e,n,u);case 14:return c=t.sent,t.abrupt("break",21);case 16:return t.next=18,P(e,n);case 18:return c=t.sent,t.abrupt("break",21);case 20:o(!1);case 21:return"data"===s&&(c=p(c)),t.abrupt("return",c);case 23:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function L(t){switch(t){case"auto":case"data":return function(){if(l)return"imagebitmap";if(u)return"image";if(h)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(t){switch(t){case"auto":return l||u||h;case"imagebitmap":return l;case"image":return u;case"data":return h;default:throw new Error("@loaders.gl/images: image ".concat(t," not supported in this environment"))}}(t),t}}var O={id:"image",module:"images",name:"Images",version:"3.2.13",mimeTypes:["image/png","image/jpeg","image/gif","
2image/webp","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],extensions:["png","jpg","jpeg","gif","webp","bmp","ico","svg"],parse:function(t,e,n){return D.apply(this,arguments)},tests:[function(t){return Boolean((0,I.I)(new DataView(t)))}],options:{image:{type:"auto",decode:!0}}}},43835:function(t,e,n){"use strict";n.d(e,{I:function(){return o}});var r=!1,i=!0;function o(t){var e=a(t);return function(t){var 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){var e=a(t),n=e.byteLength>=3&&65496===e.getUint16(0,r)&&255===e.getUint8(2);if(!n)return null;var i=function(){for(var t=new Set([65499,65476,65484,65501,65534]),e=65504;e<65520;++e)t.add(e);var n=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:t,sofMarkers:n}}(),o=i.tableMarkers,s=i.sofMarkers,u=2;for(;u+9<e.byteLength;){var l=e.getUint16(u,r);if(s.has(l))return{mimeType:"image/jpeg",height:e.getUint16(u+5,r),width:e.getUint16(u+7,r)};if(!o.has(l))return null;u+=2,u+=e.getUint16(u,r)}return null}(e)||function(t){var e=a(t),n=e.byteLength>=10&&1195984440===e.getUint32(0,r);if(!n)return null;return{mimeType:"image/gif",width:e.getUint16(6,i),height:e.getUint16(8,i)}}(e)||function(t){var e=a(t),n=e.byteLength>=14&&16973===e.getUint16(0,r)&&e.getUint32(2,i)===e.byteLength;if(!n)return null;return{mimeType:"image/bmp",width:e.getUint32(18,i),height:e.getUint32(22,i)}}(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")}},80285:function(t,e,n){"use strict";n.d(e,{jU:function(){return r}});"undefined"!==typeof self&&self,"undefined"!==typeof window&&window,"undefined"!==typeof n.g&&n.g,"undefined"!==typeof document&&document;var r=Boolean("object"!==typeof process||"[object process]"!==String(process)||process.browser),i="undefined"!==typeof process&&process.version&&/v([0-9]*)/.exec(process.version);i&&parseFloat(i[1])},73599:function(t,e,n){"use strict";function r(t,e){if(!t)throw new Error(e||"loaders.gl assertion failed.")}n.d(e,{h:function(){return r}})},89596:function(t,e,n){"use strict";n.d(e,{CO:function(){return i},hJ:function(){return a},jU:function(){return o},tq:function(){return s}});var r={self:"undefined"!==typeof self&&self,window:"undefined"!==typeof window&&window,global:"undefined"!==typeof n.g&&n.g,document:"undefined"!==typeof document&&document},i=r.global||r.self||r.window||{},o="object"!==typeof process||"[object process]"!==String(process)||process.browser,a="function"===typeof importScripts,s="undefined"!==typeof window&&"undefined"!==typeof window.orientation,u="undefined"!==typeof process&&process.version&&/v([0-9]*)/.exec(process.version);u&&parseFloat(u[1])},34819:function(t,e,n){"use strict";n.d(e,{Z:function(){return A}});var r=n(50189),i=n(91976),o=n(22951),a=n(67591),s=n(94337),u=n(69296),l=n(79666),c=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]),h=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]),f=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]),p=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]),d={POSITION:{size:3,value:new Float32Array(h)},NORMAL:{size:3,value:new Float32Array(f)},TEXCOORD_0:{size:2,value:new Float32Array(p)}},A=function(t){(0,a.Z)(n,t);var e=(0,s.Z)(n);function n(){(0,o.Z)(this,n);var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=t.id,a=void 0===i?(0,l.hQ)("cube-geometry"):i;return e.call(this,(0,r.Z)((0,r.Z)({},t),{},{id:a,indices:{size:1,value:new Uint16Array(c)},attributes:(0,r.Z)((0,r.Z)({},d),t.attributes)}))}return(0,i.Z)(n)}(u.Z)},69296:function(t,e,n){"use strict";n.d(e,{Z:function(){return l}});var r=n(50189),i=n(22951),o=n(91976),a=n(79666),s=n(81301),u={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},l=function(){function t(){(0,i.Z)(this,t);var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}
2,n=e.id,r=void 0===n?(0,a.hQ)("geometry"):n,o=e.drawMode,s=void 0===o?u.TRIANGLES:o,l=e.attributes,c=void 0===l?{}:l,h=e.indices,f=void 0===h?null:h,p=e.vertexCount,d=void 0===p?null:p;this.id=r,this.drawMode=0|s,this.attributes={},this.userData={},this._setAttributes(c,f),this.vertexCount=d||this._calculateVertexCount(this.attributes,this.indices)}return(0,o.Z)(t,[{key:"mode",get:function(){return this.drawMode}},{key:"getVertexCount",value:function(){return this.vertexCount}},{key:"getAttributes",value:function(){return this.indices?(0,r.Z)({indices:this.indices},this.attributes):this.attributes}},{key:"_print",value:function(t){return"Geometry ".concat(this.id," attribute ").concat(t)}},{key:"_setAttributes",value:function(t,e){for(var n in e&&(this.indices=ArrayBuffer.isView(e)?{value:e,size:1}:e),t){var r=t[n];r=ArrayBuffer.isView(r)?{value:r}:r,(0,s.h)(ArrayBuffer.isView(r.value),"".concat(this._print(n),": must be typed array or object with value as typed array")),"POSITION"!==n&&"positions"!==n||r.size||(r.size=3),"indices"===n?((0,s.h)(!this.indices),this.indices=r):this.attributes[n]=r}return this.indices&&void 0!==this.indices.isIndexed&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed),this}},{key:"_calculateVertexCount",value:function(t,e){if(e)return e.value.length;var n=1/0;for(var r in t){var i=t[r],o=i.value,a=i.size;!i.constant&&o&&a>=1&&(n=Math.min(n,o.length/a))}return(0,s.h)(Number.isFinite(n)),n}}],[{key:"DRAW_MODE",get:function(){return u}}]),t}()},94557:function(t,e,n){"use strict";n.d(e,{Z:function(){return V}});var r=n(64649),i=n(22951),o=n(91976),a=n(28007),s=n(37330),u=n(79666),l=n(81301),c=n(97756),h=n(79817),f=n(77462),p=n(33839),d=n(47169),A=n(83138),v=n(27597),g=n(67591),m=n(94337),y=n(35572),_=null;function b(t,e){var n;return new t((n=t.BYTES_PER_ELEMENT*e,(!_||_.byteLength<n)&&(_=new ArrayBuffer(n)),_),0,e)}var x=n(93594),w=function(t,e){(0,g.Z)(r,t);var n=(0,m.Z)(r);function r(t){var e;(0,i.Z)(this,r);var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=o.id||o.program&&o.program.id;return(e=n.call(this,t,Object.assign({},o,{id:a}))).buffer=null,e.bufferValue=null,e.isDefaultArray=o.isDefaultArray||!1,e.gl2=t,e.initialize(o),Object.seal((0,d.Z)(e)),e}return(0,o.Z)(r,[{key:e,get:function(){return"VertexArrayObject"}},{key:"delete",value:function(){return(0,A.Z)((0,v.Z)(r.prototype),"delete",this).call(this),this.buffer&&this.buffer.delete(),this}},{key:"MAX_ATTRIBUTES",get:function(){return r.getMaxAttributes(this.gl)}},{key:"initialize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.setProps(t)}},{key:"setProps",value:function(t){return this}},{key:"setElementBuffer",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return(0,l.h)(!e||34963===e.target,"elements must be GL.ELEMENT_ARRAY_BUFFER"),this.bind((function(){t.gl.bindBuffer(34963,e?e.handle:null)})),this}},{key:"setBuffer",value:function(t,e,n){if(34963===e.target)return this.setElementBuffer(e,n);var r=n.size,i=n.type,o=n.stride,s=n.offset,u=n.normalized,c=n.integer,h=n.divisor,f=this.gl,p=this.gl2;return t=Number(t),this.bind((function(){f.bindBuffer(34962,e.handle),c?((0,l.h)((0,a.D0)(f)),p.vertexAttribIPointer(t,r,i,o,s)):f.vertexAttribPointer(t,r,i,u,o,s),f.enableVertexAttribArray(t),p.vertexAttribDivisor(t,h||0)})),this}},{key:"enable",value:function(t){var e=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return!n&&0===t&&!r.isSupported(this.gl,{constantAttributeZero:!0})||(t=Number(t),this.bind((function(){return n?e.gl.enableVertexAttribArray(t):e.gl.disableVertexAttribArray(t)}))),this}},{key:"getConstantBuffer",value:function(t,e){var n=this._normalizeConstantArrayValue(e),r=n.byteLength*t,i=n.length*t,o=!this.buffer;if(this.buffer=this.buffer||new p.Z(this.gl,r),o=(o=o||this.buffer.reallocate(r))||!this._compareConstantArrayValues(n,this.bufferValue)){var a=b(e.constructor,i);!function(t){for(var e=t.target,n=t.source,r=t.start,i=void 0===r?0:r,o=t.count,a=void 0===o?1:o,s=n.length,u=a*s,l=0,c=i;l<s;l++)e[c++]=n[l];for(;l<u;)l<u-l?(e.copyWithin(i+l,i,i+l),l*=2):(e.copyWithin(i+l,i,i+u-l),l=u)}({target:a,source:n,start:0,count:i}),this.buffer.subData(a),this.bufferValue=e}return this.buffer}},{key:"_normalizeConstantArrayValue",value:function(t){return Array.isArray(t)?new Float32Array(t):t}},{key:"_compareConstantArrayValues",value:function(t,e){if(!t||!e||t.length!==e.length||t.constructor!==e.constructor)return!1;for(var n=0;n<t.length;++n)if(t[n]!==e[n])return!1;return!0}},{key:"_createHandle",value:function(){return this.gl.createVertexArray()}},{key:"_deleteHandle",value:function(t){return this.gl2.deleteVertexArray(t),[this.elements]}},{key:"_bindHandle",value:function(t){this.gl2.bindVertexArray(t)}},{key:"_getParameter",value:function(t,e){var n=this,r=e.location;return(0,l.h)(Number.isFinite(r)),this.bind((function(){return 34373===t?n.gl.getVertexAttribOffset(r,t):n.gl.getVertexAttrib(r,t)}))}}],[{key:"isSupported",value:function(t){return!(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).constantAttributeZero||((0,a.D0)(t)||"Chrome"===(0,x.Z)())}},{key:"getDefaultArray",value:function(t){return t.luma=t.luma||{},t.luma.defaultVertexArray||(t.luma.defaultVertexArray=new r(t,{handle:null,isDefaultArray:!0})),t.luma.defaultVertexArray}},{key:"getMaxAttributes",value:function(t){return r.MAX_ATTRIBUTES=r.MAX_ATTRIBUTES||t.getParameter(34921),r.MAX_ATTRIBUTES}},{key:"setConstant",value:function(t,e,n){switch(n.constructor){case Float32Array:r._setConstantFloatArray(t,e,n);break;case Int32Array:r._setConstantIntArray(t,e,n);break;case Uint32Array:r._setConstantUintArray(t,e,n);break;default:(0,l.h)(!1)}}},{key:"_setConstantFloatArray",value:function(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,l.h)(!1)}}},{key:"_setConstantIntArray",value:function(t,e,n){switch((0,l.h)((0,a.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,l.h)(!1)}}},{key:"_setConstantUintArray",value:function(t,e,n){switch((0,l.h)((0,a.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,l.h)(!1)}}}]),r}(y.Z,Symbol.toStringTag),C=n(69221),B=/^(.+)__LOCATION_([0-9]+)$/,k=["setBuffers","setGeneric","clearBindings","setLocations","setGenericValues","setDivisor","enable","disable"],E=function(){function t(e){(0,i.Z)(this,t);var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.id||n.program&&n.program.id;this.id=r,this.gl=e,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={}
2,this.vertexArrayObject=new w(e),(0,C.F)(this,"VertexArray","v6.0",k),this.initialize(n),Object.seal(this)}return(0,o.Z)(t,[{key:"delete",value:function(){this.buffer&&this.buffer.delete(),this.vertexArrayObject.delete()}},{key:"initialize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.reset(),this.configuration=null,this.bindOnUse=!1,this.setProps(t)}},{key:"reset",value:function(){this.elements=null,this.elementsAccessor=null;var t=this.vertexArrayObject.MAX_ATTRIBUTES;return this.values=new Array(t).fill(null),this.accessors=new Array(t).fill(null),this.unused={},this.drawParams=null,this}},{key:"setProps",value:function(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}},{key:"clearDrawParams",value:function(){this.drawParams=null}},{key:"getDrawParams",value:function(){return this.drawParams=this.drawParams||this._updateDrawParams(),this.drawParams}},{key:"setAttributes",value:function(t){var e=this;return Object.assign(this.attributes,t),this.vertexArrayObject.bind((function(){for(var n in t){var r=t[n];e._setAttribute(n,r)}e.gl.bindBuffer(34962,null)})),this}},{key:"setElementBuffer",value:function(){var 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}},{key:"setBuffer",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(34963===e.target)return this.setElementBuffer(e,n);var r=this._resolveLocationAndAccessor(t,e,e.accessor,n),i=r.location,o=r.accessor;return i>=0&&(this.values[i]=e,this.accessors[i]=o,this.clearDrawParams(),this.vertexArrayObject.setBuffer(i,e,o)),this}},{key:"setConstant",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this._resolveLocationAndAccessor(t,e,Object.assign({size:e.length},n)),i=r.location,o=r.accessor;return i>=0&&(e=this.vertexArrayObject._normalizeConstantArrayValue(e),this.values[i]=e,this.accessors[i]=o,this.clearDrawParams(),this.vertexArrayObject.enable(i,!1)),this}},{key:"unbindBuffers",value:function(){var t=this;return this.vertexArrayObject.bind((function(){t.elements&&t.vertexArrayObject.setElementBuffer(null),t.buffer=t.buffer||new p.Z(t.gl,{accessor:{size:4}});for(var e=0;e<t.vertexArrayObject.MAX_ATTRIBUTES;e++)t.values[e]instanceof p.Z&&(t.gl.disableVertexAttribArray(e),t.gl.bindBuffer(34962,t.buffer.handle),t.gl.vertexAttribPointer(e,1,5126,!1,0,0))})),this}},{key:"bindBuffers",value:function(){var t=this;return this.vertexArrayObject.bind((function(){t.elements&&t.setElementBuffer(t.elements);for(var e=0;e<t.vertexArrayObject.MAX_ATTRIBUTES;e++){var n=t.values[e];n instanceof p.Z&&t.setBuffer(e,n)}})),this}},{key:"bindForDraw",value:function(t,e,n){var r,i=this;return this.vertexArrayObject.bind((function(){i._setConstantAttributes(t,e),r=n()})),r}},{key:"_resolveLocationAndAccessor",value:function(t,e,n,r){var i=this,o={location:-1,accessor:null},s=this._getAttributeIndex(t),u=s.location,c=s.name;if(!Number.isFinite(u)||u<0)return this.unused[t]=e,a.cM.once(3,(function(){return"unused value ".concat(t," in ").concat(i.id)}))(),o;var h=this._getAttributeInfo(c||u);if(!h)return o;var p=this.accessors[u]||{},d=f.Z.resolve(h.accessor,p,n,r),A=d.size,v=d.type;return(0,l.h)(Number.isFinite(A)&&Number.isFinite(v)),{location:u,accessor:d}}},{key:"_getAttributeInfo",value:function(t){return this.configuration&&this.configuration.getAttributeInfo(t)}},{key:"_getAttributeIndex",value:function(t){var e=Number(t);if(Number.isFinite(e))return{location:e};var n=B.exec(t),r=n?n[1]:t,i=n?Number(n[2]):0;return this.configuration?{location:this.configuration.getAttributeLocation(r)+i,name:r}:{location:-1}}},{key:"_setAttribute",value:function(t,e){if(e instanceof p.Z)this.setBuffer(t,e);else if(Array.isArray(e)&&e.length&&e[0]instanceof p.Z){var n=e[0],r=e[1];this.setBuffer(t,n,r)}else if(ArrayBuffer.isView(e)||Array.isArray(e)){var i=e;this.setConstant(t,i)}else{if(!(e.buffer instanceof p.Z))throw new Error("VertexArray: attributes must be Buffers or constants (i.e. typed array)");var o=e;this.setBuffer(t,o.buffer,o)}}},{key:"_setConstantAttributes",value:function(t,e){var n=Math.max(0|t,0|e),r=this.values[0];ArrayBuffer.isView(r)&&this._setConstantAttributeZero(r,n);for(var i=1;i<this.vertexArrayObject.MAX_ATTRIBUTES;i++)r=this.values[i],ArrayBuffer.isView(r)&&this._setConstantAttribute(i,r)}},{key:"_setConstantAttributeZero",value:function(t,e){if(w.isSupported(this.gl,{constantAttributeZero:!0}))this._setConstantAttribute(0,t);else{var n=this.vertexArrayObject.getConstantBuffer(e,t);
2this.vertexArrayObject.setBuffer(0,n,this.accessors[0])}}},{key:"_setConstantAttribute",value:function(t,e){w.setConstant(this.gl,t,e)}},{key:"_updateDrawParams",value:function(){for(var t={isIndexed:!1,isInstanced:!1,indexCount:1/0,vertexCount:1/0,instanceCount:1/0},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}},{key:"_updateDrawParamsForLocation",value:function(t,e){var n=this.values[e],r=this.accessors[e];if(n){var i=r.divisor>0;if(t.isInstanced=t.isInstanced||i,n instanceof p.Z){var o=n;if(i){var a=o.getVertexCount(r);t.instanceCount=Math.min(t.instanceCount,a)}else{var s=o.getVertexCount(r);t.vertexCount=Math.min(t.vertexCount,s)}}}}},{key:"setElements",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return a.cM.deprecated("setElements","setElementBuffer")(),this.setElementBuffer(t,e)}}]),t}(),S=n(54345),T=n(55888),M=n(83951);function I(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.isInteger,r=void 0!==n&&n;if(Array.isArray(t)||ArrayBuffer.isView(t))return function(t,e){for(var n=e.maxElts,r=void 0===n?16:n,i=e.size,o=void 0===i?1:i,a="[",s=0;s<t.length&&s<r;++s)s>0&&(a+=",".concat(s%o===0?" ":"")),a+=I(t[s],e);var u=t.length>r?"...":"]";return"".concat(a).concat(u)}(t,e);if(!Number.isFinite(t))return String(t);if(Math.abs(t)<1e-16)return r?"0":"0.";if(r)return t.toFixed(0);if(Math.abs(t)>100&&Math.abs(t)<1e4)return t.toFixed(0);var i=t.toPrecision(2);return i.indexOf(".0")===i.length-2?i.slice(0,-1):i}function P(t,e,n,i){var o,a,s=t.gl;if(!e)return a={},(0,r.Z)(a,i,"null"),(0,r.Z)(a,"Format ","N/A"),a;var u,l,c,h="NOT PROVIDED",f=1,d=0,A=0;if(n&&(h=n.type,f=n.size,u=-1!==(h=String(h).replace("Array","")).indexOf("nt")),e instanceof p.Z){var v,g,m=e,y=m.getDebugData(),_=y.data;if(l=y.changed?"*":"",c=_,d=(A=m.byteLength)/_.BYTES_PER_ELEMENT/f,n){var b=n.divisor>0;g="".concat(b?"I ":"P "," ").concat(d," (x").concat(f,"=").concat(A," bytes ").concat((0,T.km)(s,h),")")}else u=!0,g="".concat(A," bytes");return v={},(0,r.Z)(v,i,"".concat(l).concat(I(c,{size:f,isInteger:u}))),(0,r.Z)(v,"Format ",g),v}return c=e,f=e.length,u=-1!==(h=String(e.constructor.name).replace("Array","")).indexOf("nt"),o={},(0,r.Z)(o,i,"".concat(I(c,{size:f,isInteger:u})," (constant)")),(0,r.Z)(o,"Format ","".concat(f,"x").concat(h," (constant)")),o}function Z(t,e){var n=e.type,r=e.size,i=(0,M.jG)(n,r);return i?"".concat(t," (").concat(i.name,")"):t}var D=n(60726);function L(t){var e=t.header,n=void 0===e?"Uniforms":e,i=t.program,o=t.uniforms,a=t.undefinedOnly,s=void 0!==a&&a;(0,l.h)(i);var u,c=".*Matrix",h=i._uniformSetters,f={},p=Object.keys(h).sort(),d=0,A=(0,D.Z)(p);try{for(A.s();!(u=A.n()).done;){var v=u.value;v.match(".*_.*")||v.match(c)||O({table:f,header:n,uniforms:o,uniformName:v,undefinedOnly:s})&&d++}}catch(E){A.e(E)}finally{A.f()}var g,m=(0,D.Z)(p);try{for(m.s();!(g=m.n()).done;){var y=g.value;y.match(c)&&O({table:f,header:n,uniforms:o,uniformName:y,undefinedOnly:s})&&d++}}catch(E){m.e(E)}finally{m.f()}var _,b=(0,D.Z)(p);try{for(b.s();!(_=b.n()).done;){var x=_.value;f[x]||O({table:f,header:n,uniforms:o,uniformName:x,undefinedOnly:s})&&d++}}catch(E){b.e(E)}finally{b.f()}var w=0,C={};if(!s)for(var B in o){var k=o[B];f[B]||(w++,C[B]=(0,r.Z)({Type:"NOT USED: ".concat(k)},n,I(k)))}return{table:f,count:d,unusedTable:C,unusedCount:w}}function O(t){var e,n=t.table,i=t.header,o=t.uniforms,a=t.uniformName,s=t.undefinedOnly,u=o[a],l=function(t){return void 0!==t&&null!==t}(u);return(!s||!l)&&(n[a]=(e={},(0,r.Z)(e,i,l?I(u):"N/A"),(0,r.Z)(e,"Uniform Type",l?u:"NOT PROVIDED"),e),!0)}function F(t){var e=t.accessor,n=e.type,r=e.size,i=(0,M.jG)(n,r);return i?"".concat(i.name," ").concat(t.name):t.name}var R=n(50189),z={POSITION:"positions",NORMAL:"normals",COLOR_0:"colors",TEXCOORD_0:"texCoords",TEXCOORD_1:"texCoords1",TEXCOORD_2:"texCoords2"};function U(t,e){var n=(e||{}).attributeMap,r=void 0===n?z:n;return r&&r[t]||t}function N(t,e){var 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,l.h)(Number.isFinite(e.size),"attribute ".concat(t," needs size"))}var G=function(){},j={},V=function(){function t(e){(0,i.Z)(this,t);var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.id,o=void 0===r?(0,u.hQ)("model"):r;(0,l.h)((0,a.UF)(e)),this.id=o,this.gl=e,this.id=n.id||(0,u.hQ)("Model"),this.lastLogTime=0,this.animated=!1,this.initialize(n)}return(0,o.Z)(t,[{key:"initialize",value:function(t){this.props={},this.programManager=t.programManager||s.Z.getDefaultProgramManager(this.gl),this._programManagerState=-1,this._managedProgram=!1;var e=t.program,n=void 0===e?null:e,r=t.vs,i=t.fs,o=t.modules,a=t.defines,u=t.inject,c=t.varyings,h=t.bufferMode,f=t.transpileToGLSL100;this.programProps={program:n,vs:r,fs:i,modules:o,defines:a,inject:u,varyings:c,bufferMode:h,transpileToGLSL100:f},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,l.h)(void 0!==this.drawMode&&Number.isFinite(this.vertexCount),"Model needs drawMode and vertexCount")}},{key:"setProps",value:function(t){this._setModelProps(t)}},{key:"delete",value:function(){for(var 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()}},{key:"getDrawMode",value:function(){return this.drawMode}},{key:"getVertexCount",value:function(){return this.vertexCount}},{key:"getInstanceCount",value:function(){return this.instanceCount}},{key:"getAttributes",value:function(){return this.attributes}},{key:"getProgram",value:function(){return this.program}},{key:"setProgram",value:function(t){var e=t.program,n=t.vs,r=t.fs,i=t.modules,o=t.defines,a=t.inject,s=t.varyings,u=t.bufferMode,l=t.transpileToGLSL100;this.programProps={program:e,vs:n,fs:r,modules:i,defines:o,inject:a,varyings:s,bufferMode:u,transpileToGLSL100:l},this._programDirty=!0}},{key:"getUniforms",value:function(){return this.uniforms}},{key:"setDrawMode",value:function(t){return this.drawMode=t,this}},{key:"setVertexCount",value:function(t){return(0,l.h)(Number.isFinite(t)),this.vertexCount=t,this}},{key:"setInstanceCount",value:function(t){return(0,l.h)(Number.isFinite(t)),this.instanceCount=t,this}},{key:"setGeometry",value:function(t){return this.drawMode=t.drawMode,this.vertexCount=t.getVertexCount(),this._deleteGeometryBuffers(),this.geometryBuffers=function(t,e,n){var r={},i=e.indices;for(var o in e.attributes){var a=e.attributes[o],s=U(o,n);if("indices"===o)i=a;else if(a.constant)r[s]=a.value;else{var u=a.value,c=(0,R.Z)({},a);delete c.value,r[s]=[new p.Z(t,u),c],N(o,c)}}if(i){var h=i.value||i;(0,l.h)(h instanceof Uint16Array||h instanceof Uint32Array,'attribute array for "indices" must be of integer type');var f={size:1,isIndexed:void 0===i.isIndexed||i.isIndexed};r.indices=[new p.Z(t,{data:h,target:34963}),f]}return r}(this.gl,t),this.vertexArray.setAttributes(this.geometryBuffers),this}},{key:"setAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if((0,u.nK)(t))return this;var e={};for(var n in t){var r=t[n];e[n]=r.getValue?r.getValue():r}return this.vertexArray.setAttributes(e),this}},{key:"setUniforms",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.assign(this.uniforms,t),this}},{key:"getModuleUniforms",value:function(t){this._checkProgram();var e=this.programManager.getUniforms(this.program);return e?e(t):{}}},{key:"updateModuleSettings",value:function(t){var e=this.getModuleUniforms(t||{});return this.setUniforms(e)}},{key:"clear",value:function(t){return(0,c.Z)(this.program.gl,t),this}},{key:"draw",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._checkProgram();var e,n=t.moduleSettings,r=void 0===n?null:n,i=t.framebuffer,o=t.uniforms,s=void 0===o?{}:o,u=t.attributes,l=void 0===u?{}:u,c=t.transformFeedback,h=void 0===c?this.transformFeedback:c,f=t.parameters,p=void 0===f?{}:f,d=t.vertexArray,A=void 0===d?this.vertexArray:d;this.setAttributes(l),this.updateModuleSettings(r),this.setUniforms(s),a.cM.priority>=2&&(e=this._logDrawCallStart(2));var v=this.vertexArray.getDrawParams(),g=this.props,m=g.isIndexed,y=void 0===m?v.isIndexed:m,_=g.indexType,b=void 0===_?v.indexType:_,x=g.indexOffset,w=void 0===x?v.indexOffset:x,C=g.vertexArrayInstanced;(void 0===C?v.isInstanced:C)&&!this.isInstanced&&a.cM.warn("Found instanced attributes on non-instanced model",this.id)();var B=this.isInstanced,k=this.instanceCount,E=this.props,S=E.onBeforeRender,T=void 0===S?G:S,M=E.onAfterRender,I=void 0===M?G:M;T(),this.program.setUniforms(this.uniforms);var P=this.program.draw(Object.assign(j,t,{logPriority:e,uniforms:null,framebuffer:i,parameters:p,drawMode:this.getDrawMode(),vertexCount:this.getVertexCount(),vertexArray:A,transformFeedback:h,isIndexed:y,indexType:b,isInstanced:B,instanceCount:k,offset:y?w:0}));return I(),a.cM.priority>=2&&this._logDrawCallEnd(e,A,i),P}},{key:"transform",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.discard,n=void 0===e||e,i=t.feedbackBuffers,o=t.unbindModels,a=void 0===o?[]:o,s=t.parameters;i&&this._setFeedbackBuffers(i),n&&(s=Object.assign({},s,(0,r.Z)({},35977,n))),a.forEach((function(t){return t.vertexArray.unbindBuffers()}));try{this.draw(Object.assign({},t,{parameters:s}))}finally{a.forEach((function(t){return t.vertexArray.bindBuffers()}))}return this}},{key:"render",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return a.cM.warn("Model.render() is deprecated. Use Model.setUniforms() and Model.draw()")(),this.setUniforms(t).draw()}},{key:"_setModelProps",value:function(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)}},{key:"_checkProgram",value:function(){if(this._programDirty||this.programManager.stateHash!==this._programManagerState){var t=this.programProps.program;if(t)this._managedProgram=!1;else{var e=this.programProps,n=e.vs,r=e.fs,i=e.modules,o=e.inject,a=e.defines,s=e.varyings,u=e.bufferMode,c=e.transpileToGLSL100;t=this.programManager.get({vs:n,fs:r,modules:i,inject:o,defines:a,varyings:s,bufferMode:u,transpileToGLSL100:c}),this.program&&this._managedProgram&&this.programManager.release(this.program),this._programManagerState=this.programManager.stateHash,this._managedProgram=!0}(0,l.h)(t instanceof h.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 E(this.gl,{program:this.program}),this.setUniforms(Object.assign({},this.getModuleUniforms())))}}},{key:"_deleteGeometryBuffers",value:function(){for(var t in this.geometryBuffers){var e=this.geometryBuffers[t][0]||this.geometryBuffers[t];e instanceof p.Z&&e.delete()}}},{key:"_setAnimationProps",value:function(t){this.animated&&(0,l.h)(t,"Model.draw(): animated uniforms but no animationProps")}},{key:"_setFeedbackBuffers",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if((0,u.nK)(t))return this;var e=this.program.gl;return this.transformFeedback=this.transformFeedback||new S.Z(e,{program:this.program}),this.transformFeedback.setBuffers(t),this}},{key:"_logDrawCallStart",value:function(t){var e=t>3?0:1e4;
2if(!(Date.now()-this.lastLogTime<e))return this.lastLogTime=Date.now(),a.cM.group(2,">>> DRAWING MODEL ".concat(this.id),{collapsed:a.cM.level<=2})(),t}},{key:"_logDrawCallEnd",value:function(t,e,n,i){if(void 0!==t){var o=function(t){var e=t.vertexArray,n=t.header,r=void 0===n?"Attributes":n;if(!e.configuration)return{};var i={};e.elements&&(i.ELEMENT_ARRAY_BUFFER=P(e,e.elements,null,r));var o=e.values;for(var a in o){var s=e._getAttributeInfo(a);if(s){var u="".concat(a,": ").concat(s.name),l=e.accessors[s.location];l&&(u="".concat(a,": ").concat(Z(s.name,l))),i[u]=P(e,o[a],l,r)}}return i}({vertexArray:e,header:"".concat(this.id," attributes"),attributes:this._attributes}),s=L({header:"".concat(this.id," uniforms"),program:this.program,uniforms:Object.assign({},this.program.uniforms,n)}),u=s.table,l=s.unusedTable,c=s.unusedCount,h=L({header:"".concat(this.id," uniforms"),program:this.program,uniforms:Object.assign({},this.program.uniforms,n),undefinedOnly:!0}),f=h.table;h.count>0&&a.cM.log("MISSING UNIFORMS",Object.keys(f))(),c>0&&a.cM.log("UNUSED UNIFORMS",Object.keys(l))();var p=function(t){var e,n={},i="Accessors for ".concat(t.id),o=(0,D.Z)(t.attributeInfos);try{for(o.s();!(e=o.n()).done;){var a=e.value;if(a){var s=F(a);n["in ".concat(s)]=(0,r.Z)({},i,JSON.stringify(a.accessor))}}}catch(f){o.e(f)}finally{o.f()}var u,l=(0,D.Z)(t.varyingInfos);try{for(l.s();!(u=l.n()).done;){var c=u.value;if(c){var h=F(c);n["out ".concat(h)]=(0,r.Z)({},i,JSON.stringify(c.accessor))}}}catch(f){l.e(f)}finally{l.f()}return n}(this.vertexArray.configuration);a.cM.table(t,o)(),a.cM.table(t,u)(),a.cM.table(t+1,p)(),i&&i.log({logLevel:2,message:"Rendered to ".concat(i.id)}),a.cM.groupEnd(2)()}}}]),t}()},37330:function(t,e,n){"use strict";n.d(e,{Z:function(){return q}});var r=n(60726),i=n(22951),o=n(91976),a=n(11026),s=n(64649),u=n(5740),l=n(17865),c={number:{validate:function(t,e){return Number.isFinite(t)&&(!("max"in e)||t<=e.max)&&(!("min"in e)||t>=e.min)}},array:{validate:function(t,e){return Array.isArray(t)||ArrayBuffer.isView(t)}}};function h(t){var e=f(t);return"object"===e?t?"type"in t?Object.assign({},t,c[t.type]):"value"in t?(e=f(t.value),Object.assign({type:e},t,c[e])):{type:"object",value:t}:{type:"object",value:null}:Object.assign({type:e,value:t},c[e])}function f(t){return Array.isArray(t)||ArrayBuffer.isView(t)?"array":typeof t}var p=function(){function t(e){(0,i.Z)(this,t);var n=e.name,r=e.vs,o=e.fs,a=e.dependencies,s=void 0===a?[]:a,u=e.uniforms,c=e.getUniforms,f=e.deprecations,p=void 0===f?[]:f,d=e.defines,A=void 0===d?{}:d,v=e.inject,g=void 0===v?{}:v,m=e.vertexShader,y=e.fragmentShader;(0,l.Z)("string"===typeof n),this.name=n,this.vs=r||m,this.fs=o||y,this.getModuleUniforms=c,this.dependencies=s,this.deprecations=this._parseDeprecationDefinitions(p),this.defines=A,this.injections=function(t){var e={vs:{},fs:{}};for(var n in t){var r=t[n];"string"===typeof r&&(r={order:0,injection:r}),e[n.slice(0,2)][n]=r}return e}(g),u&&(this.uniforms=function(t){var e={};for(var n in t){var r=h(t[n]);e[n]=r}return e}(u))}return(0,o.Z)(t,[{key:"getModuleSource",value:function(t){var e;switch(t){case"vs":e=this.vs||"";break;case"fs":e=this.fs||"";break;default:(0,l.Z)(!1)}return"#define MODULE_".concat(this.name.toUpperCase().replace(/[^0-9a-z]/gi,"_"),"\n").concat(e,"// END MODULE_").concat(this.name,"\n\n")}},{key:"getUniforms",value:function(t,e){return this.getModuleUniforms?this.getModuleUniforms(t,e):this.uniforms?this._defaultGetUniforms(t):{}}},{key:"getDefines",value:function(){return this.defines}},{key:"checkDeprecations",value:function(t,e){this.deprecations.forEach((function(n){n.regex.test(t)&&(n.deprecated?e.deprecated(n.old,n.new)():e.removed(n.old,n.new)())}))}},{key:"_parseDeprecationDefinitions",value:function(t){return t.forEach((function(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}},{key:"_defaultGetUniforms",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e={},n=this.uniforms;for(var r in n){var i=n[r];r in t&&!i.private?(i.validate&&(0,l.Z)(i.validate(t[r],i),"".concat(this.name,": invalid ").concat(r)),e[r]=t[r]):e[r]=i.value}return e}}]),t}();function d(t){return A(g(t))}function A(t){var e={},n={};return v({modules:t,level:0,moduleMap:e,moduleDepth:n}),Object.keys(n).sort((function(t,e){return n[e]-n[t]})).map((function(t){return e[t]}))}function v(t){var e=t.modules,n=t.level,i=t.moduleMap,o=t.moduleDepth;if(n>=5)throw new Error("Possible loop in shader dependency graph");var a,s=(0,r.Z)(e);try{for(s.s();!(a=s.n()).done;){var u=a.value;i[u.name]=u,(void 0===o[u.name]||o[u.name]<n)&&(o[u.name]=n)}}catch(f){s.e(f)}finally{s.f()}var l,c=(0,r.Z)(e);try{for(c.s();!(l=c.n()).done;){var h=l.value;h.dependencies&&v({modules:h.dependencies,level:n+1,moduleMap:i,moduleDepth:o})}}catch(f){c.e(f)}finally{c.f()}}function g(t,e){return t.map((function(t){return t instanceof p||((0,l.Z)("string"!==typeof t,"Shader module use by name is deprecated. Import shader module '".concat(t,"' and use it directly.")),(0,l.Z)(t.name,"shader module has no name"),(t=new p(t)).dependencies=g(t.dependencies)),t}))}
2var m=7936,y=7937,_=7938,b=35724,x={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]},w={};Object.keys(x).forEach((function(t){w[t]=t}));var C={};function B(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=x[e];if((0,l.Z)(r,e),!function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e="undefined"!==typeof window&&window.navigator||{},n=t.userAgent||e.userAgent||"",r=-1!==n.indexOf("MSIE "),i=-1!==n.indexOf("Trident/");return r||i}(n))return!0;if(e in C)return C[e];var i=r[0],o=n.behavior||"enable",a="#extension GL_".concat(i," : ").concat(o,"\nvoid main(void) {}"),s=t.createShader(35633);t.shaderSource(s,a),t.compileShader(s);var u=t.getShaderParameter(s,35713);return t.deleteShader(s),C[e]=u,u}function k(t,e){var n=x[e];(0,l.Z)(n,e);var r=function(t){return"undefined"!==typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||Boolean(t&&2===t._version)}(t)&&n[1]||n[0],i="string"===typeof r?Boolean(t.getExtension(r)):r;return(0,l.Z)(!1===i||!0===i),i}function E(t,e){return(e=Array.isArray(e)?e:[e]).every((function(e){return k(t,e)}))}function S(t){var e=function(t){var e=t.getExtension("WEBGL_debug_renderer_info"),n=t.getParameter(e&&e.UNMASKED_VENDOR_WEBGL||m),r=t.getParameter(e&&e.UNMASKED_RENDERER_WEBGL||y);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,r),vendor:n,renderer:r,version:t.getParameter(_),shadingLanguageVersion:t.getParameter(b)}}(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 T=n(62574);function M(t){return new RegExp("\\b".concat(t,"[ \\t]+(\\w+[ \\t]+\\w+(\\[\\w+\\])?;)"),"g")}var I,P=[[/^(#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("]],Z=[].concat(P,[[M("attribute"),"in $1"],[M("varying"),"out $1"]]),D=[].concat(P,[[M("varying"),"in $1"]]),L=[[/^#version[ \t]+300[ \t]+es/,"#version 100"],[/\btexture(2D|2DProj|Cube)Lod\(/g,"texture$1LodEXT("],[/\btexture\(/g,"texture2D("],[/\btextureLod\(/g,"texture2DLodEXT("]],O=[].concat(L,[[M("in"),"attribute $1"],[M("out"),"varying $1"]]),F=[].concat(L,[[M("in"),"varying $1"]]),R="gl_FragColor",z=/\bout[ \t]+vec4[ \t]+(\w+)[ \t]*;\n?/,U=/void\s+main\s*\([^)]*\)\s*\{\n?/;function N(t,e,n){switch(e){case 300:return n?G(t,Z):function(t){t=G(t,D);var e=t.match(z);if(e){var n=e[1];t=t.replace(new RegExp("\\b".concat(R,"\\b"),"g"),n)}else{var r="fragmentColor";t=t.replace(U,(function(t){return"out vec4 ".concat(r,";\n").concat(t)})).replace(new RegExp("\\b".concat(R,"\\b"),"g"),r)}return t}(t);case 100:return n?G(t,O):function(t){t=G(t,F);var e=t.match(z);if(e){var n=e[1];t=t.replace(z,"").replace(new RegExp("\\b".concat(n,"\\b"),"g"),R)}return t}(t);default:throw new Error("unknown GLSL version ".concat(e))}}function G(t,e){var n,i=(0,r.Z)(e);try{for(i.s();!(n=i.n()).done;){var o=(0,a.Z)(n.value,2),s=o[0],u=o[1];t=t.replace(s,u)}}catch(l){i.e(l)}finally{i.f()}return t}var j="\n\n".concat(T.O_,"\n\n"),V=(I={},(0,s.Z)(I,u.H,"vertex"),(0,s.Z)(I,u.Y,"fragment"),I),H="precision highp float;\n\n";function J(t,e){var n=e.id,i=e.source,o=e.type,s=e.modules,c=e.defines,h=void 0===c?{}:c,f=e.hookFunctions,p=void 0===f?[]:f,d=e.inject,A=void 0===d?{}:d,v=e.transpileToGLSL100,g=void 0!==v&&v,m=e.prologue,y=void 0===m||m,_=e.log;(0,l.Z)("string"===typeof i,"shader source must be a string");var b=o===u.H,x=i.split("\n"),C=100,k="",M=i;0===x[0].indexOf("#version ")?(C=300,k=x[0],M=x.slice(1).join("\n")):k="#version ".concat(C);var I={};
2s.forEach((function(t){Object.assign(I,t.getDefines())})),Object.assign(I,h);var P=y?"".concat(k,"\n").concat(function(t){var e=t.id,n=t.source,r=t.type,i=e&&"string"===typeof e&&-1===n.indexOf("SHADER_NAME");return i?"\n#define SHADER_NAME ".concat(e,"_").concat(V[r],"\n\n"):""}({id:n,source:i,type:o}),"\n").concat(function(t){var e=t.type;return"\n#define SHADER_TYPE_".concat(V[e].toUpperCase(),"\n")}({type:o}),"\n").concat(S(t),"\n").concat(function(t,e,n){var r="#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 E(t,w.GLSL_FRAG_DEPTH)&&(r+="\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"),E(t,w.GLSL_DERIVATIVES)&&B(t,w.GLSL_DERIVATIVES)&&(r+="\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"),E(t,w.GLSL_FRAG_DATA)&&B(t,w.GLSL_FRAG_DATA,{behavior:"require"})&&(r+="\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"),E(t,w.GLSL_TEXTURE_LOD)&&(r+="// 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"),r}(t),"\n").concat(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=0,n="";for(var r in t){0===e&&(n+="\n// APPLICATION DEFINES\n"),e++;var i=t[r];(i||Number.isFinite(i))&&(n+="#define ".concat(r.toUpperCase()," ").concat(t[r],"\n"))}0===e&&(n+="\n");return n}(I),"\n").concat(b?"":H,"\n"):"".concat(k,"\n"),Z=function(t){var e={vs:{},fs:{}};return t.forEach((function(t){var n;"string"!==typeof t?t=(n=t).hook:n={};var r=(t=t.trim()).split(":"),i=(0,a.Z)(r,2),o=i[0],s=i[1],u=t.replace(/\(.+/,"");e[o][u]=Object.assign(n,{signature:s})})),e}(p),D={},L={},O={};for(var F in A){var R="string"===typeof A[F]?{injection:A[F],order:0}:A[F],z=F.match(/^(v|f)s:(#)?([\w-]+)$/);if(z){var U=z[2],G=z[3];U?"decl"===G?L[F]=[R]:O[F]=[R]:D[F]=[R]}else O[F]=[R]}var J,W=(0,r.Z)(s);try{for(W.s();!(J=W.n()).done;){var Q=J.value;_&&Q.checkDeprecations(M,_),P+=Q.getModuleSource(o,C);var q=Q.injections[o];for(var K in q){var X=K.match(/^(v|f)s:#([\w-]+)$/);if(X){var Y="decl"===X[2]?L:O;Y[K]=Y[K]||[],Y[K].push(q[K])}else D[K]=D[K]||[],D[K].push(q[K])}}}catch($){W.e($)}finally{W.f()}return P+=j,P=(0,T.ZP)(P,o,L),P+=function(t,e){var n="";for(var i in t){var o=t[i];if(n+="void ".concat(o.signature," {\n"),o.header&&(n+="  ".concat(o.header)),e[i]){var a=e[i];a.sort((function(t,e){return t.order-e.order}));var s,u=(0,r.Z)(a);try{for(u.s();!(s=u.n()).done;){var l=s.value;n+="  ".concat(l.injection,"\n")}}catch($){u.e($)}finally{u.f()}}o.footer&&(n+="  ".concat(o.footer)),n+="}\n"}return n}(Z[o],D),P+=M,P=N(P=(0,T.ZP)(P,o,O),g?100:C,b)}function W(t){return function(e){var n,i={},o=(0,r.Z)(t);try{for(o.s();!(n=o.n()).done;){var a=n.value.getUniforms(e,i);Object.assign(i,a)}}catch(s){o.e(s)}finally{o.f()}return i}}var Q=n(79817),q=function(){function t(e){(0,i.Z)(this,t),this.gl=e,this._programCache={},this._getUniforms={},this._registeredModules={},this._hookFunctions=[],this._defaultModules=[],this._hashes={},this._hashCounter=0,this.stateHash=0,this._useCounts={}}return(0,o.Z)(t,[{key:"addDefaultModule",value:function(t){this._defaultModules.find((function(e){return e.name===t.name}))||this._defaultModules.push(t),this.stateHash++}},{key:"removeDefaultModule",value:function(t){var e="string"===typeof t?t:t.name;this._defaultModules=this._defaultModules.filter((function(t){return t.name!==e})),this.stateHash++}},{key:"addShaderHook",value:function(t,e){e&&(t=Object.assign(e,{hook:t})),this._hookFunctions.push(t),this.stateHash++}},{key:"get",value:function(){var t,e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=n.vs,o=void 0===i?"":i,a=n.fs,s=void 0===a?"":a,l=n.defines,c=void 0===l?{}:l,h=n.inject,f=void 0===h?{}:h,p=n.varyings,A=void 0===p?[]:p,v=n.bufferMode,g=void 0===v?35981:v,m=n.transpileToGLSL100,y=void 0!==m&&m,_=this._getModuleList(n.modules),b=this._getHash(o),x=this._getHash(s),w=_.map((function(t){return e._getHash(t.name)})).sort(),C=A.map((function(t){return e._getHash(t)})),B=Object.keys(c).sort(),k=Object.keys(f).sort(),E=[],S=[],T=(0,r.Z)(B);try{for(T.s();!(t=T.n()).done;){var M=t.value;E.push(this._getHash(M)),E.push(this._getHash(c[M]))}}catch(O){T.e(O)}finally{T.f()}var I,P=(0,r.Z)(k);try{for(P.s();!(I=P.n()).done;){var Z=I.value;
2S.push(this._getHash(Z)),S.push(this._getHash(f[Z]))}}catch(O){P.e(O)}finally{P.f()}var D="".concat(b,"/").concat(x,"D").concat(E.join("/"),"M").concat(w.join("/"),"I").concat(S.join("/"),"V").concat(C.join("/"),"H").concat(this.stateHash,"B").concat(g).concat(y?"T":"");if(!this._programCache[D]){var L=function(t,e){var n=e.vs,r=e.fs,i=d(e.modules||[]);return{gl:t,vs:J(t,Object.assign({},e,{source:n,type:u.H,modules:i})),fs:J(t,Object.assign({},e,{source:r,type:u.Y,modules:i})),getUniforms:W(i)}}(this.gl,{vs:o,fs:s,modules:_,inject:f,defines:c,hookFunctions:this._hookFunctions,transpileToGLSL100:y});this._programCache[D]=new Q.Z(this.gl,{hash:D,vs:L.vs,fs:L.fs,varyings:A,bufferMode:g}),this._getUniforms[D]=L.getUniforms||function(t){},this._useCounts[D]=0}return this._useCounts[D]++,this._programCache[D]}},{key:"getUniforms",value:function(t){return this._getUniforms[t.hash]||null}},{key:"release",value:function(t){var 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])}},{key:"_getHash",value:function(t){return void 0===this._hashes[t]&&(this._hashes[t]=this._hashCounter++),this._hashes[t]}},{key:"_getModuleList",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=new Array(this._defaultModules.length+t.length),n={},r=0,i=0,o=this._defaultModules.length;i<o;++i){var a=this._defaultModules[i],s=a.name;e[r++]=a,n[s]=!0}for(var u=0,l=t.length;u<l;++u){var c=t[u],h=c.name;n[h]||(e[r++]=c,n[h]=!0)}return e.length=r,e}}],[{key:"getDefaultProgramManager",value:function(e){return e.luma=e.luma||{},e.luma.defaultProgramManager=e.luma.defaultProgramManager||new t(e),e.luma.defaultProgramManager}}]),t}()},17225:function(t,e,n){"use strict";n.d(e,{Z:function(){return D}});var r=n(60726),i=n(22951),o=n(91976),a=n(11026),s=n(17865),u="out vec4 transform_output;\nvoid main() {\n  transform_output = vec4(0);\n}",l="#version 300 es\n".concat(u);function c(t,e){e=Array.isArray(e)?e:[e];var n=t.replace(/^\s+/,"").split(/\s+/),r=(0,a.Z)(n,3),i=r[0],o=r[1],s=r[2];return e.includes(i)&&o&&s?{qualifier:i,type:o,name:s.split(";")[0]}:null}function h(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.version,n=void 0===e?100:e,r=t.input,i=t.inputType,o=t.output;if(!r)return 300===n?l:n>300?"#version ".concat(n,"\n").concat(u):"void main() {gl_FragColor = vec4(0);}";var a=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,s.Z)(!1),null}}(r,i);return n>=300?"#version ".concat(n," ").concat(300===n?"es":"","\nin ").concat(i," ").concat(r,";\nout vec4 ").concat(o,";\nvoid main() {\n  ").concat(o," = ").concat(a,";\n}"):"varying ".concat(i," ").concat(r,";\nvoid main() {\n  gl_FragColor = ").concat(a,";\n}")}var f=n(28007),p=n(33839),d=n(54345),A=n(81301),v=function(){function t(e){(0,i.Z)(this,t);var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.gl=e,this.currentIndex=0,this.feedbackMap={},this.varyings=null,this.bindings=[],this.resources={},this._initialize(n),Object.seal(this)}return(0,o.Z)(t,[{key:"setupResources",value:function(t){var e,n=(0,r.Z)(this.bindings);try{for(n.s();!(e=n.n()).done;){var i=e.value;this._setupTransformFeedback(i,t)}}catch(o){n.e(o)}finally{n.f()}}},{key:"updateModelProps",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.varyings;return e.length>0&&(t=Object.assign({},t,{varyings:e})),t}},{key:"getDrawOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.bindings[this.currentIndex],n=e.sourceBuffers,r=e.transformFeedback;return{attributes:Object.assign({},n,t.attributes),transformFeedback:r}}},{key:"swap",value:function(){return!!this.feedbackMap&&(this.currentIndex=this._getNextIndex(),!0)}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._setupBuffers(t)}},{key:"getBuffer",value:function(t){var e=this.bindings[this.currentIndex].feedbackBuffers,n=t?e[t]:null;return n?n instanceof p.Z?n:n.buffer:null}},{key:"getData",value:function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).varyingName,e=this.getBuffer(t);return e?e.getData():null}},{key:"delete",value:function(){for(var t in this.resources)this.resources[t].delete()}},{key:"_initialize",value:function(){var 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,A.h)((0,f.D0)(this.gl))}},{key:"_getFeedbackBuffers",value:function(t){var e=t.sourceBuffers,n=void 0===e?{}:e,r={};if(this.bindings[this.currentIndex]&&Object.assign(r,this.bindings[this.currentIndex].feedbackBuffers),this.feedbackMap)for(var i in this.feedbackMap){var o=this.feedbackMap[i];i in n&&(r[o]=i)}for(var a in Object.assign(r,t.feedbackBuffers),r){var s=r[a];if("string"===typeof s){var u=n[s],l=u.byteLength,c=u.usage,h=u.accessor;r[a]=this._createNewBuffer(a,{byteLength:l,usage:c,accessor:h})}}return r}},{key:"_setupBuffers",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.sourceBuffers,n=void 0===e?null:e;Object.assign(this.feedbackMap,t.feedbackMap);var r=this._getFeedbackBuffers(t);this._updateBindings({sourceBuffers:n,feedbackBuffers:r})}},{key:"_setupTransformFeedback",value:function(t,e){var n=e.model.program;t.transformFeedback=new d.Z(this.gl,{program:n,buffers:t.feedbackBuffers})}},{key:"_updateBindings",value:function(t){if(this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],t),this.feedbackMap){var e=this._swapBuffers(this.bindings[this.currentIndex]),n=e.sourceBuffers,r=e.feedbackBuffers,i=this._getNextIndex();this.bindings[i]=this._updateBinding(this.bindings[i],{sourceBuffers:n,feedbackBuffers:r})}}},{key:"_updateBinding",value:function(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)}}},{key:"_swapBuffers",value:function(t){if(!this.feedbackMap)return null;var e=Object.assign({},t.sourceBuffers),n=Object.assign({},t.feedbackBuffers);for(var r in this.feedbackMap){var i=this.feedbackMap[r];e[r]=t.feedbackBuffers[i],n[i]=t.sourceBuffers[r],(0,A.h)(n[i]instanceof p.Z)}return{sourceBuffers:e,feedbackBuffers:n}}},{key:"_createNewBuffer",value:function(t,e){var n=new p.Z(this.gl,e);return this.resources[t]&&this.resources[t].delete(),this.resources[t]=n,n}},{key:"_getNextIndex",value:function(){return(this.currentIndex+1)%2}}]),t}(),g=n(64649),m=n(56474),y=n(58300),_=n(79078),b=n(17507);function x(t){var e=100,n=t.match(/[^\s]+/g);if(n.length>=2&&"#version"===n[0]){var r=parseInt(n[1],10);Number.isFinite(r)&&(e=r)}return e}var w,C=n(62574),B={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},k="transform_uSampler_",E="transform_uSize_",S="transform_position";function T(t){var e=t.vs,n=t.sourceTextureMap,r=t.targetTextureVarying,i=t.targetTexture,o=Object.keys(n).length,a=null,u={},l=e,h={};if(o>0||r){var f=l.split("\n"),p=f.slice();
2if(f.forEach((function(t,e,i){if(o>0){var l=function(t,e){var n={},r=function(t){return c(t,["attribute","in"])}(t);if(!r)return null;var i=r.type,o=r.name;if(o&&e[o]){var a="// ".concat(t," => Replaced by Transform with a sampler"),u=function(t){var e="".concat(k).concat(t),n="".concat(E).concat(t),r="  uniform sampler2D ".concat(e,";\n  uniform vec2 ").concat(n,";");return{samplerName:e,sizeName:n,uniformDeclerations:r}}(o),l=u.samplerName,h=u.sizeName,f=u.uniformDeclerations,p=function(t){switch(t){case"float":return"x";case"vec2":return"xy";case"vec3":return"xyz";case"vec4":return"xyzw";default:return(0,s.Z)(!1),null}}(i),d="  ".concat(i," ").concat(o," = transform_getInput(").concat(l,", ").concat(h,").").concat(p,";\n");return n[l]=o,{updatedLine:a,inject:{"vs:#decl":f,"vs:#main-start":d},samplerTextureMap:n}}return null}(t,n);if(l){var f=l.updatedLine,d=l.inject;p[e]=f,h=(0,C.Lm)([h,d]),Object.assign(u,l.samplerTextureMap),o--}}r&&!a&&(a=function(t,e){var n=c(t,["varying","out"]);if(!n)return null;return n.name===e?n.type:null}(t,r))})),r){(0,A.h)(i);var d="".concat(E).concat(r),v={"vs:#decl":"uniform vec2 ".concat(d,";\n"),"vs:#main-start":"     vec2 ".concat(S," = transform_getPos(").concat(d,");\n     gl_Position = vec4(").concat(S,", 0, 1.);\n")};h=(0,C.Lm)([h,v])}l=p.join("\n")}return{vs:l,targetTextureType:a,inject:h,samplerTextureMap:u}}var M=(w={},(0,g.Z)(w,10241,9728),(0,g.Z)(w,10240,9728),(0,g.Z)(w,10242,33071),(0,g.Z)(w,10243,33071),w),I=function(){function t(e){(0,i.Z)(this,t);var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.gl=e,this.id=this.currentIndex=0,this._swapTexture=null,this.targetTextureVarying=null,this.targetTextureType=null,this.samplerTextureMap=null,this.bindings=[],this.resources={},this._initialize(n),Object.seal(this)}return(0,o.Z)(t,[{key:"updateModelProps",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this._processVertexShader(t);return Object.assign({},t,e)}},{key:"getDrawOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.bindings[this.currentIndex],n=e.sourceBuffers,r=e.sourceTextures,i=e.framebuffer,o=e.targetTexture,a=Object.assign({},n,t.attributes),s=Object.assign({},t.uniforms),u=Object.assign({},t.parameters),l=t.discard;if(this.hasSourceTextures||this.hasTargetTexture){for(var c in a.transform_elementID=this.elementIDBuffer,this.samplerTextureMap){var h=this.samplerTextureMap[c];s[c]=r[h]}this._setSourceTextureParameters();var f=function(t){var e,n,r=t.sourceTextureMap,i=t.targetTextureVarying,o=t.targetTexture,a={};for(var s in i&&(e=o.width,n=o.height,a["".concat(E).concat(i)]=[e,n]),r){var u=r[s];e=u.width,n=u.height,a["".concat(E).concat(s)]=[e,n]}return a}({sourceTextureMap:r,targetTextureVarying:this.targetTextureVarying,targetTexture:o});Object.assign(s,f)}return this.hasTargetTexture&&(l=!1,u.viewport=[0,0,i.width,i.height]),{attributes:a,framebuffer:i,uniforms:s,discard:l,parameters:u}}},{key:"swap",value:function(){return!!this._swapTexture&&(this.currentIndex=this._getNextIndex(),!0)}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._setupTextures(t)}},{key:"getTargetTexture",value:function(){return this.bindings[this.currentIndex].targetTexture}},{key:"getData",value:function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).packed,e=void 0!==t&&t,n=this.bindings[this.currentIndex].framebuffer,r=(0,m.z6)(n);if(!e)return r;for(var i=r.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,s.Z)(!1),null}}(this.targetTextureType),a=new i(r.length*o/4),u=0,l=0;l<r.length;l+=4)for(var c=0;c<o;c++)a[u++]=r[l+c];return a}},{key:"getFramebuffer",value:function(){return this.bindings[this.currentIndex].framebuffer}},{key:"delete",value:function(){this.ownTexture&&this.ownTexture.delete(),this.elementIDBuffer&&this.elementIDBuffer.delete()}},{key:"_initialize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t._targetTextureVarying,n=t._swapTexture;this._swapTexture=n,this.targetTextureVarying=e,this.hasTargetTexture=e,this._setupTextures(t)}},{key:"_createTargetTexture",value:function(t){var e=t.sourceTextures,n=t.textureOrReference;if(n instanceof y.Z)return n;var r=e[n];return r?(this._targetRefTexName=n,this._createNewTexture(r)):null}},{key:"_setupTextures",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.sourceBuffers,n=t._sourceTextures,r=void 0===n?{}:n,i=t._targetTexture,o=this._createTargetTexture({sourceTextures:r,textureOrReference:i});this.hasSourceTextures=this.hasSourceTextures||r&&Object.keys(r).length>0,this._updateBindings({sourceBuffers:e,sourceTextures:r,targetTexture:o}),"elementCount"in t&&this._updateElementIDBuffer(t.elementCount)}
2},{key:"_updateElementIDBuffer",value:function(t){if(!("number"!==typeof t||this.elementCount>=t)){var e=new Float32Array(t);e.forEach((function(t,e,n){n[e]=e})),this.elementIDBuffer?this.elementIDBuffer.setData({data:e}):this.elementIDBuffer=new p.Z(this.gl,{data:e,accessor:{size:1}}),this.elementCount=t}}},{key:"_updateBindings",value:function(t){if(this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],t),this._swapTexture){var e=this._swapTextures(this.bindings[this.currentIndex]),n=e.sourceTextures,r=e.targetTexture,i=this._getNextIndex();this.bindings[i]=this._updateBinding(this.bindings[i],{sourceTextures:n,targetTexture:r})}}},{key:"_updateBinding",value:function(t,e){var n=e.sourceBuffers,r=e.sourceTextures,i=e.targetTexture;if(t||(t={sourceBuffers:{},sourceTextures:{},targetTexture:null}),Object.assign(t.sourceTextures,r),Object.assign(t.sourceBuffers,n),i){t.targetTexture=i;var o=i.width,a=i.height,s=t.framebuffer;s?(s.update({attachments:(0,g.Z)({},36064,i),resizeAttachments:!1}),s.resize({width:o,height:a})):t.framebuffer=new _.Z(this.gl,{id:"transform-framebuffer",width:o,height:a,attachments:(0,g.Z)({},36064,i)})}return t}},{key:"_setSourceTextureParameters",value:function(){var t=this.currentIndex,e=this.bindings[t].sourceTextures;for(var n in e)e[n].setParameters(M)}},{key:"_swapTextures",value:function(t){if(!this._swapTexture)return null;var e=Object.assign({},t.sourceTextures);return e[this._swapTexture]=t.targetTexture,{sourceTextures:e,targetTexture:t.sourceTextures[this._swapTexture]}}},{key:"_createNewTexture",value:function(t){var e,n=(0,b.h)(t,{parameters:(e={},(0,g.Z)(e,10241,9728),(0,g.Z)(e,10240,9728),(0,g.Z)(e,10242,33071),(0,g.Z)(e,10243,33071),e),pixelStore:(0,g.Z)({},37440,!1)});return this.ownTexture&&this.ownTexture.delete(),this.ownTexture=n,n}},{key:"_getNextIndex",value:function(){return(this.currentIndex+1)%2}},{key:"_processVertexShader",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.bindings[this.currentIndex],n=e.sourceTextures,r=e.targetTexture,i=T({vs:t.vs,sourceTextureMap:n,targetTextureVarying:this.targetTextureVarying,targetTexture:r}),o=i.vs,a=i.uniforms,s=i.targetTextureType,u=i.inject,l=i.samplerTextureMap,c=(0,C.Lm)([t.inject||{},u]);return this.targetTextureType=s,this.samplerTextureMap=l,{vs:o,fs:t._fs||h({version:x(o),input:this.targetTextureVarying,inputType:s,output:"transform_output"}),modules:this.hasSourceTextures||this.targetTextureVarying?[B].concat(t.modules||[]):t.modules,uniforms:a,inject:c}}}]),t}(),P=n(79666),Z=n(94557),D=function(){function t(e){(0,i.Z)(this,t);var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.gl=e,this.model=null,this.elementCount=0,this.bufferTransform=null,this.textureTransform=null,this.elementIDBuffer=null,this._initialize(n),Object.seal(this)}return(0,o.Z)(t,[{key:"delete",value:function(){var t=this.model,e=this.bufferTransform,n=this.textureTransform;t&&t.delete(),e&&e.delete(),n&&n.delete()}},{key:"run",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.clearRenderTarget,n=void 0===e||e,r=this._updateDrawOptions(t);n&&r.framebuffer&&r.framebuffer.clear({color:!0}),this.model.transform(r)}},{key:"swap",value:function(){var t,e=!1,n=[this.bufferTransform,this.textureTransform].filter(Boolean),i=(0,r.Z)(n);try{for(i.s();!(t=i.n()).done;){var o=t.value;e=e||o.swap()}}catch(a){i.e(a)}finally{i.f()}(0,A.h)(e,"Nothing to swap")}},{key:"getBuffer",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return this.bufferTransform&&this.bufferTransform.getBuffer(t)}},{key:"getData",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=[this.bufferTransform,this.textureTransform].filter(Boolean),i=(0,r.Z)(n);try{for(i.s();!(t=i.n()).done;){var o=t.value.getData(e);if(o)return o}}catch(a){i.e(a)}finally{i.f()}return null}},{key:"getFramebuffer",value:function(){return this.textureTransform&&this.textureTransform.getFramebuffer()}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"elementCount"in t&&this.model.setVertexCount(t.elementCount);
2var e,n=[this.bufferTransform,this.textureTransform].filter(Boolean),i=(0,r.Z)(n);try{for(i.s();!(e=i.n()).done;){e.value.update(t)}}catch(o){i.e(o)}finally{i.f()}}},{key:"_initialize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.gl;this._buildResourceTransforms(e,t),t=this._updateModelProps(t),this.model=new Z.Z(e,Object.assign({},t,{fs:t.fs||h({version:x(t.vs)}),id:t.id||"transform-model",drawMode:t.drawMode||0,vertexCount:t.elementCount})),this.bufferTransform&&this.bufferTransform.setupResources({model:this.model})}},{key:"_updateModelProps",value:function(t){var e,n=Object.assign({},t),i=[this.bufferTransform,this.textureTransform].filter(Boolean),o=(0,r.Z)(i);try{for(o.s();!(e=o.n()).done;){n=e.value.updateModelProps(n)}}catch(a){o.e(a)}finally{o.f()}return n}},{key:"_buildResourceTransforms",value:function(t,e){(function(t){if(!(0,P.nK)(t.feedbackBuffers)||!(0,P.nK)(t.feedbackMap)||t.varyings&&t.varyings.length>0)return!0;return!1})(e)&&(this.bufferTransform=new v(t,e)),function(t){if(!(0,P.nK)(t._sourceTextures)||t._targetTexture||t._targetTextureVarying)return!0;return!1}(e)&&(this.textureTransform=new I(t,e)),(0,A.h)(this.bufferTransform||this.textureTransform,"must provide source/feedback buffers or source/target textures")}},{key:"_updateDrawOptions",value:function(t){var e,n=Object.assign({},t),i=[this.bufferTransform,this.textureTransform].filter(Boolean),o=(0,r.Z)(i);try{for(o.s();!(e=o.n()).done;){var a=e.value;n=Object.assign(n,a.getDrawOptions(n))}}catch(s){o.e(s)}finally{o.f()}return n}}],[{key:"isSupported",value:function(t){return(0,f.D0)(t)}}]),t}()},92086:function(t,e,n){"use strict";n.d(e,{Z:function(){return h}});var r=n(50189),i=n(64649),o=n(22951),a=n(91976),s=n(12308),u=n(70353),l=n(58300),c=n(28007),h=function(){function t(e,n){(0,o.Z)(this,t);var r=n.attributes,i=n.material,a=n.pbrDebug,l=n.imageBasedLightingEnvironment,c=n.lights,h=n.useTangents;this.gl=e,this.defines={MANUAL_SRGB:1,SRGB_FAST_APPROXIMATION:1},(0,s.U6)(e,u.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=[],l&&(this.uniforms.u_DiffuseEnvSampler=l.getDiffuseEnvSampler(),this.uniforms.u_SpecularEnvSampler=l.getSpecularEnvSampler(),this.uniforms.u_brdfLUT=l.getBrdfTexture(),this.uniforms.u_ScaleIBLAmbient=[1,1]),a&&(this.uniforms.u_ScaleDiffBaseMR=[0,0,0,0],this.uniforms.u_ScaleFGDSpec=[0,0,0,0]),this.defineIfPresent(r.NORMAL,"HAS_NORMALS"),this.defineIfPresent(r.TANGENT&&h,"HAS_TANGENTS"),this.defineIfPresent(r.TEXCOORD_0,"HAS_UV"),this.defineIfPresent(l,"USE_IBL"),this.defineIfPresent(c,"USE_LIGHTS"),this.defineIfPresent(a,"PBR_DEBUG"),i&&this.parseMaterial(i)}return(0,a.Z)(t,[{key:"defineIfPresent",value:function(t,e){t&&(this.defines[e]=1)}},{key:"parseTexture",value:function(t,e){var n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=t.texture&&t.texture.sampler&&t.texture.sampler.parameters||{},s=t.texture.source.image,u={};s.compressed?(n=s,u=(0,i.Z)({},this.gl.TEXTURE_MIN_FILTER,s.data.length>1?this.gl.LINEAR_MIPMAP_NEAREST:this.gl.LINEAR)):n={data:s};var c=new l.Z(this.gl,(0,r.Z)({id:t.name||t.id,parameters:(0,r.Z)((0,r.Z)({},a),u),pixelStore:(0,i.Z)({},this.gl.UNPACK_FLIP_Y_WEBGL,!1)},n));this.uniforms[e]=c,this.defineIfPresent(o,o),this.generatedTextures.push(c)}},{key:"parsePbrMetallicRoughness",value:function(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");var e=t.metallicFactor,n=void 0===e?1:e,r=t.roughnessFactor,i=void 0===r?1:r;this.uniforms.u_MetallicRoughnessValues=[n,i]}},{key:"parseMaterial",value:function(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");var e=t.normalTexture.scale,n=void 0===e?1:e;this.uniforms.u_NormalScale=n}if(t.occlusionTexture){this.parseTexture(t.occlusionTexture,"u_OcclusionSampler","HAS_OCCLUSIONMAP");var r=t.occlusionTexture.strength,i=void 0===r?1:r;this.uniforms.u_OcclusionStrength=i}if(t.emissiveTexture&&(this.parseTexture(t.emissiveTexture,"u_EmissiveSampler","HAS_EMISSIVEMAP"),this.uniforms.u_EmissiveFactor=t.emissiveFactor||[0,0,0]),"MASK"===t.alphaMode){var o=t.alphaCutoff,a=void 0===o?.5:o;this.defines.ALPHA_CUTOFF=1,this.uniforms.u_AlphaCutoff=a}else"BLEND"===t.alphaMode&&(c.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]}))}}
2,{key:"delete",value:function(){this.generatedTextures.forEach((function(t){return t.delete()}))}}]),t}()},28007:function(t,e,n){"use strict";n.d(e,{KQ:function(){return h},JD:function(){return c},s9:function(){return ht},JY:function(){return ot},w:function(){return it},ZS:function(){return et},vd:function(){return l},yW:function(){return ft},UF:function(){return s},D0:function(){return u},cM:function(){return r},kL:function(){return nt},aQ:function(){return pt},dR:function(){return tt},s8:function(){return rt}});var r=new(n(87294).Z)({id:"luma.gl"});function i(t,e){if(!t)throw new Error(e||"luma.gl: assertion failed.")}var o="Invalid WebGLRenderingContext",a="Requires WebGL2";function s(t){return"undefined"!==typeof WebGLRenderingContext&&t instanceof WebGLRenderingContext||("undefined"!==typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||Boolean(t&&Number.isFinite(t._version)))}function u(t){return"undefined"!==typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||Boolean(t&&2===t._version)}function l(t){return u(t)?t:null}function c(t){return i(s(t),o),t}function h(t){return i(u(t),a),t}var f=n(60726),p={};function d(t,e){var n;p[t]=!0,void 0!==e&&(n=e,globalThis.console&&globalThis.console.error&&globalThis.console.error(n))}var A=function t(e){var n=e.gl;this.ext=e,this.isAlive=!0,this.hasBeenBound=!1,this.elementArrayBuffer=null,this.attribs=new Array(e.maxVertexAttribs);for(var r=0;r<this.attribs.length;r++){var i=new t.VertexAttrib(n);this.attribs[r]=i}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(":")};var v=function(t){var e=this;this.gl=t,function(t){var e=t.getError;t.getError=function(){var n;do{0!==(n=e.apply(t))&&(p[n]=!0)}while(0!==n);for(n in p)if(p[n])return delete p[n],parseInt(n,10);return 0}}(t);var 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){var r=e.currentVertexArrayObject;return r.maxAttrib=Math.max(r.maxAttrib,t),r.attribs[t].enabled=!0,n.enableVertexAttribArray.apply(this,arguments)},t.disableVertexAttribArray=function(t){var r=e.currentVertexArrayObject;return r.maxAttrib=Math.max(r.maxAttrib,t),r.attribs[t].enabled=!1,n.disableVertexAttribArray.apply(this,arguments)},t.bindBuffer=function(t,r){switch(t){case 34962:e.currentArrayBuffer=r;break;case 34963:e.currentVertexArrayObject.elementArrayBuffer=r}return n.bindBuffer.apply(this,arguments)},t.getVertexAttrib=function(t,r){var i=e.currentVertexArrayObject.attribs[t];switch(r){case 34975:return i.buffer;case 34338:return i.enabled;case 34339:return i.size;case 34340:return i.stride;case 34341:return i.type;case 34922:return i.normalized;default:return n.getVertexAttrib.apply(this,arguments)}},t.vertexAttribPointer=function(t,r,i,o,a,s){var u=e.currentVertexArrayObject;u.maxAttrib=Math.max(u.maxAttrib,t);var l=u.attribs[t];return l.buffer=e.currentArrayBuffer,l.size=r,l.type=i,l.normalized=o,l.stride=a,l.offset=s,l.recache(),n.vertexAttribPointer.apply(this,arguments)},t.instrumentExtension&&t.instrumentExtension(this,"OES_vertex_array_object"),t.canvas&&t.canvas.addEventListener("webglcontextrestored",(function(){var t;t="OESVertexArrayObject emulation library context restored",globalThis.console&&globalThis.console.log&&globalThis.console.log(t),e.reset_()}),!0),this.reset_()};v.prototype.VERTEX_ARRAY_BINDING_OES=34229,v.prototype.reset_=function(){if(void 0!==this.vertexArrayObjects)for(var t=0;t<this.vertexArrayObjects.length;++t)this.vertexArrayObjects.isAlive=!1;var e=this.gl;this.maxVertexAttribs=e.getParameter(34921),this.defaultVertexArrayObject=ne
2w A(this),this.currentVertexArrayObject=null,this.currentArrayBuffer=null,this.vertexArrayObjects=[this.defaultVertexArrayObject],this.bindVertexArrayOES(null)},v.prototype.createVertexArrayOES=function(){var t=new A(this);return this.vertexArrayObjects.push(t),t},v.prototype.deleteVertexArrayOES=function(t){t.isAlive=!1,this.vertexArrayObjects.splice(this.vertexArrayObjects.indexOf(t),1),this.currentVertexArrayObject===t&&this.bindVertexArrayOES(null)},v.prototype.isVertexArrayOES=function(t){return!!(t&&t instanceof A&&t.hasBeenBound&&t.ext===this)},v.prototype.bindVertexArrayOES=function(t){var e=this.gl;if(!t||t.isAlive){var n=this.original,r=this.currentVertexArrayObject;this.currentVertexArrayObject=t||this.defaultVertexArrayObject,this.currentVertexArrayObject.hasBeenBound=!0;var i=this.currentVertexArrayObject;if(r!==i){r&&i.elementArrayBuffer===r.elementArrayBuffer||n.bindBuffer.call(e,34963,i.elementArrayBuffer);for(var o=this.currentArrayBuffer,a=Math.max(r?r.maxAttrib:0,i.maxAttrib),s=0;s<=a;s++){var u=i.attribs[s],l=r?r.attribs[s]:null;if(r&&u.enabled===l.enabled||(u.enabled?n.enableVertexAttribArray.call(e,s):n.disableVertexAttribArray.call(e,s)),u.enabled){var c=!1;r&&u.buffer===l.buffer||(o!==u.buffer&&(n.bindBuffer.call(e,34962,u.buffer),o=u.buffer),c=!0),(c||u.cached!==l.cached)&&n.vertexAttribPointer.call(e,s,u.size,u.type,u.normalized,u.stride,u.offset)}}this.currentArrayBuffer!==o&&n.bindBuffer.call(e,34962,this.currentArrayBuffer)}}else d(1282,"bindVertexArrayOES: attempt to bind deleted arrayObject")};var g,m,y=n(64649),_="OES_element_index",b="WEBGL_draw_buffers",x="WEBGL_debug_renderer_info",w=function(t){return u(t)?void 0:0},C=(g={},(0,y.Z)(g,3074,(function(t){return u(t)?void 0:36064})),(0,y.Z)(g,35723,(function(t){return u(t)?void 0:4352})),(0,y.Z)(g,35977,w),(0,y.Z)(g,32937,w),(0,y.Z)(g,36795,(function(t,e){var n=u(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})),(0,y.Z)(g,37445,(function(t,e){var n=t.getExtension(x);return e(n&&n.UNMASKED_VENDOR_WEBGL||7936)})),(0,y.Z)(g,37446,(function(t,e){var n=t.getExtension(x);return e(n&&n.UNMASKED_RENDERER_WEBGL||7937)})),(0,y.Z)(g,34047,(function(t,e){var n=t.luma.extensions.EXT_texture_filter_anisotropic;return n?e(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1})),(0,y.Z)(g,32883,w),(0,y.Z)(g,35071,w),(0,y.Z)(g,37447,w),(0,y.Z)(g,36063,(function(t,e){if(!u(t)){var n=t.getExtension(b);return n?e(n.MAX_COLOR_ATTACHMENTS_WEBGL):0}})),(0,y.Z)(g,35379,w),(0,y.Z)(g,35374,w),(0,y.Z)(g,35377,w),(0,y.Z)(g,34852,(function(t){if(!u(t)){var e=t.getExtension(b);return e?e.MAX_DRAW_BUFFERS_WEBGL:0}})),(0,y.Z)(g,36203,(function(t){return t.getExtension(_)?2147483647:65535})),(0,y.Z)(g,33001,(function(t){return t.getExtension(_)?16777216:65535})),(0,y.Z)(g,33e3,(function(t){return 16777216})),(0,y.Z)(g,37157,w),(0,y.Z)(g,35373,w),(0,y.Z)(g,35657,w),(0,y.Z)(g,36183,w),(0,y.Z)(g,37137,w),(0,y.Z)(g,34045,w),(0,y.Z)(g,35978,w),(0,y.Z)(g,35979,w),(0,y.Z)(g,35968,w),(0,y.Z)(g,35376,w),(0,y.Z)(g,35375,w),(0,y.Z)(g,35659,w),(0,y.Z)(g,37154,w),(0,y.Z)(g,35371,w),(0,y.Z)(g,35658,w),(0,y.Z)(g,35076,w),(0,y.Z)(g,35077,w),(0,y.Z)(g,35380,w),g);var B="ANGLE_instanced_arrays";var k=(m={},(0,y.Z)(m,"OES_vertex_array_object",{meta:{suffix:"OES"},createVertexArray:function(){i(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:function(){},bindVertexArray:function(){},isVertexArray:function(){return!1}}),(0,y.Z)(m,B,{meta:{suffix:"ANGLE"},vertexAttribDivisor:function(t,e){i(0===e,"WebGL instanced rendering not supported")},drawElementsInstanced:function(){},drawArraysInstanced:function(){}}),(0,y.Z)(m,"WEBGL_draw_buffers",{meta:{suffix:"WEBGL"},drawBuffers:function(){i(!1)}}),(0,y.Z)(m,"EXT_disjoint_timer_query",{meta:{suffix:"EXT"},createQuery:function(){i(!1)},deleteQuery:function(){i(!1)},beginQuery:function(){i(!1)},endQuery:function(){},getQuery:function(t,e){return this.getQueryObject(t,e)},getQueryParameter:function(t,e){return this.getQueryObject(t,e)},getQueryObject:function(){}}),m),E={readBuffer:function(t,e,n){u(t)&&e(n)},getVertexAttrib:function(t,e,n,r){var i,o=function(t,e){return{webgl2:u(t),ext:t.getExtension(e)}}(t,B),a=o.webgl2,s=o.ext;switch(r){case 35069:i=!!a&&void 0;break;case 35070:i=a||s?void 0:0}return void 0!==i?i:e(n,r)},getProgramParameter:function(t,e,n,r){if(!u(t))switch(r){case 35967:return 35981;case 35971:case 35382:return 0}return e(n,r)},getInternalformatParameter:function(t,e,n,r,i){return u(t)||32937!==i?t.getInternalformatParameter(n,r,i):new Int32Array([0])},getTexParameter:function(t,e,n,r){if(34046===r){var i=t.luma.extensions.EXT_texture_filter_anisotropic;r=i&&i.TEXTURE_MAX_ANISOTROPY_EXT||34046}return e(n,r)},getParameter:function(t,e,n){var r=C[n],i="function"===typeof r?r(t,e,n):r;return void 0!==i?i:e(n)},hint:function(t,e,n,r){return e(n,r)}};function S(t,e){var n=e.extension,r=e.target,o=e.target2,a=k[n];i(a);for(var s=a.meta,u=(void 0===s?{}:s).suffix,l=void 0===u?"":u,c=t.getExtension(n),h=function(){var e=p[f],n="".concat(e).concat(l),i=null;"meta"===e||"function"===typeof t[e]||(c&&"function"===typeof c[n]?i=function(){return c[n].apply(c,arguments)}:"function"===typeof a[e]&&(i=a[e].bind(r))),i&&(r[e]=i,o[e]=i)},f=0,p=Object.keys(a);f<p.length;f++)h()}globalThis.polyfillContext=function(t){t.luma=t.luma||{};var e=t.luma;return e.polyfilled||(!function(t){if("function"!==typeof t.createVertexArray){var e=t.getSupp
2ortedExtensions;t.getSupportedExtensions=function(){var t=e.call(this)||[];return t.indexOf("OES_vertex_array_object")<0&&t.push("OES_vertex_array_object"),t};var n=t.getExtension;t.getExtension=function(e){return n.call(this,e)||("OES_vertex_array_object"!==e?null:(t.__OESVertexArrayObject||(this.__OESVertexArrayObject=new v(this)),this.__OESVertexArrayObject))}}}(t),function(t){t.luma.extensions={};var e,n=t.getSupportedExtensions()||[],r=(0,f.Z)(n);try{for(r.s();!(e=r.n()).done;){var i=e.value;t.luma[i]=t.getExtension(i)}}catch(o){r.e(o)}finally{r.f()}}(t),function(t,e){var n,r=(0,f.Z)(Object.getOwnPropertyNames(e));try{for(r.s();!(n=r.n()).done;){var i=n.value;"overrides"!==i&&S(t,{extension:i,target:t.luma,target2:t})}}catch(o){r.e(o)}finally{r.f()}}(t,k),function(t,e){var n=e.target,r=e.target2;Object.keys(E).forEach((function(e){if("function"===typeof E[e]){var i=t[e]?t[e].bind(t):function(){},o=E[e].bind(null,t,i);n[e]=o,r[e]=o}}))}(t,{target:e,target2:t}),e.polyfilled=!0),t};var T,M,I,P=n(11026),Z=n(649),D=(T={},(0,y.Z)(T,3042,!1),(0,y.Z)(T,32773,new Float32Array([0,0,0,0])),(0,y.Z)(T,32777,32774),(0,y.Z)(T,34877,32774),(0,y.Z)(T,32969,1),(0,y.Z)(T,32968,0),(0,y.Z)(T,32971,1),(0,y.Z)(T,32970,0),(0,y.Z)(T,3106,new Float32Array([0,0,0,0])),(0,y.Z)(T,3107,[!0,!0,!0,!0]),(0,y.Z)(T,2884,!1),(0,y.Z)(T,2885,1029),(0,y.Z)(T,2929,!1),(0,y.Z)(T,2931,1),(0,y.Z)(T,2932,513),(0,y.Z)(T,2928,new Float32Array([0,1])),(0,y.Z)(T,2930,!0),(0,y.Z)(T,3024,!0),(0,y.Z)(T,36006,null),(0,y.Z)(T,2886,2305),(0,y.Z)(T,33170,4352),(0,y.Z)(T,2849,1),(0,y.Z)(T,32823,!1),(0,y.Z)(T,32824,0),(0,y.Z)(T,10752,0),(0,y.Z)(T,32938,1),(0,y.Z)(T,32939,!1),(0,y.Z)(T,3089,!1),(0,y.Z)(T,3088,new Int32Array([0,0,1024,1024])),(0,y.Z)(T,2960,!1),(0,y.Z)(T,2961,0),(0,y.Z)(T,2968,4294967295),(0,y.Z)(T,36005,4294967295),(0,y.Z)(T,2962,519),(0,y.Z)(T,2967,0),(0,y.Z)(T,2963,4294967295),(0,y.Z)(T,34816,519),(0,y.Z)(T,36003,0),(0,y.Z)(T,36004,4294967295),(0,y.Z)(T,2964,7680),(0,y.Z)(T,2965,7680),(0,y.Z)(T,2966,7680),(0,y.Z)(T,34817,7680),(0,y.Z)(T,34818,7680),(0,y.Z)(T,34819,7680),(0,y.Z)(T,2978,[0,0,1024,1024]),(0,y.Z)(T,3333,4),(0,y.Z)(T,3317,4),(0,y.Z)(T,37440,!1),(0,y.Z)(T,37441,!1),(0,y.Z)(T,37443,37444),(0,y.Z)(T,35723,4352),(0,y.Z)(T,36010,null),(0,y.Z)(T,35977,!1),(0,y.Z)(T,3330,0),(0,y.Z)(T,3332,0),(0,y.Z)(T,3331,0),(0,y.Z)(T,3314,0),(0,y.Z)(T,32878,0),(0,y.Z)(T,3316,0),(0,y.Z)(T,3315,0),(0,y.Z)(T,32877,0),T),L=function(t,e,n){return e?t.enable(n):t.disable(n)},O=function(t,e,n){return t.hint(n,e)},F=function(t,e,n){return t.pixelStorei(n,e)};function R(t){return Array.isArray(t)||ArrayBuffer.isView(t)}var z=(M={},(0,y.Z)(M,3042,L),(0,y.Z)(M,32773,(function(t,e){return t.blendColor.apply(t,(0,Z.Z)(e))})),(0,y.Z)(M,32777,"blendEquation"),(0,y.Z)(M,34877,"blendEquation"),(0,y.Z)(M,32969,"blendFunc"),(0,y.Z)(M,32968,"blendFunc"),(0,y.Z)(M,32971,"blendFunc"),(0,y.Z)(M,32970,"blendFunc"),(0,y.Z)(M,3106,(function(t,e){return t.clearColor.apply(t,(0,Z.Z)(e))})),(0,y.Z)(M,3107,(function(t,e){return t.colorMask.apply(t,(0,Z.Z)(e))})),(0,y.Z)(M,2884,L),(0,y.Z)(M,2885,(function(t,e){return t.cullFace(e)})),(0,y.Z)(M,2929,L),(0,y.Z)(M,2931,(function(t,e){return t.clearDepth(e)})),(0,y.Z)(M,2932,(function(t,e){return t.depthFunc(e)})),(0,y.Z)(M,2928,(function(t,e){return t.depthRange.apply(t,(0,Z.Z)(e))})),(0,y.Z)(M,2930,(function(t,e){return t.depthMask(e)})),(0,y.Z)(M,3024,L),(0,y.Z)(M,35723,O),(0,y.Z)(M,36006,(function(t,e){var n=u(t)?36009:36160;return t.bindFramebuffer(n,e)})),(0,y.Z)(M,2886,(function(t,e){return t.frontFace(e)})),(0,y.Z)(M,33170,O),(0,y.Z)(M,2849,(function(t,e){return t.lineWidth(e)})),(0,y.Z)(M,32823,L),(0,y.Z)(M,32824,"polygonOffset"),(0,y.Z)(M,10752,"polygonOffset"),(0,y.Z)(M,35977,L),(0,y.Z)(M,32938,"sampleCoverage"),(0,y.Z)(M,32939,"sampleCoverage"),(0,y.Z)(M,3089,L),(0,y.Z)(M,3088,(function(t,e){return t.scissor.apply(t,(0,Z.Z)(e))})),(0,y.Z)(M,2960,L),(0,y.Z)(M,2961,(function(t,e){return t.clearStencil(e)})),(0,y.Z)(M,2968,(function(t,e){return t.stencilMaskSeparate(1028,e)})),(0,y.Z)(M,36005,(function(t,e){return t.stencilMaskSeparate(1029,e)})),(0,y.Z)(M,2962,"stencilFuncFront"),(0,y.Z)(M,2967,"stencilFuncFront"),(0,y.Z)(M,2963,"stencilFuncFront"),(0,y.Z)(M,34816,"stencilFuncBack"),(0,y.Z)(M,36003,"stencilFuncBack"),(0,y.Z)(M,36004,"stencilFuncBack"),(0,y.Z)(M,2964,"stencilOpFront"),(0,y.Z)(M,2965,"stencilOpFront"),(0,y.Z)(M,2966,"stencilOpFront"),(0,y.Z)(M,34817,"stencilOpBack"),(0,y.Z)(M,34818,"stencilOpBack"),(0,y.Z)(M,34819,"stencilOpBack"),(0,y.Z)(M,2978,(function(t,e){return t.viewport.apply(t,(0,Z.Z)(e))})),(0,y.Z)(M,3333,F),(0,y.Z)(M,3317,F),(0,y.Z)(M,37440,F),(0,y.Z)(M,37441,F),(0,y.Z)(M,37443,F),(0,y.Z)(M,3330,F),(0,y.Z)(M,3332,F),(0,y.Z)(M,3331,F),(0,y.Z)(M,36010,(function(t,e){return t.bindFramebuffer(36008,e)})),(0,y.Z)(M,3314,F),(0,y.Z)(M,32878,F),(0,y.Z)(M,3316,F),(0,y.Z)(M,3315,F),(0,y.Z)(M,32877,F),(0,y.Z)(M,"framebuffer",(function(t,e){var n=e&&"handle"in e?e.handle:e;return t.bindFramebuffer(36160,n)})),(0,y.Z)(M,"blend",(function(t,e){return e?t.enable(3042):t.disable(3042)})),(0,y.Z)(M,"blendColor",(function(t,e){return t.blendColor.apply(t,(0,Z.Z)(e))})),(0,y.Z)(M,"blendEquation",(function(t,e){e=R(e)?e:[e,e],t.blendEquationSeparate.apply(t,(0,Z.Z)(e))})),(0,y.Z)(M,"blendFunc",(function(t,e){e=R(e)&&2===e.length?[].concat((0,Z.Z)(e),(0,Z.Z)(e)):e,t.blendFuncSeparate.apply(t,(0,Z.Z)(e))})),(0,y.Z)(M,"clearColor",(function(t,e){return t.clearColor.apply(t,(0,Z.Z)(e))})),(0,y.Z)(M,"clearDepth",(function(t,e){return t.clearDepth(e)})),(0,y.Z)(M,"clearStencil",(function(t,e){return t.clearStencil(e)})),(0,y.Z)(M,"colorMask",(function(t,e){return t.colorMask.apply(t,(0,Z.Z)(e))})),(0,y.Z)(M,"cull",(function(t,e){return e?t.enable(2884):t.disable(2884)})),(0,y.Z)(M,"cullFace",(function(t,e){return t.cullFace(e)})),(0,y.Z)(M,"depthTest",(function(t,e){return e?t.enable(2929):t.disable(2929)})),(0,y.Z)(M,"depthFunc",(function(t,e){return t.depthFunc(e)})),(0,y.Z)(M,"depthMask",(function(t,e){return t.depthMask(e)})),(0,y.Z)(M,"depthRange",(function(t,e){return t.depthRange.apply(t,(0,Z.Z)(e))})),(0,y.Z)(M,"dither",(function(t,e){return e?t.enable(3024):t.disable(3024)})),(0,y.Z)(M,"derivativeHint",(function(t,e){t.hint(35723,e)})),(0,y.Z)(M,"frontFace",(function(t,e){return t.frontFace(e)})),(0,y.Z)(M,"mipmapHint",(function(t,e){return t.hint(33170,e)})),(0,y.Z)(M,"lineWidth",(function(t,e){return t.lineWidth(e)})),(0,y.Z)(M,"polygonOffsetFill",(function(t,e){return e?t.enable(32823):t.disable(32823)})),(0,y.Z)(M,"polygonOffset",(function(t,e){return t.polygonOffset.apply(t,(0,Z.Z)(e))}
2)),(0,y.Z)(M,"sampleCoverage",(function(t,e){return t.sampleCoverage.apply(t,(0,Z.Z)(e))})),(0,y.Z)(M,"scissorTest",(function(t,e){return e?t.enable(3089):t.disable(3089)})),(0,y.Z)(M,"scissor",(function(t,e){return t.scissor.apply(t,(0,Z.Z)(e))})),(0,y.Z)(M,"stencilTest",(function(t,e){return e?t.enable(2960):t.disable(2960)})),(0,y.Z)(M,"stencilMask",(function(t,e){var n=e=R(e)?e:[e,e],r=(0,P.Z)(n,2),i=r[0],o=r[1];t.stencilMaskSeparate(1028,i),t.stencilMaskSeparate(1029,o)})),(0,y.Z)(M,"stencilFunc",(function(t,e){var n=e=R(e)&&3===e.length?[].concat((0,Z.Z)(e),(0,Z.Z)(e)):e,r=(0,P.Z)(n,6),i=r[0],o=r[1],a=r[2],s=r[3],u=r[4],l=r[5];t.stencilFuncSeparate(1028,i,o,a),t.stencilFuncSeparate(1029,s,u,l)})),(0,y.Z)(M,"stencilOp",(function(t,e){var n=e=R(e)&&3===e.length?[].concat((0,Z.Z)(e),(0,Z.Z)(e)):e,r=(0,P.Z)(n,6),i=r[0],o=r[1],a=r[2],s=r[3],u=r[4],l=r[5];t.stencilOpSeparate(1028,i,o,a),t.stencilOpSeparate(1029,s,u,l)})),(0,y.Z)(M,"viewport",(function(t,e){return t.viewport.apply(t,(0,Z.Z)(e))})),M);function U(t,e,n){return void 0!==e[t]?e[t]:n[t]}var N={blendEquation:function(t,e,n){return t.blendEquationSeparate(U(32777,e,n),U(34877,e,n))},blendFunc:function(t,e,n){return t.blendFuncSeparate(U(32969,e,n),U(32968,e,n),U(32971,e,n),U(32970,e,n))},polygonOffset:function(t,e,n){return t.polygonOffset(U(32824,e,n),U(10752,e,n))},sampleCoverage:function(t,e,n){return t.sampleCoverage(U(32938,e,n),U(32939,e,n))},stencilFuncFront:function(t,e,n){return t.stencilFuncSeparate(1028,U(2962,e,n),U(2967,e,n),U(2963,e,n))},stencilFuncBack:function(t,e,n){return t.stencilFuncSeparate(1029,U(34816,e,n),U(36003,e,n),U(36004,e,n))},stencilOpFront:function(t,e,n){return t.stencilOpSeparate(1028,U(2964,e,n),U(2965,e,n),U(2966,e,n))},stencilOpBack:function(t,e,n){return t.stencilOpSeparate(1029,U(34817,e,n),U(34818,e,n),U(34819,e,n))}},G={enable:function(t,e){return t((0,y.Z)({},e,!0))},disable:function(t,e){return t((0,y.Z)({},e,!1))},pixelStorei:function(t,e,n){return t((0,y.Z)({},e,n))},hint:function(t,e,n){return t((0,y.Z)({},e,n))},bindFramebuffer:function(t,e,n){var r;switch(e){case 36160:return t((r={},(0,y.Z)(r,36006,n),(0,y.Z)(r,36010,n),r));case 36009:return t((0,y.Z)({},36006,n));case 36008:return t((0,y.Z)({},36010,n));default:return null}},blendColor:function(t,e,n,r,i){return t((0,y.Z)({},32773,new Float32Array([e,n,r,i])))},blendEquation:function(t,e){var n;return t((n={},(0,y.Z)(n,32777,e),(0,y.Z)(n,34877,e),n))},blendEquationSeparate:function(t,e,n){var r;return t((r={},(0,y.Z)(r,32777,e),(0,y.Z)(r,34877,n),r))},blendFunc:function(t,e,n){var r;return t((r={},(0,y.Z)(r,32969,e),(0,y.Z)(r,32968,n),(0,y.Z)(r,32971,e),(0,y.Z)(r,32970,n),r))},blendFuncSeparate:function(t,e,n,r,i){var o;return t((o={},(0,y.Z)(o,32969,e),(0,y.Z)(o,32968,n),(0,y.Z)(o,32971,r),(0,y.Z)(o,32970,i),o))},clearColor:function(t,e,n,r,i){return t((0,y.Z)({},3106,new Float32Array([e,n,r,i])))},clearDepth:function(t,e){return t((0,y.Z)({},2931,e))},clearStencil:function(t,e){return t((0,y.Z)({},2961,e))},colorMask:function(t,e,n,r,i){return t((0,y.Z)({},3107,[e,n,r,i]))},cullFace:function(t,e){return t((0,y.Z)({},2885,e))},depthFunc:function(t,e){return t((0,y.Z)({},2932,e))},depthRange:function(t,e,n){return t((0,y.Z)({},2928,new Float32Array([e,n])))},depthMask:function(t,e){return t((0,y.Z)({},2930,e))},frontFace:function(t,e){return t((0,y.Z)({},2886,e))},lineWidth:function(t,e){return t((0,y.Z)({},2849,e))},polygonOffset:function(t,e,n){var r;return t((r={},(0,y.Z)(r,32824,e),(0,y.Z)(r,10752,n),r))},sampleCoverage:function(t,e,n){var r;return t((r={},(0,y.Z)(r,32938,e),(0,y.Z)(r,32939,n),r))},scissor:function(t,e,n,r,i){return t((0,y.Z)({},3088,new Int32Array([e,n,r,i])))},stencilMask:function(t,e){var n;return t((n={},(0,y.Z)(n,2968,e),(0,y.Z)(n,36005,e),n))},stencilMaskSeparate:function(t,e,n){return t((0,y.Z)({},1028===e?2968:36005,n))},stencilFunc:function(t,e,n,r){var i;return t((i={},(0,y.Z)(i,2962,e),(0,y.Z)(i,2967,n),(0,y.Z)(i,2963,r),(0,y.Z)(i,34816,e),(0,y.Z)(i,36003,n),(0,y.Z)(i,36004,r),i))},stencilFuncSeparate:function(t,e,n,r,i){var o;return t((o={},(0,y.Z)(o,1028===e?2962:34816,n),(0,y.Z)(o,1028===e?2967:36003,r),(0,y.Z)(o,1028===e?2963:36004,i),o))},stencilOp:function(t,e,n,r){var i;return t((i={},(0,y.Z)(i,2964,e),(0,y.Z)(i,2965,n),(0,y.Z)(i,2966,r),(0,y.Z)(i,34817,e),(0,y.Z)(i,34818,n),(0,y.Z)(i,34819,r),i))},stencilOpSeparate:function(t,e,n,r,i){var o;return t((o={},(0,y.Z)(o,1028===e?2964:34817,n),(0,y.Z)(o,1028===e?2965:34818,r),(0,y.Z)(o,1028===e?2966:34819,i),o))},viewport:function(t,e,n,r,i){return t((0,y.Z)({},2978,[e,n,r,i]))}},j=function(t,e){return t.isEnabled(e)},V=(I={},(0,y.Z)(I,3042,j),(0,y.Z)(I,2884,j),(0,y.Z)(I,2929,j),(0,y.Z)(I,3024,j),(0,y.Z)(I,32823,j),(0,y.Z)(I,32926,j),(0,y.Z)(I,32928,j),(0,y.Z)(I,3089,j),(0,y.Z)(I,2960,j),(0,y.Z)(I,35977,j),I),H=n(22951),J=n(91976);function W(t){for(var e in t)return!1;return!0}function Q(t,e){if(t===e)return!0;var n=Array.isArray(t)||ArrayBuffer.isView(t),r=Array.isArray(e)||ArrayBuffer.isView(e);if(n&&r&&t.length===e.length){for(var i=0;i<t.length;++i)if(t[i]!==e[i])return!1;return!0}return!1}function q(t,e){var n=t[e].bind(t);t[e]=function(){var e=arguments.length<=0?void 0:arguments[0];return e in t.state.cache&&t.state.enable?t.state.cache[e]:n.apply(void 0,arguments)}
2,Object.defineProperty(t[e],"name",{value:"".concat(e,"-from-cache"),configurable:!1})}function K(t,e,n){var r=t[e].bind(t);t[e]=function(){for(var e=arguments.length,i=new Array(e),o=0;o<e;o++)i[o]=arguments[o];var a=n.apply(void 0,[t.state._updateCache].concat(i)),s=a.valueChanged,u=a.oldValue;return s&&r.apply(void 0,i),u},Object.defineProperty(t[e],"name",{value:"".concat(e,"-to-cache"),configurable:!1})}var X=function(){function t(e){(0,H.Z)(this,t);var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.copyState,i=void 0!==r&&r,o=n.log,a=void 0===o?function(){}:o;this.gl=e,this.program=null,this.stateStack=[],this.enable=!0,this.cache=i?et(e):Object.assign({},D),this.log=a,this._updateCache=this._updateCache.bind(this),Object.seal(this)}return(0,J.Z)(t,[{key:"push",value:function(){this.stateStack.push({})}},{key:"pop",value:function(){i(this.stateStack.length>0);var t=this.stateStack[this.stateStack.length-1];tt(this.gl,t),this.stateStack.pop()}},{key:"_updateCache",value:function(t){var e,n=!1,r=this.stateStack.length>0&&this.stateStack[this.stateStack.length-1];for(var o in t){i(void 0!==o);var a=t[o],s=this.cache[o];Q(a,s)||(n=!0,e=s,r&&!(o in r)&&(r[o]=s),this.cache[o]=a)}return{valueChanged:n,oldValue:e}}}]),t}();function Y(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.enable,r=void 0===n||n,o=e.copyState;if(i(void 0!==o),!t.state){var a=globalThis.polyfillContext;for(var s in a&&a(t),t.state=new X(t,{copyState:o}),function(t){var e=t.useProgram.bind(t);t.useProgram=function(n){t.state.program!==n&&(e(n),t.state.program=n)}}(t),G){K(t,s,G[s])}q(t,"getParameter"),q(t,"isEnabled")}return t.state.enable=r,t}function $(t){i(t.state),t.state.pop()}function tt(t,e){if(i(s(t),"setParameters requires a WebGL context"),!W(e)){var n={};for(var r in e){var o=Number(r),a=z[r];a&&("string"===typeof a?n[a]=!0:a(t,e[r],o))}var u=t.state&&t.state.cache;if(u)for(var l in n){(0,N[l])(t,e,u)}}}function et(t,e){if("number"===typeof(e=e||D)){var n=e,r=V[n];return r?r(t,n):t.getParameter(n)}var i,o=Array.isArray(e)?e:Object.keys(e),a={},s=(0,f.Z)(o);try{for(s.s();!(i=s.n()).done;){var u=i.value,l=V[u];a[u]=l?l(t,Number(u)):t.getParameter(Number(u))}}catch(c){s.e(c)}finally{s.f()}return a}function nt(t){tt(t,D)}function rt(t,e,n){if(W(e))return n(t);var r,i=e.nocatch,o=void 0===i||i;if(function(t){t.state||Y(t,{copyState:!1}),t.state.push()}(t),tt(t,e),o)r=n(t),$(t);else try{r=n(t)}finally{$(t)}return r}function it(t){var e=t.luma;if(t.canvas&&e){var n=e.canvasSizeInfo.clientWidth;return n?t.drawingBufferWidth/n:1}return 1}function ot(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return function(t,e,n,r,i){var o,a=at(t[0],e,n),s=st(t[1],e,r,i),u=at(t[0]+1,e,n),l=u===n-1?u:u-1;u=st(t[1]+1,e,r,i),i?(o=s,s=u=0===u?u:u+1):o=u===r-1?u:u-1;return{x:a,y:s,width:Math.max(l-a+1,1),height:Math.max(o-s+1,1)}}(e,it(t),t.drawingBufferWidth,t.drawingBufferHeight,n)}function at(t,e,n){return Math.min(Math.round(t*e),n-1)}function st(t,e,n,r){return r?Math.max(0,n-1-Math.round(t*e)):Math.min(Math.round(t*e),n-1)}var ut=(0,n(11515).Z)(),lt=ut&&"undefined"!==typeof document,ct={webgl2:!0,webgl1:!0,throwOnError:!0,manageState:!0,canvas:null,debug:!1,width:800,height:600};function ht(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(ut,"createGLContext only available in the browser.\nCreate your own headless context or use 'createHeadlessContext' from @luma.gl/test-utils");var e,n=t=Object.assign({},ct,t),o=n.width,a=n.height;function s(e){if(t.throwOnError)throw new Error(e);return console.error(e),null}t.onError=s;var l=function(t){var e,n=t.canvas,r=t.width,i=void 0===r?800:r,o=t.height,a=void 0===o?600:o,s=t.onError;if("string"===typeof n){lt&&"complete"===document.readyState||s("createGLContext called on canvas '".concat(n,"' before page was loaded")),e=document.getElementById(n)}else n?e=n:((e=document.createElement("canvas")).id="lumagl-canvas",e.style.width=Number.isFinite(i)?"".concat(i,"px"):"100%",e.style.height=Number.isFinite(a)?"".concat(a,"px"):"100%",document.body.insertBefore(e,document.body.firstChild));return e}({canvas:t.canvas,width:o,height:a,onError:s});return e=function(t,e){var n=e.onError,r=null,i=function(t){return r=t.statusMessage||r};t.addEventListener("webglcontextcreationerror",i,!1);var o=e.webgl1,a=void 0===o||o,s=e.webgl2,u=void 0===s||s,l=null;u&&(l=(l=l||t.getContext("webgl2",e))||t.getContext("experimental-webgl2",e));a&&(l=(l=l||t.getContext("webgl",e))||t.getContext("experimental-webgl",e));if(t.removeEventListener("webglcontextcreationerror",i,!1),!l)return n("Failed to create ".concat(u&&!a?"WebGL2":"WebGL"," context: ").concat(r||"Unknown error"));e.onContextLost&&t.addEventListener("webglcontextlost",e.onContextLost,!1);e.onContextRestored&&t.addEventListener("webglcontextrestored",e.onContextRestored,!1);return l}(l,t),e?(function(t){var e=u(t)?"WebGL2":"WebGL1",n=function(t){var e=t.getParameter(7936),n=t.getParameter(7937),r=t.getExtension("WEBGL_debug_renderer_info"),i=r&&t.getParameter(r.UNMASKED_VENDOR_WEBGL||7936),o=r&&t.getParameter(r.UNMASKED_RENDERER_WEBGL||7937);return{vendor:i||e,renderer:o||n,vendorMasked:e,rendererMasked:n,version:t.getParameter(7938),shadingLanguageVersion:t.getParameter(35724)}}(t),i=n?"(".concat(n.vendor,",").concat(n.renderer,")"):"",o=t.debug?" debug":"";r.info(1,"".concat(e).concat(o," context ").concat(i))()}(e=ft(e,t)),e):null}function ft(t){var 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||{};var n=e=Object.assign({},ct,e),i=n.manageState,o=n.debug;return i&&Y(t,{copyState:!1,log:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return r.log.apply(r,[1].concat(e))()}}),ut&&o&&(globalThis.makeDebugContext?(t=globalThis.makeDebugContext(t,e),r.level=Math.max(r.level,1)):r.warn('WebGL debug mode not activated. import "@luma.gl/debug" to enable.')()),t._instrumented=!0,t}function pt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t.canvas){!function(t,e,n){var i="width"in n?n.width:t.canvas.clientWidth,o="height"in n?n.height:t.canvas.clientHeight;i&&o||(r.log(1,"Canvas clientWidth/clientHeight is 0")(),e=1,i=t.canvas.width||1,o=t.canvas.height||1);t.luma=t.luma||{},t.luma.canvasSizeInfo=t.luma.canvasSizeInfo||{};var a=t.luma.canvasSizeInfo;if(a.clientWidth!==i||a.clientHeight!==o||a.devicePixelRatio!==e){var s=e,u=Math.floor(i*s),l=Math.floor(o*s);t.canvas.width=u,t.canvas.height=l,t.drawingBufferWidth===u&&t.drawingBufferHeight===l||(r.warn("Device pixel ratio clamped")(),s=Math.min(t.drawingBufferWidth/i,t.drawingBufferHeight/o),t.canvas.width=Math.floor(i*s),t.canvas.height=Math.floor(o*s)),Object.assign(t.luma.canvasSizeInfo,{clientWidth:i,clientHeight:o,devicePixelRatio:e})}}(t,function(t){var e="undefined"===typeof window?1:window.devicePixelRatio||1;return Number.isFinite(t)?t<=0?1:t:t?e:1}(e.useDevicePixels),e)}else{var n=t.getExtension("STACKGL_resize_drawingbuffer");n&&"width"in e&&"height"in e&&n.resize(e.width,e.height)}}},5740:function(t,e,n){"use strict";n.d(e,{H:function(){return r},Y:function(){return i}});var r="vs",i="fs"},62574:function(t,e,n){"use strict";n.d(e,{O_:function(){return u},Lm:function(){return p},ZP:function(){return f}});var r,i=n(64649),o=n(5740),a=n(17865),s=(r={},(0,i.Z)(r,o.H,"#ifdef MODULE_LOGDEPTH\n  logdepth_adjustPosition(gl_Position);\n#endif\n"),(0,i.Z)(r,o.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"),r),u="__LUMA_INJECT_DECLARATIONS__",l=/void\s+main\s*\([^)]*\)\s*\{\n?/,c=/}\n?[^{}]*$/,h=[];function f(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=e===o.H,a=function(){var e=n[f];e.sort((function(t,e){return t.order-e.order})),h.length=e.length;for(var r=0,o=e.length;r<o;++r)h[r]=e[r].injection;var a="".concat(h.join("\n"),"\n");switch(f){case"vs:#decl":i&&(t=t.replace(u,a));break;case"vs:#main-start":i&&(t=t.replace(l,(function(t){return t+a})));break;case"vs:#main-end":i&&(t=t.replace(c,(function(t){return a+t})));break;case"fs:#decl":i||(t=t.replace(u,a));break;case"fs:#main-start":i||(t=t.replace(l,(function(t){return t+a})));break;case"fs:#main-end":i||(t=t.replace(c,(function(t){return a+t})));break;default:t=t.replace(f,(function(t){return t+a}))}};for(var f in n)a();return t=t.replace(u,""),r&&(t=t.replace(/\}\s*$/,(function(t){return t+s[e]}))),t}function p(t){var e={};return(0,a.Z)(Array.isArray(t)&&t.length>1),t.forEach((function(t){for(var n in t)e[n]=e[n]?"".concat(e[n],"\n").concat(t[n]):t[n]})),e}},45986:function(t,e,n){"use strict";n.d(e,{H:function(){return s}});var r=n(60726),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",o={lightSources:{}};function a(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.color,n=void 0===e?[0,0,0]:e,r=t.intensity,i=void 0===r?1:r;return n.map((function(t){return t*i/255}))}var s={name:"lights",vs:i,fs:i,getUniforms:function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o;if("lightSources"in e){var n=e.lightSources||{},i=n.ambientLight,s=n.pointLights,u=n.directionalLights;return i||s&&s.length>0||u&&u.length>0?Object.assign({},function(t){var e=t.ambientLight,n=t.pointLights,r=void 0===n?[]:n,i=t.directionalLights,o=void 0===i?[]:i,s={};return s["lighting_uAmbientLight.color"]=e?a(e):[0,0,0],r.forEach((function(t,e){s["lighting_uPointLight[".concat(e,"].color")
2]=a(t),s["lighting_uPointLight[".concat(e,"].position")]=t.position,s["lighting_uPointLight[".concat(e,"].attenuation")]=t.attenuation||[1,0,0]})),s.lighting_uPointLightCount=r.length,o.forEach((function(t,e){s["lighting_uDirectionalLight[".concat(e,"].color")]=a(t),s["lighting_uDirectionalLight[".concat(e,"].direction")]=t.direction})),s.lighting_uDirectionalLightCount=o.length,s}({ambientLight:i,pointLights:s,directionalLights:u}),{lighting_uEnabled:!0}):{lighting_uEnabled:!1}}if("lights"in e){var l,c={pointLights:[],directionalLights:[]},h=(0,r.Z)(e.lights||[]);try{for(h.s();!(l=h.n()).done;){var f=l.value;switch(f.type){case"ambient":c.ambientLight=f;break;case"directional":c.directionalLights.push(f);break;case"point":c.pointLights.push(f)}}}catch(p){h.e(p)}finally{h.f()}return t({lightSources:c})}return{}},defines:{MAX_LIGHTS:3}}},78032:function(t,e,n){"use strict";n.d(e,{b:function(){return r}});var r={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);
2\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
2);\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:function(t,e,n){"use strict";n.d(e,{N:function(){return s},s:function(){return u}});var r=n(45986),i="\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;
2 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 a(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o;if(!("material"in t))return{};var e=t.material;return e?function(t){var e=t.ambient,n=void 0===e?.35:e,r=t.diffuse,i=void 0===r?.6:r,o=t.shininess,a=void 0===o?32:o,s=t.specularColor;return{lighting_uAmbient:n,lighting_uDiffuse:i,lighting_uShininess:a,lighting_uSpecularColor:(void 0===s?[30,30,30]:s).map((function(t){return t/255}))}}(e):{lighting_uEnabled:!1}}var s={name:"gouraud-lighting",dependencies:[r.H],vs:i,defines:{LIGHTING_VERTEX:1},getUniforms:a},u={name:"phong-lighting",dependencies:[r.H],fs:i,defines:{LIGHTING_FRAGMENT:1},getUniforms:a}},17865:function(t,e,n){"use strict";function r(t,e){if(!t)throw new Error(e||"shadertools: assertion failed.")}n.d(e,{Z:function(){return r}})},77462:function(t,e,n){"use strict";n.d(e,{Z:function(){return h}});var r=n(19113),i=n(22951),o=n(91976),a=n(75946),s=n(81301),u=n(80182),l={offset:0,stride:0,type:5126,size:1,divisor:0,normalized:!1,integer:!1},c={deprecatedProps:{instanced:"divisor",isInstanced:"divisor"}},h=function(){function t(){var e=this;(0,i.Z)(this,t);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];r.forEach((function(t){return e._assign(t)})),Object.freeze(this)}return(0,o.Z)(t,[{key:"toString",value:function(){return JSON.stringify(this)}},{key:"BYTES_PER_ELEMENT",get:function(){return t.getBytesPerElement(this)}},{key:"BYTES_PER_VERTEX",get:function(){return t.getBytesPerVertex(this)}},{key:"_assign",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return void 0!==(t=(0,u.k)("Accessor",t,c)).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}}],[{key:"getBytesPerElement",value:function(t){return(0,a.vN)(t.type||5126).BYTES_PER_ELEMENT}},{key:"getBytesPerVertex",value:function(t){return(0,s.h)(t.size),(0,a.vN)(t.type||5126).BYTES_PER_ELEMENT*t.size}},{key:"resolve",value:function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return(0,r.Z)(t,[l].concat(n))}}]),t}()},33839:function(t,e,n){"use strict";n.d(e,{Z:function(){return g}});var r=n(22951),i=n(91976),o=n(47169),a=n(67591),s=n(94337),u=n(35572),l=n(77462),c=n(75946),h=n(28007),f=n(81301),p=n(80182),d={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"},A={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:d},v={removedProps:d},g=function(t,e){(0,a.Z)(u,t);var n=(0,s.Z)(u);function u(t){var e;(0,r.Z)(this,u);var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(e=n.call(this,t,i)).stubRemovedMethods("Buffer","v6.0",["layout","setLayout","getIndexedParameter"]),e.target=i.target||(e.gl.webgl2?36662:34962),e.initialize(i),Object.seal((0,o.Z)(e)),e}return(0,i.Z)(u,[{key:e,get:function(){return"Buffer"}},{key:"getElementCount",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/l.Z.getBytesPerElement(t))}},{key:"getVertexCount",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/l.Z.getBytesPerVertex(t))}},{key:"initialize",value:function(){var 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,p.k)("Buffer",t,A),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}},{key:"setProps",value:function(t){return"accessor"in(t=(0,p.k)("Buffer",t,v))&&this.setAccessor(t.accessor),this}},{key:"setAccessor",value:function(t){return delete(t=Object.assign({},t)).buffer,this.accessor=new l.Z(t),this}},{key:"reallocate",value:function(t){return t>this.byteLength?(this._setByteLength(t),!0):(this.bytesUsed=t,!1)}},{key:"setData",value:function(t){return this.initialize(t)}},{key:"subData",value:function(t){ArrayBuffer.isView(t)&&(t={data:t});var e=t,n=e.data,r=e.offset,i=void 0===r?0:r,o=e.srcOffset,a=void 0===o?0:o,s=t.byteLength||t.length;(0,f.h)(n);var u=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(u,this.handle),0!==a||void 0!==s?((0,h.KQ)(this.gl),this.gl.bufferSubData(this.target,i,n,a,s)):this.gl.bufferSubData(u,i,n),this.gl.bindBuffer(u,null),this.debugData=null,this._inferType(n),this}},{key:"copyData",value:function(t){var e=t.sourceBuffer,n=t.readOffset,r=void 0===n?0:n,i=t.writeOffset,o=void 0===i?0:i,a=t.size,s=this.gl;return(0,h.KQ)(s),s.bindBuffer(36662,e.handle),s.bindBuffer(36663,this.handle),s.copyBufferSubData(36662,36663,r,o,a),s.bindBuffer(36662,null),s.bindBuffer(36663,null),this.debugData=null,this}},{key:"getData",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.dstData,n=void 0===e?null:e,r=t.srcByteOffset,i=void 0===r?0:r,o=t.dstOffset,a=void 0===o?0:o,s=t.length,u=void 0===s?0:s;(0,h.KQ)(this.gl);var l,p,d=(0,c.vN)(this.accessor.type||5126,{clamped:!1}),A=this._getAvailableElementCount(i),v=a;n?l=(p=n.length)-v:p=v+(l=Math.min(A,u||A));var g=Math.min(A,l);return u=u||g,(0,f.h)(u<=g),n=n||new d(p),this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,i,n,a,u),this.gl.bindBuffer(36662,null),n}},{key:"bind",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.target,n=void 0===e?this.target:e,r=t.index,i=void 0===r?this.accessor&&this.accessor.index:r,o=t.offset,a=void 0===o?0:o,s=t.size;return 35345===n||35982===n?void 0!==s?this.gl.bindBufferRange(n,i,this.handle,a,s):((0,f.h)(0===a),this.gl.bindBufferBase(n,i,this.handle)):this.gl.bindBuffer(n,this.handle),this}},{key:"unbind",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.target,n=void 0===e?this.target:e,r=t.index,i=void 0===r?this.accessor&&this.accessor.index:r;return 35345===n||35982===n?this.gl.bindBufferBase(n,i,null):this.gl.bindBuffer(n,null),this}},{key:"getDebugData",value:function(){return this.debugData?{data:this.debugData,changed:!1}:(this.debugData=this.getData({length:Math.min(10,this.byteLength)}),{data:this.debugData,changed:!0})}},{key:"invalidateDebugData",value:function(){this.debugData=null}},{key:"_setData",value:function(t){var 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,f.h)(ArrayBuffer.isView(t)),this._trackDeallocatedMemory();var r=this._getTarget();this.gl.bindBuffer(r,this.handle),this.gl.bufferData(r,n,this.usage),this.gl.bufferSubData(r,e,t),this.gl.bindBuffer(r,null),this.debugData=t.slice(0,10),this.bytesUsed=n,this._trackAllocatedMemory(n);var i=(0,c.O)(t);return(0,f.h)(i),this.setAccessor(new l.Z(this.accessor,{type:i})),this}},{key:"_setByteLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.usage;(0,f.h)(t>=0),this._trackDeallocatedMemory();var n=t;0===t&&(n=new Float32Array(0));var r=this._getTarget();return this.gl.bindBuffer(r,this.handle),this.gl.bufferData(r,n,e),this.gl.bindBuffer(r,null),this.usage=e,this.debugData=null,this.bytesUsed=t,this._trackAllocatedMemory(t),this}},{key:"_getTarget",value:function(){return this.gl.webgl2?36663:this.target}},{key:"_getAvailableElementCount",value:function(t){var e=t/(0,c.vN)(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-e}},{key:"_inferType",value:function(t){this.accessor.type||this.setAccessor(new l.Z(this.accessor,{type:(0,c.O)(t)}))}},{key:"_createHandle",value:function(){return this.gl.createBuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteBuffer(this.handle),this._trackDeallocatedMemory()}},{key:"_getParameter",value:function(t){this.gl.bindBuffer(this.target,this.handle);var e=this.gl.getBufferParameter(this.target,t);return this.gl.bindBuffer(this.target,null),e}},{key:"type",get:function(){return h.cM.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}},{key:"bytes",get:function(){return h.cM.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}},{key:"setByteLength",value:function(t){return h.cM.deprecated("setByteLength","reallocate")(),this.reallocate(t)}},{key:"updateAccessor",value:function(t){return h.cM.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new l.Z(this.accessor,t),this}}]),u}(u.Z,Symbol.toStringTag)},97756:function(t,e,n){"use strict";n.d(e,{$:function(){return A},Z:function(){return d}});var r=n(11026),i=n(28007),o=n(81301),a=256,s=1024,u=16384,l=6144,c=6145,h=6146,f=34041,p="clear: bad arguments";function d(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.framebuffer,r=void 0===n?null:n,l=e.color,c=void 0===l?null:l,h=e.depth,f=void 0===h?null:h,d=e.stencil,A=void 0===d?null:d,v={};r&&(v.framebuffer=r);var g=0;c&&(g|=u,!0!==c&&(v.clearColor=c)),f&&(g|=a,!0!==f&&(v.clearDepth=f)),A&&(g|=s,!0!==f&&(v.clearStencil=f)),(0,o.h)(0!==g,p),(0,i.s8)(t,v,(function(){t.clear(g)}))}function A(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.framebuffer,a=void 0===n?null:n,s=e.buffer,u=void 0===s?l:s,d=e.drawBuffer,A=void 0===d?0:d,v=e.value,g=void 0===v?[0,0,0,0]:v;(0,i.KQ)(t),(0,i.s8)(t,{framebuffer:a},(function(){switch(u){case l:switch(g.constructor){case Int32Array:t.clearBufferiv(u,A,g);break;case Uint32Array:t.clearBufferuiv(u,A,g);break;
2case Float32Array:default:t.clearBufferfv(u,A,g)}break;case c:t.clearBufferfv(c,0,[g]);break;case h:t.clearBufferiv(h,0,[g]);break;case f:var e=(0,r.Z)(g,2),n=e[0],i=e[1];t.clearBufferfi(f,0,n,i);break;default:(0,o.h)(!1,p)}}))}},56474:function(t,e,n){"use strict";n.d(e,{Km:function(){return p},Lv:function(){return d},z6:function(){return h},Jb:function(){return f}});var r=n(33839),i=n(79078),o=n(51055),a=n(28007),s=n(75946),u=n(81301);function l(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,u.h)(!1),0}}var c=n(17507);function h(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.sourceX,r=void 0===n?0:n,i=e.sourceY,o=void 0===i?0:i,a=e.sourceFormat,c=void 0===a?6408:a,h=e.sourceAttachment,f=void 0===h?36064:h,p=e.target,d=void 0===p?null:p,v=e.sourceWidth,g=e.sourceHeight,m=e.sourceType,y=A(t),_=y.framebuffer,b=y.deleteFramebuffer;(0,u.h)(_);var x=_.gl,w=_.handle,C=_.attachments;v=v||_.width,g=g||_.height,36064===f&&null===w&&(f=1028),(0,u.h)(C[f]),d=function(t,e,n,r,i){if(t)return t;e=e||5121;var o=(0,s.vN)(e,{clamped:!1}),a=l(n);return new o(r*i*a)}(d,m=m||C[f].type,c,v,g),m=m||(0,s.O)(d);var B=x.bindFramebuffer(36160,w);return x.readPixels(r,o,v,g,c,m,d),x.bindFramebuffer(36160,B||null),b&&_.delete(),d}function f(t,e){var n=e.sourceX,i=void 0===n?0:n,o=e.sourceY,s=void 0===o?0:o,c=e.sourceFormat,h=void 0===c?6408:c,f=e.target,p=void 0===f?null:f,d=e.targetByteOffset,v=void 0===d?0:d,g=e.sourceWidth,m=e.sourceHeight,y=e.sourceType,_=A(t),b=_.framebuffer,x=_.deleteFramebuffer;(0,u.h)(b),g=g||b.width,m=m||b.height;var w=(0,a.KQ)(b.gl);if(y=y||(p?p.type:5121),!p){var C=l(h),B=function(t){switch(t){case 5121:return 1;case 33635:case 32819:case 32820:return 2;case 5126:return 4;default:return(0,u.h)(!1),0}}(y),k=v+g*m*C*B;p=new r.Z(w,{byteLength:k,accessor:{type:y,size:C}})}return p.bind({target:35051}),(0,a.s8)(w,{framebuffer:b},(function(){w.readPixels(i,s,g,m,h,y,v)})),p.unbind({target:35051}),x&&b.delete(),p}function p(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.sourceAttachment,r=void 0===n?36064:n,i=e.targetMaxHeight,o=void 0===i?Number.MAX_SAFE_INTEGER:i,a=h(t,{sourceAttachment:r}),u=t.width,l=t.height;l>o;){var c=(0,s.KS)({data:a,width:u,height:l});a=c.data,u=c.width,l=c.height}(0,s.c$)({data:a,width:u,height:l});var f=document.createElement("canvas");f.width=u,f.height=l;var p=f.getContext("2d"),d=p.createImageData(u,l);return d.data.set(a),p.putImageData(d,0,0),f.toDataURL()}function d(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.sourceX,i=void 0===r?0:r,s=n.sourceY,l=void 0===s?0:s,c=n.targetMipmaplevel,h=void 0===c?0:c,f=n.targetInternalFormat,p=void 0===f?6408:f,d=n.targetX,v=n.targetY,g=n.targetZ,m=n.width,y=n.height,_=A(t),b=_.framebuffer,x=_.deleteFramebuffer;(0,u.h)(b);var w=b.gl,C=b.handle,B="undefined"!==typeof d||"undefined"!==typeof v||"undefined"!==typeof g;d=d||0,v=v||0,g=g||0;var k=w.bindFramebuffer(36160,C);(0,u.h)(e);var E=null;if(e instanceof o.Z&&(E=e,m=Number.isFinite(m)?m:E.width,y=Number.isFinite(y)?y:E.height,E.bind(0),e=E.target),B)switch(e){case 3553:case 34067:w.copyTexSubImage2D(e,h,d,v,i,l,m,y);break;case 35866:case 32879:(0,a.KQ)(w).copyTexSubImage3D(e,h,d,v,g,i,l,m,y)}else w.copyTexImage2D(e,h,p,i,l,m,y,0);return E&&E.unbind(),w.bindFramebuffer(36160,k||null),x&&b.delete(),E}function A(t){return t instanceof i.Z?{framebuffer:t,deleteFramebuffer:!1}:{framebuffer:(0,c.Y)(t),deleteFramebuffer:!0}}},79078:function(t,e,n){"use strict";n.d(e,{Z:function(){return w}});var r=n(64649),i=n(11026),o=n(60726),a=n(22951),s=n(91976),u=n(47169),l=n(83138),c=n(27597),h=n(67591),f=n(94337),p=n(28007),d=n(35572),A=n(58300),v=n(38332),g=n(97756),m=n(56474),y=n(12308),_=n(55888),b=n(81301),x="Multiple render targets not supported",w=function(t,e){(0,h.Z)(d,t);var n=(0,f.Z)(d);function d(t){var e;(0,a.Z)(this,d);var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(e=n.call(this,t,r)).width=null,e.height=null,e.attachments={},e.readBuffer=36064,e.drawBuffers=[36064],e.ownResources=[],e.initialize(r),Object.seal((0,u.Z)(e)),e}return(0,s.Z)(d,[{key:e,get:function(){return"Framebuffer"}},{key:"MAX_COLOR_ATTACHMENTS",get:function(){var t=(0,p.KQ)(this.gl);return t.getParameter(t.MAX_COLOR_ATTACHMENTS)}},{key:"MAX_DRAW_BUFFERS",get:function(){var t=(0,p.KQ)(this.gl);return t.getParameter(t.MAX_DRAW_BUFFERS)}},{key:"color",get:function(){return this.attachments[36064]||null}},{key:"texture",get:function(){return this.attachments[36064]||null}},{key:"depth",get:function(){return this.attachments[36096]||this.attachments[33306]||null}},{key:"stencil",get:function(){return this.attachments[36128]||this.attachments[33306]||null}},{key:"initialize",value:function(t){var e=t.width,n=void 0===e?1:e,r=t.height,i=void 0===r?1:r,o=t.attachments,a=void 0===o?null:o,s=t.color,u=void 0===s||s,l=t.depth,c=void 0===l||l,h=t.stencil,f=void 0!==h&&h,p=t.check,d=void 0===p||p,A=t.readBuffer,v=void 0===A?void 0:A,g=t.drawBuffers,m=void 0===g?void 0:g;if((0,b.h)(n>=0&&i>=0,"Width and height need to be integers"),this.width=n,this.height=i,a)for(var y in a){var _=a[y];(Array.isArray(_)?_[0]:_).resize({width:n,height:i})}else a=this._createDefaultAttachments(u,c,f,n,i);this.update({clearAttachments:!0,attachments:a,readBuffer:v,drawBuffers:m}),a&&d&&this.checkStatus()}},{key:"delete",value:function(){var t,e=(0,o.Z)(this.ownResources);try{for(e.s();!(t=e.n()).done;){t.value.delete()}}catch(n){e.e(n)}finally{e.f()}return(0,l.Z)((0,c.Z)(d.prototype),"delete",this).call(this),this}},{key:"update",value:function(t){var e=t.attachments,n=void 0===e?{}:e,r=t.readBuffer,i=t.drawBuffers,o=t.clearAttachments,a=void 0!==o&&o,s=t.resizeAttachments,u=void 0===s||s;this.attach(n,{clearAttachments:a,resizeAttachments:u});
2var l=this.gl,c=l.bindFramebuffer(36160,this.handle);return r&&this._setReadBuffer(r),i&&this._setDrawBuffers(i),l.bindFramebuffer(36160,c||null),this}},{key:"resize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.width,n=t.height;if(null===this.handle)return(0,b.h)(void 0===e&&void 0===n),this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;for(var r in void 0===e&&(e=this.gl.drawingBufferWidth),void 0===n&&(n=this.gl.drawingBufferHeight),e!==this.width&&n!==this.height&&p.cM.log(2,"Resizing framebuffer ".concat(this.id," to ").concat(e,"x").concat(n))(),this.attachments)this.attachments[r].resize({width:e,height:n});return this.width=e,this.height=n,this}},{key:"attach",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.clearAttachments,o=void 0!==r&&r,a=n.resizeAttachments,s=void 0===a||a,u={};o&&Object.keys(this.attachments).forEach((function(t){u[t]=null})),Object.assign(u,t);var l=this.gl.bindFramebuffer(36160,this.handle);for(var c in u){(0,b.h)(void 0!==c,"Misspelled framebuffer binding point?");var h=Number(c),f=u[h],p=f;if(p)if(p instanceof v.Z)this._attachRenderbuffer({attachment:h,renderbuffer:p});else if(Array.isArray(f)){var d=(0,i.Z)(f,3),A=d[0],g=d[1],m=void 0===g?0:g,y=d[2],_=void 0===y?0:y;p=A,this._attachTexture({attachment:h,texture:A,layer:m,level:_})}else this._attachTexture({attachment:h,texture:p,layer:0,level:0});else this._unattach(h);s&&p&&p.resize({width:this.width,height:this.height})}this.gl.bindFramebuffer(36160,l||null),Object.assign(this.attachments,t),Object.keys(this.attachments).filter((function(t){return!e.attachments[t]})).forEach((function(t){delete e.attachments[t]}))}},{key:"checkStatus",value:function(){this.gl;var t=this.getStatus();if(36053!==t)throw new Error(C(t));return this}},{key:"getStatus",value:function(){var t=this.gl,e=t.bindFramebuffer(36160,this.handle),n=t.checkFramebufferStatus(36160);return t.bindFramebuffer(36160,e||null),n}},{key:"clear",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.color,r=e.depth,i=e.stencil,o=e.drawBuffers,a=void 0===o?[]:o,s=this.gl.bindFramebuffer(36160,this.handle);return(n||r||i)&&(0,g.Z)(this.gl,{color:n,depth:r,stencil:i}),a.forEach((function(e,n){(0,g.$)(t.gl,{drawBuffer:n,value:e})})),this.gl.bindFramebuffer(36160,s||null),this}},{key:"readPixels",value:function(){return p.cM.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}},{key:"readPixelsToBuffer",value:function(){return p.cM.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}},{key:"copyToDataUrl",value:function(){return p.cM.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}},{key:"copyToImage",value:function(){return p.cM.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}},{key:"copyToTexture",value:function(){return p.cM.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}},{key:"blit",value:function(){return p.cM.error("Framebuffer.blit({...}) is no logner supported, use blit(source, target, opts)")(),null}},{key:"invalidate",value:function(t){var e=t.attachments,n=void 0===e?[]:e,r=t.x,i=void 0===r?0:r,o=t.y,a=void 0===o?0:o,s=t.width,u=t.height,l=(0,p.KQ)(this.gl),c=l.bindFramebuffer(36008,this.handle);return 0===i&&0===a&&void 0===s&&void 0===u?l.invalidateFramebuffer(36008,n):l.invalidateFramebuffer(36008,n,i,a,s,u),l.bindFramebuffer(36008,c),this}},{key:"getAttachmentParameter",value:function(t,e,n){var r=this._getAttachmentParameterFallback(e);return null===r&&(this.gl.bindFramebuffer(36160,this.handle),r=this.gl.getFramebufferAttachmentParameter(36160,t,e),this.gl.bindFramebuffer(36160,null)),n&&r>1e3&&(r=(0,_.km)(this.gl,r)),r}},{key:"getAttachmentParameters",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:36064,n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.constructor.ATTACHMENT_PARAMETERS||[],i={},a=(0,o.Z)(r);try{for(a.s();!(t=a.n()).done;){var s=t.value;i[n?(0,_.km)(this.gl,s):s]=this.getAttachmentParameter(e,s,n)}}catch(u){a.e(u)}finally{a.f()}return i}},{key:"getParameters",value:function(){for(var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e={},n=0,r=Object.keys(this.attachments);n<r.length;n++){var i=r[n],o=Number(i);e[t?(0,_.km)(this.gl,o):o]=this.getAttachmentParameters(o,t)}return e}},{key:"show",value:function(){return"undefined"!==typeof window&&window.open((0,m.Km)(this),"luma-debug-texture"),this}},{key:"log",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(t>p.cM.level||"undefined"===typeof window)return this;
2e=e||"Framebuffer ".concat(this.id);var n=(0,m.Km)(this,{targetMaxHeight:100});return p.cM.image({logLevel:t,message:e,image:n},e)(),this}},{key:"bind",value:function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).target,e=void 0===t?36160:t;return this.gl.bindFramebuffer(e,this.handle),this}},{key:"unbind",value:function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).target,e=void 0===t?36160:t;return this.gl.bindFramebuffer(e,null),this}},{key:"_createDefaultAttachments",value:function(t,e,n,i,o){var a,s=null;t&&((s=s||{})[36064]=new A.Z(this.gl,{id:"".concat(this.id,"-color0"),pixels:null,format:6408,type:5121,width:i,height:o,mipmaps:!1,parameters:(a={},(0,r.Z)(a,10241,9729),(0,r.Z)(a,10240,9729),(0,r.Z)(a,10242,33071),(0,r.Z)(a,10243,33071),a)}),this.ownResources.push(s[36064]));return e&&n?((s=s||{})[33306]=new v.Z(this.gl,{id:"".concat(this.id,"-depth-stencil"),format:35056,width:i,height:111}),this.ownResources.push(s[33306])):e?((s=s||{})[36096]=new v.Z(this.gl,{id:"".concat(this.id,"-depth"),format:33189,width:i,height:o}),this.ownResources.push(s[36096])):n&&(0,b.h)(!1),s}},{key:"_unattach",value:function(t){var e=this.attachments[t];e&&(e instanceof v.Z?this.gl.framebufferRenderbuffer(36160,t,36161,null):this.gl.framebufferTexture2D(36160,t,3553,null,0),delete this.attachments[t])}},{key:"_attachRenderbuffer",value:function(t){var e=t.attachment,n=void 0===e?36064:e,r=t.renderbuffer;this.gl.framebufferRenderbuffer(36160,n,36161,r.handle),this.attachments[n]=r}},{key:"_attachTexture",value:function(t){var e=t.attachment,n=void 0===e?36064:e,r=t.texture,i=t.layer,o=t.level,a=this.gl;switch(a.bindTexture(r.target,r.handle),r.target){case 35866:case 32879:(0,p.KQ)(a).framebufferTextureLayer(36160,n,r.target,o,i);break;case 34067:var s=function(t){return t<34069?t+34069:t}(i);a.framebufferTexture2D(36160,n,s,r.handle,o);break;case 3553:a.framebufferTexture2D(36160,n,3553,r.handle,o);break;default:(0,b.h)(!1,"Illegal texture type")}a.bindTexture(r.target,null),this.attachments[n]=r}},{key:"_setReadBuffer",value:function(t){var e=(0,p.vd)(this.gl);e?e.readBuffer(t):(0,b.h)(36064===t||1029===t,x),this.readBuffer=t}},{key:"_setDrawBuffers",value:function(t){var e=this.gl,n=(0,p.KQ)(e);if(n)n.drawBuffers(t);else{var r=e.getExtension("WEBGL_draw_buffers");r?r.drawBuffersWEBGL(t):(0,b.h)(1===t.length&&(36064===t[0]||1029===t[0]),x)}this.drawBuffers=t}},{key:"_getAttachmentParameterFallback",value:function(t){var e=(0,y.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}}},{key:"_createHandle",value:function(){return this.gl.createFramebuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteFramebuffer(this.handle)}},{key:"_bindHandle",value:function(t){return this.gl.bindFramebuffer(36160,t)}}],[{key:"isSupported",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.colorBufferFloat,r=e.colorBufferHalfFloat,i=!0;return n&&(i=Boolean(t.getExtension("EXT_color_buffer_float")||t.getExtension("WEBGL_color_buffer_float")||t.getExtension("OES_texture_float"))),r&&(i=i&&Boolean(t.getExtension("EXT_color_buffer_float")||t.getExtension("EXT_color_buffer_half_float"))),i}},{key:"getDefaultFramebuffer",value:function(t){return t.luma=t.luma||{},t.luma.defaultFramebuffer=t.luma.defaultFramebuffer||new d(t,{id:"default-framebuffer",handle:null,attachments:{}}),t.luma.defaultFramebuffer}}]),d}(d.Z,Symbol.toStringTag);function C(t){return(w.STATUS||{})[t]||"Framebuffer error ".concat(t)}w.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303]},79817:function(t,e,n){"use strict";n.d(e,{Z:function(){return X}});var r,i=n(60726),o=n(22951),a=n(91976),s=n(47169),u=n(83138),l=n(27597),c=n(67591),h=n(94337),f=n(35572),p=n(51055),d=n(79078),A=n(64649),v=n(28007),g=n(38332),m=n(81301),y=(r={},(0,A.Z)(r,5126,Z.bind(null,"uniform1fv",B,1,D)),(0,A.Z)(r,35664,Z.bind(null,"uniform2fv",B,2,D)),(0,A.Z)(r,35665,Z.bind(null,"uniform3fv",B,3,D)),(0,A.Z)(r,35666,Z.bind(null,"uniform4fv",B,4,D)),(0,A.Z)(r,5124,Z.bind(null,"uniform1iv",k,1,D)),(0,A.Z)(r,35667,Z.bind(null,"uniform2iv",k,2,D)),(0,A.Z)(r,35668,Z.bind(null,"uniform3iv",k,3,D)),(0,A.Z)(r,35669,Z.bind(null,"uniform4iv",k,4,D)),(0,A.Z)(r,35670,Z.bind(null,"uniform1iv",k,1,D)),(0,A.Z)(r,35671,Z.bind(null,"uniform2iv",k,2,D)),(0,A.Z)(r,35672,Z.bind(null,"uniform3iv",k,3,D)),(0,A.Z)(r,35673,Z.bind(null,"uniform4iv",k,4,D)),(0,A.Z)(r,35674,Z.bind(null,"uniformMatrix2fv",B,4,L)),(0,A.Z)(r,35675,Z.bind(null,"uniformMatrix3fv",B,9,L)),(0,A.Z)(r,35676,Z.bind(null,"uniformMatrix4fv",B,16,L)),(0,A.Z)(r,35678,P),(0,A.Z)(r,35680,P),(0,A.Z)(r,5125,Z.bind(null,"uniform1uiv",E,1,D)),(0,A.Z)(r,36294,Z.bind(null,"uniform2uiv",E,2,D)),(0,A.Z)(r,36295,Z.bind(null,"uniform3uiv",E,3,D)),(0,A.Z)(r,36296,Z.bind(null,"uniform4uiv",E,4,D)),(0,A.Z)(r,35685,Z.bind(null,"uniformMatrix2x3fv",B,6,L)),(0,A.Z)(r,35686,Z.bind(null,"uniformMatrix2x4fv",B,8,L)),(0,A.Z)(r,35687,Z.bind(null,"uniformMatrix3x2fv",B,6,L)),(0,A.Z)(r,35688,Z.bind(null,"uniformMatrix3x4fv",B,12,L)),(0,A.Z)(r,35689,Z.bind(null,"uniformMatrix4x2fv",B,8,L)),(0,A.Z)(r,35690,Z.bind(null,"uniformMatrix4x3fv",B,12,L)),(0,A.Z)(r,35678,P),(0,A.Z)(r,35680,P),(0,A.Z)(r,35679,P),(0,A.Z)(r,35682,P),(0,A.Z)(r,36289,P),(0,A.Z)(r,36292,P),(0,A.Z)(r,36293,P),(0,A.Z)(r,36298,P),(0,A.Z)(r,36299,P),(0,A.Z)(r,36300,P),
2(0,A.Z)(r,36303,P),(0,A.Z)(r,36306,P),(0,A.Z)(r,36307,P),(0,A.Z)(r,36308,P),(0,A.Z)(r,36311,P),r),_={},b={},x={},w=[0];function C(t,e,n,r){1===e&&"boolean"===typeof t&&(t=t?1:0),Number.isFinite(t)&&(w[0]=t,t=w);var i=t.length;if(i%e&&v.cM.warn("Uniform size should be multiples of ".concat(e),t)(),t instanceof n)return t;var o=r[i];o||(o=new n(i),r[i]=o);for(var a=0;a<i;a++)o[a]=t[a];return o}function B(t,e){return C(t,e,Float32Array,_)}function k(t,e){return C(t,e,Int32Array,b)}function E(t,e){return C(t,e,Uint32Array,x)}function S(t,e,n){var r=y[n.type];if(!r)throw new Error("Unknown GLSL uniform type ".concat(n.type));return r().bind(null,t,e)}function T(t){if("]"!==t[t.length-1])return{name:t,length:1,isArray:!1};var 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 M(t){return Array.isArray(t)||ArrayBuffer.isView(t)?function(t){if(0===t.length)return!1;for(var e=Math.min(t.length,16),n=0;n<e;++n)if(!Number.isFinite(t[n]))return!1;return!0}(t):!!isFinite(t)||(!0===t||!1===t||(t instanceof p.Z||(t instanceof g.Z||t instanceof d.Z&&Boolean(t.texture))))}function I(t,e,n){if(Array.isArray(n)||ArrayBuffer.isView(n))if(t[e])for(var r=t[e],i=0,o=n.length;i<o;++i)r[i]=n[i];else t[e]=n.slice();else t[e]=n}function P(){var t=null;return function(e,n,r){var i=t!==r;return i&&(e.uniform1i(n,r),t=r),i}}function Z(t,e,n,r){var i=null,o=null;return function(a,s,u){var l=e(u,n),c=l.length,h=!1;if(null===i)i=new Float32Array(c),o=c,h=!0;else{(0,m.h)(o===c,"Uniform length cannot change.");for(var f=0;f<c;++f)if(l[f]!==i[f]){h=!0;break}}return h&&(r(a,t,s,l),i.set(l)),h}}function D(t,e,n,r){t[e](n,r)}function L(t,e,n,r){t[e](n,!1,r)}function O(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unnamed",n=t.match(/#define[\s*]SHADER_NAME[\s*]([A-Za-z0-9_-]+)[\s*]/);return n?n[1]:e}var F=35632,R=35633;function z(t,e,n,r){for(var i=t.split(/\r?\n/),o={},a={},s=r||O(e)||"(unnamed)",u="".concat(function(t){switch(t){case F:return"fragment";case R:return"vertex";default:return"unknown type"}}(n)," shader ").concat(s),l=0;l<i.length;l++){var c=i[l];if(!(c.length<=1)){var h=c.split(":"),f=h[0],p=parseInt(h[2],10);if(isNaN(p))throw new Error("GLSL compilation error in ".concat(u,": ").concat(t));"WARNING"!==f?o[p]=c:a[p]=c}}var d=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:": ",r=t.split(/\r?\n/),i=String(r.length+e-1).length;return r.map((function(t,r){var o=String(r+e),a=o.length;return N(o,i-a)+n+t}))}(e);return{shaderName:u,errors:U(o,d),warnings:U(a,d)}}function U(t,e){for(var n="",r=0;r<e.length;r++){var i=e[r];if((t[r+3]||t[r+2]||t[r+1])&&(n+="".concat(i,"\n"),t[r+1])){var o=t[r+1],a=o.split(":",3),s=a[0],u=parseInt(a[1],10)||0,l=o.substring(a.join(":").length+1).trim();n+=N("^^^ ".concat(s,": ").concat(l,"\n\n"),u)}}return n}function N(t,e){for(var n="",r=0;r<e;++r)n+=" ";return"".concat(n).concat(t)}var G=n(79666),j=function(t,e){(0,c.Z)(r,t);var n=(0,h.Z)(r);function r(t,e){var i;(0,o.Z)(this,r),(0,v.JD)(t),(0,m.h)("string"===typeof e.source,"Shader: GLSL source code must be a JavaScript string");var a=O(e.source,null)||e.id||(0,G.hQ)("unnamed ".concat(r.getTypeName(e.shaderType)));return(i=n.call(this,t,{id:a})).shaderType=e.shaderType,i.source=e.source,i.initialize(e),i}return(0,a.Z)(r,[{key:e,get:function(){return"Shader"}},{key:"initialize",value:function(t){var e=t.source,n=O(e,null);n&&(this.id=(0,G.hQ)(n)),this._compile(e)}},{key:"getParameter",value:function(t){return this.gl.getShaderParameter(this.handle,t)}},{key:"toString",value:function(){return"".concat(r.getTypeName(this.shaderType),":").concat(this.id)}},{key:"getName",value:function(){return O(this.source)||"unnamed-shader"}},{key:"getSource",value:function(){return this.gl.getShaderSource(this.handle)}},{key:"getTranslatedSource",value:function(){var t=this.gl.getExtension("WEBGL_debug_shaders");return t?t.getTranslatedShaderSource(this.handle):"No translated source available. WEBGL_debug_shaders not implemented"}},{key:"_compile",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.source;if(t.startsWith("#version ")||(t="#version 100\n".concat(t)),this.source=t,this.gl.shaderSource(this.handle,this.source),this.gl.compileShader(this.handle),!this.getParameter(35713)){var e=z(this.gl.getShaderInfoLog(this.handle),this.source,this.shaderType,this.id),n=e.shaderName,r=e.errors,i=e.warnings;throw v.cM.error("GLSL compilation errors in ".concat(n,"\n").concat(r))(),v.cM.warn("GLSL compilation warnings in ".concat(n,"\n").concat(i))(),new Error("GLSL compilation errors in ".concat(n))}}},{key:"_deleteHandle",value:function(){this.gl.deleteShader(this.handle)}},{key:"_getOptsFromHandle",value:function(){return{type:this.getParameter(35663),source:this.getSource()}}}],[{key:"getTypeName",value:function(t){switch(t){case 35633:return"vertex-shader";case 35632:return"fragment-shader";default:return(0,m.h)(!1),"unknown"}}}]),r}(f.Z,Symbol.toStringTag),V=function(t,e){(0,c.Z)(r,t);var n=(0,h.Z)(r);function r(t,e){return(0,o.Z)(this,r),"string"===typeof e&&(e={source:e}),n.call(this,t,Object.assign({},e,{shaderType:35633}))}return(0,a.Z)(r,[{key:e,get:function(){return"VertexShader"}},{key:"_createHandle",value:function(){return this.gl.createShader(35633)}}]),r}(j,Symbol.toStringTag),H=function(t,e){(0,c.Z)(r,t);var n=(0,h.Z)(r);function r(t,e){return(0,o.Z)(this,r),"string"===typeof e&&(e={source:e}),n.call(this,t,Object.assign({},e,{shaderType:35632}))}return(0,a.Z)(r,[{key:e,get:function(){return"FragmentShader"}},{key:"_createHandle",value:function(){return this.gl.createShader(35632)}}]),r}(j,Symbol.toStringTag),J=n(77462),W=n(83951),Q=function(){function t(e){(0,o.Z)(this,t),this.id=e.id,this.attributeInfos=[],this.attributeInfosByName={},this.attributeInfosByLocation=[],this.varyingInfos=[],this.varyingInfosByName={},Object.seal(this),this._readAttributesFromProgram(e),this._readVaryingsFromProgram(e)}return(0,a.Z)(t,[{key:"getAttributeInfo",value:function(t){var e=Number(t);return Number.isFinite(e)?this.attributeInfosByLocation[e]:this.attributeInfosByName[t]||null}},{key:"getAttributeLocation",value:function(t){var e=this.getAttributeInfo(t);return e?e.location:-1}}
2,{key:"getAttributeAccessor",value:function(t){var e=this.getAttributeInfo(t);return e?e.accessor:null}},{key:"getVaryingInfo",value:function(t){var e=Number(t);return Number.isFinite(e)?this.varyingInfos[e]:this.varyingInfosByName[t]||null}},{key:"getVaryingIndex",value:function(t){var e=this.getVaryingInfo();return e?e.location:-1}},{key:"getVaryingAccessor",value:function(t){var e=this.getVaryingInfo();return e?e.accessor:null}},{key:"_readAttributesFromProgram",value:function(t){for(var e=t.gl,n=e.getProgramParameter(t.handle,35721),r=0;r<n;r++){var i=e.getActiveAttrib(t.handle,r),o=i.name,a=i.type,s=i.size,u=e.getAttribLocation(t.handle,o);u>=0&&this._addAttribute(u,o,a,s)}this.attributeInfos.sort((function(t,e){return t.location-e.location}))}},{key:"_readVaryingsFromProgram",value:function(t){var e=t.gl;if((0,v.D0)(e)){for(var n=e.getProgramParameter(t.handle,35971),r=0;r<n;r++){var i=e.getTransformFeedbackVarying(t.handle,r),o=i.name,a=i.type,s=i.size;this._addVarying(r,o,a,s)}this.varyingInfos.sort((function(t,e){return t.location-e.location}))}}},{key:"_addAttribute",value:function(t,e,n,r){var i=(0,W.hJ)(n),o={type:i.type,size:r*i.components};this._inferProperties(t,e,o);var a={location:t,name:e,accessor:new J.Z(o)};this.attributeInfos.push(a),this.attributeInfosByLocation[t]=a,this.attributeInfosByName[a.name]=a}},{key:"_inferProperties",value:function(t,e,n){/instance/i.test(e)&&(n.divisor=1)}},{key:"_addVarying",value:function(t,e,n,r){var i=(0,W.hJ)(n),o=i.type,a=i.components,s={location:t,name:e,accessor:new J.Z({type:o,size:r*a})};this.varyingInfos.push(s),this.varyingInfosByName[s.name]=s}}]),t}(),q=n(55888),K=["setVertexArray","setAttributes","setBuffers","unsetBuffers","use","getUniformCount","getUniformInfo","getUniformLocation","getUniformValue","getVarying","getFragDataLocation","getAttachedShaders","getAttributeCount","getAttributeLocation","getAttributeInfo"],X=function(t,e){(0,c.Z)(r,t);var n=(0,h.Z)(r);function r(t){var e;(0,o.Z)(this,r);var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(e=n.call(this,t,i)).stubRemovedMethods("Program","v6.0",K),e._isCached=!1,e.initialize(i),Object.seal((0,s.Z)(e)),e._setId(i.id),e}return(0,a.Z)(r,[{key:e,get:function(){return"Program"}},{key:"initialize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.hash,n=t.vs,r=t.fs,i=t.varyings,o=t.bufferMode,a=void 0===o?35981:o;return this.hash=e||"",this.vs="string"===typeof n?new V(this.gl,{id:"".concat(t.id,"-vs"),source:n}):n,this.fs="string"===typeof r?new H(this.gl,{id:"".concat(t.id,"-fs"),source:r}):r,(0,m.h)(this.vs instanceof V),(0,m.h)(this.fs instanceof H),this.uniforms={},this._textureUniforms={},i&&i.length>0&&((0,v.KQ)(this.gl),this.varyings=i,this.gl2.transformFeedbackVaryings(this.handle,i,a)),this._compileAndLink(),this._readUniformLocationsFromLinkedProgram(),this.configuration=new Q(this),this.setProps(t)}},{key:"delete",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._isCached?this:(0,u.Z)((0,l.Z)(r.prototype),"delete",this).call(this,t)}},{key:"setProps",value:function(t){return"uniforms"in t&&this.setUniforms(t.uniforms),this}},{key:"draw",value:function(t){var e=this,n=t.logPriority,r=t.drawMode,i=void 0===r?4:r,o=t.vertexCount,a=t.offset,s=void 0===a?0:a,u=t.start,l=t.end,c=t.isIndexed,h=void 0!==c&&c,f=t.indexType,p=void 0===f?5123:f,d=t.instanceCount,A=void 0===d?0:d,g=t.isInstanced,y=void 0===g?A>0:g,_=t.vertexArray,b=void 0===_?null:_,x=t.transformFeedback,w=t.framebuffer,C=t.parameters,B=void 0===C?{}:C,k=t.uniforms,E=t.samplers;if((k||E)&&(v.cM.deprecated("Program.draw({uniforms})","Program.setUniforms(uniforms)")(),this.setUniforms(k||{})),v.cM.priority>=n){var S=w?w.id:"default",T="mode=".concat((0,q.km)(this.gl,i)," verts=").concat(o," ")+"instances=".concat(A," indexType=").concat((0,q.km)(this.gl,p)," ")+"isInstanced=".concat(y," isIndexed=").concat(h," ")+"Framebuffer=".concat(S);v.cM.log(n,T)()}return(0,m.h)(b),this.gl.useProgram(this.handle),!(!this._areTexturesRenderable()||0===o||y&&0===A)&&(b.bindForDraw(o,A,(function(){if(void 0!==w&&(B=Object.assign({},B,{framebuffer:w})),x){var t=(0,W.$Z)(i);x.begin(t)}e._bindTextures(),(0,v.s8)(e.gl,B,(function(){h&&y?e.gl2.drawElementsInstanced(i,o,p,s,A):h&&
2(0,v.D0)(e.gl)&&!isNaN(u)&&!isNaN(l)?e.gl2.drawRangeElements(i,u,l,o,p,s):h?e.gl.drawElements(i,o,p,s):y?e.gl2.drawArraysInstanced(i,s,o,A):e.gl.drawArrays(i,s,o)})),x&&x.end()})),!0)}},{key:"setUniforms",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};for(var e in v.cM.priority>=2&&function(t,e,n){for(var r in t){var i=t[r];if((!n||Boolean(n[r]))&&!M(i))throw e=e?"".concat(e," "):"",console.error("".concat(e," Bad uniform ").concat(r),i),new Error("".concat(e," Bad uniform ").concat(r))}}(t,this.id,this._uniformSetters),this.gl.useProgram(this.handle),t){var n=t[e],r=this._uniformSetters[e];if(r){var i=n,o=!1;if(i instanceof d.Z&&(i=i.texture),i instanceof p.Z)if(o=this.uniforms[e]!==n){void 0===r.textureIndex&&(r.textureIndex=this._textureIndexCounter++);var a=i,s=r.textureIndex;a.bind(s),i=s,this._textureUniforms[e]=a}else i=r.textureIndex;else this._textureUniforms[e]&&delete this._textureUniforms[e];(r(i)||o)&&I(this.uniforms,e,n)}}return this}},{key:"_areTexturesRenderable",value:function(){var t=!0;for(var e in this._textureUniforms){var n=this._textureUniforms[e];n.update(),t=t&&n.loaded}return t}},{key:"_bindTextures",value:function(){for(var t in this._textureUniforms){var e=this._uniformSetters[t].textureIndex;this._textureUniforms[t].bind(e)}}},{key:"_createHandle",value:function(){return this.gl.createProgram()}},{key:"_deleteHandle",value:function(){this.gl.deleteProgram(this.handle)}},{key:"_getOptionsFromHandle",value:function(t){var e,n=this.gl.getAttachedShaders(t),r={},o=(0,i.Z)(n);try{for(o.s();!(e=o.n()).done;){var a=e.value;switch(this.gl.getShaderParameter(this.handle,35663)){case 35633:r.vs=new V({handle:a});break;case 35632:r.fs=new H({handle:a})}}}catch(s){o.e(s)}finally{o.f()}return r}},{key:"_getParameter",value:function(t){return this.gl.getProgramParameter(this.handle,t)}},{key:"_setId",value:function(t){if(!t){var e=this._getName();this.id=(0,G.hQ)(e)}}},{key:"_getName",value:function(){var t=this.vs.getName()||this.fs.getName();return t=(t=t.replace(/shader/i,""))?"".concat(t,"-program"):"program"}},{key:"_compileAndLink",value:function(){var t=this.gl;if(t.attachShader(this.handle,this.vs.handle),t.attachShader(this.handle,this.fs.handle),v.cM.time(4,"linkProgram for ".concat(this._getName()))(),t.linkProgram(this.handle),v.cM.timeEnd(4,"linkProgram for ".concat(this._getName()))(),t.debug||v.cM.level>0){if(!t.getProgramParameter(this.handle,35714))throw new Error("Error linking: ".concat(t.getProgramInfoLog(this.handle)));if(t.validateProgram(this.handle),!t.getProgramParameter(this.handle,35715))throw new Error("Error validating: ".concat(t.getProgramInfoLog(this.handle)))}}},{key:"_readUniformLocationsFromLinkedProgram",value:function(){var t=this.gl;this._uniformSetters={},this._uniformCount=this._getParameter(35718);for(var e=0;e<this._uniformCount;e++){var n=this.gl.getActiveUniform(this.handle,e),r=T(n.name).name,i=t.getUniformLocation(this.handle,r);if(this._uniformSetters[r]=S(t,i,n),n.size>1)for(var o=0;o<n.size;o++)i=t.getUniformLocation(this.handle,"".concat(r,"[").concat(o,"]")),this._uniformSetters["".concat(r,"[").concat(o,"]")]=S(t,i,n)}this._textureIndexCounter=0}},{key:"getActiveUniforms",value:function(t,e){return this.gl2.getActiveUniforms(this.handle,t,e)}},{key:"getUniformBlockIndex",value:function(t){return this.gl2.getUniformBlockIndex(this.handle,t)}},{key:"getActiveUniformBlockParameter",value:function(t,e){return this.gl2.getActiveUniformBlockParameter(this.handle,t,e)}},{key:"uniformBlockBinding",value:function(t,e){this.gl2.uniformBlockBinding(this.handle,t,e)}}]),r}(f.Z,Symbol.toStringTag)},38332:function(t,e,n){"use strict";n.d(e,{Z:function(){return A}});var r,i=n(22951),o=n(91976),a=n(47169),s=n(67591),u=n(94337),l=n(35572),c=n(64649),h="EXT_color_buffer_float",f=(r={},(0,c.Z)(r,33189,{bpp:2}),(0,c.Z)(r,33190,{gl2:!0,bpp:3}),(0,c.Z)(r,36012,{gl2:!0,bpp:4}),(0,c.Z)(r,36168,{bpp:1}),(0,c.Z)(r,34041,{bpp:4}),(0,c.Z)(r,35056,{gl2:!0,bpp:4}),(0,c.Z)(r,36013,{gl2:!0,bpp:5}),(0,c.Z)(r,32854,{bpp:2}),(0,c.Z)(r,36194,{bpp:2}),(0,c.Z)(r,32855,{bpp:2}),(0,c.Z)(r,33321,{gl2:!0,bpp:1}),(0,c.Z)(r,33330,{gl2:!0,bpp:1}),(0,c.Z)(r,33329,{gl2:!0,bpp:1}),(0,c.Z)(r,33332,{gl2:!0,bpp:2}),(0,c.Z)(r,33331,{gl2:!0,bpp:2}),(0,c.Z)(r,33334,{gl2:!0,bpp:4}),(0,c.Z)(r,33333,{gl2:!0,bpp:4}),(0,c.Z)(r,33323,{gl2:!0,bpp:2}),(0,c.Z)(r,33336,{gl2:!0,bpp:2}),(0,c.Z)(r,33335,{gl2:!0,bpp:2}),(0,c.Z)(r,33338,{gl2:!0,bpp:4}),(0,c.Z)(r,33337,{gl2:!0,bpp:4}),(0,c.Z)(r,33340,{gl2:!0,bpp:8}),(0,c.Z)(r,33339,{gl2:!0,bpp:8}),(0,c.Z)(r,32849,{gl2:!0,bpp:3}),(0,c.Z)(r,32856,{gl2:!0,bpp:4}),(0,c.Z)(r,32857,{gl2:!0,bpp:4}),(0,c.Z)(r,36220,{gl2:!0,bpp:4}),(0,c.Z)(r,36238,{gl2:!0,bpp:4}),(0,c.Z)(r,36975,{gl2:!0,bpp:4}),(0,c.Z)(r,36214,{gl2:!0,bpp:8}),(0,c.Z)(r,36232,{gl2:!0,bpp:8}),(0,c.Z)(r,36226,{gl2:!0,bpp:16}),(0,c.Z)(r,36208,{gl2:!0,bpp:16}),(0,c.Z)(r,33325,{gl2:h,bpp:2}),(0,c.Z)(r,33327,{gl2:h,bpp:4}),(0,c.Z)(r,34842,{gl2:h,bpp:8}),(0,c.Z)(r,33326,{gl2:h,bpp:4}),(0,c.Z)(r,33328,{gl2:h,bpp:8}),(0,c.Z)(r,34836,{gl2:h,bpp:16}),(0,c.Z)(r,35898,{gl2:h,bpp:4}),r),p=n(28007),d=n(81301);var A=function(t,e){(0,s.Z)(r,t);var n=(0,u.Z)(r);function r(t){var e;(0,i.Z)(this,r);var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(e=n.call(this,t,o)).initialize(o),Object.seal((0,a.Z)(e)),e}
2return(0,o.Z)(r,[{key:e,get:function(){return"Renderbuffer"}},{key:"initialize",value:function(t){var e=t.format,n=t.width,r=void 0===n?1:n,i=t.height,o=void 0===i?1:i,a=t.samples,s=void 0===a?0:a;return(0,d.h)(e,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==s&&(0,p.D0)(this.gl)?this.gl.renderbufferStorageMultisample(36161,s,e,r,o):this.gl.renderbufferStorage(36161,e,r,o),this.format=e,this.width=r,this.height=o,this.samples=s,this._trackAllocatedMemory(this.width*this.height*(this.samples||1)*f[this.format].bpp),this}},{key:"resize",value:function(t){var e=t.width,n=t.height;return e!==this.width||n!==this.height?this.initialize({width:e,height:n,format:this.format,samples:this.samples}):this}},{key:"_createHandle",value:function(){return this.gl.createRenderbuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteRenderbuffer(this.handle),this._trackDeallocatedMemory()}},{key:"_bindHandle",value:function(t){this.gl.bindRenderbuffer(36161,t)}},{key:"_syncHandle",value:function(t){this.format=this.getParameter(36164),this.width=this.getParameter(36162),this.height=this.getParameter(36163),this.samples=this.getParameter(36011)}},{key:"_getParameter",value:function(t){return this.gl.bindRenderbuffer(36161,this.handle),this.gl.getRenderbufferParameter(36161,t)}}],[{key:"isSupported",value:function(t){var e=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{format:null}).format;return!e||function(t,e,n){var r=n[e];if(!r)return!1;var i=(0,p.D0)(t)&&r.gl2||r.gl1;return"string"===typeof i?t.getExtension(i):i}(t,e,f)}},{key:"getSamplesForFormat",value:function(t,e){var n=e.format;return t.getInternalformatParameter(36161,n,32937)}}]),r}(l.Z,Symbol.toStringTag)},35572:function(t,e,n){"use strict";n.d(e,{Z:function(){return p}});var r=n(60726),i=n(22951),o=n(91976),a=n(28007),s=n(48546),u=n(55888),l=n(81301),c=n(79666),h=n(69221),f="Resource subclass must define virtual methods",p=function(t){function e(t){(0,i.Z)(this,e);var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,a.JD)(t);var r=n.id,o=n.userData,s=void 0===o?{}:o;this.gl=t,this.gl2=t,this.id=r||(0,c.hQ)(this[Symbol.toStringTag]),this.userData=s,this._bound=!1,this._handle=n.handle,void 0===this._handle&&(this._handle=this._createHandle()),this.byteLength=0,this._addStats()}return(0,o.Z)(e,[{key:t,get:function(){return"Resource"}},{key:"toString",value:function(){return"".concat(this[Symbol.toStringTag]||this.constructor.name,"(").concat(this.id,")")}},{key:"handle",get:function(){return this._handle}},{key:"delete",value:function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).deleteChildren,e=void 0!==t&&t,n=this._handle&&this._deleteHandle(this._handle);return this._handle&&this._removeStats(),this._handle=null,n&&e&&n.filter(Boolean).forEach((function(t){return t.delete()})),this}},{key:"bind",value:function(){var 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)}},{key:"unbind",value:function(){this.bind(null)}},{key:"getParameter",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t=(0,u.sF)(this.gl,t),(0,l.h)(t);var n=(this.constructor.PARAMETERS||{})[t];if(n){var r=(0,a.D0)(this.gl);if(!((!("webgl2"in n)||r)&&(!("extension"in n)||this.gl.getExtension(n.extension)))){var i=n.webgl1,o="webgl2"in n?n.webgl2:n.webgl1;return r?o:i}}return this._getParameter(t,e)}},{key:"getParameters",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.parameters,i=e.keys,o=this.constructor.PARAMETERS||{},s=(0,a.D0)(this.gl),l={},c=n||Object.keys(o),h=(0,r.Z)(c);try{for(h.s();!(t=h.n()).done;){var f=t.value,p=o[f];if(p&&(!("webgl2"in p)||s)&&(!("extension"in p)||this.gl.getExtension(p.extension))){var d=i?(0,u.km)(this.gl,f):f;l[d]=this.getParameter(f,e),i&&"GLenum"===p.type&&(l[d]=(0,u.km)(this.gl,l[d]))}}}catch(A){h.e(A)}finally{h.f()}return l}},{key:"setParameter",value:function(t,e){t=(0,u.sF)(this.gl,t),(0,l.h)(t);var n=(this.constructor.PARAMETERS||{})[t];if(n){var r=(0,a.D0)(this.gl);
2if(!((!("webgl2"in n)||r)&&(!("extension"in n)||this.gl.getExtension(n.extension))))throw new Error("Parameter not available on this platform");"GLenum"===n.type&&(e=(0,u.sF)(e))}return this._setParameter(t,e),this}},{key:"setParameters",value:function(t){for(var e in t)this.setParameter(e,t[e]);return this}},{key:"stubRemovedMethods",value:function(t,e,n){return(0,h.F)(this,t,e,n)}},{key:"initialize",value:function(t){}},{key:"_createHandle",value:function(){throw new Error(f)}},{key:"_deleteHandle",value:function(){throw new Error(f)}},{key:"_bindHandle",value:function(t){throw new Error(f)}},{key:"_getOptsFromHandle",value:function(){throw new Error(f)}},{key:"_getParameter",value:function(t,e){throw new Error(f)}},{key:"_setParameter",value:function(t,e){throw new Error(f)}},{key:"_context",value:function(){return this.gl.luma=this.gl.luma||{},this.gl.luma}},{key:"_addStats",value:function(){var t=this[Symbol.toStringTag],e=s.lR.get("Resource Counts");e.get("Resources Created").incrementCount(),e.get("".concat(t,"s Created")).incrementCount(),e.get("".concat(t,"s Active")).incrementCount()}},{key:"_removeStats",value:function(){var t=this[Symbol.toStringTag];s.lR.get("Resource Counts").get("".concat(t,"s Active")).decrementCount()}},{key:"_trackAllocatedMemory",value:function(t){var 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}},{key:"_trackAllocatedMemoryForContext",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this[Symbol.toStringTag],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=s.lR.get("Memory Usage".concat(n));r.get("GPU Memory").addCount(t),r.get("".concat(e," Memory")).addCount(t)}},{key:"_trackDeallocatedMemory",value:function(){var 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}},{key:"_trackDeallocatedMemoryForContext",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this[Symbol.toStringTag],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=s.lR.get("Memory Usage".concat(e));n.get("GPU Memory").subtractCount(this.byteLength),n.get("".concat(t," Memory")).subtractCount(this.byteLength)}}]),e}(Symbol.toStringTag)},58300:function(t,e,n){"use strict";n.d(e,{Z:function(){return f}});var r=n(22951),i=n(91976),o=n(47169),a=n(67591),s=n(94337),u=n(28007),l=n(51055),c=n(81301),h="";var f=function(t,e){(0,a.Z)(f,t);var n=(0,s.Z)(f);function f(t){var e;(0,r.Z)(this,f);var i,a,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,u.JD)(t),(s instanceof Promise||"string"===typeof s)&&(s={data:s}),"string"===typeof s.data&&(s=Object.assign({},s,{data:(i=s.data,(0,c.h)("string"===typeof i),i=h+i,new Promise((function(t,e){try{var n=new Image;n.onload=function(){return t(n)},n.onerror=function(){return e(new Error("Could not load image ".concat(i,".")))},n.crossOrigin=a&&a.crossOrigin||"anonymous",n.src=i}catch(r){e(r)}})))})),(e=n.call(this,t,Object.assign({},s,{target:3553}))).initialize(s),Object.seal((0,o.Z)(e)),e}return(0,i.Z)(f,[{key:e,get:function(){return"Texture2D"}}],[{key:"isSupported",value:function(t,e){return l.Z.isSupported(t,e)}}]),f}(l.Z,Symbol.toStringTag)},29094:function(t,e,n){"use strict";n.d(e,{C:function(){return l},KR:function(){return f},ae:function(){return u},br:function(){return h},pH:function(){return c}});var r,i,o,a=n(64649),s=n(28007),u=(r={},(0,a.Z)(r,6407,{dataFormat:6407,types:[5121,33635]}),(0,a.Z)(r,6408,{dataFormat:6408,types:[5121,32819,32820]}),(0,a.Z)(r,6406,{dataFormat:6406,types:[5121]}),(0,a.Z)(r,6409,{dataFormat:6409,types:[5121]}),(0,a.Z)(r,6410,{dataFormat:6410,types:[5121]}),(0,a.Z)(r,33326,{dataFormat:6403,types:[5126],gl2:!0}),(0,a.Z)(r,33328,{dataFormat:33319,types:[5126],gl2:!0}),(0,a.Z)(r,34837,{dataFormat:6407,types:[5126],gl2:!0}),(0,a.Z)(r,34836,{dataFormat:6408,types:[5126],gl2:!0}),r),l=(i={},(0,a.Z)(i,6403,1),(0,a.Z)(i,36244,1),(0,a.Z)(i,33319,2),(0,a.Z)(i,33320,2),(0,a.Z)(i,6407,3),(0,a.Z)(i,36248,3),(0,a.Z)(i,6408,4),(0,a.Z)(i,36249,4),(0,a.Z)(i,6402,1),(0,a.Z)(i,34041,1),(0,a.Z)(i,6406,1),(0,a.Z)(i,6409,1),(0,a.Z)(i,6410,2),i),c=(o={},(0,a.Z)(o,5126,4),(0,a.Z)(o,5125,4),(0,a.Z)(o,5124,4),(0,a.Z)(o,5123,2),(0,a.Z)(o,5122,2),(0,a.Z)(o,5131,2),(0,a.Z)(o,5120,1),(0,a.Z)(o,5121,1),o);function h(t,e){var n=u[e];
2if(!n)return!1;if(void 0===n.gl1&&void 0===n.gl2)return!0;var r=(0,s.D0)(t)&&n.gl2||n.gl1;return"string"===typeof r?t.getExtension(r):r}function f(t,e){var n=u[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:function(t,e,n){"use strict";n.d(e,{Z:function(){return g}});var r=n(11026),i=n(60726),o=n(22951),a=n(91976),s=n(67591),u=n(94337),l=n(28007),c=n(35572),h=n(33839),f=n(29094),p=n(81301),d=n(79666),A=[9729,9728],v=globalThis.WebGLBuffer||function(){},g=function(t,e){(0,s.Z)(c,t);var n=(0,u.Z)(c);function c(t,e){var r;(0,o.Z)(this,c);var i=e.id,a=void 0===i?(0,d.hQ)("texture"):i,s=e.handle,u=e.target;return(r=n.call(this,t,{id:a,handle:s})).target=u,r.textureUnit=void 0,r.loaded=!1,r.width=void 0,r.height=void 0,r.depth=void 0,r.format=void 0,r.type=void 0,r.dataFormat=void 0,r.border=void 0,r.textureUnit=void 0,r.mipmaps=void 0,r}return(0,a.Z)(c,[{key:e,get:function(){return"Texture"}},{key:"toString",value:function(){return"Texture(".concat(this.id,",").concat(this.width,"x").concat(this.height,")")}},{key:"initialize",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.data;if(n instanceof Promise)return n.then((function(n){return t.initialize(Object.assign({},e,{pixels:n,data:n}))})),this;var r="undefined"!==typeof HTMLVideoElement&&n instanceof HTMLVideoElement;if(r&&n.readyState<HTMLVideoElement.HAVE_METADATA)return this._video=null,n.addEventListener("loadeddata",(function(){return t.initialize(e)})),this;var i=e.pixels,o=void 0===i?null:i,a=e.format,s=void 0===a?6408:a,u=e.border,c=void 0===u?0:u,h=e.recreate,f=void 0!==h&&h,p=e.parameters,d=void 0===p?{}:p,A=e.pixelStore,v=void 0===A?{}:A,g=e.textureUnit,m=void 0===g?void 0:g;n||(n=o);var y=e.width,_=e.height,b=e.dataFormat,x=e.type,w=e.compressed,C=void 0!==w&&w,B=e.mipmaps,k=void 0===B||B,E=e.depth,S=void 0===E?0:E,T=this._deduceParameters({format:s,type:x,dataFormat:b,compressed:C,data:n,width:y,height:_});return y=T.width,_=T.height,C=T.compressed,b=T.dataFormat,x=T.type,this.width=y,this.height=_,this.depth=S,this.format=s,this.type=x,this.dataFormat=b,this.border=c,this.textureUnit=m,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle)),k&&this._isNPOT()&&(l.cM.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),k=!1,this._updateForNPOT(d)),this.mipmaps=k,this.setImageData({data:n,width:y,height:_,depth:S,format:s,type:x,dataFormat:b,border:c,mipmaps:k,parameters:v,compressed:C}),k&&this.generateMipmap(),this.setParameters(d),f&&(this.data=n),r&&(this._video={video:n,parameters:d,lastTime:n.readyState>=HTMLVideoElement.HAVE_CURRENT_DATA?n.currentTime:-1}),this}},{key:"update",value:function(){if(this._video){var t=this._video,e=t.video,n=t.parameters;if(t.lastTime===e.currentTime||e.readyState<HTMLVideoElement.HAVE_CURRENT_DATA)return;this.setSubImageData({data:e,parameters:n}),this.mipmaps&&this.generateMipmap(),this._video.lastTime=e.currentTime}}},{key:"resize",value:function(t){var e=t.height,n=t.width,r=t.mipmaps,i=void 0!==r&&r;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}},{key:"generateMipmap",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._isNPOT()?(l.cM.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),this):(this.mipmaps=!0,this.gl.bindTexture(this.target,this.handle),(0,l.s8)(this.gl,e,(function(){t.gl.generateMipmap(t.target)})),this.gl.bindTexture(this.target,null),this)}},{key:"setImageData",value:function(t){this._trackDeallocatedMemory("Texture");var e=t.target,n=void 0===e?this.target:e,o=t.pixels,a=void 0===o?null:o,s=t.level,u=void 0===s?0:s,c=t.format,h=void 0===c?this.format:c,d=t.border,A=void 0===d?this.border:d,v=t.offset,g=void 0===v?0:v,m=t.parameters,y=void 0===m?{}:m,_=t.data,b=void 0===_?null:_,x=t.type,w=void 0===x?this.type:x,C=t.width,B=void 0===C?this.width:C,k=t.height,E=void 0===k?this.height:k,S=t.dataFormat,T=void 0===S?this.dataFormat:S,M=t.compressed,I=void 0!==M&&M;b||(b=a);var P=this._deduceParameters({format:h,type:w,dataFormat:T,compressed:I,data:b,width:B,height:E});w=P.type,T=P.dataFormat,I=P.compressed,B=P.width,E=P.height;var Z=this.gl;Z.bindTexture(this.target,this.handle);var D,L,O=this._getDataType({data:b,compressed:I});b=O.data,D=O.dataType;var F=0;if((0,l.s8)(this.gl,y,(function(){switch(D){case"null":Z.texImage2D(n,u,h,B,E,A,T,w,b);break;case"typed-array":Z.texImage2D(n,u,h,B,E,A,T,w,b,g);break;case"buffer":(L=(0,l.KQ)(Z)).bindBuffer(35052,b.handle||b),L.texImage2D(n,u,h,B,E,A,T,w,g),L.bindBuffer(35052,null);break;case"browser-object":(0,l.D0)(Z)?Z.texImage2D(n,u,h,B,E,A,T,w,b):Z.texImage2D(n,u,h,T,w,b);break;case"compressed":var t,e=(0,i.Z)(b.entries());try{for(e.s();!(t=e.n()).done;){var o=(0,r.Z)(t.value,2),a=o[0],s=o[1];Z.compressedTexImage2D(n,a,s.format,s.width,s.height,A,s.data),F+=s.levelSize}}catch(c){e.e(c)}finally{e.f()}break;default:(0,p.h)(!1,"Unknown image data type")}})),"compressed"===D)this._trackAllocatedMemory(F,"Texture");else if(b&&b.byteLength)this._trackAllocatedMemory(b.byteLength,"Texture");
2else{var R=f.C[this.dataFormat]||4,z=f.pH[this.type]||1;this._trackAllocatedMemory(this.width*this.height*R*z,"Texture")}return this.loaded=!0,this}},{key:"setSubImageData",value:function(t){var e=this,n=t.target,r=void 0===n?this.target:n,i=t.pixels,o=void 0===i?null:i,a=t.data,s=void 0===a?null:a,u=t.x,c=void 0===u?0:u,f=t.y,d=void 0===f?0:f,A=t.width,g=void 0===A?this.width:A,m=t.height,y=void 0===m?this.height:m,_=t.level,b=void 0===_?0:_,x=t.format,w=void 0===x?this.format:x,C=t.type,B=void 0===C?this.type:C,k=t.dataFormat,E=void 0===k?this.dataFormat:k,S=t.compressed,T=void 0!==S&&S,M=t.offset,I=void 0===M?0:M,P=t.border,Z=(void 0===P&&this.border,t.parameters),D=void 0===Z?{}:Z,L=this._deduceParameters({format:w,type:B,dataFormat:E,compressed:T,data:s,width:g,height:y});if(B=L.type,E=L.dataFormat,T=L.compressed,g=L.width,y=L.height,(0,p.h)(0===this.depth,"texSubImage not supported for 3D textures"),s||(s=o),s&&s.data){var O=s;s=O.data,g=O.shape[0],y=O.shape[1]}s instanceof h.Z&&(s=s.handle),this.gl.bindTexture(this.target,this.handle),(0,l.s8)(this.gl,D,(function(){if(T)e.gl.compressedTexSubImage2D(r,b,c,d,g,y,w,s);else if(null===s)e.gl.texSubImage2D(r,b,c,d,g,y,E,B,null);else if(ArrayBuffer.isView(s))e.gl.texSubImage2D(r,b,c,d,g,y,E,B,s,I);else if(s instanceof v){var t=(0,l.KQ)(e.gl);t.bindBuffer(35052,s),t.texSubImage2D(r,b,c,d,g,y,E,B,I),t.bindBuffer(35052,null)}else if((0,l.D0)(e.gl)){(0,l.KQ)(e.gl).texSubImage2D(r,b,c,d,g,y,E,B,s)}else e.gl.texSubImage2D(r,b,c,d,E,B,s)})),this.gl.bindTexture(this.target,null)}},{key:"copyFramebuffer",value:function(){return l.cM.error("Texture.copyFramebuffer({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}},{key:"getActiveUnit",value:function(){return this.gl.getParameter(34016)-33984}},{key:"bind",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit,e=this.gl;return void 0!==t&&(this.textureUnit=t,e.activeTexture(33984+t)),e.bindTexture(this.target,this.handle),t}},{key:"unbind",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit,e=this.gl;return void 0!==t&&(this.textureUnit=t,e.activeTexture(33984+t)),e.bindTexture(this.target,null),t}},{key:"_getDataType",value:function(t){var e=t.data,n=t.compressed;return void 0!==n&&n?{data:e,dataType:"compressed"}:null===e?{data:e,dataType:"null"}:ArrayBuffer.isView(e)?{data:e,dataType:"typed-array"}:e instanceof h.Z?{data:e.handle,dataType:"buffer"}:e instanceof v?{data:e,dataType:"buffer"}:{data:e,dataType:"browser-object"}}},{key:"_deduceParameters",value:function(t){var e=t.format,n=t.data,r=t.width,i=t.height,o=t.dataFormat,a=t.type,s=t.compressed,u=f.ae[e];o=o||u&&u.dataFormat,a=a||u&&u.types[0],s=s||u&&u.compressed;var l=this._deduceImageSize(n,r,i);return{dataFormat:o,type:a,compressed:s,width:r=l.width,height:i=l.height,format:e,data:n}}},{key:"_deduceImageSize",value:function(t,e,n){var r;return r="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,p.h)(r,"Could not deduced texture size"),(0,p.h)(void 0===e||r.width===e,"Deduced texture width does not match supplied width"),(0,p.h)(void 0===n||r.height===n,"Deduced texture height does not match supplied height"),r}},{key:"_createHandle",value:function(){return this.gl.createTexture()}},{key:"_deleteHandle",value:function(){this.gl.deleteTexture(this.handle),this._trackDeallocatedMemory("Texture")}},{key:"_getParameter",value:function(t){switch(t){case 4096:return this.width;case 4097:return this.height;default:this.gl.bindTexture(this.target,this.handle);var e=this.gl.getTexParameter(this.target,t);return this.gl.bindTexture(this.target,null),e}}},{key:"_setParameter",value:function(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,p.h)(!1);break;default:this.gl.texParameteri(this.target,t,e)}return this.gl.bindTexture(this.target,null),this}},{key:"_isNPOT",value:function(){return!(0,l.D0)(this.gl)&&(!(!this.width||!this.height)&&(!(0,d.wt)(this.width)||!(0,d.wt)(this.height)))}},{key:"_updateForNPOT",value:function(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)}},{key:"_getNPOTParam",value:function(t,e){if(this._isNPOT())switch(t){case 10241:-1===A.indexOf(e)&&(e=9729);break;case 10242:case 10243:33071!==e&&(e=33071)}return e}}],[{key:"isSupported",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.format,r=e.linearFiltering,i=!0;return n&&(i=(i=i&&(0,f.br)(t,n))&&(!r||(0,f.KR)(t,n))),i}}]),c}(c.Z,Symbol.toStringTag)},54345:function(t,e,n){"use strict";n.d(e,{Z:function(){return f}});var r=n(22951),i=n(91976),o=n(47169),a=n(67591),s=n(94337),u=n(28007),l=n(35572),c=n(33839),h=n(79666),f=function(t,e){(0,a.Z)(l,t);var n=(0,s.Z)(l);function l(t){var e;(0,r.Z)(this,l);var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,u.KQ)(t),(e=n.call(this,t,i)).initialize(i),e.stubRemovedMethods("TransformFeedback","v6.0",["pause","resume"]),Object.seal((0,o.Z)(e)),e}return(0,i.Z)(l,[{key:e,get:function(){return"TransformFeedback"}},{key:"initialize",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.buffers={},this.unused={},this.configuration=null,this.bindOnUse=!0,(0,h.nK)(this.buffers)||this.bind((function(){return t._unbindBuffers()})),this.setProps(e),this}},{key:"setProps",value:function(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)}},{key:"setBuffers",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.bind((function(){for(var n in e)t.setBuffer(n,e[n])})),this}},{key:"setBuffer",value:function(t,e){var n=this._getVaryingIndex(t),r=this._getBufferParams(e),i=r.buffer,o=r.byteSize,a=r.byteOffset;return n<0?(this.unused[t]=i,u.cM.warn("".concat(this.id," unused varying buffer ").concat(t))(),this):(this.buffers[n]=e,this.bindOnUse||this._bindBuffer(n,i,a,o),this)}},{key:"begin",value:function(){var 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}},{key:"end",value:function(){return this.gl.endTransformFeedback(),this._unbindBuffers(),this.gl.bindTransformFeedback(36386,null),this}},{key:"_getBufferParams",value:function(t){var e,n,r;return t instanceof c.Z===!1?(r=t.buffer,n=t.byteSize,e=t.byteOffset):r=t,void 0===e&&void 0===n||(e=e||0,n=n||r.byteLength-e),{buffer:r,byteOffset:e,byteSize:n}}},{key:"_getVaryingInfo",value:function(t){return this.configuration&&this.configuration.getVaryingInfo(t)}},{key:"_getVaryingIndex",value:function(t){if(this.configuration)return this.configuration.getVaryingInfo(t).location;var e=Number(t);return Number.isFinite(e)?e:-1}},{key:"_bindBuffers",value:function(){if(this.bindOnUse)for(var t in this.buffers){var e=this._getBufferParams(this.buffers[t]),n=e.buffer,r=e.byteSize,i=e.byteOffset;this._bindBuffer(t,n,i,r)}}},{key:"_unbindBuffers",value:function(){if(this.bindOnUse)for(var t in this.buffers)this._bindBuffer(t,null)}},{key:"_bindBuffer",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3?arguments[3]:void 0,i=e&&e.handle;return i&&void 0!==r?this.gl.bindBufferRange(35982,t,i,n,r):this.gl.bindBufferBase(35982,t,i),this}},{key:"_createHandle",value:function(){return this.gl.createTransformFeedback()}},{key:"_deleteHandle",value:function(){this.gl.deleteTransformFeedback(this.handle)}},{key:"_bindHandle",value:function(t){this.gl.bindTransformFeedback(36386,this.handle)}}],[{key:"isSupported",value:function(t){return(0,u.D0)(t)}}]),l}(l.Z,Symbol.toStringTag)},12308:function(t,e,n){"use strict";n.d(e,{N$:function(){return c},U6:function(){return u},ag:function(){return l}});var r=n(60726),i=n(70353),o=n(28007),a=n(81301),s=2;function u(t,e){return l(t,e)}function l(t,e){return(e=Array.isArray(e)?e:[e]).every((function(e){return h(t,e)}))}function c(t){for(var e in t.luma=t.luma||{},t.luma.caps=t.luma.caps||{},i.Z)void 0===t.luma.caps[e]&&(t.luma.caps[e]=h(t,e));return t.luma.caps}function h(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){var n,s=i.Z[e];(0,a.h)(s,e);var u=(0,o.D0)(t)&&s[1]||s[0];if("function"===typeof u)n=u(t);else if(Array.isArray(u)){n=!0;var l,c=(0,r.Z)(u);try{for(c.s();!(l=c.n()).done;){var h=l.value;n=n&&Boolean(t.getExtension(h))}}catch(f){c.e(f)}finally{c.f()}}else"string"===typeof u?n=Boolean(t.getExtension(u)):"boolean"===typeof u?n=u:(0,a.h)(!1);return n}(t,e)),t.luma.caps[e]||o.cM.log(s,"Feature: ".concat(e," not supported"))(),t.luma.caps[e]}},70353:function(t,e,n){"use strict";n.d(e,{h:function(){return s}});var r,i=n(64649),o=n(79078),a=n(58300),s={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"};e.Z=(r={},(0,i.Z)(r,s.WEBGL2,[!1,!0]),(0,i.Z)(r,s.VERTEX_ARRAY_OBJECT,["OES_vertex_array_object",!0]),(0,i.Z)(r,s.TIMER_QUERY,["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"]),(0,i.Z)(r,s.INSTANCED_RENDERING,["ANGLE_
2instanced_arrays",!0]),(0,i.Z)(r,s.MULTIPLE_RENDER_TARGETS,["WEBGL_draw_buffers",!0]),(0,i.Z)(r,s.ELEMENT_INDEX_UINT32,["OES_element_index_uint",!0]),(0,i.Z)(r,s.BLEND_EQUATION_MINMAX,["EXT_blend_minmax",!0]),(0,i.Z)(r,s.FLOAT_BLEND,["EXT_float_blend"]),(0,i.Z)(r,s.COLOR_ENCODING_SRGB,["EXT_sRGB",!0]),(0,i.Z)(r,s.TEXTURE_DEPTH,["WEBGL_depth_texture",!0]),(0,i.Z)(r,s.TEXTURE_FLOAT,["OES_texture_float",!0]),(0,i.Z)(r,s.TEXTURE_HALF_FLOAT,["OES_texture_half_float",!0]),(0,i.Z)(r,s.TEXTURE_FILTER_LINEAR_FLOAT,["OES_texture_float_linear"]),(0,i.Z)(r,s.TEXTURE_FILTER_LINEAR_HALF_FLOAT,["OES_texture_half_float_linear"]),(0,i.Z)(r,s.TEXTURE_FILTER_ANISOTROPIC,["EXT_texture_filter_anisotropic"]),(0,i.Z)(r,s.COLOR_ATTACHMENT_RGBA32F,[function(t){var e=new a.Z(t,{format:6408,type:5126,dataFormat:6408}),n=new o.Z(t,{id:"test-framebuffer",check:!1,attachments:(0,i.Z)({},36064,e)}),r=n.getStatus();return e.delete(),n.delete(),36053===r},"EXT_color_buffer_float"]),(0,i.Z)(r,s.COLOR_ATTACHMENT_FLOAT,[!1,"EXT_color_buffer_float"]),(0,i.Z)(r,s.COLOR_ATTACHMENT_HALF_FLOAT,["EXT_color_buffer_half_float"]),(0,i.Z)(r,s.GLSL_FRAG_DATA,["WEBGL_draw_buffers",!0]),(0,i.Z)(r,s.GLSL_FRAG_DEPTH,["EXT_frag_depth",!0]),(0,i.Z)(r,s.GLSL_DERIVATIVES,["OES_standard_derivatives",!0]),(0,i.Z)(r,s.GLSL_TEXTURE_LOD,["EXT_shader_texture_lod",!0]),r)},48546:function(t,e,n){"use strict";n.d(e,{lR:function(){return l}});var r=n(22951),i=n(91976),o=n(28007),a=n(92138),s=n(11515),u="8.5.18",l=new(function(){function t(){(0,r.Z)(this,t),this.stats=new Map}return(0,i.Z)(t,[{key:"get",value:function(t){return this.stats.has(t)||this.stats.set(t,new a.Z({id:t})),this.stats.get(t)}}]),t}());if(globalThis.luma&&globalThis.luma.VERSION!==u)throw new Error("luma.gl - multiple VERSIONs detected: ".concat(globalThis.luma.VERSION," vs ").concat(u));globalThis.luma||((0,s.Z)()&&o.cM.log(1,"luma.gl ".concat(u," - ").concat("set luma.log.level=1 (or higher) to trace rendering"))(),globalThis.luma=globalThis.luma||{VERSION:u,version:u,log:o.cM,stats:l,globals:{modules:{},nodeIO:{}}});globalThis.luma},81301:function(t,e,n){"use strict";function r(t,e){if(!t)throw new Error(e||"luma.gl: assertion failed.")}n.d(e,{h:function(){return r}})},80182:function(t,e,n){"use strict";n.d(e,{k:function(){return i}});var r=n(28007);function i(t,e,n){var i=n.removedProps,o=void 0===i?{}:i,a=n.deprecatedProps,s=void 0===a?{}:a,u=n.replacedProps,l=void 0===u?{}:u;for(var c in o)if(c in e){var h=o[c]?"".concat(t,".").concat(o[c]):"N/A";r.cM.removed("".concat(t,".").concat(c),h)()}for(var f in s)if(f in e){var p=s[f];r.cM.deprecated("".concat(t,".").concat(f),"".concat(t,".").concat(p))()}var d=null;for(var A in l)if(A in e){var v=l[A];r.cM.deprecated("".concat(t,".").concat(A),"".concat(t,".").concat(v))(),(d=d||Object.assign({},e))[v]=e[A],delete d[A]}return d||e}},69221:function(t,e,n){"use strict";n.d(e,{F:function(){return i}});var r=n(28007);function i(t,e,n,i){var o="See luma.gl ".concat(n," Upgrade Guide at https://luma.gl/docs/upgrade-guide"),a=Object.getPrototypeOf(t);i.forEach((function(t){a.methodName||(a[t]=function(){throw r.cM.removed("Calling removed method ".concat(e,".").concat(t,": "),o)(),new Error(t)})}))}},79666:function(t,e,n){"use strict";n.d(e,{hQ:function(){return o},nK:function(){return s},wt:function(){return a}});var r=n(81301),i={};function o(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"id";i[t]=i[t]||1;var e=i[t]++;return"".concat(t,"-").concat(e)}function a(t){return(0,r.h)("number"===typeof t,"Input must be a number"),t&&0===(t&t-1)}function s(t){var e=!0;for(var n in t){e=!1;break}return e}},83951:function(t,e,n){"use strict";n.d(e,{$Z:function(){return x},hJ:function(){return w},jG:function(){return C}});var r,i=n(11026),o=n(64649),a=n(81301),s=5120,u=5121,l=5122,c=5123,h=0,f=1,p=2,d=3,A=4,v=5,g=6,m=5126,y=5124,_=5125,b=(r={},(0,o.Z)(r,m,[m,1,"float"]),(0,o.Z)(r,35664,[m,2,"vec2"]),(0,o.Z)(r,35665,[m,3,"vec3"]),(0,o.Z)(r,35666,[m,4,"vec4"]),(0,o.Z)(r,y,[y,1,"int"]),(0,o.Z)(r,35667,[y,2,"ivec2"]),(0,o.Z)(r,35668,[y,3,"ivec3"]),(0,o.Z)(r,35669,[y,4,"ivec4"]),(0,o.Z)(r,_,[_,1,"uint"]),(0,o.Z)(r,36294,[_,2,"uvec2"]),(0,o.Z)(r,36295,[_,3,"uvec3"]),(0,o.Z)(r,36296,[_,4,"uvec4"]),(0,o.Z)(r,35670,[m,1,"bool"]),(0,o.Z)(r,35671,[m,2,"bvec2"]),(0,o.Z)(r,35672,[m,3,"bvec3"]),(0,o.Z)(r,35673,[m,4,"bvec4"]),(0,o.Z)(r,35674,[m,8,"mat2"]),(0,o.Z)(r,35685,[m,8,"mat2x3"]),(0,o.Z)(r,35686,[m,8,"mat2x4"]),(0,o.Z)(r,35675,[m,12,"mat3"]),(0,o.Z)(r,35687,[m,12,"mat3x2"]),(0,o.Z)(r,35688,[m,12,"mat3x4"]),(0,o.Z)(r,35676,[m,16,"mat4"]),(0,o.Z)(r,35689,[m,16,"mat4x2"]),(0,o.Z)(r,35690,[m,16,"mat4x3"]),r);function x(t){switch(t){case h:return h;case f:case d:case p:return f;case A:case v:case g:return A;default:return(0,a.h)(!1),0}}function w(t){var e=b[t];if(!e)return null;var n=(0,i.Z)(e,2);return{type:n[0],components:n[1]}}function C(t,e){switch(t){case s:case u:case l:case c:t=m}for(var n in b){var r=(0,i.Z)(b[n],3),o=r[0],a=r[1],h=r[2];if(o===t&&a===e)return{glType:n,name:h}}return null}},55888:function(t,e,n){"use strict";n.d(e,{km:function(){return o},sF:function(){return i}});var r=n(81301);function i(t,e){if("string"!==typeof e)return e;var n=Number(e);if(!isNaN(n))return n;var i=t[e=e.replace(/^.*\./,"")];return(0,r.h)(void 0!==i,"Accessing undefined constant GL.".concat(e)),i}function o(t,e){for(var n in e=Number(e),t)if(t[n]===e)return"GL.".concat(n);return String(e)}},17507:function(t,e,n){"use strict";n.d(e,{h:function(){return b},Y:function(){return x}});var r=n(64649),i=n(58300),o=n(11092),a=n(27791),s=n(22951),u=n(91976),l=n(47169),c=n(67591),h=n(94337),f=n(2800
27),p=n(51055),d=[34069,34070,34071,34072,34073,34074],A=function(t,e){(0,c.Z)(r,t);var n=(0,h.Z)(r);function r(t){var e;(0,s.Z)(this,r);var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,f.JD)(t),(e=n.call(this,t,Object.assign({},i,{target:34067}))).initialize(i),Object.seal((0,l.Z)(e)),e}return(0,u.Z)(r,[{key:e,get:function(){return"TextureCube"}},{key:"initialize",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.mipmaps,r=void 0===n||n,i=e.parameters,o=void 0===i?{}:i;return this.opts=e,this.setCubeMapImageData(e).then((function(){t.loaded=!0,r&&t.generateMipmap(e),t.setParameters(o)})),this}},{key:"subImage",value:function(t){var e=t.face,n=t.data,r=t.x,i=void 0===r?0:r,o=t.y,a=void 0===o?0:o,s=t.mipmapLevel,u=void 0===s?0:s;return this._subImage({target:e,data:n,x:i,y:a,mipmapLevel:u})}},{key:"setCubeMapImageData",value:function(){var t=(0,a.Z)((0,o.Z)().mark((function t(e){var n,r,i,a,s,u,l,c,h,p,A,v,g,m=this;return(0,o.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.width,r=e.height,i=e.pixels,a=e.data,s=e.border,u=void 0===s?0:s,l=e.format,c=void 0===l?6408:l,h=e.type,p=void 0===h?5121:h,A=this.gl,v=i||a,t.next=5,Promise.all(d.map((function(t){var e=v[t];return Promise.all(Array.isArray(e)?e:[e])})));case 5:g=t.sent,this.bind(),d.forEach((function(t,e){g[e].length>1&&!1!==m.opts.mipmaps&&f.cM.warn("".concat(m.id," has mipmap and multiple LODs."))(),g[e].forEach((function(e,i){n&&r?A.texImage2D(t,i,c,n,r,u,c,p,e):A.texImage2D(t,i,c,c,p,e)}))})),this.unbind();case 9:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"setImageDataForFace",value:function(t){var e=this,n=t.face,r=t.width,i=t.height,o=t.pixels,a=t.data,s=t.border,u=void 0===s?0:s,l=t.format,c=void 0===l?6408:l,h=t.type,f=void 0===h?5121:h,p=this.gl,d=o||a;return this.bind(),d instanceof Promise?d.then((function(r){return e.setImageDataForFace(Object.assign({},t,{face:n,data:r,pixels:r}))})):this.width||this.height?p.texImage2D(n,0,c,r,i,u,c,f,d):p.texImage2D(n,0,c,c,f,d),this}}]),r}(p.Z,Symbol.toStringTag);A.FACES=d;var v=n(29094),g=n(33839),m=function(t,e){(0,c.Z)(r,t);var n=(0,h.Z)(r);function r(t){var e;(0,s.Z)(this,r);var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,f.KQ)(t),i=Object.assign({depth:1},i,{target:32879,unpackFlipY:!1}),(e=n.call(this,t,i)).initialize(i),Object.seal((0,l.Z)(e)),e}return(0,u.Z)(r,[{key:e,get:function(){return"Texture3D"}},{key:"setImageData",value:function(t){var e=this,n=t.level,r=void 0===n?0:n,i=t.dataFormat,o=void 0===i?6408:i,a=t.width,s=t.height,u=t.depth,l=void 0===u?1:u,c=t.border,h=void 0===c?0:c,p=t.format,d=t.type,A=void 0===d?5121:d,m=t.offset,y=void 0===m?0:m,_=t.data,b=t.parameters,x=void 0===b?{}:b;if(this._trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle),(0,f.s8)(this.gl,x,(function(){ArrayBuffer.isView(_)&&e.gl.texImage3D(e.target,r,o,a,s,l,h,p,A,_),_ instanceof g.Z&&(e.gl.bindBuffer(35052,_.handle),e.gl.texImage3D(e.target,r,o,a,s,l,h,p,A,y))})),_&&_.byteLength)this._trackAllocatedMemory(_.byteLength,"Texture");else{var w=v.C[this.dataFormat]||4,C=v.pH[this.type]||1;this._trackAllocatedMemory(this.width*this.height*this.depth*w*C,"Texture")}return this.loaded=!0,this}}],[{key:"isSupported",value:function(t){return(0,f.D0)(t)}}]),r}(p.Z,Symbol.toStringTag),y=n(79078),_=n(81301);function b(t,e){(0,_.h)(t instanceof i.Z||t instanceof A||t instanceof m);var n=t.constructor,r=t.gl,o=t.width,a=t.height,s=t.format,u=t.type,l=t.dataFormat,c=t.border,h=t.mipmaps;return new n(r,Object.assign({width:o,height:a,format:s,type:u,dataFormat:l,border:c,mipmaps:h},e))}function x(t,e){var n=t.gl,i=t.width,o=t.height,a=t.id;return new y.Z(n,Object.assign({},e,{id:"framebuffer-for-".concat(a),width:i,height:o,attachments:(0,r.Z)({},36064,t)}))}},75946:function(t,e,n){"use strict";n.d(e,{KS:function(){return s},O:function(){return i},c$:function(){return a},vN:function(){return o}});var r="Failed to deduce GL constant from typed array";function i(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(r)}}function o(t){var e=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).clamped,n=void 0===e||e;switch(t){case 5126:return Float32Array;case 5123:case 33635:case 32819:case 32820:return Uint16Array;case 5125:return Uint32Array;case 5121:return n?Uint8ClampedArray:Uint8Array;case 5120:return Int8Array;case 5122:return Int16Array;case 5124:return Int32Array;
2default:throw new Error("Failed to deduce typed array type from GL constant")}}function a(t){var e=t.data,n=t.width,r=t.height,i=t.bytesPerPixel,o=void 0===i?4:i,a=t.temp,s=n*o;a=a||new Uint8Array(s);for(var u=0;u<r/2;++u){var l=u*s,c=(r-u-1)*s;a.set(e.subarray(l,l+s)),e.copyWithin(l,c,c+s),e.set(a,c)}}function s(t){for(var e=t.data,n=t.width,r=t.height,i=Math.round(n/2),o=Math.round(r/2),a=new Uint8Array(i*o*4),s=0;s<o;s++)for(var u=0;u<i;u++)for(var l=0;l<4;l++)a[4*(s*i+u)+l]=e[4*(2*s*n+2*u)+l];return{data:a,width:i,height:o}}},30116:function(t){"use strict";t.exports=n,t.exports.default=n;var e=1e20;function n(t,e,n,r,i,o){this.fontSize=t||24,this.buffer=void 0===e?3:e,this.cutoff=r||.25,this.fontFamily=i||"sans-serif",this.fontWeight=o||"normal",this.radius=n||8;var a=this.size=this.fontSize+2*this.buffer,s=a+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=a,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textAlign="left",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(s*s),this.gridInner=new Float64Array(s*s),this.f=new Float64Array(s),this.z=new Float64Array(s+1),this.v=new Uint16Array(s),this.useMetrics=void 0!==this.ctx.measureText("A").actualBoundingBoxLeft,this.middle=Math.round(a/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function r(t,e,n,r,o,a){for(var s=0;s<e;s++)i(t,s,e,n,r,o,a);for(var u=0;u<n;u++)i(t,u*e,1,e,r,o,a)}function i(t,n,r,i,o,a,s){var u,l,c,h;for(a[0]=0,s[0]=-e,s[1]=e,u=0;u<i;u++)o[u]=t[n+u*r];for(u=1,l=0,c=0;u<i;u++){do{h=a[l],c=(o[u]-o[h]+u*u-h*h)/(u-h)/2}while(c<=s[l]&&--l>-1);a[++l]=u,s[l]=c,s[l+1]=e}for(u=0,l=0;u<i;u++){for(;s[l+1]<u;)l++;h=a[l],t[n+u*r]=o[h]+(u-h)*(u-h)}}n.prototype._draw=function(t,n){var i,o,a,s,u,l,c,h,f,p=this.ctx.measureText(t),d=p.width,A=2*this.buffer;n&&this.useMetrics?(u=Math.floor(p.actualBoundingBoxAscent),h=this.buffer+Math.ceil(p.actualBoundingBoxAscent),l=this.buffer,c=this.buffer,i=(o=Math.min(this.size,Math.ceil(p.actualBoundingBoxRight-p.actualBoundingBoxLeft)))+A,a=(s=Math.min(this.size-l,Math.ceil(p.actualBoundingBoxAscent+p.actualBoundingBoxDescent)))+A,this.ctx.textBaseline="alphabetic"):(i=o=this.size,a=s=this.size,u=19*this.fontSize/24,l=c=0,h=this.middle,this.ctx.textBaseline="middle"),o&&s&&(this.ctx.clearRect(c,l,o,s),this.ctx.fillText(t,this.buffer,h),f=this.ctx.getImageData(c,l,o,s));var v=new Uint8ClampedArray(i*a);return function(t,n,r,i,o,a,s){a.fill(e,0,n*r),s.fill(0,0,n*r);for(var u=(n-i)/2,l=0;l<o;l++)for(var c=0;c<i;c++){var h=(l+u)*n+c+u,f=t.data[4*(l*i+c)+3]/255;if(1===f)a[h]=0,s[h]=e;else if(0===f)a[h]=e,s[h]=0;else{var p=Math.max(0,.5-f),d=Math.max(0,f-.5);a[h]=p*p,s[h]=d*d}}}(f,i,a,o,s,this.gridOuter,this.gridInner),r(this.gridOuter,i,a,this.f,this.v,this.z),r(this.gridInner,i,a,this.f,this.v,this.z),function(t,e,n,r,i,o,a){for(var s=0;s<e*n;s++){var u=Math.sqrt(r[s])-Math.sqrt(i[s]);t[s]=Math.round(255-255*(u/o+a))}}(v,i,a,this.gridOuter,this.gridInner,this.radius,this.cutoff),{data:v,metrics:{width:o,height:s,sdfWidth:i,sdfHeight:a,top:u,left:0,advance:d}}},n.prototype.draw=function(t){return this._draw(t,!1).data},n.prototype.drawWithMetrics=function(t){return this._draw(t,!0)}},97833:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(22951),i=n(91976),o=n(67591),a=n(94337),s=n(47410);var u=function(t){(0,o.Z)(n,t);var e=(0,a.Z)(n);function n(){return(0,r.Z)(this,n),e.apply(this,arguments)}return(0,i.Z)(n,[{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"fromArray",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n<this.ELEMENTS;++n)this[n]=t[n+e];return this.check()}},{key:"toArray",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0;n<this.ELEMENTS;++n)t[e+n]=this[n];return t}},{key:"from",value:function(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}},{key:"to",value:function(t){return t===this?this:(0,s.kJ)(t)?this.toArray(t):this.toObject(t)}},{key:"toTarget",value:function(t){return t?this.to(t):this}},{key:"toFloat32Array",value:function(){return new Float32Array(this)}},{key:"toString",value:function(){return this.formatString(s.vc)}},{key:"formatString",value:function(t){for(var e="",n=0;n<this.ELEMENTS;++n)e+=(n>0?", ":"")+(0,s.Bw)(this[n],t);return"".concat(t.printTypes?this.constructor.name:"","[").concat(e,"]")}},{key:"equals",value:function(t){if(!t||this.length!==t.length)return!1;for(var e=0;e<this.ELEMENTS;++e)if(!(0,s.fS)(this[e],t[e]))return!1;return!0}},{key:"exactEquals",value:function(t){if(!t||this.length!==t.length)return!1;for(var e=0;e<this.ELEMENTS;++e)if(this[e]!==t[e])return!1;return!0}},{key:"negate",value:function(){for(var t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}},{key:"lerp",value:function(t,e,n){if(void 0===n)return this.lerp(this,t,e);for(var r=0;r<this.ELEMENTS;++r){var i=t[r];this[r]=i+n*(e[r]-i)}return this.check()}},{key:"min",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]=Math.min(t[e],this[e]);return this.check()}},{key:"max",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]=Math.max(t[e],this[e]);return this.check()}},{key:"clamp",value:function(t,e){for(var n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t[n]),e[n]);return this.check()}},{key:"add",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0,i=e;r<i.length;r++)for(var o=i[r],a=0;a<this.ELEMENTS;++a)this[a]+=o[a];return this.check()}},{key:"subtract",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0,i=e;r<i.length;r++)for(var o=i[r],a=0;a<this.ELEMENTS;++a)this[a]-=o[a];return this.check()}},{key:"scale",value:function(t){if("number"===typeof t)for(var e=0;e<this.ELEMENTS;++e)this[e]*=t;else for(var n=0;n<this.ELEMENTS&&n<t.length;++n)this[n]*=t[n];return this.check()}},{key:"multiplyByScalar",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}},{key:"check",value:function(){if(s.vc.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invali
2d numbers'"));return this}},{key:"validate",value:function(){for(var t=this.length===this.ELEMENTS,e=0;e<this.ELEMENTS;++e)t=t&&Number.isFinite(this[e]);return t}},{key:"sub",value:function(t){return this.subtract(t)}},{key:"setScalar",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]=t;return this.check()}},{key:"addScalar",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]+=t;return this.check()}},{key:"subScalar",value:function(t){return this.addScalar(-t)}},{key:"multiplyScalar",value:function(t){for(var e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}},{key:"divideScalar",value:function(t){return this.multiplyByScalar(1/t)}},{key:"clampScalar",value:function(t,e){for(var n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t),e);return this.check()}},{key:"elements",get:function(){return this}}]),n}(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))},53209:function(t,e,n){"use strict";n.d(e,{Z:function(){return c}});var r=n(22951),i=n(91976),o=n(67591),a=n(94337),s=n(97833),u=n(69801),l=n(47410),c=function(t){(0,o.Z)(n,t);var e=(0,a.Z)(n);function n(){return(0,r.Z)(this,n),e.apply(this,arguments)}return(0,i.Z)(n,[{key:"toString",value:function(){var t="[";if(l.vc.printRowMajor){t+="row-major:";for(var e=0;e<this.RANK;++e)for(var n=0;n<this.RANK;++n)t+=" ".concat(this[n*this.RANK+e])}else{t+="column-major:";for(var r=0;r<this.ELEMENTS;++r)t+=" ".concat(this[r])}return t+="]"}},{key:"getElementIndex",value:function(t,e){return e*this.RANK+t}},{key:"getElement",value:function(t,e){return this[e*this.RANK+t]}},{key:"setElement",value:function(t,e,n){return this[e*this.RANK+t]=(0,u.u5)(n),this}},{key:"getColumn",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Array(this.RANK).fill(-0),n=t*this.RANK,r=0;r<this.RANK;++r)e[r]=this[n+r];return e}},{key:"setColumn",value:function(t,e){for(var n=t*this.RANK,r=0;r<this.RANK;++r)this[n+r]=e[r];return this}}]),n}(s.Z)},95282:function(t,e,n){"use strict";n.d(e,{Z:function(){return c}});var r=n(22951),i=n(91976),o=n(67591),a=n(94337),s=n(97833),u=n(69801),l=n(45903),c=function(t){(0,o.Z)(n,t);var e=(0,a.Z)(n);function n(){return(0,r.Z)(this,n),e.apply(this,arguments)}return(0,i.Z)(n,[{key:"x",get:function(){return this[0]},set:function(t){this[0]=(0,u.u5)(t)}},{key:"y",get:function(){return this[1]},set:function(t){this[1]=(0,u.u5)(t)}},{key:"len",value:function(){return Math.sqrt(this.lengthSquared())}},{key:"magnitude",value:function(){return this.len()}},{key:"lengthSquared",value:function(){for(var t=0,e=0;e<this.ELEMENTS;++e)t+=this[e]*this[e];return t}},{key:"magnitudeSquared",value:function(){return this.lengthSquared()}},{key:"distance",value:function(t){return Math.sqrt(this.distanceSquared(t))}},{key:"distanceSquared",value:function(t){for(var e=0,n=0;n<this.ELEMENTS;++n){var r=this[n]-t[n];e+=r*r}return(0,u.u5)(e)}},{key:"dot",value:function(t){for(var e=0,n=0;n<this.ELEMENTS;++n)e+=this[n]*t[n];return(0,u.u5)(e)}},{key:"normalize",value:function(){var t=this.magnitude();if(0!==t)for(var e=0;e<this.ELEMENTS;++e)this[e]/=t;return this.check()}},{key:"multiply",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0,i=e;r<i.length;r++)for(var o=i[r],a=0;a<this.ELEMENTS;++a)this[a]*=o[a];return this.check()}},{key:"divide",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(var r=0,i=e;r<i.length;r++)for(var o=i[r],a=0;a<this.ELEMENTS;++a)this[a]/=o[a];return this.check()}},{key:"lengthSq",value:function(){return this.lengthSquared()}},{key:"distanceTo",value:function(t){return this.distance(t)}},{key:"distanceToSquared",value:function(t){return this.distanceSquared(t)}},{key:"getComponent",value:function(t){return(0,l.Z)(t>=0&&t<this.ELEMENTS,"index is out of range"),(0,u.u5)(this[t])}},{key:"setComponent",value:function(t,e){return(0,l.Z)(t>=0&&t<this.ELEMENTS,"index is out of range"),this[t]=e,this.check()}},{key:"addVectors",value:function(t,e){return this.copy(t).add(e)}},{key:"subVectors",value:function(t,e){return this.copy(t).subtract(e)}},{key:"multiplyVectors",value:function(t,e){return this.copy(t).multiply(e)}},{key:"addScaledVector",value:function(t,e){return this.add(new this.constructor(t).multiplyScalar(e))}}]),n}(s.Z)},12987:function(t,e,n){"use strict";n.d(e,{Z:function(){return y}});var r,i=n(22951),o=n(91976),a=n(67591),s=n(94337),u=n(53209),l=n(69801),c=n(63986),h=n(83367),f=n(77548),p=n(99007),d=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"}(r||(r={}));var A,v,g=45*Math.PI/180,m=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),y=function(t){(0,a.Z)(n,t);var e=(0,s.Z)(n);function n(t){var r;return(0,i.Z)(this,n),r=e.call(this,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(t)?r.copy(t):r.identity(),r}return(0,o.Z)(n,[{key:"ELEMENTS",get:function(){return 16}},{key:"RANK",get:function(){return 4}},{key:"INDICES",get:function(){return r}},{key:"copy",value:function(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5
2]=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()}},{key:"set",value:function(t,e,n,r,i,o,a,s,u,l,c,h,f,p,d,A){return this[0]=t,this[1]=e,this[2]=n,this[3]=r,this[4]=i,this[5]=o,this[6]=a,this[7]=s,this[8]=u,this[9]=l,this[10]=c,this[11]=h,this[12]=f,this[13]=p,this[14]=d,this[15]=A,this.check()}},{key:"setRowMajor",value:function(t,e,n,r,i,o,a,s,u,l,c,h,f,p,d,A){return this[0]=t,this[1]=i,this[2]=u,this[3]=f,this[4]=e,this[5]=o,this[6]=l,this[7]=p,this[8]=n,this[9]=a,this[10]=c,this[11]=d,this[12]=r,this[13]=s,this[14]=h,this[15]=A,this.check()}},{key:"toRowMajor",value:function(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}},{key:"identity",value:function(){return this.copy(m)}},{key:"fromObject",value:function(t){return this.check()}},{key:"fromQuaternion",value:function(t){return h.en(this,t),this.check()}},{key:"frustum",value:function(t){var e=t.left,n=t.right,r=t.bottom,i=t.top,o=t.near,a=void 0===o?.1:o,s=t.far,u=void 0===s?500:s;return u===1/0?function(t,e,n,r,i,o){var a=2*o/(n-e),s=2*o/(i-r),u=(n+e)/(n-e),l=(i+r)/(i-r),c=-1,h=-1,f=-2*o;t[0]=a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,t[6]=0,t[7]=0,t[8]=u,t[9]=l,t[10]=c,t[11]=h,t[12]=0,t[13]=0,t[14]=f,t[15]=0}(this,e,n,r,i,a):h.oy(this,e,n,r,i,a,u),this.check()}},{key:"lookAt",value:function(t){var e=t.eye,n=t.center,r=void 0===n?[0,0,0]:n,i=t.up,o=void 0===i?[0,1,0]:i;return h.zB(this,e,r,o),this.check()}},{key:"ortho",value:function(t){var e=t.left,n=t.right,r=t.bottom,i=t.top,o=t.near,a=void 0===o?.1:o,s=t.far,u=void 0===s?500:s;return h.M5(this,e,n,r,i,a,u),this.check()}},{key:"orthographic",value:function(t){var e=t.fovy,n=void 0===e?g:e,r=t.aspect,i=void 0===r?1:r,o=t.focalDistance,a=void 0===o?1:o,s=t.near,u=void 0===s?.1:s,l=t.far,c=void 0===l?500:l;x(n);var h=n/2,f=a*Math.tan(h),p=f*i;return this.ortho({left:-p,right:p,bottom:-f,top:f,near:u,far:c})}},{key:"perspective",value:function(t){var e=t.fovy,n=void 0===e?45*Math.PI/180:e,r=t.aspect,i=void 0===r?1:r,o=t.near,a=void 0===o?.1:o,s=t.far,u=void 0===s?500:s;return x(n),h.G3(this,n,i,a,u),this.check()}},{key:"determinant",value:function(){return h.GH(this)}},{key:"getScale",value:function(){var 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}},{key:"getTranslation",value:function(){var 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}},{key:"getRotation",value:function(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];var n=this.getScale(e),r=1/n[0],i=1/n[1],o=1/n[2];return t[0]=this[0]*r,t[1]=this[1]*i,t[2]=this[2]*o,t[3]=0,t[4]=this[4]*r,t[5]=this[5]*i,t[6]=this[6]*o,t[7]=0,t[8]=this[8]*r,t[9]=this[9]*i,t[10]=this[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}},{key:"getRotationMatrix3",value:function(t,e){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0],e=e||[-0,-0,-0];var n=this.getScale(e),r=1/n[0],i=1/n[1],o=1/n[2];return t[0]=this[0]*r,t[1]=this[1]*i,t[2]=this[2]*o,t[3]=this[4]*r,t[4]=this[5]*i,t[5]=this[6]*o,t[6]=this[8]*r,t[7]=this[9]*i,t[8]=this[10]*o,t}},{key:"transpose",value:function(){return h.p4(this,this),this.check()}},{key:"invert",value:function(){return h.U_(this,this),this.check()}},{key:"multiplyLeft",value:function(t){return h.Jp(this,t,this),this.check()}},{key:"multiplyRight",value:function(t){return h.Jp(this,this,t),this.check()}},{key:"rotateX",value:function(t){return h.lM(this,this,t),this.check()}},{key:"rotateY",value:function(t){return h.uD(this,this,t),this.check()}},{key:"rotateZ",value:function(t){return h.jI(this,this,t),this.check()}},{key:"rotateXYZ",value:function(t){return this.rotateX(t[0]).rotateY(t[1]).rotateZ(t[2])}},{key:"rotateAxis",value:function(t,e){return h.U1(this,this,t,e),this.check()}},{key:"scale",value:function(t){return h.bA(this,this,Array.isArray(t)?t:[t,t,t]),this.check()}},{key:"translate",value:function(t){return h.Iu(this,this,t),this.check()}},{key:"transform",value:function(t,e){return 4===t.length?(e=d.fF(e||[-0,-0,-0,-0],t,this),(0,l.IL)(e,4),e):this.transformAsPoint(t,e)}},{key:"transformAsPoint",value:function(t,e){var n;switch(t.length){case 2:n=f.fF(e||[-0,-0],t,this);break;case 3:n=p.fF(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return(0,l.IL)(n,t.length),n}},{key:"transformAsVector",value:function(t,e){var n;switch(t.length){case 2:n=(0,c.pb)(e||[-0,-0],t,this);break;case 3:n=(0,c.pL)(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return(0,l.IL)(n,t.length),n}},{key:"transformPoint",value:function(t,e){return this.transformAsPoint(t,e)}},{key:"transformVector",value:function(t,e){return this.transformAsPoint(t,e)}},{key:"transformDirection",value:function(t,e){return this.transformAsVector(t,e)}},{key:"makeRotationX",value:function(t){return this.identity().rotateX(t)}},{key:"makeTranslation",value:function(t,e,n){return this.identity().translate([t,e,n])}}],[{key:"IDENTITY",get:function(){return b()}},{key:"ZERO",get:function(){return _()}}]),n}(u.Z);function _(){return A||(A=new y([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(A)),A}function b(){return v||(v=new y,Object.freeze(v)),v}function x(t){if(t>2*Math.PI)throw Error("expected radians")}},34980:function(t,e,n){"use strict";n.d(e,{Z:function(){return P}});var r,i=n(22951),o=n(91976),a=n(67591),s=n(94337),u=n(97833),l=n(69801),c=n(95282),h=n(47410),f=n(99007),p=n(63986),d=function(t){(0,a.Z)(n,t);var e=(0,s.Z)(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;
2return(0,i.Z)(this,n),t=e.call(this,-0,-0,-0,-0),(0,h.kJ)(r)&&1===arguments.length?t.copy(r):(h.vc.debug&&((0,l.u5)(r),(0,l.u5)(o),(0,l.u5)(a),(0,l.u5)(s)),t[0]=r,t[1]=o,t[2]=a,t[3]=s),t}return(0,o.Z)(n,[{key:"set",value:function(t,e,n,r){return this[0]=t,this[1]=e,this[2]=n,this[3]=r,this.check()}},{key:"copy",value:function(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}},{key:"fromObject",value:function(t){return h.vc.debug&&((0,l.u5)(t.x),(0,l.u5)(t.y),(0,l.u5)(t.z),(0,l.u5)(t.w)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this[3]=t.w,this}},{key:"toObject",value:function(t){return t.x=this[0],t.y=this[1],t.z=this[2],t.w=this[3],t}},{key:"ELEMENTS",get:function(){return 4}},{key:"z",get:function(){return this[2]},set:function(t){this[2]=(0,l.u5)(t)}},{key:"w",get:function(){return this[3]},set:function(t){this[3]=(0,l.u5)(t)}},{key:"transform",value:function(t){return f.fF(this,this,t),this.check()}},{key:"transformByMatrix3",value:function(t){return(0,p._x)(this,this,t),this.check()}},{key:"transformByMatrix2",value:function(t){return(0,p.G7)(this,this,t),this.check()}},{key:"transformByQuaternion",value:function(t){return f.VC(this,this,t),this.check()}},{key:"applyMatrix4",value:function(t){return t.transform(this,this),this}}],[{key:"ZERO",get:function(){return r||(r=new n(0,0,0,0),Object.freeze(r)),r}}]),n}(c.Z),A=n(60285),v=n(24645),g=n(62220);function m(){var t=new A.WT(4);return A.WT!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function y(t,e,n){n*=.5;var r=Math.sin(n);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t}function _(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=n[0],u=n[1],l=n[2],c=n[3];return t[0]=r*c+a*s+i*l-o*u,t[1]=i*c+a*u+o*s-r*l,t[2]=o*c+a*l+r*u-i*s,t[3]=a*c-r*s-i*u-o*l,t}function b(t,e,n,r){var i,o,a,s,u,l=e[0],c=e[1],h=e[2],f=e[3],p=n[0],d=n[1],v=n[2],g=n[3];return(o=l*p+c*d+h*v+f*g)<0&&(o=-o,p=-p,d=-d,v=-v,g=-g),1-o>A.Ib?(i=Math.acos(o),a=Math.sin(i),s=Math.sin((1-r)*i)/a,u=Math.sin(r*i)/a):(s=1-r,u=r),t[0]=s*l+u*p,t[1]=s*c+u*d,t[2]=s*h+u*v,t[3]=s*f+u*g,t}function x(t,e){var n,r=e[0]+e[4]+e[8];if(r>0)n=Math.sqrt(r+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 i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var o=(i+1)%3,a=(i+2)%3;n=Math.sqrt(e[3*i+i]-e[3*o+o]-e[3*a+a]+1),t[i]=.5*n,n=.5/n,t[3]=(e[3*o+a]-e[3*a+o])*n,t[o]=(e[3*o+i]+e[3*i+o])*n,t[a]=(e[3*a+i]+e[3*i+a])*n}return t}g.d9,g.al,g.JG,g.t8;var w=g.IH,C=g.bA,B=g.AK,k=g.t7,E=g.kE,S=g.we,T=g.Fv,M=(g.I6,g.fS,function(){var t=f.Ue(),e=f.al(1,0,0),n=f.al(0,1,0);return function(r,i,o){var a=f.AK(i,o);return a<-.999999?(f.kC(t,e,i),f.Zh(t)<1e-6&&f.kC(t,n,i),f.Fv(t,t),y(r,t,Math.PI),r):a>.999999?(r[0]=0,r[1]=0,r[2]=0,r[3]=1,r):(f.kC(t,i,o),r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=1+a,T(r,r))}}()),I=(function(){var t=m(),e=m()}(),function(){var t=v.Ue()}(),[0,0,0,1]),P=function(t){(0,a.Z)(n,t);var e=(0,s.Z)(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return(0,i.Z)(this,n),t=e.call(this,-0,-0,-0,-0),Array.isArray(r)&&1===arguments.length?t.copy(r):t.set(r,o,a,s),t}return(0,o.Z)(n,[{key:"copy",value:function(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}},{key:"set",value:function(t,e,n,r){return this[0]=t,this[1]=e,this[2]=n,this[3]=r,this.check()}},{key:"fromObject",value:function(t){return this[0]=t.x,this[1]=t.y,this[2]=t.z,this[3]=t.w,this.check()}},{key:"fromMatrix3",value:function(t){return x(this,t),this.check()}},{key:"fromAxisRotation",value:function(t,e){return y(this,t,e),this.check()}},{key:"identity",value:function(){var t;return(t=this)[0]=0,t[1]=0,t[2]=0,t[3]=1,this.check()}},{key:"setAxisAngle",value:function(t,e){return this.fromAxisRotation(t,e)}},{key:"ELEMENTS",get:function(){return 4}},{key:"x",get:function(){return this[0]},set:function(t){this[0]=(0,l.u5)(t)}},{key:"y",get:function(){return this[1]},set:function(t){this[1]=(0,l.u5)(t)}},{key:"z",get:function(){return this[2]},set:function(t){this[2]=(0,l.u5)(t)}},{key:"w",get:function(){return this[3]},set:function(t){this[3]=(0,l.u5)(t)}},{key:"len",value:function(){return E(this)}},{key:"lengthSquared",value:function(){return S(this)}},{key:"dot",value:function(t){return B(this,t)}},{key:"rotationTo",value:function(t,e){return M(this,t,e),this.check()}},{key:"add",value:function(t){return w(this,this,t),this.check()}},{key:"calculateW",value:function(){return function(t,e){var n=e[0],r=e[1],i=e[2];t[0]=n,t[1]=r,t[2]=i,t[3]=Math.sqrt(Math.abs(1-n*n-r*r-i*i))}(this,this),this.check()}},{key:"conjugate",value:function(){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()}},{key:"invert",value:function(){return function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o,s=a?1/a:0;t[0]=-n*s,t[1]=-r*s,t[2]=-i*s,t[3]=o*s}(this,this),this.check()}},{key:"lerp",value:function(t,e,n){return void 0===n?this.lerp(this,t,e):(k(this,t,e,n),this.check())}},{key:"multiplyRight",value:function(t){return _(this,this,t),this.check()}},{key:"multiplyLeft",value:function(t){return _(this,t,this),this.check()}},{key:"normalize",value:function(){var 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()}},{key:"rotateX",value:function(t){return function(t,e,n){n*=.5;var r=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(n),u=Math.cos(n);t[0]=r*u+a*s,t[1]=i*u+o*s,t[2]=o*u-i*s,t[3]=a*u-r*s}(this,this,t),this.check()}},{key:"rotateY",value:function(t){return function(t,e,n){n*=.5;var r=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(n),u=Math.cos(n);t[0]=r*u-o*s,t[1]=i*u+a*s,t[2]=o*u+r*s,t[3]=a*u-i*s}(this,this,t),this.check()}},{key:"rotateZ",value:function(t){return function(t,e,n){n*=.5;var r=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(n),u=Math.cos(n);t[0]=r*u+i*s,t[1]=i*u-r*s,t[2]=o*u+a*s,t[3]=a*u-o*s}(this,this,t),this.check()}},{key:"scale",value:function(t){return C(this,this,t),this.check()}},{key:"slerp",value:function(t,e,n){var r,i,o;switch(arguments.length){case 1:var a=t.start;r=void 0===a?I:a,i=t.target,o=t.ratio;break;case 2:r=this,i=t,o=e;break;default:r=t,i=e,o=n}return b(this,r,i,o),this.check()}},{key:"transformVector4",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new d;return g.VC(e,t,this),(0,l.IL)(e,4)}},{key:"lengthSq",value:function(){return this.lengthSquared()}},{key:"setFromAxisAngle",value:function(t,e){return this.setAxisAngle(t,e)}},{key:"premultiply",value:function(t){return this.multiplyLeft(t)}},{key:"multiply",value:function(t){return this.multiplyRight(t)}}]),n}(u.Z)},431:function(t,e,n){"use strict";n.d(e,{Z:function(){return d}});var r,i=n(22951),o=n(91976),a=n(67591),s=n(94337),u=n(95282),l=n(47410),c=n(69801),h=n(99007),f=n(63986),p=[0,0,0],d=function(t){(0,a.Z)(n,t);var e=(0,s.Z)(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return(0,i.Z)(this,n),t=e.call(this,-0,-0,-0),1===arguments.length&&(0,l.kJ)(r)?t.copy(r):(l.vc.debug&&((0,c.u5)(r),(0,c.u5)(o),(0,c.u5)(a)),t[0]=r,t[1]=o,t[2]=a),t}return(0,o.Z)(n,[{key:"set",value:function(t,e,n){return this[0]=t,this[1]=e,this[2]=n,this.check()}},{key:"copy",value:function(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this.check()}},{key:"fromObject",value:function(t){return l.vc.debug&&((0,c.u5)(t.x),(0,c.u5)(t.y),(0,c.u5)(t.z)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this.check()}},{key:"toObject",value:function(t){return t.x=this[0],t.y=this[1],t.z=this[2],t}},{key:"ELEMENTS",get:function(){return 3}},{key:"z",get:function(){return this[2]},set:function(t){this[2]=(0,c.u5)(t)}},{key:"angle",value:function(t){return h.EU(this,t)}},{key:"cross",value:function(t){return h.kC(this,this,t),this.check()}},{key:"rotateX",value:function(t){var e=t.radians,n=t.origin,r=void 0===n?p:n;return h.lM(this,this,r,e),this.check()}},{key:"rotateY",value:function(t){var e=t.radians,n=t.origin,r=void 0===n?p:n;return h.uD(this,this,r,e),this.check()}},{key:"rotateZ",value:function(t){var e=t.radians,n=t.origin,r=void 0===n?p:n;return h.jI(this,this,r,e),this.check()}},{key:"transform",value:function(t){return this.transformAsPoint(t)}},{key:"transformAsPoint",value:function(t){return h.fF(this,this,t),this.check()}},{key:"transformAsVector",value:function(t){return(0,f.pL)(this,this,t),this.check()}},{key:"transformByMatrix3",value:function(t){return h.kK(this,this,t),this.check()}},{key:"transformByMatrix2",value:function(t){return(0,f.eQ)(this,this,t),this.check()}},{key:"transformByQuaternion",value:function(t){return h.VC(this,this,t),this.check()}}],[{key:"ZERO",get:function(){return r||(r=new n(0,0,0),Object.freeze(r)),r}}]),n}(u.Z)},45903:function(t,e,n){"use strict";function r(t,e){if(!t)throw new Error("math.gl assertion ".concat(e))}n.d(e,{Z:function(){return r}})},47410:function(t,e,n){"use strict";n.d(e,{Bw:function(){return a},RW:function(){return c},Ux:function(){return l},Yr:function(){return u},fS:function(){return p},kJ:function(){return s},t7:function(){return f},uZ:function(){return h},vc:function(){return o}});var r=1/Math.PI*180,i=1/180*Math.PI,o={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0};function a(t){var e=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).precision,n=void 0===e?o.precision:e;return t=function(t){return Math.round(t/o.EPSILON)*o.EPSILON}(t),"".concat(parseFloat(t.toPrecision(n)))}function s(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function u(t){return function(t,e){return d(t,(function(t){return t*i}),e)}(t)}function l(t){return c(t)}function c(t,e){return d(t,(function(t){return t*r}),e)}function h(t,e,n){return d(t,(function(t){return Math.max(e,Math.min(n,t))}))}function f(t,e,n){return s(t)?t.map((function(t,r){return f(t,e[r],n)})):n*e+(1-n)*t}function p(t,e,n){var r=o.EPSILON;n&&(o.EPSILON=n);try{if(t===e)return!0;
2if(s(t)&&s(e)){if(t.length!==e.length)return!1;for(var i=0;i<t.length;++i)if(!p(t[i],e[i]))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=r}}function d(t,e,n){if(s(t)){var r=t;n=n||function(t){return t.clone?t.clone():new Array(t.length)}(r);for(var i=0;i<n.length&&i<r.length;++i)n[i]=e(t[i],i,n);return n}return e(t)}},63986:function(t,e,n){"use strict";function r(t,e,n){var r=e[0],i=e[1],o=n[3]*r+n[7]*i||1;return t[0]=(n[0]*r+n[4]*i)/o,t[1]=(n[1]*r+n[5]*i)/o,t}function i(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o||1;return t[0]=(n[0]*r+n[4]*i+n[8]*o)/a,t[1]=(n[1]*r+n[5]*i+n[9]*o)/a,t[2]=(n[2]*r+n[6]*i+n[10]*o)/a,t}function o(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t[2]=e[2],t}function a(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t[2]=e[2],t[3]=e[3],t}function s(t,e,n){var r=e[0],i=e[1],o=e[2];return t[0]=n[0]*r+n[3]*i+n[6]*o,t[1]=n[1]*r+n[4]*i+n[7]*o,t[2]=n[2]*r+n[5]*i+n[8]*o,t[3]=e[3],t}n.d(e,{G7:function(){return a},_x:function(){return s},eQ:function(){return o},pL:function(){return i},pb:function(){return r}})},69801:function(t,e,n){"use strict";n.d(e,{IL:function(){return o},u5:function(){return i}});var r=n(47410);function i(t){if(!Number.isFinite(t))throw new Error("Invalid number ".concat(t));return t}function o(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(r.vc.debug&&!function(t,e){if(t.length!==e)return!1;for(var 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}},23595:function(t,e,n){"use strict";n.d(e,{wG:function(){return r},WZ:function(){return U},GU:function(){return Q},dj:function(){return O},ct:function(){return W},OT:function(){return a},ap:function(){return o},Ny:function(){return i}});var r={CLOCKWISE:1,COUNTER_CLOCKWISE:-1};function i(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Math.sign(o(t,e))}(t,n);return r!==e&&(function(t,e){for(var n=e.start,r=void 0===n?0:n,i=e.end,o=void 0===i?t.length:i,a=e.size,s=void 0===a?2:a,u=(o-r)/s,l=Math.floor(u/2),c=0;c<l;++c)for(var h=r+c*s,f=r+(u-1-c)*s,p=0;p<s;++p){var d=t[h+p];t[h+p]=t[f+p],t[f+p]=d}}(t,n),!0)}function o(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.start,r=void 0===n?0:n,i=e.end,o=void 0===i?t.length:i,a=e.size||2,s=0,u=r,l=o-a;u<o;u+=a)s+=(t[u]-t[l])*(t[u+1]+t[l+1]),l=u;return s/2}function a(t,e){var n,r,i,o,a,c,h,f=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2,p=arguments.length>3?arguments[3]:void 0,v=e&&e.length,g=v?e[0]*f:t.length,y=s(t,0,g,f,!0,p&&p[0]),_=[];if(!y||y.next===y.prev)return _;if(v&&(y=function(t,e,n,r,i){var o,a,l,c=[];for(o=0,a=e.length;o<a;o++)(l=s(t,e[o]*r,o<a-1?e[o+1]*r:t.length,r,!1,i&&i[o+1]))===l.next&&(l.steiner=!0),c.push(m(l));for(c.sort(d),o=0;o<c.length;o++)A(c[o],n),n=u(n,n.next);return n}(t,e,y,f,p)),t.length>80*f){o=r=t[0],a=i=t[1];for(var b=f;b<g;b+=f)(c=t[b])<o&&(o=c),(h=t[b+1])<a&&(a=h),c>r&&(r=c),h>i&&(i=h);n=0!==(n=Math.max(r-o,i-a))?1/n:0}return l(y,_,f,o,a,n),_}function s(t,e,n,r,i,a){var s,u;if(void 0===a&&(a=o(t,{start:e,end:n,size:r})),i===a<0)for(s=e;s<n;s+=r)u=S(s,t[s],t[s+1],u);else for(s=n-r;s>=e;s-=r)u=S(s,t[s],t[s+1],u);return u&&x(u,u.next)&&(T(u),u=u.next),u}function u(t,e){if(!t)return t;e||(e=t);var n,r=t;do{if(n=!1,r.steiner||!x(r,r.next)&&0!==b(r.prev,r,r.next))r=r.next;else{if(T(r),(r=e=r.prev)===r.next)break;n=!0}}while(n||r!==e);return e}function l(t,e,n,r,i,o,a){if(t){!a&&o&&function(t,e,n,r){var i=t;do{null===i.z&&(i.z=g(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,n,r,i,o,a,s,u,l=1;do{for(i=t,t=null,u=null,r=0;i;){for(r++,a=i,o=0,n=0;n<l&&(o++,a=a.nextZ);n++);for(s=l;o>0||s>0&&a;)0!==o&&(0===s||!a||i.z<=a.z)?(e=i,i=i.nextZ,o--):(e=a,a=a.nextZ,s--),u?u.nextZ=e
vendor: 1,861 bytes, line 2
2:t=e,e.prevZ=u,u=e;i=a}u.nextZ=null,l*=2}while(r>1)}(i)}(t,r,i,o);for(var s,d,A=t;t.prev!==t.next;)if(s=t.prev,d=t.next,o?h(t,r,i,o):c(t))e.push(s.i/n),e.push(t.i/n),e.push(d.i/n),T(t),t=d.next,A=d.next;else if((t=d)===A){a?1===a?l(t=f(u(t),e,n),e,n,r,i,o,2):2===a&&p(t,e,n,r,i,o):l(u(t),e,n,r,i,o,1);break}}}function c(t){var e=t.prev,n=t,r=t.next;if(b(e,n,r)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(y(e.x,e.y,n.x,n.y,r.x,r.y,i.x,i.y)&&b(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function h(t,e,n,r){var i=t.prev,o=t,a=t.next;if(b(i,o,a)>=0)return!1;for(var s=i.x<o.x?i.x<a.x?i.x:a.x:o.x<a.x?o.x:a.x,u=i.y<o.y?i.y<a.y?i.y:a.y:o.y<a.y?o.y:a.y,l=i.x>o.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,c=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,h=g(s,u,e,n,r),f=g(l,c,e,n,r),p=t.prevZ,d=t.nextZ;p&&p.z>=h&&d&&d.z<=f;){if(p!==t.prev&&p!==t.next&&y(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&b(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,d!==t.prev&&d!==t.next&&y(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&b(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(;p&&p.z>=h;){if(p!==t.prev&&p!==t.next&&y(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&b(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;d&&d.z<=f;){if(d!==t.prev&&d!==t.next&&y(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&b(d.prev,d,d.next)>=0)return!1;d=d.nextZ}return!0}function f(t,e,n){var r=t;do{var i=r.prev,o=r.next.next;!x(i,o)&&w(i,r,r.next,o)&&k(i,o)&&k(o,i)&&(e.push(i.i/n),e.push(r.i/n),e.push(o.i/n),T(r),T(r.next),r=t=o),r=r.next}while(r!==t);return u(r)}function p(t,e,n,r,i,o){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&_(a,s)){var c=E(a,s);return a=u(a,a.next),c=u(c,c.next),l(a,e,n,r,i,o),void l(c,e,n,r,i,o)}s=s.next}a=a.next}while(a!==t)}function d(t,e){return t.x-e.x}function A(t,e){if(e=function(t,e){var n,r=e,i=t.x,o=t.y,a=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var s=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y
2);if(s<=i&&s>a){if(a=s,s===i){if(o===r.y)return r;if(o===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==e);if(!n)return null;if(i===a)return n;var u,l=n,c=n.x,h=n.y,f=1/0;r=n;do{i>=r.x&&r.x>=c&&i!==r.x&&y(o<h?i:a,o,c,h,o<h?a:i,o,r.x,r.y)&&(u=Math.abs(o-r.y)/(i-r.x),k(r,t)&&(u<f||u===f&&(r.x>n.x||r.x===n.x&&v(n,r)))&&(n=r,f=u)),r=r.next}while(r!==l);return n}(t,e),e){var n=E(e,t);u(e,e.next),u(n,n.next)}}function v(t,e){return b(t.prev,t,e.prev)<0&&b(e.next,t,t.next)<0}function g(t,e,n,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function m(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 y(t,e,n,r,i,o,a,s){return(i-a)*(e-s)-(t-a)*(o-s)>=0&&(t-a)*(r-s)-(n-a)*(e-s)>=0&&(n-a)*(o-s)-(i-a)*(r-s)>=0}function _(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&&w(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(k(t,e)&&k(e,t)&&function(t,e){var n=t,r=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!==n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==t);return r}(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,r){var i=B(b(t,e,n)),o=B(b(t,e,r)),a=B(b(n,r,t)),s=B(b(n,r,e));return i!==o&&a!==s||(!(0!==i||!C(t,n,e))||(!(0!==o||!C(t,r,e))||(!(0!==a||!C(n,t,r))||!(0!==s||!C(n,e,r)))))}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 k(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 E(t,e){var n=new M(t.i,t.x,t.y),r=new M(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function S(t,e,n,r){var i=new M(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function T(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 M(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 I(t,e,n,r){var i,o,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];if(8&n)i=(r[3]-t[1])/(e[1]-t[1]),o=3;else if(4&n)i=(r[1]-t[1])/(e[1]-t[1]),o=1;else if(2&n)i=(r[2]-t[0])/(e[0]-t[0]),o=2;else{if(!(1&n))return null;i=(r[0]-t[0])/(e[0]-t[0]),o=0}for(var s=0;s<t.length;s++)a[s]=(1&o)===s?r[o]:i*(e[s]-t[s])+t[s];return a}function P(t,e){var 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 Z(t,e){var n=e.length,r=t.length;if(r>0){for(var i=!0,o=0;o<n;o++)if(t[r-n+o]!==e[o]){i=!1;break}if(i)return!1}for(var a=0;a<n;a++)t[r+a]=e[a];return!0}function D(t,e){for(var n=e.length,r=0;r<n;r++)t[r]=e[r]}function L(t,e,n,r){for(var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],o=r+e*n,a=0;a<n;a++)i[a]=t[o+a];return i}function O(t,e){var n,r,i=e||{},o=i.size,a=void 0===o?2:o,s=i.broken,u=void 0!==s&&s,l=i.gridResolution,c=void 0===l?10:l,h=i.gridOffset,f=void 0===h?[0,0]:h,p=i.startIndex,d=void 0===p?0:p,A=i.endIndex,v=((void 0===A?t.length:A)-d)/a,g=[],m=[g],y=L(t,0,a,d),_=G(y,c,f,[]),b=[];Z(g,y);for(var x=1;x<v;x++){for(r=P(n=L(t,x,a,d,n),_);r;){I(y,n,r,_,b);var w=P(b,_);w&&(I(y,b,w,_,b),r=w),Z(g,b),D(y,b),j(_,c,r),u&&g.length>a&&(g=[],m.push(g),Z(g,y)),r=P(n,_)}Z(g,n),D(y,n)}return u?m:m[0]}var F=0,R=1;function z(t,e){for(var n=0;n<e.length;n++)t.push(e[n]);return t}function U(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2?arguments[2]:void 0;if(!t.length)return[];for(var r=n||{},i=r.size,o=void 0===i?2:i,a=r.gridResolution,s=void 0===a?10:a,u=r.gridOffset,l=void 0===u?[0,0]:u,c=r.edgeTypes,h=void 0!==c&&c,f=[],p=[{pos:t,types:h?new Array(t.length/o).fill(R):null,holes:e||[]}],d=[[],[]],A=[];p.length;){var v=p.shift(),g=v.pos,m=v.types,y=v.holes;V(g,o,y[0]||g.length,d),A=G(d[0],s,l,A);var _=P(d[1],A);if(_){var b=N(g,m,o,0,y[0]||g.length,A,_),x={pos:b[0].pos,types:b[0].types,holes:[]},w={pos:b[1].pos,types:b[1].types,holes:[]};p.push(x,w);for(var C=0;C<y.length;C++)(b=N(g,m,o,y[C],y[C+1]||g.length,A,_))[0]&&(x.holes.push(x.pos.length),x.pos=z(x.pos,b[0].pos),h&&(x.types=z(x.types,b[0].types))),b[1]&&(w.holes.push(w.pos.length),w.pos=z(w.pos,b[1].pos),h&&(w.types=z(w.types,b[1].types)))}else{var B={positions:g};h&&(B.edgeTypes=m),y.length&&(B.holeIndices=y),f.push(B)}}return f}function N(t,e,n,r,i,o,a){for(var s,u,l,c=(i-r)/n,h=[],f=[],p=[],d=[],A=[],v=L(t,c-1,n,r),g=Math.sign(8&a?v[1]-o[3]:v[0]-o[2]),m=e&&e[c-1],y=0,_=0,b=0;b<c;
2b++)s=L(t,b,n,r,s),u=Math.sign(8&a?s[1]-o[3]:s[0]-o[2]),l=e&&e[r/n+b],u&&g&&g!==u&&(I(v,s,a,o,A),Z(h,A)&&p.push(m),Z(f,A)&&d.push(m)),u<=0?(Z(h,s)&&p.push(l),y-=u):p.length&&(p[p.length-1]=F),u>=0?(Z(f,s)&&d.push(l),_+=u):d.length&&(d[d.length-1]=F),D(v,s),g=u,m=l;return[y?{pos:h,types:e&&p}:null,_?{pos:f,types:e&&d}:null]}function G(t,e,n,r){var i=Math.floor((t[0]-n[0])/e)*e+n[0],o=Math.floor((t[1]-n[1])/e)*e+n[1];return r[0]=i,r[1]=o,r[2]=i+e,r[3]=o+e,r}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,r){for(var i=1/0,o=-1/0,a=1/0,s=-1/0,u=0;u<n;u+=e){var l=t[u],c=t[u+1];i=l<i?l:i,o=l>o?l:o,a=c<a?c:a,s=c>s?c:s}return r[0][0]=i,r[0][1]=a,r[1][0]=o,r[1][1]=s,r}var H=n(60726),J=85.051129;function W(t,e){var n=e||{},r=n.size,i=void 0===r?2:r,o=n.startIndex,a=void 0===o?0:o,s=n.endIndex,u=void 0===s?t.length:s,l=n.normalize,c=void 0===l||l,h=t.slice(a,u);X(h,i,0,u-a);var f=O(h,{size:i,broken:!0,gridResolution:360,gridOffset:[-180,-180]});if(c){var p,d=(0,H.Z)(f);try{for(d.s();!(p=d.n()).done;){Y(p.value,i)}}catch(A){d.e(A)}finally{d.f()}}return f}function Q(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2?arguments[2]:void 0,r=n||{},i=r.size,o=void 0===i?2:i,a=r.normalize,s=void 0===a||a,u=r.edgeTypes,l=void 0!==u&&u;e=e||[];for(var c=[],h=[],f=0,p=0,d=0;d<=e.length;d++){for(var A=e[d]||t.length,v=p,g=q(t,o,f,A),m=g;m<A;m++)c[p++]=t[m];for(var y=f;y<g;y++)c[p++]=t[y];X(c,o,v,p),K(c,o,v,p,null===n||void 0===n?void 0:n.maxLatitude),f=A,h[d]=p}h.pop();var _=U(c,h,{size:o,gridResolution:360,gridOffset:[-180,-180],edgeTypes:l});if(s){var b,x=(0,H.Z)(_);try{for(x.s();!(b=x.n()).done;){Y(b.value.positions,o)}}catch(w){x.e(w)}finally{x.f()}}return _}function q(t,e,n,r){for(var i=-1,o=-1,a=n+1;a<r;a+=e){var s=Math.abs(t[a]);s>i&&(i=s,o=a-1)}return o}function K(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:J,o=t[n],a=t[r-e];if(Math.abs(o-a)>180){var s=L(t,0,e,n);s[0]+=360*Math.round((a-o)/360),Z(t,s),s[1]=Math.sign(s[1])*i,Z(t,s),s[0]=o,Z(t,s)}}function X(t,e,n,r){for(var i,o=t[0],a=n;a<r;a+=e){var s=(i=t[a])-o;(s>180||s<-180)&&(i-=360*Math.round(s/360)),t[a]=o=i}}function Y(t,e){for(var n,r=t.length/e,i=0;i<r&&((n=t[i*e])+180)%360===0;i++);var o=360*-Math.round(n/360);if(0!==o)for(var a=0;a<r;a++)t[a*e]+=o}},75818:function(t,e,n){"use strict";n.d(e,{DW:function(){return G},eG:function(){return I},Lu:function(){return D},Xg:function(){return R},if:function(){return K},sj:function(){return L},zX:function(){return U},ro:function(){return M},up:function(){return X},Bf:function(){return T},wl:function(){return Z},lf:function(){return P},w5:function(){return E},QA:function(){return V},CT:function(){return F},es:function(){return S},aW:function(){return O}});var r=n(649),i=n(11026),o=n(22951),a=n(91976),s=n(64649),u=n(62220);function l(t,e){var n=(0,u.fF)([],e,t);return(0,u.bA)(n,n,1/n[3]),n}function c(t,e){var n=t%e;return n<0?e+n:n}function h(t,e,n){return t<e?e:t>n?n:t}var f=Math.log2||function(t){return Math.log(t)*Math.LOG2E},p=n(83367),d=n(77548),A=n(99007);function v(t,e){if(!t)throw new Error(e||"@math.gl/web-mercator: assertion failed.")}var g=Math.PI,m=g/4,y=g/180,_=180/g,b=512,x=4003e4,w=85.051129,C=1.5;function B(t){return Math.pow(2,t)}function k(t){return f(t)}function E(t){var e=(0,i.Z)(t,2),n=e[0],r=e[1];v(Number.isFinite(n)),v(Number.isFinite(r)&&r>=-90&&r<=90,"invalid latitude");var o=r*y;return[b*(n*y+g)/(2*g),b*(g+Math.log(Math.tan(m+.5*o)))/(2*g)]}function S(t){var e=(0,i.Z)(t,2),n=e[0],r=e[1],o=n/b*(2*g)-g,a=2*(Math.atan(Math.exp(r/b*(2*g)-g))-m);return[o*_,a*_]}function T(t){var e=t.latitude;v(Number.isFinite(e));var n=Math.cos(e*y);return k(x*n)-9}function M(t){var e=t.latitude,n=t.longitude,r=t.highPrecision,i=void 0!==r&&r;v(Number.isFinite(e)&&Number.isFinite(n));var o=b,a=Math.cos(e*y),s=o/360,u=s/a,l=o/x/a,c={unitsPerMeter:[l,l,l],metersPerUnit:[1/l,1/l,1/l],unitsPerDegree:[s,u,l],degreesPerUnit:[1/s,1/u,1/l]};if(i){var h=y*Math.tan(e*y)/a,f=s*h/2,p=o/x*h,d=p/u*l;c.unitsPerDegree2=[0,f,p],c.unitsPerMeter2=[d,0,d]}return c}function I(t,e){var n=(0,i.Z)(t,3),r=n[0],o=n[1],a=n[2],s=(0,i.Z)(e,3),u=s[0],l=s[1],c=s[2],h=M({longitude:r,latitude:o,highPrecision:!0}),f=h.unitsPerMeter,p=h.unitsPerMeter2,d=E(t);d[0]+=u*(f[0]+p[0]*l),d[1]+=l*(f[1]+p[1]*l);var A=S(d),v=(a||0)+(c||0);return Number.isFinite(a)||Number.isFinite(c)?[A[0],A[1],v]:A}function P(t){var e=t.height,n=t.pitch,r=t.bearing,i=t.altitude,o=t.scale,a=t.center,s=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];p.Iu(s,s,[0,0,-i]),p.lM(s,s,-n*y),p.jI(s,s,r*y);var u=o/e;return p.bA(s,s,[u,u,u]),a&&p.Iu(s,s,A.tk([],a)),s}function Z(t){var e=t.width,n=t.height,r=t.altitude,i=t.pitch,o=void 0===i?0:i,a=t.offset,s=t.center,u=t.scale,l=t.nearZMultiplier,c=void 0===l?1:l,f=t.farZMultiplier,p=void 0===f?1:f,d=t.fovy,A=void 0===d?D(C):d;void 0!==r&&(A=D(r));var v=A*y,g=o*y,m=L(A),_=m;s&&(_+=s[2]*u/Math.cos(g)/n);var b=v*(.5+(a?a[1]:0)/n),x=Math.sin(b)*_/Math.sin(h(Math.PI/2-g-b,.01,Math.PI-.01)),w=Math.sin(g)*x+_,B=10*_;return{fov:v,aspect:e/n,focalDistance:m,near:c,far:Math.min(w*p,B)}}function D(t){return 2*Math.atan(.5/t)*_}function L(t){return.5/Math.tan(.5*t*y)}function O(t,e){var n=(0,i.Z)(t,3),r=n[0],o=n[1],a=n[2],s=void 0===a?0:a;return v(Number.isFinite(r)&&Number.isFinite(o)&&Number.isFinite(s)),l(e,[r,o,s,1])}function F(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=(0,i.Z)(t,3),o=r[0],a=r[1],s=r[2];if(v(Number.isFinite(o)&&Number.isFinite(a),"invalid pixel coordinate"),Number.isFinite(s))return l(e,[o,a,s,1]);var u=l(e,[o,a,0,1]),c=l(e,[o,a,1,1]),h=u[2],f=c[2],p=h===f?0:((n||0)-h)/(f-h);return d.t7([],u,c,p)}
2function R(t){var e=t.width,n=t.height,r=t.bounds,o=t.minExtent,a=void 0===o?0:o,s=t.maxZoom,u=void 0===s?24:s,l=t.offset,c=void 0===l?[0,0]:l,p=(0,i.Z)(r,2),d=(0,i.Z)(p[0],2),A=d[0],g=d[1],m=(0,i.Z)(p[1],2),y=m[0],_=m[1],b=function(){var 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 v(Number.isFinite(t.top)&&Number.isFinite(t.bottom)&&Number.isFinite(t.left)&&Number.isFinite(t.right)),t}(t.padding),x=E([A,h(_,-w,w)]),C=E([y,h(g,-w,w)]),B=[Math.max(Math.abs(C[0]-x[0]),a),Math.max(Math.abs(C[1]-x[1]),a)],k=[e-b.left-b.right-2*Math.abs(c[0]),n-b.top-b.bottom-2*Math.abs(c[1])];v(k[0]>0&&k[1]>0);var T=k[0]/B[0],M=k[1]/B[1],I=(b.right-b.left)/2/T,P=(b.top-b.bottom)/2/M,Z=S([(C[0]+x[0])/2+I,(C[1]+x[1])/2+P]),D=Math.min(u,f(Math.abs(Math.min(T,M))));return v(Number.isFinite(D)),{longitude:Z[0],latitude:Z[1],zoom:D}}var z=Math.PI/180;function U(t){var e,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=t.width,o=t.height,a=t.unproject,s={targetZ:r},u=a([0,o],s),l=a([i,o],s);return(t.fovy?.5*t.fovy*z:Math.atan(.5/t.altitude))>(90-t.pitch)*z-.01?(e=N(t,0,r),n=N(t,i,r)):(e=a([0,0],s),n=a([i,0],s)),[u,l,n,e]}function N(t,e,n){var r=t.pixelUnprojectionMatrix,i=l(r,[e,0,1,1]),o=l(r,[e,t.height,1,1]),a=(n*t.distanceScales.unitsPerMeter[2]-i[2])/(o[2]-i[2]),s=S(d.t7([],i,o,a));return s.push(n),s}var G=function(){function t(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{width:1,height:1};(0,o.Z)(this,t),(0,s.Z)(this,"latitude",void 0),(0,s.Z)(this,"longitude",void 0),(0,s.Z)(this,"zoom",void 0),(0,s.Z)(this,"pitch",void 0),(0,s.Z)(this,"bearing",void 0),(0,s.Z)(this,"altitude",void 0),(0,s.Z)(this,"fovy",void 0),(0,s.Z)(this,"meterOffset",void 0),(0,s.Z)(this,"center",void 0),(0,s.Z)(this,"width",void 0),(0,s.Z)(this,"height",void 0),(0,s.Z)(this,"scale",void 0),(0,s.Z)(this,"distanceScales",void 0),(0,s.Z)(this,"viewMatrix",void 0),(0,s.Z)(this,"projectionMatrix",void 0),(0,s.Z)(this,"viewProjectionMatrix",void 0),(0,s.Z)(this,"pixelProjectionMatrix",void 0),(0,s.Z)(this,"pixelUnprojectionMatrix",void 0),(0,s.Z)(this,"equals",(function(n){return n instanceof t&&(n.width===e.width&&n.height===e.height&&p.fS(n.projectionMatrix,e.projectionMatrix)&&p.fS(n.viewMatrix,e.viewMatrix))})),(0,s.Z)(this,"project",(function(t){var n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).topLeft,r=void 0===n||n,o=O(e.projectPosition(t),e.pixelProjectionMatrix),a=(0,i.Z)(o,2),s=a[0],u=a[1],l=r?u:e.height-u;return 2===t.length?[s,l]:[s,l,o[2]]})),(0,s.Z)(this,"unproject",(function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.topLeft,o=void 0===r||r,a=n.targetZ,s=void 0===a?void 0:a,u=(0,i.Z)(t,3),l=u[0],c=u[1],h=u[2],f=o?c:e.he
2ight-c,p=s&&s*e.distanceScales.unitsPerMeter[2],d=F([l,f,h],e.pixelUnprojectionMatrix,p),A=e.unprojectPosition(d),v=(0,i.Z)(A,3),g=v[0],m=v[1],y=v[2];return Number.isFinite(h)?[g,m,y]:Number.isFinite(s)?[g,m,s]:[g,m]})),(0,s.Z)(this,"projectPosition",(function(t){var n=E(t),r=(0,i.Z)(n,2);return[r[0],r[1],(t[2]||0)*e.distanceScales.unitsPerMeter[2]]})),(0,s.Z)(this,"unprojectPosition",(function(t){var n=S(t),r=(0,i.Z)(n,2);return[r[0],r[1],(t[2]||0)*e.distanceScales.metersPerUnit[2]]}));var r=n.width,a=n.height,u=n.altitude,l=void 0===u?null:u,c=n.fovy,h=void 0===c?null:c,f=n.latitude,d=void 0===f?0:f,v=n.longitude,g=void 0===v?0:v,m=n.zoom,y=void 0===m?0:m,_=n.pitch,b=void 0===_?0:_,x=n.bearing,w=void 0===x?0:x,k=n.position,T=void 0===k?null:k,I=n.nearZMultiplier,R=void 0===I?.02:I,z=n.farZMultiplier,U=void 0===z?1.01:z;r=r||1,a=a||1,null===h&&null===l?h=D(l=C):null===h?h=D(l):null===l&&(l=L(h));var N=B(y);l=Math.max(.75,l);var G=M({longitude:g,latitude:d}),j=E([g,d]);j.push(0),T&&A.IH(j,j,A.dC([],T,G.unitsPerMeter)),this.projectionMatrix=function(t){var e=Z(t),n=e.fov,r=e.aspect,i=e.near,o=e.far;return p.G3([],n,r,i,o)}({width:r,height:a,scale:N,center:j,pitch:b,fovy:h,nearZMultiplier:R,farZMultiplier:U}),this.viewMatrix=P({height:a,scale:N,center:j,pitch:b,bearing:w,altitude:l}),this.width=r,this.height=a,this.scale=N,this.latitude=d,this.longitude=g,this.zoom=y,this.pitch=b,this.bearing=w,this.altitude=l,this.fovy=h,this.center=j,this.meterOffset=T||[0,0,0],this.distanceScales=G,this._initMatrices(),Object.freeze(this)}return(0,a.Z)(t,[{key:"_initMatrices",value:function(){var t=this.width,e=this.height,n=this.projectionMatrix,r=this.viewMatrix,i=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];p.Jp(i,i,n),p.Jp(i,i,r),this.viewProjectionMatrix=i;var o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];p.bA(o,o,[t/2,-e/2,1]),p.Iu(o,o,[1,-1,0]),p.Jp(o,o,i);var a=p.U_([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],o);if(!a)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=o,this.pixelUnprojectionMatrix=a}},{key:"projectFlat",value:function(t){return E(t)}},{key:"unprojectFlat",value:function(t){return S(t)}},{key:"getMapCenterByLngLatPosition",value:function(t){var e=t.lngLat,n=F(t.pos,this.pixelUnprojectionMatrix),r=E(e),i=d.IH([],r,d.tk([],n));return S(d.IH([],this.center,i))}},{key:"fitBounds",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.width,i=this.height,o=R(Object.assign({width:r,height:i,bounds:e},n));return new t({width:r,height:i,longitude:o.longitude,latitude:o.latitude,zoom:o.zoom})}},{key:"getBounds",value:function(t){var e=this.getBoundingRegion(t),n=Math.min.apply(Math,(0,r.Z)(e.map((function(t){return t[0]})))),i=Math.max.apply(Math,(0,r.Z)(e.map((function(t){return t[0]}))));return[[n,Math.min.apply(Math,(0,r.Z)(e.map((function(t){return t[1]}))))],[i,Math.max.apply(Math,(0,r.Z)(e.map((function(t){return t[1]}))))]]}},{key:"getBoundingRegion",value:function(){return U(this,(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).z||0)}},{key:"getLocationAtPoint",value:function(t){var e=t.lngLat,n=t.pos;return this.getMapCenterByLngLatPosition({lngLat:e,pos:n})}}]),t}(),j=512;function V(t){var e=t.width,n=t.height,r=t.pitch,i=void 0===r?0:r,o=t.longitude,a=t.latitude,s=t.zoom,u=t.bearing,l=void 0===u?0:u;(o<-180||o>180)&&(o=c(o+180,360)-180),(l<-180||l>180)&&(l=c(l+180,360)-180);var h=f(n/j);if(s<=h)s=h,a=0;else{var p=n/2/Math.pow(2,s),d=S([0,p])[1];if(a<d)a=d;else{var A=S([0,j-p])[1];a>A&&(a=A)}}return{width:e,height:n,longitude:o,latitude:a,zoom:s,pitch:i,bearing:l}}var H=n(50189),J=n(60726),W=.01,Q=["longitude","latitude","zoom"],q={curve:1.414,speed:1.2};function K(t,e,n,r){var i,o=Y(t,e,r),a=o.startZoom,s=o.startCenterXY,u=o.uDelta,l=o.w0,c=o.u1,h=o.S,f=o.rho,p=o.rho2,A=o.r0;if(c<W){var v,g={},m=(0,J.Z)(Q);try{for(m.s();!(v=m.n()).done;){var y=v.value,_=t[y],b=e[y];g[y]=(i=n)*b+(1-i)*_}}catch(M){m.e(M)}finally{m.f()}return g}var x=n*h,w=Math.cosh(A)/Math.cosh(A+f*x),C=l*((Math.cosh(A)*Math.tanh(A+f*x)-Math.sinh(A))/p)/c,B=a+k(1/w),E=d.bA([],u,C);d.IH(E,E,s);var T=S(E);return{longitude:T[0],latitude:T[1],zoom:B}}function X(t,e,n){var r,i=(0,H.Z)((0,H.Z)({},q),n),o=i.screenSpeed,a=i.speed,s=i.maxDuration,u=Y(t,e,i),l=u.S,c=u.rho,h=1e3*l;return r=Number.isFinite(o)?h/(o/c):h/a,Number.isFinite(s)&&r>s?0:r}function Y(t,e,n){var r=(n=Object.assign({},q,n)).curve,i=t.zoom,o=[t.longitude,t.latitude],a=B(i),s=e.zoom,u=[e.longitude,e.latitude],l=B(s-i),c=E(o),h=E(u),f=d.lu([],h,c),p=Math.max(t.width,t.height),A=p/l,v=d.kE(f)*a,g=Math.max(v,W),m=r*r,y=(A*A-p*p+m*m*g*g)/(2*p*m*g),_=(A*A-p*p-m*m*g*g)/(2*A*m*g),b=Math.log(Math.sqrt(y*y+1)-y),x=Math.log(Math.sqrt(_*_+1)-_);return{startZoom:i,startCenterXY:c,uDelta:f,w0:p,u1:v,S:(x-b)/r,rho:r,rho2:m,r0:b,r1:x}}},93594:function(t,e,n){"use strict";n.d(e,{Z:function(){return a}});var r=n(11515),i=n(33568),o=globalThis;function a(t){if(!t&&!(0,r.Z)())return"Node";if((0,i.Z)(t))return"Electron";var e="undefined"!==typeof navigator?navigator:{},n=t||e.userAgent||"";if(n.indexOf("Edge")>-1)return"Edge";var a=-1!==n.indexOf("MSIE "),s=-1!==n.indexOf("Trident/");return a||s?"IE":o.chrome?"Chrome":o.safari?"Safari":o.mozInnerScreenX?"Firefox":"Unknown"}},11515:function(t,e,n){"use strict";n.d(e,{Z:function(){return i}});var r=n(33568);function i(){return!("object"===typeof process&&"[object process]"===String(process)&&
2!process.browser)||(0,r.Z)()}},33568:function(t,e,n){"use strict";function r(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;var e="object"===typeof navigator&&"string"===typeof navigator.userAgent&&navigator.userAgent,n=t||e;return!!(n&&n.indexOf("Electron")>=0)}n.d(e,{Z:function(){return r}})},87294:function(t,e,n){"use strict";n.d(e,{Z:function(){return C}});var r=n(649),i=n(64649),o=n(22951),a=n(91976),s=n(11515),u="undefined"!==typeof __VERSION__?__VERSION__:"untranspiled source";(0,s.Z)();var l,c=function(){function t(e,n){(0,o.Z)(this,t);var r=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{var e=window[t],n="__storage_test__";return e.setItem(n,n),e.removeItem(n),e}catch(r){return null}}(r),this.id=e,this.config=n,this._loadConfiguration()}return(0,a.Z)(t,[{key:"getConfiguration",value:function(){return this.config}},{key:"setConfiguration",value:function(t){if(Object.assign(this.config,t),this.storage){var e=JSON.stringify(this.config);this.storage.setItem(this.id,e)}}},{key:"_loadConfiguration",value:function(){var t={};if(this.storage){var e=this.storage.getItem(this.id);t=e?JSON.parse(e):{}}return Object.assign(this.config,t),this}}]),t}();function h(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:600,i=t.src.replace(/\(/g,"%28").replace(/\)/g,"%29");t.width>r&&(n=Math.min(n,r/t.width));var o=t.width*n,a=t.height*n,s=["font-size:1px;","padding:".concat(Math.floor(a/2),"px ").concat(Math.floor(o/2),"px;"),"line-height:".concat(a,"px;"),"background:url(".concat(i,");"),"background-size:".concat(o,"px ").concat(a,"px;"),"color:transparent;"].join("");return["".concat(e," %c+"),s]}function f(t){return"string"===typeof t?l[t.toUpperCase()]||l.WHITE:t}!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={}));var p=n(60726);function d(t,e){if(!t)throw new Error(e||"Assertion failed")}var A={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},v=(globalThis,A.window||A.self||A.global),g=A.process||{};console;function m(){var t,e,n;if(s.Z&&"performance"in v)t=null===v||void 0===v||null===(e=v.performance)||void 0===e||null===(n=e.now)||void 0===n?void 0:n.call(e);else if("hrtime"in g){var r,i=null===g||void 0===g||null===(r=g.hrtime)||void 0===r?void 0:r.call(g);t=1e3*i[0]+i[1]/1e6}else t=Date.now();return t}var y={debug:s.Z&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},_={enabled:!0,level:0};function b(){}var x={},w={once:!0},C=function(){function t(){(0,o.Z)(this,t);var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:""}).id;(0,i.Z)(this,"id",void 0),(0,i.Z)(this,"VERSION",u),(0,i.Z)(this,"_startTs",m()),(0,i.Z)(this,"_deltaTs",m()),(0,i.Z)(this,"_storage",void 0),(0,i.Z)(this,"userData",{}),(0,i.Z)(this,"LOG_THROTTLE_TIMEOUT",0),this.id=e,this.userData={},this._storage=new c("__probe-".concat(this.id,"__"),_),this.timeStamp("".concat(this.id," started")),function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["constructor"],r=Object.getPrototypeOf(t),i=Object.getOwnPropertyNames(r),o=(0,p.Z)(i);try{var a=function(){var r=e.value;"function"===typeof t[r]&&(n.find((function(t){return r===t}))||(t[r]=t[r].bind(t)))};for(o.s();!(e=o.n()).done;)a()}catch(s){o.e(s)}finally{o.f()}}
2(this),Object.seal(this)}return(0,a.Z)(t,[{key:"level",get:function(){return this.getLevel()},set:function(t){this.setLevel(t)}},{key:"isEnabled",value:function(){return this._storage.config.enabled}},{key:"getLevel",value:function(){return this._storage.config.level}},{key:"getTotal",value:function(){return Number((m()-this._startTs).toPrecision(10))}},{key:"getDelta",value:function(){return Number((m()-this._deltaTs).toPrecision(10))}},{key:"priority",get:function(){return this.level},set:function(t){this.level=t}},{key:"getPriority",value:function(){return this.level}},{key:"enable",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._storage.setConfiguration({enabled:t}),this}},{key:"setLevel",value:function(t){return this._storage.setConfiguration({level:t}),this}},{key:"get",value:function(t){return this._storage.config[t]}},{key:"set",value:function(t,e){this._storage.setConfiguration((0,i.Z)({},t,e))}},{key:"settings",value:function(){console.table?console.table(this._storage.config):console.log(this._storage.config)}},{key:"assert",value:function(t,e){d(t,e)}},{key:"warn",value:function(t){return this._getLogFunction(0,t,y.warn,arguments,w)}},{key:"error",value:function(t){return this._getLogFunction(0,t,y.error,arguments)}},{key:"deprecated",value:function(t,e){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(e,"` instead"))}},{key:"removed",value:function(t,e){return this.error("`".concat(t,"` has been removed. Use `").concat(e,"` instead"))}},{key:"probe",value:function(t,e){return this._getLogFunction(t,e,y.log,arguments,{time:!0,once:!0})}},{key:"log",value:function(t,e){return this._getLogFunction(t,e,y.debug,arguments)}},{key:"info",value:function(t,e){return this._getLogFunction(t,e,console.info,arguments)}},{key:"once",value:function(t,e){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return this._getLogFunction(t,e,y.debug||y.info,arguments,w)}},{key:"table",value:function(t,e,n){return e?this._getLogFunction(t,e,console.table||b,n&&[n],{tag:E(e)}):b}},{key:"image",value:function(t){var e=t.logLevel,n=t.priority,i=t.image,o=t.message,a=void 0===o?"":o,u=t.scale,l=void 0===u?1:u;return this._shouldLog(e||n)?s.Z?function(t){var e=t.image,n=t.message,i=void 0===n?"":n,o=t.scale,a=void 0===o?1:o;if("string"===typeof e){var s=new Image;return s.onload=function(){var t,e=h(s,i,a);(t=console).log.apply(t,(0,r.Z)(e))},s.src=e,b}var u=e.nodeName||"";if("img"===u.toLowerCase()){var l;return(l=console).log.apply(l,(0,r.Z)(h(e,i,a))),b}if("canvas"===u.toLowerCase()){var c=new Image;return c.onload=function(){var t;return(t=console).log.apply(t,(0,r.Z)(h(c,i,a)))},c.src=e.toDataURL(),b}return b}({image:i,message:a,scale:l}):function(t){t.image,t.message,t.scale;return console.warn("removed"),b}({image:i,message:a,scale:l}):b}},{key:"time",value:function(t,e){return this._getLogFunction(t,e,console.time?console.time:console.info)}},{key:"timeEnd",value:function(t,e){return this._getLogFunction(t,e,console.timeEnd?console.timeEnd:console.info)}},{key:"timeStamp",value:function(t,e){return this._getLogFunction(t,e,console.timeStamp||b)}},{key:"group",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{collapsed:!1},r=k({logLevel:t,message:e,opts:n}),i=n.collapsed;return r.method=(i?console.groupCollapsed:console.group)||console.info,this._getLogFunction(r)}},{key:"groupCollapsed",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.group(t,e,Object.assign({},n,{collapsed:!0}))}},{key:"groupEnd",value:function(t){return this._getLogFunction(t,"",console.groupEnd||b)}},{key:"withGroup",value:function(t,e,n){this.group(t,e)();try{n()}finally{this.groupEnd(t)()}}},{key:"trace",value:function(){console.trace&&console.trace()}},{key:"_shouldLog",value:function(t){return this.isEnabled()&&this.getLevel()>=B(t)}},{key:"_getLogFunction",value:function(t,e,n,i,o){if(this._shouldLog(t)){var a;o=k({logLevel:t,message:e,args:i,opts:o}),d(n=n||o.method),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=m();var u=o.tag||o.message;if(o.once){if(x[u])return b;x[u]=m()}return e=function(t,e,n){if("string"===typeof e){var r=n.time?function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,n=Math.max(e-t.length,0);return"".concat(" ".repeat(n)).concat(t)}((u=n.total)<10?"".concat(u.toFixed(2),"ms"):u<100?"".concat(u.toFixed(1),"ms"):u<1e3?"".concat(u.toFixed(0),"ms"):"".concat((u/1e3).toFixed(2),"s")):"";e=n.time?"".concat(t,": ").concat(r,"  ").concat(e):"".concat(t,": ").concat(e),i=e,o=n.color,a=n.background,s.Z||"string"!==typeof i||(o&&(o=f(o),i="\x1b[".concat(o,"m").concat(i,"\x1b[39m")),a&&(o=f(a),i="\x1b[".concat(a+10,"m").concat(i,"\x1b[49m"))),e=i}var i,o,a;var u;return e}(this.id,o.message,o),(a=n).bind.apply(a,[console,e].concat((0,r.Z)(o.args)))}return b}}]),t}();function B(t){if(!t)return 0;var e;switch(typeof t){case"number":e=t;break;case"object":e=t.logLevel||t.priority||0;break;default:return 0}return d(Number.isFinite(e)&&e>=0),e}function k(t){var e=t.logLevel,n=t.message;t.logLevel=B(e);for(var r=t.args?Array.from(t.args):[];r.length&&r.shift()!==n;);switch(typeof e){case"string":case"function":void 0!==n&&r.unshift(n),t.message=e;break;case"object":Object.assign(t,e)}"function"===typeof t.message&&(t.message=t.message());var i=typeof t.message;
2return d("string"===i||"object"===i),Object.assign(t,{args:r},t.opts)}function E(t){for(var e in t)for(var n in t[e])return n||"untitled";return"empty"}(0,i.Z)(C,"VERSION",u)},92138:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(22951),i=n(91976),o=n(64649);function a(){var t;if("undefined"!==typeof window&&window.performance)t=window.performance.now();else if("undefined"!==typeof process&&process.hrtime){var e=process.hrtime();t=1e3*e[0]+e[1]/1e6}else t=Date.now();return t}var s=function(){function t(e,n){(0,r.Z)(this,t),(0,o.Z)(this,"name",void 0),(0,o.Z)(this,"type",void 0),(0,o.Z)(this,"sampleSize",1),(0,o.Z)(this,"time",void 0),(0,o.Z)(this,"count",void 0),(0,o.Z)(this,"samples",void 0),(0,o.Z)(this,"lastTiming",void 0),(0,o.Z)(this,"lastSampleTime",void 0),(0,o.Z)(this,"lastSampleCount",void 0),(0,o.Z)(this,"_count",0),(0,o.Z)(this,"_time",0),(0,o.Z)(this,"_samples",0),(0,o.Z)(this,"_startTime",0),(0,o.Z)(this,"_timerPending",!1),this.name=e,this.type=n,this.reset()}return(0,i.Z)(t,[{key:"setSampleSize",value:function(t){return this.sampleSize=t,this}},{key:"incrementCount",value:function(){return this.addCount(1),this}},{key:"decrementCount",value:function(){return this.subtractCount(1),this}},{key:"addCount",value:function(t){return this._count+=t,this._samples++,this._checkSampling(),this}},{key:"subtractCount",value:function(t){return this._count-=t,this._samples++,this._checkSampling(),this}},{key:"addTime",value:function(t){return this._time+=t,this.lastTiming=t,this._samples++,this._checkSampling(),this}},{key:"timeStart",value:function(){return this._startTime=a(),this._timerPending=!0,this}},{key:"timeEnd",value:function(){return this._timerPending?(this.addTime(a()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}},{key:"getSampleAverageCount",value:function(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}},{key:"getSampleAverageTime",value:function(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}},{key:"getSampleHz",value:function(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}},{key:"getAverageCount",value:function(){return this.samples>0?this.count/this.samples:0}},{key:"getAverageTime",value:function(){return this.samples>0?this.time/this.samples:0}},{key:"getHz",value:function(){return this.time>0?this.samples/(this.time/1e3):0}},{key:"reset",value:function(){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}},{key:"_checkSampling",value:function(){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)}}]),t}(),u=function(){function t(e){(0,r.Z)(this,t),(0,o.Z)(this,"id",void 0),(0,o.Z)(this,"stats",{}),this.id=e.id,this.stats={},this._initializeStats(e.stats),Object.seal(this)}return(0,i.Z)(t,[{key:"get",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"count";return this._getOrCreate({name:t,type:e})}},{key:"size",get:function(){return Object.keys(this.stats).length}},{key:"reset",value:function(){for(var t in this.stats)this.stats[t].reset();return this}},{key:"forEach",value:function(t){for(var e in this.stats)t(this.stats[e])}},{key:"getTable",value:function(){var t={};return this.forEach((function(e){t[e.name]={time:e.time||0,count:e.count||0,average:e.getAverageTime()||0,hz:e.getHz()||0}})),t}},{key:"_initializeStats",value:function(){var t=this;(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((function(e){return t._getOrCreate(e)}))}},{key:"_getOrCreate",value:function(t){if(!t||!t.name)return null;var e=t.name,n=t.type;return this.stats[e]||(this.stats[e]=t instanceof s?t:new s(e,n)),this.stats[e]}}]),t}()},25880:function(t){"use strict";function e(t,e,r){r=r||2;var o,a,s,u,h,f,d,A=e&&e.length,v=A?e[0]*r:t.length,g=n(t,0,v,r,!0),m=[];
vendor: 3,200 bytes, line 2
2if(!g||g.next===g.prev)return m;if(A&&(g=function(t,e,r,i){var o,a,s,u=[];for(o=0,a=e.length;o<a;o++)(s=n(t,e[o]*i,o<a-1?e[o+1]*i:t.length,i,!1))===s.next&&(s.steiner=!0),u.push(p(s));for(u.sort(l),o=0;o<u.length;o++)r=c(u[o],r);return r}(t,e,g,r)),t.length>80*r){o=s=t[0],a=u=t[1];for(var y=r;y<v;y+=r)(h=t[y])<o&&(o=h),(f=t[y+1])<a&&(a=f),h>s&&(s=h),f>u&&(u=f);d=0!==(d=Math.max(s-o,u-a))?32767/d:0}return i(g,m,r,o,a,d,0),m}function n(t,e,n,r,i){var o,a;if(i===k(t,e,n,r)>0)for(o=e;o<n;o+=r)a=w(o,t[o],t[o+1],a);else for(o=n-r;o>=e;o-=r)a=w(o,t[o],t[o+1],a);return a&&g(a,a.next)&&(C(a),a=a.next),a}function r(t,e){if(!t)return t;e||(e=t);var n,r=t;do{if(n=!1,r.steiner||!g(r,r.next)&&0!==v(r.prev,r,r.next))r=r.next;else{if(C(r),(r=e=r.prev)===r.next)break;n=!0}}while(n||r!==e);return e}function i(t,e,n,l,c,h,p){if(t){!p&&h&&function(t,e,n,r){var i=t;do{0===i.z&&(i.z=f(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,n,r,i,o,a,s,u,l=1;do{for(n=t,t=null,o=null,a=0;n;){for(a++,r=n,s=0,e=0;e<l&&(s++,r=r.nextZ);e++);for(u=l;s>0||u>0&&r;)0!==s&&(0===u||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,u--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;n=r}o.nextZ=null,l*=2}while(a>1)}(i)}(t,l,c,h);for(var d,A,v=t;t.prev!==t.next;)if(d=t.prev,A=t.next,h?a(t,l,c,h):o(t))e.push(d.i/n|0),e.push(t.i/n|0),e.push(A.i/n|0),C(t),t=A.next,v=A.next;else if((t=A)===v){p?1===p?i(t=s(r(t),e,n),e,n,l,c,h,2):2===p&&u(t,e,n,l,c,h):i(r(t),e,n,l,c,h,1);break}}}function o(t){var e=t.prev,n=t,r=t.next;if(v(e,n,r)>=0)return!1;for(var i=e.x,o=n.x,a=r.x,s=e.y,u=n.y,l=r.y,c=i<o?i<a?i:a:o<a?o:a,h=s<u?s<l?s:l:u<l?u:l,f=i>o?i>a?i:a:o>a?o:a,p=s>u?s>l?s:l:u>l?u:l,A=r.next;A!==e;){if(A.x>=c&&A.x<=f&&A.y>=h&&A.y<=p&&d(i,s,o,u,a,l,A.x,A.y)&&v(A.prev,A,A.next)>=0)return!1;A=A.next}return!0}function a(t,e,n,r){var i=t.prev,o=t,a=t.next;if(v(i,o,a)>=0)return!1;for(var s=i.x,u=o.x,l=a.x,c=i.y,h=o.y,p=a.y,A=s<u?s<l?s:l:u<l?u:l,g=c<h?c<p?c:p:h<p?h:p,m=s>u?s>l?s:l:u>l?u:l,y=c>h?c>p?c:p:h>p?h:p,_=f(A,g,e,n,r),b=f(m,y,e,n,r),x=t.prevZ,w=t.nextZ;x&&x.z>=_&&w&&w.z<=b;){if(x.x>=A&&x.x<=m&&x.y>=g&&x.y<=y&&x!==i&&x!==a&&d(s,c,u,h,l,p,x.x,x.y)&&v(x.prev,x,x.next)>=0)return!1;if(x=x.prevZ,w.x>=A&&w.x<=m&&w.y>=g&&w.y<=y&&w!==i&&w!==a&&d(s,c,u,h,l,p,w.x,w.y)&&v(w.prev,w,w.next)>=0)return!1;w=w.nextZ}for(;x&&x.z>=_;){if(x.x>=A&&x.x<=m&&x.y>=g&&x.y<=y&&x!==i&&x!==a&&d(s,c,u,h,l,p,x.x,x.y)&&v(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;w&&w.z<=b;){if(w.x>=A&&w.x<=m&&w.y>=g&&w.y<=y&&w!==i&&w!==a&&d(s,c,u,h,l,p,w.x,w.y)&&v(w.prev,w,w.next)>=0)return!1;w=w.nextZ}return!0}function s(t,e,n){var i=t;do{var o=i.prev,a=i.next.next;!g(o,a)&&m(o,i,i.next,a)&&b(o,a)&&b(a,o)&&(e.push(o.i/n|0),e.push(i.i/n|0),e.push(a.i/n|0),C(i),C(i.next),i=t=a),i=i.next}while(i!==t);return r(i)}function u(t,e,n,o,a,s){var u=t;do{for(var l=u.next.next;l!==u.prev;){if(u.i!==l.i&&A(u,l)){var c=x(u,l);return u=r(u,u.next),c=r(c,c.next),i(u,e,n,o,a,s,0),void i(c,e,n,o,a,s,0)}l=l.next}u=u.next}while(u!==t)}function l(t,e){return t.x-e.x}function c(t,e){var n=function(t,e){var n,r=e,i=t.x,o=t.y,a=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var s=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y
2);if(s<=i&&s>a&&(a=s,n=r.x<r.next.x?r:r.next,s===i))return n}r=r.next}while(r!==e);if(!n)return null;var u,l=n,c=n.x,f=n.y,p=1/0;r=n;do{i>=r.x&&r.x>=c&&i!==r.x&&d(o<f?i:a,o,c,f,o<f?a:i,o,r.x,r.y)&&(u=Math.abs(o-r.y)/(i-r.x),b(r,t)&&(u<p||u===p&&(r.x>n.x||r.x===n.x&&h(n,r)))&&(n=r,p=u)),r=r.next}while(r!==l);return n}(t,e);if(!n)return e;var i=x(n,t);return r(i,i.next),r(n,n.next)}function h(t,e){return v(t.prev,t,e.prev)<0&&v(e.next,t,t.next)<0}function f(t,e,n,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function p(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 d(t,e,n,r,i,o,a,s){return(i-a)*(e-s)>=(t-a)*(o-s)&&(t-a)*(r-s)>=(n-a)*(e-s)&&(n-a)*(o-s)>=(i-a)*(r-s)}function A(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&&m(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,r=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!==n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==t);return r}(t,e)&&(v(t.prev,t,e.prev)||v(t,e.prev,e))||g(t,e)&&v(t.prev,t,t.next)>0&&v(e.prev,e,e.next)>0)}function v(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function g(t,e){return t.x===e.x&&t.y===e.y}function m(t,e,n,r){var i=_(v(t,e,n)),o=_(v(t,e,r)),a=_(v(n,r,t)),s=_(v(n,r,e));return i!==o&&a!==s||(!(0!==i||!y(t,n,e))||(!(0!==o||!y(t,r,e))||(!(0!==a||!y(n,t,r))||!(0!==s||!y(n,e,r)))))}function y(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 v(t.prev,t,t.next)<0?v(t,e,t.next)>=0&&v(t,t.prev,e)>=0:v(t,e,t.prev)<0||v(t,t.next,e)<0}function x(t,e){var n=new B(t.i,t.x,t.y),r=new B(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function w(t,e,n,r){var i=new B(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}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 k(t,e,n,r){for(var i=0,o=e,a=n-r;o<n;o+=r)i+=(t[a]-t[o])*(t[o+1]+t[a+1]),a=o;return i}t.exports=e,t.exports.default=e,e.deviation=function(t,e,n,r){var i=e&&e.length,o=i?e[0]*n:t.length,a=Math.abs(k(t,0,o,n));if(i)for(var s=0,u=e.length;s<u;s++){var l=e[s]*n,c=s<u-1?e[s+1]*n:t.length;a-=Math.abs(k(t,l,c,n))}var h=0;for(s=0;s<r.length;s+=3){var f=r[s]*n,p=r[s+1]*n,d=r[s+2]*n;h+=Math.abs((t[f]-t[d])*(t[p+1]-t[f+1])-(t[f]-t[p])*(t[d+1]-t[f+1]))}return 0===a&&0===h?0:Math.abs((h-a)/a)},e.flatten=function(t){for(var e=t[0][0].length,n={vertices:[],holes:[],dimensions:e},r=0,i=0;i<t.length;i++){for(var o=0;o<t[i].length;o++)for(var a=0;a<e;a++)n.vertices.push(t[i][o][a]);i>0&&(r+=t[i-1].length,n.holes.push(r))}return n}},61521:function(t,e,n){var r=n(40131).default,i=n(21337).default,o=n(10029).default,a=n(42103),s={"||":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}},u={"-":function(t){return-t},"+":function(t){return+t},"~":function(t){return~t},"!":function(t){return!t}};function l(t,e){return t.map((function(t){return A(t,e)}))}function c(t,e){return h.apply(this,arguments)}
2function h(){return(h=o(i().mark((function t(e,n){var r;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Promise.all(e.map((function(t){return v(t,n)})));case 2:return r=t.sent,t.abrupt("return",r);case 4:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function f(t,e){var n=A(t.object,e);return t.computed?[n,n[A(t.property,e)]]:[n,n[t.property.name]]}function p(t,e){return d.apply(this,arguments)}function d(){return(d=o(i().mark((function t(e,n){var r;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,v(e.object,n);case 2:if(r=t.sent,!e.computed){t.next=12;break}return t.t0=r,t.next=7,v(e.property,n);case 7:return t.t1=t.sent,t.t2=r[t.t1],t.abrupt("return",[t.t0,t.t2]);case 12:return t.abrupt("return",[r,r[e.property.name]]);case 13:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function A(t,e){switch(t.type){case"ArrayExpression":return l(t.elements,e);case"BinaryExpression":return s[t.operator](A(t.left,e),A(t.right,e));case"CallExpression":var n,r,i;if("MemberExpression"===t.callee.type?(n=(i=f(t.callee,e))[0],r=i[1]):r=A(t.callee,e),"function"!==typeof r)return;return r.apply(n,l(t.arguments,e));case"ConditionalExpression":return A(t.test,e)?A(t.consequent,e):A(t.alternate,e);case"Identifier":return e[t.name];case"Literal":return t.value;case"LogicalExpression":return"||"===t.operator?A(t.left,e)||A(t.right,e):"&&"===t.operator?A(t.left,e)&&A(t.right,e):s[t.operator](A(t.left,e),A(t.right,e));case"MemberExpression":return f(t,e)[1];case"ThisExpression":return e;case"UnaryExpression":return u[t.operator](A(t.argument,e));default:return}}function v(t,e){return g.apply(this,arguments)}function g(){return(g=o(i().mark((function t(e,n){var o,a,l,h,f,d,A,g,m,y,_;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:t.t0=e.type,t.next="ArrayExpression"===t.t0?3:"BinaryExpression"===t.t0?6:"CallExpression"===t.t0?13:"ConditionalExpression"===t.t0?34:"Identifier"===t.t0?46:"Literal"===t.t0?47:"LogicalExpression"===t.t0?48:"MemberExpression"===t.t0?75:"ThisExpression"===t.t0?78:"UnaryExpression"===t.t0?79:85;break;case 3:return t.next=5,c(e.elements,n);case 5:return t.abrupt("return",t.sent);case 6:return t.next=8,Promise.all([v(e.left,n),v(e.right,n)]);case 8:return o=t.sent,a=r(o,2),l=a[0],h=a[1],t.abrupt("return",s[e.operator](l,h));case 13:if("MemberExpression"!==e.callee.type){t.next=21;break}return t.next=16,p(e.callee,n);case 16:A=t.sent,f=A[0],d=A[1],t.next=24;break;case 21:return t.next=23,v(e.callee,n);case 23:d=t.sent;case 24:if("function"===typeof d){t.next=26;break}return t.abrupt("return",void 0);case 26:return t.t1=d,t.t2=f,t.next=30,c(e.arguments,n);case 30:return t.t3=t.sent,t.next=33,t.t1.apply.call(t.t1,t.t2,t.t3);case 33:return t.abrupt("return",t.sent);case 34:return t.next=36,v(e.test,n);case 36:if(!t.sent){t.next=42;break}return t.next=39,v(e.consequent,n);case 39:t.t4=t.sent,t.next=45;break;case 42:return t.next=44,v(e.alternate,n);case 44:t.t4=t.sent;case 45:return t.abrupt("return",t.t4);case 46:return t.abrupt("return",n[e.name]);case 47:return t.abrupt("return",e.value);case 48:if("||"!==e.operator){t.next=59;break}return t.next=51,v(e.left,n);case 51:if(t.t5=t.sent,t.t5){t.next=56;break}return t.next=55,v(e.right,n);case 55:t.t5=t.sent;case 56:return t.abrupt("return",t.t5);case 59:if("&&"!==e.operator){t.next=68;break}return t.next=62,v(e.left,n);case 62:if(t.t6=t.sent,!t.t6){t.next=67;break}return t.next=66,v(e.right,n);case 66:t.t6=t.sent;case 67:return t.abrupt("return",t.t6);case 68:return t.next=70,Promise.all([v(e.left,n),v(e.right,n)]);case 70:return g=t.sent,m=r(g,2),y=m[0],_=m[1],t.abrupt("return",s[e.operator](y,_));case 75:return t.next=77,p(e,n);case 77:return t.abrupt("return",t.sent[1]);case 78:return t.abrupt("return",n);case 79:return t.t7=u,t.t8=e.operator,t.next=83,v(e.argument,n);case 83:return t.t9=t.sent,t.abrupt("return",t.t7[t.t8].call(t.t7,t.t9));case 85:return t.abrupt("return",void 0);case 86:case"end":return t.stop()}}),t)})))).apply(this,arguments)}t.exports={parse:a,eval:A,evalAsync:v,compile:function(t){return A.bind(null,a(t))},compileAsync:function(t){return v.bind(null,a(t))}}},60285:function(t,e,n){"use strict";n.d(e,{Ib:function(){return r},WT:function(){return i}});var r=1e-6,i="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:function(t,e,n){"use strict";n.d(e,{GH:function(){return s},Iu:function(){return l},Jp:function(){return u},U1:function(){return c},U_:function(){return a},Ue:function(){return i},bA:function(){return h},en:function(){return f},p4:function(){return o}});var r=n(60285);function i(){var t=new r.WT(9);
2return r.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],r=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=n,t[5]=e[7],t[6]=r,t[7]=i}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 a(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],l=e[7],c=e[8],h=c*a-s*l,f=-c*o+s*u,p=l*o-a*u,d=n*h+r*f+i*p;return d?(d=1/d,t[0]=h*d,t[1]=(-c*r+i*l)*d,t[2]=(s*r-i*a)*d,t[3]=f*d,t[4]=(c*n-i*u)*d,t[5]=(-s*n+i*o)*d,t[6]=p*d,t[7]=(-l*n+r*u)*d,t[8]=(a*n-r*o)*d,t):null}function s(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],l=t[8];return e*(l*o-a*u)+n*(-l*i+a*s)+r*(u*i-o*s)}function u(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=e[8],f=n[0],p=n[1],d=n[2],A=n[3],v=n[4],g=n[5],m=n[6],y=n[7],_=n[8];return t[0]=f*r+p*a+d*l,t[1]=f*i+p*s+d*c,t[2]=f*o+p*u+d*h,t[3]=A*r+v*a+g*l,t[4]=A*i+v*s+g*c,t[5]=A*o+v*u+g*h,t[6]=m*r+y*a+_*l,t[7]=m*i+y*s+_*c,t[8]=m*o+y*u+_*h,t}function l(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=e[8],f=n[0],p=n[1];return t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=f*r+p*a+l,t[7]=f*i+p*s+c,t[8]=f*o+p*u+h,t}function c(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=e[8],f=Math.sin(n),p=Math.cos(n);return t[0]=p*r+f*a,t[1]=p*i+f*s,t[2]=p*o+f*u,t[3]=p*a-f*r,t[4]=p*s-f*i,t[5]=p*u-f*o,t[6]=l,t[7]=c,t[8]=h,t}function h(t,e,n){var r=n[0],i=n[1];return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function f(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,s=r+r,u=i+i,l=n*a,c=r*a,h=r*s,f=i*a,p=i*s,d=i*u,A=o*a,v=o*s,g=o*u;return t[0]=1-h-d,t[3]=c-g,t[6]=f+v,t[1]=c+g,t[4]=1-l-d,t[7]=p-A,t[2]=f-v,t[5]=p+A,t[8]=1-l-h,t}},83367:function(t,e,n){"use strict";n.d(e,{G3:function(){return g},GH:function(){return a},Iu:function(){return u},Jp:function(){return s},M5:function(){return m},Q$:function(){return d},U1:function(){return c},U_:function(){return o},bA:function(){return l},en:function(){return A},fS:function(){return _},jI:function(){return p},lM:function(){return h},oy:function(){return v},p4:function(){return i},uD:function(){return f},zB:function(){return y}});var r=n(60285);function i(t,e){if(t===e){var n=e[1],r=e[2],i=e[3],o=e[6],a=e[7],s=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]=r,t[9]=o,t[11]=e[14],t[12]=i,t[13]=a,t[14]=s}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],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],l=e[7],c=e[8],h=e[9],f=e[10],p=e[11],d=e[12],A=e[13],v=e[14],g=e[15],m=n*s-r*a,y=n*u-i*a,_=n*l-o*a,b=r*u-i*s,x=r*l-o*s,w=i*l-o*u,C=c*A-h*d,B=c*v-f*d,k=c*g-p*d,E=h*v-f*A,S=h*g-p*A,T=f*g-p*v,M=m*T-y*S+_*E+b*k-x*B+w*C;return M?(M=1/M,t[0]=(s*T-u*S+l*E)*M,t[1]=(i*S-r*T-o*E)*M,t[2]=(A*w-v*x+g*b)*M,t[3]=(f*x-h*w-p*b)*M,t[4]=(u*k-a*T-l*B)*M,t[5]=(n*T-i*k+o*B)*M,t[6]=(v*_-d*w-g*y)*M,t[7]=(c*w-f*_+p*y)*M,t[8]=(a*S-s*k+l*C)*M,t[9]=(r*k-n*S-o*C)*M,t[10]=(d*x-A*_+g*m)*M,t[11]=(h*_-c*x-p*m)*M,t[12]=(s*B-a*E-u*C)*M,t[13]=(n*E-r*B+i*C)*M,t[14]=(A*y-d*b-v*m)*M,t[15]=(c*b-h*y+f*m)*M,t):null}function a(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],l=t[8],c=t[9],h=t[10],f=t[11],p=t[12],d=t[13],A=t[14],v=t[15];return(e*a-n*o)*(h*v-f*A)-(e*s-r*o)*(c*v-f*d)+(e*u-i*o)*(c*A-h*d)+(n*s-r*a)*(l*v-f*p)-(n*u-i*a)*(l*A-h*p)+(r*u-i*s)*(l*d-c*p)}function s(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=e[8],f=e[9],p=e[10],d=e[11],A=e[12],v=e[13],g=e[14],m=e[15],y=n[0],_=n[1],b=n[2],x=n[3];return t[0]=y*r+_*s+b*h+x*A,t[1]=y*i+_*u+b*f+x*v,t[2]=y*o+_*l+b*p+x*g,t[3]=y*a+_*c+b*d+x*m,y=n[4],_=n[5],b=n[6],x=n[7],t[4]=y*r+_*s+b*h+x*A,t[5]=y*i+_*u+b*f+x*v,t[6]=y*o+_*l+b*p+x*g,t[7]=y*a+_*c+b*d+x*m,y=n[8],_=n[9],b=n[10],x=n[11],t[8]=y*r+_*s+b*h+x*A,t[9]=y*i+_*u+b*f+x*v,t[10]=y*o+_*l+b*p+x*g,t[11]=y*a+_*c+b*d+x*m,y=n[12],_=n[13],b=n[14],x=n[15],t[12]=y*r+_*s+b*h+x*A,t[13]=y*i+_*u+b*f+x*v,t[14]=y*o+_*l+b*p+x*g,t[15]=y*a+_*c+b*d+x*m,t}function u(t,e,n){var r,i,o,a,s,u,l,c,h,f,p,d,A=n[0],v=n[1],g=n[2];return e===t?(t[12]=e[0]*A+e[4]*v+e[8]*g+e[12],t[13]=e[1]*A+e[5]*v+e[9]*g+e[13],t[14]=e[2]*A+e[6]*v+e[10]*g+e[14],t[15]=e[3]*A+e[7]*v+e[11]*g+e[15]):(r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=e[8],f=e[9],p=e[10],d=e[11],t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=l,t[7]=c,t[8]=h,t[9]=f,t[10]=p,t[11]=d,t[12]=r*A+s*v+h*g+e[12],t[13]=i*A+u*v+f*g+e[13],t[14]=o*A+l*v+p*g+e[14],t[15]=a*A+c*v+d*g+e[15]),t}function l(t,e,n){var r=n[0],i=n[1],o=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,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 c(t,e,n,i){var o,a,s,u,l,c,h,f,p,d,A,v,g,m,y,_,b,x,w,C,B,k,E,S,T=i[0],M=i[1],I=i[2],P=Math.hypot(T,M,I);return P<r.Ib?null:(T*=P=1/P,M*=P,I*=P,o=Math.sin(n),s=1-(a=Math.cos(n)),u=e[0],l=e[1],c=e[2],h=e[3],f=e[4],p=e[5],d=e[6],A=e[7],v=e[8],g=e[9],m=e[10],y=e[11],_=T*T*s+a,b=M*T*s+I*o,x=I*T*s-M*o,w=T*M*s-I*o,C=M*M*s+a,B=I*M*s+T*o,k=T*I*s+M*o,E=M*I*s-T*o,S=I*I*s+a,t[0]=u*_+f*b+v*x,t[1]=l*_+p*b+g*x,t[2]=c*_+d*b+m*x,t[3]=h*_+A*b+y*x,t[4]=u*w+f*C+v*B,t[5]=l*w+p*C+g*B,t[6]=c*w+d*C+m*B,t[7]=h*w+A*C+y*B,t[8]=u*k+f*E+v*S,t[9]=l*k+p*E+g*S,t[10]=c*k+d*E+m*S,t[11]=h*k+A*E+y*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 r=Math.sin(n),i=Math.cos(n),o=e[4],a=e[5],s=e[6],u=e[7],l=e[8],c=e[9],h=e[10],f=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*i+l*r,t[5]=a*i+c*r,t[6]=s*i+h*r,t[7]=u*i+f*r,t[8]=l*i-o*r,t[9]=c*i-a*r,t[10]=h*i-s*r,t[11]=f*i-u*r,t}function f(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],u=e[3],l=e[8],c=e[9],h=e[10],f=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*i-l*r,t[1]=a*i-c*r,t[2]=s*i-h*r,t[3]=u*i-f*r,t[8]=o*r+l*i,t[9]=a*r+c*i,t[10]=s*r+h*i,t[11]=u*r+f*i,t}function p(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],u=e[3],l=e[4],c=e[5],h=e[6],f=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*i+l*r,t[1]=a*i+c*r,t[2]=s*i+h*r,t[3]=u*i+f*r,t[4]=l*i-o*r,t[5]=c*i-a*r,t[6]=h*i-s*r,t[7]=f*i-u*r,t}function d(t,e){var n=e[0],r=e[1],i=e[2],o=e[4],a=e[5],s=e[6],u=e[8],l=e[9],c=e[10];return t[0]=Math.hypot(n,r,i),t[1]=Math.hypot(o,a,s),t[2]=Math.hypot(u,l,c),t}function A(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,s=r+r,u=i+i,l=n*a,c=r*a,h=r*s,f=i*a,p=i*s,d=i*u,A=o*a,v=o*s,g=o*u;return t[0]=1-h-d,t[1]=c+g,t[2]=f-v,t[3]=0,t[4]=c-g,t[5]=1-l-d,t[6]=p+A,t[7]=0,t[8]=f+v,t[9]=p-A,t[10]=1-l-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function v(t,e,n,r,i,o,a){var s=1/(n-e),u=1/(i-r),l=1/(o-a);
2return t[0]=2*o*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*u,t[6]=0,t[7]=0,t[8]=(n+e)*s,t[9]=(i+r)*u,t[10]=(a+o)*l,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*l,t[15]=0,t}var g=function(t,e,n,r,i){var o,a=1/Math.tan(e/2);return t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(o=1/(r-i),t[10]=(i+r)*o,t[14]=2*i*r*o):(t[10]=-1,t[14]=-2*r),t};var m=function(t,e,n,r,i,o,a){var s=1/(e-n),u=1/(r-i),l=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*u,t[14]=(a+o)*l,t[15]=1,t};function y(t,e,n,i){var o,a,s,u,l,c,h,f,p,d,A=e[0],v=e[1],g=e[2],m=i[0],y=i[1],_=i[2],b=n[0],x=n[1],w=n[2];return Math.abs(A-b)<r.Ib&&Math.abs(v-x)<r.Ib&&Math.abs(g-w)<r.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=A-b,f=v-x,p=g-w,o=y*(p*=d=1/Math.hypot(h,f,p))-_*(f*=d),a=_*(h*=d)-m*p,s=m*f-y*h,(d=Math.hypot(o,a,s))?(o*=d=1/d,a*=d,s*=d):(o=0,a=0,s=0),u=f*s-p*a,l=p*o-h*s,c=h*a-f*o,(d=Math.hypot(u,l,c))?(u*=d=1/d,l*=d,c*=d):(u=0,l=0,c=0),t[0]=o,t[1]=u,t[2]=h,t[3]=0,t[4]=a,t[5]=l,t[6]=f,t[7]=0,t[8]=s,t[9]=c,t[10]=p,t[11]=0,t[12]=-(o*A+a*v+s*g),t[13]=-(u*A+l*v+c*g),t[14]=-(h*A+f*v+p*g),t[15]=1,t)}function _(t,e){var n=t[0],i=t[1],o=t[2],a=t[3],s=t[4],u=t[5],l=t[6],c=t[7],h=t[8],f=t[9],p=t[10],d=t[11],A=t[12],v=t[13],g=t[14],m=t[15],y=e[0],_=e[1],b=e[2],x=e[3],w=e[4],C=e[5],B=e[6],k=e[7],E=e[8],S=e[9],T=e[10],M=e[11],I=e[12],P=e[13],Z=e[14],D=e[15];return Math.abs(n-y)<=r.Ib*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(i-_)<=r.Ib*Math.max(1,Math.abs(i),Math.abs(_))&&Math.abs(o-b)<=r.Ib*Math.max(1,Math.abs(o),Math.abs(b))&&Math.abs(a-x)<=r.Ib*Math.max(1,Math.abs(a),Math.abs(x))&&Math.abs(s-w)<=r.Ib*Math.max(1,Math.abs(s),Math.abs(w))&&Math.abs(u-C)<=r.Ib*Math.max(1,Math.abs(u),Math.abs(C))&&Math.abs(l-B)<=r.Ib*Math.max(1,Math.abs(l),Math.abs(B))&&Math.abs(c-k)<=r.Ib*Math.max(1,Math.abs(c),Math.abs(k))&&Math.abs(h-E)<=r.Ib*Math.max(1,Math.abs(h),Math.abs(E))&&Math.abs(f-S)<=r.Ib*Math.max(1,Math.abs(f),Math.abs(S))&&Math.abs(p-T)<=r.Ib*Math.max(1,Math.abs(p),Math.abs(T))&&Math.abs(d-M)<=r.Ib*Math.max(1,Math.abs(d),Math.abs(M))&&Math.abs(A-I)<=r.Ib*Math.max(1,Math.abs(A),Math.abs(I))&&Math.abs(v-P)<=r.Ib*Math.max(1,Math.abs(v),Math.abs(P))&&Math.abs(g-Z)<=r.Ib*Math.max(1,Math.abs(g),Math.abs(Z))&&Math.abs(m-D)<=r.Ib*Math.max(1,Math.abs(m),Math.abs(D))}},77548:function(t,e,n){"use strict";n.d(e,{IH:function(){return i},bA:function(){return o},c:function(){return l},fF:function(){return f},iu:function(){return c},kE:function(){return a},kK:function(){return h},lu:function(){return p},t7:function(){return u},tk:function(){return s}});var r=n(60285);function i(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 a(t){var e=t[0],n=t[1];return Math.hypot(e,n)}function s(t,e){return t[0]=-e[0],t[1]=-e[1],t}function u(t,e,n,r){var i=e[0],o=e[1];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t}function l(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i,t[1]=n[1]*r+n[3]*i,t}function c(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[2]*i+n[4],t[1]=n[1]*r+n[3]*i+n[5],t}function h(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[3]*i+n[6],t[1]=n[1]*r+n[4]*i+n[7],t}function f(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[4]*i+n[12],t[1]=n[1]*r+n[5]*i+n[13],t}var p=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 r.WT(2);return r.WT!=Float32Array&&(t[0]=0,t[1]=0),t}()}()},99007:function(t,e,n){"use strict";n.d(e,{AK:function(){return c},EU:function(){return y},Fv:function(){return l},IH:function(){return s},Ue:function(){return i},VC:function(){return A},Zh:function(){return x},al:function(){return a},dC:function(){return b},fF:function(){return p},jI:function(){return m},kC:function(){return h},kE:function(){return o},kK:function(){return d},lM:function(){return v},lu:function(){return _},t7:function(){return f},tk:function(){return u},uD:function(){return g},x9:function(){return w}});var r=n(60285);function i(){var t=new r.WT(3);
2return r.WT!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function o(t){var e=t[0],n=t[1],r=t[2];return Math.hypot(e,n,r)}function a(t,e,n){var i=new r.WT(3);return i[0]=t,i[1]=e,i[2]=n,i}function s(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function u(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function l(t,e){var n=e[0],r=e[1],i=e[2],o=n*n+r*r+i*i;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 c(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function h(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],u=n[2];return t[0]=i*u-o*s,t[1]=o*a-r*u,t[2]=r*s-i*a,t}function f(t,e,n,r){var i=e[0],o=e[1],a=e[2];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a),t}function p(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return a=a||1,t[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/a,t[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,t[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,t}function d(t,e,n){var r=e[0],i=e[1],o=e[2];return t[0]=r*n[0]+i*n[3]+o*n[6],t[1]=r*n[1]+i*n[4]+o*n[7],t[2]=r*n[2]+i*n[5]+o*n[8],t}function A(t,e,n){var r=n[0],i=n[1],o=n[2],a=n[3],s=e[0],u=e[1],l=e[2],c=i*l-o*u,h=o*s-r*l,f=r*u-i*s,p=i*f-o*h,d=o*c-r*f,A=r*h-i*c,v=2*a;return c*=v,h*=v,f*=v,p*=2,d*=2,A*=2,t[0]=s+c+p,t[1]=u+h+d,t[2]=l+f+A,t}function v(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[0],o[1]=i[1]*Math.cos(r)-i[2]*Math.sin(r),o[2]=i[1]*Math.sin(r)+i[2]*Math.cos(r),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t}function g(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[2]*Math.sin(r)+i[0]*Math.cos(r),o[1]=i[1],o[2]=i[2]*Math.cos(r)-i[0]*Math.sin(r),t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t}function m(t,e,n,r){var i=[],o=[];return i[0]=e[0]-n[0],i[1]=e[1]-n[1],i[2]=e[2]-n[2],o[0]=i[0]*Math.cos(r)-i[1]*Math.sin(r),o[1]=i[0]*Math.sin(r)+i[1]*Math.cos(r),o[2]=i[2],t[0]=o[0]+n[0],t[1]=o[1]+n[1],t[2]=o[2]+n[2],t}function y(t,e){var n=t[0],r=t[1],i=t[2],o=e[0],a=e[1],s=e[2],u=Math.sqrt(n*n+r*r+i*i)*Math.sqrt(o*o+a*a+s*s),l=u&&c(t,e)/u;return Math.acos(Math.min(Math.max(l,-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],r=t[2];return e*e+n*n+r*r};!function(){var t=i()}()},62220:function(t,e,n){"use strict";n.d(e,{AK:function(){return p},Fv:function(){return f},I6:function(){return g},IH:function(){return u},JG:function(){return a},VC:function(){return v},al:function(){return o},bA:function(){return l},d9:function(){return i},fF:function(){return A},fS:function(){return m},kE:function(){return c},t7:function(){return d},t8:function(){return s},we:function(){return h}});var r=n(60285);function i(t){var e=new r.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,i){var o=new r.WT(4);return o[0]=t,o[1]=e,o[2]=n,o[3]=i,o}function a(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function s(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t}function u(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 l(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 c(t){var e=t[0],n=t[1],r=t[2],i=t[3];return Math.hypot(e,n,r,i)}function h(t){var e=t[0],n=t[1],r=t[2],i=t[3];return e*e+n*n+r*r+i*i}function f(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=n*a,t[1]=r*a,t[2]=i*a,t[3]=o*a,t}function p(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function d(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=e[3];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a),t[3]=s+r*(n[3]-s),t}function A(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,t[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,t[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,t[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,t}function v(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],u=n[2],l=n[3],c=l*r+s*o-u*i,h=l*i+u*r-a*o,f=l*o+a*i-s*r,p=-a*r-s*i-u*o;return t[0]=c*l+p*-a+h*-u-f*-s,t[1]=h*l+p*-s+f*-a-c*-u,t[2]=f*l+p*-u+c*-s-h*-a,t[3]=e[3],t}function g(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function m(t,e){var n=t[0],i=t[1],o=t[2],a=t[3],s=e[0],u=e[1],l=e[2],c=e[3];return Math.abs(n-s)<=r.Ib*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-u)<=r.Ib*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(o-l)<=r.Ib*Math.max(1,Math.abs(o),Math.abs(l))&&Math.abs(a-c)<=r.Ib*Math.max(1,Math.abs(a),Math.abs(c))}!function(){var t=function(){var t=new r.WT(4);
vendor: 42,262 bytes, line 2
2return r.WT!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}()}()},37659:function(t,e,n){var r;!function(i,o,a,s){"use strict";var u,l=["","webkit","Moz","MS","ms","o"],c=o.createElement("div"),h="function",f=Math.round,p=Math.abs,d=Date.now;function A(t,e,n){return setTimeout(x(t,n),e)}function v(t,e,n){return!!Array.isArray(t)&&(g(t,n[e],n),!0)}function g(t,e,n){var r;if(t)if(t.forEach)t.forEach(e,n);else if(t.length!==s)for(r=0;r<t.length;)e.call(n,t[r],r,t),r++;else for(r in t)t.hasOwnProperty(r)&&e.call(n,t[r],r,t)}function m(t,e,n){var r="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=i.console&&(i.console.warn||i.console.log);return o&&o.call(i.console,r,n),t.apply(this,arguments)}}u="function"!==typeof Object.assign?function(t){if(t===s||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=1;n<arguments.length;n++){var r=arguments[n];if(r!==s&&null!==r)for(var i in r)r.hasOwnProperty(i)&&(e[i]=r[i])}return e}:Object.assign;var y=m((function(t,e,n){for(var r=Object.keys(e),i=0;i<r.length;)(!n||n&&t[r[i]]===s)&&(t[r[i]]=e[r[i]]),i++;return t}),"extend","Use `assign`."),_=m((function(t,e){return y(t,e,!0)}),"merge","Use `assign`.");function b(t,e,n){var r,i=e.prototype;(r=t.prototype=Object.create(i)).constructor=t,r._super=i,n&&u(r,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]||s,e):t}function C(t,e){return t===s?e:t}function B(t,e,n){g(T(e),(function(e){t.addEventListener(e,n,!1)}))}function k(t,e,n){g(T(e),(function(e){t.removeEventListener(e,n,!1)}))}function E(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1}function S(t,e){return t.indexOf(e)>-1}function T(t){return t.trim().split(/\s+/g)}function M(t,e,n){if(t.indexOf&&!n)return t.indexOf(e);for(var r=0;r<t.length;){if(n&&t[r][n]==e||!n&&t[r]===e)return r;r++}return-1}function I(t){return Array.prototype.slice.call(t,0)}function P(t,e,n){for(var r=[],i=[],o=0;o<t.length;){var a=e?t[o][e]:t[o];M(i,a)<0&&r.push(t[o]),i[o]=a,o++}return n&&(r=e?r.sort((function(t,n){return t[e]>n[e]})):r.sort()),r}function Z(t,e){for(var n,r,i=e[0].toUpperCase()+e.slice(1),o=0;o<l.length;){if((r=(n=l[o])?n+i:e)in t)return r;o++}return s}var D=1;function L(t){var e=t.ownerDocument||t;return e.defaultView||e.parentWindow||i}var O="ontouchstart"in i,F=Z(i,"PointerEvent")!==s,R=O&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),z="touch",U="mouse",N=25,G=1,j=4,V=8,H=1,J=2,W=4,Q=8,q=16,K=J|W,X=Q|q,Y=K|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 r=n.pointers.length,i=n.changedPointers.length,o=e&G&&r-i===0,a=e&(j|V)&&r-i===0;n.isFirst=!!o,n.isFinal=!!a,o&&(t.session={}),n.eventType=e,function(t,e){var n=t.session,r=e.pointers,i=r.length;n.firstInput||(n.firstInput=rt(e));i>1&&!n.firstMultiple?n.firstMultiple=rt(e):1===i&&(n.firstMultiple=!1);var o=n.firstInput,a=n.firstMultiple,u=a?a.center:o.center,l=e.center=it(r);e.timeStamp=d(),e.deltaTime=e.timeStamp-o.timeStamp,e.angle=ut(u,l),e.distance=st(u,l),function(t,e){var n=e.center,r=t.offsetDelta||{},i=t.prevDelta||{},o=t.prevInput||{};e.eventType!==G&&o.eventType!==j||(i=t.prevDelta={x:o.deltaX||0,y:o.deltaY||0},r=t.offsetDelta={x:n.x,y:n.y});e.deltaX=i.x+(n.x-r.x),e.deltaY=i.y+(n.y-r.y)}(n,e),e.offsetDirection=at(e.deltaX,e.deltaY);var c=ot(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=c.x,e.overallVelocityY=c.y,e.overallVelocity=p(c.x)>p(c.y)?c.x:c.y,e.scale=a?(h=a.pointers,f=r,st(f[0],f[1],tt)/st(h[0],h[1],tt)):1,e.rotation=a?function(t,e){return ut(e[1],e[0],tt)+ut(t[1],t[0],tt)}(a.pointers,r):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,r,i,o,a=t.lastInterval||e,u=e.timeStamp-a.timeStamp;if(e.eventType!=V&&(u>N||a.velocity===s)){var l=e.deltaX-a.deltaX,c=e.deltaY-a.deltaY,h=ot(u,l,c);r=h.x,i=h.y,n=p(h.x)>p(h.y)?h.x:h.y,o=at(l,c),t.lastInterval=e}else n=a.velocity,r=a.velocityX,i=a.velocityY,o=a.direction;e.velocity=n,e.velocityX=r,e.velocityY=i,e.direction=o}(n,e);var h,f;var A=t.element;E(e.srcEvent.target,A)&&(A=e.srcEvent.target);e.target=A}(t,n),t.emit("hammer.input",n),t.recognize(n),t.session.prevInput=n}function rt(t){for(var e=[],n=0;n<t.pointers.length;)e[n]={clientX:f(t.pointers[n].clientX),clientY:f(t.pointers[n].clientY)},n++;return{timeStamp:d(),pointers:e,center:it(e),deltaX:t.deltaX,deltaY:t.deltaY}}function it(t){var e=t.length;if(1===e)return{x:f(t[0].clientX),y:f(t[0].clientY)};for(var n=0,r=0,i=0;i<e;)n+=t[i].clientX,r+=t[i].clientY,i++;return{x:f(n/e),y:f(r/e)}}function ot(t,e,n){return{x:e/t||0,y:n/t||0}}function at(t,e){return t===e?H:p(t)>=p(e)?t<0?J:W:e<0?Q:q}function st(t,e,n){n||(n=$);var r=e[n[0]]-t[n[0]],i=e[n[1]]-t[n[1]];return Math.sqrt(r*r+i*i)}function ut(t,e,n){n||(n=$);var r=e[n[0]]-t[n[0]],i=e[n[1]]-t[n[1]];return 180*Math.atan2(i,r)/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(L(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&k(this.element,this.evEl,this.domHandler),this.evTarget&&k(this.target,this.evTarget,this.domHandler),this.evWin&&k(L(this.element),this.evWin,this.domHandler)}};var lt={mousedown:G,mousemove:2,mouseup:j},ct="mousedown",ht="mousemove mouseup";function ft(){this.evEl=ct,this.evWin=ht,this.pressed=!1,et.apply(this,arguments)}b(ft,et,{handler:function(t){var e=lt[t.type];e&G&&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:U,srcEvent:t}))}});var pt={pointerdown:G,pointermove:2,pointerup:j,pointercancel:V,pointerout:V},dt={2:z,3:"pen",4:U,5:"kinect"},At="pointerdown",vt="pointermove pointerup pointercancel";function gt(){this.evEl=At,this.evWin=vt,et.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}i.MSPointerEvent&&!i.PointerEvent&&(At="MSPointerDown",vt="MSPointerMove MSPointerUp MSPointerCancel"),b(gt,et,{handler:function(t){var e=this.store,n=!1,r=t.type.toLowerCase().replace("ms",""),i=pt[r],o=dt[t.pointerType]||t.pointerType,a=o==z,s=M(e,t.pointerId,"pointerId");i&G&&(0===t.button||a)?s<0&&(e.push(t),s=e.length-1):i&(j|V)&&(n=!0),s<0||(e[s]=t,this.callback(this.manager,i,{pointers:e,changedPointers:[t],pointerType:o,srcEvent:t}),n&&e.splice(s,1))}});var mt={touchstart:G,touchmove:2,touchend:j,touchcancel:V};function yt(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,et.apply(this,arguments)}function _t(t,e){var n=I(t.touches),r=I(t.changedTouches);return e&(j|V)&&(n=P(n.concat(r),"identifier",!0)),[n,r]}b(yt,et,{handler:function(t){var e=mt[t.type];if(e===G&&(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:G,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=I(t.touches),r=this.targetIds;if(e&(2|G)&&1===n.length)return r[n[0].identifier]=!0,[n,n];var i,o,a=I(t.changedTouches),s=[],u=this.target;if(o=n.filter((function(t){return E(t.target,u)})),e===G)for(i=0;i<o.length;)r[o[i].identifier]=!0,i++;for(i=0;i<a.length;)r[a[i].identifier]&&s.push(a[i]),e&(j|V)&&delete r[a[i].identifier],i++;return s.length?[P(o.concat(s),"identifier",!0),s]: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 kt(){et.apply(this,arguments);var t=x(this.handler,this);this.touch=new wt(this.manager,t),this.mouse=new ft(this.manager,t),this.primaryTouch=null,this.lastTouches=[]}function Et(t,e){t&G?(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 r=this.lastTouches;setTimeout((function(){var t=r.indexOf(n);t>-1&&r.splice(t,1)}),Bt)}}function Tt(t){for(var e=t.srcEvent.clientX,n=t.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var i=this.lastTouches[r],o=Math.abs(e-i.x),a=Math.abs(n-i.y);if(o<=25&&a<=25)return!0}return!1}b(kt,et,{handler:function(t,e,n){var r=n.pointerType==z,i=n.pointerType==U;if(!(i&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(r)Et.call(this,e,n);else if(i&&Tt.call(this,n))return;this.callback(t,e,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var Mt=Z(c.style,"touchAction"),It=Mt!==s,Pt="compute",Zt="auto",Dt="manipulation",Lt="none",Ot="pan-x",Ft="pan-y",Rt=function(){if(!It)return!1;var t={},e=i.CSS&&i.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(n){t[n]=!e||i.CSS.supports("touch-action",n)})),t}();function zt(t,e){this.manager=t,this.set(e)}zt.prototype={set:function(t){t==Pt&&(t=this.compute()),It&&this.manager.element.style&&Rt[t]&&(this.manager.element.style[Mt]=t),this.actions=t.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var t=[];return g(this.manager.recognizers,(function(e){w(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))})),function(t){if(S(t,Lt))return Lt;var e=S(t,Ot),n=S(t,Ft);if(e&&n)return Lt;if(e||n)return e?Ot:Ft;if(S(t,Dt))return Dt;return Zt}(t.join(" "))},preventDefaults:function(t){var e=t.srcEvent,n=t.offsetDirection;if(this.manager.session.prevented)e.preventDefault();else{var r=this.actions,i=S(r,Lt)&&!Rt[Lt],o=S(r,Ft)&&!Rt[Ft],a=S(r,Ot)&&!Rt[Ot];if(i){var s=1===t.pointers.length,u=t.distance<2,l=t.deltaTime<250;if(s&&u&&l)return}if(!a||!o)return i||o&&n&K||a&&n&X?this.preventSrc(e):void 0}},preventSrc:function(t){this.manager.session.prevented=!0,t.preventDefault()}};var Ut=1,Nt=32;function Gt(t){this.options=u({},this.defaults,t||{}),this.id=D++,this.manager=null,this.options.enable=C(this.options.enable,!0),this.state=Ut,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==q?"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(){Gt.apply(this,arguments)}function Wt(){Jt.apply(this,arguments),this.pX=null,this.pY=null}function Qt(){Jt.apply(this,arguments)}function qt(){Gt.apply(this,arguments),this._timer=null,this._input=null}function Kt(){Jt.apply(this,arguments)}function Xt(){Jt.apply(this,arguments)}function Yt(){Gt.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)}Gt.prototype={defaults:{},set:function(t){return u(this.options,t),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(t){if(v(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 v(t,"dropRecognizeWith",this)||(t=Ht(t,this),delete this.simultaneous[t.id]),this},requireFailure:function(t){if(v(t,"requireFailure",this))return this;var e=this.requireFail;return-1===M(e,t=Ht(t,this))&&(e.push(t),t.requireFailure(this)),this},dropRequireFailure:function(t){if(v(t,"dropRequireFailure",this))return this;t=Ht(t,this);var e=M(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 r(n){e.manager.emit(n,t)}n<8&&r(e.options.event+jt(n)),r(e.options.event),t.additionalEvent&&r(t.additionalEvent),n>=8&&r(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|Ut)))return!1;t++}return!0},recognize:function(t){var e=u({},t);if(!w(this.options.enable,[this,e]))return this.reset(),void(this.state=Nt);56&this.state&&(this.state=Ut),this.state=this.process(e),30&this.state&&this.tryEmit(e)},process:function(t){},getTouchAction:function(){},reset:function(){}},b(Jt,Gt,{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,r=6&e,i=this.attrTest(t);return r&&(n&V||!i)?16|e:r||i?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&K&&e.push(Ft),t&X&&e.push(Ot),e},directionTest:function(t){var e=this.options,n=!0,r=t.distance,i=t.direction,o=t.deltaX,a=t.deltaY;return i&e.direction||(e.direction&K?(i=0===o?H:o<0?J:W,n=o!=this.pX,r=Math.abs(t.deltaX)):(i=0===a?H:a<0?Q:q,n=a!=this.pY,r=Math.abs(t.deltaY))),t.direction=i,n&&r>e.threshold&&i&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[Lt]},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(qt,Gt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Zt]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,r=t.distance<e.threshold,i=t.deltaTime>e.time;if(this._input=t,!r||!n||t.eventType&(j|V)&&!i)this.reset();else if(t.eventType&G)this.reset(),this._timer=A((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=d(),this.manager.emit(this.options.event,this._input)))}}),b(Kt,Jt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Lt]},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:K|X,pointers:1},getTouchAction:function(){return Wt.prototype.getTouchAction.call(this)},attrTest:function(t){var e,n=this.options.direction;return n&(K|X)?e=t.overallVelocity:n&K?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&&p(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,Gt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Dt]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,r=t.distance<e.threshold,i=t.deltaTime<e.time;if(this.reset(),t.eventType&G&&0===this.count)return this.failTimeout();if(r&&i&&n){if(t.eventType!=j)return this.failTimeout();var o=!this.pTime||t.timeStamp-this.pTime<e.interval,a=!this.pCenter||st(this.pCenter,t.center)<e.posThreshold;if(this.pTime=t.timeStamp,this.pCenter=t.center,a&&o?this.count+=1:this.count=1,this._input=t,0===this.count%e.taps)return this.hasRequireFailures()?(this._timer=A((function(){this.state=8,this.tryEmit()}),e.interval,this),2):8}return Nt},failTimeout:function(){return this._timer=A((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:Pt,enable:!0,inputTarget:null,inputClass:null,preset:[[Kt,{enable:!1}],[Qt,{enable:!1},["rotate"]],[Xt,{direction:K}],[Wt,{direction:K},["swipe"]],[Yt],[Yt,{event:"doubletap",taps:2},["tap"]],[qt]],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=u({},$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||(F?gt:R?wt:O?kt:ft))(n,nt),this.touchAction=new zt(this,this.options.touchAction),ee(this,!0),g(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,r=t.element;r.style&&(g(t.options.cssProps,(function(i,o){n=Z(r.style,o),e?(t.oldCssProps[n]=r.style[n],r.style[n]=i):r.style[n]=t.oldCssProps[n]||""})),e||(t.oldCssProps={}))}te.prototype={set:function(t){return u(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 r=this.recognizers,i=e.curRecognizer;(!i||i&&8&i.state)&&(i=e.curRecognizer=null);for(var o=0;o<r.length;)n=r[o],2===e.stopped||i&&n!=i&&!n.canRecognizeWith(i)?n.reset():n.recognize(t),!i&&14&n.state&&(i=e.curRecognizer=n),o++}},get:function(t){if(t instanceof Gt)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(v(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(v(t,"remove",this))return this;if(t=this.get(t)){var e=this.recognizers,n=M(e,t);-1!==n&&(e.splice(n,1),this.touchAction.update())}return this},on:function(t,e){if(t!==s&&e!==s){var n=this.handlers;return g(T(t),(function(t){n[t]=n[t]||[],n[t].push(e)})),this}},off:function(t,e){if(t!==s){var n=this.handlers;return g(T(t),(function(t){e?n[t]&&n[t].splice(M(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 r=0;r<n.length;)n[r](e),r++}},destroy:function(){this.element&&ee(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},u($t,{INPUT_START:G,INPUT_MOVE:2,INPUT_END:j,INPUT_CANCEL:V,STATE_POSSIBLE:Ut,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:q,DIRECTION_HORIZONTAL:K,DIRECTION_VERTICAL:X,DIRECTION_ALL:Y,Manager:te,Input:et,TouchAction:zt,TouchInput:wt,MouseInput:ft,PointerEventInput:gt,TouchMouseInput:kt,SingleTouchInput:yt,Recognizer:Gt,AttrRecognizer:Jt,Tap:Yt,Pan:Wt,Swipe:Xt,Pinch:Qt,Rotate:Kt,Press:qt,on:B,off:k,each:g,merge:_,extend:y,assign:u,inherit:b,bindFn:x,prefixed:Z}),("undefined"!==typeof i?i:"undefined"!==typeof self?self:{}).Hammer=$t,(r=function(){return $t}.call(e,n,e,t))===s||(t.exports=r)}(window,document)},70356:function(t,e){e.read=function(t,e,n,r,i){var o,a,s=8*i-r-1,u=(1<<s)-1,l=u>>1,c=-7,h=n?i-1:0,f=n?-1:1,p=t[e+h];for(h+=f,o=p&(1<<-c)-1,p>>=-c,c+=s;c>0;o=256*o+t[e+h],h+=f,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=r;c>0;a=256*a+t[e+h],h+=f,c-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),o-=l}return(p?-1:1)*a*Math.pow(2,o-r)},e.write=function(t,e,n,r,i,o){var a,s,u,l=8*o-i-1,c=(1<<l)-1,h=c>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,d=r?1:-1,A=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+h>=1?f/u:f*Math.pow(2,1-h))*u>=2&&(a++,u/=2),a+h>=c?(s=0,a=c):a+h>=1?(s=(e*u-1)*Math.pow(2,i),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;t[n+p]=255&s,p+=d,s/=256,i-=8);for(a=a<<i|s,l+=i;l>0;t[n+p]=255&a,p+=d,a/=256,l-=8);t[n+p-d]|=128*A}},42103:function(t,e){!function(n){"use strict";var r="Compound",i="MemberExpression",o="Literal",a=function(t,e){var n=new Error(t+" at character "+e);throw n.index=e,n.description=t,n},s=!0,u={"-":s,"!":s,"~":s,"+":s},l={"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},c=function(t){var e,n=0;for(var r in t)(e=r.length)>n&&t.hasOwnProperty(r)&&(n=e);return n},h=c(u),f=c(l),p={true:!0,false:!1,null:null},d=function(t){return l[t]||0},A=function(t,e,n){return{type:"||"===t||"&&"===t?"LogicalExpression":"BinaryExpression",operator:t,left:e,right:n}},v=function(t){return t>=48&&t<=57},g=function(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||t>=128&&!l[String.fromCharCode(t)]},m=function(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||t>=128&&!l[String.fromCharCode(t)]},y=function(t){for(var e,n,s=0,c=t.charAt,y=t.charCodeAt,_=function(e){return c.call(t,e)},b=function(e){return y.call(t,e)},x=t.length,w=function(){for(var t=b(s);32===t||9===t||10===t||13===t;)t=b(++s)},C=function t(){var e,n,r=k();return w(),63!==b(s)?r:(s++,(e=t())||a("Expected expression",s),w(),58===b(s)?(s++,(n=t())||a("Expected expression",s),{type:"ConditionalExpression",test:r,consequent:e,alternate:n}):void a("Expected :",s))},B=function(){w();for(var e=t.substr(s,f),n=e.length;n>0;){if(l.hasOwnProperty(e)&&(!g(b(s))||s+e.length<t.length&&!m(b(s+e.length))))return s+=n,e;e=e.substr(0,--n)}return!1},k=function(){var t,e,n,r,i,o,u,l,c;if(o=E(),!(e=B()))return o;for(i={value:e,prec:d(e)},(u=E())||a("Expected expression after "+e,s),r=[o,i,u];(e=B())&&0!==(n=d(e));){for(i={value:e,prec:n},c=e;r.length>2&&n<=r[r.length-2].prec;)u=r.pop(),e=r.pop().value,o=r.pop(),t=A(e,o,u),r.push(t);(t=E())||a("Expected expression after "+c,s),r.push(i,t)}for(t=r[l=r.length-1];l>1;)t=A(r[l-1].value,r[l-2],t),l-=2;return t},E=function e(){var n,r,i;if(w(),n=b(s),v(n)||46===n)return S();if(39===n||34===n)return T();if(91===n)return D();for(i=(r=t.substr(s,h)).length;i>0;){if(u.hasOwnProperty(r)&&(!g(b(s))||s+r.length<t.length&&!m(b(s+r.length))))return s+=i,{type:"UnaryExpression",operator:r,argument:e(),prefix:!0};r=r.substr(0,--i)}return!(!g(n)&&40!==n)&&P()},S=function(){for(var t,e,n="";v(b(s));)n+=_(s++);if(46===b(s))for(n+=_(s++);v(b(s));)n+=_(s++);if("e"===(t=_(s))||"E"===t){for(n+=_(s++),"+"!==(t=_(s))&&"-"!==t||(n+=_(s++));v(b(s));)n+=_(s++);v(b(s-1))||a("Expected exponent ("+n+_(s)+")",s)}return e=b(s),g(e)?a("Variable names cannot start with a number ("+n+_(s)+")",s):46===e&&a("Unexpected period",s),{type:o,value:parseFloat(n),raw:n}},T=function(){for(var t,e="",n=_(s++),r=!1;s<x;){if((t=_(s++))===n){r=!0;break}if("\\"===t)switch(t=_(s++)){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 r||a('Unclosed quote after "'+e+'"',s),{type:o,value:e,raw:n+e+n}},M=function(){var e,n=b(s),r=s;for(g(n)?s++:a("Unexpected "+_(s),s);s<x&&(n=b(s),m(n));)s++;return e=t.slice(r,s),p.hasOwnProperty(e)?{type:o,value:p[e],raw:e}:"this"===e?{type:"ThisExpression"}:{type:"Identifier",name:e}},I=function(t){for(var e,n,i=[],o=!1,u=0;s<x;){if(w(),(e=b(s))===t){o=!0,s++,41===t&&u&&u>=i.length&&a("Unexpected token "+String.fromCharCode(t),s);break}if(44===e){if(s++,++u!==i.length)if(41===t)a("Unexpected token ,",s);else if(93===t)for(var l=i.length;l<u;l++)i.push(null)}else(n=C())&&n.type!==r||a("Expected comma",s),i.push(n)}return o||a("Expected "+String.fromCharCode(t),s),i},P=function(){var t,e;for(e=40===(t=b(s))?Z():M(),w(),t=b(s);46===t||91===t||40===t;)s++,46===t?(w(),e={type:i,computed:!1,object:e,property:M()}):91===t?(e={type:i,computed:!0,object:e,property:C()},w(),93!==(t=b(s))&&a("Unclosed [",s),s++):40===t&&(e={type:"CallExpression",arguments:I(41),callee:e}),w(),t=b(s);return e},Z=function(){s++;var t=C();if(w(),41===b(s))return s++,t;a("Unclosed (",s)},D=function(){return s++,{type:"ArrayExpression",elements:I(93)}},L=[];s<x;)59===(e=b(s))||44===e?s++:(n=C())?L.push(n):s<x&&a('Unexpected "'+_(s)+'"',s);return 1===L.length?L[0]:{type:r,body:L}};y.version="0.3.5",y.toString=function(){return"JavaScript Expression Parser (JSEP) v"+y.version},y.addUnaryOp=function(t){return h=Math.max(t.length,h),u[t]=s,this},y.addBinaryOp=function(t,e){return f=Math.max(t.length,f),l[t]=e,this},y.addLiteral=function(t,e){return p[t]=e,this},y.removeUnaryOp=function(t){return delete u[t],t.length===h&&(h=c(u)),this},y.removeAllUnaryOps=function(){return u={},h=0,this},y.removeBinaryOp=function(t){return delete l[t],t.length===f&&(f=c(l)),this},y.removeAllBinaryOps=function(){return l={},f=0,this},y.removeLiteral=function(t){return delete p[t],this},y.removeAllLiterals=function(){return p={},this},t.exports?e=t.exports=y:e.parse=y}()},88687:function(t,e,n){"use strict";var r,i,o,a,s,u,l,c;new Uint8Array([0]);!function(t){t[t.NONE=0]="NONE",t[t.BASISLZ=1]="BASISLZ",t[t.ZSTD=2]="ZSTD",t[t.ZLIB=3]="ZLIB"}(r||(r={})),function(t){t[t.BASICFORMAT=0]="BASICFORMAT"}(i||(i={})),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"}(a||(a={})),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"}(s||(s={})),function(t){t[t.ALPHA_STRAIGHT=0]="ALPHA_STRAIGHT",t[t.ALPHA_PREMULTIPLIED=1]="ALPHA_PREMULTIPLIED"}(u||(u={})),function(t){t[t.RGB=0]="RGB",t[t.RRR=3]="RRR",t[t.GGG=4]="GGG",t[t.AAA=15]="AAA"}(l||(l={})),function(t){t[t.RGB=0]="RGB",t[t.RGBA=3]="RGBA",t[t.RRR=4]="RRR",t[t.RRRG=5]="RRRG"}(c||(c={}))},62813:function(t,e,n){var r=n(19156);t.exports=function(t,e){return r(t,e)}},9794:function(t){t.exports=function(){"use strict";var t,e,n;function r(r,i){if(t)if(e){var o="var sharedChunk = {}; ("+t+")(sharedChunk); ("+e+")(sharedChunk);",a={};t(a),n=i(a),"undefined"!==typeof window&&(n.workerUrl=window.URL.createObjectURL(new Blob([o],{type:"text/javascript"})))}else e=i;else t=i}return r(["exports"],(function(t){function e(t,e){return t(e={exports:{}},e.exports),e.exports}var n=r;function r(t,e,n,r){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*(r-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=r,this.p2x=n,this.p2y=r}r.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},r.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},r.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},r.prototype.solveCurveX=function(t,e){var n,r,i,o,a;for(void 0===e&&(e=1e-6),i=t,a=0;a<8;a++){if(o=this.sampleCurveX(i)-t,Math.abs(o)<e)return i;var s=this.sampleCurveDerivativeX(i);if(Math.abs(s)<1e-6)break;i-=o/s}if((i=t)<(n=0))return n;if(i>(r=1))return r;for(;n<r;){if(o=this.sampleCurveX(i),Math.abs(o-t)<e)return i;t>o?n=i:r=i,i=.5*(r-n)+n}return i},r.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var i=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),r=n*this.x+e*this.y;return this.x=e*this.x-n*this.y,this.y=r,this},_rotateAround:function(t,e){var n=Math.cos(t),r=Math.sin(t),i=e.y+r*(this.x-e.x)+n*(this.y-e.y);return this.x=e.x+n*(this.x-e.x)-r*(this.y-e.y),this.y=i,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 a="undefined"!=typeof self?self:{},s=Math.pow(2,53)-1;function u(t,e,r,i){var o=new n(t,e,r,i);return function(t){return o.solve(t)}}var l=u(.25,.1,.25,1);function c(t,e,n){return Math.min(n,Math.max(e,t))}function h(t,e,n){var r=n-e,i=((t-e)%r+r)%r+e;return i===e?n:i}function f(t){for(var e=[],n=arguments.length-1;n-- >0;)e[n]=arguments[n+1];for(var r=0,i=e;r<i.length;r+=1){var o=i[r];for(var a in o)t[a]=o[a]}return t}var p=1;function d(){return p++}function A(){return function t(e){return e?(e^16*Math.random()>>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function v(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 g(t,e){t.forEach((function(t){e[t]&&(e[t]=e[t].bind(e))}))}function m(t,e){return-1!==t.indexOf(e,t.length-e.length)}function y(t,e,n){var r={};for(var i in t)r[i]=e.call(n||this,t[i],i,t);return r}function _(t,e,n){var r={};for(var i in t)e.call(n||this,t[i],i,t)&&(r[i]=t[i]);return r}function b(t){return Array.isArray(t)?t.map(b):"object"==typeof t&&t?y(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,r=t.length,i=r-1,o=void 0,a=void 0;n<r;i=n++)e+=((a=t[i]).x-(o=t[n]).x)*(o.y+a.y);return e}function k(){return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}function E(t){var e={};if(t.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(t,n,r,i){var o=r||i;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 T(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 M(t){try{var e=a[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return!1}}var I,P,Z,D,L=a.performance&&a.performance.now?a.performance.now.bind(a.performance):Date.now.bind(Date),O=a.requestAnimationFrame||a.mozRequestAnimationFrame||a.webkitRequestAnimationFrame||a.msRequestAnimationFrame,F=a.cancelAnimationFrame||a.mozCancelAnimationFrame||a.webkitCancelAnimationFrame||a.msCancelAnimationFrame,R={now:L,frame:function(t){var e=O(t);return{cancel:function(){return F(e)}}},getImageData:function(t,e){void 0===e&&(e=0);var n=a.document.createElement("canvas"),r=n.getContext("2d");if(!r)throw new Error("failed to create canvas 2d context");return n.width=t.width,n.height=t.height,r.drawImage(t,0,0,t.width,t.height),r.getImageData(-e,-e,t.width+2*e,t.height+2*e)},resolveURL:function(t){return I||(I=a.document.createElement("a")),I.href=t,I.href},hardwareConcurrency:a.navigator&&a.navigator.hardwareConcurrency||4,get devicePixelRatio(){return a.devicePixelRatio},get prefersReducedMotion(){return!!a.matchMedia&&(null==P&&(P=a.matchMedia("(prefers-reduced-motion: reduce)")),P.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},U={supported:!1,testSupport:function(t){!N&&D&&(G?j(t):Z=t)}},N=!1,G=!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,D),t.isContextLost())return;U.supported=!0}catch(t){}t.deleteTexture(e),N=!0}a.document&&((D=a.document.createElement("img")).onload=function(){Z&&j(Z),Z=null,G=!0},D.onerror=function(){N=!0,Z=null},D.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=K(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=K(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=K(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,r){var i=K(t);return J(t)?(i.path="/styles/v1"+i.path+"/sprite"+e+n,this._makeAPIURL(i,this._customAccessToken||r)):(i.path+=""+e+n,X(i))},H.prototype.normalizeTileURL=function(t,e){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!J(t))return t;var n=K(t);n.path=n.path.replace(/(\.(png|jpg)\d*)(?=$)/,(R.devicePixelRatio>=2||512===e?"@2x":"")+(U.supported?".webp":"$1")),n.path=n.path.replace(/^.+\/v4\//,"/"),n.path="/v4"+n.path;var r=this._customAccessToken||function(t){for(var e=0,n=t;e<n.length;e+=1){var r=n[e].match(/^access_token=(.*)$/);if(r)return r[1]}return null}(n.params)||z.ACCESS_TOKEN;return z.REQUIRE_ACCESS_TOKEN&&r&&this._skuToken&&n.params.push("sku="+this._skuToken),this._makeAPIURL(n,r)},H.prototype.canonicalizeTileURL=function(t,e){var n=K(t);if(!n.path.match(/(^\/v4\/)/)||!n.path.match(/\.[\w]+$/))return t;var r="mapbox://tiles/";r+=n.path.replace("/v4/","");var i=n.params;return e&&(i=i.filter((function(t){return!t.match(/^access_token=/)}))),i.length&&(r+="?"+i.join("&")),r},H.prototype.canonicalizeTileset=function(t,e){for(var n=!!e&&J(e),r=[],i=0,o=t.tiles||[];i<o.length;i+=1){var a=o[i];Q(a)?r.push(this.canonicalizeTileURL(a,n)):r.push(a)}return r},H.prototype._makeAPIURL=function(t,e){var n="See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes",r=K(z.API_URL);if(t.protocol=r.protocol,t.authority=r.authority,"http"===t.protocol){var i=t.params.indexOf("secure");i>=0&&t.params.splice(i,1)}if("/"!==r.path&&(t.path=""+r.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 q=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function K(t){var e=t.match(q);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(a.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?a.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=M("localStorage"),e=this.getStorageKey(),n=this.getStorageKey("uuid");if(t)try{var r=a.localStorage.getItem(e);r&&(this.eventData=JSON.parse(r));var i=a.localStorage.getItem(n);i&&(this.anonId=i)}catch(t){w("Unable to read from LocalStorage")}},$.prototype.saveEventData=function(){var t=M("localStorage"),e=this.getStorageKey(),n=this.getStorageKey("uuid");if(t)try{a.localStorage.setItem(n,this.anonId),Object.keys(this.eventData).length>=1&&a.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,r){var i=this;if(z.EVENTS_URL){var o=K(z.EVENTS_URL);o.params.push("access_token="+(r||z.ACCESS_TOKEN||""));var a={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.13.2",skuId:V,userId:this.anonId},s=e?f(a,e):a,u={url:X(o),headers:{"Content-Type":"text/plain"},body:JSON.stringify([s])};this.pendingRequest=bt(u,(function(t){i.pendingRequest=null,n(t),i.saveEventData(),i.processRequests(r)}))}},$.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,r){this.skuToken=n,(z.EVENTS_URL&&r||z.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return J(t)||Q(t)})))&&this.queueRequest({id:e,timestamp:Date.now()},r)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){var n=this.queue.shift(),r=n.id,i=n.timestamp;r&&this.success[r]||(this.anonId||this.fetchEventData(),v(this.anonId)||(this.anonId=A()),this.postEvent(i,{skuToken:this.skuToken},(function(t){t||r&&(e.success[r]=!0)}),t))}},e}($),rt=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),r=n?n.u:z.ACCESS_TOKEN,i=r!==this.eventData.tokenU;v(this.anonId)||(this.anonId=A(),i=!0);var o=this.queue.shift();if(this.eventData.lastSuccess){var a=new Date(this.eventData.lastSuccess),s=new Date(o),u=(o-this.eventData.lastSuccess)/864e5;i=i||u>=1||u<-1||a.getDate()!==s.getDate()}else i=!0;if(!i)return this.processRequests();this.postEvent(o,{"enabled.telemetry":!1},(function(t){t||(e.eventData.lastSuccess=o,e.eventData.tokenU=r)}),t)}},e}($)),it=rt.postTurnstileEvent.bind(rt),ot=new nt,at=ot.postMapLoadEvent.bind(ot),st=500,ut=50;function lt(){a.caches&&!tt&&(tt=a.caches.open("mapbox-tiles"))}function ct(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}var ht,ft=1/0;function pt(){return null==ht&&(ht=a.OffscreenCanvas&&new a.OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof a.createImageBitmap),ht}var dt={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(dt);var At,vt,gt=function(t){function e(e,n,r){401===n&&Q(r)&&(e+=": you may have provided an invali
2d Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),t.call(this,e),this.status=n,this.url=r,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),mt=k()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===a.location.protocol?a.parent:a).location.href},yt=function(t,e){if(!(/^file:/.test(n=t.url)||/^file:/.test(mt())&&!/^\w+:/.test(n))){if(a.fetch&&a.Request&&a.AbortController&&a.Request.prototype.hasOwnProperty("signal"))return function(t,e){var n,r=new a.AbortController,i=new a.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:mt(),signal:r.signal}),o=!1,s=!1,u=(n=i.url).indexOf("sku=")>0&&Q(n);"json"===t.type&&i.headers.set("Accept","application/json");var l=function(n,r,o){if(!s){if(n&&"SecurityError"!==n.message&&w(n),r&&o)return c(r);var l=Date.now();a.fetch(i).then((function(n){if(n.ok){var r=u?n.clone():null;return c(n,r,l)}return e(new gt(n.statusText,n.status,t.url))})).catch((function(t){20!==t.code&&e(new Error(t.message))}))}},c=function(n,r,u){("arrayBuffer"===t.type?n.arrayBuffer():"json"===t.type?n.json():n.text()).then((function(t){s||(r&&u&&function(t,e,n){if(lt(),tt){var r={status:e.status,statusText:e.statusText,headers:new a.Headers};e.headers.forEach((function(t,e){return r.headers.set(e,t)}));var i=E(e.headers.get("Cache-Control")||"");i["no-store"]||(i["max-age"]&&r.headers.set("Expires",new Date(n+1e3*i["max-age"]).toUTCString()),new Date(r.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 a.Response(e,r);lt(),tt&&tt.then((function(e){return e.put(ct(t.url),n)})).catch((function(t){return w(t.message)}))})))}}(i,r,u),o=!0,e(null,t,n.headers.get("Cache-Control"),n.headers.get("Expires")))})).catch((function(t){s||e(new Error(t.message))}))};return u?function(t,e){if(lt(),!tt)return e(null);var n=ct(t.url);tt.then((function(t){t.match(n).then((function(r){var i=function(t){if(!t)return!1;var e=new Date(t.headers.get("Expires")||0),n=E(t.headers.get("Cache-Control")||"");return e>Date.now()&&!n["no-cache"]}(r);t.delete(n),i&&t.put(n,r.clone()),e(null,r,i)})).catch(e)})).catch(e)}(i,l):l(null,null),{cancel:function(){s=!0,o||r.abort()}}}(t,e);if(k()&&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 a.XMLHttpRequest;for(var r in n.open(t.method||"GET",t.url,!0),"arrayBuffer"===t.type&&(n.responseType="arraybuffer"),t.headers)n.setRequestHeader(r,t.headers[r]);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 r=n.response;if("json"===t.type)try{r=JSON.parse(n.response)}catch(t){return e(t)}e(null,r,n.getResponseHeader("Cache-Control"),n.getResponseHeader("Expires"))}else e(new gt(n.statusText,n.status,t.url))},n.send(t.body),{cancel:function(){return n.abort()}}}(t,e)},_t=function(t,e){return yt(f(t,{type:"arrayBuffer"}),e)},bt=function(t,e){return yt(f(t,{method:"POST"}),e)},xt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";At=[],vt=0;var wt=function t(e,n){if(U.supported&&(e.headers||(e.headers={}),e.headers.accept="image/webp,*/*"),vt>=z.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:e,callback:n,cancelled:!1,cancel:function(){this.cancelled=!0}};return At.push(r),r}vt++;var i=!1,o=function(){if(!i)for(i=!0,vt--;At.length&&vt<z.MAX_PARALLEL_IMAGE_REQUESTS;){var e=At.shift();e.cancelled||(e.cancel=t(e.requestParameters,e.callback).cancel)}},s=_t(e,(function(t,e,r,i){o(),t?n(t):e&&(pt()?function(t,e){var n=new a.Blob([new Uint8Array(t)],{type:"image/png"});a.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."))}))}(e,n):function(t,e,n,r){var i=new a.Image,o=a.URL;i.onload=function(){e(null,i),o.revokeObjectURL(i.src),i.onload=null,a.requestAnimationFrame((function(){i.src=xt}))},i.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 s=new a.Blob([new Uint8Array(t)],{type:"image/png"});i.cacheControl=n,i.expires=r,i.src=t.byteLength?o.createObjectURL(s):xt}(e,n,r,i))}));
vendor: 1,743 bytes, line 2
2return{cancel:function(){s.cancel(),o()}}};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 r=n[t].indexOf(e);-1!==r&&n[t].splice(r,1)}}var kt=function(t,e){void 0===e&&(e={}),f(this,e),this.type=t},Et=function(t){function e(e,n){void 0===n&&(n={}),t.call(this,"error",f({error:e},n))}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(kt),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 kt(t,e||{}));var n=t.type;if(this.listens(n)){t.target=this;for(var r=0,i=this._listeners&&this._listeners[n]?this._listeners[n].slice():[];r<i.length;r+=1)i[r].call(this,t);for(var o=0,a=this._oneTimeListeners&&this._oneTimeListeners[n]?this._oneTimeListeners[n].slice():[];o<a.length;o+=1){var s=a[o];Bt(n,s,this._oneTimeListeners),s.call(this,t)}var u=this._eventedParent;u&&(f(t,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),u.fire(t))}else t instanceof Et&&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 T
vendor: 19,006 bytes, line 2
2t={$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"}
vendor: 9,823 bytes, line 2
2,"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"}}}
vendor: 219,039 bytes, line 2
2,Mt=function(t,e,n,r){this.message=(t?t+": ":"")+n,r&&(this.identifier=r),null!=e&&e.__line__&&(this.line=e.__line__)};function It(t){var e=t.value;return e?[new Mt(t.key,e,"constants have been deprecated as of v8")]:[]}function Pt(t){for(var e=[],n=arguments.length-1;n-- >0;)e[n]=arguments[n+1];for(var r=0,i=e;r<i.length;r+=1){var o=i[r];for(var a in o)t[a]=o[a]}return t}function Zt(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function Dt(t){if(Array.isArray(t))return t.map(Dt);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){var e={};for(var n in t)e[n]=Dt(t[n]);return e}return Zt(t)}var Lt=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),Ot=function(t,e){void 0===e&&(e=[]),this.parent=t,this.bindings={};for(var n=0,r=e;n<r.length;n+=1){var i=r[n];this.bindings[i[0]]=i[1]}};Ot.prototype.concat=function(t){return new Ot(this,t)},Ot.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.")},Ot.prototype.has=function(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)};var Ft={kind:"null"},Rt={kind:"number"},zt={kind:"string"},Ut={kind:"boolean"},Nt={kind:"color"},Gt={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 qt=[Ft,Rt,zt,Ut,Nt,Ht,Gt,Wt(jt),Jt];function Kt(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!Kt(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,r=qt;n<r.length;n+=1)if(!Kt(r[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 r(t){return(t=Math.round(t))<0?0:t>255?255:t}function i(t){return r("%"===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 a(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,s=t.replace(/ /g,"").toLowerCase();if(s in n)return n[s].slice();if("#"===s[0])return 4===s.length?(e=parseInt(s.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===s.length&&(e=parseInt(s.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var u=s.indexOf("("),l=s.indexOf(")");if(-1!==u&&l+1===s.length){var c=s.substr(0,u),h=s.substr(u+1,l-(u+1)).split(","),f=1;switch(c){case"rgba":if(4!==h.length)return null;f=o(h.pop());case"rgb":return 3!==h.length?null:[i(h[0]),i(h[1]),i(h[2]),f];case"hsla":if(4!==h.length)return null;f=o(h.pop());case"hsl":if(3!==h.length)return null;var p=(parseFloat(h[0])%360+360)%360/360,d=o(h[1]),A=o(h[2]),v=A<=.5?A*(d+1):A+d-A*d,g=2*A-v;return[r(255*a(g,v,p+1/3)),r(255*a(g,v,p)),r(255*a(g,v,p-1/3)),f];default:return null}}return null}}catch(t){}})).parseCSSColor,te=function(t,e,n,r){void 0===r&&(r=1),this.r=t,this.g=e,this.b=n,this.a=r};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],r=t[3];return"rgba("+Math.round(t[0])+","+Math.round(e)+","+Math.round(n)+","+r+")"},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,r,i){this.text=t,this.image=e,this.scale=n,this.fontStack=r,this.textColor=i},re=function(t){this.sections=t};re.fromString=function(t){return new re([new ne(t,null,null,null,null)])},re.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}))},re.factory=function(t){return t instanceof re?t:re.fromString(t)},re.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(t){return t.text})).join("")},re.prototype.serialize=function(){for(var t=["format"],e=0,n=this.sections;e<n.length;e+=1){var r=n[e];if(r.image)t.push(["image",r.image.name]);else{t.push(r.text);var i={};r.fontStack&&(i["text-font"]=["literal",r.fontStack.split(",")]),r.scale&&(i["font-scale"]=r.scale),r.textColor&&(i["text-color"]=["rgba"].concat(r.textColor.toArray())),t.push(i)}}return t};var ie=function(t){this.name=t.name,this.available=t.available};function oe(t,e,n,r){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof n&&n>=0&&n<=255?void 0===r||"number"==typeof r&&r>=0&&r<=1?null:"Invalid rgba value ["+[t,e,n,r].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof r?[t,e,n,r]:[t,e,n]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function ae(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 re)return!0;if(t instanceof ie)return!0;if(Array.isArray(t)){for(var e=0,n=t;e<n.length;e+=1)if(!ae(n[e]))return!1;return!0}if("object"==typeof t){for(var r in t)if(!ae(t[r]))return!1;return!0}return!1}function se(t){if(null===t)return Ft;if("string"==typeof t)return zt;if("boolean"==typeof t)return Ut;if("number"==typeof t)return Rt;if(t instanceof te)return Nt;if(t instanceof ee)return Vt;if(t instanceof re)return Ht;if(t instanceof ie)return Jt;if(Array.isArray(t)){for(var e,n=t.length,r=0,i=t;r<i.length;r+=1){var o=se(i[r]);if(e){if(e===o)continue;e=jt;break}e=o}return Wt(e||jt,n)}return Gt}function ue(t){var e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof te||t instanceof re||t instanceof ie?t.toString():JSON.stringify(t)}ie.prototype.toString=function(){return this.name},ie.fromString=function(t){return t?new ie({name:t,available:!1}):null},ie.prototype.serialize=function(){return["image",this.name]};var le=function(t,e){this.type=t,this.value=e};le.parse=function(t,e){if(2!==t.length)return e.error("'literal' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(!ae(t[1]))return e.error("invalid value");var n=t[1],r=se(n),i=e.expectedType;return"array"!==r.kind||0!==r.N||!i||"array"!==i.kind||"number"==typeof i.N&&0!==i.N||(r=i),new le(r,n)},le.prototype.evaluate=function(){return this.value},le.prototype.eachChild=function(){},le.prototype.outputDefined=function(){return!0},le.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 re?this.value.serialize():this.value};var ce=function(t){this.name="ExpressionEvaluationError",this.message=t};ce.prototype.toJSON=function(){return this.message};var he={string:zt,number:Rt,boolean:Ut,object:Gt},fe=function(t,e){this.type=t,this.args=e};fe.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var n,r=1,i=t[0];if("array"===i){var o,a;if(t.length>2){var s=t[1];if("string"!=typeof s||!(s in he)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);o=he[s],r++}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);a=t[2],r++}n=Wt(o,a)}else n=he[i];for(var u=[];r<t.length;r++){var l=e.parse(t[r],r,jt);if(!l)return null;u.push(l)}return new fe(n,u)},fe.prototype.evaluate=function(t){for(var e=0;e<this.args.length;e++){var n=this.args[e].evaluate(t);if(!Kt(this.type,se(n)))return n;if(e===this.args.length-1)throw new ce("Expected value to be of type "+Qt(this.type)+", but found "+Qt(se(n))+" instead.")}return null},fe.prototype.eachChild=function(t){this.args.forEach(t)},fe.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},fe.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 r=t.N;("number"==typeof r||this.args.length>1)&&e.push(r)}}return e.concat(this.args.map((function(t){return t.serialize()})))};var pe=function(t){this.type=Ht,this.sections=t};pe.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 r=[],i=!1,o=1;o<=t.length-1;++o){var a=t[o];if(i&&"object"==typeof a&&!Array.isArray(a)){i=!1;var s=null;if(a["font-scale"]&&!(s=e.parse(a["font-scale"],1,Rt)))return null;var u=null;if(a["text-font"]&&!(u=e.parse(a["text-font"],1,Wt(zt))))return null;var l=null;if(a["text-color"]&&!(l=e.parse(a["text-color"],1,Nt)))return null;var c=r[r.length-1];c.scale=s,c.font=u,c.textColor=l}else{var h=e.parse(t[o],1,jt);if(!h)return null;var f=h.type.kind;if("string"!==f&&"value"!==f&&"null"!==f&&"resolvedImage"!==f)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,r.push({content:h,scale:null,font:null,textColor:null})}}return new pe(r)},pe.prototype.evaluate=function(t){return new re(this.sections.map((function(e){var n=e.content.evaluate(t);return se(n)===Jt?new ne("",n,null,null,null):new ne(ue(n),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},pe.prototype.eachChild=function(t){for(var e=0,n=this.sections;e<n.length;e+=1){var r=n[e];t(r.content),r.scale&&t(r.scale),r.font&&t(r.font),r.textColor&&t(r.textColor)}},pe.prototype.outputDefined=function(){return!1},pe.prototype.serialize=function(){for(var t=["format"],e=0,n=this.sections;e<n.length;e+=1){var r=n[e];t.push(r.content.serialize());var i={};r.scale&&(i["font-scale"]=r.scale.serialize()),r.font&&(i["text-font"]=r.font.serialize()),r.textColor&&(i["text-color"]=r.textColor.serialize()),t.push(i)}return t};var de=function(t){this.type=Jt,this.input=t};de.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 de(n):e.error("No image name provided.")},de.prototype.evaluate=function(t){var e=this.input.evaluate(t),n=ie.fromString(e);return n&&t.availableImages&&(n.available=t.availableImages.indexOf(e)>-1),n},de.prototype.eachChild=function(t){t(this.input)},de.prototype.outputDefined=function(){return!1},de.prototype.serialize=function(){return["image",this.input.serialize()]};var Ae={"to-boolean":Ut,"to-color":Nt,"to-number":Rt,"to-string":zt},ve=function(t,e){this.type=t,this.args=e};ve.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 r=Ae[n],i=[],o=1;o<t.length;o++){var a=e.parse(t[o],o,jt);if(!a)return null;i.push(a)}return new ve(r,i)},ve.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,r=0,i=this.args;r<i.length;r+=1){if(n=null,(e=i[r].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 ce(n||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"===this.type.kind){for(var a=null,s=0,u=this.args;s<u.length;s+=1){if(null===(a=u[s].evaluate(t)))return 0;var l=Number(a);if(!isNaN(l))return l}throw new ce("Could not convert "+JSON.stringify(a)+" to number.")}return"formatted"===this.type.kind?re.fromString(ue(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?ie.fromString(ue(this.args[0].evaluate(t))):ue(this.args[0].evaluate(t))},ve.prototype.eachChild=function(t){this.args.forEach(t)},ve.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},ve.prototype.serialize=function(){if("formatted"===this.type.kind)return new pe([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new de(this.args[0]).serialize();var t=["to-"+this.type.kind];return this.eachChild((function(e){t.push(e.serialize())})),t};var ge=["Unknown","Point","LineString","Polygon"],me=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null};me.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},me.prototype.geometryType=function(){return this.feature?"number"==typeof this.feature.type?ge[this.feature.type]:this.feature.type:null},me.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},me.prototype.canonicalID=function(){return this.canonical},me.prototype.properties=function(){return this.feature&&this.feature.properties||{}},me.prototype.parseColor=function(t){var e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=te.parse(t)),e};var ye=function(t,e,n,r){this.name=t,this.type=e,this._evaluate=n,this.args=r};ye.prototype.evaluate=function(t){return this._evaluate(t,this.args)},ye.prototype.eachChild=function(t){this.args.forEach(t)},ye.prototype.outputDefined=function(){return!1},ye.prototype.serialize=function(){return[this.name].concat(this.args.map((function(t){return t.serialize()})))},ye.parse=function(t,e){var n,r=t[0],i=ye.definitions[r];if(!i)return e.error('Unknown expression "'+r+'". If you wanted a literal array, use ["literal", [...]].',0);for(var o=Array.isArray(i)?i[0]:i.type,a=Array.isArray(i)?[[i[1],i[2]]]:i.overloads,s=a.filter((function(e){var n=e[0];return!Array.isArray(n)||n.length===t.length-1})),u=null,l=0,c=s;l<c.length;l+=1){var h=c[l],f=h[0],p=h[1];u=new Ne(e.registry,e.path,null,e.scope);for(var d=[],A=!1,v=1;v<t.length;v++){var g=t[v],m=Array.isArray(f)?f[v-1]:f.type,y=u.parse(g,1+d.length,m);if(!y){A=!0;break}d.push(y)}if(!A)if(Array.isArray(f)&&f.length!==d.length)u.error("Expected "+f.length+" arguments, but found "+d.length+" instead.");else{for(var _=0;_<d.length;_++){var b=Array.isArray(f)?f[_]:f.type,x=d[_];u.concat(_+1).checkSubtype(b,x.type)}if(0===u.errors.length)return new ye(r,o,p,d)}}if(1===s.length)(n=e.errors).push.apply(n,u.errors);else{for(var w=(s.length?s:a).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 k=e.parse(t[B],1+C.length);if(!k)return null;C.push(Qt(k.type))}e.error("Expected arguments of type "+w+", but found ("+C.join(", ")+") instead.")}return null},ye.register=function(t,e){for(var n in ye.definitions=e,e)t[n]=ye};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,r=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t[1]*Math.PI/360)))/360,i=Math.pow(2,e.z);return[Math.round(n*i*8192),Math.round(r*i*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,r,i,o,a,s,u,l=!1,c=0,h=e.length;c<h;c++)for(var f=e[c],p=0,d=f.length;p<d-1;p++){if((o=(n=t)[0]-(r=f[p])[0])*(u=n[1]-(i=f[p+1])[1])-(s=n[0]-i[0])*(a=n[1]-r[1])==0&&o*s<=0&&a*u<=0)return!1;Ce(t,f[p],f[p+1])&&(l=!l)}return l}function ke(t,e){for(var n=0;n<e.length;n++)if(Be(t,e[n]))return!0;return!1}function Ee(t,e,n,r){var i=r[0]-n[0],o=r[1]-n[1],a=(t[0]-n[0])*o-i*(t[1]-n[1]),s=(e[0]-n[0])*o-i*(e[1]-n[1]);return a>0&&s<0||a<0&&s>0}function Se(t,e,n){for(var r=0,i=n;r<i.length;r+=1)for(var o=i[r],a=0;a<o.length-1;++a)if(0!=(h=[(c=o[a+1])[0]-(l=o[a])[0],c[1]-l[1]])[0]*(f=[(u=e)[0]-(s=t)[0],u[1]-s[1]])[1]-h[1]*f[0]&&Ee(s,u,l,c)&&Ee(l,c,s,u))return!0;var s,u,l,c,h,f;return!1}function Te(t,e){for(var n=0;n<t.length;++n)if(!Be(t[n],e))return!1;for(var r=0;r<t.length-1;++r)if(Se(t[r],t[r+1],e))return!1;return!0}function Me(t,e){for(var n=0;n<e.length;n++)if(Te(t,e[n]))return!0;return!1}function Ie(t,e,n){for(var r=[],i=0;i<t.length;i++){for(var o=[],a=0;a<t[i].length;a++){var s=we(t[i][a],n);be(e,s),o.push(s)}r.push(o)}return r}function Pe(t,e,n){for(var r=[],i=0;i<t.length;i++){var o=Ie(t[i],e,n);r.push(o)}return r}function Ze(t,e,n,r){if(t[0]<n[0]||t[0]>n[2]){var i=.5*r,o=t[0]-n[0]>i?-r:n[0]-t[0]>i?r:0;0===o&&(o=t[0]-n[2]>i?-r:n[2]-t[0]>i?r:0),t[0]+=o}be(e,t)}function De(t,e,n,r){for(var i=8192*Math.pow(2,r.z),o=[8192*r.x,8192*r.y],a=[],s=0,u=t;s<u.length;s+=1)for(var l=0,c=u[s];l<c.length;l+=1){var h=c[l],f=[h.x+o[0],h.y+o[1]];Ze(f,e,n,i),a.push(f)}return a}function Le(t,e,n,r){for(var i,o=8192*Math.pow(2,r.z),a=[8192*r.x,8192*r.y],s=[],u=0,l=t;u<l.length;u+=1){for(var c=[],h=0,f=l[u];h<f.length;h+=1){var p=f[h],d=[p.x+a[0],p.y+a[1]];be(e,d),c.push(d)}s.push(c)}if(e[2]-e[0]<=o/2){(i=e)[0]=i[1]=1/0,i[2]=i[3]=-1/0;for(var A=0,v=s;A<v.length;A+=1)for(var g=0,m=v[A];g<m.length;g+=1)Ze(m[g],e,n,o)}return s}_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 r=e.parse(void 0!==n["case-sensitive"]&&n["case-sensitive"],1,Ut);if(!r)return null;var i=e.parse(void 0!==n["diacritic-sensitive"]&&n["diacritic-sensitive"],1,Ut);if(!i)return null;var o=null;return n.locale&&!(o=e.parse(n.locale,1,zt))?null:new _e(r,i,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 Oe=function(t,e){this.type=Ut,this.geojson=t,this.geometries=e};function Fe(t){if(t instanceof ye){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 Oe)return!1;var e=!0;return t.eachChild((function(t){e&&!Fe(t)&&(e=!1)})),e}function Re(t){if(t instanceof ye&&"feature-state"===t.name)return!1;var e=!0;return t.eachChild((function(t){e&&!Re(t)&&(e=!1)})),e}function ze(t,e){if(t instanceof ye&&e.indexOf(t.name)>=0)return!1;var n=!0;return t.eachChild((function(t){n&&!ze(t,e)&&(n=!1)})),n}Oe.parse=function(t,e){if(2!==t.length)return e.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(ae(t[1])){var n=t[1];if("FeatureCollection"===n.type)for(var r=0;r<n.features.length;++r){var i=n.features[r].geometry.type;if("Polygon"===i||"MultiPolygon"===i)return new Oe(n,n.features[r].geometry)}else if("Feature"===n.type){var o=n.geometry.type;if("Polygon"===o||"MultiPolygon"===o)return new Oe(n,n.geometry)}else if("Polygon"===n.type||"MultiPolygon"===n.type)return new Oe(n,n)}return e.error("'within' expression requires valid geojson object that contains polygon geometry type.")},Oe.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],r=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if("Polygon"===e.type){var o=Ie(e.coordinates,r,i),a=De(t.geometry(),n,r,i);if(!xe(n,r))return!1;for(var s=0,u=a;s<u.length;s+=1)if(!Be(u[s],o))return!1}if("MultiPolygon"===e.type){var l=Pe(e.coordinates,r,i),c=De(t.geometry(),n,r,i);if(!xe(n,r))return!1;for(var h=0,f=c;h<f.length;h+=1)if(!ke(f[h],l))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],r=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if("Polygon"===e.type){var o=Ie(e.coordinates,r,i),a=Le(t.geometry(),n,r,i);if(!xe(n,r))return!1;for(var s=0,u=a;s<u.length;s+=1)if(!Te(u[s],o))return!1}if("MultiPolygon"===e.type){var l=Pe(e.coordinates,r,i),c=Le(t.geometry(),n,r,i);if(!xe(n,r))return!1;for(var h=0,f=c;h<f.length;h+=1)if(!Me(f[h],l))return!1}return!0}(t,this.geometries)}return!1},Oe.prototype.eachChild=function(){},Oe.prototype.outputDefined=function(){return!0},Oe.prototype.serialize=function(){return["within",this.geojson]};var Ue=function(t,e){this.type=e.type,this.name=t,this.boundExpression=e};Ue.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 Ue(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)},Ue.prototype.evaluate=function(t){return this.boundExpression.evaluate(t)},Ue.prototype.eachChild=function(){},Ue.prototype.outputDefined=function(){return!1},Ue.prototype.serialize=function(){return["var",this.name]};var Ne=function(t,e,n,r,i){void 0===e&&(e=[]),void 0===r&&(r=new Ot),void 0===i&&(i=[]),this.registry=t,this.path=e,this.key=e.map((function(t){return"["+t+"]"})).join(""),this.scope=r,this.errors=i,this.expectedType=n};function Ge(t,e){for(var n,r=t.length-1,i=0,o=r,a=0;i<=o;)if((n=t[a=Math.floor((i+o)/2)])<=e){if(a===r||e<t[a+1])return a;i=a+1}else{if(!(n>e))throw new ce("Input is not a number.");o=a-1}return 0}Ne.prototype.parse=function(t,e,n,r,i){return void 0===i&&(i={}),e?this.concat(e,n,r)._parse(t,i):this._parse(t,i)},Ne.prototype._parse=function(t,e){function n(t,e,n){return"assert"===n?new fe(e,[t]):"coerce"===n?new ve(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 r=t[0];if("string"!=typeof r)return this.error("Expression name must be a string, but found "+typeof r+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var i=this.registry[r];if(i){var o=i.parse(t,this);if(!o)return null;if(this.expectedType){var a=this.expectedType,s=o.type;if("string"!==a.kind&&"number"!==a.kind&&"boolean"!==a.kind&&"object"!==a.kind&&"array"!==a.kind||"value"!==s.kind)if("color"!==a.kind&&"formatted"!==a.kind&&"resolvedImage"!==a.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(a,s))return null}else o=n(o,a,e.typeAnnotation||"coerce");else o=n(o,a,e.typeAnnotation||"assert")}if(!(o instanceof le)&&"resolvedImage"!==o.type.kind&&function t(e){if(e instanceof Ue)return t(e.boundExpression);if(e instanceof ye&&"error"===e.name)return!1;if(e instanceof _e)return!1;if(e instanceof Oe)return!1;var n=e instanceof ve||e instanceof fe,r=!0;return e.eachChild((function(e){r=n?r&&t(e):r&&e instanceof le})),!!r&&Fe(e)&&ze(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(o)){var u=new me;try{o=new le(o.type,o.evaluate(u))}catch(t){return this.error(t.message),null}}return o}return this.error('Unknown expression "'+r+'". If you wanted a literal array, use ["literal", [...]].',0)}return this.error(void 0===t?"'undefined' value invalid. Use null instead.":"object"==typeof t?'Bare objects invalid. Use ["literal", {...}] instead.':"Expected an array, but found "+typeof t+" instead.")},Ne.prototype.concat=function(t,e,n){var r="number"==typeof t?this.path.concat(t):this.path,i=n?this.scope.concat(n):this.scope;return new Ne(this.registry,r,e||null,i,this.errors)},Ne.prototype.error=function(t){for(var e=[],n=arguments.length-1;n-- >0;)e[n]=arguments[n+1];var r=""+this.key+e.map((function(t){return"["+t+"]"})).join("");this.errors.push(new Lt(r,t))},Ne.prototype.checkSubtype=function(t,e){var n=Kt(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 r=0,i=n;r<i.length;r+=1){var o=i[r],a=o[1];this.labels.push(o[0]),this.outputs.push(a)}};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,Rt);if(!n)return null;var r=[],i=null;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);for(var o=1;o<t.length;o+=2){var a=1===o?-1/0:t[o],s=t[o+1],u=o,l=o+1;if("number"!=typeof a)return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',u);if(r.length&&r[r.length-1][0]>=a)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',u);var c=e.parse(s,l,i);if(!c)return null;i=i||c.type,r.push([a,c])}return new je(i,n,r)},je.prototype.evaluate=function(t){var e=this.labels,n=this.outputs;if(1===e.length)return n[0].evaluate(t);var r=this.input.evaluate(t);if(r<=e[0])return n[0].evaluate(t);var i=e.length;return r>=e[i-1]?n[i-1].evaluate(t):n[Ge(e,r)].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,r){return Ve(t,e[r],n)}))}}),Je=6/29*3*(6/29),We=Math.PI/180,Qe=180/Math.PI;function qe(t){return t>.008856451679035631?Math.pow(t,1/3):t/Je+4/29}function Ke(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),r=Ye(t.b),i=qe((.4124564*e+.3575761*n+.1804375*r)/.95047),o=qe((.2126729*e+.7151522*n+.072175*r)/1);return{l:116*o-16,a:500*(i-o),b:200*(o-qe((.0193339*e+.119192*n+.9503041*r)/1.08883)),alpha:t.a}}function tn(t){var e=(t.l+16)/116,n=isNaN(t.a)?e:e+t.a/500,r=isNaN(t.b)?e:e-t.b/200;return e=1*Ke(e),n=.95047*Ke(n),r=1.08883*Ke(r),new te(Xe(3.2404542*n-1.5371385*e-.4985314*r),Xe(-.969266*n+1.8760108*e+.041556*r),Xe(.0556434*n-.2040259*e+1.0572252*r),t.alpha)}function en(t,e,n){var r=e-t;return t+n*(r>180||r<-180?r-360*Math.round(r/360):r)}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,r=e.a,i=e.b,o=Math.atan2(i,r)*Qe;return{h:o<0?o+360:o,c:Math.sqrt(r*r+i*i),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}),an=function(t,e,n,r,i){this.type=t,this.operator=e,this.interpolation=n,this.input=r,this.labels=[],this.outputs=[];for(var o=0,a=i;o<a.length;o+=1){var s=a[o],u=s[1];this.labels.push(s[0]),this.outputs.push(u)}};function sn(t,e,n,r){var i=r-n,o=t-n;return 0===i?0:1===e?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}an.interpolationFactor=function(t,e,r,i){var o=0;if("exponential"===t.name)o=sn(e,t.base,r,i);else if("linear"===t.name)o=sn(e,1,r,i);else if("cubic-bezier"===t.name){var a=t.controlPoints;o=new n(a[0],a[1],a[2],a[3]).solve(sn(e,1,r,i))}return o},an.parse=function(t,e){var n=t[0],r=t[1],i=t[2],o=t.slice(3);if(!Array.isArray(r)||0===r.length)return e.error("Expected an interpolation type expression.",1);if("linear"===r[0])r={name:"linear"};else if("exponential"===r[0]){var a=r[1];if("number"!=typeof a)return e.error("Exponential interpolation requires a numeric base.",1,1);r={name:"exponential",base:a}}else{if("cubic-bezier"!==r[0])return e.error("Unknown interpolation type "+String(r[0]),1,0);var s=r.slice(1);if(4!==s.length||s.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);r={name:"cubic-bezier",controlPoints:s}}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(!(i=e.parse(i,2,Rt)))return null;var u=[],l=null;"interpolate-hcl"===n||"interpolate-lab"===n?l=Nt:e.expectedType&&"value"!==e.expectedType.kind&&(l=e.expectedType);for(var c=0;c<o.length;c+=2){var h=o[c],f=o[c+1],p=c+3,d=c+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.',p);if(u.length&&u[u.length-1][0]>=h)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',p);var A=e.parse(f,d,l);if(!A)return null;l=l||A.type,u.push([h,A])}return"number"===l.kind||"color"===l.kind||"array"===l.kind&&"number"===l.itemType.kind&&"number"==typeof l.N?new an(l,n,r,i,u):e.error("Type "+Qt(l)+" is not interpolatable.")},an.prototype.evaluate=function(t){var e=this.labels,n=this.outputs;if(1===e.length)return n[0].evaluate(t);var r=this.input.evaluate(t);if(r<=e[0])return n[0].evaluate(t);var i=e.length;if(r>=e[i-1])return n[i-1].evaluate(t);var o=Ge(e,r),a=an.interpolationFactor(this.interpolation,r,e[o],e[o+1]),s=n[o].evaluate(t),u=n[o+1].evaluate(t);return"interpolate"===this.operator?He[this.type.kind.toLowerCase()](s,u,a):"interpolate-hcl"===this.operator?rn.reverse(rn.interpolate(rn.forward(s),rn.forward(u),a)):nn.reverse(nn.interpolate(nn.forward(s),nn.forward(u),a))},an.prototype.eachChild=function(t){t(this.input);for(var e=0,n=this.outputs;e<n.length;e+=1)t(n[e])},an.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))},an.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 un=function(t,e){this.type=t,this.args=e};un.parse=function(t,e){if(t.length<2)return e.error("Expectected at least one argument.");var n=null,r=e.expectedType;r&&"value"!==r.kind&&(n=r);for(var i=[],o=0,a=t.slice(1);o<a.length;o+=1){var s=e.parse(a[o],1+i.length,n,void 0,{typeAnnotation:"omit"});if(!s)return null;n=n||s.type,i.push(s)}var u=r&&i.some((function(t){return Kt(r,t.type)}));return new un(u?jt:n,i)},un.prototype.evaluate=function(t){for(var e,n=null,r=0,i=0,o=this.args;i<o.length&&(r++,(n=o[i].evaluate(t))&&n instanceof ie&&!n.available&&(e||(e=n.name),n=null,r===this.args.length&&(n=e)),null===n);i+=1);return n},un.prototype.eachChild=function(t){this.args.forEach(t)},un.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},un.prototype.serialize=function(){var t=["coalesce"];return this.eachChild((function(e){t.push(e.serialize())})),t};var ln=function(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e};ln.prototype.evaluate=function(t){return this.result.evaluate(t)},ln.prototype.eachChild=function(t){for(var e=0,n=this.bindings;e<n.length;e+=1)t(n[e][1]);t(this.result)},ln.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=[],r=1;r<t.length-1;r+=2){var i=t[r];if("string"!=typeof i)return e.error("Expected string, but found "+typeof i+" instead.",r);if(/[^a-zA-Z0-9_]/.test(i))return e.error("Variable names must contain only alphanumeric characters or '_'.",r);var o=e.parse(t[r+1],r+1);if(!o)return null;n.push([i,o])}var a=e.parse(t[t.length-1],t.length-1,e.expectedType,n);return a?new ln(n,a):null},ln.prototype.outputDefined=function(){return this.result.outputDefined()},ln.prototype.serialize=function(){for(var t=["let"],e=0,n=this.bindings;e<n.length;e+=1){var r=n[e];t.push(r[0],r[1].serialize())}return t.push(this.result.serialize()),t};var cn=function(t,e,n){this.type=t,this.index=e,this.input=n};cn.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,Rt),r=e.parse(t[2],2,Wt(e.expectedType||jt));return n&&r?new cn(r.type.itemType,n,r):null},cn.prototype.evaluate=function(t){var e=this.index.evaluate(t),n=this.input.evaluate(t);if(e<0)throw new ce("Array index out of bounds: "+e+" < 0.");if(e>=n.length)throw new ce("Array index out of bounds: "+e+" > "+(n.length-1)+".");if(e!==Math.floor(e))throw new ce("Array index must be an integer, but found "+e+" instead.");return n[e]},cn.prototype.eachChild=function(t){t(this.index),t(this.input)},cn.prototype.outputDefined=function(){return!1},cn.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var hn=function(t,e){this.type=Ut,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),r=e.parse(t[2],2,jt);return n&&r?Xt(n.type,[Ut,zt,Rt,Ft,jt])?new hn(n,r):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 ce("Expected first argument to be of type boolean, string, number or null, but found "+Qt(se(e))+" instead.");if(!Yt(n,["string","array"]))throw new ce("Expected second argument to be of type array or string, but found "+Qt(se(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 fn=function(t,e,n){this.type=Rt,this.needle=t,this.haystack=e,this.fromIndex=n};fn.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),r=e.parse(t[2],2,jt);if(!n||!r)return null;if(!Xt(n.type,[Ut,zt,Rt,Ft,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 i=e.parse(t[3],3,Rt);return i?new fn(n,r,i):null}return new fn(n,r)},fn.prototype.evaluate=function(t){var e=this.needle.evaluate(t),n=this.haystack.evaluate(t);if(!Yt(e,["boolean","string","number","null"]))throw new ce("Expected first argument to be of type boolean, string, number or null, but found "+Qt(se(e))+" instead.");if(!Yt(n,["string","array"]))throw new ce("Expected second argument to be of type array or string, but found "+Qt(se(n))+" instead.");if(this.fromIndex){var r=this.fromIndex.evaluate(t);return n.indexOf(e,r)}return n.indexOf(e)},fn.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)},fn.prototype.outputDefined=function(){return!1},fn.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 pn=function(t,e,n,r,i,o){this.inputType=t,this.type=e,this.input=n,this.cases=r,this.outputs=i,this.otherwise=o};pn.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,r;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);for(var i={},o=[],a=2;a<t.length-1;a+=2){var s=t[a],u=t[a+1];Array.isArray(s)||(s=[s]);var l=e.concat(a);if(0===s.length)return l.error("Expected at least one branch label.");for(var c=0,h=s;c<h.length;c+=1){var f=h[c];if("number"!=typeof f&&"string"!=typeof f)return l.error("Branch labels must be numbers or strings.");if("number"==typeof f&&Math.abs(f)>Number.MAX_SAFE_INTEGER)return l.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof f&&Math.floor(f)!==f)return l.error("Numeric branch labels must be integer values.");if(n){if(l.checkSubtype(n,se(f)))return null}else n=se(f);if(void 0!==i[String(f)])return l.error("Branch labels must be unique.");i[String(f)]=o.length}var p=e.parse(u,a,r);if(!p)return null;r=r||p.type,o.push(p)}var d=e.parse(t[1],1,jt);if(!d)return null;var A=e.parse(t[t.length-1],t.length-1,r);return A?"value"!==d.type.kind&&e.concat(1).checkSubtype(n,d.type)?null:new pn(n,r,d,i,o,A):null},pn.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(se(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},pn.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},pn.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},pn.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],n=[],r={},i=0,o=Object.keys(this.cases).sort();i<o.length;i+=1){var a=o[i];void 0===(h=r[this.cases[a]])?(r[this.cases[a]]=n.length,n.push([this.cases[a],[a]])):n[h][1].push(a)}for(var s=function(e){return"number"===t.inputType.kind?Number(e):e},u=0,l=n;u<l.length;u+=1){var c=l[u],h=c[0],f=c[1];e.push(1===f.length?s(f[0]):f.map(s)),e.push(this.outputs[outputIndex$1].serialize())}return e.push(this.otherwise.serialize()),e};var dn=function(t,e,n){this.type=t,this.branches=e,this.otherwise=n};dn.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 r=[],i=1;i<t.length-1;i+=2){var o=e.parse(t[i],i,Ut);if(!o)return null;var a=e.parse(t[i+1],i+1,n);if(!a)return null;r.push([o,a]),n=n||a.type}var s=e.parse(t[t.length-1],t.length-1,n);return s?new dn(n,r,s):null},dn.prototype.evaluate=function(t){for(var e=0,n=this.branches;e<n.length;e+=1){var r=n[e],i=r[1];if(r[0].evaluate(t))return i.evaluate(t)}return this.otherwise.evaluate(t)},dn.prototype.eachChild=function(t){for(var e=0,n=this.branches;e<n.length;e+=1){var r=n[e],i=r[1];t(r[0]),t(i)}t(this.otherwise)},dn.prototype.outputDefined=function(){return this.branches.every((function(t){return t[1].outputDefined()}))&&this.otherwise.outputDefined()},dn.prototype.serialize=function(){var t=["case"];return this.eachChild((function(e){t.push(e.serialize())})),t};var An=function(t,e,n,r){this.type=t,this.input=e,this.beginIndex=n,this.endIndex=r};function vn(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 gn(t,e,n,r){return 0===r.compare(e,n)}function mn(t,e,n){var r="=="!==t&&"!="!==t;return function(){function i(t,e,n){this.type=Ut,this.lhs=t,this.rhs=e,this.collator=n,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}return i.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(!vn(n,o.type))return e.concat(1).error('"'+n+"\" comparisons are not supported for type '"+Qt(o.type)+"'.");var a=e.parse(t[2],2,jt);if(!a)return null;if(!vn(n,a.type))return e.concat(2).error('"'+n+"\" comparisons are not supported for type '"+Qt(a.type)+"'.");if(o.type.kind!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return e.error("Cannot compare types '"+Qt(o.type)+"' and '"+Qt(a.type)+"'.");r&&("value"===o.type.kind&&"value"!==a.type.kind?o=new fe(a.type,[o]):"value"!==o.type.kind&&"value"===a.type.kind&&(a=new fe(o.type,[a])));var s=null;if(4===t.length){if("string"!==o.type.kind&&"string"!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return e.error("Cannot use collator to compare non-string types.");if(!(s=e.parse(t[3],3,Vt)))return null}return new i(o,a,s)},i.prototype.evaluate=function(i){var o=this.lhs.evaluate(i),a=this.rhs.evaluate(i);if(r&&this.hasUntypedArgument){var s=se(o),u=se(a);if(s.kind!==u.kind||"string"!==s.kind&&"number"!==s.kind)throw new ce('Expected arguments for "'+t+'" to be (string, string) or (number, number), but found ('+s.kind+", "+u.kind+") instead.")}if(this.collator&&!r&&this.hasUntypedArgument){var l=se(o),c=se(a);if("string"!==l.kind||"string"!==c.kind)return e(i,o,a)}return this.collator?n(i,o,a,this.collator.evaluate(i)):e(i,o,a)},i.prototype.eachChild=function(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)},i.prototype.outputDefined=function(){return!0},i.prototype.serialize=function(){var e=[t];return this.eachChild((function(t){e.push(t.serialize())})),e},i}()}An.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),r=e.parse(t[2],2,Rt);if(!n||!r)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 i=e.parse(t[3],3,Rt);return i?new An(n.type,n,r,i):null}return new An(n.type,n,r)},An.prototype.evaluate=function(t){var e=this.input.evaluate(t),n=this.beginIndex.evaluate(t);if(!Yt(e,["string","array"]))throw new ce("Expected first argument to be of type array or string, but found "+Qt(se(e))+" instead.");if(this.endIndex){var r=this.endIndex.evaluate(t);return e.slice(n,r)}return e.slice(n)},An.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)},An.prototype.outputDefined=function(){return!1},An.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 yn=mn("==",(function(t,e,n){return e===n}),gn),_n=mn("!=",(function(t,e,n){return e!==n}),(function(t,e,n,r){return!gn(0,e,n,r)})),bn=mn("<",(function(t,e,n){return e<n}),(function(t,e,n,r){return r.compare(e,n)<0})),xn=mn(">",(function(t,e,n){return e>n}),(function(t,e,n,r){return r.compare(e,n)>0})),wn=mn("<=",(function(t,e,n){return e<=n}),(function(t,e,n,r){return r.compare(e,n)<=0})),Cn=mn(">=",(function(t,e,n){return e>=n}),(function(t,e,n,r){return r.compare(e,n)>=0})),Bn=function(t,e,n,r,i){this.type=zt,this.number=t,this.locale=e,this.currency=n,this.minFractionDigits=r,this.maxFractionDigits=i};Bn.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var n=e.parse(t[1],1,Rt);if(!n)return null;var r=t[2];if("object"!=typeof r||Array.isArray(r))return e.error("NumberFormat options argument must be an object.");var i=null;if(r.locale&&!(i=e.parse(r.locale,1,zt)))return null;var o=null;if(r.currency&&!(o=e.parse(r.currency,1,zt)))return null;var a=null;if(r["min-fraction-digits"]&&!(a=e.parse(r["min-fraction-digits"],1,Rt)))return null;var s=null;return r["max-fraction-digits"]&&!(s=e.parse(r["max-fraction-digits"],1,Rt))?null:new Bn(n,i,o,a,s)},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 kn=function(t){this.type=Rt,this.input=t};kn.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 kn(n):null},kn.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 ce("Expected value to be of type string or array, but found "+Qt(se(e))+" instead.")},kn.prototype.eachChild=function(t){t(this.input)},kn.prototype.outputDefined=function(){return!1},kn.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var En={"==":yn,"!=":_n,">":xn,"<":bn,">=":Cn,"<=":wn,array:fe,at:cn,boolean:fe,case:dn,coalesce:un,collator:_e,format:pe,image:de,in:hn,"index-of":fn,interpolate:an,"interpolate-hcl":an,"interpolate-lab":an,length:kn,let:ln,literal:le,match:pn,number:fe,"number-format":Bn,object:fe,slice:An,step:je,string:fe,"to-boolean":ve,"to-color":ve,"to-number":ve,"to-string":ve,var:Ue,within:Oe};function Sn(t,e){var n=e[0],r=e[1],i=e[2],o=e[3];n=n.evaluate(t),r=r.evaluate(t),i=i.evaluate(t);var a=o?o.evaluate(t):1,s=oe(n,r,i,a);if(s)throw new ce(s);return new te(n/255*a,r/255*a,i/255*a,a)}function Tn(t,e){return t in e}function Mn(t,e){var n=e[t];return void 0===n?null:n}function In(t){return{type:t}}function Pn(t){return{result:"success",value:t}}function Zn(t){return{result:"error",value:t}}function Dn(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function Ln(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function On(t){return!!t.expression&&t.expression.interpolated}function Fn(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function Rn(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function zn(t){return t}function Un(t,e,n){return void 0!==t?t:void 0!==e?e:void 0!==n?n:void 0}function Nn(t,e,n,r,i){return Un(typeof n===i?r[n]:void 0,t.default,e.default)}function Gn(t,e,n){if("number"!==Fn(n))return Un(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 i=Ge(t.stops.map((function(t){return t[0]})),n);return t.stops[i][1]}function jn(t,e,n){var r=void 0!==t.base?t.base:1;if("number"!==Fn(n))return Un(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 o=Ge(t.stops.map((function(t){return t[0]})),n),a=function(t,e,n,r){var i=r-n,o=t-n;return 0===i?0:1===e?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}(n,r,t.stops[o][0],t.stops[o+1][0]),s=t.stops[o][1],u=t.stops[o+1][1],l=He[e.type]||zn;if(t.colorSpace&&"rgb"!==t.colorSpace){var c=on[t.colorSpace];l=function(t,e){return c.reverse(c.interpolate(c.forward(t),c.forward(e),a))}}return"function"==typeof s.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var n=s.evaluate.apply(void 0,t),r=u.evaluate.apply(void 0,t);if(void 0!==n&&void 0!==r)return l(n,r,a)}}:l(s,u,a)}function Vn(t,e,n){return"color"===e.type?n=te.parse(n):"formatted"===e.type?n=re.fromString(n.toString()):"resolvedImage"===e.type?n=ie.fromString(n.toString()):Fn(n)===e.type||"enum"===e.type&&e.values[n]||(n=void 0),Un(n,t.default,e.default)}ye.register(En,{error:[{kind:"error"},[zt],function(t,e){throw new ce(e[0].evaluate(t))}],typeof:[zt,[jt],function(t,e){return Qt(se(e[0].evaluate(t)))}],"to-rgba":[Wt(Rt,4),[Nt],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[Nt,[Rt,Rt,Rt],Sn],rgba:[Nt,[Rt,Rt,Rt,Rt],Sn],has:{type:Ut,overloads:[[[zt],function(t,e){return Tn(e[0].evaluate(t),t.properties())}],[[zt,Gt],function(t,e){var n=e[1];return Tn(e[0].evaluate(t),n.evaluate(t))}]]},get:{type:jt,overloads:[[[zt],function(t,e){return Mn(e[0].evaluate(t),t.properties())}],[[zt,Gt],function(t,e){var n=e[1];return Mn(e[0].evaluate(t),n.evaluate(t))}]]},"feature-state":[jt,[zt],function(t,e){return Mn(e[0].evaluate(t),t.featureState||{})}],properties:[Gt,[],function(t){return t.properties()}],"geometry-type":[zt,[],function(t){return t.geometryType()}],id:[jt,[],function(t){return t.id()}],zoom:[Rt,[],function(t){return t.globals.zoom}],"heatmap-density":[Rt,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[Rt,[],function(t){return t.globals.lineProgress||0}],accumulated:[jt,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[Rt,In(Rt),function(t,e){for(var n=0,r=0,i=e;r<i.length;r+=1)n+=i[r].evaluate(t);return n}],"*":[Rt,In(Rt),function(t,e){for(var n=1,r=0,i=e;r<i.length;r+=1)n*=i[r].evaluate(t);return n}],"-":{type:Rt,overloads:[[[Rt,Rt],function(t,e){var n=e[1];return e[0].evaluate(t)-n.evaluate(t)}],[[Rt],function(t,e){return-e[0].evaluate(t)}]]},"/":[Rt,[Rt,Rt],function(t,e){var n=e[1];return e[0].evaluate(t)/n.evaluate(t)}],"%":[Rt,[Rt,Rt],function(t,e){var n=e[1];return e[0].evaluate(t)%n.evaluate(t)}],ln2:[Rt,[],function(){return Math.LN2}],pi:[Rt,[],function(){return Math.PI}],e:[Rt,[],function(){return Math.E}],"^":[Rt,[Rt,Rt],function(t,e){var n=e[1];return Math.pow(e[0].evaluate(t),n.evaluate(t))}],sqrt:[Rt,[Rt],function(t,e){return Math.sqrt(e[0].evaluate(t))}],log10:[Rt,[Rt],function(t,e){return Math.log(e[0].evaluate(t))/Math.LN10}],ln:[Rt,[Rt],function(t,e){return Math.log(e[0].evaluate(t))}],log2:[Rt,[Rt],function(t,e){return Math.log(e[0].evaluate(t))/Math.LN2}],sin:[Rt,[Rt],function(t,e){return Math.sin(e[0].evaluate(t))}],cos:[Rt,[Rt],function(t,e){return Math.cos(e[0].evaluate(t))}],tan:[Rt,[Rt],function(t,e){return Math.tan(e[0].evaluate(t))}],asin:[Rt,[Rt],function(t,e){return Math.asin(e[0].evaluate(t))}],acos:[Rt,[Rt],function(t,e){return Math.acos(e[0].evaluate(t))}],atan:[Rt,[Rt],function(t,e){return Math.atan(e[0].evaluate(t))}],min:[Rt,In(Rt),function(t,e){return Math.min.apply(Math,e.map((function(e){return e.evaluate(t)})))}],max:[Rt,In(Rt),function(t,e){return Math.max.apply(Math,e.map((function(e){return e.evaluate(t)})))}],abs:[Rt,[Rt],function(t,e){return Math.abs(e[0].evaluate(t))}],round:[Rt,[Rt],function(t,e){var n=e[0].evaluate(t);return n<0?-Math.round(-n):Math.round(n)}],floor:[Rt,[Rt],function(t,e){return Math.floor(e[0].evaluate(t))}],ceil:[Rt,[Rt],function(t,e){return Math.ceil(e[0].evaluate(t))}],"filter-==":[Ut,[zt,jt],function(t,e){var n=e[0],r=e[1];return t.properties()[n.value]===r.value}],"filter-id-==":[Ut,[jt],function(t,e){var n=e[0];return t.id()===n.value}],"filter-type-==":[Ut,[zt],function(t,e){var n=e[0];return t.geometryType()===n.value}],"filter-<":[Ut,[zt,jt],function(t,e){var n=e[0],r=e[1],i=t.properties()[n.value],o=r.value;return typeof i==typeof o&&i<o}],"filter-id-<":[Ut,[jt],function(t,e){var n=e[0],r=t.id(),i=n.value;return typeof r==typeof i&&r<i}],"filter->":[Ut,[zt,jt],function(t,e){var n=e[0],r=e[1],i=t.properties()[n.value],o=r.value;return typeof i==typeof o&&i>o}],"filter-id->":[Ut,[jt],function(t,e){var n=e[0],r=t.id(),i=n.value;return typeof r==typeof i&&r>i}],"filter-<=":[Ut,[zt,jt],function(t,e){var n=e[0],r=e[1],i=t.properties()[n.value],o=r.value;return typeof i==typeof o&&i<=o}],"filter-id-<=":[Ut,[jt],function(t,e){var n=e[0],r=t.id(),i=n.value;return typeof r==typeof i&&r<=i}],"filter->=":[Ut,[zt,jt],function(t,e){var n=e[0],r=e[1],i=t.properties()[n.value],o=r.value;return typeof i==typeof o&&i>=o}],"filter-id->=":[Ut,[jt],function(t,e){var n=e[0],r=t.id(),i=n.value;return typeof r==typeof i&&r>=i}],"filter-has":[Ut,[jt],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[Ut,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[Ut,[Wt(zt)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[Ut,[Wt(jt)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[Ut,[zt,Wt(jt)],function(t,e){var n=e[0];return e[1].value.indexOf(t.properties()[n.value])>=0}],"filter-in-large":[Ut,[zt,Wt(jt)],function(t,e){var n=e[0],r=e[1];return function(t,e,n,r){for(;n<=r;){var i=n+r>>1;if(e[i]===t)return!0;e[i]>t?r=i-1:n=i+1}return!1}(t.properties()[n.value],r.value,0,r.value.length-1)}],all:{type:Ut,overloads:[[[Ut,Ut],function(t,e){var n=e[1];return e[0].evaluate(t)&&n.evaluate(t)}],[In(Ut),function(t,e){for(var n=0,r=e;n<r.length;n+=1)if(!r[n].evaluate(t))return!1;return!0}]]},any:{type:Ut,overloads:[[[Ut,Ut],function(t,e){var n=e[1];return e[0].evaluate(t)||n.evaluate(t)}],[In(Ut),function(t,e){for(var n=0,r=e;n<r.length;n+=1)if(r[n].evaluate(t))return!0;return!1}]]},"!":[Ut,[Ut],function(t,e){return!e[0].evaluate(t)}],"is-supported-script":[Ut,[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,In(jt),function(t,e){return e.map((function(e){return ue(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 me,this._defaultValue=e?function(t){return"color"===t.type&&Rn(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 En}function Wn(t,e){var n=new Ne(En,[],e?function(t){var e={color:Nt,string:zt,number:Rt,enum:zt,boolean:Ut,formatted:Ht,resolvedImage:Jt};return"array"===t.type?Wt(e[t.value]||jt,t.length):e[t.type]}(e):void 0),r=n.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return r?Pn(new Hn(r,e)):Zn(n.errors)}Hn.prototype.evaluateWithoutErrorHandling=function(t,e,n,r,i,o){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=n,this._evaluator.canonical=r,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=o,this.expression.evaluate(this._evaluator)},Hn.prototype.evaluate=function(t,e,n,r,i,o){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=n||null,this._evaluator.canonical=r,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=o||null;try{var a=this.expression.evaluate(this._evaluator);if(null==a||"number"==typeof a&&a!=a)return this._defaultValue;if(this._enumValues&&!(a in this._enumValues))throw new ce("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(a)+" instead.");return a}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&&!Re(e.expression)};Qn.prototype.evaluateWithoutErrorHandling=function(t,e,n,r,i,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,n,r,i,o)},Qn.prototype.evaluate=function(t,e,n,r,i,o){return this._styleExpression.evaluate(t,e,n,r,i,o)};var qn=function(t,e,n,r){this.kind=t,this.zoomStops=n,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Re(e.expression),this.interpolationType=r};function Kn(t,e){if("error"===(t=Wn(t,e)).result)return t;var n=t.value.expression,r=Fe(n);if(!r&&!Dn(e))return Zn([new Lt("","data expressions not supported")]);var i=ze(n,["zoom"]);if(!i&&!Ln(e))return Zn([new Lt("","zoom expressions not supported")]);var o=function t(e){var n=null;if(e instanceof ln)n=t(e.result);else if(e instanceof un)for(var r=0,i=e.args;r<i.length&&!(n=t(i[r]));r+=1);else(e instanceof je||e instanceof an)&&e.input instanceof ye&&"zoom"===e.input.name&&(n=e);return n instanceof Lt||e.eachChild((function(e){var r=t(e);r instanceof Lt?n=r:!n&&r?n=new Lt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):n&&r&&n!==r&&(n=new Lt("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),n}(n);return o||i?o instanceof Lt?Zn([o]):o instanceof an&&!On(e)?Zn([new Lt("",'"interpolate" expressions cannot be used with this property')]):Pn(o?new qn(r?"camera":"composite",t.value,o.labels,o instanceof an?o.interpolation:void 0):new Qn(r?"constant":"source",t.value)):Zn([new Lt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}qn.prototype.evaluateWithoutErrorHandling=function(t,e,n,r,i,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,n,r,i,o)},qn.prototype.evaluate=function(t,e,n,r,i,o){return this._styleExpression.evaluate(t,e,n,r,i,o)},qn.prototype.interpolationFactor=function(t,e,n){return this.interpolationType?an.interpolationFactor(this.interpolationType,t,e,n):0};var Xn=function(t,e){this._parameters=t,this._specification=e,Pt(this,function t(e,n){var r,i,o,a="color"===n.type,s=e.stops&&"object"==typeof e.stops[0][0],u=s||!(s||void 0!==e.property),l=e.type||(On(n)?"exponential":"interval");if(a&&((e=Pt({},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"===l)r=jn;else if("interval"===l)r=Gn;else if("categorical"===l){r=Nn,i=Object.create(null);for(var c=0,h=e.stops;c<h.length;c+=1){var f=h[c];i[f[0]]=f[1]}o=typeof e.stops[0][0]}else{if("identity"!==l)throw new Error('Unknown function type "'+l+'"');r=Vn}if(s){for(var p={},d=[],A=0;A<e.stops.length;A++){var v=e.stops[A],g=v[0].zoom;void 0===p[g]&&(p[g]={zoom:g,type:e.type,property:e.property,default:e.default,stops:[]},d.push(g)),p[g].stops.push([v[0].value,v[1]])}for(var m=[],y=0,_=d;y<_.length;y+=1){var b=_[y];m.push([p[b].zoom,t(p[b],n)])}var x={name:"linear"};return{kind:"composite",interpolationType:x,interpolationFactor:an.interpolationFactor.bind(void 0,x),zoomStops:m.map((function(t){return t[0]})),evaluate:function(t,r){var i=t.zoom;return jn({stops:m,base:e.base},n,i).evaluate(i,r)}}}if(u){var w="exponential"===l?{name:"exponential",base:void 0!==e.base?e.base:1}:null;return{kind:"camera",interpolationType:w,interpolationFactor:an.interpolationFactor.bind(void 0,w),zoomStops:e.stops.map((function(t){return t[0]})),evaluate:function(t){return r(e,n,t.zoom,i,o)}}}return{kind:"source",evaluate:function(t,a){var s=a&&a.properties?a.properties[e.property]:void 0;return void 0===s?Un(e.default,n.default):r(e,n,s,i,o)}}}(this._parameters,this._specification))};function Yn(t){var e=t.key,n=t.value,r=t.valueSpec||{},i=t.objectElementValidators||{},o=t.style,a=t.styleSpec,s=[],u=Fn(n);if("object"!==u)return[new Mt(e,n,"object expected, "+u+" found")];for(var l in n){var c=l.split(".")[0],h=r[c]||r["*"],f=void 0;if(i[c])f=i[c];else if(r[c])f=wr;else if(i["*"])f=i["*"];else{if(!r["*"]){s.push(new Mt(e,n[l],'unknown property "'+l+'"'));continue}f=wr}s=s.concat(f({key:(e?e+".":e)+l,value:n[l],valueSpec:h,style:o,styleSpec:a,object:n,objectKey:l},n))}for(var p in r)i[p]||r[p].required&&void 0===r[p].default&&void 0===n[p]&&s.push(new Mt(e,n,'missing required property "'+p+'"'));return s}function $n(t){var e=t.value,n=t.valueSpec,r=t.style,i=t.styleSpec,o=t.key,a=t.arrayElementValidator||wr;if("array"!==Fn(e))return[new Mt(o,e,"array expected, "+Fn(e)+" found")];if(n.length&&e.length!==n.length)return[new Mt(o,e,"array length "+n.length+" expected, length "+e.length+" found")];if(n["min-length"]&&e.length<n["min-length"])return[new Mt(o,e,"array length at least "+n["min-length"]+" expected, length "+e.length+" found")];var s={type:n.value,values:n.values};i.$version<7&&(s.function=n.function),"object"===Fn(n.value)&&(s=n.value);for(var u=[],l=0;l<e.length;l++)u=u.concat(a({array:e,arrayIndex:l,value:e[l],valueSpec:s,style:r,styleSpec:i,key:o+"["+l+"]"}));return u}function tr(t){var e=t.key,n=t.value,r=t.valueSpec,i=Fn(n);return"number"===i&&n!=n&&(i="NaN"),"number"!==i?[new Mt(e,n,"number expected, "+i+" found")]:"minimum"in r&&n<r.minimum?[new Mt(e,n,n+" is less than the minimum value "+r.minimum)]:"maximum"in r&&n>r.maximum?[new Mt(e,n,n+" is greater than the maximum value "+r.maximum)]:[]}function er(t){var e,n,r,i=t.valueSpec,o=Zt(t.value.type),a={},s="categorical"!==o&&void 0===t.value.property,u=!s,l="array"===Fn(t.value.stops)&&"array"===Fn(t.value.stops[0])&&"object"===Fn(t.value.stops[0][0]),c=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 Mt(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"===Fn(n)&&0===n.length&&e.push(new Mt(t.key,n,"array must have at least one stop")),e},default:function(t){return wr({key:t.key,value:t.value,valueSpec:i,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===o&&s&&c.push(new Mt(t.key,t.value,'missing required property "property"')),"identity"===o||t.value.stops||c.push(new Mt(t.key,t.value,'missing required property "stops"')),"exponential"===o&&t.valueSpec.expression&&!On(t.valueSpec)&&c.push(new Mt(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(u&&!Dn(t.valueSpec)?c.push(new Mt(t.key,t.value,"property functions not supported")):s&&!Ln(t.valueSpec)&&c.push(new Mt(t.key,t.value,"zoom functions not supported"))),"categorical"!==o&&!l||void 0!==t.value.property||c.push(new Mt(t.key,t.value,'"property" property is required')),c;function h(t){var e=[],o=t.value,s=t.key;if("array"!==Fn(o))return[new Mt(s,o,"array expected, "+Fn(o)+" found")];if(2!==o.length)return[new Mt(s,o,"array length 2 expected, length "+o.length+" found")];if(l){if("object"!==Fn(o[0]))return[new Mt(s,o,"object expected, "+Fn(o[0])+" found")];if(void 0===o[0].zoom)return[new Mt(s,o,"object stop key must have zoom")];if(void 0===o[0].value)return[new Mt(s,o,"object stop key must have value")];if(r&&r>Zt(o[0].zoom))return[new Mt(s,o[0].zoom,"stop zoom values must appear in ascending order")];Zt(o[0].zoom)!==r&&(r=Zt(o[0].zoom),n=void 0,a={}),e=e.concat(Yn({key:s+"[0]",value:o[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:tr,value:f}}))}else e=e.concat(f({key:s+"[0]",value:o[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},o));return Jn(Dt(o[1]))?e.concat([new Mt(s+"[1]",o[1],"expressions are not allowed in function stops.")]):e.concat(wr({key:s+"[1]",value:o[1],valueSpec:i,style:t.style,styleSpec:t.styleSpec}))}function f(t,r){var s=Fn(t.value),u=Zt(t.value),l=null!==t.value?t.value:r;if(e){if(s!==e)return[new Mt(t.key,l,s+" stop domain type must match previous stop domain type "+e)]}else e=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new Mt(t.key,l,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==o){var c="number expected, "+s+" found";return Dn(i)&&void 0===o&&(c+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Mt(t.key,l,c)]}return"categorical"!==o||"number"!==s||isFinite(u)&&Math.floor(u)===u?"categorical"!==o&&"number"===s&&void 0!==n&&u<n?[new Mt(t.key,l,"stop domain values must appear in ascending order")]:(n=u,"categorical"===o&&u in a?[new Mt(t.key,l,"stop domain values must be unique")]:(a[u]=!0,[])):[new Mt(t.key,l,"integer expected, found "+u)]}}function nr(t){var e=("property"===t.expressionContext?Kn:Wn)(Dt(t.value),t.valueSpec);if("error"===e.result)return e.value.map((function(e){return new Mt(""+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 Mt(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&&!Re(n))return[new Mt(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext&&!Re(n))return[new Mt(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 Mt(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!Fe(n))return[new Mt(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function rr(t){var e=t.key,n=t.value,r=t.valueSpec,i=[];return Array.isArray(r.values)?-1===r.values.indexOf(Zt(n))&&i.push(new Mt(e,n,"expected one of ["+r.values.join(", ")+"], "+JSON.stringify(n)+" found")):-1===Object.keys(r.values).indexOf(Zt(n))&&i.push(new Mt(e,n,"expected one of ["+Object.keys(r.values).join(", ")+"], "+JSON.stringify(n)+" found")),i}function ir(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 r=n[e];if(!ir(r)&&"boolean"!=typeof r)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 or={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function ar(t){if(null==t)return{filter:function(){return!0},needGeometry:!1};ir(t)||(t=ur(t));var e=Wn(t,or);if("error"===e.result)throw new Error(e.value.map((function(t){return t.key+": "+t.message})).join(", "));return{filter:function(t,n,r){return e.value.evaluate(t,n,{},r)},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 sr(t,e){return t<e?-1:t>e?1:0}function ur(t){if(!t)return!0;var e,n=t[0];return t.length<=1?"any"!==n:"=="===n?lr(t[1],t[2],"=="):"!="===n?fr(lr(t[1],t[2],"==")):"<"===n||">"===n||"<="===n||">="===n?lr(t[1],t[2],n):"any"===n?(e=t.slice(1),["any"].concat(e.map(ur))):"all"===n?["all"].concat(t.slice(1).map(ur)):"none"===n?["all"].concat(t.slice(1).map(ur).map(fr)):"in"===n?cr(t[1],t.slice(2)):"!in"===n?fr(cr(t[1],t.slice(2))):"has"===n?hr(t[1]):"!has"===n?fr(hr(t[1])):"within"!==n||t}function lr(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 cr(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(sr)]]:["filter-in-small",t,["literal",e]]}}function hr(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function fr(t){return["!",t]}function pr(t){return ir(Dt(t.value))?nr(Pt({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var n=e.value,r=e.key;if("array"!==Fn(n))return[new Mt(r,n,"array expected, "+Fn(n)+" found")];var i,o=e.styleSpec,a=[];if(n.length<1)return[new Mt(r,n,"filter array must have at least 1 element")];switch(a=a.concat(rr({key:r+"[0]",value:n[0],valueSpec:o.filter_operator,style:e.style,styleSpec:e.styleSpec})),Zt(n[0])){case"<":case"<=":case">":case">=":n.length>=2&&"$type"===Zt(n[1])&&a.push(new Mt(r,n,'"$type" cannot be use with operator "'+n[0]+'"'));case"==":case"!=":3!==n.length&&a.push(new Mt(r,n,'filter array for operator "'+n[0]+'" must have 3 elements'));case"in":case"!in":n.length>=2&&"string"!==(i=Fn(n[1]))&&a.push(new Mt(r+"[1]",n[1],"string expected, "+i+" found"));for(var s=2;s<n.length;s++)i=Fn(n[s]),"$type"===Zt(n[1])?a=a.concat(rr({key:r+"["+s+"]",value:n[s],valueSpec:o.geometry_type,style:e.style,styleSpec:e.styleSpec})):"string"!==i&&"number"!==i&&"boolean"!==i&&a.push(new Mt(r+"["+s+"]",n[s],"string, number, or boolean expected, "+i+" found"));break;case"any":case"all":case"none":for(var u=1;u<n.length;u++)a=a.concat(t({key:r+"["+u+"]",value:n[u],style:e.style,styleSpec:e.styleSpec}));break;case"has":case"!has":i=Fn(n[1]),2!==n.length?a.push(new Mt(r,n,'filter array for "'+n[0]+'" operator must have 2 elements')):"string"!==i&&a.push(new Mt(r+"[1]",n[1],"string expected, "+i+" found"));break;case"within":i=Fn(n[1]),2!==n.length?a.push(new Mt(r,n,'filter array for "'+n[0]+'" operator must have 2 elements')):"object"!==i&&a.push(new Mt(r+"[1]",n[1],"object expected, "+i+" found"))}return a}(t)}function dr(t,e){var n=t.key,r=t.style,i=t.styleSpec,o=t.value,a=t.objectKey,s=i[e+"_"+t.layerType];if(!s)return[];var u=a.match(/^(.*)-transition$/);if("paint"===e&&u&&s[u[1]]&&s[u[1]].transition)return wr({key:n,value:o,valueSpec:i.transition,style:r,styleSpec:i});var l,c=t.valueSpec||s[a];if(!c)return[new Mt(n,o,'unknown property "'+a+'"')];if("string"===Fn(o)&&Dn(c)&&!c.tokens&&(l=/^{([^}]+)}$/.exec(o)))return[new Mt(n,o,'"'+a+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(l[1])+" }`.")];var h=[];return"symbol"===t.layerType&&("text-field"===a&&r&&!r.glyphs&&h.push(new Mt(n,o,'use of "text-field" requires a style "glyphs" property')),"text-font"===a&&Rn(Dt(o))&&"identity"===Zt(o.type)&&h.push(new Mt(n,o,'"text-font" does not support identity functions'))),h.concat(wr({key:t.key,value:o,valueSpec:c,style:r,styleSpec:i,expressionContext:"property",propertyType:e,propertyKey:a}))}function Ar(t){return dr(t,"paint")}function vr(t){return dr(t,"layout")}function gr(t){var e=[],n=t.value,r=t.key,i=t.style,o=t.styleSpec;n.type||n.ref||e.push(new Mt(r,n,'either "type" or "ref" is required'));var a,s=Zt(n.type),u=Zt(n.ref);if(n.id)for(var l=Zt(n.id),c=0;c<t.arrayIndex;c++){var h=i.layers[c];Zt(h.id)===l&&e.push(new Mt(r,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 Mt(r,n[t],'"'+t+'" is prohibited for ref layers'))})),i.layers.forEach((function(t){Zt(t.id)===u&&(a=t)})),a?a.ref?e.push(new Mt(r,n.ref,"ref cannot reference another ref layer")):s=Zt(a.type):e.push(new Mt(r,n.ref,'ref layer "'+u+'" not found'));else if("background"!==s)if(n.source){var f=i.sources&&i.sources[n.source],p=f&&Zt(f.type);f?"vector"===p&&"raster"===s?e.push(new Mt(r,n.source,'layer "'+n.id+'" requires a raster source')):"raster"===p&&"raster"!==s?e.push(new Mt(r,n.source,'layer "'+n.id+'" requires a vector source')):"vector"!==p||n["source-layer"]?"raster-dem"===p&&"hillshade"!==s?e.push(new Mt(r,n.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==s||!n.paint||!n.paint["line-gradient"]||"geojson"===p&&f.lineMetrics||e.push(new Mt(r,n,'layer "'+n.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):e.push(new Mt(r,n,'layer "'+n.id+'" must specify a "source-layer"')):e.push(new Mt(r,n.source,'source "'+n.source+'" not found'))}else e.push(new Mt(r,n,'missing required property "source"'));return e=e.concat(Yn({key:r,value:n,valueSpec:o.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return wr({key:r+".type",value:n.type,valueSpec:o.layer.type,style:t.style,styleSpec:t.styleSpec,object:n,objectKey:"type"})},filter:pr,layout:function(t){return Yn({layer:n,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return vr(Pt({layerType:s},t))}}})},paint:function(t){return Yn({layer:n,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return Ar(Pt({layerType:s},t))}}})}}}))}function mr(t){var e=t.value,n=t.key,r=Fn(e);return"string"!==r?[new Mt(n,e,"string expected, "+r+" found")]:[]}var yr={promoteId:function(t){var e=t.key,n=t.value;if("string"===Fn(n))return mr({key:e,value:n});var r=[];for(var i in n)r.push.apply(r,mr({key:e+"."+i,value:n[i]}));return r}};function _r(t){var e=t.value,n=t.key,r=t.styleSpec,i=t.style;if(!e.type)return[new Mt(n,e,'"type" is required')];var o,a=Zt(e.type);switch(a){case"vector":case"raster":case"raster-dem":return Yn({key:n,value:e,valueSpec:r["source_"+a.replace("-","_")],style:t.style,styleSpec:r,objectElementValidators:yr});case"geojson":if(o=Yn({key:n,value:e,valueSpec:r.source_geojson,style:i,styleSpec:r,objectElementValidators:yr}),e.cluster)for(var s in e.clusterProperties){var u=e.clusterProperties[s],l=u[0],c="string"==typeof l?[l,["accumulated"],["get",s]]:l;o.push.apply(o,nr({key:n+"."+s+".map",value:u[1],expressionContext:"cluster-map"})),o.push.apply(o,nr({key:n+"."+s+".reduce",value:c,expressionContext:"cluster-reduce"}))}return o;case"video":return Yn({key:n,value:e,valueSpec:r.source_video,style:i,styleSpec:r});case"image":return Yn({key:n,value:e,valueSpec:r.source_image,style:i,styleSpec:r});case"canvas":return[new Mt(n,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return rr({key:n+".type",value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:i,styleSpec:r})}}function br(t){var e=t.value,n=t.styleSpec,r=n.light,i=t.style,o=[],a=Fn(e);if(void 0===e)return o;if("object"!==a)return o.concat([new Mt("light",e,"object expected, "+a+" found")]);for(var s in e){var u=s.match(/^(.*)-transition$/);o=o.concat(u&&r[u[1]]&&r[u[1]].transition?wr({key:s,value:e[s],valueSpec:n.transition,style:i,styleSpec:n}):r[s]?wr({key:s,value:e[s],valueSpec:r[s],style:i,styleSpec:n}):[new Mt(s,e[s],'unknown property "'+s+'"')])}return o}var xr={"*":function(){return[]},array:$n,boolean:function(t){var e=t.value,n=t.key,r=Fn(e);return"boolean"!==r?[new Mt(n,e,"boolean expected, "+r+" found")]:[]},number:tr,color:function(t){var e=t.key,n=t.value,r=Fn(n);return"string"!==r?[new Mt(e,n,"color expected, "+r+" found")]:null===$t(n)?[new Mt(e,n,'color expected, "'+n+'" found')]:[]},constants:It,enum:rr,filter:pr,function:er,layer:gr,object:Yn,source:_r,light:br,string:mr,formatted:function(t){return 0===mr(t).length?[]:nr(t)},resolvedImage:function(t){return 0===mr(t).length?[]:nr(t)}};function wr(t){var e=t.value,n=t.valueSpec,r=t.styleSpec;return n.expression&&Rn(Zt(e))?er(t):n.expression&&Jn(Dt(e))?nr(t):n.type&&xr[n.type]?xr[n.type](t):Yn(Pt({},t,{valueSpec:n.type?r[n.type]:n}))}function Cr(t){var e=t.value,n=t.key,r=mr(t);return r.length||(-1===e.indexOf("{fontstack}")&&r.push(new Mt(n,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&r.push(new Mt(n,e,'"glyphs" url must include a "{range}" token'))),r}function Br(t,e){void 0===e&&(e=Tt);var n=[];return n=n.concat(wr({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:Cr,"*":function(){return[]}}})),t.constants&&(n=n.concat(It({key:"constants",value:t.constants,style:t,styleSpec:e}))),kr(n)}function kr(t){return[].concat(t).sort((function(t,e){return t.line-e.line}))}function Er(t){return function(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];return kr(t.apply(this,e))}}Br.source=Er(_r),Br.light=Er(br),Br.layer=Er(gr),Br.filter=Er(pr),Br.paintProperty=Er(Ar),Br.layoutProperty=Er(vr);var Sr=Br,Tr=Sr.light,Mr=Sr.paintProperty,Ir=Sr.layoutProperty;function Pr(t,e){var n=!1;if(e&&e.length)for(var r=0,i=e;r<i.length;r+=1)t.fire(new Et(new Error(i[r].message))),n=!0;return n}var Zr=Dr;function Dr(t,e,n){var r=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var i=new Int32Array(this.arrayBuffer);t=i[0],this.d=(e=i[1])+2*(n=i[2]);for(var o=0;o<this.d*this.d;o++){var a=i[3+o],s=i[3+o+1];r.push(a===s?null:i.subarray(a,s))}var u=i[3+r.length+1];this.keys=i.subarray(i[3+r.length],u),this.bboxes=i.subarray(u),this.insert=this._insertReadonly}else{this.d=e+2*n;for(var l=0;l<this.d*this.d;l++)r.push([]);this.keys=[],this.bboxes=[]}this.n=e,this.extent=t,this.padding=n,this.scale=e/t,this.uid=0;var c=n/e*t;this.min=-c,this.max=t+c}Dr.prototype.insert=function(t,e,n,r,i){this._forEachCell(e,n,r,i,this._insertCell,this.uid++),this.keys.push(t),this.bboxes.push(e),this.bboxes.push(n),this.bboxes.push(r),this.bboxes.push(i)},Dr.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},Dr.prototype._insertCell=function(t,e,n,r,i,o){this.cells[i].push(o)},Dr.prototype.query=function(t,e,n,r,i){var o=this.min,a=this.max;if(t<=o&&e<=o&&a<=n&&a<=r&&!i)return Array.prototype.slice.call(this.keys);var s=[];return this._forEachCell(t,e,n,r,this._queryCell,s,{},i),s},Dr.prototype._queryCell=function(t,e,n,r,i,o,a,s){var u=this.cells[i];if(null!==u)for(var l=this.keys,c=this.bboxes,h=0;h<u.length;h++){var f=u[h];if(void 0===a[f]){var p=4*f;(s?s(c[p+0],c[p+1],c[p+2],c[p+3]):t<=c[p+2]&&e<=c[p+3]&&n>=c[p+0]&&r>=c[p+1])?(a[f]=!0,o.push(l[f])):a[f]=!1}}},Dr.prototype._forEachCell=function(t,e,n,r,i,o,a,s){for(var u=this._convertToCellCoord(t),l=this._convertToCellCoord(e),c=this._convertToCellCoord(n),h=this._convertToCellCoord(r),f=u;f<=c;f++)for(var p=l;p<=h;p++){var d=this.d*p+f;if((!s||s(this._convertFromCellCoord(f),this._convertFromCellCoord(p),this._convertFromCellCoord(f+1),this._convertFromCellCoord(p+1)))&&i.call(this,t,e,n,r,d,o,a,s))return}},Dr.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},Dr.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},Dr.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=3+this.cells.length+1+1,n=0,r=0;r<this.cells.length;r++)n+=this.cells[r].length;var i=new Int32Array(e+n+this.keys.length+this.bboxes.length);i[0]=this.extent,i[1]=this.n,i[2]=this.padding;for(var o=e,a=0;a<t.length;a++){var s=t[a];i[3+a]=o,i.set(s,o),o+=s.length}return i[3+t.length]=o,i.set(this.keys,o),i[3+t.length+1]=o+=this.keys.length,i.set(this.bboxes,o),o+=this.bboxes.length,i.buffer};var Lr=a.ImageData,Or=a.ImageBitmap,Fr={};function Rr(t,e,n){void 0===n&&(n={}),Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),Fr[t]={klass:e,omit:n.omit||[],shallow:n.shallow||[]}}for(var zr in Rr("Object",Object),Zr.serialize=function(t,e){var n=t.toArrayBuffer();return e&&e.push(n),{buffer:n}},Zr.deserialize=function(t){return new Zr(t.buffer)},Rr("Grid",Zr),Rr("Color",te),Rr("Error",Error),Rr("ResolvedImage",ie),Rr("StylePropertyFunction",Xn),Rr("StyleExpression",Hn,{omit:["_evaluator"]}),Rr("ZoomDependentExpression",qn),Rr("ZoomConstantExpression",Qn),Rr("CompoundExpression",ye,{omit:["_evaluate"]}),En)En[zr]._classRegistryKey||Rr("Expression_"+zr,En[zr]);function Ur(t){return t&&"undefined"!=typeof ArrayBuffer&&(t instanceof ArrayBuffer||t.constructor&&"ArrayBuffer"===t.constructor.name)}function Nr(t){return Or&&t instanceof Or}function Gr(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(Ur(t)||Nr(t))return e&&e.push(t),t;if(ArrayBuffer.isView(t)){var n=t;return e&&e.push(n.buffer),n}if(t instanceof Lr)return e&&e.push(t.data.buffer),t;if(Array.isArray(t)){for(var r=[],i=0,o=t;i<o.length;i+=1)r.push(Gr(o[i],e));return r}if("object"==typeof t){var a=t.constructor,s=a._classRegistryKey;if(!s)throw new Error("can't serialize object of unregistered class");var u=a.serialize?a.serialize(t,e):{};if(!a.serialize){for(var l in t)if(t.hasOwnProperty(l)&&!(Fr[s].omit.indexOf(l)>=0)){var c=t[l];u[l]=Fr[s].shallow.indexOf(l)>=0?c:Gr(c,e)}t instanceof Error&&(u.message=t.message)}if(u.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==s&&(u.$name=s),u}throw new Error("can't serialize object of type "+typeof t)}function jr(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||Ur(t)||Nr(t)||ArrayBuffer.isView(t)||t instanceof Lr)return t;if(Array.isArray(t))return t.map(jr);if("object"==typeof t){var e=t.$name||"Object",n=Fr[e].klass;if(!n)throw new Error("can't deserialize unregistered class "+e);if(n.deserialize)return n.deserialize(t);for(var r=Object.create(n.prototype),i=0,o=Object.keys(t);i<o.length;i+=1){var a=o[i];if("$name"!==a){var s=t[a];r[a]=Fr[e].shallow.indexOf(a)>=0?s:jr(s)}}return r}throw new Error("can't deserialize object of type "+typeof t)}var Vr=function(){this.first=!0};Vr.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 Hr={"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 Jr(t){for(var e=0,n=t;e<n.length;e+=1)if(Wr(n[e].charCodeAt(0)))return!0;return!1}function Wr(t){return!(746!==t&&747!==t&&(t<4352||!(Hr["Bopomofo Extended"](t)||Hr.Bopomofo(t)||Hr["CJK Compatibility Forms"](t)&&!(t>=65097&&t<=65103)||Hr["CJK Compatibility Ideographs"](t)||Hr["CJK Compatibility"](t)||Hr["CJK Radicals Supplement"](t)||Hr["CJK Strokes"](t)||!(!Hr["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||Hr["CJK Unified Ideographs Extension A"](t)||Hr["CJK Unified Ideographs"](t)||Hr["Enclosed CJK Letters and Months"](t)||Hr["Hangul Compatibility Jamo"](t)||Hr["Hangul Jamo Extended-A"](t)||Hr["Hangul Jamo Extended-B"](t)||Hr["Hangul Jamo"](t)||Hr["Hangul Syllables"](t)||Hr.Hiragana(t)||Hr["Ideographic Description Characters"](t)||Hr.Kanbun(t)||Hr["Kangxi Radicals"](t)||Hr["Katakana Phonetic Extensions"](t)||Hr.Katakana(t)&&12540!==t||!(!Hr["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)||!(!Hr["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||Hr["Unified Canadian Aboriginal Syllabics"](t)||Hr["Unified Canadian Aboriginal Syllabics Extended"](t)||Hr["Vertical Forms"](t)||Hr["Yijing Hexagram Symbols"](t)||Hr["Yi Syllables"](t)||Hr["Yi Radicals"](t))))}function Qr(t){return!(Wr(t)||function(t){return!!(Hr["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||Hr["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)||Hr["Letterlike Symbols"](t)||Hr["Number Forms"](t)||Hr["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)||Hr["Control Pictures"](t)&&9251!==t||Hr["Optical Character Recognition"](t)||Hr["Enclosed Alphanumerics"](t)||Hr["Geometric Shapes"](t)||Hr["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||Hr["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||Hr["CJK Symbols and Punctuation"](t)||Hr.Katakana(t)||Hr["Private Use Area"](t)||Hr["CJK Compatibility Forms"](t)||Hr["Small Form Variants"](t)||Hr["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 qr(t){return t>=1424&&t<=2303||Hr["Arabic Presentation Forms-A"](t)||Hr["Arabic Presentation Forms-B"](t)}function Kr(t,e){return!(!e&&qr(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||Hr.Khmer(t))}function Xr(t){for(var e=0,n=t;e<n.length;e+=1)if(qr(n[e].charCodeAt(0)))return!0;return!1}var Yr=null,$r="unavailable",ti=null,ei=function(t){t&&"string"==typeof t&&t.indexOf("NetworkError")>-1&&($r="error"),Yr&&Yr(t)};function ni(){ri.fire(new kt("pluginStateChange",{pluginStatus:$r,pluginURL:ti}))}var ri=new St,ii=function(){return $r},oi=function(){if("deferred"!==$r||!ti)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");$r="loading",ni(),ti&&_t({url:ti},(function(t){t?ei(t):($r="loaded",ni())}))},ai={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return"loaded"===$r||null!=ai.applyArabicShaping},isLoading:function(){return"loading"===$r},setState:function(t){$r=t.pluginStatus,ti=t.pluginURL},isParsed:function(){return null!=ai.applyArabicShaping&&null!=ai.processBidirectionalText&&null!=ai.processStyledBidirectionalText},getPluginURL:function(){return ti}},si=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 Vr,this.transition={})};si.prototype.isSupportedScript=function(t){return function(t,e){for(var n=0,r=t;n<r.length;n+=1)if(!Kr(r[n].charCodeAt(0),e))return!1;return!0}(t,ai.isLoaded())},si.prototype.crossFadingFactor=function(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},si.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 ui=function(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(Rn(t))return new Xn(t,e);if(Jn(t)){var n=Kn(t,e);if("error"===n.result)throw new Error(n.value.map((function(t){return t.key+": "+t.message})).join(", "));return n.value}var r=t;return"string"==typeof t&&"color"===e.type&&(r=te.parse(t)),{kind:"constant",evaluate:function(){return r}}}(void 0===e?t.specification.default:e,t.specification)};ui.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},ui.prototype.possiblyEvaluate=function(t,e,n){return this.property.possiblyEvaluate(this,t,e,n)};var li=function(t){this.property=t,this.value=new ui(t,void 0)};li.prototype.transitioned=function(t,e){return new hi(this.property,this.value,e,f({},t.transition,this.transition),t.now)},li.prototype.untransitioned=function(){return new hi(this.property,this.value,null,{},0)};var ci=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};ci.prototype.getValue=function(t){return b(this._values[t].value.value)},ci.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new li(this._values[t].property)),this._values[t].value=new ui(this._values[t].property,null===e?void 0:b(e))},ci.prototype.getTransition=function(t){return b(this._values[t].transition)},ci.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new li(this._values[t].property)),this._values[t].transition=b(e)||void 0},ci.prototype.serialize=function(){for(var t={},e=0,n=Object.keys(this._values);e<n.length;e+=1){var r=n[e],i=this.getValue(r);void 0!==i&&(t[r]=i);var o=this.getTransition(r);void 0!==o&&(t[r+"-transition"]=o)}return t},ci.prototype.transitioned=function(t,e){for(var n=new fi(this._properties),r=0,i=Object.keys(this._values);r<i.length;r+=1){var o=i[r];n._values[o]=this._values[o].transitioned(t,e._values[o])}return n},ci.prototype.untransitioned=function(){for(var t=new fi(this._properties),e=0,n=Object.keys(this._values);e<n.length;e+=1){var r=n[e];t._values[r]=this._values[r].untransitioned()}return t};var hi=function(t,e,n,r,i){this.property=t,this.value=e,this.begin=i+r.delay||0,this.end=this.begin+r.duration||0,t.specification.transition&&(r.delay||r.duration)&&(this.prior=n)};hi.prototype.possiblyEvaluate=function(t,e,n){var r=t.now||0,i=this.value.possiblyEvaluate(t,e,n),o=this.prior;if(o){if(r>this.end)return this.prior=null,i;if(this.value.isDataDriven())return this.prior=null,i;if(r<this.begin)return o.possiblyEvaluate(t,e,n);var a=(r-this.begin)/(this.end-this.begin);return this.property.interpolate(o.possiblyEvaluate(t,e,n),i,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)}(a))}return i};var fi=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};fi.prototype.possiblyEvaluate=function(t,e,n){for(var r=new Ai(this._properties),i=0,o=Object.keys(this._values);i<o.length;i+=1){var a=o[i];r._values[a]=this._values[a].possiblyEvaluate(t,e,n)}return r},fi.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 pi=function(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues)};pi.prototype.getValue=function(t){return b(this._values[t].value)},pi.prototype.setValue=function(t,e){this._values[t]=new ui(this._values[t].property,null===e?void 0:b(e))},pi.prototype.serialize=function(){for(var t={},e=0,n=Object.keys(this._values);e<n.length;e+=1){var r=n[e],i=this.getValue(r);void 0!==i&&(t[r]=i)}return t},pi.prototype.possiblyEvaluate=function(t,e,n){for(var r=new Ai(this._properties),i=0,o=Object.keys(this._values);i<o.length;i+=1){var a=o[i];r._values[a]=this._values[a].possiblyEvaluate(t,e,n)}return r};var di=function(t,e,n){this.property=t,this.value=e,this.parameters=n};di.prototype.isConstant=function(){return"constant"===this.value.kind},di.prototype.constantOr=function(t){return"constant"===this.value.kind?this.value.value:t},di.prototype.evaluate=function(t,e,n,r){return this.property.evaluate(this.value,this.parameters,t,e,n,r)};var Ai=function(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)};Ai.prototype.get=function(t){return this._values[t]};var vi=function(t){this.specification=t};vi.prototype.possiblyEvaluate=function(t,e){return t.expression.evaluate(e)},vi.prototype.interpolate=function(t,e,n){var r=He[this.specification.type];return r?r(t,e,n):t};var gi=function(t,e){this.specification=t,this.overrides=e};gi.prototype.possiblyEvaluate=function(t,e,n,r){return new di(this,"constant"===t.expression.kind||"camera"===t.expression.kind?{kind:"constant",value:t.expression.evaluate(e,null,{},n,r)}:t.expression,e)},gi.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 di(this,{kind:"constant",value:void 0},t.parameters);var r=He[this.specification.type];return r?new di(this,{kind:"constant",value:r(t.value.value,e.value.value,n)},t.parameters):t},gi.prototype.evaluate=function(t,e,n,r,i,o){return"constant"===t.kind?t.value:t.evaluate(e,n,r,i,o)};var mi=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,r){if(void 0===t.value)return new di(this,{kind:"constant",value:void 0},e);if("constant"===t.expression.kind){var i=t.expression.evaluate(e,null,{},n,r),o="resolvedImage"===t.property.specification.type&&"string"!=typeof i?i.name:i,a=this._calculate(o,o,o,e);return new di(this,{kind:"constant",value:a},e)}if("camera"===t.expression.kind){var s=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 di(this,{kind:"constant",value:s},e)}return new di(this,t.expression,e)},e.prototype.evaluate=function(t,e,n,r,i,o){if("source"===t.kind){var a=t.evaluate(e,n,r,i,o);return this._calculate(a,a,a,e)}return"composite"===t.kind?this._calculate(t.evaluate({zoom:Math.floor(e.zoom)-1},n,r),t.evaluate({zoom:Math.floor(e.zoom)},n,r),t.evaluate({zoom:Math.floor(e.zoom)+1},n,r),e):t.value},e.prototype._calculate=function(t,e,n,r){return r.zoom>r.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:n,to:e}},e.prototype.interpolate=function(t){return t},e}(gi),yi=function(t){this.specification=t};yi.prototype.possiblyEvaluate=function(t,e,n,r){if(void 0!==t.value){if("constant"===t.expression.kind){var i=t.expression.evaluate(e,null,{},n,r);return this._calculate(i,i,i,e)}return this._calculate(t.expression.evaluate(new si(Math.floor(e.zoom-1),e)),t.expression.evaluate(new si(Math.floor(e.zoom),e)),t.expression.evaluate(new si(Math.floor(e.zoom+1),e)),e)}},yi.prototype._calculate=function(t,e,n,r){return r.zoom>r.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:n,to:e}},yi.prototype.interpolate=function(t){return t};var _i=function(t){this.specification=t};_i.prototype.possiblyEvaluate=function(t,e,n,r){return!!t.expression.evaluate(e,null,{},n,r)},_i.prototype.interpolate=function(){return!1};var bi=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 r=this.defaultPropertyValues[e]=new ui(n,void 0),i=this.defaultTransitionablePropertyValues[e]=new li(n);this.defaultTransitioningPropertyValues[e]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=r.possiblyEvaluate({})}};Rr("DataDrivenProperty",gi),Rr("DataConstantProperty",vi),Rr("CrossFadedDataDrivenProperty",mi),Rr("CrossFadedProperty",yi),Rr("ColorRampProperty",_i);var xi=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 pi(n.layout)),n.paint)){for(var r in this._transitionablePaint=new ci(n.paint),e.paint)this.setPaintProperty(r,e.paint[r],{validate:!1});for(var i in e.layout)this.setLayoutProperty(i,e.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Ai(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(Ir,"layers."+this.id+".layout."+t,t,e,n)||("visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e)},e.prototype.getPaintProperty=function(t){return m(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(Mr,"layers."+this.id+".paint."+t,t,e,n))return!1;if(m(t,"-transition"))return this._transitionablePaint.setTransition(t.slice(0,-11),e||void 0),!1;var r=this._transitionablePaint._values[t],i="cross-faded-data-driven"===r.property.specification["property-type"],o=r.value.isDataDriven(),a=r.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);var s=this._transitionablePaint._values[t].value;return s.isDataDriven()||o||i||this._handleOverridablePaintPropertyUpdate(t,a,s)},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,r,i){return void 0===i&&(i={}),(!i||!1!==i.validate)&&Pr(this,t.call(Sr,{key:e,layerType:this.type,objectKey:n,value:r,styleSpec:Tt,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 di&&Dn(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1},e}(St),wi={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Ci=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},Bi=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function ki(t,e){void 0===e&&(e=1);var n=0,r=0;return{members:t.map((function(t){var i=wi[t.type].BYTES_PER_ELEMENT,o=n=Ei(n,Math.max(e,i)),a=t.components||1;return r=Math.max(r,i),n+=i*a,{name:t.name,type:t.type,components:a,offset:o}})),size:Ei(n,Math.max(r,e)),alignment:e}}function Ei(t,e){return Math.ceil(t/e)*e}Bi.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},Bi.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},Bi.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Bi.prototype.clear=function(){this.length=0},Bi.prototype.resize=function(t){this.reserve(t),this.length=t},Bi.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)}},Bi.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var Si=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 r=2*t;return this.int16[r+0]=e,this.int16[r+1]=n,t},e}(Bi);Si.prototype.bytesPerElement=4,Rr("StructArrayLayout2i4",Si);var Ti=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,r){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,n,r)},e.prototype.emplace=function(t,e,n,r,i){var o=4*t;return this.int16[o+0]=e,this.int16[o+1]=n,this.int16[o+2]=r,this.int16[o+3]=i,t},e}(Bi);Ti.prototype.bytesPerElement=8,Rr("StructArrayLayout4i8",Ti);var Mi=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,r,i,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,n,r,i,o)},e.prototype.emplace=function(t,e,n,r,i,o,a){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=n,this.int16[s+2]=r,this.int16[s+3]=i,this.int16[s+4]=o,this.int16[s+5]=a,t},e}(Bi);Mi.prototype.bytesPerElement=12,Rr("StructArrayLayout2i4i12",Mi);var Ii=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,r,i,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,n,r,i,o)},e.prototype.emplace=function(t,e,n,r,i,o,a){var s=4*t,u=8*t;return this.int16[s+0]=e,this.int16[s+1]=n,this.uint8[u+4]=r,this.uint8[u+5]=i,this.uint8[u+6]=o,this.uint8[u+7]=a,t},e}(Bi);Ii.prototype.bytesPerElement=8,Rr("StructArrayLayout2i4ub8",Ii);var Pi=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 r=2*t;return this.float32[r+0]=e,this.float32[r+1]=n,t},e}(Bi);Pi.prototype.bytesPerElement=8,Rr("StructArrayLayout2f8",Pi);var Zi=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,r,i,o,a,s,u,l){var c=this.length;return this.resize(c+1),this.emplace(c,t,e,n,r,i,o,a,s,u,l)},e.prototype.emplace=function(t,e,n,r,i,o,a,s,u,l,c){var h=10*t;return this.uint16[h+0]=e,this.uint16[h+1]=n,this.uint16[h+2]=r,this.uint16[h+3]=i,this.uint16[h+4]=o,this.uint16[h+5]=a,this.uint16[h+6]=s,this.uint16[h+7]=u,this.uint16[h+8]=l,this.uint16[h+9]=c,t},e}(Bi);Zi.prototype.bytesPerElement=20,Rr("StructArrayLayout10ui20",Zi);var Di=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,r,i,o,a,s,u,l,c,h){var f=this.length;return this.resize(f+1),this.emplace(f,t,e,n,r,i,o,a,s,u,l,c,h)},e.prototype.emplace=function(t,e,n,r,i,o,a,s,u,l,c,h,f){var p=12*t;return this.int16[p+0]=e,this.int16[p+1]=n,this.int16[p+2]=r,this.int16[p+3]=i,this.uint16[p+4]=o,this.uint16[p+5]=a,this.uint16[p+6]=s,this.uint16[p+7]=u,this.int16[p+8]=l,this.int16[p+9]=c,this.int16[p+10]=h,this.int16[p+11]=f,t},e}(Bi);Di.prototype.bytesPerElement=24,Rr("StructArrayLayout4i4ui4i24",Di);var Li=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 r=this.length;return this.resize(r+1),this.emplace(r,t,e,n)},e.prototype.emplace=function(t,e,n,r){var i=3*t;return this.float32[i+0]=e,this.float32[i+1]=n,this.float32[i+2]=r,t},e}(Bi);Li.prototype.bytesPerElement=12,Rr("StructArrayLayout3f12",Li);var Oi=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}(Bi);Oi.prototype.bytesPerElement=4,Rr("StructArrayLayout1ul4",Oi);var Fi=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,r,i,o,a,s,u){var l=this.length;return this.resize(l+1),this.emplace(l,t,e,n,r,i,o,a,s,u)},e.prototype.emplace=function(t,e,n,r,i,o,a,s,u,l){var c=10*t,h=5*t;return this.int16[c+0]=e,this.int16[c+1]=n,this.int16[c+2]=r,this.int16[c+3]=i,this.int16[c+4]=o,this.int16[c+5]=a,this.uint32[h+3]=s,this.uint16[c+8]=u,this.uint16[c+9]=l,t},e}(Bi);Fi.prototype.bytesPerElement=20,Rr("StructArrayLayout6i1ul2ui20",Fi);var Ri=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,r,i,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,n,r,i,o)},e.prototype.emplace=function(t,e,n,r,i,o,a){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=n,this.int16[s+2]=r,this.int16[s+3]=i,this.int16[s+4]=o,this.int16[s+5]=a,t},e}(Bi);Ri.prototype.bytesPerElement=12,Rr("StructArrayLayout2i2i2i12",Ri);var zi=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,r,i){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,n,r,i)},e.prototype.emplace=function(t,e,n,r,i,o){var a=4*t,s=8*t;return this.float32[a+0]=e,this.float32[a+1]=n,this.float32[a+2]=r,this.int16[s+6]=i,this.int16[s+7]=o,t},e}(Bi);zi.prototype.bytesPerElement=16,Rr("StructArrayLayout2f1f2i16",zi);var Ui=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,r){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,n,r)},e.prototype.emplace=function(t,e,n,r,i){var o=12*t,a=3*t;return this.uint8[o+0]=e,this.uint8[o+1]=n,this.float32[a+1]=r,this.float32[a+2]=i,t},e}(Bi);Ui.prototype.bytesPerElement=12,Rr("StructArrayLayout2ub2f12",Ui);var Ni=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 r=this.length;return this.resize(r+1),this.emplace(r,t,e,n)},e.prototype.emplace=function(t,e,n,r){var i=3*t;return this.uint16[i+0]=e,this.uint16[i+1]=n,this.uint16[i+2]=r,t},e}(Bi);Ni.prototype.bytesPerElement=6,Rr("StructArrayLayout3ui6",Ni);var Gi=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,r,i,o,a,s,u,l,c,h,f,p,d,A,v){var g=this.length;return this.resize(g+1),this.emplace(g,t,e,n,r,i,o,a,s,u,l,c,h,f,p,d,A,v)},e.prototype.emplace=function(t,e,n,r,i,o,a,s,u,l,c,h,f,p,d,A,v,g){var m=24*t,y=12*t,_=48*t;return this.int16[m+0]=e,this.int16[m+1]=n,this.uint16[m+2]=r,this.uint16[m+3]=i,this.uint32[y+2]=o,this.uint32[y+3]=a,this.uint32[y+4]=s,this.uint16[m+10]=u,this.uint16[m+11]=l,this.uint16[m+12]=c,this.float32[y+7]=h,this.float32[y+8]=f,this.uint8[_+36]=p,this.uint8[_+37]=d,this.uint8[_+38]=A,this.uint32[y+10]=v,this.int16[m+22]=g,t},e}(Bi);Gi.prototype.bytesPerElement=48,Rr("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Gi);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._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,r,i,o,a,s,u,l,c,h,f,p,d,A,v,g,m,y,_,b,x,w,C,B,k,E){var S=this.length;return this.resize(S+1),this.emplace(S,t,e,n,r,i,o,a,s,u,l,c,h,f,p,d,A,v,g,m,y,_,b,x,w,C,B,k,E)},e.prototype.emplace=function(t,e,n,r,i,o,a,s,u,l,c,h,f,p,d,A,v,g,m,y,_,b,x,w,C,B,k,E,S){var T=34*t,M=17*t;return this.int16[T+0]=e,this.int16[T+1]=n,this.int16[T+2]=r,this.int16[T+3]=i,this.int16[T+4]=o,this.int16[T+5]=a,this.int16[T+6]=s,this.int16[T+7]=u,this.uint16[T+8]=l,this.uint16[T+9]=c,this.uint16[T+10]=h,this.uint16[T+11]=f,this.uint16[T+12]=p,this.uint16[T+13]=d,this.uint16[T+14]=A,this.uint16[T+15]=v,this.uint16[T+16]=g,this.uint16[T+17]=m,this.uint16[T+18]=y,this.uint16[T+19]=_,this.uint16[T+20]=b,this.uint16[T+21]=x,this.uint16[T+22]=w,this.uint32[M+12]=C,this.float32[M+13]=B,this.float32[M+14]=k,this.float32[M+15]=E,this.float32[M+16]=S,t},e}(Bi);ji.prototype.bytesPerElement=68,Rr("StructArrayLayout8i15ui1ul4f68",ji);var Vi=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}(Bi);Vi.prototype.bytesPerElement=4,Rr("StructArrayLayout1f4",Vi);var Hi=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 r=this.length;return this.resize(r+1),this.emplace(r,t,e,n)},e.prototype.emplace=function(t,e,n,r){var i=3*t;return this.int16[i+0]=e,this.int16[i+1]=n,this.int16[i+2]=r,t},e}(Bi);Hi.prototype.bytesPerElement=6,Rr("StructArrayLayout3i6",Hi);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._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 r=this.length;return this.resize(r+1),this.emplace(r,t,e,n)},e.prototype.emplace=function(t,e,n,r){var i=4*t;return this.uint32[2*t+0]=e,this.uint16[i+2]=n,this.uint16[i+3]=r,t},e}(Bi);Ji.prototype.bytesPerElement=8,Rr("StructArrayLayout1ul2ui8",Ji);var 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._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 r=2*t;return this.uint16[r+0]=e,this.uint16[r+1]=n,t},e}(Bi);Wi.prototype.bytesPerElement=4,Rr("StructArrayLayout2ui4",Wi);var 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._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}(Bi);Qi.prototype.bytesPerElement=2,Rr("StructArrayLayout1ui2",Qi);var 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._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n,r){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,n,r)},e.prototype.emplace=function(t,e,n,r,i){var o=4*t;return this.float32[o+0]=e,this.float32[o+1]=n,this.float32[o+2]=r,this.float32[o+3]=i,t},e}(Bi);qi.prototype.bytesPerElement=16,Rr("StructArrayLayout4f16",qi);var Ki=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 i(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,n),e}(Ci);Ki.prototype.size=20;var Xi=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 Ki(this,t)},e}(Fi);Rr("CollisionBoxArray",Xi);var Yi=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}(Ci);Yi.prototype.size=48;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.get=function(t){return new Yi(this,t)},e}(Gi);Rr("PlacedSymbolArray",$i);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}(Ci);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}(ji);Rr("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}(Vi);Rr("GlyphOffsetArray",no);var ro=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}(Hi);Rr("SymbolLineVertexArray",ro);var io=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}(Ci);io.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 io(this,t)},e}(Ji);Rr("FeatureIndexArray",oo);var ao=ki([{name:"a_pos",components:2,type:"Int16"}],4).members,so=function(t){void 0===t&&(t=[]),this.segments=t};function uo(t,e){return 256*(t=c(Math.floor(t),0,255))+c(Math.floor(e),0,255)}so.prototype.prepareSegment=function(t,e,n,r){var i=this.segments[this.segments.length-1];return t>so.MAX_VERTEX_ARRAY_LENGTH&&w("Max vertices per segment is "+so.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!i||i.vertexLength+t>so.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==r)&&(i={vertexOffset:e.length,primitiveOffset:n.length,vertexLength:0,primitiveLength:0},void 0!==r&&(i.sortKey=r),this.segments.push(i)),i},so.prototype.get=function(){return this.segments},so.prototype.destroy=function(){for(var t=0,e=this.segments;t<e.length;t+=1){var n=e[t];for(var r in n.vaos)n.vaos[r].destroy()}},so.simpleSegment=function(t,e,n,r){return new so([{vertexOffset:t,primitiveOffset:e,vertexLength:n,primitiveLength:r,vaos:{},sortKey:0}])},so.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Rr("SegmentVector",so);var lo=ki([{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"}]),co=e((function(t){t.exports=function(t,e){var n,r,i,o,a,s,u,l;for(r=t.length-(n=3&t.length),i=e,a=3432918353,s=461845907,l=0;l<r;)u=255&t.charCodeAt(l)|(255&t.charCodeAt(++l))<<8|(255&t.charCodeAt(++l))<<16|(255&t.charCodeAt(++l))<<24,++l,i=27492+(65535&(o=5*(65535&(i=(i^=u=(65535&(u=(u=(65535&u)*a+(((u>>>16)*a&65535)<<16)&4294967295)<<15|u>>>17))*s+(((u>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(o>>>16)&65535)<<16);switch(u=0,n){case 3:u^=(255&t.charCodeAt(l+2))<<16;case 2:u^=(255&t.charCodeAt(l+1))<<8;case 1:i^=u=(65535&(u=(u=(65535&(u^=255&t.charCodeAt(l)))*a+(((u>>>16)*a&65535)<<16)&4294967295)<<15|u>>>17))*s+(((u>>>16)*s&65535)<<16)&4294967295}return i^=t.length,i=2246822507*(65535&(i^=i>>>16))+((2246822507*(i>>>16)&65535)<<16)&4294967295,i=3266489909*(65535&(i^=i>>>13))+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^=i>>>16)>>>0}})),ho=e((function(t){t.exports=function(t,e){for(var n,r=t.length,i=e^r,o=0;r>=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),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(n=1540483477*(65535&(n^=n>>>24))+((1540483477*(n>>>16)&65535)<<16)),r-=4,++o;switch(r){case 3:i^=(255&t.charCodeAt(o+2))<<16;case 2:i^=(255&t.charCodeAt(o+1))<<8;case 1:i=1540483477*(65535&(i^=255&t.charCodeAt(o)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0}})),fo=co,po=ho;fo.murmur3=co,fo.murmur2=po;var Ao=function(){this.ids=[],this.positions=[],this.indexed=!1};Ao.prototype.add=function(t,e,n,r){this.ids.push(go(t)),this.positions.push(e,n,r)},Ao.prototype.getPositions=function(t){for(var e=go(t),n=0,r=this.ids.length-1;n<r;){var i=n+r>>1;this.ids[i]>=e?r=i:n=i+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},Ao.serialize=function(t,e){var n=new Float64Array(t.ids),r=new Uint32Array(t.positions);return function t(e,n,r,i){for(;r<i;){for(var o=e[r+i>>1],a=r-1,s=i+1;;){do{a++}while(e[a]<o);do{s--}while(e[s]>o);if(a>=s)break;mo(e,a,s),mo(n,3*a,3*s),mo(n,3*a+1,3*s+1),mo(n,3*a+2,3*s+2)}s-r<i-s?(t(e,n,r,s),r=s+1):(t(e,n,s+1,i),i=s)}}(n,r,0,n.length-1),e&&e.push(n.buffer,r.buffer),{ids:n,positions:r}},Ao.deserialize=function(t){var e=new Ao;return e.ids=t.ids,e.positions=t.positions,e.indexed=!0,e};var vo=Math.pow(2,53)-1;function go(t){var e=+t;return!isNaN(e)&&e<=vo?e:fo(String(t))}function mo(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}Rr("FeaturePositionMap",Ao);var yo=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}(yo),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}(yo),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}(yo),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}(yo),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}(yo),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}(yo),ko=new Float32Array(16),Eo=function(t){function e(e,n){t.call(this,e,n),this.current=ko}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}(yo);function So(t){return[uo(255*t.r,255*t.g),uo(255*t.b,255*t.a)]}var To=function(t,e,n){this.value=t,this.uniformNames=e.map((function(t){return"u_"+t})),this.type=n};To.prototype.setUniform=function(t,e,n){t.set(n.constantOr(this.value))},To.prototype.getBinding=function(t,e,n){return"color"===this.type?new Bo(t,e):new bo(t,e)};var Mo=function(t,e){this.uniformNames=e.map((function(t){return"u_"+t})),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1};Mo.prototype.setConstantPatternPositions=function(t,e){this.pixelRatioFrom=e.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=e.tlbr,this.patternTo=t.tlbr},Mo.prototype.setUniform=function(t,e,n,r){var i="u_pattern_to"===r?this.patternTo:"u_pattern_from"===r?this.patternFrom:"u_pixel_ratio_to"===r?this.pixelRatioTo:"u_pixel_ratio_from"===r?this.pixelRatioFrom:null;i&&t.set(i)},Mo.prototype.getBinding=function(t,e,n){return"u_pattern"===n.substr(0,9)?new Co(t,e):new bo(t,e)};var Io=function(t,e,n,r){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 r};Io.prototype.populatePaintArray=function(t,e,n,r,i){var o=this.paintVertexArray.length,a=this.expression.evaluate(new si(0),e,{},r,[],i);this.paintVertexArray.resize(t),this._setPaintValue(o,t,a)},Io.prototype.updatePaintArray=function(t,e,n,r){var i=this.expression.evaluate({zoom:0},n,r);this._setPaintValue(t,e,i)},Io.prototype._setPaintValue=function(t,e,n){if("color"===this.type)for(var r=So(n),i=t;i<e;i++)this.paintVertexArray.emplace(i,r[0],r[1]);else{for(var o=t;o<e;o++)this.paintVertexArray.emplace(o,n);this.maxValue=Math.max(this.maxValue,Math.abs(n))}},Io.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))},Io.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()};var Po=function(t,e,n,r,i,o){this.expression=t,this.uniformNames=e.map((function(t){return"u_"+t+"_t"})),this.type=n,this.useIntegerZoom=r,this.zoom=i,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};Po.prototype.populatePaintArray=function(t,e,n,r,i){var o=this.expression.evaluate(new si(this.zoom),e,{},r,[],i),a=this.expression.evaluate(new si(this.zoom+1),e,{},r,[],i),s=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(s,t,o,a)},Po.prototype.updatePaintArray=function(t,e,n,r){var i=this.expression.evaluate({zoom:this.zoom},n,r),o=this.expression.evaluate({zoom:this.zoom+1},n,r);this._setPaintValue(t,e,i,o)},Po.prototype._setPaintValue=function(t,e,n,r){if("color"===this.type)for(var i=So(n),o=So(r),a=t;a<e;a++)this.paintVertexArray.emplace(a,i[0],i[1],o[0],o[1]);else{for(var s=t;s<e;s++)this.paintVertexArray.emplace(s,n,r);this.maxValue=Math.max(this.maxValue,Math.abs(n),Math.abs(r))}},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()},Po.prototype.setUniform=function(t,e){var n=this.useIntegerZoom?Math.floor(e.zoom):e.zoom,r=c(this.expression.interpolationFactor(n,this.zoom,this.zoom+1),0,1);t.set(r)},Po.prototype.getBinding=function(t,e,n){return new bo(t,e)};var Zo=function(t,e,n,r,i,o){this.expression=t,this.type=e,this.useIntegerZoom=n,this.zoom=r,this.layerId=o,this.zoomInPaintVertexArray=new i,this.zoomOutPaintVertexArray=new i};Zo.prototype.populatePaintArray=function(t,e,n){var r=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(t),this.zoomOutPaintVertexArray.resize(t),this._setPaintValues(r,t,e.patterns&&e.patterns[this.layerId],n)},Zo.prototype.updatePaintArray=function(t,e,n,r,i){this._setPaintValues(t,e,n.patterns&&n.patterns[this.layerId],i)},Zo.prototype._setPaintValues=function(t,e,n,r){if(r&&n){var i=r[n.min],o=r[n.mid],a=r[n.max];if(i&&o&&a)for(var s=t;s<e;s++)this.zoomInPaintVertexArray.emplace(s,o.tl[0],o.tl[1],o.br[0],o.br[1],i.tl[0],i.tl[1],i.br[0],i.br[1],o.pixelRatio,i.pixelRatio),this.zoomOutPaintVertexArray.emplace(s,o.tl[0],o.tl[1],o.br[0],o.br[1],a.tl[0],a.tl[1],a.br[0],a.br[1],o.pixelRatio,a.pixelRatio)}},Zo.prototype.upload=function(t){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=t.createVertexBuffer(this.zoomInPaintVertexArray,lo.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,lo.members,this.expression.isStateDependent))},Zo.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()};var Do=function(t,e,n){this.binders={},this._buffers=[];var r=[];for(var i in t.paint._values)if(n(i)){var o=t.paint.get(i);if(o instanceof di&&Dn(o.property.specification)){var a=Oo(i,t.type),s=o.value,u=o.property.specification.type,l=o.property.useIntegerZoom,c=o.property.specification["property-type"],h="cross-faded"===c||"cross-faded-data-driven"===c;if("constant"===s.kind)this.binders[i]=h?new Mo(s.value,a):new To(s.value,a,u),r.push("/u_"+i);else if("source"===s.kind||h){var f=Fo(i,u,"source");this.binders[i]=h?new Zo(s,u,l,e,f,t.id):new Io(s,a,u,f),r.push("/a_"+i)}else{var p=Fo(i,u,"composite");this.binders[i]=new Po(s,a,u,l,e,p),r.push("/z_"+i)}}}this.cacheKey=r.sort().join("")};Do.prototype.getMaxValue=function(t){var e=this.binders[t];return e instanceof Io||e instanceof Po?e.maxValue:0},Do.prototype.populatePaintArrays=function(t,e,n,r,i){for(var o in this.binders){var a=this.binders[o];(a instanceof Io||a instanceof Po||a instanceof Zo)&&a.populatePaintArray(t,e,n,r,i)}},Do.prototype.setConstantPatternPositions=function(t,e){for(var n in this.binders){var r=this.binders[n];r instanceof Mo&&r.setConstantPatternPositions(t,e)}},Do.prototype.updatePaintArrays=function(t,e,n,r,i){var o=!1;for(var a in t)for(var s=0,u=e.getPositions(a);s<u.length;s+=1){var l=u[s],c=n.feature(l.index);for(var h in this.binders){var f=this.binders[h];if((f instanceof Io||f instanceof Po||f instanceof Zo)&&!0===f.expression.isStateDependent){var p=r.paint.get(h);f.expression=p.value,f.updatePaintArray(l.start,l.end,c,t[a],i),o=!0}}}return o},Do.prototype.defines=function(){var t=[];for(var e in this.binders){var n=this.binders[e];(n instanceof To||n instanceof Mo)&&t.push.apply(t,n.uniformNames.map((function(t){return"#define HAS_UNIFORM_"+t})))}return t},Do.prototype.getBinderAttributes=function(){var t=[];for(var e in this.binders){var n=this.binders[e];if(n instanceof Io||n instanceof Po)for(var r=0;r<n.paintVertexAttributes.length;r++)t.push(n.paintVertexAttributes[r].name);else if(n instanceof Zo)for(var i=0;i<lo.members.length;i++)t.push(lo.members[i].name)}return t},Do.prototype.getBinderUniforms=function(){var t=[];for(var e in this.binders){var n=this.binders[e];if(n instanceof To||n instanceof Mo||n instanceof Po)for(var r=0,i=n.uniformNames;r<i.length;r+=1)t.push(i[r])}return t},Do.prototype.getPaintVertexBuffers=function(){return this._buffers},Do.prototype.getUniforms=function(t,e){var n=[];for(var r in this.binders){var i=this.binders[r];if(i instanceof To||i instanceof Mo||i instanceof Po)for(var o=0,a=i.uniformNames;o<a.length;o+=1){var s=a[o];if(e[s]){var u=i.getBinding(t,e[s],s);n.push({name:s,property:r,binding:u})}}}return n},Do.prototype.setUniforms=function(t,e,n,r){for(var i=0,o=e;i<o.length;i+=1){var a=o[i],s=a.name,u=a.property;this.binders[u].setUniform(a.binding,r,n.get(u),s)}},Do.prototype.updatePaintBuffers=function(t){for(var e in this._buffers=[],this.binders){var n=this.binders[e];if(t&&n instanceof Zo){var r=2===t.fromScale?n.zoomInPaintVertexBuffer:n.zoomOutPaintVertexBuffer;r&&this._buffers.push(r)}else(n instanceof Io||n instanceof Po)&&n.paintVertexBuffer&&this._buffers.push(n.paintVertexBuffer)}},Do.prototype.upload=function(t){for(var e in this.binders){var n=this.binders[e];(n instanceof Io||n instanceof Po||n instanceof Zo)&&n.upload(t)}this.updatePaintBuffers()},Do.prototype.destroy=function(){for(var t in this.binders){var e=this.binders[t];(e instanceof Io||e instanceof Po||e instanceof Zo)&&e.destroy()}};var Lo=function(t,e,n){void 0===n&&(n=function(){return!0}),this.programConfigurations={};for(var r=0,i=t;r<i.length;r+=1){var o=i[r];this.programConfigurations[o.id]=new Do(o,e,n)}this.needsUpload=!1,this._featureMap=new Ao,this._bufferOffset=0};function Oo(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 Fo(t,e,n){var r={color:{source:Pi,composite:qi},number:{source:Vi,composite:Pi}},i=function(t){return{"line-pattern":{source:Zi,composite:Zi},"fill-pattern":{source:Zi,composite:Zi},"fill-extrusion-pattern":{source:Zi,composite:Zi}}[t]}(t);return i&&i[n]||r[e][n]}Lo.prototype.populatePaintArrays=function(t,e,n,r,i,o){for(var a in this.programConfigurations)this.programConfigurations[a].populatePaintArrays(t,e,r,i,o);void 0!==e.id&&this._featureMap.add(e.id,n,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0},Lo.prototype.updatePaintArrays=function(t,e,n,r){for(var i=0,o=n;i<o.length;i+=1){var a=o[i];this.needsUpload=this.programConfigurations[a.id].updatePaintArrays(t,this._featureMap,e,a,r)||this.needsUpload}},Lo.prototype.get=function(t){return this.programConfigurations[t]},Lo.prototype.upload=function(t){if(this.needsUpload){for(var e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1}},Lo.prototype.destroy=function(){for(var t in this.programConfigurations)this.programConfigurations[t].destroy()},Rr("ConstantBinder",To),Rr("CrossFadedConstantBinder",Mo),Rr("SourceExpressionBinder",Io),Rr("CrossFadedCompositeBinder",Zo),Rr("CompositeExpressionBinder",Po),Rr("ProgramConfiguration",Do,{omit:["_buffers"]}),Rr("ProgramConfigurationSet",Lo);var Ro=Math.pow(2,14)-1,zo=-Ro-1;function Uo(t){for(var e=8192/t.extent,n=t.loadGeometry(),r=0;r<n.length;r++)for(var i=n[r],o=0;o<i.length;o++){var a=i[o],s=Math.round(a.x*e),u=Math.round(a.y*e);a.x=c(s,zo,Ro),a.y=c(u,zo,Ro),(s<a.x||s>a.x+1||u<a.y||u>a.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?Uo(t):[]}}function Go(t,e,n,r,i){t.emplaceBack(2*e+(r+1)/2,2*n+(i+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 Si,this.indexArray=new Ni,this.segments=new so,this.programConfigurations=new Lo(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 r=0;r<e.length;r++)if($o(t,e[r]))return!0;return!!Qo(t,e)}function Ho(t,e,n){return!!$o(t,e)||!!Ko(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 r=e[n],i=0;i<r.length;i++)if($o(t,r[i]))return!0;for(var o=0;o<t.length;o++)if(Yo(e,t[o]))return!0;for(var a=0;a<e.length;a++)if(Qo(t,e[a]))return!0;return!1}function Wo(t,e,n){if(t.length>1){if(Qo(t,e))return!0;for(var r=0;r<e.length;r++)if(Ko(e[r],t,n))return!0}for(var i=0;i<t.length;i++)if(Ko(t[i],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 r=t[n],i=t[n+1],o=0;o<e.length-1;o++)if(qo(r,i,e[o],e[o+1]))return!0;return!1}function qo(t,e,n,r){return C(t,n,r)!==C(e,n,r)&&C(t,e,n)!==C(t,e,r)}function Ko(t,e,n){var r=n*n;if(1===e.length)return t.distSqr(e[0])<r;for(var i=1;i<e.length;i++)if(Xo(t,e[i-1],e[i])<r)return!0;return!1}function Xo(t,e,n){var r=e.distSqr(n);if(0===r)return t.distSqr(e);var i=((t.x-e.x)*(n.x-e.x)+(t.y-e.y)*(n.y-e.y))/r;return t.distSqr(i<0?e:i>1?n:n.sub(e)._mult(i)._add(e))}function Yo(t,e){for(var n,r,i,o=!1,a=0;a<t.length;a++)for(var s=0,u=(n=t[a]).length-1;s<n.length;u=s++)(r=n[s]).y>e.y!=(i=n[u]).y>e.y&&e.x<(i.x-r.x)*(e.y-r.y)/(i.y-r.y)+r.x&&(o=!o);return o}function $o(t,e){for(var n=!1,r=0,i=t.length-1;r<t.length;i=r++){var o=t[r],a=t[i];o.y>e.y!=a.y>e.y&&e.x<(a.x-o.x)*(e.y-o.y)/(a.y-o.y)+o.x&&(n=!n)}return n}function ta(t,e,n){var r=n[0],i=n[2];if(t.x<r.x&&e.x<r.x||t.x>i.x&&e.x>i.x||t.y<r.y&&e.y<r.y||t.y>i.y&&e.y>i.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 ea(t,e,n){var r=e.paint.get(t).value;return"constant"===r.kind?r.value:n.programConfigurations.get(e.id).getMaxValue(t)}function na(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function ra(t,e,n,r,o){if(!e[0]&&!e[1])return t;var a=i.convert(e)._mult(o);"viewport"===n&&a._rotate(-r);for(var s=[],u=0;u<t.length;u++)s.push(t[u].sub(a));return s}jo.prototype.populate=function(t,e,n){var r=this.layers[0],i=[],o=null;"circle"===r.type&&(o=r.layout.get("circle-sort-key"));for(var a=0,s=t;a<s.length;a+=1){var u=s[a],l=u.feature,c=u.id,h=u.index,f=u.sourceLayerIndex,p=this.layers[0]._featureFilter.needGeometry,d=No(l,p);if(this.layers[0]._featureFilter.filter(new si(this.zoom),d,n)){var A=o?o.evaluate(d,{},n):void 0,v={id:c,properties:l.properties,type:l.type,sourceLayerIndex:f,index:h,geometry:p?d.geometry:Uo(l),patterns:{},sortKey:A};i.push(v)}}o&&i.sort((function(t,e){return t.sortKey-e.sortKey}));for(var g=0,m=i;g<m.length;g+=1){var y=m[g],_=y.geometry,b=y.index,x=y.sourceLayerIndex,w=t[b].feature;this.addFeature(y,_,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,ao),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,r){for(var i=0,o=e;i<o.length;i+=1)for(var a=0,s=o[i];a<s.length;a+=1){var u=s[a],l=u.x,c=u.y;if(!(l<0||l>=8192||c<0||c>=8192)){var h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),f=h.vertexLength;Go(this.layoutVertexArray,l,c,-1,-1),Go(this.layoutVertexArray,l,c,1,-1),Go(this.layoutVertexArray,l,c,1,1),Go(this.layoutVertexArray,l,c,-1,1),this.indexArray.emplaceBack(f,f+1,f+2),this.indexArray.emplaceBack(f,f+3,f+2),h.vertexLength+=4,h.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,n,{},r)},Rr("CircleBucket",jo,{omit:["layers"]});var ia=new bi({"circle-sort-key":new gi(Tt.layout_circle["circle-sort-key"])}),oa={paint:new bi({"circle-radius":new gi(Tt.paint_circle["circle-radius"]),"circle-color":new gi(Tt.paint_circle["circle-color"]),"circle-blur":new gi(Tt.paint_circle["circle-blur"]),"circle-opacity":new gi(Tt.paint_circle["circle-opacity"]),"circle-translate":new vi(Tt.paint_circle["circle-translate"]),"circle-translate-anchor":new vi(Tt.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new vi(Tt.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new vi(Tt.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new gi(Tt.paint_circle["circle-stroke-width"]),"circle-stroke-color":new gi(Tt.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new gi(Tt.paint_circle["circle-stroke-opacity"])}),layout:ia},aa="undefined"!=typeof Float32Array?Float32Array:Array;function sa(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 ua(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=e[8],f=e[9],p=e[10],d=e[11],A=e[12],v=e[13],g=e[14],m=e[15],y=n[0],_=n[1],b=n[2],x=n[3];return t[0]=y*r+_*s+b*h+x*A,t[1]=y*i+_*u+b*f+x*v,t[2]=y*o+_*l+b*p+x*g,t[3]=y*a+_*c+b*d+x*m,t[4]=(y=n[4])*r+(_=n[5])*s+(b=n[6])*h+(x=n[7])*A,t[5]=y*i+_*u+b*f+x*v,t[6]=y*o+_*l+b*p+x*g,t[7]=y*a+_*c+b*d+x*m,t[8]=(y=n[8])*r+(_=n[9])*s+(b=n[10])*h+(x=n[11])*A,t[9]=y*i+_*u+b*f+x*v,t[10]=y*o+_*l+b*p+x*g,t[11]=y*a+_*c+b*d+x*m,t[12]=(y=n[12])*r+(_=n[13])*s+(b=n[14])*h+(x=n[15])*A,t[13]=y*i+_*u+b*f+x*v,t[14]=y*o+_*l+b*p+x*g,t[15]=y*a+_*c+b*d+x*m,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 la,ca=ua;function ha(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,t[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,t[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,t[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,t}la=new aa(3),aa!=Float32Array&&(la[0]=0,la[1]=0,la[2]=0),function(){var t=new aa(4);aa!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0)}();var fa=(function(){var t=new aa(2);aa!=Float32Array&&(t[0]=0,t[1]=0)}(),function(t){function e(e){t.call(this,e,oa)}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 ea("circle-radius",this,e)+ea("circle-stroke-width",this,e)+na(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,n,r,i,o,a,s){for(var u=ra(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),o.angle,a),l=this.paint.get("circle-radius").evaluate(e,n)+this.paint.get("circle-stroke-width").evaluate(e,n),c="map"===this.paint.get("circle-pitch-alignment"),h=c?u:function(t,e){return t.map((function(t){return pa(t,e)}))}(u,s),f=c?l*a:l,p=0,d=r;p<d.length;p+=1)for(var A=0,v=d[p];A<v.length;A+=1){var g=v[A],m=c?g:pa(g,s),y=f,_=ha([],[g.x,g.y,0,1],s);if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?y*=_[3]/o.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(y*=o.cameraToCenterDistance/_[3]),Ho(h,m,y))return!0}return!1},e}(xi));function pa(t,e){var n=ha([],[t.x,t.y,0,1],e);return new i(n[0]/n[3],n[1]/n[3])}var da=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 Aa(t,e,n,r){var i=e.width,o=e.height;if(r){if(r instanceof Uint8ClampedArray)r=new Uint8Array(r.buffer);else if(r.length!==i*o*n)throw new RangeError("mismatched image size")}else r=new Uint8Array(i*o*n);return t.width=i,t.height=o,t.data=r,t}function va(t,e,n){var r=e.width,i=e.height;if(r!==t.width||i!==t.height){var o=Aa({},{width:r,height:i},n);ga(t,o,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,r),height:Math.min(t.height,i)},n),t.width=r,t.height=i,t.data=o.data}}function ga(t,e,n,r,i,o){if(0===i.width||0===i.height)return e;if(i.width>t.width||i.height>t.height||n.x>t.width-i.width||n.y>t.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>e.width||i.height>e.height||r.x>e.width-i.width||r.y>e.height-i.height)throw new RangeError("out of range destination coordinates for image copy");for(var a=t.data,s=e.data,u=0;u<i.height;u++)for(var l=((n.y+u)*t.width+n.x)*o,c=((r.y+u)*e.width+r.x)*o,h=0;h<i.width*o;h++)s[c+h]=a[l+h];return e}Rr("HeatmapBucket",da,{omit:["layers"]});var ma=function(t,e){Aa(this,t,1,e)};ma.prototype.resize=function(t){va(this,t,1)},ma.prototype.clone=function(){return new ma({width:this.width,height:this.height},new Uint8Array(this.data))},ma.copy=function(t,e,n,r,i){ga(t,e,n,r,i,1)};var ya=function(t,e){Aa(this,t,4,e)};ya.prototype.resize=function(t){va(this,t,4)},ya.prototype.replace=function(t,e){e?this.data.set(t):this.data=t instanceof Uint8ClampedArray?new Uint8Array(t.buffer):t},ya.prototype.clone=function(){return new ya({width:this.width,height:this.height},new Uint8Array(this.data))},ya.copy=function(t,e,n,r,i){ga(t,e,n,r,i,4)},Rr("AlphaImage",ma),Rr("RGBAImage",ya);var _a={paint:new bi({"heatmap-radius":new gi(Tt.paint_heatmap["heatmap-radius"]),"heatmap-weight":new gi(Tt.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new vi(Tt.paint_heatmap["heatmap-intensity"]),"heatmap-color":new _i(Tt.paint_heatmap["heatmap-color"]),"heatmap-opacity":new vi(Tt.paint_heatmap["heatmap-opacity"])})};function ba(t){var e={},n=t.resolution||256,r=t.clips?t.clips.length:1,i=t.image||new ya({width:n,height:r}),o=function(n,r,o){e[t.evaluationKey]=o;var a=t.expression.evaluate(e);i.data[n+r+0]=Math.floor(255*a.r/a.a),i.data[n+r+1]=Math.floor(255*a.g/a.a),i.data[n+r+2]=Math.floor(255*a.b/a.a),i.data[n+r+3]=Math.floor(255*a.a)};if(t.clips)for(var a=0,s=0;a<r;++a,s+=4*n)for(var u=0,l=0;u<n;u++,l+=4){var c=u/(n-1),h=t.clips[a];o(s,l,h.start*(1-c)+h.end*c)}else for(var f=0,p=0;f<n;f++,p+=4)o(0,p,f/(n-1));return i}var xa=function(t){function e(e){t.call(this,e,_a),this._updateColorRamp()}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new da(t)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){"heatmap-color"===t&&this._updateColorRamp()},e.prototype._updateColorRamp=function(){this.colorRamp=ba({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}(xi),wa={paint:new bi({"hillshade-illumination-direction":new vi(Tt.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new vi(Tt.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new vi(Tt.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new vi(Tt.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new vi(Tt.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new vi(Tt.paint_hillshade["hillshade-accent-color"])})},Ca=function(t){function e(e){t.call(this,e,wa)}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}(xi),Ba=ki([{name:"a_pos",components:2,type:"Int16"}],4).members,ka=Sa,Ea=Sa;function Sa(t,e,n){n=n||2;var r,i,o,a,s,u,l,c=e&&e.length,h=c?e[0]*n:t.length,f=Ta(t,0,h,n,!0),p=[];if(!f||f.next===f.prev)return p;if(c&&(f=function(t,e,n,r){var i,o,a,s=[];for(i=0,o=e.length;i<o;i++)(a=Ta(t,e[i]*r,i<o-1?e[i+1]*r:t.length,r,!1))===a.next&&(a.steiner=!0),s.push(Ua(a));for(s.sort(Oa),i=0;i<s.length;i++)Fa(s[i],n),n=Ma(n,n.next);return n}(t,e,f,n)),t.length>80*n){r=o=t[0],i=a=t[1];for(var d=n;d<h;d+=n)(s=t[d])<r&&(r=s),(u=t[d+1])<i&&(i=u),s>o&&(o=s),u>a&&(a=u);l=0!==(l=Math.max(o-r,a-i))?1/l:0}return Ia(f,p,n,r,i,l),p}function Ta(t,e,n,r,i){var o,a;if(i===$a(t,e,n,r)>0)for(o=e;o<n;o+=r)a=Ka(o,t[o],t[o+1],a);else for(o=n-r;o>=e;o-=r)a=Ka(o,t[o],t[o+1],a);return a&&Va(a,a.next)&&(Xa(a),a=a.next),a}function Ma(t,e){if(!t)return t;e||(e=t);var n,r=t;do{if(n=!1,r.steiner||!Va(r,r.next)&&0!==ja(r.prev,r,r.next))r=r.next;else{if(Xa(r),(r=e=r.prev)===r.next)break;n=!0}}while(n||r!==e);return e}function Ia(t,e,n,r,i,o,a){if(t){!a&&o&&function(t,e,n,r){var i=t;do{null===i.z&&(i.z=za(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,n,r,i,o,a,s,u,l=1;do{for(n=t,t=null,o=null,a=0;n;){for(a++,r=n,s=0,e=0;e<l&&(s++,r=r.nextZ);e++);for(u=l;s>0||u>0&&r;)0!==s&&(0===u||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,u--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;n=r}o.nextZ=null,l*=2}while(a>1)}(i)}(t,r,i,o);for(var s,u,l=t;t.prev!==t.next;)if(s=t.prev,u=t.next,o?Za(t,r,i,o):Pa(t))e.push(s.i/n),e.push(t.i/n),e.push(u.i/n),Xa(t),t=u.next,l=u.next;else if((t=u)===l){a?1===a?Ia(t=Da(Ma(t),e,n),e,n,r,i,o,2):2===a&&La(t,e,n,r,i,o):Ia(Ma(t),e,n,r,i,o,1);break}}}function Pa(t){var e=t.prev,n=t,r=t.next;if(ja(e,n,r)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(Na(e.x,e.y,n.x,n.y,r.x,r.y,i.x,i.y)&&ja(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function Za(t,e,n,r){var i=t.prev,o=t,a=t.next;if(ja(i,o,a)>=0)return!1;for(var s=i.x>o.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,u=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,l=za(i.x<o.x?i.x<a.x?i.x:a.x:o.x<a.x?o.x:a.x,i.y<o.y?i.y<a.y?i.y:a.y:o.y<a.y?o.y:a.y,e,n,r),c=za(s,u,e,n,r),h=t.prevZ,f=t.nextZ;h&&h.z>=l&&f&&f.z<=c;){if(h!==t.prev&&h!==t.next&&Na(i.x,i.y,o.x,o.y,a.x,a.y,h.x,h.y)&&ja(h.prev,h,h.next)>=0)return!1;if(h=h.prevZ,f!==t.prev&&f!==t.next&&Na(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&ja(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;h&&h.z>=l;){if(h!==t.prev&&h!==t.next&&Na(i.x,i.y,o.x,o.y,a.x,a.y,h.x,h.y)&&ja(h.prev,h,h.next)>=0)return!1;h=h.prevZ}for(;f&&f.z<=c;){if(f!==t.prev&&f!==t.next&&Na(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&ja(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function Da(t,e,n){var r=t;do{var i=r.prev,o=r.next.next;!Va(i,o)&&Ha(i,r,r.next,o)&&Qa(i,o)&&Qa(o,i)&&(e.push(i.i/n),e.push(r.i/n),e.push(o.i/n),Xa(r),Xa(r.next),r=t=o),r=r.next}while(r!==t);return Ma(r)}function La(t,e,n,r,i,o){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&Ga(a,s)){var u=qa(a,s);return a=Ma(a,a.next),u=Ma(u,u.next),Ia(a,e,n,r,i,o),void Ia(u,e,n,r,i,o)}s=s.next}a=a.next}while(a!==t)}function Oa(t,e){return t.x-e.x}function Fa(t,e){if(e=function(t,e){var n,r=e,i=t.x,o=t.y,a=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var s=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&s>a){if(a=s,s===i){if(o===r.y)return r;if(o===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==e);if(!n)return null;if(i===a)return n;var u,l=n,c=n.x,h=n.y,f=1/0;r=n;do{i>=r.x&&r.x>=c&&i!==r.x&&Na(o<h?i:a,o,c,h,o<h?a:i,o,r.x,r.y)&&(u=Math.abs(o-r.y)/(i-r.x),Qa(r,t)&&(u<f||u===f&&(r.x>n.x||r.x===n.x&&Ra(n,r)))&&(n=r,f=u)),r=r.next}while(r!==l);return n}(t,e)){var n=qa(e,t);Ma(e,e.next),Ma(n,n.next)}}function Ra(t,e){return ja(t.prev,t,e.prev)<0&&ja(e.next,t,t.next)<0}function za(t,e,n,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Ua(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 Na(t,e,n,r,i,o,a,s){return(i-a)*(e-s)-(t-a)*(o-s)>=0&&(t-a)*(r-s)-(n-a)*(e-s)>=0&&(n-a)*(o-s)-(i-a)*(r-s)>=0}function Ga(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&&Ha(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(Qa(t,e)&&Qa(e,t)&&function(t,e){var n=t,r=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==t);return r}(t,e)&&(ja(t.prev,t,e.prev)||ja(t,e.prev,e))||Va(t,e)&&ja(t.prev,t,t.next)>0&&ja(e.prev,e,e.next)>0)}function ja(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function Va(t,e){return t.x===e.x&&t.y===e.y}function Ha(t,e,n,r){var i=Wa(ja(t,e,n)),o=Wa(ja(t,e,r)),a=Wa(ja(n,r,t)),s=Wa(ja(n,r,e));return i!==o&&a!==s||!(0!==i||!Ja(t,n,e))||!(0!==o||!Ja(t,r,e))||!(0!==a||!Ja(n,t,r))||!(0!==s||!Ja(n,e,r))}function Ja(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 Wa(t){return t>0?1:t<0?-1:0}function Qa(t,e){return ja(t.prev,t,t.next)<0?ja(t,e,t.next)>=0&&ja(t,t.prev,e)>=0:ja(t,e,t.prev)<0||ja(t,t.next,e)<0}function qa(t,e){var n=new Ya(t.i,t.x,t.y),r=new Ya(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function Ka(t,e,n,r){var i=new Ya(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Xa(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 Ya(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 $a(t,e,n,r){for(var i=0,o=e,a=n-r;o<n;o+=r)i+=(t[a]-t[o])*(t[o+1]+t[a+1]),a=o;return i}function ts(t,e,n,r,i){!function t(e,n,r,i,o){for(;i>r;){if(i-r>600){var a=i-r+1,s=n-r+1,u=Math.log(a),l=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*l*(a-l)/a)*(s-a/2<0?-1:1);t(e,n,Math.max(r,Math.floor(n-s*l/a+c)),Math.min(i,Math.floor(n+(a-s)*l/a+c)),o)}var h=e[n],f=r,p=i;for(es(e,r,n),o(e[i],h)>0&&es(e,r,i);f<p;){for(es(e,f,p),f++,p--;o(e[f],h)<0;)f++;for(;o(e[p],h)>0;)p--}0===o(e[r],h)?es(e,r,p):es(e,++p,i),p<=n&&(r=p+1),n<=p&&(i=p-1)}}(t,e,n||0,r||t.length-1,i||ns)}function es(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function ns(t,e){return t<e?-1:t>e?1:0}function rs(t,e){var n=t.length;if(n<=1)return[t];for(var r,i,o=[],a=0;a<n;a++){var s=B(t[a]);0!==s&&(t[a].area=Math.abs(s),void 0===i&&(i=s<0),i===s<0?(r&&o.push(r),r=[t[a]]):r.push(t[a]))}if(r&&o.push(r),e>1)for(var u=0;u<o.length;u++)o[u].length<=e||(ts(o[u],e,1,o[u].length-1,is),o[u]=o[u].slice(0,e));return o}function is(t,e){return e.area-t.area}function os(t,e,n){for(var r=n.patternDependencies,i=!1,o=0,a=e;o<a.length;o+=1){var s=a[o].paint.get(t+"-pattern");s.isConstant()||(i=!0);var u=s.constantOr(null);u&&(i=!0,r[u.to]=!0,r[u.from]=!0)}return i}function as(t,e,n,r,i){for(var o=i.patternDependencies,a=0,s=e;a<s.length;a+=1){var u=s[a],l=u.paint.get(t+"-pattern").value;if("constant"!==l.kind){var c=l.evaluate({zoom:r-1},n,{},i.availableImages),h=l.evaluate({zoom:r},n,{},i.availableImages),f=l.evaluate({zoom:r+1},n,{},i.availableImages);h=h&&h.name?h.name:h,f=f&&f.name?f.name:f,o[c=c&&c.name?c.name:c]=!0,o[h]=!0,o[f]=!0,n.patterns[u.id]={min:c,mid:h,max:f}}}return n}Sa.deviation=function(t,e,n,r){var i=e&&e.length,o=Math.abs($a(t,0,i?e[0]*n:t.length,n));if(i)for(var a=0,s=e.length;a<s;a++)o-=Math.abs($a(t,e[a]*n,a<s-1?e[a+1]*n:t.length,n));var u=0;for(a=0;a<r.length;a+=3){var l=r[a]*n,c=r[a+1]*n,h=r[a+2]*n;u+=Math.abs((t[l]-t[h])*(t[c+1]-t[l+1])-(t[l]-t[c])*(t[h+1]-t[l+1]))}return 0===o&&0===u?0:Math.abs((u-o)/o)},Sa.flatten=function(t){for(var e=t[0][0].length,n={vertices:[],holes:[],dimensions:e},r=0,i=0;i<t.length;i++){for(var o=0;o<t[i].length;o++)for(var a=0;a<e;a++)n.vertices.push(t[i][o][a]);i>0&&n.holes.push(r+=t[i-1].length)}return n},ka.default=Ea;var ss=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 Si,this.indexArray=new Ni,this.indexArray2=new Wi,this.programConfigurations=new Lo(t.layers,t.zoom),this.segments=new so,this.segments2=new so,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};ss.prototype.populate=function(t,e,n){this.hasPattern=os("fill",this.layers,e);for(var r=this.layers[0].layout.get("fill-sort-key"),i=[],o=0,a=t;o<a.length;o+=1){var s=a[o],u=s.feature,l=s.id,c=s.index,h=s.sourceLayerIndex,f=this.layers[0]._featureFilter.needGeometry,p=No(u,f);if(this.layers[0]._featureFilter.filter(new si(this.zoom),p,n)){var d=r?r.evaluate(p,{},n,e.availableImages):void 0,A={id:l,properties:u.properties,type:u.type,sourceLayerIndex:h,index:c,geometry:f?p.geometry:Uo(u),patterns:{},sortKey:d};i.push(A)}}r&&i.sort((function(t,e){return t.sortKey-e.sortKey}));for(var v=0,g=i;v<g.length;v+=1){var m=g[v],y=m.geometry,_=m.index,b=m.sourceLayerIndex;if(this.hasPattern){var x=as("fill",this.layers,m,this.zoom,e);this.patternFeatures.push(x)}else this.addFeature(m,y,_,n,{});e.featureIndex.insert(t[_].feature,y,_,b,this.index)}},ss.prototype.update=function(t,e,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,n)},ss.prototype.addFeatures=function(t,e,n){for(var r=0,i=this.patternFeatures;r<i.length;r+=1){var o=i[r];this.addFeature(o,o.geometry,o.index,e,n)}},ss.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},ss.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},ss.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Ba),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0},ss.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},ss.prototype.addFeature=function(t,e,n,r,i){for(var o=0,a=rs(e,500);o<a.length;o+=1){for(var s=a[o],u=0,l=0,c=s;l<c.length;l+=1)u+=c[l].length;for(var h=this.segments.prepareSegment(u,this.layoutVertexArray,this.indexArray),f=h.vertexLength,p=[],d=[],A=0,v=s;A<v.length;A+=1){var g=v[A];if(0!==g.length){g!==s[0]&&d.push(p.length/2);var m=this.segments2.prepareSegment(g.length,this.layoutVertexArray,this.indexArray2),y=m.vertexLength;this.layoutVertexArray.emplaceBack(g[0].x,g[0].y),this.indexArray2.emplaceBack(y+g.length-1,y),p.push(g[0].x),p.push(g[0].y);for(var _=1;_<g.length;_++)this.layoutVertexArray.emplaceBack(g[_].x,g[_].y),this.indexArray2.emplaceBack(y+_-1,y+_),p.push(g[_].x),p.push(g[_].y);m.vertexLength+=g.length,m.primitiveLength+=g.length}}for(var b=ka(p,d),x=0;x<b.length;x+=3)this.indexArray.emplaceBack(f+b[x],f+b[x+1],f+b[x+2]);h.vertexLength+=u,h.primitiveLength+=b.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,n,i,r)},Rr("FillBucket",ss,{omit:["layers","patternFeatures"]});var us=new bi({"fill-sort-key":new gi(Tt.layout_fill["fill-sort-key"])}),ls={paint:new bi({"fill-antialias":new vi(Tt.paint_fill["fill-antialias"]),"fill-opacity":new gi(Tt.paint_fill["fill-opacity"]),"fill-color":new gi(Tt.paint_fill["fill-color"]),"fill-outline-color":new gi(Tt.paint_fill["fill-outline-color"]),"fill-translate":new vi(Tt.paint_fill["fill-translate"]),"fill-translate-anchor":new vi(Tt.paint_fill["fill-translate-anchor"]),"fill-pattern":new mi(Tt.paint_fill["fill-pattern"])}),layout:us},cs=function(t){function e(e){t.call(this,e,ls)}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 r=this.paint._values["fill-outline-color"];"constant"===r.value.kind&&void 0===r.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])},e.prototype.createBucket=function(t){return new ss(t)},e.prototype.queryRadius=function(){return na(this.paint.get("fill-translate"))},e.prototype.queryIntersectsFeature=function(t,e,n,r,i,o,a){return Jo(ra(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),o.angle,a),r)},e.prototype.isTileClipped=function(){return!0},e}(xi),hs=ki([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4).members,fs=ps;function ps(t,e,n,r,i){this.properties={},this.extent=n,this.type=0,this._pbf=t,this._geometry=-1,this._keys=r,this._values=i,t.readFields(ds,this,e)}function ds(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 r=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[r]=i}}(n,e):3==t?e.type=n.readVarint():4==t&&(e._geometry=n.pos)}function As(t){for(var e,n,r=0,i=0,o=t.length,a=o-1;i<o;a=i++)r+=((n=t[a]).x-(e=t[i]).x)*(e.y+n.y);return r}ps.types=["Unknown","Point","LineString","Polygon"],ps.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,n=t.readVarint()+t.pos,r=1,o=0,a=0,s=0,u=[];t.pos<n;){if(o<=0){var l=t.readVarint();r=7&l,o=l>>3}if(o--,1===r||2===r)a+=t.readSVarint(),s+=t.readSVarint(),1===r&&(e&&u.push(e),e=[]),e.push(new i(a,s));else{if(7!==r)throw new Error("unknown command "+r);e&&e.push(e[0].clone())}}return e&&u.push(e),u},ps.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,n=1,r=0,i=0,o=0,a=1/0,s=-1/0,u=1/0,l=-1/0;t.pos<e;){if(r<=0){var c=t.readVarint();n=7&c,r=c>>3}if(r--,1===n||2===n)(i+=t.readSVarint())<a&&(a=i),i>s&&(s=i),(o+=t.readSVarint())<u&&(u=o),o>l&&(l=o);else if(7!==n)throw new Error("unknown command "+n)}return[a,u,s,l]},ps.prototype.toGeoJSON=function(t,e,n){var r,i,o=this.extent*Math.pow(2,n),a=this.extent*t,s=this.extent*e,u=this.loadGeometry(),l=ps.types[this.type];function c(t){for(var e=0;e<t.length;e++){var n=t[e];t[e]=[360*(n.x+a)/o-180,360/Math.PI*Math.atan(Math.exp((180-360*(n.y+s)/o)*Math.PI/180))-90]}}switch(this.type){case 1:var h=[];for(r=0;r<u.length;r++)h[r]=u[r][0];c(u=h);break;case 2:for(r=0;r<u.length;r++)c(u[r]);break;case 3:for(u=function(t){var e=t.length;if(e<=1)return[t];for(var n,r,i=[],o=0;o<e;o++){var a=As(t[o]);0!==a&&(void 0===r&&(r=a<0),r===a<0?(n&&i.push(n),n=[t[o]]):n.push(t[o]))}return n&&i.push(n),i}(u),r=0;r<u.length;r++)for(i=0;i<u[r].length;i++)c(u[r][i])}1===u.length?u=u[0]:l="Multi"+l;var f={type:"Feature",geometry:{type:l,coordinates:u},properties:this.properties};return"id"in this&&(f.id=this.id),f};var vs=gs;function gs(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(ms,this,e),this.length=this._features.length}function ms(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 r=t.readVarint()>>3;e=1===r?t.readString():2===r?t.readFloat():3===r?t.readDouble():4===r?t.readVarint64():5===r?t.readVarint():6===r?t.readSVarint():7===r?t.readBoolean():null}return e}(n))}function ys(t,e,n){if(3===t){var r=new vs(n,n.readVarint()+n.pos);r.length&&(e[r.name]=r)}}gs.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 fs(this._pbf,e,this.extent,this._keys,this._values)};var _s={VectorTile:function(t,e){this.layers=t.readFields(ys,{},e)},VectorTileFeature:fs,VectorTileLayer:vs},bs=_s.VectorTileFeature.types,xs=Math.pow(2,13);function ws(t,e,n,r,i,o,a,s){t.emplaceBack(e,n,2*Math.floor(r*xs)+a,i*xs*2,o*xs*2,Math.round(s))}var Cs=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 Mi,this.indexArray=new Ni,this.programConfigurations=new Lo(t.layers,t.zoom),this.segments=new so,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function Bs(t,e){return t.x===e.x&&(t.x<0||t.x>8192)||t.y===e.y&&(t.y<0||t.y>8192)}Cs.prototype.populate=function(t,e,n){this.features=[],this.hasPattern=os("fill-extrusion",this.layers,e);for(var r=0,i=t;r<i.length;r+=1){var o=i[r],a=o.feature,s=o.id,u=o.index,l=o.sourceLayerIndex,c=this.layers[0]._featureFilter.needGeometry,h=No(a,c);if(this.layers[0]._featureFilter.filter(new si(this.zoom),h,n)){var f={id:s,sourceLayerIndex:l,index:u,geometry:c?h.geometry:Uo(a),properties:a.properties,type:a.type,patterns:{}};this.hasPattern?this.features.push(as("fill-extrusion",this.layers,f,this.zoom,e)):this.addFeature(f,f.geometry,u,n,{}),e.featureIndex.insert(a,f.geometry,u,l,this.index,!0)}}},Cs.prototype.addFeatures=function(t,e,n){for(var r=0,i=this.features;r<i.length;r+=1){var o=i[r];this.addFeature(o,o.geometry,o.index,e,n)}},Cs.prototype.update=function(t,e,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,n)},Cs.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Cs.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Cs.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,hs),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},Cs.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Cs.prototype.addFeature=function(t,e,n,r,i){for(var o=0,a=rs(e,500);o<a.length;o+=1){for(var s=a[o],u=0,l=0,c=s;l<c.length;l+=1)u+=c[l].length;for(var h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),f=0,p=s;f<p.length;f+=1){var d=p[f];if(0!==d.length&&!((P=d).every((function(t){return t.x<0}))||P.every((function(t){return t.x>8192}))||P.every((function(t){return t.y<0}))||P.every((function(t){return t.y>8192}))))for(var A=0,v=0;v<d.length;v++){var g=d[v];if(v>=1){var m=d[v-1];if(!Bs(g,m)){h.vertexLength+4>so.MAX_VERTEX_ARRAY_LENGTH&&(h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var y=g.sub(m)._perp()._unit(),_=m.dist(g);A+_>32768&&(A=0),ws(this.layoutVertexArray,g.x,g.y,y.x,y.y,0,0,A),ws(this.layoutVertexArray,g.x,g.y,y.x,y.y,0,1,A),ws(this.layoutVertexArray,m.x,m.y,y.x,y.y,0,0,A+=_),ws(this.layoutVertexArray,m.x,m.y,y.x,y.y,0,1,A);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+u>so.MAX_VERTEX_ARRAY_LENGTH&&(h=this.segments.prepareSegment(u,this.layoutVertexArray,this.indexArray)),"Polygon"===bs[t.type]){for(var x=[],w=[],C=h.vertexLength,B=0,k=s;B<k.length;B+=1){var E=k[B];if(0!==E.length){E!==s[0]&&w.push(x.length/2);for(var S=0;S<E.length;S++){var T=E[S];ws(this.layoutVertexArray,T.x,T.y,0,0,1,1,0),x.push(T.x),x.push(T.y)}}}for(var M=ka(x,w),I=0;I<M.length;I+=3)this.indexArray.emplaceBack(C+M[I],C+M[I+2],C+M[I+1]);h.primitiveLength+=M.length/3,h.vertexLength+=u}}var P;this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,n,i,r)},Rr("FillExtrusionBucket",Cs,{omit:["layers","features"]});var ks={paint:new bi({"fill-extrusion-opacity":new vi(Tt["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new gi(Tt["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new vi(Tt["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new vi(Tt["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new mi(Tt["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new gi(Tt["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new gi(Tt["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new vi(Tt["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})},Es=function(t){function e(e){t.call(this,e,ks)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new Cs(t)},e.prototype.queryRadius=function(){return na(this.paint.get("fill-extrusion-translate"))},e.prototype.is3D=function(){return!0},e.prototype.queryIntersectsFeature=function(t,e,n,r,o,a,s,u){var l=ra(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),a.angle,s),c=this.paint.get("fill-extrusion-height").evaluate(e,n),h=this.paint.get("fill-extrusion-base").evaluate(e,n),f=function(t,e,n,r){for(var o=[],a=0,s=t;a<s.length;a+=1){var u=s[a],l=[u.x,u.y,0,1];ha(l,l,e),o.push(new i(l[0]/l[3],l[1]/l[3]))}return o}(l,u),p=function(t,e,n,r){for(var o=[],a=[],s=r[8]*e,u=r[9]*e,l=r[10]*e,c=r[11]*e,h=r[8]*n,f=r[9]*n,p=r[10]*n,d=r[11]*n,A=0,v=t;A<v.length;A+=1){for(var g=[],m=[],y=0,_=v[A];y<_.length;y+=1){var b=_[y],x=b.x,w=b.y,C=r[0]*x+r[4]*w+r[12],B=r[1]*x+r[5]*w+r[13],k=r[2]*x+r[6]*w+r[14],E=r[3]*x+r[7]*w+r[15],S=k+l,T=E+c,M=C+h,I=B+f,P=k+p,Z=E+d,D=new i((C+s)/T,(B+u)/T);D.z=S/T,g.push(D);var L=new i(M/Z,I/Z);L.z=P/Z,m.push(L)}o.push(g),a.push(m)}return[o,a]}(r,h,c,u);return function(t,e,n){var r=1/0;Jo(n,e)&&(r=Ts(n,e[0]));for(var i=0;i<e.length;i++)for(var o=e[i],a=t[i],s=0;s<o.length-1;s++){var u=o[s],l=[u,o[s+1],a[s+1],a[s],u];Vo(n,l)&&(r=Math.min(r,Ts(n,l)))}return r!==1/0&&r}(p[0],p[1],f)},e}(xi);function Ss(t,e){return t.x*e.x+t.y*e.y}function Ts(t,e){if(1===t.length){for(var n,r=0,i=e[r++];!n||i.equals(n);)if(!(n=e[r++]))return 1/0;for(;r<e.length;r++){var o=e[r],a=t[0],s=n.sub(i),u=o.sub(i),l=a.sub(i),c=Ss(s,s),h=Ss(s,u),f=Ss(u,u),p=Ss(l,s),d=Ss(l,u),A=c*f-h*h,v=(f*p-h*d)/A,g=(c*d-h*p)/A,m=i.z*(1-v-g)+n.z*v+o.z*g;if(isFinite(m))return m}return 1/0}for(var y=1/0,_=0,b=e;_<b.length;_+=1)y=Math.min(y,b[_].z);return y}var Ms=ki([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4).members,Is=ki([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]).members,Ps=_s.VectorTileFeature.types,Zs=Math.cos(Math.PI/180*37.5),Ds=Math.pow(2,14)/.5,Ls=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 Ii,this.layoutVertexArray2=new Pi,this.indexArray=new Ni,this.programConfigurations=new Lo(t.layers,t.zoom),this.segments=new so,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};Ls.prototype.populate=function(t,e,n){this.hasPattern=os("line",this.layers,e);for(var r=this.layers[0].layout.get("line-sort-key"),i=[],o=0,a=t;o<a.length;o+=1){var s=a[o],u=s.feature,l=s.id,c=s.index,h=s.sourceLayerIndex,f=this.layers[0]._featureFilter.needGeometry,p=No(u,f);if(this.layers[0]._featureFilter.filter(new si(this.zoom),p,n)){var d=r?r.evaluate(p,{},n):void 0,A={id:l,properties:u.properties,type:u.type,sourceLayerIndex:h,index:c,geometry:f?p.geometry:Uo(u),patterns:{},sortKey:d};i.push(A)}}r&&i.sort((function(t,e){return t.sortKey-e.sortKey}));for(var v=0,g=i;v<g.length;v+=1){var m=g[v],y=m.geometry,_=m.index,b=m.sourceLayerIndex;if(this.hasPattern){var x=as("line",this.layers,m,this.zoom,e);this.patternFeatures.push(x)}else this.addFeature(m,y,_,n,{});e.featureIndex.insert(t[_].feature,y,_,b,this.index)}},Ls.prototype.update=function(t,e,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,n)},Ls.prototype.addFeatures=function(t,e,n){for(var r=0,i=this.patternFeatures;r<i.length;r+=1){var o=i[r];this.addFeature(o,o.geometry,o.index,e,n)}},Ls.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Ls.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Ls.prototype.upload=function(t){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,Is)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Ms),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},Ls.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Ls.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}},Ls.prototype.addFeature=function(t,e,n,r,i){var o=this.layers[0].layout,a=o.get("line-join").evaluate(t,{}),s=o.get("line-cap"),u=o.get("line-miter-limit"),l=o.get("line-round-limit");this.lineClips=this.lineFeatureClips(t);for(var c=0,h=e;c<h.length;c+=1)this.addLine(h[c],t,a,s,u,l);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,n,i,r)},Ls.prototype.addLine=function(t,e,n,r,i,o){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(var a=0;a<t.length-1;a++)this.totalDistance+=t[a].dist(t[a+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}for(var s="Polygon"===Ps[e.type],u=t.length;u>=2&&t[u-1].equals(t[u-2]);)u--;for(var l=0;l<u-1&&t[l].equals(t[l+1]);)l++;if(!(u<(s?3:2))){"bevel"===n&&(i=1.05);var c,h=this.overscaling<=16?122880/(512*this.overscaling):0,f=this.segments.prepareSegment(10*u,this.layoutVertexArray,this.indexArray),p=void 0,d=void 0,A=void 0,v=void 0;this.e1=this.e2=-1,s&&(v=t[l].sub(c=t[u-2])._unit()._perp());for(var g=l;g<u;g++)if(!(d=g===u-1?s?t[l+1]:void 0:t[g+1])||!t[g].equals(d)){v&&(A=v),c&&(p=c),c=t[g],v=d?d.sub(c)._unit()._perp():A;var m=(A=A||v).add(v);0===m.x&&0===m.y||m._unit();var y=A.x*v.x+A.y*v.y,_=m.x*v.x+m.y*v.y,b=0!==_?1/_:1/0,x=2*Math.sqrt(2-2*_),w=_<Zs&&p&&d,C=A.x*v.y-A.y*v.x>0;if(w&&g>l){var B=c.dist(p);if(B>2*h){var k=c.sub(c.sub(p)._mult(h/B)._round());this.updateDistance(p,k),this.addCurrentVertex(k,A,0,0,f),p=k}}var E=p&&d,S=E?n:s?"butt":r;if(E&&"round"===S&&(b<o?S="miter":b<=2&&(S="fakeround")),"miter"===S&&b>i&&(S="bevel"),"bevel"===S&&(b>2&&(S="flipbevel"),b<i&&(S="miter")),p&&this.updateDistance(p,c),"miter"===S)m._mult(b),this.addCurrentVertex(c,m,0,0,f);else if("flipbevel"===S){if(b>100)m=v.mult(-1);else{var T=b*A.add(v).mag()/A.sub(v).mag();m._perp()._mult(T*(C?-1:1))}this.addCurrentVertex(c,m,0,0,f),this.addCurrentVertex(c,m.mult(-1),0,0,f)}else if("bevel"===S||"fakeround"===S){var M=-Math.sqrt(b*b-1),I=C?M:0,P=C?0:M;if(p&&this.addCurrentVertex(c,A,I,P,f),"fakeround"===S)for(var Z=Math.round(180*x/Math.PI/20),D=1;D<Z;D++){var L=D/Z;if(.5!==L){var O=L-.5;L+=L*O*(L-1)*((1.0904+y*(y*(3.55645-1.43519*y)-3.2452))*O*O+(.848013+y*(.215638*y-1.06021)))}var F=v.sub(A)._mult(L)._add(A)._unit()._mult(C?-1:1);this.addHalfVertex(c,F.x,F.y,!1,C,0,f)}d&&this.addCurrentVertex(c,v,-I,-P,f)}else if("butt"===S)this.addCurrentVertex(c,m,0,0,f);else if("square"===S){var R=p?1:-1;this.addCurrentVertex(c,m,R,R,f)}else"round"===S&&(p&&(this.addCurrentVertex(c,A,0,0,f),this.addCurrentVertex(c,A,1,1,f,!0)),d&&(this.addCurrentVertex(c,v,-1,-1,f,!0),this.addCurrentVertex(c,v,0,0,f)));if(w&&g<u-1){var z=c.dist(d);if(z>2*h){var U=c.add(d.sub(c)._mult(h/z)._round());this.updateDistance(c,U),this.addCurrentVertex(U,v,0,0,f),c=U}}}}},Ls.prototype.addCurrentVertex=function(t,e,n,r,i,o){void 0===o&&(o=!1);var a=e.y*r-e.x,s=-e.y-e.x*r;this.addHalfVertex(t,e.x+e.y*n,e.y-e.x*n,o,!1,n,i),this.addHalfVertex(t,a,s,o,!0,-r,i),this.distance>Ds/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,n,r,i,o))},Ls.prototype.addHalfVertex=function(t,e,n,r,i,o,a){var s=.5*(this.lineClips?this.scaledDistance*(Ds-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((t.x<<1)+(r?1:0),(t.y<<1)+(i?1:0),Math.round(63*e)+128,Math.round(63*n)+128,1+(0===o?0:o<0?-1:1)|(63&s)<<2,s>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);var u=a.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,u),a.primitiveLength++),i?this.e2=u:this.e1=u},Ls.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},Ls.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.updateScaledDistance()},Rr("LineBucket",Ls,{omit:["layers","patternFeatures"]});var Os=new bi({"line-cap":new vi(Tt.layout_line["line-cap"]),"line-join":new gi(Tt.layout_line["line-join"]),"line-miter-limit":new vi(Tt.layout_line["line-miter-limit"]),"line-round-limit":new vi(Tt.layout_line["line-round-limit"]),"line-sort-key":new gi(Tt.layout_line["line-sort-key"])}),Fs={paint:new bi({"line-opacity":new gi(Tt.paint_line["line-opacity"]),"line-color":new gi(Tt.paint_line["line-color"]),"line-translate":new vi(Tt.paint_line["line-translate"]),"line-translate-anchor":new vi(Tt.paint_line["line-translate-anchor"]),"line-width":new gi(Tt.paint_line["line-width"]),"line-gap-width":new gi(Tt.paint_line["line-gap-width"]),"line-offset":new gi(Tt.paint_line["line-offset"]),"line-blur":new gi(Tt.paint_line["line-blur"]),"line-dasharray":new yi(Tt.paint_line["line-dasharray"]),"line-pattern":new mi(Tt.paint_line["line-pattern"]),"line-gradient":new _i(Tt.paint_line["line-gradient"])}),layout:Os},Rs=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 si(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,r,i){return n=f({},n,{zoom:Math.floor(n.zoom)}),t.prototype.evaluate.call(this,e,n,r,i)},e}(gi))(Fs.paint.properties["line-width"].specification);Rs.useIntegerZoom=!0;var zs=function(t){function e(e){t.call(this,e,Fs),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)%s)},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"]=Rs.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)},e.prototype.createBucket=function(t){return new Ls(t)},e.prototype.queryRadius=function(t){var e=t,n=Us(ea("line-width",this,e),ea("line-gap-width",this,e)),r=ea("line-offset",this,e);return n/2+Math.abs(r)+na(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,n,r,o,a,s){var u=ra(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),a.angle,s),l=s/2*Us(this.paint.get("line-width").evaluate(e,n),this.paint.get("line-gap-width").evaluate(e,n)),c=this.paint.get("line-offset").evaluate(e,n);return c&&(r=function(t,e){for(var n=[],r=new i(0,0),o=0;o<t.length;o++){for(var a=t[o],s=[],u=0;u<a.length;u++){var l=a[u],c=a[u+1],h=0===u?r:l.sub(a[u-1])._unit()._perp(),f=u===a.length-1?r:c.sub(l)._unit()._perp(),p=h._add(f)._unit();p._mult(1/(p.x*f.x+p.y*f.y)),s.push(p._mult(e)._add(l))}n.push(s)}return n}(r,c*s)),function(t,e,n){for(var r=0;r<e.length;r++){var i=e[r];if(t.length>=3)for(var o=0;o<i.length;o++)if($o(t,i[o]))return!0;if(Wo(t,i,n))return!0}return!1}(u,r,l)},e.prototype.isTileClipped=function(){return!0},e}(xi);function Us(t,e){return e>0?e+2*t:t}var Ns=ki([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Gs=ki([{name:"a_projected_pos",components:3,type:"Float32"}],4),js=(ki([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),ki([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),Vs=(ki([{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"}]),ki([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),Hs=ki([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Js(t,e,n){return t.sections.forEach((function(t){t.text=function(t,e,n){var r=e.layout.get("text-transform").evaluate(n,{});return"uppercase"===r?t=t.toLocaleUpperCase():"lowercase"===r&&(t=t.toLocaleLowerCase()),ai.applyArabicShaping&&(t=ai.applyArabicShaping(t)),t}(t.text,e,n)})),t}ki([{name:"triangle",components:3,type:"Uint16"}]),ki([{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"}]),ki([{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"}]),ki([{type:"Float32",name:"offsetX"}]),ki([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var Ws={"!":"\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"},Qs=function(t,e,n,r,i){var o,a,s=8*i-r-1,u=(1<<s)-1,l=u>>1,c=-7,h=n?i-1:0,f=n?-1:1,p=t[e+h];for(h+=f,o=p&(1<<-c)-1,p>>=-c,c+=s;c>0;o=256*o+t[e+h],h+=f,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=r;c>0;a=256*a+t[e+h],h+=f,c-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),o-=l}return(p?-1:1)*a*Math.pow(2,o-r)},qs=function(t,e,n,r,i,o){var a,s,u,l=8*o-i-1,c=(1<<l)-1,h=c>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,d=r?1:-1,A=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+h>=1?f/u:f*Math.pow(2,1-h))*u>=2&&(a++,u/=2),a+h>=c?(s=0,a=c):a+h>=1?(s=(e*u-1)*Math.pow(2,i),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;t[n+p]=255&s,p+=d,s/=256,i-=8);for(a=a<<i|s,l+=i;l>0;t[n+p]=255&a,p+=d,a/=256,l-=8);t[n+p-d]|=128*A},Ks=Xs;function Xs(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Xs.Varint=0,Xs.Fixed64=1,Xs.Bytes=2,Xs.Fixed32=5;var Ys="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function $s(t){return t.type===Xs.Bytes?t.readVarint()+t.pos:t.pos+1}function tu(t,e,n){return n?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function eu(t,e,n){var r=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));n.realloc(r);for(var i=n.pos-1;i>=t;i--)n.buf[i+r]=n.buf[i]}function nu(t,e){for(var n=0;n<t.length;n++)e.writeVarint(t[n])}function ru(t,e){for(var n=0;n<t.length;n++)e.writeSVarint(t[n])}function iu(t,e){for(var n=0;n<t.length;n++)e.writeFloat(t[n])}function ou(t,e){for(var n=0;n<t.length;n++)e.writeDouble(t[n])}function au(t,e){for(var n=0;n<t.length;n++)e.writeBoolean(t[n])}function su(t,e){for(var n=0;n<t.length;n++)e.writeFixed32(t[n])}function uu(t,e){for(var n=0;n<t.length;n++)e.writeSFixed32(t[n])}function lu(t,e){for(var n=0;n<t.length;n++)e.writeFixed64(t[n])}function cu(t,e){for(var n=0;n<t.length;n++)e.writeSFixed64(t[n])}function hu(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function fu(t,e,n){t[n]=e,t[n+1]=e>>>8,t[n+2]=e>>>16,t[n+3]=e>>>24}function pu(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function du(t,e,n){1===t&&n.readMessage(Au,e)}function Au(t,e,n){if(3===t){var r=n.readMessage(vu,{}),i=r.width,o=r.height,a=r.left,s=r.top,u=r.advance;e.push({id:r.id,bitmap:new ma({width:i+6,height:o+6},r.bitmap),metrics:{width:i,height:o,left:a,top:s,advance:u}})}}function vu(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 gu(t){for(var e=0,n=0,r=0,i=t;r<i.length;r+=1){var o=i[r];e+=o.w*o.h,n=Math.max(n,o.w)}t.sort((function(t,e){return e.h-t.h}));for(var a=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),n),h:1/0}],s=0,u=0,l=0,c=t;l<c.length;l+=1)for(var h=c[l],f=a.length-1;f>=0;f--){var p=a[f];if(!(h.w>p.w||h.h>p.h)){if(h.x=p.x,h.y=p.y,u=Math.max(u,h.y+h.h),s=Math.max(s,h.x+h.w),h.w===p.w&&h.h===p.h){var d=a.pop();f<a.length&&(a[f]=d)}else h.h===p.h?(p.x+=h.w,p.w-=h.w):h.w===p.w?(p.y+=h.h,p.h-=h.h):(a.push({x:p.x+h.w,y:p.y,w:p.w-h.w,h:h.h}),p.y+=h.h,p.h-=h.h);break}}return{w:s,h:u,fill:e/(s*u)||0}}Xs.prototype={destroy:function(){this.buf=null},readFields:function(t,e,n){for(n=n||this.length;this.pos<n;){var r=this.readVarint(),i=r>>3,o=this.pos;this.type=7&r,t(i,e,this),this.pos===o&&this.skip(r)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=hu(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=pu(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=hu(this.buf,this.pos)+4294967296*hu(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=hu(this.buf,this.pos)+4294967296*pu(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=Qs(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Qs(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,n,r=this.buf;return e=127&(n=r[this.pos++]),n<128?e:(e|=(127&(n=r[this.pos++]))<<7,n<128?e:(e|=(127&(n=r[this.pos++]))<<14,n<128?e:(e|=(127&(n=r[this.pos++]))<<21,n<128?e:function(t,e,n){var r,i,o=n.buf;if(r=(112&(i=o[n.pos++]))>>4,i<128)return tu(t,r,e);if(r|=(127&(i=o[n.pos++]))<<3,i<128)return tu(t,r,e);if(r|=(127&(i=o[n.pos++]))<<10,i<128)return tu(t,r,e);if(r|=(127&(i=o[n.pos++]))<<17,i<128)return tu(t,r,e);if(r|=(127&(i=o[n.pos++]))<<24,i<128)return tu(t,r,e);if(r|=(1&(i=o[n.pos++]))<<31,i<128)return tu(t,r,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(n=r[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&Ys?function(t,e,n){return Ys.decode(t.subarray(e,n))}(this.buf,e,t):function(t,e,n){for(var r="",i=e;i<n;){var o,a,s,u=t[i],l=null,c=u>239?4:u>223?3:u>191?2:1;if(i+c>n)break;1===c?u<128&&(l=u):2===c?128==(192&(o=t[i+1]))&&(l=(31&u)<<6|63&o)<=127&&(l=null):3===c?(a=t[i+2],128==(192&(o=t[i+1]))&&128==(192&a)&&((l=(15&u)<<12|(63&o)<<6|63&a)<=2047||l>=55296&&l<=57343)&&(l=null)):4===c&&(a=t[i+2],s=t[i+3],128==(192&(o=t[i+1]))&&128==(192&a)&&128==(192&s)&&((l=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||l>=1114112)&&(l=null)),null===l?(l=65533,c=1):l>65535&&(l-=65536,r+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),r+=String.fromCharCode(l),i+=c}return r}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==Xs.Bytes)return t.push(this.readVarint(e));var n=$s(this);for(t=t||[];this.pos<n;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==Xs.Bytes)return t.push(this.readSVarint());var e=$s(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==Xs.Bytes)return t.push(this.readBoolean());var e=$s(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==Xs.Bytes)return t.push(this.readFloat());var e=$s(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==Xs.Bytes)return t.push(this.readDouble());var e=$s(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==Xs.Bytes)return t.push(this.readFixed32());var e=$s(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==Xs.Bytes)return t.push(this.readSFixed32());var e=$s(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==Xs.Bytes)return t.push(this.readFixed64());var e=$s(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==Xs.Bytes)return t.push(this.readSFixed64());var e=$s(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===Xs.Varint)for(;this.buf[this.pos++]>127;);else if(e===Xs.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Xs.Fixed32)this.pos+=4;else{if(e!==Xs.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),fu(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),fu(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),fu(this.buf,-1&t,this.pos),fu(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),fu(this.buf,-1&t,this.pos),fu(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,r;if(t>=0?(n=t%4294967296|0,r=t/4294967296|0):(r=~(-t/4294967296),4294967295^(n=~(-t%4294967296))?n=n+1|0:(n=0,r=r+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,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)))))}(r,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,n){for(var r,i,o=0;o<e.length;o++){if((r=e.charCodeAt(o))>55295&&r<57344){if(!i){r>56319||o+1===e.length?(t[n++]=239,t[n++]=191,t[n++]=189):i=r;continue}if(r<56320){t[n++]=239,t[n++]=191,t[n++]=189,i=r;continue}r=i-55296<<10|r-56320|65536,i=null}else i&&(t[n++]=239,t[n++]=191,t[n++]=189,i=null);r<128?t[n++]=r:(r<2048?t[n++]=r>>6|192:(r<65536?t[n++]=r>>12|224:(t[n++]=r>>18|240,t[n++]=r>>12&63|128),t[n++]=r>>6&63|128),t[n++]=63&r|128)}return n}(this.buf,t,this.pos);var n=this.pos-e;n>=128&&eu(e,n,this),this.pos=e-1,this.writeVarint(n),this.pos+=n},writeFloat:function(t){this.realloc(4),qs(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),qs(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 r=this.pos-n;r>=128&&eu(n,r,this),this.pos=n-1,this.writeVarint(r),this.pos+=r},writeMessage:function(t,e,n){this.writeTag(t,Xs.Bytes),this.writeRawMessage(e,n)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,nu,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,ru,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,au,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,iu,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,ou,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,su,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,uu,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,lu,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,cu,e)},writeBytesField:function(t,e){this.writeTag(t,Xs.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Xs.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Xs.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Xs.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Xs.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Xs.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Xs.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Xs.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Xs.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Xs.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var mu=function(t,e){var n=e.pixelRatio,r=e.version,i=e.stretchX,o=e.stretchY,a=e.content;this.paddedRect=t,this.pixelRatio=n,this.stretchX=i,this.stretchY=o,this.content=a,this.version=r},yu={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};yu.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},yu.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},yu.tlbr.get=function(){return this.tl.concat(this.br)},yu.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(mu.prototype,yu);var _u=function(t,e){var n={},r={};this.haveRenderCallbacks=[];var i=[];this.addImages(t,n,i),this.addImages(e,r,i);var o=gu(i),a=new ya({width:o.w||1,height:o.h||1});for(var s in t){var u=t[s],l=n[s].paddedRect;ya.copy(u.data,a,{x:0,y:0},{x:l.x+1,y:l.y+1},u.data)}for(var c in e){var h=e[c],f=r[c].paddedRect,p=f.x+1,d=f.y+1,A=h.data.width,v=h.data.height;ya.copy(h.data,a,{x:0,y:0},{x:p,y:d},h.data),ya.copy(h.data,a,{x:0,y:v-1},{x:p,y:d-1},{width:A,height:1}),ya.copy(h.data,a,{x:0,y:0},{x:p,y:d+v},{width:A,height:1}),ya.copy(h.data,a,{x:A-1,y:0},{x:p-1,y:d},{width:1,height:v}),ya.copy(h.data,a,{x:0,y:0},{x:p+A,y:d},{width:1,height:v})}this.image=a,this.iconPositions=n,this.patternPositions=r};_u.prototype.addImages=function(t,e,n){for(var r in t){var i=t[r],o={x:0,y:0,w:i.data.width+2,h:i.data.height+2};n.push(o),e[r]=new mu(o,i),i.hasRenderCallback&&this.haveRenderCallbacks.push(r)}},_u.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)},_u.prototype.patchUpdatedImage=function(t,e,n){if(t&&e&&t.version!==e.version){t.version=e.version;var r=t.tl;n.update(e.data,void 0,{x:r[0],y:r[1]})}},Rr("ImagePosition",mu),Rr("ImageAtlas",_u);var bu={horizontal:1,vertical:2,horizontalOnly:3},xu=function(){this.scale=1,this.fontStack="",this.imageName=null};xu.forText=function(t,e){var n=new xu;return n.scale=t||1,n.fontStack=e,n},xu.forImage=function(t){var e=new xu;return e.imageName=t,e};var wu=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};function Cu(t,e,n,r,i,o,a,s,u,l,c,h,f,p,d,A){var v,g=wu.fromFeature(t,i);h===bu.vertical&&g.verticalizePunctuation();var m=ai.processBidirectionalText,y=ai.processStyledBidirectionalText;if(m&&1===g.sections.length){v=[];for(var _=0,b=m(g.toString(),Iu(g,l,o,e,r,p,d));_<b.length;_+=1){var x=b[_],w=new wu;w.text=x,w.sections=g.sections;for(var C=0;C<x.length;C++)w.sectionIndex.push(0);v.push(w)}}else if(y){v=[];for(var B=0,k=y(g.text,g.sectionIndex,Iu(g,l,o,e,r,p,d));B<k.length;B+=1){var E=k[B],S=new wu;S.text=E[0],S.sectionIndex=E[1],S.sections=g.sections,v.push(S)}}else v=function(t,e){for(var n=[],r=t.text,i=0,o=0,a=e;o<a.length;o+=1){var s=a[o];n.push(t.substring(i,s)),i=s}return i<r.length&&n.push(t.substring(i,r.length)),n}(g,Iu(g,l,o,e,r,p,d));var T=[],M={positionedLines:T,text:g.toString(),top:c[1],bottom:c[1],left:c[0],right:c[0],writingMode:h,iconsInText:!1,verticalizable:!1};return function(t,e,n,r,i,o,a,s,u,l,c,h){for(var f=0,p=-17,d=0,A=0,v="right"===s?1:"left"===s?0:.5,g=0,m=0,y=i;m<y.length;m+=1){var _=y[m];_.trim();var b=_.getMaxScale(),x=24*(b-1),w={positionedGlyphs:[],lineOffset:0};t.positionedLines[g]=w;var C=w.positionedGlyphs,B=0;if(_.length()){for(var k=0;k<_.length();k++){var E=_.getSection(k),S=_.getSectionIndex(k),T=_.getCharCode(k),M=0,I=null,P=null,Z=null,D=24,L=!(u===bu.horizontal||!c&&!Wr(T)||c&&(Bu[T]||(V=T,Hr.Arabic(V)||Hr["Arabic Supplement"](V)||Hr["Arabic Extended-A"](V)||Hr["Arabic Presentation Forms-A"](V)||Hr["Arabic Presentation Forms-B"](V))));if(E.imageName){var O=r[E.imageName];if(!O)continue;Z=E.imageName,t.iconsInText=t.iconsInText||!0,P=O.paddedRect;var F=O.displaySize;E.scale=24*E.scale/h,M=x+(24-F[1]*E.scale),D=(I={width:F[0],height:F[1],left:1,top:-3,advance:L?F[1]:F[0]}).advance;var R=L?F[0]*E.scale-24*b:F[1]*E.scale-24*b;R>0&&R>B&&(B=R)}else{var z=n[E.fontStack],U=z&&z[T];if(U&&U.rect)P=U.rect,I=U.metrics;else{var N=e[E.fontStack],G=N&&N[T];if(!G)continue;I=G.metrics}M=24*(b-E.scale)}L?(t.verticalizable=!0,C.push({glyph:T,imageName:Z,x:f,y:p+M,vertical:L,scale:E.scale,fontStack:E.fontStack,sectionIndex:S,metrics:I,rect:P}),f+=D*E.scale+l):(C.push({glyph:T,imageName:Z,x:f,y:p+M,vertical:L,scale:E.scale,fontStack:E.fontStack,sectionIndex:S,metrics:I,rect:P}),f+=I.advance*E.scale+l)}0!==C.length&&(d=Math.max(f-l,d),Zu(C,0,C.length-1,v,B)),f=0;var j=o*b+B;w.lineOffset=Math.max(B,x),p+=j,A=Math.max(j,A),++g}else p+=o,++g}var V,H=p- -17,J=Pu(a),W=J.horizontalAlign,Q=J.verticalAlign;(function(t,e,n,r,i,o,a,s,u){var l,c=(e-n)*i;l=o!==a?-s*r- -17:(-r*u+.5)*a;for(var h=0,f=t;h<f.length;h+=1)for(var p=0,d=f[h].positionedGlyphs;p<d.length;p+=1){var A=d[p];A.x+=c,A.y+=l}})(t.positionedLines,v,W,Q,d,A,o,H,i.length),t.top+=-Q*H,t.bottom=t.top+H,t.left+=-W*d,t.right=t.left+d}(M,e,n,r,v,a,s,u,h,l,f,A),!function(t){for(var e=0,n=t;e<n.length;e+=1)if(0!==n[e].positionedGlyphs.length)return!1;return!0}(T)&&M}wu.fromFeature=function(t,e){for(var n=new wu,r=0;r<t.sections.length;r++){var i=t.sections[r];i.image?n.addImageSection(i):n.addTextSection(i,e)}return n},wu.prototype.length=function(){return this.text.length},wu.prototype.getSection=function(t){return this.sections[this.sectionIndex[t]]},wu.prototype.getSectionIndex=function(t){return this.sectionIndex[t]},wu.prototype.getCharCode=function(t){return this.text.charCodeAt(t)},wu.prototype.verticalizePunctuation=function(){this.text=function(t){for(var e="",n=0;n<t.length;n++){var r=t.charCodeAt(n+1)||null,i=t.charCodeAt(n-1)||null;e+=r&&Qr(r)&&!Ws[t[n+1]]||i&&Qr(i)&&!Ws[t[n-1]]||!Ws[t[n]]?t[n]:Ws[t[n]]}return e}(this.text)},wu.prototype.trim=function(){for(var t=0,e=0;e<this.text.length&&Bu[this.text.charCodeAt(e)];e++)t++;for(var n=this.text.length,r=this.text.length-1;r>=0&&r>=t&&Bu[this.text.charCodeAt(r)];r--)n--;this.text=this.text.substring(t,n),this.sectionIndex=this.sectionIndex.slice(t,n)},wu.prototype.substring=function(t,e){var n=new wu;return n.text=this.text.substring(t,e),n.sectionIndex=this.sectionIndex.slice(t,e),n.sections=this.sections,n},wu.prototype.toString=function(){return this.text},wu.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce((function(e,n){return Math.max(e,t.sections[n].scale)}
vendor: 1,043 bytes, line 2
2),0)},wu.prototype.addTextSection=function(t,e){this.text+=t.text,this.sections.push(xu.forText(t.scale,t.fontStack||e));for(var n=this.sections.length-1,r=0;r<t.text.length;++r)this.sectionIndex.push(n)},wu.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(xu.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.")},wu.prototype.getNextImageSectionCharCode=function(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var Bu={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},ku={};function Eu(t,e,n,r,i,o){if(e.imageName){var a=r[e.imageName];return a?a.displaySize[0]*e.scale*24/o+i:0}var s=n[e.fontStack],u=s&&s[t];return u?u.metrics.advance*e.scale+i:0}function Su(t,e,n,r){var i=Math.pow(t-e,2);return r?t<e?i/2:2*i:i+Math.abs(n)*n}
vendor: 97,977 bytes, line 2
2function Tu(t,e,n){var r=0;return 10===t&&(r-=1e4),n&&(r+=150),40!==t&&65288!==t||(r+=50),41!==e&&65289!==e||(r+=50),r}function Mu(t,e,n,r,i,o){for(var a=null,s=Su(e,n,i,o),u=0,l=r;u<l.length;u+=1){var c=l[u],h=Su(e-c.x,n,i,o)+c.badness;h<=s&&(a=c,s=h)}return{index:t,x:e,priorBreak:a,badness:s}}function Iu(t,e,n,r,i,o,a){if("point"!==o)return[];if(!t)return[];for(var s,u=[],l=function(t,e,n,r,i,o){for(var a=0,s=0;s<t.length();s++){var u=t.getSection(s);a+=Eu(t.getCharCode(s),u,r,i,e,o)}return a/Math.max(1,Math.ceil(a/n))}(t,e,n,r,i,a),c=t.text.indexOf("\u200b")>=0,h=0,f=0;f<t.length();f++){var p=t.getSection(f),d=t.getCharCode(f);if(Bu[d]||(h+=Eu(d,p,r,i,e,a)),f<t.length()-1){var A=!((s=d)<11904||!(Hr["Bopomofo Extended"](s)||Hr.Bopomofo(s)||Hr["CJK Compatibility Forms"](s)||Hr["CJK Compatibility Ideographs"](s)||Hr["CJK Compatibility"](s)||Hr["CJK Radicals Supplement"](s)||Hr["CJK Strokes"](s)||Hr["CJK Symbols and Punctuation"](s)||Hr["CJK Unified Ideographs Extension A"](s)||Hr["CJK Unified Ideographs"](s)||Hr["Enclosed CJK Letters and Months"](s)||Hr["Halfwidth and Fullwidth Forms"](s)||Hr.Hiragana(s)||Hr["Ideographic Description Characters"](s)||Hr["Kangxi Radicals"](s)||Hr["Katakana Phonetic Extensions"](s)||Hr.Katakana(s)||Hr["Vertical Forms"](s)||Hr["Yi Radicals"](s)||Hr["Yi Syllables"](s)));(ku[d]||A||p.imageName)&&u.push(Mu(f+1,h,l,u,Tu(d,t.getCharCode(f+1),A&&c),!1))}}return function t(e){return e?t(e.priorBreak).concat(e.index):[]}(Mu(t.length(),h,l,u,0,!0))}function Pu(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 Zu(t,e,n,r,i){if(r||i)for(var o=t[n],a=(t[n].x+o.metrics.advance*o.scale)*r,s=e;s<=n;s++)t[s].x-=a,t[s].y+=i}function Du(t,e,n,r,i,o){var a,s=t.image;if(s.content){var u=s.content,l=s.pixelRatio||1;a=[u[0]/l,u[1]/l,s.displaySize[0]-u[2]/l,s.displaySize[1]-u[3]/l]}var c,h,f,p,d=e.left*o,A=e.right*o;"width"===n||"both"===n?(p=i[0]+d-r[3],h=i[0]+A+r[1]):h=(p=i[0]+(d+A-s.displaySize[0])/2)+s.displaySize[0];var v=e.top*o,g=e.bottom*o;return"height"===n||"both"===n?(c=i[1]+v-r[0],f=i[1]+g+r[2]):f=(c=i[1]+(v+g-s.displaySize[1])/2)+s.displaySize[1],{image:s,top:c,right:h,bottom:f,left:p,collisionPadding:a}}ku[10]=!0,ku[32]=!0,ku[38]=!0,ku[40]=!0,ku[41]=!0,ku[43]=!0,ku[45]=!0,ku[47]=!0,ku[173]=!0,ku[183]=!0,ku[8203]=!0,ku[8208]=!0,ku[8211]=!0,ku[8231]=!0;var Lu=function(t){function e(e,n,r,i){t.call(this,e,n),this.angle=r,void 0!==i&&(this.segment=i)}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}(i);function Ou(t,e){var n=e.expression;if("constant"===n.kind)return{kind:"constant",layoutSize:n.evaluate(new si(t+1))};if("source"===n.kind)return{kind:"source"};for(var r=n.zoomStops,i=n.interpolationType,o=0;o<r.length&&r[o]<=t;)o++;for(var a=o=Math.max(0,o-1);a<r.length&&r[a]<t+1;)a++;a=Math.min(r.length-1,a);var s=r[o],u=r[a];return"composite"===n.kind?{kind:"composite",minZoom:s,maxZoom:u,interpolationType:i}:{kind:"camera",minZoom:s,maxZoom:u,minSize:n.evaluate(new si(s)),maxSize:n.evaluate(new si(u)),interpolationType:i}}function Fu(t,e,n){var r=e.uSize,i=n.lowerSize;return"source"===t.kind?i/128:"composite"===t.kind?Ve(i/128,n.upperSize/128,e.uSizeT):r}function Ru(t,e){var n=0,r=0;if("constant"===t.kind)r=t.layoutSize;else if("source"!==t.kind){var i=t.interpolationType,o=i?c(an.interpolationFactor(i,e,t.minZoom,t.maxZoom),0,1):0;"camera"===t.kind?r=Ve(t.minSize,t.maxSize,o):n=o}return{uSizeT:n,uSize:r}}Rr("Anchor",Lu);var zu=Object.freeze({__proto__:null,getSizeData:Ou,evaluateSizeForFeature:Fu,evaluateSizeForZoom:Ru,SIZE_PACK_FACTOR:128});function Uu(t,e,n,r,i){if(void 0===e.segment)return!0;for(var o=e,a=e.segment+1,s=0;s>-n/2;){if(--a<0)return!1;s-=t[a].dist(o),o=t[a]}s+=t[a].dist(t[a+1]),a++;for(var u=[],l=0;s<n/2;){var c=t[a],h=t[a+1];if(!h)return!1;var f=t[a-1].angleTo(c)-c.angleTo(h);for(f=Math.abs((f+3*Math.PI)%(2*Math.PI)-Math.PI),u.push({distance:s,angleDelta:f}),l+=f;s-u[0].distance>r;)l-=u.shift().angleDelta;if(l>i)return!1;a++,s+=c.dist(h)}return!0}function Nu(t){for(var e=0,n=0;n<t.length-1;n++)e+=t[n].dist(t[n+1]);return e}function Gu(t,e,n){return t?.6*e*n:0}function ju(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}function Vu(t,e,n,r,i,o){for(var a=Gu(n,i,o),s=ju(n,r)*o,u=0,l=Nu(t)/2,c=0;c<t.length-1;c++){var h=t[c],f=t[c+1],p=h.dist(f);if(u+p>l){var d=(l-u)/p,A=Ve(h.x,f.x,d),v=Ve(h.y,f.y,d),g=new Lu(A,v,f.angleTo(h),c);return g._round(),!a||Uu(t,g,s,a,e)?g:void 0}u+=p}}function Hu(t,e,n,r,i,o,a,s,u){var l=Gu(r,o,a),c=ju(r,i),h=c*a,f=0===t[0].x||t[0].x===u||0===t[0].y||t[0].y===u;return e-h<e/4&&(e=h+e/4),function t(e,n,r,i,o,a,s,u,l){for(var c=a/2,h=Nu(e),f=0,p=n-r,d=[],A=0;A<e.length-1;A++){for(var v=e[A],g=e[A+1],m=v.dist(g),y=g.angleTo(v);p+r<f+m;){var _=((p+=r)-f)/m,b=Ve(v.x,g.x,_),x=Ve(v.y,g.y,_);if(b>=0&&b<l&&x>=0&&x<l&&p-c>=0&&p+c<=h){var w=new Lu(b,x,y,A);w._round(),i&&!Uu(e,w,a,i,o)||d.push(w)}}f+=m}return u||d.length||s||(d=t(e,f/2,r,i,o,a,s,!0,l)),d}(t,f?e/2*s%e:(c/2+2*o)*a*s%e,e,l,n,h,f,!1,u)}function Ju(t,e,n,r,o){for(var a=[],s=0;s<t.length;s++)for(var u=t[s],l=void 0,c=0;c<u.length-1;c++){var h=u[c],f=u[c+1];h.x<e&&f.x<e||(h.x<e?h=new i(e,h.y+(e-h.x)/(f.x-h.x)*(f.y-h.y))._round():f.x<e&&(f=new i(e,h.y+(e-h.x)/(f.x-h.x)*(f.y-h.y))._round()),h.y<n&&f.y<n||(h.y<n?h=new i(h.x+(n-h.y)/(f.y-h.y)*(f.x-h.x),n)._round():f.y<n&&(f=new i(h.x+(n-h.y)/(f.y-h.y)*(f.x-h.x),n)._round()),h.x>=r&&f.x>=r||(h.x>=r?h=new i(r,h.y+(r-h.x)/(f.x-h.x)*(f.y-h.y))._round():f.x>=r&&(f=new i(r,h.y+(r-h.x)/(f.x-h.x)*(f.y-h.y))._round()),h.y>=o&&f.y>=o||(h.y>=o?h=new i(h.x+(o-h.y)/(f.y-h.y)*(f.x-h.x),o)._round():f.y>=o&&(f=new i(h.x+(o-h.y)/(f.y-h.y)*(f.x-h.x),o)._round()),l&&h.equals(l[l.length-1])||a.push(l=[h]),l.push(f)))))}return a}function Wu(t,e,n,r){var o=[],a=t.image,s=a.pixelRatio,u=a.paddedRect.w-2,l=a.paddedRect.h-2,c=t.right-t.left,h=t.bottom-t.top,f=a.stretchX||[[0,u]],p=a.stretchY||[[0,l]],d=function(t,e){return t+e[1]-e[0]},A=f.reduce(d,0),v=p.reduce(d,0),g=u-A,m=l-v,y=0,_=A,b=0,x=v,w=0,C=g,B=0,k=m;if(a.content&&r){var E=a.content;y=Qu(f,0,E[0]),b=Qu(p,0,E[1]),_=Qu(f,E[0],E[2]),x=Qu(p,E[1],E[3]),w=E[0]-y,B=E[1]-b,C=E[2]-E[0]-_,k=E[3]-E[1]-x}var S=function(r,o,u,l){var f=Ku(r.stretch-y,_,c,t.left),p=Xu(r.fixed-w,C,r.stretch,A),d=Ku(o.stretch-b,x,h,t.top),g=Xu(o.fixed-B,k,o.stretch,v),m=Ku(u.stretch-y,_,c,t.left),E=Xu(u.fixed-w,C,u.stretch,A),S=Ku(l.stretch-b,x,h,t.top),T=Xu(l.fixed-B,k,l.stretch,v),M=new i(f,d),I=new i(m,d),P=new i(m,S),Z=new i(f,S),D=new i(p/s,g/s),L=new i(E/s,T/s),O=e*Math.PI/180;if(O){var F=Math.sin(O),R=Math.cos(O),z=[R,-F,F,R];M._matMult(z),I._matMult(z),Z._matMult(z),P._matMult(z)}var U=r.stretch+r.fixed,N=o.stretch+o.fixed;return{tl:M,tr:I,bl:Z,br:P,tex:{x:a.paddedRect.x+1+U,y:a.paddedRect.y+1+N,w:u.stretch+u.fixed-U,h:l.stretch+l.fixed-N},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:D,pixelOffsetBR:L,minFontScaleX:C/s/c,minFontScaleY:k/s/h,isSDF:n}};if(r&&(a.stretchX||a.stretchY))for(var T=qu(f,g,A),M=qu(p,m,v),I=0;I<T.length-1;I++)for(var P=T[I],Z=T[I+1],D=0;D<M.length-1;D++)o.push(S(P,M[D],Z,M[D+1]));else o.push(S({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:u+1},{fixed:0,stretch:l+1}));return o}function Qu(t,e,n){for(var r=0,i=0,o=t;i<o.length;i+=1){var a=o[i];r+=Math.max(e,Math.min(n,a[1]))-Math.max(e,Math.min(n,a[0]))}return r}function qu(t,e,n){for(var r=[{fixed:-1,stretch:0}],i=0,o=t;i<o.length;i+=1){var a=o[i],s=a[0],u=a[1],l=r[r.length-1];r.push({fixed:s-l.stretch,stretch:l.stretch}),r.push({fixed:s-l.stretch,stretch:l.stretch+(u-s)})}return r.push({fixed:e+1,stretch:n}),r}function Ku(t,e,n,r){return t/e*n+r}function Xu(t,e,n,r){return t-e*n/r}var Yu=function(t,e,n,r,o,a,s,u,l,c){if(this.boxStartIndex=t.length,l){var h=a.top,f=a.bottom,p=a.collisionPadding;p&&(h-=p[1],f+=p[3]);var d=f-h;d>0&&(d=Math.max(10,d),this.circleDiameter=d)}else{var A=a.top*s-u,v=a.bottom*s+u,g=a.left*s-u,m=a.right*s+u,y=a.collisionPadding;if(y&&(g-=y[0]*s,A-=y[1]*s,m+=y[2]*s,v+=y[3]*s),c){var _=new i(g,A),b=new i(m,A),x=new i(g,v),w=new i(m,v),C=c*Math.PI/180;_._rotate(C),b._rotate(C),x._rotate(C),w._rotate(C),g=Math.min(_.x,b.x,x.x,w.x),m=Math.max(_.x,b.x,x.x,w.x),A=Math.min(_.y,b.y,x.y,w.y),v=Math.max(_.y,b.y,x.y,w.y)}t.emplaceBack(e.x,e.y,g,A,m,v,n,r,o)}this.boxEndIndex=t.length},$u=function(t,e){if(void 0===t&&(t=[]),void 0===e&&(e=tl),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 tl(t,e){return t<e?-1:t>e?1:0}function el(t,e,n){void 0===e&&(e=1),void 0===n&&(n=!1);for(var r=1/0,o=1/0,a=-1/0,s=-1/0,u=t[0],l=0;l<u.length;l++){var c=u[l];(!l||c.x<r)&&(r=c.x),(!l||c.y<o)&&(o=c.y),(!l||c.x>a)&&(a=c.x),(!l||c.y>s)&&(s=c.y)}var h=Math.min(a-r,s-o),f=h/2,p=new $u([],nl);if(0===h)return new i(r,o);for(var d=r;d<a;d+=h)for(var A=o;A<s;A+=h)p.push(new rl(d+f,A+f,f,t));for(var v=function(t){for(var e=0,n=0,r=0,i=t[0],o=0,a=i.length,s=a-1;o<a;s=o++){var u=i[o],l=i[s],c=u.x*l.y-l.x*u.y;n+=(u.x+l.x)*c,r+=(u.y+l.y)*c,e+=3*c}return new rl(n/e,r/e,0,t)}(t),g=p.length;p.length;){var m=p.pop();(m.d>v.d||!v.d)&&(v=m,n&&console.log("found best %d after %d probes",Math.round(1e4*m.d)/1e4,g)),m.max-v.d<=e||(p.push(new rl(m.p.x-(f=m.h/2),m.p.y-f,f,t)),p.push(new rl(m.p.x+f,m.p.y-f,f,t)),p.push(new rl(m.p.x-f,m.p.y+f,f,t)),p.push(new rl(m.p.x+f,m.p.y+f,f,t)),g+=4)}return n&&(console.log("num probes: "+g),console.log("best distance: "+v.d)),v.p}function nl(t,e){return e.max-t.max}function rl(t,e,n,r){this.p=new i(t,e),this.h=n,this.d=function(t,e){for(var n=!1,r=1/0,i=0;i<e.length;i++)for(var o=e[i],a=0,s=o.length,u=s-1;a<s;u=a++){var l=o[a],c=o[u];l.y>t.y!=c.y>t.y&&t.x<(c.x-l.x)*(t.y-l.y)/(c.y-l.y)+l.x&&(n=!n),r=Math.min(r,Xo(t,l,c))}return(n?1:-1)*Math.sqrt(r)}(this.p,r),this.max=this.d+this.h*Math.SQRT2}$u.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1)},$u.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}},$u.prototype.peek=function(){return this.data[0]},$u.prototype._up=function(t){for(var e=this.data,n=this.compare,r=e[t];t>0;){var i=t-1>>1,o=e[i];if(n(r,o)>=0)break;e[t]=o,t=i}e[t]=r},$u.prototype._down=function(t){for(var e=this.data,n=this.compare,r=this.length>>1,i=e[t];t<r;){var o=1+(t<<1),a=e[o],s=o+1;if(s<this.length&&n(e[s],a)<0&&(o=s,a=e[s]),n(a,i)>=0)break;e[t]=a,t=o}e[t]=i};var il=Number.POSITIVE_INFINITY;function ol(t,e){return e[1]!==il?function(t,e,n){var r=0,i=0;switch(e=Math.abs(e),n=Math.abs(n),t){case"top-right":case"top-left":case"top":i=n-7;break;case"bottom-right":case"bottom-left":case"bottom":i=7-n}switch(t){case"top-right":case"bottom-right":case"right":r=-e;break;case"top-left":case"bottom-left":case"left":r=e}return[r,i]}(t,e[0],e[1]):function(t,e){var n=0,r=0;e<0&&(e=0);var i=e/Math.sqrt(2);switch(t){case"top-right":case"top-left":r=i-7;break;case"bottom-right":case"bottom-left":r=7-i;break;case"bottom":r=7-e;break;case"top":r=e-7}switch(t){case"top-right":case"bottom-right":n=-i;break;case"top-left":case"bottom-left":n=i;break;case"left":n=e;break;case"right":n=-e}return[n,r]}(t,e[0])}function al(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 sl(t,e,n,r,o,a,s,u,l,c,h,f,p,d,A){var v=function(t,e,n,r,o,a,s,u){for(var l=r.layout.get("text-rotate").evaluate(a,{})*Math.PI/180,c=[],h=0,f=e.positionedLines;h<f.length;h+=1)for(var p=f[h],d=0,A=p.positionedGlyphs;d<A.length;d+=1){var v=A[d];if(v.rect){var g=v.rect||{},m=4,y=!0,_=1,b=0,x=(o||u)&&v.vertical,w=v.metrics.advance*v.scale/2;if(u&&e.verticalizable&&(b=p.lineOffset/2-(v.imageName?-(24-v.metrics.width*v.scale)/2:24*(v.scale-1))),v.imageName){var C=s[v.imageName];y=C.sdf,m=1/(_=C.pixelRatio)}var B=o?[v.x+w,v.y]:[0,0],k=o?[0,0]:[v.x+w+n[0],v.y+n[1]-b],E=[0,0];x&&(E=k,k=[0,0]);var S=(v.metrics.left-m)*v.scale-w+k[0],T=(-v.metrics.top-m)*v.scale+k[1],M=S+g.w*v.scale/_,I=T+g.h*v.scale/_,P=new i(S,T),Z=new i(M,T),D=new i(S,I),L=new i(M,I);if(x){var O=new i(-w,w- -17),F=-Math.PI/2,R=12-w,z=new i(22-R,-(v.imageName?R:0)),U=new(Function.prototype.bind.apply(i,[null].concat(E)));P._rotateAround(F,O)._add(z)._add(U),Z._rotateAround(F,O)._add(z)._add(U),D._rotateAround(F,O)._add(z)._add(U),L._rotateAround(F,O)._add(z)._add(U)}if(l){var N=Math.sin(l),G=Math.cos(l),j=[G,-N,N,G];P._matMult(j),Z._matMult(j),D._matMult(j),L._matMult(j)}var V=new i(0,0),H=new i(0,0);c.push({tl:P,tr:Z,bl:D,br:L,tex:g,writingMode:e.writingMode,glyphOffset:B,sectionIndex:v.sectionIndex,isSDF:y,pixelOffsetTL:V,pixelOffsetBR:H,minFontScaleX:0,minFontScaleY:0})}}return c}(0,n,u,o,a,s,r,t.allowVerticalPlacement),g=t.textSizeData,m=null;"source"===g.kind?(m=[128*o.layout.get("text-size").evaluate(s,{})])[0]>32640&&w(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):"composite"===g.kind&&((m=[128*d.compositeTextSizes[0].evaluate(s,{},A),128*d.compositeTextSizes[1].evaluate(s,{},A)])[0]>32640||m[1]>32640)&&w(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),t.addSymbols(t.text,v,m,u,a,s,c,e,l.lineStartIndex,l.lineLength,p,A);for(var y=0,_=h;y<_.length;y+=1)f[_[y]]=t.text.placedSymbolArray.length-1;return 4*v.length}function ul(t){for(var e in t)return t[e];return null}function ll(t,e,n,r){var i=t.compareText;if(e in i){for(var o=i[e],a=o.length-1;a>=0;a--)if(r.dist(o[a])<n)return!0}else i[e]=[];return i[e].push(r),!1}var cl=_s.VectorTileFeature.types,hl=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function fl(t,e,n,r,i,o,a,s,u,l,c,h,f){var p=s?Math.min(32640,Math.round(s[0])):0,d=s?Math.min(32640,Math.round(s[1])):0;t.emplaceBack(e,n,Math.round(32*r),Math.round(32*i),o,a,(p<<1)+(u?1:0),d,16*l,16*c,256*h,256*f)}function pl(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 dl(t){for(var e=0,n=t.sections;e<n.length;e+=1)if(Xr(n[e].text))return!0;return!1}var Al=function(t){this.layoutVertexArray=new Di,this.indexArray=new Ni,this.programConfigurations=t,this.segments=new so,this.dynamicLayoutVertexArray=new Li,this.opacityVertexArray=new Oi,this.placedSymbolArray=new $i};Al.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length},Al.prototype.upload=function(t,e,n,r){this.isEmpty()||(n&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Ns.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,e),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,Gs.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,hl,!0),this.opacityVertexBuffer.itemSize=1),(n||r)&&this.programConfigurations.upload(t))},Al.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())},Rr("SymbolBuffers",Al);var vl=function(t,e,n){this.layoutVertexArray=new t,this.layoutAttributes=e,this.indexArray=new n,this.segments=new so,this.collisionVertexArray=new Ui};vl.prototype.upload=function(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,js.members,!0)},vl.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},Rr("CollisionBuffers",vl);var gl=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=sa([]),this.placementViewportMatrix=sa([]);var e=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Ou(this.zoom,e["text-size"]),this.iconSizeData=Ou(this.zoom,e["icon-size"]);var n=this.layers[0].layout,r=n.get("symbol-sort-key"),i=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"!==i&&void 0!==r.constantOr(1),this.sortFeaturesByY=("viewport-y"===i||"auto"===i&&!this.sortFeaturesByKey)&&this.canOverlap,"point"===n.get("symbol-placement")&&(this.writingModes=n.get("text-writing-mode").map((function(t){return bu[t]}))),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id})),this.sourceID=t.sourceID};gl.prototype.createArrays=function(){this.text=new Al(new Lo(this.layers,this.zoom,(function(t){return/^text/.test(t)}))),this.icon=new Al(new Lo(this.layers,this.zoom,(function(t){return/^icon/.test(t)}))),this.glyphOffsetArray=new no,this.lineVertexArray=new ro,this.symbolInstances=new eo},gl.prototype.calculateGlyphDependencies=function(t,e,n,r,i){for(var o=0;o<t.length;o++)if(e[t.charCodeAt(o)]=!0,(n||r)&&i){var a=Ws[t.charAt(o)];a&&(e[a.charCodeAt(0)]=!0)}},gl.prototype.populate=function(t,e,n){var r=this.layers[0],i=r.layout,o=i.get("text-font"),a=i.get("text-field"),s=i.get("icon-image"),u=("constant"!==a.value.kind||a.value.value instanceof re&&!a.value.value.isEmpty()||a.value.value.toString().length>0)&&("constant"!==o.value.kind||o.value.value.length>0),l="constant"!==s.value.kind||!!s.value.value||Object.keys(s.parameters).length>0,c=i.get("symbol-sort-key");if(this.features=[],u||l){for(var h=e.iconDependencies,f=e.glyphDependencies,p=e.availableImages,d=new si(this.zoom),A=0,v=t;A<v.length;A+=1){var g=v[A],m=g.feature,y=g.id,_=g.index,b=g.sourceLayerIndex,x=r._featureFilter.needGeometry,w=No(m,x);if(r._featureFilter.filter(d,w,n)){x||(w.geometry=Uo(m));var C=void 0;if(u){var B=r.getValueAndResolveTokens("text-field",w,n,p),k=re.factory(B);dl(k)&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===ii()||this.hasRTLText&&ai.isParsed())&&(C=Js(k,r,w))}var E=void 0;if(l){var S=r.getValueAndResolveTokens("icon-image",w,n,p);E=S instanceof ie?S:ie.fromString(S)}if(C||E){var T=this.sortFeaturesByKey?c.evaluate(w,{},n):void 0;if(this.features.push({id:y,text:C,icon:E,index:_,sourceLayerIndex:b,geometry:w.geometry,properties:m.properties,type:cl[m.type],sortKey:T}),E&&(h[E.name]=!0),C){var M=o.evaluate(w,{},n).join(","),I="map"===i.get("text-rotation-alignment")&&"point"!==i.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(bu.vertical)>=0;for(var P=0,Z=C.sections;P<Z.length;P+=1){var D=Z[P];if(D.image)h[D.image.name]=!0;else{var L=Jr(C.toString()),O=D.fontStack||M,F=f[O]=f[O]||{};this.calculateGlyphDependencies(D.text,F,I,this.allowVerticalPlacement,L)}}}}}}"line"===i.get("symbol-placement")&&(this.features=function(t){var e={},n={},r=[],i=0;function o(e){r.push(t[e]),i++}function a(t,e,i){var o=n[t];return delete n[t],n[e]=o,r[o].geometry[0].pop(),r[o].geometry[0]=r[o].geometry[0].concat(i[0]),o}function s(t,n,i){var o=e[n];return delete e[n],e[t]=o,r[o].geometry[0].shift(),r[o].geometry[0]=i[0].concat(r[o].geometry[0]),o}function u(t,e,n){var r=n?e[0][e[0].length-1]:e[0][0];return t+":"+r.x+":"+r.y}for(var l=0;l<t.length;l++){var c=t[l],h=c.geometry,f=c.text?c.text.toString():null;if(f){var p=u(f,h),d=u(f,h,!0);if(p in n&&d in e&&n[p]!==e[d]){var A=s(p,d,h),v=a(p,d,r[A].geometry);delete e[p],delete n[d],n[u(f,r[v].geometry,!0)]=v,r[A].geometry=null}else p in n?a(p,d,h):d in e?s(p,d,h):(o(l),e[p]=i-1,n[d]=i-1)}else o(l)}return r.filter((function(t){return t.geometry}))}(this.features)),this.sortFeaturesByKey&&this.features.sort((function(t,e){return t.sortKey-e.sortKey}))}},gl.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))},gl.prototype.isEmpty=function(){return 0===this.symbolInstances.length&&!this.hasRTLText},gl.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},gl.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},gl.prototype.destroyDebugData=function(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()},gl.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()},gl.prototype.addToLineVertexArray=function(t,e){var n=this.lineVertexArray.length;if(void 0!==t.segment){for(var r=t.dist(e[t.segment+1]),i=t.dist(e[t.segment]),o={},a=t.segment+1;a<e.length;a++)o[a]={x:e[a].x,y:e[a].y,tileUnitDistanceFromAnchor:r},a<e.length-1&&(r+=e[a+1].dist(e[a]));for(var s=t.segment||0;s>=0;s--)o[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:i},s>0&&(i+=e[s-1].dist(e[s]));for(var u=0;u<e.length;u++){var l=o[u];this.lineVertexArray.emplaceBack(l.x,l.y,l.tileUnitDistanceFromAnchor)}}return{lineStartIndex:n,lineLength:this.lineVertexArray.length-n}},gl.prototype.addSymbols=function(t,e,n,r,i,o,a,s,u,l,c,h){for(var f=t.indexArray,p=t.layoutVertexArray,d=t.segments.prepareSegment(4*e.length,p,f,this.canOverlap?o.sortKey:void 0),A=this.glyphOffsetArray.length,v=d.vertexLength,g=this.allowVerticalPlacement&&a===bu.vertical?Math.PI/2:0,m=o.text&&o.text.sections,y=0;y<e.length;y++){var _=e[y],b=_.tl,x=_.tr,w=_.bl,C=_.br,B=_.tex,k=_.pixelOffsetTL,E=_.pixelOffsetBR,S=_.minFontScaleX,T=_.minFontScaleY,M=_.glyphOffset,I=_.isSDF,P=_.sectionIndex,Z=d.vertexLength,D=M[1];fl(p,s.x,s.y,b.x,D+b.y,B.x,B.y,n,I,k.x,k.y,S,T),fl(p,s.x,s.y,x.x,D+x.y,B.x+B.w,B.y,n,I,E.x,k.y,S,T),fl(p,s.x,s.y,w.x,D+w.y,B.x,B.y+B.h,n,I,k.x,E.y,S,T),fl(p,s.x,s.y,C.x,D+C.y,B.x+B.w,B.y+B.h,n,I,E.x,E.y,S,T),pl(t.dynamicLayoutVertexArray,s,g),f.emplaceBack(Z,Z+1,Z+2),f.emplaceBack(Z+1,Z+2,Z+3),d.vertexLength+=4,d.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(M[0]),y!==e.length-1&&P===e[y+1].sectionIndex||t.programConfigurations.populatePaintArrays(p.length,o,o.index,{},h,m&&m[P])}t.placedSymbolArray.emplaceBack(s.x,s.y,A,this.glyphOffsetArray.length-A,v,u,l,s.segment,n?n[0]:0,n?n[1]:0,r[0],r[1],a,0,!1,0,c)},gl.prototype._addCollisionDebugVertex=function(t,e,n,r,i,o){return e.emplaceBack(0,0),t.emplaceBack(n.x,n.y,r,i,Math.round(o.x),Math.round(o.y))},gl.prototype.addCollisionDebugVertices=function(t,e,n,r,o,a,s){var u=o.segments.prepareSegment(4,o.layoutVertexArray,o.indexArray),l=u.vertexLength,c=o.layoutVertexArray,h=o.collisionVertexArray,f=s.anchorX,p=s.anchorY;this._addCollisionDebugVertex(c,h,a,f,p,new i(t,e)),this._addCollisionDebugVertex(c,h,a,f,p,new i(n,e)),this._addCollisionDebugVertex(c,h,a,f,p,new i(n,r)),this._addCollisionDebugVertex(c,h,a,f,p,new i(t,r)),u.vertexLength+=4;var d=o.indexArray;d.emplaceBack(l,l+1),d.emplaceBack(l+1,l+2),d.emplaceBack(l+2,l+3),d.emplaceBack(l+3,l),u.primitiveLength+=4},gl.prototype.addDebugCollisionBoxes=function(t,e,n,r){for(var i=t;i<e;i++){var o=this.collisionBoxArray.get(i);this.addCollisionDebugVertices(o.x1,o.y1,o.x2,o.y2,r?this.textCollisionBox:this.iconCollisionBox,o.anchorPoint,n)}},gl.prototype.generateCollisionDebugBuffers=function(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new vl(Ri,Vs.members,Wi),this.iconCollisionBox=new vl(Ri,Vs.members,Wi);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)}},gl.prototype._deserializeCollisionBoxesForSymbol=function(t,e,n,r,i,o,a,s,u){for(var l={},c=e;c<n;c++){var h=t.get(c);l.textBox={x1:h.x1,y1:h.y1,x2:h.x2,y2:h.y2,anchorPointX:h.anchorPointX,anchorPointY:h.anchorPointY},l.textFeatureIndex=h.featureIndex;break}for(var f=r;f<i;f++){var p=t.get(f);l.verticalTextBox={x1:p.x1,y1:p.y1,x2:p.x2,y2:p.y2,anchorPointX:p.anchorPointX,anchorPointY:p.anchorPointY},l.verticalTextFeatureIndex=p.featureIndex;break}for(var d=o;d<a;d++){var A=t.get(d);l.iconBox={x1:A.x1,y1:A.y1,x2:A.x2,y2:A.y2,anchorPointX:A.anchorPointX,anchorPointY:A.anchorPointY},l.iconFeatureIndex=A.featureIndex;break}for(var v=s;v<u;v++){var g=t.get(v);l.verticalIconBox={x1:g.x1,y1:g.y1,x2:g.x2,y2:g.y2,anchorPointX:g.anchorPointX,anchorPointY:g.anchorPointY},l.verticalIconFeatureIndex=g.featureIndex;break}return l},gl.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))}},gl.prototype.hasTextData=function(){return this.text.segments.get().length>0},gl.prototype.hasIconData=function(){return this.icon.segments.get().length>0},gl.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},gl.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},gl.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},gl.prototype.addIndicesForPlacedSymbol=function(t,e){for(var n=t.placedSymbolArray.get(e),r=n.vertexStartIndex+4*n.numGlyphs,i=n.vertexStartIndex;i<r;i+=4)t.indexArray.emplaceBack(i,i+1,i+2),t.indexArray.emplaceBack(i+1,i+2,i+3)},gl.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),r=[],i=[],o=[],a=0;a<this.symbolInstances.length;++a){o.push(a);var s=this.symbolInstances.get(a);r.push(0|Math.round(e*s.anchorX+n*s.anchorY)),i.push(s.featureIndex)}return o.sort((function(t,e){return r[t]-r[e]||i[e]-i[t]})),o},gl.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})},gl.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,r=this.symbolInstanceIndexes;n<r.length;n+=1){var i=this.symbolInstances.get(r[n]);this.featureSortOrder.push(i.featureIndex),[i.rightJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.leftJustifiedTextSymbolIndex].forEach((function(t,n,r){t>=0&&r.indexOf(t)===n&&e.addIndicesForPlacedSymbol(e.text,t)})),i.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,i.verticalPlacedTextSymbolIndex),i.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,i.placedIconSymbolIndex),i.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,i.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},Rr("SymbolBucket",gl,{omit:["layers","collisionBoxArray","features","compareText"]}),gl.MAX_GLYPHS=65535,gl.addDynamicAttributes=pl;var ml=new bi({"symbol-placement":new vi(Tt.layout_symbol["symbol-placement"]),"symbol-spacing":new vi(Tt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new vi(Tt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new gi(Tt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new vi(Tt.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new vi(Tt.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new vi(Tt.layout_symbol["icon-ignore-placement"]),"icon-optional":new vi(Tt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new vi(Tt.layout_symbol["icon-rotation-alignment"]),"icon-size":new gi(Tt.layout_symbol["icon-size"]),"icon-text-fit":new vi(Tt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new vi(Tt.layout_symbol["icon-text-fit-padding"]),"icon-image":new gi(Tt.layout_symbol["icon-image"]),"icon-rotate":new gi(Tt.layout_symbol["icon-rotate"]),"icon-padding":new vi(Tt.layout_symbol["icon-padding"]),"icon-keep-upright":new vi(Tt.layout_symbol["icon-keep-upright"]),"icon-offset":new gi(Tt.layout_symbol["icon-offset"]),"icon-anchor":new gi(Tt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new vi(Tt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new vi(Tt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new vi(Tt.layout_symbol["text-rotation-alignment"]),"text-field":new gi(Tt.layout_symbol["text-field"]),"text-font":new gi(Tt.layout_symbol["text-font"]),"text-size":new gi(Tt.layout_symbol["text-size"]),"text-max-width":new gi(Tt.layout_symbol["text-max-width"]),"text-line-height":new vi(Tt.layout_symbol["text-line-height"]),"text-letter-spacing":new gi(Tt.layout_symbol["text-letter-spacing"]),"text-justify":new gi(Tt.layout_symbol["text-justify"]),"text-radial-offset":new gi(Tt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new vi(Tt.layout_symbol["text-variable-anchor"]),"text-anchor":new gi(Tt.layout_symbol["text-anchor"]),"text-max-angle":new vi(Tt.layout_symbol["text-max-angle"]),"text-writing-mode":new vi(Tt.layout_symbol["text-writing-mode"]),"text-rotate":new gi(Tt.layout_symbol["text-rotate"]),"text-padding":new vi(Tt.layout_symbol["text-padding"]),"text-keep-upright":new vi(Tt.layout_symbol["text-keep-upright"]),"text-transform":new gi(Tt.layout_symbol["text-transform"]),"text-offset":new gi(Tt.layout_symbol["text-offset"]),"text-allow-overlap":new vi(Tt.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new vi(Tt.layout_symbol["text-ignore-placement"]),"text-optional":new vi(Tt.layout_symbol["text-optional"])}),yl={paint:new bi({"icon-opacity":new gi(Tt.paint_symbol["icon-opacity"]),"icon-color":new gi(Tt.paint_symbol["icon-color"]),"icon-halo-color":new gi(Tt.paint_symbol["icon-halo-color"]),"icon-halo-width":new gi(Tt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new gi(Tt.paint_symbol["icon-halo-blur"]),"icon-translate":new vi(Tt.paint_symbol["icon-translate"]),"icon-translate-anchor":new vi(Tt.paint_symbol["icon-translate-anchor"]),"text-opacity":new gi(Tt.paint_symbol["text-opacity"]),"text-color":new gi(Tt.paint_symbol["text-color"],{runtimeType:Nt,getOverride:function(t){return t.textColor},hasOverride:function(t){return!!t.textColor}}),"text-halo-color":new gi(Tt.paint_symbol["text-halo-color"]),"text-halo-width":new gi(Tt.paint_symbol["text-halo-width"]),"text-halo-blur":new gi(Tt.paint_symbol["text-halo-blur"]),"text-translate":new vi(Tt.paint_symbol["text-translate"]),"text-translate-anchor":new vi(Tt.paint_symbol["text-translate-anchor"])}),layout:ml},_l=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:Ft,this.defaultValue=t};_l.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},_l.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)},_l.prototype.outputDefined=function(){return!1},_l.prototype.serialize=function(){return null},Rr("FormatSectionOverride",_l,{omit:["defaultValue"]});var bl=function(t){function e(e){t.call(this,e,yl)}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 r=this.layout.get("text-writing-mode");if(r){for(var i=[],o=0,a=r;o<a.length;o+=1){var s=a[o];i.indexOf(s)<0&&i.push(s)}this.layout._values["text-writing-mode"]=i}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()},e.prototype.getValueAndResolveTokens=function(t,e,n,r){var i=this.layout.get(t).evaluate(e,{},n,r),o=this._unevaluatedLayout._values[t];return o.isDataDriven()||Jn(o.value)||!i?i:function(t,e){return e.replace(/{([^{}]+)}/g,(function(e,n){return n in t?String(t[n]):""}))}(e.properties,i)},e.prototype.createBucket=function(t){return new gl(t)},e.prototype.queryRadius=function(){return 0},e.prototype.queryIntersectsFeature=function(){return!1},e.prototype._setPaintOverrides=function(){for(var t=0,n=yl.paint.overridableProperties;t<n.length;t+=1){var r=n[t];if(e.hasPaintOverride(this.layout,r)){var i,o=this.paint.get(r),a=new _l(o),s=new Hn(a,o.property.specification);i="constant"===o.value.kind||"source"===o.value.kind?new Qn("source",s):new qn("composite",s,o.value.zoomStops,o.value._interpolationType),this.paint._values[r]=new di(o.property,i,o.parameters)}}},e.prototype._handleOverridablePaintPropertyUpdate=function(t,n,r){return!(!this.layout||n.isDataDriven()||r.isDataDriven())&&e.hasPaintOverride(this.layout,t)},e.hasPaintOverride=function(t,e){var n=t.get("text-field"),r=yl.paint.properties[e],i=!1,o=function(t){for(var e=0,n=t;e<n.length;e+=1)if(r.overrides&&r.overrides.hasOverride(n[e]))return void(i=!0)};if("constant"===n.value.kind&&n.value.value instanceof re)o(n.value.value.sections);else if("source"===n.value.kind){var a=function t(e){i||(e instanceof le&&se(e.value)===Ht?o(e.value.sections):e instanceof pe?o(e.sections):e.eachChild(t))},s=n.value;s._styleExpression&&a(s._styleExpression.expression)}return i},e}(xi),xl={paint:new bi({"background-color":new vi(Tt.paint_background["background-color"]),"background-pattern":new yi(Tt.paint_background["background-pattern"]),"background-opacity":new vi(Tt.paint_background["background-opacity"])})},wl=function(t){function e(e){t.call(this,e,xl)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(xi),Cl={paint:new bi({"raster-opacity":new vi(Tt.paint_raster["raster-opacity"]),"raster-hue-rotate":new vi(Tt.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new vi(Tt.paint_raster["raster-brightness-min"]),"raster-brightness-max":new vi(Tt.paint_raster["raster-brightness-max"]),"raster-saturation":new vi(Tt.paint_raster["raster-saturation"]),"raster-contrast":new vi(Tt.paint_raster["raster-contrast"]),"raster-resampling":new vi(Tt.paint_raster["raster-resampling"]),"raster-fade-duration":new vi(Tt.paint_raster["raster-fade-duration"])})},Bl=function(t){function e(e){t.call(this,e,Cl)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(xi),kl=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}(xi),El={circle:fa,heatmap:xa,hillshade:Ca,fill:cs,"fill-extrusion":Es,line:zs,symbol:bl,background:wl,raster:Bl},Sl=a.HTMLImageElement,Tl=a.HTMLCanvasElement,Ml=a.HTMLVideoElement,Il=a.ImageData,Pl=a.ImageBitmap,Zl=function(t,e,n,r){this.context=t,this.format=n,this.texture=t.gl.createTexture(),this.update(e,r)};Zl.prototype.update=function(t,e,n){var r=t.width,i=t.height,o=!(this.size&&this.size[0]===r&&this.size[1]===i||n),a=this.context,s=a.gl;if(this.useMipmap=Boolean(e&&e.useMipmap),s.bindTexture(s.TEXTURE_2D,this.texture),a.pixelStoreUnpackFlipY.set(!1),a.pixelStoreUnpack.set(1),a.pixelStoreUnpackPremultiplyAlpha.set(this.format===s.RGBA&&(!e||!1!==e.premultiply)),o)this.size=[r,i],t instanceof Sl||t instanceof Tl||t instanceof Ml||t instanceof Il||Pl&&t instanceof Pl?s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,s.UNSIGNED_BYTE,t):s.texImage2D(s.TEXTURE_2D,0,this.format,r,i,0,this.format,s.UNSIGNED_BYTE,t.data);else{var u=n||{x:0,y:0},l=u.x,c=u.y;t instanceof Sl||t instanceof Tl||t instanceof Ml||t instanceof Il||Pl&&t instanceof Pl?s.texSubImage2D(s.TEXTURE_2D,0,l,c,s.RGBA,s.UNSIGNED_BYTE,t):s.texSubImage2D(s.TEXTURE_2D,0,l,c,r,i,s.RGBA,s.UNSIGNED_BYTE,t.data)}this.useMipmap&&this.isSizePowerOfTwo()&&s.generateMipmap(s.TEXTURE_2D)},Zl.prototype.bind=function(t,e,n){var r=this.context.gl;r.bindTexture(r.TEXTURE_2D,this.texture),n!==r.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(n=r.LINEAR),t!==this.filter&&(r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,t),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,n||t),this.filter=t),e!==this.wrap&&(r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,e),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,e),this.wrap=e)},Zl.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0},Zl.prototype.destroy=function(){this.context.gl.deleteTexture(this.texture),this.texture=null};var Dl=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()})};Dl.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))},Dl.prototype.remove=function(){delete this._channel,this._callback=function(){}};var Ll=function(t,e,n){this.target=t,this.parent=e,this.mapId=n,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},g(["receive","process"],this),this.invoker=new Dl(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=k()?t:a};function Ol(t,e,n){var r=2*Math.PI*6378137/256/Math.pow(2,n);return[t*r-2*Math.PI*6378137/2,e*r-2*Math.PI*6378137/2]}Ll.prototype.send=function(t,e,n,r,i){var o=this;void 0===i&&(i=!1);var a=Math.round(1e18*Math.random()).toString(36).substring(0,10);n&&(this.callbacks[a]=n);var s=T(this.globalScope)?void 0:[];return this.target.postMessage({id:a,type:t,hasCallback:!!n,targetMapId:r,mustQueue:i,sourceMapId:this.mapId,data:Gr(e,s)},s),{cancel:function(){n&&delete o.callbacks[a],o.target.postMessage({id:a,type:"<cancel>",targetMapId:r,sourceMapId:o.mapId})}}},Ll.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 r=this.cancelCallbacks[n];delete this.cancelCallbacks[n],r&&r()}else k()||e.mustQueue?(this.tasks[n]=e,this.taskQueue.push(n),this.invoker.trigger()):this.processTask(n,e)},Ll.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)}},Ll.prototype.processTask=function(t,e){var n=this;if("<response>"===e.type){var r=this.callbacks[t];delete this.callbacks[t],r&&(e.error?r(jr(e.error)):r(null,jr(e.data)))}else{var i=!1,o=T(this.globalScope)?void 0:[],a=e.hasCallback?function(e,r){i=!0,delete n.cancelCallbacks[t],n.target.postMessage({id:t,type:"<response>",sourceMapId:n.mapId,error:e?Gr(e):null,data:Gr(r,o)},o)}:function(t){i=!0},s=null,u=jr(e.data);if(this.parent[e.type])s=this.parent[e.type](e.sourceMapId,u,a);else if(this.parent.getWorkerSource){var l=e.type.split(".");s=this.parent.getWorkerSource(e.sourceMapId,l[0],u.source)[l[1]](u,a)}else a(new Error("Could not find function "+e.type));!i&&s&&s.cancel&&(this.cancelCallbacks[t]=s.cancel)}},Ll.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var Fl=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]))};Fl.prototype.setNorthEast=function(t){return this._ne=t instanceof Rl?new Rl(t.lng,t.lat):Rl.convert(t),this},Fl.prototype.setSouthWest=function(t){return this._sw=t instanceof Rl?new Rl(t.lng,t.lat):Rl.convert(t),this},Fl.prototype.extend=function(t){var e,n,r=this._sw,i=this._ne;if(t instanceof Rl)e=t,n=t;else{if(!(t instanceof Fl))return Array.isArray(t)?4===t.length||t.every(Array.isArray)?this.extend(Fl.convert(t)):this.extend(Rl.convert(t)):this;if(n=t._ne,!(e=t._sw)||!n)return this}return r||i?(r.lng=Math.min(e.lng,r.lng),r.lat=Math.min(e.lat,r.lat),i.lng=Math.max(n.lng,i.lng),i.lat=Math.max(n.lat,i.lat)):(this._sw=new Rl(e.lng,e.lat),this._ne=new Rl(n.lng,n.lat)),this},Fl.prototype.getCenter=function(){return new Rl((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},Fl.prototype.getSouthWest=function(){return this._sw},Fl.prototype.getNorthEast=function(){return this._ne},Fl.prototype.getNorthWest=function(){return new Rl(this.getWest(),this.getNorth())},Fl.prototype.getSouthEast=function(){return new Rl(this.getEast(),this.getSouth())},Fl.prototype.getWest=function(){return this._sw.lng},Fl.prototype.getSouth=function(){return this._sw.lat},Fl.prototype.getEast=function(){return this._ne.lng},Fl.prototype.getNorth=function(){return this._ne.lat},Fl.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},Fl.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},Fl.prototype.isEmpty=function(){return!(this._sw&&this._ne)},Fl.prototype.contains=function(t){var e=Rl.convert(t),n=e.lng,r=e.lat,i=this._sw.lng<=n&&n<=this._ne.lng;return this._sw.lng>this._ne.lng&&(i=this._sw.lng>=n&&n>=this._ne.lng),this._sw.lat<=r&&r<=this._ne.lat&&i},Fl.convert=function(t){return!t||t instanceof Fl?t:new Fl(t)};var Rl=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")};Rl.prototype.wrap=function(){return new Rl(h(this.lng,-180,180),this.lat)},Rl.prototype.toArray=function(){return[this.lng,this.lat]},Rl.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Rl.prototype.distanceTo=function(t){var e=Math.PI/180,n=this.lat*e,r=t.lat*e,i=Math.sin(n)*Math.sin(r)+Math.cos(n)*Math.cos(r)*Math.cos((t.lng-this.lng)*e);return 6371008.8*Math.acos(Math.min(i,1))},Rl.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 Fl(new Rl(this.lng-n,this.lat-e),new Rl(this.lng+n,this.lat+e))},Rl.convert=function(t){if(t instanceof Rl)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new Rl(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new Rl(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 zl=2*Math.PI*6371008.8;function Ul(t){return zl*Math.cos(t*Math.PI/180)}function Nl(t){return(180+t)/360}function Gl(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function jl(t,e){return t/Ul(e)}function Vl(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}var Hl=function(t,e,n){void 0===n&&(n=0),this.x=+t,this.y=+e,this.z=+n};Hl.fromLngLat=function(t,e){void 0===e&&(e=0);var n=Rl.convert(t);return new Hl(Nl(n.lng),Gl(n.lat),jl(e,n.lat))},Hl.prototype.toLngLat=function(){return new Rl(360*this.x-180,Vl(this.y))},Hl.prototype.toAltitude=function(){return this.z*Ul(Vl(this.y))},Hl.prototype.meterInMercatorCoordinateUnits=function(){return 1/zl*(t=Vl(this.y),1/Math.cos(t*Math.PI/180));var t};var Jl=function(t,e,n){this.z=t,this.x=e,this.y=n,this.key=ql(0,t,t,e,n)};Jl.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},Jl.prototype.url=function(t,e){var n,r,i,o,a,s=(r=this.y,i=this.z,o=Ol(256*(n=this.x),256*(r=Math.pow(2,i)-r-1),i),a=Ol(256*(n+1),256*(r+1),i),o[0]+","+o[1]+","+a[0]+","+a[1]),u=function(t,e,n){for(var r,i="",o=t;o>0;o--)i+=(e&(r=1<<o-1)?1:0)+(n&r?2:0);return i}(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}",u).replace("{bbox-epsg-3857}",s)},Jl.prototype.getTilePoint=function(t){var e=Math.pow(2,this.z);return new i(8192*(t.x*e-this.x),8192*(t.y*e-this.y))},Jl.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var Wl=function(t,e){this.wrap=t,this.canonical=e,this.key=ql(t,e.z,e.z,e.x,e.y)},Ql=function(t,e,n,r,i){this.overscaledZ=t,this.wrap=e,this.canonical=new Jl(n,+r,+i),this.key=ql(e,t,n,r,i)};function ql(t,e,n,r,i){(t*=2)<0&&(t=-1*t-1);var o=1<<n;return(o*o*t+o*i+r).toString(36)+n.toString(36)+e.toString(36)}Ql.prototype.equals=function(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)},Ql.prototype.scaledTo=function(t){var e=this.canonical.z-t;return t>this.canonical.z?new Ql(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Ql(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},Ql.prototype.calculateScaledKey=function(t,e){var n=this.canonical.z-t;return t>this.canonical.z?ql(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):ql(this.wrap*+e,t,t,this.canonical.x>>n,this.canonical.y>>n)},Ql.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},Ql.prototype.children=function(t){if(this.overscaledZ>=t)return[new Ql(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,r=2*this.canonical.y;return[new Ql(e,this.wrap,e,n,r),new Ql(e,this.wrap,e,n+1,r),new Ql(e,this.wrap,e,n,r+1),new Ql(e,this.wrap,e,n+1,r+1)]},Ql.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))},Ql.prototype.wrapped=function(){return new Ql(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},Ql.prototype.unwrapTo=function(t){return new Ql(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)},Ql.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},Ql.prototype.toUnwrapped=function(){return new Wl(this.wrap,this.canonical)},Ql.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},Ql.prototype.getTilePoint=function(t){return this.canonical.getTilePoint(new Hl(t.x-this.wrap,t.y))},Rr("CanonicalTileID",Jl),Rr("OverscaledTileID",Ql,{omit:["posMatrix"]});var Kl=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 r=this.dim=e.height-2;this.data=new Uint32Array(e.data.buffer),this.encoding=n||"mapbox";for(var i=0;i<r;i++)this.data[this._idx(-1,i)]=this.data[this._idx(0,i)],this.data[this._idx(r,i)]=this.data[this._idx(r-1,i)],this.data[this._idx(i,-1)]=this.data[this._idx(i,0)],this.data[this._idx(i,r)]=this.data[this._idx(i,r-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(r,-1)]=this.data[this._idx(r-1,0)],this.data[this._idx(-1,r)]=this.data[this._idx(0,r-1)],this.data[this._idx(r,r)]=this.data[this._idx(r-1,r-1)]};Kl.prototype.get=function(t,e){var n=new Uint8Array(this.data.buffer),r=4*this._idx(t,e);return("terrarium"===this.encoding?this._unpackTerrarium:this._unpackMapbox)(n[r],n[r+1],n[r+2])},Kl.prototype.getUnpackVector=function(){return"terrarium"===this.encoding?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]},Kl.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)},Kl.prototype._unpackMapbox=function(t,e,n){return(256*t*256+256*e+n)/10-1e4},Kl.prototype._unpackTerrarium=function(t,e,n){return 256*t+e+n/256-32768},Kl.prototype.getPixels=function(){return new ya({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Kl.prototype.backfillBorder=function(t,e,n){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");var r=e*this.dim,i=e*this.dim+this.dim,o=n*this.dim,a=n*this.dim+this.dim;switch(e){case-1:r=i-1;break;case 1:i=r+1}switch(n){case-1:o=a-1;break;case 1:a=o+1}for(var s=-e*this.dim,u=-n*this.dim,l=o;l<a;l++)for(var c=r;c<i;c++)this.data[this._idx(c,l)]=t.data[this._idx(c+s,l+u)]},Rr("DEMData",Kl);var Xl=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}};Xl.prototype.encode=function(t){return this._stringToNumber[t]},Xl.prototype.decode=function(t){return this._numberToString[t]};var Yl=function(t,e,n,r,i){this.type="Feature",this._vectorTileFeature=t,t._z=e,t._x=n,t._y=r,this.properties=t.properties,this.id=i},$l={geometry:{configurable:!0}};$l.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},$l.geometry.set=function(t){this._geometry=t},Yl.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(Yl.prototype,$l);var tc=function(){this.state={},this.stateChanges={},this.deletedStates={}};tc.prototype.updateState=function(t,e,n){var r=String(e);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][r]=this.stateChanges[t][r]||{},f(this.stateChanges[t][r],n),null===this.deletedStates[t])for(var i in this.deletedStates[t]={},this.state[t])i!==r&&(this.deletedStates[t][i]=null);else if(this.deletedStates[t]&&null===this.deletedStates[t][r])for(var o in this.deletedStates[t][r]={},this.state[t][r])n[o]||(this.deletedStates[t][r][o]=null);else for(var a in n)this.deletedStates[t]&&this.deletedStates[t][r]&&null===this.deletedStates[t][r][a]&&delete this.deletedStates[t][r][a]},tc.prototype.removeFeatureState=function(t,e,n){if(null!==this.deletedStates[t]){var r=String(e);if(this.deletedStates[t]=this.deletedStates[t]||{},n&&void 0!==e)null!==this.deletedStates[t][r]&&(this.deletedStates[t][r]=this.deletedStates[t][r]||{},this.deletedStates[t][r][n]=null);else if(void 0!==e)if(this.stateChanges[t]&&this.stateChanges[t][r])for(n in this.deletedStates[t][r]={},this.stateChanges[t][r])this.deletedStates[t][r][n]=null;else this.deletedStates[t][r]=null;else this.deletedStates[t]=null}},tc.prototype.getState=function(t,e){var n=String(e),r=f({},(this.state[t]||{})[n],(this.stateChanges[t]||{})[n]);if(null===this.deletedStates[t])return{};if(this.deletedStates[t]){var i=this.deletedStates[t][e];if(null===i)return{};for(var o in i)delete r[o]}return r},tc.prototype.initializeTileState=function(t,e){t.setFeatureState(this.state,e)},tc.prototype.coalesceChanges=function(t,e){var n={};for(var r in this.stateChanges){this.state[r]=this.state[r]||{};var i={};for(var o in this.stateChanges[r])this.state[r][o]||(this.state[r][o]={}),f(this.state[r][o],this.stateChanges[r][o]),i[o]=this.state[r][o];n[r]=i}for(var a in this.deletedStates){this.state[a]=this.state[a]||{};var s={};if(null===this.deletedStates[a])for(var u in this.state[a])s[u]={},this.state[a][u]={};else for(var l in this.deletedStates[a]){if(null===this.deletedStates[a][l])this.state[a][l]={};else for(var c=0,h=Object.keys(this.deletedStates[a][l]);c<h.length;c+=1)delete this.state[a][l][h[c]];s[l]=this.state[a][l]}n[a]=n[a]||{},f(n[a],s)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(n).length)for(var p in t)t[p].setFeatureState(n,e)};var ec=function(t,e){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new Zr(8192,16,0),this.grid3D=new Zr(8192,16,0),this.featureIndexArray=new oo,this.promoteId=e};function nc(t,e,n,r,i){return y(t,(function(t,o){var a=e instanceof Ai?e.get(o):null;return a&&a.evaluate?a.evaluate(n,r,i):a}))}function rc(t){for(var e=1/0,n=1/0,r=-1/0,i=-1/0,o=0,a=t;o<a.length;o+=1){var s=a[o];e=Math.min(e,s.x),n=Math.min(n,s.y),r=Math.max(r,s.x),i=Math.max(i,s.y)}return{minX:e,minY:n,maxX:r,maxY:i}}function ic(t,e){return e-t}ec.prototype.insert=function(t,e,n,r,i,o){var a=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(n,r,i);for(var s=o?this.grid3D:this.grid,u=0;u<e.length;u++){for(var l=e[u],c=[1/0,1/0,-1/0,-1/0],h=0;h<l.length;h++){var f=l[h];c[0]=Math.min(c[0],f.x),c[1]=Math.min(c[1],f.y),c[2]=Math.max(c[2],f.x),c[3]=Math.max(c[3],f.y)}c[0]<8192&&c[1]<8192&&c[2]>=0&&c[3]>=0&&s.insert(a,c[0],c[1],c[2],c[3])}},ec.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new _s.VectorTile(new Ks(this.rawTileData)).layers,this.sourceLayerCoder=new Xl(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},ec.prototype.query=function(t,e,n,r){var o=this;this.loadVTLayers();for(var a=t.params||{},s=8192/t.tileSize/t.scale,u=ar(a.filter),l=t.queryGeometry,c=t.queryPadding*s,h=rc(l),f=this.grid.query(h.minX-c,h.minY-c,h.maxX+c,h.maxY+c),p=rc(t.cameraQueryGeometry),d=this.grid3D.query(p.minX-c,p.minY-c,p.maxX+c,p.maxY+c,(function(e,n,r,o){return function(t,e,n,r,o){for(var a=0,s=t;a<s.length;a+=1){var u=s[a];if(e<=u.x&&n<=u.y&&r>=u.x&&o>=u.y)return!0}var l=[new i(e,n),new i(e,o),new i(r,o),new i(r,n)];if(t.length>2)for(var c=0,h=l;c<h.length;c+=1)if($o(t,h[c]))return!0;for(var f=0;f<t.length-1;f++)if(ta(t[f],t[f+1],l))return!0;return!1}(t.cameraQueryGeometry,e-c,n-c,r+c,o+c)})),A=0,v=d;A<v.length;A+=1)f.push(v[A]);f.sort(ic);for(var g,m={},y=function(i){var c=f[i];if(c!==g){g=c;var h=o.featureIndexArray.get(c),p=null;o.loadMatchingFeature(m,h.bucketIndex,h.sourceLayerIndex,h.featureIndex,u,a.layers,a.availableImages,e,n,r,(function(e,n,r){return p||(p=Uo(e)),n.queryIntersectsFeature(l,e,r,p,o.z,t.transform,s,t.pixelPosMatrix)}))}},_=0;_<f.length;_++)y(_);return m},ec.prototype.loadMatchingFeature=function(t,e,n,r,i,o,a,s,u,l,c){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 p=this.sourceLayerCoder.decode(n),d=this.vtLayers[p].feature(r);if(i.needGeometry){var A=No(d,!0);if(!i.filter(new si(this.tileID.overscaledZ),A,this.tileID.canonical))return}else if(!i.filter(new si(this.tileID.overscaledZ),d))return;for(var v=this.getId(d,p),g=0;g<h.length;g++){var m=h[g];if(!(o&&o.indexOf(m)<0)){var y=s[m];if(y){var _={};void 0!==v&&l&&(_=l.getState(y.sourceLayer||"_geojsonTileLayer",v));var b=f({},u[m]);b.paint=nc(b.paint,y.paint,d,_,a),b.layout=nc(b.layout,y.layout,d,_,a);var x=!c||c(d,y,_);if(x){var w=new Yl(d,this.z,this.x,this.y,v);w.layer=b;var C=t[m];void 0===C&&(C=t[m]=[]),C.push({featureIndex:r,feature:w,intersectionZ:x})}}}}}},ec.prototype.lookupSymbolFeatures=function(t,e,n,r,i,o,a,s){var u={};this.loadVTLayers();for(var l=ar(i),c=0,h=t;c<h.length;c+=1)this.loadMatchingFeature(u,n,r,h[c],l,o,a,s,e);return u},ec.prototype.hasLayer=function(t){for(var e=0,n=this.bucketLayerIDs;e<n.length;e+=1)for(var r=0,i=n[e];r<i.length;r+=1)if(t===i[r])return!0;return!1},ec.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},Rr("FeatureIndex",ec,{omit:["rawTileData","sourceLayerCoder"]});var oc=function(t,e){this.tileID=t,this.uid=d(),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"};oc.prototype.registerFadeDuration=function(t){var e=t+this.timeAdded;e<R.now()||this.fadeEndTime&&e<this.fadeEndTime||(this.fadeEndTime=e)},oc.prototype.wasRequested=function(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state},oc.prototype.loadVectorData=function(t,e,n){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",t){for(var r 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 r=function(){var t=o[i],r=t.layerIds.map((function(t){return e.getLayer(t)})).filter(Boolean);if(0!==r.length){t.layers=r,t.stateDependentLayerIds&&(t.stateDependentLayers=t.stateDependentLayerIds.map((function(t){return r.filter((function(e){return e.id===t}))[0]})));for(var a=0,s=r;a<s.length;a+=1)n[s[a].id]=t}},i=0,o=t;i<o.length;i+=1)r();return n}(t.buckets,e.style),this.hasSymbolBuckets=!1,this.buckets){var i=this.buckets[r];if(i instanceof gl){if(this.hasSymbolBuckets=!0,!n)break;i.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(var o in this.buckets){var a=this.buckets[o];if(a instanceof gl&&a.hasRTLText){this.hasRTLText=!0,ai.isLoading()||ai.isLoaded()||"deferred"!==ii()||oi();break}}for(var s in this.queryPadding=0,this.buckets){var u=this.buckets[s];this.queryPadding=Math.max(this.queryPadding,e.style.getLayer(s).queryRadius(u))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage)}else this.collisionBoxArray=new Xi},oc.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"},oc.prototype.getBucket=function(t){return this.buckets[t.id]},oc.prototype.upload=function(t){for(var e in this.buckets){var n=this.buckets[e];n.uploadPending()&&n.upload(t)}var r=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new Zl(t,this.imageAtlas.image,r.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new Zl(t,this.glyphAtlasImage,r.ALPHA),this.glyphAtlasImage=null)},oc.prototype.prepare=function(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)},oc.prototype.queryRenderedFeatures=function(t,e,n,r,i,o,a,s,u,l){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:r,cameraQueryGeometry:i,scale:o,tileSize:this.tileSize,pixelPosMatrix:l,transform:s,params:a,queryPadding:this.queryPadding*u},t,e,n):{}},oc.prototype.querySourceFeatures=function(t,e){var n=this.latestFeatureIndex;if(n&&n.rawTileData){var r=n.loadVTLayers(),i=e?e.sourceLayer:"",o=r._geojsonTileLayer||r[i];if(o)for(var a=ar(e&&e.filter),s=this.tileID.canonical,u=s.z,l=s.x,c=s.y,h={z:u,x:l,y:c},f=0;f<o.length;f++){var p=o.feature(f);if(a.needGeometry){var d=No(p,!0);if(!a.filter(new si(this.tileID.overscaledZ),d,this.tileID.canonical))continue}else if(!a.filter(new si(this.tileID.overscaledZ),p))continue;var A=n.getId(p,i),v=new Yl(p,u,l,c,A);v.tile=h,t.push(v)}}},oc.prototype.hasData=function(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state},oc.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},oc.prototype.setExpiryData=function(t){var e=this.expirationTime;if(t.cacheControl){var n=E(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 r=Date.now(),i=!1;if(this.expirationTime>r)i=!1;else if(e)if(this.expirationTime<e)i=!0;else{var o=this.expirationTime-e;o?this.expirationTime=r+Math.max(o,3e4):i=!0}else i=!0;i?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}},oc.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)},oc.prototype.setFeatureState=function(t,e){if(this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData&&0!==Object.keys(t).length){var n=this.latestFeatureIndex.loadVTLayers();for(var r in this.buckets)if(e.style.hasLayer(r)){var i=this.buckets[r],o=i.layers[0].sourceLayer||"_geojsonTileLayer",a=n[o],s=t[o];if(a&&s&&0!==Object.keys(s).length){i.update(s,a,this.imageAtlas&&this.imageAtlas.patternPositions||{});var u=e&&e.style&&e.style.getLayer(r);u&&(this.queryPadding=Math.max(this.queryPadding,u.queryRadius(i)))}}}},oc.prototype.holdingForFade=function(){return void 0!==this.symbolFadeHoldUntil},oc.prototype.symbolFadeFinished=function(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<R.now()},oc.prototype.clearFadeHold=function(){this.symbolFadeHoldUntil=void 0},oc.prototype.setHoldDuration=function(t){this.symbolFadeHoldUntil=R.now()+t},oc.prototype.setDependencies=function(t,e){for(var n={},r=0,i=e;r<i.length;r+=1)n[i[r]]=!0;this.dependencies[t]=n},oc.prototype.hasDependency=function(t,e){for(var n=0,r=t;n<r.length;n+=1){var i=this.dependencies[r[n]];if(i)for(var o=0,a=e;o<a.length;o+=1)if(i[a[o]])return!0}return!1};var ac=a.performance,sc=function(t){this._marks={start:[t.url,"start"].join("#"),end:[t.url,"end"].join("#"),measure:t.url.toString()},ac.mark(this._marks.start)};sc.prototype.finish=function(){ac.mark(this._marks.end);var t=ac.getEntriesByName(this._marks.measure);return 0===t.length&&(ac.measure(this._marks.measure,this._marks.start,this._marks.end),t=ac.getEntriesByName(this._marks.measure),ac.clearMarks(this._marks.start),ac.clearMarks(this._marks.end),ac.clearMeasures(this._marks.measure)),t},t.Actor=Ll,t.AlphaImage=ma,t.CanonicalTileID=Jl,t.CollisionBoxArray=Xi,t.Color=te,t.DEMData=Kl,t.DataConstantProperty=vi,t.DictionaryCoder=Xl,t.EXTENT=8192,t.ErrorEvent=Et,t.EvaluationParameters=si,t.Event=kt,t.Evented=St,t.FeatureIndex=ec,t.FillBucket=ss,t.FillExtrusionBucket=Cs,t.ImageAtlas=_u,t.ImagePosition=mu,t.LineBucket=Ls,t.LngLat=Rl,t.LngLatBounds=Fl,t.MercatorCoordinate=Hl,t.ONE_EM=24,t.OverscaledTileID=Ql,t.Point=i,t.Point$1=i,t.Properties=bi,t.Protobuf=Ks,t.RGBAImage=ya,t.RequestManager=H,t.RequestPerformance=sc,t.ResourceType=dt,t.SegmentVector=so,t.SourceFeatureState=tc,t.StructArrayLayout1ui2=Qi,t.StructArrayLayout2f1f2i16=zi,t.StructArrayLayout2i4=Si,t.StructArrayLayout3ui6=Ni,t.StructArrayLayout4i8=Ti,t.SymbolBucket=gl,t.Texture=Zl,t.Tile=oc,t.Transitionable=ci,t.Uniform1f=bo,t.Uniform1i=_o,t.Uniform2f=xo,t.Uniform3f=wo,t.Uniform4f=Co,t.UniformColor=Bo,t.UniformMatrix4f=Eo,t.UnwrappedTileID=Wl,t.ValidationError=Mt,t.WritingMode=bu,t.ZoomHistory=Vr,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=pl,t.asyncAll=function(t,e,n){if(!t.length)return n(null,[]);var r=t.length,i=new Array(t.length),o=null;t.forEach((function(t,a){e(t,(function(t,e){t&&(o=t),i[a]=e,0==--r&&n(o,i)}))}))},t.bezier=u,t.bindAll=g,t.browser=R,t.cacheEntryPossiblyAdded=function(t){++ft>ut&&(t.getActor().send("enforceCacheSizeLimit",st),ft=0)},t.clamp=c,t.clearTileCache=function(t){var e=a.caches.delete("mapbox-tiles");t&&e.catch(t).then((function(){return t()}))},t.clipLine=Ju,t.clone=function(t){var e=new aa(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 aa(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},t.collisionCircleLayout=Hs,t.config=z,t.create=function(){var t=new aa(16);return aa!=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 aa(9);return aa!=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 aa(4);return aa!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},t.createCommonjsModule=e,t.createExpression=Wn,t.createLayout=ki,t.createStyleLayer=function(t){return"custom"===t.type?new kl(t):new El[t.type](t)},t.cross=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],u=n[2];return t[0]=i*u-o*s,t[1]=o*a-r*u,t[2]=r*s-i*a,t},t.deepEqual=function t(e,n){if(Array.isArray(e)){if(!Array.isArray(n)||e.length!==n.length)return!1;for(var r=0;r<e.length;r++)if(!t(e[r],n[r]))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 i in e)if(!t(e[i],n[i]))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=l,t.emitValidationErrors=Pr,t.endsWith=m,t.enforceCacheSizeLimit=function(t){lt(),tt&&tt.then((function(e){e.keys().then((function(n){for(var r=0;r<n.length-t;r++)e.delete(n[r])}))}))},t.evaluateSizeForFeature=Fu,t.evaluateSizeForZoom=Ru,t.evaluateVariableOffset=ol,t.evented=ri,t.extend=f,t.featureFilter=ar,t.filterObject=_,t.fromRotation=function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},t.getAnchorAlignment=Pu,t.getAnchorJustification=al,t.getArrayBuffer=_t,t.getImage=wt,t.getJSON=function(t,e){return yt(f(t,{type:"json"}),e)},t.getRTLTextPluginStatus=ii,t.getReferrer=mt,t.getVideo=function(t,e){var n,r,i=a.document.createElement("video");i.muted=!0,i.onloadstart=function(){e(null,i)};for(var o=0;o<t.length;o++){var s=a.document.createElement("source");n=t[o],r=void 0,(r=a.document.createElement("a")).href=n,(r.protocol!==a.document.location.protocol||r.host!==a.document.location.host)&&(i.crossOrigin="Anonymous"),s.src=t[o],i.appendChild(s)}return{cancel:function(){}}},t.identity=sa,t.invert=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],l=e[7],c=e[8],h=e[9],f=e[10],p=e[11],d=e[12],A=e[13],v=e[14],g=e[15],m=n*s-r*a,y=n*u-i*a,_=n*l-o*a,b=r*u-i*s,x=r*l-o*s,w=i*l-o*u,C=c*A-h*d,B=c*v-f*d,k=c*g-p*d,E=h*v-f*A,S=h*g-p*A,T=f*g-p*v,M=m*T-y*S+_*E+b*k-x*B+w*C;return M?(t[0]=(s*T-u*S+l*E)*(M=1/M),t[1]=(i*S-r*T-o*E)*M,t[2]=(A*w-v*x+g*b)*M,t[3]=(f*x-h*w-p*b)*M,t[4]=(u*k-a*T-l*B)*M,t[5]=(n*T-i*k+o*B)*M,t[6]=(v*_-d*w-g*y)*M,t[7]=(c*w-f*_+p*y)*M,t[8]=(a*S-s*k+l*C)*M,t[9]=(r*k-n*S-o*C)*M,t[10]=(d*x-A*_+g*m)*M,t[11]=(h*_-c*x-p*m)*M,t[12]=(s*B-a*E-u*C)*M,t[13]=(n*E-r*B+i*C)*M,t[14]=(A*y-d*b-v*m)*M,t[15]=(c*b-h*y+f*m)*M,t):null},t.isChar=Hr,t.isMapboxURL=J,t.keysDifference=function(t,e){var n=[];for(var r in t)r in e||n.push(r);return n},t.makeRequest=yt,t.mapObject=y,t.mercatorXfromLng=Nl,t.mercatorYfromLat=Gl,t.mercatorZfromAltitude=jl,t.mul=ca,t.multiply=ua,t.mvt=_s,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],r=e[1],i=e[2],o=n*n+r*r+i*i;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=pt,t.ortho=function(t,e,n,r,i,o,a){var s=1/(e-n),u=1/(r-i),l=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*u,t[14]=(a+o)*l,t[15]=1,t},t.parseGlyphPBF=function(t){return new Ks(t).readFields(du,[])},t.pbf=Ks,t.performSymbolLayout=function(t,e,n,r,i,o,a){t.createArrays(),t.tilePixelRatio=8192/(512*t.overscaling),t.compareText={},t.iconsNeedLinear=!1;var s=t.layers[0].layout,u=t.layers[0]._unevaluatedLayout._values,l={};if("composite"===t.textSizeData.kind){var c=t.textSizeData,h=c.maxZoom;l.compositeTextSizes=[u["text-size"].possiblyEvaluate(new si(c.minZoom),a),u["text-size"].possiblyEvaluate(new si(h),a)]}if("composite"===t.iconSizeData.kind){var f=t.iconSizeData,p=f.maxZoom;l.compositeIconSizes=[u["icon-size"].possiblyEvaluate(new si(f.minZoom),a),u["icon-size"].possiblyEvaluate(new si(p),a)]}l.layoutTextSize=u["text-size"].possiblyEvaluate(new si(t.zoom+1),a),l.layoutIconSize=u["icon-size"].possiblyEvaluate(new si(t.zoom+1),a),l.textMaxSize=u["text-size"].possiblyEvaluate(new si(18));for(var d=24*s.get("text-line-height"),A="map"===s.get("text-rotation-alignment")&&"point"!==s.get("symbol-placement"),v=s.get("text-keep-upright"),g=s.get("text-size"),m=function(){var o=_[y],u=s.get("text-font").evaluate(o,{},a).join(","),c=g.evaluate(o,{},a),h=l.layoutTextSize.evaluate(o,{},a),f=l.layoutIconSize.evaluate(o,{},a),p={horizontal:{},vertical:void 0},m=o.text,b=[0,0];if(m){var x=m.toString(),C=24*s.get("text-letter-spacing").evaluate(o,{},a),B=function(t){for(var e=0,n=t;e<n.length;e+=1)if(r=n[e].charCodeAt(0),Hr.Arabic(r)||Hr["Arabic Supplement"](r)||Hr["Arabic Extended-A"](r)||Hr["Arabic Presentation Forms-A"](r)||Hr["Arabic Presentation Forms-B"](r))return!1;var r;return!0}(x)?C:0,k=s.get("text-anchor").evaluate(o,{},a),E=s.get("text-variable-anchor");if(!E){var S=s.get("text-radial-offset").evaluate(o,{},a);b=S?ol(k,[24*S,il]):s.get("text-offset").evaluate(o,{},a).map((function(t){return 24*t}))}var T=A?"center":s.get("text-justify").evaluate(o,{},a),M=s.get("symbol-placement"),I="point"===M?24*s.get("text-max-width").evaluate(o,{},a):0,P=function(){t.allowVerticalPlacement&&Jr(x)&&(p.vertical=Cu(m,e,n,i,u,I,d,k,"left",B,b,bu.vertical,!0,M,h,c))};if(!A&&E){for(var Z="auto"===T?E.map((function(t){return al(t)})):[T],D=!1,L=0;L<Z.length;L++){var O=Z[L];if(!p.horizontal[O])if(D)p.horizontal[O]=p.horizontal[0];else{var F=Cu(m,e,n,i,u,I,d,"center",O,B,b,bu.horizontal,!1,M,h,c);F&&(p.horizontal[O]=F,D=1===F.positionedLines.length)}}P()}else{"auto"===T&&(T=al(k));var R=Cu(m,e,n,i,u,I,d,k,T,B,b,bu.horizontal,!1,M,h,c);R&&(p.horizontal[T]=R),P(),Jr(x)&&A&&v&&(p.vertical=Cu(m,e,n,i,u,I,d,k,T,B,b,bu.vertical,!1,M,h,c))}}var z=void 0,U=!1;if(o.icon&&o.icon.name){var N=r[o.icon.name];N&&(z=function(t,e,n){var r=Pu(n),i=e[0]-t.displaySize[0]*r.horizontalAlign,o=e[1]-t.displaySize[1]*r.verticalAlign;return{image:t,top:o,bottom:o+t.displaySize[1],left:i,right:i+t.displaySize[0]}}(i[o.icon.name],s.get("icon-offset").evaluate(o,{},a),s.get("icon-anchor").evaluate(o,{},a)),U=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!==s.get("icon-rotate").constantOr(1))&&(t.iconsNeedLinear=!0))}var G=ul(p.horizontal)||p.vertical;t.iconsInText=!!G&&G.iconsInText,(G||z)&&function(t,e,n,r,i,o,a,s,u,l,c){var h=o.textMaxSize.evaluate(e,{});void 0===h&&(h=a);var f,p=t.layers[0].layout,d=p.get("icon-offset").evaluate(e,{},c),A=ul(n.horizontal),v=a/24,g=t.tilePixelRatio*v,m=t.tilePixelRatio*h/24,y=t.tilePixelRatio*s,_=t.tilePixelRatio*p.get("symbol-spacing"),b=p.get("text-padding")*t.tilePixelRatio,x=p.get("icon-padding")*t.tilePixelRatio,C=p.get("text-max-angle")/180*Math.PI,B="map"===p.get("text-rotation-alignment")&&"point"!==p.get("symbol-placement"),k="map"===p.get("icon-rotation-alignment")&&"point"!==p.get("symbol-placement"),E=p.get("symbol-placement"),S=_/2,T=p.get("icon-text-fit");r&&"none"!==T&&(t.allowVerticalPlacement&&n.vertical&&(f=Du(r,n.vertical,T,p.get("icon-text-fit-padding"),d,v)),A&&(r=Du(r,A,T,p.get("icon-text-fit-padding"),d,v)));var M=function(s,h){h.x<0||h.x>=8192||h.y<0||h.y>=8192||function(t,e,n,r,i,o,a,s,u,l,c,h,f,p,d,A,v,g,m,y,_,b,x,C,B){var k,E,S,T,M,I=t.addToLineVertexArray(e,n),P=0,Z=0,D=0,L=0,O=-1,F=-1,R={},z=fo(""),U=0,N=0;if(void 0===s._unevaluatedLayout.getValue("text-radial-offset")?(U=(k=s.layout.get("text-offset").evaluate(_,{},C).map((function(t){return 24*t})))[0],N=k[1]):(U=24*s.layout.get("text-radial-offset").evaluate(_,{},C),N=il),t.allowVerticalPlacement&&r.vertical){var G=s.layout.get("text-rotate").evaluate(_,{},C)+90;T=new Yu(u,e,l,c,h,r.vertical,f,p,d,G),a&&(M=new Yu(u,e,l,c,h,a,v,g,d,G))}if(i){var j=s.layout.get("icon-rotate").evaluate(_,{}),V="none"!==s.layout.get("icon-text-fit"),H=Wu(i,j,x,V),J=a?Wu(a,j,x,V):void 0;S=new Yu(u,e,l,c,h,i,v,g,!1,j),P=4*H.length;var W=t.iconSizeData,Q=null;"source"===W.kind?(Q=[128*s.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,y,m,_,!1,e,I.lineStartIndex,I.lineLength,-1,C),O=t.icon.placedSymbolArray.length-1,J&&(Z=4*J.length,t.addSymbols(t.icon,J,Q,y,m,_,bu.vertical,e,I.lineStartIndex,I.lineLength,-1,C),F=t.icon.placedSymbolArray.length-1)}for(var q in r.horizontal){var K=r.horizontal[q];if(!E){z=fo(K.text);var X=s.layout.get("text-rotate").evaluate(_,{},C);E=new Yu(u,e,l,c,h,K,f,p,d,X)}var Y=1===K.positionedLines.length;if(D+=sl(t,e,K,o,s,d,_,A,I,r.vertical?bu.horizontal:bu.horizontalOnly,Y?Object.keys(r.horizontal):[q],R,O,b,C),Y)break}r.vertical&&(L+=sl(t,e,r.vertical,o,s,d,_,A,I,bu.vertical,["vertical"],R,F,b,C));var $=E?E.boxStartIndex:t.collisionBoxArray.length,tt=E?E.boxEndIndex:t.collisionBoxArray.length,et=T?T.boxStartIndex:t.collisionBoxArray.length,nt=T?T.boxEndIndex:t.collisionBoxArray.length,rt=S?S.boxStartIndex:t.collisionBoxArray.length,it=S?S.boxEndIndex:t.collisionBoxArray.length,ot=M?M.boxStartIndex:t.collisionBoxArray.length,at=M?M.boxEndIndex:t.collisionBoxArray.length,st=-1,ut=function(t,e){return t&&t.circleDiameter?Math.max(t.circleDiameter,e):e};st=ut(E,st),st=ut(T,st),st=ut(S,st);var lt=(st=ut(M,st))>-1?1:0;lt&&(st*=B/24),t.glyphOffsetArray.length>=gl.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,R.right>=0?R.right:-1,R.center>=0?R.center:-1,R.left>=0?R.left:-1,R.vertical||-1,O,F,z,$,tt,et,nt,rt,it,ot,at,l,D,L,P,Z,lt,0,f,U,N,st)}(t,h,s,n,r,i,f,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,g,b,B,u,y,x,k,d,e,o,l,c,a)};if("line"===E)for(var I=0,P=Ju(e.geometry,0,0,8192,8192);I<P.length;I+=1)for(var Z=P[I],D=0,L=Hu(Z,_,C,n.vertical||A,r,24,m,t.overscaling,8192);D<L.length;D+=1){var O=L[D];A&&ll(t,A.text,S,O)||M(Z,O)}else if("line-center"===E)for(var F=0,R=e.geometry;F<R.length;F+=1){var z=R[F];if(z.length>1){var U=Vu(z,C,n.vertical||A,r,24,m);U&&M(z,U)}}else if("Polygon"===e.type)for(var N=0,G=rs(e.geometry,0);N<G.length;N+=1){var j=G[N],V=el(j,16);M(j[0],new Lu(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];M(W,new Lu(W[0].x,W[0].y,0))}else if("Point"===e.type)for(var Q=0,q=e.geometry;Q<q.length;Q+=1)for(var K=0,X=q[Q];K<X.length;K+=1){var Y=X[K];M([Y],new Lu(Y.x,Y.y,0))}}(t,o,p,z,r,l,h,f,b,U,a)},y=0,_=t.features;y<_.length;y+=1)m();o&&t.generateCollisionDebugBuffers()},t.perspective=function(t,e,n,r,i){var o,a=1/Math.tan(e/2);return t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(t[10]=(i+r)*(o=1/(r-i)),t[14]=2*i*r*o):(t[10]=-1,t[14]=-2*r),t},t.pick=function(t,e){for(var n={},r=0;r<e.length;r++){var i=e[r];i in t&&(n[i]=t[i])}return n},t.plugin=ai,t.polygonIntersectsPolygon=Vo,t.postMapLoadEvent=at,t.postTurnstileEvent=it,t.potpack=gu,t.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],t.register=Rr,t.registerForPluginStateChange=function(t){return t({pluginStatus:$r,pluginURL:ti}),ri.on("pluginStateChange",t),t},t.renderColorRamp=ba,t.rotate=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(n),u=Math.cos(n);return t[0]=r*u+o*s,t[1]=i*u+a*s,t[2]=r*-s+o*u,t[3]=i*-s+a*u,t},t.rotateX=function(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[4],a=e[5],s=e[6],u=e[7],l=e[8],c=e[9],h=e[10],f=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*i+l*r,t[5]=a*i+c*r,t[6]=s*i+h*r,t[7]=u*i+f*r,t[8]=l*i-o*r,t[9]=c*i-a*r,t[10]=h*i-s*r,t[11]=f*i-u*r,t},t.rotateZ=function(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],u=e[3],l=e[4],c=e[5],h=e[6],f=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*i+l*r,t[1]=a*i+c*r,t[2]=s*i+h*r,t[3]=u*i+f*r,t[4]=l*i-o*r,t[5]=c*i-a*r,t[6]=h*i-s*r,t[7]=f*i-u*r,t},t.scale=function(t,e,n){var r=n[0],i=n[1],o=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,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){st=t,ut=e},t.setRTLTextPlugin=function(t,e,n){if(void 0===n&&(n=!1),"deferred"===$r||"loading"===$r||"loaded"===$r)throw new Error("setRTLTextPlugin cannot be called multiple times.");ti=R.resolveURL(t),$r="deferred",Yr=e,ni(),n||oi()},t.sphericalToCartesian=function(t){var e=t[0],n=t[1],r=t[2];return n+=90,n*=Math.PI/180,r*=Math.PI/180,{x:e*Math.cos(n)*Math.sin(r),y:e*Math.sin(n)*Math.sin(r),z:e*Math.cos(r)}},t.sqrLen=function(t){var e=t[0],n=t[1];return e*e+n*n},t.styleSpec=Tt,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=zu,t.transformMat3=function(t,e,n){var r=e[0],i=e[1],o=e[2];return t[0]=r*n[0]+i*n[3]+o*n[6],t[1]=r*n[1]+i*n[4]+o*n[7],t[2]=r*n[2]+i*n[5]+o*n[8],t},t.transformMat4=ha,t.translate=function(t,e,n){var r,i,o,a,s,u,l,c,h,f,p,d,A=n[0],v=n[1],g=n[2];return e===t?(t[12]=e[0]*A+e[4]*v+e[8]*g+e[12],t[13]=e[1]*A+e[5]*v+e[9]*g+e[13],t[14]=e[2]*A+e[6]*v+e[10]*g+e[14],t[15]=e[3]*A+e[7]*v+e[11]*g+e[15]):(i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=e[8],f=e[9],p=e[10],d=e[11],t[0]=r=e[0],t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=l,t[7]=c,t[8]=h,t[9]=f,t[10]=p,t[11]=d,t[12]=r*A+s*v+h*g+e[12],t[13]=i*A+u*v+f*g+e[13],t[14]=o*A+l*v+p*g+e[14],t[15]=a*A+c*v+d*g+e[15]),t},t.triggerPluginCompletionEvent=ei,t.uniqueId=d,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=Tr,t.validateStyle=Sr,t.values=function(t){var e=[];for(var n in t)e.push(t[n]);return e},t.vectorTile=_s,t.version="1.13.2",t.warnOnce=w,t.webpSupported=U,t.window=a,t.wrap=h})),r(["./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 r="[",i=0,o=t;i<o.length;i+=1)r+=e(o[i])+",";return r+"]"}for(var a=Object.keys(t).sort(),s="{",u=0;u<a.length;u++)s+=JSON.stringify(a[u])+":"+e(t[a[u]])+",";return s+"}"}function n(n){for(var r="",i=0,o=t.refProperties;i<o.length;i+=1)r+="/"+e(n[o[i]]);return r}var r=function(t){this.keyCache={},t&&this.replace(t)};r.prototype.replace=function(t){this._layerConfigs={},this._layers={},this.update(t,[])},r.prototype.update=function(e,r){for(var i=this,o=0,a=e;o<a.length;o+=1){var s=a[o];this._layerConfigs[s.id]=s;var u=this._layers[s.id]=t.createStyleLayer(s);u._featureFilter=t.featureFilter(u.filter),this.keyCache[s.id]&&delete this.keyCache[s.id]}for(var l=0,c=r;l<c.length;l+=1){var h=c[l];delete this.keyCache[h],delete this._layerConfigs[h],delete this._layers[h]}this.familiesBySource={};for(var f=0,p=function(t,e){for(var r={},i=0;i<t.length;i++){var o=e&&e[t[i].id]||n(t[i]);e&&(e[t[i].id]=o);var a=r[o];a||(a=r[o]=[]),a.push(t[i])}var s=[];for(var u in r)s.push(r[u]);return s}(t.values(this._layerConfigs),this.keyCache);f<p.length;f+=1){var d=p[f].map((function(t){return i._layers[t.id]})),A=d[0];if("none"!==A.visibility){var v=A.source||"",g=this.familiesBySource[v];g||(g=this.familiesBySource[v]={});var m=A.sourceLayer||"_geojsonTileLayer",y=g[m];y||(y=g[m]=[]),y.push(d)}}};var i=function(e){var n={},r=[];for(var i in e){var o=e[i],a=n[i]={};for(var s in o){var u=o[+s];if(u&&0!==u.bitmap.width&&0!==u.bitmap.height){var l={x:0,y:0,w:u.bitmap.width+2,h:u.bitmap.height+2};r.push(l),a[s]={rect:l,metrics:u.metrics}}}}var c=t.potpack(r),h=new t.AlphaImage({width:c.w||1,height:c.h||1});for(var f in e){var p=e[f];for(var d in p){var A=p[+d];if(A&&0!==A.bitmap.width&&0!==A.bitmap.height){var v=n[f][d].rect;t.AlphaImage.copy(A.bitmap,h,{x:0,y:0},{x:v.x+1,y:v.y+1},A.bitmap)}}}this.image=h,this.positions=n};t.register("GlyphAtlas",i);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 a(e,n,r){for(var i=new t.EvaluationParameters(n),o=0,a=e;o<a.length;o+=1)a[o].recalculate(i,r)}function s(e,n){var r=t.getArrayBuffer(e.request,(function(e,r,i,o){e?n(e):r&&n(null,{vectorTile:new t.vectorTile.VectorTile(new t.pbf(r)),rawData:r,cacheControl:i,expires:o})}));return function(){r.cancel(),n()}}o.prototype.parse=function(e,n,r,o,s){var u=this;this.status="parsing",this.data=e,this.collisionBoxArray=new t.CollisionBoxArray;var l=new t.DictionaryCoder(Object.keys(e.layers).sort()),c=new t.FeatureIndex(this.tileID,this.promoteId);c.bucketLayerIDs=[];var h,f,p,d,A={},v={featureIndex:c,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:r},g=n.familiesBySource[this.source];for(var m in g){var y=e.layers[m];if(y){1===y.version&&t.warnOnce('Vector tile source "'+this.source+'" layer "'+m+'" does not use vector tile spec v2 and therefore may have some rendering errors.');for(var _=l.encode(m),b=[],x=0;x<y.length;x++){var w=y.feature(x),C=c.getId(w,m);b.push({feature:w,id:C,index:x,sourceLayerIndex:_})}for(var B=0,k=g[m];B<k.length;B+=1){var E=k[B],S=E[0];S.minzoom&&this.zoom<Math.floor(S.minzoom)||S.maxzoom&&this.zoom>=S.maxzoom||"none"!==S.visibility&&(a(E,this.zoom,r),(A[S.id]=S.createBucket({index:c.bucketLayerIDs.length,layers:E,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:_,sourceID:this.source})).populate(b,v,this.tileID.canonical),c.bucketLayerIDs.push(E.map((function(t){return t.id}))))}}}var T=t.mapObject(v.glyphDependencies,(function(t){return Object.keys(t).map(Number)}));Object.keys(T).length?o.send("getGlyphs",{uid:this.uid,stacks:T},(function(t,e){h||(h=t,f=e,P.call(u))})):f={};var M=Object.keys(v.iconDependencies);M.length?o.send("getImages",{icons:M,source:this.source,tileID:this.tileID,type:"icons"},(function(t,e){h||(h=t,p=e,P.call(u))})):p={};var I=Object.keys(v.patternDependencies);function P(){if(h)return s(h);if(f&&p&&d){var e=new i(f),n=new t.ImageAtlas(p,d);for(var o in A){var u=A[o];u instanceof t.SymbolBucket?(a(u.layers,this.zoom,r),t.performSymbolLayout(u,f,e.positions,p,n.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):u.hasPattern&&(u instanceof t.LineBucket||u instanceof t.FillBucket||u instanceof t.FillExtrusionBucket)&&(a(u.layers,this.zoom,r),u.addFeatures(v,this.tileID.canonical,n.patternPositions))}this.status="done",s(null,{buckets:t.values(A).filter((function(t){return!t.isEmpty()})),featureIndex:c,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:e.image,imageAtlas:n,glyphMap:this.returnDependencies?f:null,iconMap:this.returnDependencies?p:null,glyphPositions:this.returnDependencies?e.positions:null})}}I.length?o.send("getImages",{icons:I,source:this.source,tileID:this.tileID,type:"patterns"},(function(t,e){h||(h=t,d=e,P.call(u))})):d={},P.call(this)};var u=function(t,e,n,r){this.actor=t,this.layerIndex=e,this.availableImages=n,this.loadVectorData=r||s,this.loading={},this.loaded={}};u.prototype.loadTile=function(e,n){var r=this,i=e.uid;this.loading||(this.loading={});var a=!!(e&&e.request&&e.request.collectResourceTiming)&&new t.RequestPerformance(e.request),s=this.loading[i]=new o(e);s.abort=this.loadVectorData(e,(function(e,o){if(delete r.loading[i],e||!o)return s.status="done",r.loaded[i]=s,n(e);var u=o.rawData,l={};o.expires&&(l.expires=o.expires),o.cacheControl&&(l.cacheControl=o.cacheControl);var c={};if(a){var h=a.finish();h&&(c.resourceTiming=JSON.parse(JSON.stringify(h)))}s.vectorTile=o.vectorTile,s.parse(o.vectorTile,r.layerIndex,r.availableImages,r.actor,(function(e,r){if(e||!r)return n(e);n(null,t.extend({rawTileData:u.slice(0)},r,l,c))})),r.loaded=r.loaded||{},r.loaded[i]=s}))},u.prototype.reloadTile=function(t,e){var n=this,r=this.loaded,i=t.uid,o=this;if(r&&r[i]){var a=r[i];a.showCollisionBoxes=t.showCollisionBoxes;var s=function(t,r){var i=a.reloadCallback;i&&(delete a.reloadCallback,a.parse(a.vectorTile,o.layerIndex,n.availableImages,o.actor,i)),e(t,r)};"parsing"===a.status?a.reloadCallback=s:"done"===a.status&&(a.vectorTile?a.parse(a.vectorTile,this.layerIndex,this.availableImages,this.actor,s):s())}},u.prototype.abortTile=function(t,e){var n=this.loading,r=t.uid;n&&n[r]&&n[r].abort&&(n[r].abort(),delete n[r]),e()},u.prototype.removeTile=function(t,e){var n=this.loaded,r=t.uid;n&&n[r]&&delete n[r],e()};var l=t.window.ImageBitmap,c=function(){this.loaded={}};function h(t,e){if(0!==t.length){f(t[0],e);for(var n=1;n<t.length;n++)f(t[n],!e)}}function f(t,e){for(var n=0,r=0,i=t.length,o=i-1;r<i;o=r++)n+=(t[r][0]-t[o][0])*(t[o][1]+t[r][1]);n>=0!=!!e&&t.reverse()}c.prototype.loadTile=function(e,n){var r=e.uid,i=e.encoding,o=e.rawImageData,a=l&&o instanceof l?this.getImageData(o):o,s=new t.DEMData(r,a,i);this.loaded=this.loaded||{},this.loaded[r]=s,n(null,s)},c.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)},c.prototype.removeTile=function(t){var e=this.loaded,n=t.uid;e&&e[n]&&delete e[n]};var p=t.vectorTile.VectorTileFeature.prototype.toGeoJSON,d=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))};d.prototype.loadGeometry=function(){if(1===this._feature.type){for(var e=[],n=0,r=this._feature.geometry;n<r.length;n+=1){var i=r[n];e.push([new t.Point$1(i[0],i[1])])}return e}for(var o=[],a=0,s=this._feature.geometry;a<s.length;a+=1){for(var u=[],l=0,c=s[a];l<c.length;l+=1){var h=c[l];u.push(new t.Point$1(h[0],h[1]))}o.push(u)}return o},d.prototype.toGeoJSON=function(t,e,n){return p.call(this,t,e,n)};var A=function(e){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=t.EXTENT,this.length=e.length,this._features=e};A.prototype.feature=function(t){return new d(this._features[t])};var v=t.vectorTile.VectorTileFeature,g=m;function m(t,e){this.options=e||{},this.features=t,this.length=t.length}function y(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}m.prototype.feature=function(t){return new y(this.features[t],this.options.extent)},y.prototype.loadGeometry=function(){var e=this.rawGeometry;this.geometry=[];for(var n=0;n<e.length;n++){for(var r=e[n],i=[],o=0;o<r.length;o++)i.push(new t.Point$1(r[o][0],r[o][1]));this.geometry.push(i)}return this.geometry},y.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var t=this.geometry,e=1/0,n=-1/0,r=1/0,i=-1/0,o=0;o<t.length;o++)for(var a=t[o],s=0;s<a.length;s++){var u=a[s];e=Math.min(e,u.x),n=Math.max(n,u.x),r=Math.min(r,u.y),i=Math.max(i,u.y)}return[e,r,n,i]},y.prototype.toGeoJSON=v.prototype.toGeoJSON;var _=x,b=g;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 r={keys:[],values:[],keycache:{},valuecache:{}};for(n=0;n<t.length;n++)r.feature=t.feature(n),e.writeMessage(2,C,r);var i=r.keys;for(n=0;n<i.length;n++)e.writeStringField(3,i[n]);var o=r.values;for(n=0;n<o.length;n++)e.writeMessage(4,T,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,r=t.keys,i=t.values,o=t.keycache,a=t.valuecache;for(var s in n.properties){var u=o[s];void 0===u&&(r.push(s),o[s]=u=r.length-1),e.writeVarint(u);var l=n.properties[s],c=typeof l;"string"!==c&&"boolean"!==c&&"number"!==c&&(l=JSON.stringify(l));var h=c+":"+l,f=a[h];void 0===f&&(i.push(l),a[h]=f=i.length-1),e.writeVarint(f)}}function k(t,e){return(e<<3)+(7&t)}function E(t){return t<<1^t>>31}function S(t,e){for(var n=t.loadGeometry(),r=t.type,i=0,o=0,a=n.length,s=0;s<a;s++){var u=n[s],l=1;1===r&&(l=u.length),e.writeVarint(k(1,l));for(var c=3===r?u.length-1:u.length,h=0;h<c;h++){1===h&&1!==r&&e.writeVarint(k(2,c-1));var f=u[h].x-i,p=u[h].y-o;e.writeVarint(E(f)),e.writeVarint(E(p)),i+=f,o+=p}3===r&&e.writeVarint(k(7,1))}}function T(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 M(t,e,n,r){I(t,n,r),I(e,2*n,2*r),I(e,2*n+1,2*r+1)}function I(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function P(t,e,n,r){var i=t-n,o=e-r;return i*i+o*o}_.fromVectorTileJs=x,_.fromGeojsonVt=function(t,e){e=e||{};var n={};for(var r in t)n[r]=new g(t[r].features,e),n[r].name=r,n[r].version=e.version,n[r].extent=e.extent;return x({layers:n})},_.GeoJSONWrapper=b;var Z=function(t){return t[0]},D=function(t){return t[1]},L=function(t,e,n,r,i){void 0===e&&(e=Z),void 0===n&&(n=D),void 0===r&&(r=64),void 0===i&&(i=Float64Array),this.nodeSize=r,this.points=t;for(var o=t.length<65536?Uint16Array:Uint32Array,a=this.ids=new o(t.length),s=this.coords=new i(2*t.length),u=0;u<t.length;u++)a[u]=u,s[2*u]=e(t[u]),s[2*u+1]=n(t[u]);!function t(e,n,r,i,o,a){if(!(o-i<=r)){var s=i+o>>1;!function t(e,n,r,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,u=r-i+1,l=Math.log(s),c=.5*Math.exp(2*l/3),h=.5*Math.sqrt(l*c*(s-c)/s)*(u-s/2<0?-1:1);t(e,n,r,Math.max(i,Math.floor(r-u*c/s+h)),Math.min(o,Math.floor(r+(s-u)*c/s+h)),a)}var f=n[2*r+a],p=i,d=o;for(M(e,n,i,r),n[2*o+a]>f&&M(e,n,i,o);p<d;){for(M(e,n,p,d),p++,d--;n[2*p+a]<f;)p++;for(;n[2*d+a]>f;)d--}n[2*i+a]===f?M(e,n,i,d):M(e,n,++d,o),d<=r&&(i=d+1),r<=d&&(o=d-1)}}(e,n,s,i,o,a%2),t(e,n,r,i,s-1,a+1),t(e,n,r,s+1,o,a+1)}}(a,s,r,0,a.length-1,0)};L.prototype.range=function(t,e,n,r){return function(t,e,n,r,i,o,a){for(var s,u,l=[0,t.length-1,0],c=[];l.length;){var h=l.pop(),f=l.pop(),p=l.pop();if(f-p<=a)for(var d=p;d<=f;d++)u=e[2*d+1],(s=e[2*d])>=n&&s<=i&&u>=r&&u<=o&&c.push(t[d]);else{var A=Math.floor((p+f)/2);u=e[2*A+1],(s=e[2*A])>=n&&s<=i&&u>=r&&u<=o&&c.push(t[A]);var v=(h+1)%2;(0===h?n<=s:r<=u)&&(l.push(p),l.push(A-1),l.push(v)),(0===h?i>=s:o>=u)&&(l.push(A+1),l.push(f),l.push(v))}}return c}(this.ids,this.coords,t,e,n,r,this.nodeSize)},L.prototype.within=function(t,e,n){return function(t,e,n,r,i,o){for(var a=[0,t.length-1,0],s=[],u=i*i;a.length;){var l=a.pop(),c=a.pop(),h=a.pop();if(c-h<=o)for(var f=h;f<=c;f++)P(e[2*f],e[2*f+1],n,r)<=u&&s.push(t[f]);else{var p=Math.floor((h+c)/2),d=e[2*p],A=e[2*p+1];P(d,A,n,r)<=u&&s.push(t[p]);var v=(l+1)%2;(0===l?n-i<=d:r-i<=A)&&(a.push(h),a.push(p-1),a.push(v)),(0===l?n+i>=d:r+i>=A)&&(a.push(p+1),a.push(c),a.push(v))}}return s}(this.ids,this.coords,t,e,n,this.nodeSize)};var O={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(t){return t}},F=function(t){this.options=V(Object.create(O),t),this.trees=new Array(this.options.maxZoom+1)};function R(t,e,n,r,i){return{x:t,y:e,zoom:1/0,id:n,parentId:-1,numPoints:r,properties:i}}function z(t,e){var n=t.geometry.coordinates,r=n[1];return{x:G(n[0]),y:j(r),zoom:1/0,index:e,parentId:-1}}function U(t){return{type:"Feature",id:t.id,properties:N(t),geometry:{type:"Point",coordinates:[(r=t.x,360*(r-.5)),(e=t.y,n=(180-360*e)*Math.PI/180,360*Math.atan(Math.exp(n))/Math.PI-90)]}};var e,n,r}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 G(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,r,i,o){var a=i-n,s=o-r;if(0!==a||0!==s){var u=((t-n)*a+(e-r)*s)/(a*a+s*s);u>1?(n=i,r=o):u>0&&(n+=a*u,r+=s*u)}return(a=t-n)*a+(s=e-r)*s}function Q(t,e,n,r){var i={id:void 0===t?null:t,type:e,geometry:n,tags:r,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)q(t,e);else if("Polygon"===n||"MultiLineString"===n)for(var r=0;r<e.length;r++)q(t,e[r]);else if("MultiPolygon"===n)for(r=0;r<e.length;r++)for(var i=0;i<e[r].length;i++)q(t,e[r][i])}(i),i}function q(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 K(t,e,n,r){if(e.geometry){var i=e.geometry.coordinates,o=e.geometry.type,a=Math.pow(n.tolerance/((1<<n.maxZoom)*n.extent),2),s=[],u=e.id;if(n.promoteId?u=e.properties[n.promoteId]:n.generateId&&(u=r||0),"Point"===o)X(i,s);else if("MultiPoint"===o)for(var l=0;l<i.length;l++)X(i[l],s);else if("LineString"===o)Y(i,s,a,!1);else if("MultiLineString"===o){if(n.lineMetrics){for(l=0;l<i.length;l++)Y(i[l],s=[],a,!1),t.push(Q(u,"LineString",s,e.properties));return}$(i,s,a,!1)}else if("Polygon"===o)$(i,s,a,!0);else{if("MultiPolygon"!==o){if("GeometryCollection"===o){for(l=0;l<e.geometry.geometries.length;l++)K(t,{id:u,geometry:e.geometry.geometries[l],properties:e.properties},n,r);return}throw new Error("Input data is not a valid GeoJSON object.")}for(l=0;l<i.length;l++){var c=[];$(i[l],c,a,!0),s.push(c)}}t.push(Q(u,o,s,e.properties))}}function X(t,e){e.push(tt(t[0])),e.push(et(t[1])),e.push(0)}function Y(t,e,n,r){for(var i,o,a=0,s=0;s<t.length;s++){var u=tt(t[s][0]),l=et(t[s][1]);e.push(u),e.push(l),e.push(0),s>0&&(a+=r?(i*l-u*o)/2:Math.sqrt(Math.pow(u-i,2)+Math.pow(l-o,2))),i=u,o=l}var c=e.length-3;e[2]=1,function t(e,n,r,i){for(var o,a=i,s=r-n>>1,u=r-n,l=e[n],c=e[n+1],h=e[r],f=e[r+1],p=n+3;p<r;p+=3){var d=W(e[p],e[p+1],l,c,h,f);
vendor: 4,289 bytes, line 2
2if(d>a)o=p,a=d;else if(d===a){var A=Math.abs(p-s);A<u&&(o=p,u=A)}}a>i&&(o-n>3&&t(e,n,o,i),e[o+2]=a,r-o>3&&t(e,o,r,i))}(e,0,c,n),e[c+2]=1,e.size=Math.abs(a),e.start=0,e.end=e.size}function $(t,e,n,r){for(var i=0;i<t.length;i++){var o=[];Y(t[i],o,n,r),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,r,i,o,a,s){if(r/=e,o>=(n/=e)&&a<r)return t;if(a<n||o>=r)return null;for(var u=[],l=0;l<t.length;l++){var c=t[l],h=c.geometry,f=c.type,p=0===i?c.minX:c.minY,d=0===i?c.maxX:c.maxY;if(p>=n&&d<r)u.push(c);else if(!(d<n||p>=r)){var A=[];if("Point"===f||"MultiPoint"===f)rt(h,A,n,r,i);else if("LineString"===f)it(h,A,n,r,i,!1,s.lineMetrics);else if("MultiLineString"===f)at(h,A,n,r,i,!1);else if("Polygon"===f)at(h,A,n,r,i,!0);else if("MultiPolygon"===f)for(var v=0;v<h.length;v++){var g=[];at(h[v],g,n,r,i,!0),g.length&&A.push(g)}if(A.length){if(s.lineMetrics&&"LineString"===f){for(v=0;v<A.length;v++)u.push(Q(c.id,f,A[v],c.tags));continue}"LineString"!==f&&"MultiLineString"!==f||(1===A.length?(f="LineString",A=A[0]):f="MultiLineString"),"Point"!==f&&"MultiPoint"!==f||(f=3===A.length?"Point":"MultiPoint"),u.push(Q(c.id,f,A,c.tags))}}}return u.length?u:null}function rt(t,e,n,r,i){for(var o=0;o<t.length;o+=3){var a=t[o+i];a>=n&&a<=r&&(e.push(t[o]),e.push(t[o+1]),e.push(t[o+2]))}}function it(t,e,n,r,i,o,a){for(var s,u,l=ot(t),c=0===i?ut:lt,h=t.start,f=0;f<t.length-3;f+=3){var p=t[f],d=t[f+1],A=t[f+2],v=t[f+3],g=t[f+4],m=0===i?p:d,y=0===i?v:g,_=!1;a&&(s=Math.sqrt(Math.pow(p-v,2)+Math.pow(d-g,2))),m<n?y>n&&(u=c(l,p,d,v,g,n),a&&(l.start=h+s*u)):m>r?y<r&&(u=c(l,p,d,v,g,r),a&&(l.start=h+s*u)):st(l,p,d,A),y<n&&m>=n&&(u=c(l,p,d,v,g,n),_=!0),y>r&&m<=r&&(u=c(l,p,d,v,g,r),_=!0),!o&&_&&(a&&(l.end=h+s*u),e.push(l),l=ot(t)),a&&(h+=s)}var b=t.length-3;p=t[b],d=t[b+1],A=t[b+2],(m=0===i?p:d)>=n&&m<=r&&st(l,p,d,A),b=l.length-3,o&&b>=3&&(l[b]!==l[0]||l[b+1]!==l[1])&&st(l,l[0],l[1],l[2]),l.length&&e.push(l)}function ot(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function at(t,e,n,r,i,o){for(var a=0;a<t.length;a++)it(t[a],e,n,r,i,o,!1)}function st(t,e,n,r){t.push(e),t.push(n),t.push(r)}function ut(t,e,n,r,i,o){var a=(o-e)/(r-e);return t.push(o),t.push(n+(i-n)*a),t.push(1),a}function lt(t,e,n,r,i,o){var a=(o-n)/(i-n);return t.push(e+(r-e)*a),t.push(o),t.push(1),a}function ct(t,e){for(var n=[],r=0;r<t.length;r++){var i,o=t[r],a=o.type;if("Point"===a||"MultiPoint"===a||"LineString"===a)i=ht(o.geometry,e);else if("MultiLineString"===a||"Polygon"===a){i=[];for(var s=0;s<o.geometry.length;s++)i.push(ht(o.geometry[s],e))}else if("MultiPolygon"===a)for(i=[],s=0;s<o.geometry.length;s++){for(var u=[],l=0;l<o.geometry[s].length;l++)u.push(ht(o.geometry[s][l],e));i.push(u)}n.push(Q(o.id,a,i,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 r=0;r<t.length;r+=3)n.push(t[r]+e,t[r+1],t[r+2]);return n}function ft(t,e){if(t.transformed)return t;var n,r,i,o=1<<t.z,a=t.x,s=t.y;for(n=0;n<t.features.length;n++){var u=t.features[n],l=u.geometry,c=u.type;if(u.geometry=[],1===c)for(r=0;r<l.length;r+=2)u.geometry.push(pt(l[r],l[r+1],e,o,a,s));else for(r=0;r<l.length;r++){var h=[];for(i=0;i<l[r].length;i+=2)h.push(pt(l[r][i],l[r][i+1],e,o,a,s));u.geometry.push(h)}}return t.transformed=!0,t}function pt(t,e,n,r,i,o){return[Math.round(n*(t*r-i)),Math.round(n*(e*r-o))]}function dt(t,e,n,r,i){for(var o=e===i.maxZoom?0:i.tolerance/((1<<e)*i.extent),a={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:n,y:r,z:e,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},s=0;s<t.length;s++){a.numFeatures++,At(a,t[s],o,i);var u=t[s].minX,l=t[s].minY,c=t[s].maxX,h=t[s].maxY;u<a.minX&&(a.minX=u),l<a.minY&&(a.minY=l),c>a.maxX&&(a.maxX=c),h>a.maxY&&(a.maxY=h)}return a}function At(t,e,n,r){var i=e.geometry,o=e.type,a=[];if("Point"===o||"MultiPoint"===o)for(var s=0;s<i.length;s+=3)a.push(i[s]),a.push(i[s+1]),t.numPoints++,t.numSimplified++;else if("LineString"===o)vt(a,i,t,n,!1,!1);else if("MultiLineString"===o||"Polygon"===o)for(s=0;s<i.length;s++)vt(a,i[s],t,n,"Polygon"===o,0===s);else if("MultiPolygon"===o)for(var u=0;u<i.length;u++){var l=i[u];for(s=0;s<l.length;s++)vt(a,l[s],t,n,!0,0===s)}
vendor: 17,115 bytes, line 2
2if(a.length){var c=e.tags||null;if("LineString"===o&&r.lineMetrics){for(var h in c={},e.tags)c[h]=e.tags[h];c.mapbox_clip_start=i.start/i.size,c.mapbox_clip_end=i.end/i.size}var f={geometry:a,type:"Polygon"===o||"MultiPolygon"===o?3:"LineString"===o||"MultiLineString"===o?2:1,tags:c};null!==e.id&&(f.id=e.id),t.features.push(f)}}function vt(t,e,n,r,i,o){var a=r*r;if(r>0&&e.size<(i?a:r))n.numPoints+=e.length/3;else{for(var s=[],u=0;u<e.length;u+=3)(0===r||e[u+2]>a)&&(n.numSimplified++,s.push(e[u]),s.push(e[u+1])),n.numPoints++;i&&function(t,e){for(var n=0,r=0,i=t.length,o=i-2;r<i;o=r,r+=2)n+=(t[r]-t[o])*(t[r+1]+t[o+1]);if(n>0===e)for(r=0,i=t.length;r<i/2;r+=2){var a=t[r],s=t[r+1];t[r]=t[i-2-r],t[r+1]=t[i-1-r],t[i-2-r]=a,t[i-1-r]=s}}(s,o),t.push(s)}}function gt(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 r=function(t,e){var n=[];if("FeatureCollection"===t.type)for(var r=0;r<t.features.length;r++)K(n,t.features[r],e,r);else K(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),(r=function(t,e){var n=e.buffer/e.extent,r=t,i=nt(t,1,-1-n,n,0,-1,2,e),o=nt(t,1,1-n,2+n,0,-1,2,e);return(i||o)&&(r=nt(t,1,-n,1+n,0,-1,2,e)||[],i&&(r=ct(i,1).concat(r)),o&&(r=r.concat(ct(o,-1)))),r}(r,e)).length&&this.splitTile(r,0,0,0),n&&(r.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function mt(t,e,n){return 32*((1<<t)*n+e)+t}function yt(t,e){var n=t.tileID.canonical;if(!this._geoJSONIndex)return e(null,null);var r=this._geoJSONIndex.getTile(n.z,n.x,n.y);if(!r)return e(null,null);var i=new A(r.features),o=_(i);0===o.byteOffset&&o.byteLength===o.buffer.byteLength||(o=new Uint8Array(o)),e(null,{vectorTile:i,rawData:o.buffer})}F.prototype.load=function(t){var e=this.options,n=e.log,r=e.minZoom,i=e.maxZoom,o=e.nodeSize;n&&console.time("total time");var a="prepare "+t.length+" points";n&&console.time(a),this.points=t;for(var s=[],u=0;u<t.length;u++)t[u].geometry&&s.push(z(t[u],u));this.trees[i+1]=new L(s,H,J,o,Float32Array),n&&console.timeEnd(a);for(var l=i;l>=r;l--){var c=+Date.now();s=this._cluster(s,l),this.trees[l]=new L(s,H,J,o,Float32Array),n&&console.log("z%d: %d clusters in %dms",l,s.length,+Date.now()-c)}return n&&console.timeEnd("total time"),this},F.prototype.getClusters=function(t,e){var n=((t[0]+180)%360+360)%360-180,r=Math.max(-90,Math.min(90,t[1])),i=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,i=180;else if(n>i){var a=this.getClusters([n,r,180,o],e),s=this.getClusters([-180,r,i,o],e);return a.concat(s)}for(var u=this.trees[this._limitZoom(e)],l=[],c=0,h=u.range(G(n),j(o),G(i),j(r));c<h.length;c+=1){var f=u.points[h[c]];l.push(f.numPoints?U(f):this.points[f.index])}return l},F.prototype.getChildren=function(t){var e=this._getOriginId(t),n=this._getOriginZoom(t),r="No cluster with the specified id.",i=this.trees[n];if(!i)throw new Error(r);var o=i.points[e];if(!o)throw new Error(r);for(var a=this.options.radius/(this.options.extent*Math.pow(2,n-1)),s=[],u=0,l=i.within(o.x,o.y,a);u<l.length;u+=1){var c=i.points[l[u]];c.parentId===t&&s.push(c.numPoints?U(c):this.points[c.index])}if(0===s.length)throw new Error(r);return s},F.prototype.getLeaves=function(t,e,n){var r=[];return this._appendLeaves(r,t,e=e||10,n=n||0,0),r},F.prototype.getTile=function(t,e,n){var r=this.trees[this._limitZoom(t)],i=Math.pow(2,t),o=this.options,a=o.radius/o.extent,s=(n-a)/i,u=(n+1+a)/i,l={features:[]};return this._addTileFeatures(r.range((e-a)/i,s,(e+1+a)/i,u),r.points,e,n,i,l),0===e&&this._addTileFeatures(r.range(1-a/i,s,1,u),r.points,i,n,i,l),e===i-1&&this._addTileFeatures(r.range(0,s,a/i,u),r.points,-1,n,i,l),l.features.length?l:null},F.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},F.prototype._appendLeaves=function(t,e,n,r,i){for(var o=0,a=this.getChildren(e);o<a.length;o+=1){var s=a[o],u=s.properties;if(u&&u.cluster?i+u.point_count<=r?i+=u.point_count:i=this._appendLeaves(t,u.cluster_id,n,r,i):i<r?i++:t.push(s),t.length===n)break}return i},F.prototype._addTileFeatures=function(t,e,n,r,i,o){for(var a=0,s=t;a<s.length;a+=1){var u=e[s[a]],l=u.numPoints,c={type:1,geometry:[[Math.round(this.options.extent*(u.x*i-n)),Math.round(this.options.extent*(u.y*i-r))]],tags:l?N(u):this.points[u.index].properties},h=void 0;l?h=u.id:this.options.generateId?h=u.index:this.points[u.index].id&&(h=this.points[u.index].id),void 0!==h&&(c.id=h),o.features.push(c)}},F.prototype._limitZoom=function(t){return Math.max(this.options.minZoom,Math.min(+t,this.options.maxZoom+1))},F.prototype._cluster=function(t,e){for(var n=[],r=this.options,i=r.reduce,o=r.minPoints,a=r.radius/(r.extent*Math.pow(2,e)),s=0;s<t.length;s++){var u=t[s];if(!(u.zoom<=e)){u.zoom=e;for(var l=this.trees[e+1],c=l.within(u.x,u.y,a),h=u.numPoints||1,f=h,p=0,d=c;p<d.length;p+=1){var A=l.points[d[p]];A.zoom>e&&(f+=A.numPoints||1)}if(f>=o){for(var v=u.x*h,g=u.y*h,m=i&&h>1?this._map(u,!0):null,y=(s<<5)+(e+1)+this.points.length,_=0,b=c;_<b.length;_+=1){var x=l.points[b[_]];if(!(x.zoom<=e)){x.zoom=e;var w=x.numPoints||1;v+=x.x*w,g+=x.y*w,x.parentId=y,i&&(m||(m=this._map(u,!0)),i(m,this._map(x)))}}u.parentId=y,n.push(R(v/f,g/f,y,f,m))}else if(n.push(u),f>1)for(var C=0,B=c;C<B.length;C+=1){var k=l.points[B[C]];k.zoom<=e||(k.zoom=e,n.push(k))}}}return n},F.prototype._getOriginId=function(t){return t-this.points.length>>5},F.prototype._getOriginZoom=function(t){return(t-this.points.length)%32},F.prototype._map=function(t,e){if(t.numPoints)return e?V({},t.properties):t.properties;var n=this.points[t.index].properties,r=this.options.map(n);return e&&r===n?V({},r):r},gt.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},gt.prototype.splitTile=function(t,e,n,r,i,o,a){for(var s=[t,e,n,r],u=this.options,l=u.debug;s.length;){r=s.pop(),n=s.pop(),e=s.pop(),t=s.pop();var c=1<<e,h=mt(e,n,r),f=this.tiles[h];if(!f&&(l>1&&console.time("creation"),f=this.tiles[h]=dt(t,e,n,r,u),this.tileCoords.push({z:e,x:n,y:r}),l)){l>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,n,r,f.numFeatures,f.numPoints,f.numSimplified),console.timeEnd("creation"));var p="z"+e;this.stats[p]=(this.stats[p]||0)+1,this.total++}if(f.source=t,i){if(e===u.maxZoom||e===i)continue;var d=1<<i-e;if(n!==Math.floor(o/d)||r!==Math.floor(a/d))continue}else if(e===u.indexMaxZoom||f.numPoints<=u.indexMaxPoints)continue;if(f.source=null,0!==t.length){l>1&&console.time("clipping");var A,v,g,m,y,_,b=.5*u.buffer/u.extent,x=.5-b,w=.5+b,C=1+b;A=v=g=m=null,y=nt(t,c,n-b,n+w,0,f.minX,f.maxX,u),_=nt(t,c,n+x,n+C,0,f.minX,f.maxX,u),t=null,y&&(A=nt(y,c,r-b,r+w,1,f.minY,f.maxY,u),v=nt(y,c,r+x,r+C,1,f.minY,f.maxY,u),y=null),_&&(g=nt(_,c,r-b,r+w,1,f.minY,f.maxY,u),m=nt(_,c,r+x,r+C,1,f.minY,f.maxY,u),_=null),l>1&&console.timeEnd("clipping"),s.push(A||[],e+1,2*n,2*r),s.push(v||[],e+1,2*n,2*r+1),s.push(g||[],e+1,2*n+1,2*r),s.push(m||[],e+1,2*n+1,2*r+1)}}},gt.prototype.getTile=function(t,e,n){var r=this.options,i=r.extent,o=r.debug;if(t<0||t>24)return null;var a=1<<t,s=mt(t,e=(e%a+a)%a,n);if(this.tiles[s])return ft(this.tiles[s],i);o>1&&console.log("drilling down to z%d-%d-%d",t,e,n);for(var u,l=t,c=e,h=n;!u&&l>0;)l--,c=Math.floor(c/2),h=Math.floor(h/2),u=this.tiles[mt(l,c,h)];return u&&u.source?(o>1&&console.log("found parent tile z%d-%d-%d",l,c,h),o>1&&console.time("drilling down"),this.splitTile(u.source,l,c,h,t,e,n),o>1&&console.timeEnd("drilling down"),this.tiles[s]?ft(this.tiles[s],i):null):null};var _t=function(e){function n(t,n,r,i){e.call(this,t,n,r,yt),i&&(this.loadGeoJSON=i)}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,r=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var i=!!(r&&r.request&&r.request.collectResourceTiming)&&new t.RequestPerformance(r.request);this.loadGeoJSON(r,(function(o,a){if(o||!a)return n(o);if("object"!=typeof a)return n(new Error("Input data given to '"+r.source+"' is not a valid GeoJSON object."));!function t(e,n){var r,i=e&&e.type;if("FeatureCollection"===i)for(r=0;r<e.features.length;r++)t(e.features[r],n);else if("GeometryCollection"===i)for(r=0;r<e.geometries.length;r++)t(e.geometries[r],n);else if("Feature"===i)t(e.geometry,n);else if("Polygon"===i)h(e.coordinates,n);else if("MultiPolygon"===i)for(r=0;r<e.coordinates.length;r++)h(e.coordinates[r],n);return e}(a,!0);try{if(r.filter){var s=t.createExpression(r.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===s.result)throw new Error(s.value.map((function(t){return t.key+": "+t.message})).join(", "));var u=a.features.filter((function(t){return s.value.evaluate({zoom:0},t)}));a={type:"FeatureCollection",features:u}}e._geoJSONIndex=r.cluster?new F(function(e){var n=e.superclusterOptions,r=e.clusterProperties;if(!r||!n)return n;for(var i={},o={},a={accumulated:null,zoom:0},s={properties:null},u=Object.keys(r),l=0,c=u;l<c.length;l+=1){var h=c[l],f=r[h],p=f[0],d=t.createExpression(f[1]),A=t.createExpression("string"==typeof p?[p,["accumulated"],["get",h]]:p);i[h]=d.value,o[h]=A.value}return n.map=function(t){s.properties=t;for(var e={},n=0,r=u;n<r.length;n+=1){var o=r[n];e[o]=i[o].evaluate(a,s)}return e},n.reduce=function(t,e){s.properties=e;for(var n=0,r=u;n<r.length;n+=1){var i=r[n];a.accumulated=t[i],t[i]=o[i].evaluate(a,s)}},n}(r)).load(a.features):function(t,e){return new gt(t,e)}(a,r.geojsonVtOptions)}catch(o){return n(o)}e.loaded={};var l={};if(i){var c=i.finish();c&&(l.resourceTiming={},l.resourceTiming[r.source]=JSON.parse(JSON.stringify(c)))}n(null,l)}))}},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 r=this.loaded;return r&&r[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}(u),bt=function(e){var n=this;this.self=e,this.actor=new t.Actor(e,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:u,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 r in this.availableImages[t]=e,this.workerSources[t]){var i=this.workerSources[t][r];for(var o in i)i[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 r=this.workerSources[t][e.type][e.source];delete this.workerSources[t][e.type][e.source],void 0!==r.removeSource?r.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,r){try{t.plugin.setState(n);var i=t.plugin.getPluginURL();if(t.plugin.isLoaded()&&!t.plugin.isParsed()&&null!=i){this.self.importScripts(i);var o=t.plugin.isParsed();r(o?void 0:new Error("RTL Text Plugin failed to import scripts from "+i),o)}}catch(t){r(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 r),e},bt.prototype.getWorkerSource=function(t,e,n){var r=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,i){r.actor.send(e,n,i,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 c),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})),r(["./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"}),r=URL.createObjectURL(n);try{e=new Worker(r),t=!0}catch(e){t=!1}return e&&e.terminate(),URL.revokeObjectURL(r),t}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var t=document.createElement("canvas");t.width=t.height=1;var e=t.getContext("2d");if(!e)return!1;var n=e.getImageData(0,0,1,1);return n&&n.width===t.width}()?(void 0===r[n=t&&t.failIfMajorPerformanceCaveat]&&(r[n]=function(t){var n=function(t){var n=document.createElement("canvas"),r=Object.create(e.webGLContextAttributes);return r.failIfMajorPerformanceCaveat=t,n.probablySupportsContext?n.probablySupportsContext("webgl",r)||n.probablySupportsContext("experimental-webgl",r):n.supportsContext?n.supportsContext("webgl",r)||n.supportsContext("experimental-webgl",r):n.getContext("webgl",r)||n.getContext("experimental-webgl",r)}(t);if(!n)return!1;var r=n.createShader(n.VERTEX_SHADER);return!(!r||n.isContextLost())&&(n.shaderSource(r,"void main() {}
2"),n.compileShader(r),!0===n.getShaderParameter(r,n.COMPILE_STATUS))}(n)),r[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 r={};e.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}})),n={create:function(e,n,r){var i=t.window.document.createElement(e);return void 0!==n&&(i.className=n),r&&r.appendChild(i),i},createNS:function(e,n){return t.window.document.createElementNS(e,n)}},r=t.window.document&&t.window.document.documentElement.style;function i(t){if(!r)return t[0];for(var e=0;e<t.length;e++)if(t[e]in r)return t[e];return t[0]}var o,a=i(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);n.disableDrag=function(){r&&a&&(o=r[a],r[a]="none")},n.enableDrag=function(){r&&a&&(r[a]=o)};var s=i(["transform","WebkitTransform"]);n.setTransform=function(t,e){t.style[s]=e};var u=!1;try{var l=Object.defineProperty({},"passive",{get:function(){u=!0}});t.window.addEventListener("test",l,l),t.window.removeEventListener("test",l,l)}catch(t){u=!1}n.addEventListener=function(t,e,n,r){void 0===r&&(r={}),t.addEventListener(e,n,"passive"in r&&u?r:r.capture)},n.removeEventListener=function(t,e,n,r){void 0===r&&(r={}),t.removeEventListener(e,n,"passive"in r&&u?r:r.capture)};var c=function e(n){n.preventDefault(),n.stopPropagation(),t.window.removeEventListener("click",e,!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",c,!0),t.window.setTimeout((function(){t.window.removeEventListener("click",c,!0)}),0)},n.mousePos=function(e,n){var r=e.getBoundingClientRect();return new t.Point(n.clientX-r.left-e.clientLeft,n.clientY-r.top-e.clientTop)},n.touchPos=function(e,n){for(var r=e.getBoundingClientRect(),i=[],o=0;o<n.length;o++)i.push(new t.Point(n[o].clientX-r.left-e.clientLeft,n[o].clientY-r.top-e.clientTop));return i},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 f=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 r=n[e];this._notify(r.ids,r.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 r=!0;return this._validateStretch(n.stretchX,n.data&&n.data.width)||(this.fire(new t.ErrorEvent(new Error('Image "'+e+'" has invalid "stretchX" value'))),r=!1),this._validateStretch(n.stretchY,n.data&&n.data.height)||(this.fire(new t.ErrorEvent(new Error('Image "'+e+'" has invalid "stretchY" value'))),r=!1),this._validateContent(n.content,n)||(this.fire(new t.ErrorEvent(new Error('Image "'+e+'" has invalid "content" value'))),r=!1),r},n.prototype._validateStretch=function(t,e){if(!t)return!0;for(var n=0,r=0,i=t;r<i.length;r+=1){var o=i[r];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 r=0,i=t;r<i.length;
vendor: 105,877 bytes, line 2
2r+=1)this.images[i[r]]||(n=!1);this.isLoaded()||n?this._notify(t,e):this.requestors.push({ids:t,callback:e})},n.prototype._notify=function(e,n){for(var r={},i=0,o=e;i<o.length;i+=1){var a=o[i];this.images[a]||this.fire(new t.Event("styleimagemissing",{id:a}));var s=this.images[a];s?r[a]={data:s.data.clone(),pixelRatio:s.pixelRatio,sdf:s.sdf,version:s.version,stretchX:s.stretchX,stretchY:s.stretchY,content:s.content,hasRenderCallback:Boolean(s.userImage&&s.userImage.render)}:t.warnOnce('Image "'+a+'" 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,r)},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],r=this.getImage(e);if(!r)return null;if(n&&n.position.version===r.version)return n.position;if(n)n.position.version=r.version;else{var i={w:r.data.width+2,h:r.data.height+2,x:0,y:0},o=new t.ImagePosition(i,r);this.patterns[e]={bin:i,position:o}}return this._updatePatternAtlas(),this.patterns[e].position},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 r=t.potpack(e),i=r.w,o=r.h,a=this.atlasImage;for(var s in a.resize({width:i||1,height:o||1}),this.patterns){var u=this.patterns[s].bin,l=u.x+1,c=u.y+1,h=this.images[s].data,f=h.width,p=h.height;t.RGBAImage.copy(h,a,{x:0,y:0},{x:l,y:c},{width:f,height:p}),t.RGBAImage.copy(h,a,{x:0,y:p-1},{x:l,y:c-1},{width:f,height:1}),t.RGBAImage.copy(h,a,{x:0,y:0},{x:l,y:c+p},{width:f,height:1}),t.RGBAImage.copy(h,a,{x:f-1,y:0},{x:l-1,y:c},{width:1,height:p}),t.RGBAImage.copy(h,a,{x:0,y:0},{x:l+f,y:c},{width:1,height:p})}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 r=n[e];if(!this.callbackDispatchedThisFrame[r]){this.callbackDispatchedThisFrame[r]=!0;var i=this.images[r];h(i)&&this.updateImage(r,i)}}},n}(t.Evented),p=v,d=v,A=1e20;function v(t,e,n,r,i,o){this.fontSize=t||24,this.buffer=void 0===e?3:e,this.cutoff=r||.25,this.fontFamily=i||"sans-serif",this.fontWeight=o||"normal",this.radius=n||8;var a=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=a,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(a*a),this.gridInner=new Float64Array(a*a),this.f=new Float64Array(a),this.d=new Float64Array(a),this.z=new Float64Array(a+1),this.v=new Int16Array(a),this.middle=Math.round(a/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function g(t,e,n,r,i,o,a){for(var s=0;s<e;s++){for(var u=0;u<n;u++)r[u]=t[u*e+s];for(m(r,i,o,a,n),u=0;u<n;u++)t[u*e+s]=i[u]}for(u=0;u<n;u++){for(s=0;s<e;s++)r[s]=t[u*e+s];for(m(r,i,o,a,e),s=0;s<e;s++)t[u*e+s]=Math.sqrt(i[s])}}function m(t,e,n,r,i){n[0]=0,r[0]=-A,r[1]=+A;for(var o=1,a=0;o<i;o++){for(var s=(t[o]+o*o-(t[n[a]]+n[a]*n[a]))/(2*o-2*n[a]);s<=r[a];)a--,s=(t[o]+o*o-(t[n[a]]+n[a]*n[a]))/(2*o-2*n[a]);n[++a]=o,r[a]=s,r[a+1]=+A}for(o=0,a=0;o<i;o++){for(;r[a+1]<o;)a++;e[o]=(o-n[a])*(o-n[a])+t[n[a]]}}v.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),r=0;r<this.size*this.size;r++){var i=e.data[4*r+3]/255;this.gridOuter[r]=1===i?0:0===i?A:Math.pow(Math.max(0,.5-i),2),this.gridInner[r]=1===i?A:0===i?0:Math.pow(Math.max(0,i-.5),2)}for(g(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),g(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),r=0;r<this.size*this.size;r++)n[r]=Math.max(0,Math.min(255,Math.round(255-255*((this.gridOuter[r]-this.gridInner[r])/this.radius+this.cutoff))));return n},p.default=d;var y=function(t,e){this.requestManager=t,this.localIdeographFontFamily=e,this.entries={}};y.prototype.setURL=function(t){this.url=t},y.prototype.getGlyphs=function(e,n){var r=this,i=[];for(var o in e)for(var a=0,s=e[o];a<s.length;a+=1)i.push({stack:o,id:s[a]});t.asyncAll(i,(function(t,e){var n=t.stack,i=t.id,o=r.entries[n];o||(o=r.entries[n]={glyphs:{},requests:{},ranges:{}});var a=o.glyphs[i];if(void 0===a){if(a=r._tinySDF(o,n,i))return o.glyphs[i]=a,void e(null,{stack:n,id:i,glyph:a});var s=Math.floor(i/256);if(256*s>65535)e(new Error("glyphs > 65535 not supported"));else if(o.ranges[s])e(null,{stack:n,id:i,glyph:a});else{var u=o.requests[s];u||(u=o.requests[s]=[],y.loadGlyphRange(n,s,r.url,r.requestManager,(function(t,e){if(e){for(var n in e)r._doesCharSupportLocalGlyph(+n)||(o.glyphs[+n]=e[+n]);o.ranges[s]=!0}for(var i=0,a=u;i<a.length;i+=1)(0,a[i])(t,e);delete o.requests[s]}))),u.push((function(t,r){t?e(t):r&&e(null,{stack:n,id:i,glyph:r[i]||null})}))}}else e(null,{stack:n,id:i,glyph:a})}),(function(t,e){if(t)n(t);else if(e){for(var r={},i=0,o=e;i<o.length;i+=1){var a=o[i],s=a.stack,u=a.id,l=a.glyph;(r[s]||(r[s]={}))[u]=l&&{id:l.id,bitmap:l.bitmap.clone(),metrics:l.metrics}}n(null,r)}}))},y.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))},y.prototype._tinySDF=function(e,n,r){var i=this.localIdeographFontFamily;if(i&&this._doesCharSupportLocalGlyph(r)){var o=e.tinySDF;if(!o){var a="400";/bold/i.test(n)?a="900":/medium/i.test(n)?a="500":/light/i.test(n)&&(a="200"),o=e.tinySDF=new y.TinySDF(24,3,8,.25,i,a)}return{id:r,bitmap:new t.AlphaImage({width:30,height:30},o.draw(String.fromCharCode(r))),metrics:{width:24,height:24,left:0,top:-8,advance:24}}}},y.loadGlyphRange=function(e,n,r,i,o){var a=256*n,s=a+255,u=i.transformRequest(i.normalizeGlyphsURL(r).replace("{fontstack}",e).replace("{range}",a+"-"+s),t.ResourceType.Glyphs);t.getArrayBuffer(u,(function(e,n){if(e)o(e);else if(n){for(var r={},i=0,a=t.parseGlyphPBF(n);i<a.length;i+=1){var s=a[i];r[s.id]=s}o(null,r)}}))},y.TinySDF=p;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,r){return{x:t.number(e.x,n.x,r),y:t.number(e.y,n.y,r),z:t.number(e.z,n.z,r)}};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 r in e){var i=e[r];t.endsWith(r,"-transition")?this._transitionable.setTransition(r.slice(0,-11),i):this._transitionable.setValue(r,i)}},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,r){return(!r||!1!==r.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 r=[],i=t.length%2==1?-t[t.length-1]*n:0,o=t[0]*n,a=!0;r.push({left:i,right:o,isDash:a,zeroLength:0===t[0]});for(var s=t[0],u=1;u<t.length;u++){var l=t[u];r.push({left:i=s*n,right:o=(s+=l)*n,isDash:a=!a,zeroLength:0===l})}return r},w.prototype.addRoundDash=function(t,e,n){for(var r=e/2,i=-n;i<=n;i++)for(var o=this.width*(this.nextRow+n+i),a=0,s=t[a],u=0;u<this.width;u++){u/s.right>1&&(s=t[++a]);var l=Math.abs(u-s.left),c=Math.abs(u-s.right),h=Math.min(l,c),f=void 0,p=i/n*(r+1);if(s.isDash){var d=r-Math.abs(p);f=Math.sqrt(h*h+d*d)}else f=r-Math.sqrt(h*h+p*p);this.data[o+u]=Math.max(0,Math.min(255,f+128))}},w.prototype.addRegularDash=function(t){for(var e=t.length-1;e>=0;--e){var n=t[e],r=t[e+1];n.zeroLength?t.splice(e,1):r&&r.isDash===n.isDash&&(r.left=n.left,t.splice(e,1))}var i=t[0],o=t[t.length-1];i.isDash===o.isDash&&(i.left=o.left-this.width,o.right=i.right+this.width);for(var a=this.width*this.nextRow,s=0,u=t[s],l=0;l<this.width;l++){l/u.right>1&&(u=t[++s]);var c=Math.abs(l-u.left),h=Math.abs(l-u.right),f=Math.min(c,h);this.data[a+l]=Math.max(0,Math.min(255,(u.isDash?f:-f)+128))}},w.prototype.addDash=function(e,n){var r=n?7:0,i=2*r+1;if(this.nextRow+i>this.height)return t.warnOnce("LineAtlas out of space"),null;for(var o=0,a=0;a<e.length;a++)o+=e[a];if(0!==o){var s=this.width/o,u=this.getDashRanges(e,this.width,s);n?this.addRoundDash(u,s,r):this.addRegularDash(u)}var l={y:(this.nextRow+r+.5)/this.height,height:2*r/this.height,width:o};return this.nextRow+=i,this.dirty=!0,l},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,r){this.workerPool=n,this.actors=[],this.currentActor=0,this.id=t.uniqueId();for(var i=this.workerPool.acquire(this.id),o=0;o<i.length;o++){var a=new e.Actor(i[o],r,this.id);a.name="Worker "+o,this.actors.push(a)}};function B(e,n,r){var i=function(i,o){if(i)return r(i);if(o){var a=t.pick(t.extend(o,e),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);o.vector_layers&&(a.vectorLayers=o.vector_layers,a.vectorLayerIds=a.vectorLayers.map((function(t){return t.id}))),a.tiles=n.canonicalizeTileset(a,e.url),r(null,a)}};return e.url?t.getJSON(n.transformRequest(n.normalizeSourceURL(e.url),t.ResourceType.Source),i):t.browser.frame((function(){return i(null,e)}))}C.prototype.broadcast=function(e,n,r){t.asyncAll(this.actors,(function(t,r){t.send(e,n,r)}),r=r||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 k=function(e,n,r){this.bounds=t.LngLatBounds.convert(this.validateBounds(e)),this.minzoom=n||0,this.maxzoom=r||24};k.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]},k.prototype.contains=function(e){var n=Math.pow(2,e.z),r=Math.floor(t.mercatorXfromLng(this.bounds.getWest())*n),i=Math.floor(t.mercatorYfromLat(this.bounds.getNorth())*n),o=Math.ceil(t.mercatorXfromLng(this.bounds.getEast())*n),a=Math.ceil(t.mercatorYfromLat(this.bounds.getSouth())*n);return e.x>=r&&e.x<o&&e.y>=i&&e.y<a};var E=function(e){function n(n,r,i,o){if(e.call(this),this.id=n,this.dispatcher=i,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(r,["url","scheme","tileSize","promoteId"])),this._options=t.extend({type:"vector"},r),this._collectResourceTiming=r.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,r){e._tileJSONRequest=null,e._loaded=!0,n?e.fire(new t.ErrorEvent(n)):r&&(t.extend(e,r),r.bounds&&(e.tileBounds=new k(r.bounds,e.minzoom,e.maxzoom)),t.postTurnstileEvent(r.tiles,e.map._requestManager._customAccessToken),t.postMapLoadEvent(r.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 r=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme)),i={request:this.map._requestManager.transformRequest(r,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(r,i){return delete e.request,e.aborted?n(null):r&&404!==r.status?n(r):(i&&i.resourceTiming&&(e.resourceTiming=i.resourceTiming),this.map._refreshExpiredTiles&&i&&e.setExpiryData(i),e.loadVectorData(i,this.map.painter),t.cacheEntryPossiblyAdded(this.dispatcher),n(null),void(e.reloadCallback&&(this.loadTile(e,e.reloadCallback),e.reloadCallback=null)))}i.request.collectResourceTiming=this._collectResourceTiming,e.actor&&"expired"!==e.state?"loading"===e.state?e.reloadCallback=n:e.request=e.actor.send("reloadTile",i,o.bind(this)):(e.actor=this.dispatcher.getActor(),e.request=e.actor.send("loadTile",i,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,r,i,o){e.call(this),this.id=n,this.dispatcher=i,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"},r),t.extend(this,t.pick(r,["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,r){e._tileJSONRequest=null,e._loaded=!0,n?e.fire(new t.ErrorEvent(n)):r&&(t.extend(e,r),r.bounds&&(e.tileBounds=new k(r.bounds,e.minzoom,e.maxzoom)),t.postTurnstileEvent(r.tiles),t.postMapLoadEvent(r.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 r=this,i=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);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){r.map._refreshExpiredTiles&&e.setExpiryData(o),delete o.cacheControl,delete o.expires;var a=r.map.painter.context,s=a.gl;e.texture=r.map.painter.getTileTexture(o.width),e.texture?e.texture.update(o,{useMipmap:!0}):(e.texture=new t.Texture(a,o,s.RGBA,{useMipmap:!0}),e.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE,s.LINEAR_MIPMAP_NEAREST),a.extTextureFilterAnisotropic&&s.texParameterf(s.TEXTURE_2D,a.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,a.extTextureFilterAnisotropicMax)),e.state="loaded",t.cacheEntryPossiblyAdded(r.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),T=function(e){function n(n,r,i,o){e.call(this,n,r,i,o),this.type="raster-dem",this.maxzoom=22,this._options=t.extend({type:"raster-dem"},r),this.encoding=r.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 r=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);function i(t,r){t&&(e.state="errored",n(t)),r&&(e.dem=r,e.needsHillshadePrepare=!0,e.state="loaded",n(null))}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){this.map._refreshExpiredTiles&&e.setExpiryData(o),delete o.cacheControl,delete o.expires;var a=t.window.ImageBitmap&&o instanceof t.window.ImageBitmap&&t.offscreenCanvasSupported()?o:t.browser.getImageData(o,1),s={uid:e.uid,coord:e.tileID,source:this.id,rawImageData:a,encoding:this.encoding};e.actor&&"expired"!==e.state||(e.actor=this.dispatcher.getActor(),e.actor.send("loadDEMTile",s,i.bind(this)))}}.bind(this)),e.neighboringTiles=this._getNeighboringTiles(e.tileID)},n.prototype._getNeighboringTiles=function(e){var n=e.canonical,r=Math.pow(2,n.z),i=(n.x-1+r)%r,o=0===n.x?e.wrap-1:e.wrap,a=(n.x+1+r)%r,s=n.x+1===r?e.wrap+1:e.wrap,u={};return u[new t.OverscaledTileID(e.overscaledZ,o,n.z,i,n.y).key]={backfilled:!1},u[new t.OverscaledTileID(e.overscaledZ,s,n.z,a,n.y).key]={backfilled:!1},n.y>0&&(u[new t.OverscaledTileID(e.overscaledZ,o,n.z,i,n.y-1).key]={backfilled:!1},u[new t.OverscaledTileID(e.overscaledZ,e.wrap,n.z,n.x,n.y-1).key]={backfilled:!1},u[new t.OverscaledTileID(e.overscaledZ,s,n.z,a,n.y-1).key]={backfilled:!1}),n.y+1<r&&(u[new t.OverscaledTileID(e.overscaledZ,o,n.z,i,n.y+1).key]={backfilled:!1},u[new t.OverscaledTileID(e.overscaledZ,e.wrap,n.z,n.x,n.y+1).key]={backfilled:!1},u[new t.OverscaledTileID(e.overscaledZ,s,n.z,a,n.y+1).key]={backfilled:!1}),u},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),M=function(e){function n(n,r,i,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=i.getActor(),this.setEventedParent(o),this._data=r.data,this._options=t.extend({},r),this._collectResourceTiming=r.collectResourceTiming,this._resourceTiming=[],void 0!==r.maxzoom&&(this.maxzoom=r.maxzoom),r.type&&(this.type=r.type),r.attribution&&(this.attribution=r.attribution),this.promoteId=r.promoteId;var a=t.EXTENT/this.tileSize;this.workerOptions=t.extend({source:this.id,cluster:r.cluster||!1,geojsonVtOptions:{buffer:(void 0!==r.buffer?r.buffer:128)*a,tolerance:(void 0!==r.tolerance?r.tolerance:.375)*a,extent:t.EXTENT,maxZoom:this.maxzoom,lineMetrics:r.lineMetrics||!1,generateId:r.generateId||!1},superclusterOptions:{maxZoom:void 0!==r.clusterMaxZoom?Math.min(r.clusterMaxZoom,this.maxzoom-1):this.maxzoom-1,minPoints:Math.max(2,r.clusterMinPoints||2),extent:t.EXTENT,radius:(r.clusterRadius||50)*a,log:!1,generateId:r.generateId||!1},clusterProperties:r.clusterProperties,filter:r.filter},r.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 r={dataType:"source",sourceDataType:"metadata"};e._collectResourceTiming&&e._resourceTiming&&e._resourceTiming.length>0&&(r.resourceTiming=e._resourceTiming,e._resourceTiming=[]),e.fire(new t.Event("data",r))}}))},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 r={dataType:"source",sourceDataType:"content"};n._collectResourceTiming&&n._resourceTiming&&n._resourceTiming.length>0&&(r.resourceTiming=n._resourceTiming,n._resourceTiming=[]),n.fire(new t.Event("data",r))}})),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,r){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:e,offset:n},r),this},n.prototype._updateWorkerData=function(e){var n=this;this._loaded=!1;var r=t.extend({},this.workerOptions),i=this._data;"string"==typeof i?(r.request=this.map._requestManager.transformRequest(t.browser.resolveURL(i),t.ResourceType.Source),r.request.collectResourceTiming=this._collectResourceTiming):r.data=JSON.stringify(i),this.actor.send(this.type+".loadData",r,(function(t,i){n._removed||i&&i.abandoned||(n._loaded=!0,i&&i.resourceTiming&&i.resourceTiming[n.id]&&(n._resourceTiming=i.resourceTiming[n.id].slice(0)),n.actor.send(n.type+".coalesce",{source:r.source},null),e(t))}))},n.prototype.loaded=function(){return this._loaded},n.prototype.loadTile=function(e,n){var r=this,i=e.actor?"reloadTile":"loadTile";e.actor=this.actor,e.request=this.actor.send(i,{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,r.map.painter,"reloadTile"===i),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),I=t.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),P=function(e){function n(t,n,r,i){e.call(this),this.id=t,this.dispatcher=r,this.coordinates=n.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(i),this.options=n}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.load=function(e,n){var r=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(i,o){r._loaded=!0,i?r.fire(new t.ErrorEvent(i)):o&&(r.image=o,e&&(r.coordinates=e),n&&n(),r._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 r=e.map(t.MercatorCoordinate.fromLngLat);this.tileID=function(e){for(var n=1/0,r=1/0,i=-1/0,o=-1/0,a=0,s=e;a<s.length;a+=1){var u=s[a];n=Math.min(n,u.x),r=Math.min(r,u.y),i=Math.max(i,u.x),o=Math.max(o,u.y)}var l=Math.max(i-n,o-r),c=Math.max(0,Math.floor(-Math.log(l)/Math.LN2)),h=Math.pow(2,c);return new t.CanonicalTileID(c,Math.floor((n+i)/2*h),Math.floor((r+o)/2*h))}(r),this.minzoom=this.maxzoom=this.tileID.z;var i=r.map((function(t){return n.tileID.getTilePoint(t)._round()}));return this._boundsArray=new t.StructArrayLayout4i8,this._boundsArray.emplaceBack(i[0].x,i[0].y,0,0),this._boundsArray.emplaceBack(i[1].x,i[1].y,t.EXTENT,0),this._boundsArray.emplaceBack(i[3].x,i[3].y,0,t.EXTENT),this._boundsArray.emplaceBack(i[2].x,i[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 r in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,I.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 i=this.tiles[r];"loaded"!==i.state&&(i.state="loaded",i.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),Z=function(e){function n(t,n,r,i){e.call(this,t,n,r,i),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 r=0,i=n.urls;r<i.length;r+=1)this.urls.push(this.map._requestManager.transformRequest(i[r],t.ResourceType.Source).url);t.getVideo(this.urls,(function(n,r){e._loaded=!0,n?e.fire(new t.ErrorEvent(n)):r&&(e.video=r,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 r in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,I.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 i=this.tiles[r];"loaded"!==i.state&&(i.state="loaded",i.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}(P),D=function(e){function n(n,r,i,o){e.call(this,n,r,i,o),r.coordinates?Array.isArray(r.coordinates)&&4===r.coordinates.length&&!r.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"'))),r.animate&&"boolean"!=typeof r.animate&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+n,null,'optional "animate" property must be a boolean value'))),r.canvas?"string"==typeof r.canvas||r.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=r,this.animate=void 0===r.animate||r.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,r=n.gl;for(var i in this.boundsBuffer||(this.boundsBuffer=n.createVertexBuffer(this._boundsArray,I.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,r.RGBA,{premultiply:!0}),this.tiles){var o=this.tiles[i];"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}(P),L={vector:E,raster:S,"raster-dem":T,geojson:M,video:Z,image:P,canvas:D};function O(e,n){var r=t.identity([]);return t.translate(r,r,[1,1,0]),t.scale(r,r,[.5*e.width,.5*e.height,1]),t.multiply(r,r,e.calculatePosMatrix(n.toUnwrapped()))}function F(t,e,n,r,i,o){var a=function(t,e,n){if(t)for(var r=0,i=t;r<i.length;r+=1){var o=e[i[r]];if(o&&o.source===n&&"fill-extrusion"===o.type)return!0}else for(var a in e){var s=e[a];if(s.source===n&&"fill-extrusion"===s.type)return!0}return!1}(i&&i.layers,e,t.id),s=o.maxPitchScaleFactor(),u=t.tilesIn(r,s,a);u.sort(R);for(var l=[],c=0,h=u;c<h.length;c+=1){var f=h[c];l.push({wrappedTileID:f.tileID.wrapped().key,queryResults:f.tile.queryRenderedFeatures(e,n,t._state,f.queryGeometry,f.cameraQueryGeometry,f.scale,i,o,s,O(t.transform,f.tileID))})}var p=function(t){for(var e={},n={},r=0,i=t;r<i.length;r+=1){var o=i[r],a=o.queryResults,s=o.wrappedTileID,u=n[s]=n[s]||{};for(var l in a)for(var c=a[l],h=u[l]=u[l]||{},f=e[l]=e[l]||[],p=0,d=c;p<d.length;p+=1){var A=d[p];h[A.featureIndex]||(h[A.featureIndex]=!0,f.push(A))}}return e}(l);for(var d in p)p[d].forEach((function(e){var n=e.feature,r=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=r}));return p}function R(t,e){var n=t.tileID,r=e.tileID;return n.overscaledZ-r.overscaledZ||n.canonical.y-r.canonical.y||n.wrap-r.wrap||n.canonical.x-r.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 r=n[e];r.timeout&&clearTimeout(r.timeout),this.onRemove(r.value)}return this.data={},this.order=[],this},z.prototype.add=function(t,e,n){var r=this,i=t.wrapped().key;void 0===this.data[i]&&(this.data[i]=[]);var o={value:e,timeout:void 0};if(void 0!==n&&(o.timeout=setTimeout((function(){r.remove(t,o)}),n)),this.data[i].push(o),this.order.push(i),this.order.length>this.max){var a=this._getAndRemoveByKey(this.order[0]);a&&this.onRemove(a)}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,r=void 0===e?0:this.data[n].indexOf(e),i=this.data[n][r];return this.data[n].splice(r,1),i.timeout&&clearTimeout(i.timeout),0===this.data[n].length&&delete this.data[n],this.onRemove(i.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 r=0,i=this.data[n];r<i.length;r+=1){var o=i[r];t(o.value)||e.push(o)}for(var a=0,s=e;a<s.length;a+=1){var u=s[a];this.remove(u.value.tileID,u)}};var U=function(t,e,n){this.context=t;var r=t.gl;this.buffer=r.createBuffer(),this.dynamicDraw=Boolean(n),this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),r.bufferData(r.ELEMENT_ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?r.DYNAMIC_DRAW:r.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer};U.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},U.prototype.updateData=function(t){var e=this.context.gl;this.context.unbindVAO(),this.bind(),e.bufferSubData(e.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)},U.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"},G=function(t,e,n,r){this.length=e.length,this.attributes=n,this.itemSize=e.bytesPerElement,this.dynamicDraw=r,this.context=t;var i=t.gl;this.buffer=i.createBuffer(),t.bindVertexBuffer.set(this.buffer),i.bufferData(i.ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?i.DYNAMIC_DRAW:i.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer};G.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},G.prototype.updateData=function(t){var e=this.context.gl;this.bind(),e.bufferSubData(e.ARRAY_BUFFER,0,t.arrayBuffer)},G.prototype.enableAttributes=function(t,e){for(var n=0;n<this.attributes.length;n++){var r=e.attributes[this.attributes[n].name];void 0!==r&&t.enableVertexAttribArray(r)}},G.prototype.setVertexAttribPointers=function(t,e,n){for(var r=0;r<this.attributes.length;r++){var i=this.attributes[r],o=e.attributes[i.name];void 0!==o&&t.vertexAttribPointer(o,i.components,t[N[i.type]],!1,this.itemSize,i.offset+this.itemSize*(n||0))}},G.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),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 255},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.stencilMask(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{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),rt=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),it=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),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!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),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 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),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.CCW},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.frontFace(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 null},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.useProgram(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 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),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.bindFramebuffer(e.FRAMEBUFFER,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.bindRenderbuffer(e.RENDERBUFFER,t),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.bindTexture(e.TEXTURE_2D,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.bindBuffer(e.ARRAY_BUFFER,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 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),gt=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),mt=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),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!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,r){this.context=t,this.width=e,this.height=n;var i=this.framebuffer=t.gl.createFramebuffer();this.colorAttachment=new xt(t,i),r&&(this.depthAttachment=new wt(t,i))};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 kt=function(t,e,n,r,i,o){this.test=t,this.ref=e,this.mask=n,this.fail=r,this.depthFail=i,this.pass=o};kt.disabled=new kt({func:519,mask:0},0,0,7680,7680,7680);var Et=function(t,e,n){this.blendFunction=t,this.blendColor=e,this.mask=n};Et.disabled=new Et(Et.Replace=[1,0],t.Color.transparent,[!1,!1,!1,!1]),Et.unblended=new Et(Et.Replace,t.Color.transparent,[!0,!0,!0,!0]),Et.alphaBlended=new Et([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 Tt=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 q(this),this.stencilFunc=new K(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 rt(this),this.blendColor=new it(this),this.blendEquation=new ot(this),this.cullFace=new at(this),this.cullFaceSide=new st(this),this.frontFace=new ut(this),this.program=new lt(this),this.activeTexture=new ct(this),this.viewport=new ht(this),this.bindFramebuffer=new ft(this),this.bindRenderbuffer=new pt(this),this.bindTexture=new dt(this),this.bindVertexBuffer=new At(this),this.bindElementBuffer=new vt(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new gt(this),this.pixelStoreUnpack=new mt(this),this.pixelStoreUnpackPremultiplyAlpha=new yt(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)};Tt.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()},Tt.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},Tt.prototype.createIndexBuffer=function(t,e){return new U(this,t,e)},Tt.prototype.createVertexBuffer=function(t,e,n){return new G(this,t,e,n)},Tt.prototype.createRenderbuffer=function(t,e,n){var r=this.gl,i=r.createRenderbuffer();return this.bindRenderbuffer.set(i),r.renderbufferStorage(r.RENDERBUFFER,t,e,n),this.bindRenderbuffer.set(null),i},Tt.prototype.createFramebuffer=function(t,e,n){return new Ct(this,t,e,n)},Tt.prototype.clear=function(t){var e=t.color,n=t.depth,r=this.gl,i=0;e&&(i|=r.COLOR_BUFFER_BIT,this.clearColor.set(e),this.colorMask.set([!0,!0,!0,!0])),void 0!==n&&(i|=r.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(n),this.depthMask.set(!0)),r.clear(i)},Tt.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))},Tt.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)},Tt.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)},Tt.prototype.setColorMode=function(e){t.deepEqual(e.blendFunction,Et.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(e.blendFunction),this.blendColor.set(e.blendColor)),this.colorMask.set(e.mask)},Tt.prototype.unbindVAO=function(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)};var Mt=function(e){function n(n,r,i){var o=this;e.call(this),this.id=n,this.dispatcher=i,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,r,i){var o=new L[n.type](e,n,r,i);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,r,i,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(It).map((function(t){return t.key}))},n.prototype.getRenderableIds=function(e){var n=this,r=[];for(var i in this._tiles)this._isIdRenderable(i,e)&&r.push(this._tiles[i]);return e?r.sort((function(e,r){var i=e.tileID,o=r.tileID,a=new t.Point(i.canonical.x,i.canonical.y)._rotate(n.transform.angle),s=new t.Point(o.canonical.x,o.canonical.y)._rotate(n.transform.angle);return i.overscaledZ-o.overscaledZ||s.y-a.y||s.x-a.x})).map((function(t){return t.tileID.key})):r.map((function(t){return t.tileID})).sort(It).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,r,i){if(i)return e.state="errored",void(404!==i.status?this._source.fire(new t.ErrorEvent(i,{tile:e})):this.update(this.transform));e.timeAdded=t.browser.now(),"expired"===r&&(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 r=e[n];if(t.neighboringTiles&&t.neighboringTiles[r]){var i=this.getTileByID(r);o(t,i),o(i,t)}}function o(t,e){t.needsHillshadePrepare=!0;var n=e.tileID.canonical.x-t.tileID.canonical.x,r=e.tileID.canonical.y-t.tileID.canonical.y,i=Math.pow(2,t.tileID.canonical.z),o=e.tileID.key;0===n&&0===r||Math.abs(r)>1||(Math.abs(n)>1&&(1===Math.abs(n+i)?n+=i:1===Math.abs(n-i)&&(n-=i)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,n,r),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,r){for(var i in this._tiles){var o=this._tiles[i];if(!(r[i]||!o.hasData()||o.tileID.overscaledZ<=e||o.tileID.overscaledZ>n)){for(var a=o.tileID;o&&o.tileID.overscaledZ>e+1;){var s=o.tileID.scaledTo(o.tileID.overscaledZ-1);(o=this._tiles[s.key])&&o.hasData()&&(a=s)}for(var u=a;u.overscaledZ>e;)if(t[(u=u.scaledTo(u.overscaledZ-1)).key]){r[a.key]=a;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 r=t.overscaledZ-1;r>=e;r--){var i=t.scaledTo(r),o=this._getLoadedTile(i);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,r=Math.floor(e*n*5),i="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,r):r;this._cache.setMaxSize(i)},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 r in this._tiles){var i=this._tiles[r];i.tileID=i.tileID.unwrapTo(i.tileID.wrap+e),n[i.tileID.key]=i}for(var o in this._tiles=n,this._timers)clearTimeout(this._timers[o]),delete this._timers[o];for(var a in this._tiles)this._setTileReloadTimer(a,this._tiles[a])}},n.prototype.update=function(e){var r=this;if(this.transform=e,this._sourceLoaded&&!this._paused){var i;this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?i=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)})):(i=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&&(i=i.filter((function(t){return r._source.hasTile(t)})))):i=[];var o=e.coveringZoomLevel(this._source),a=Math.max(o-n.maxOverzooming,this._source.minzoom),s=Math.max(o+n.maxUnderzooming,this._source.minzoom),u=this._updateRetainedTiles(i,o);if(Pt(this._source.type)){for(var l={},c={},h=0,f=Object.keys(u);h<f.length;h+=1){var p=f[h],d=u[p],A=this._tiles[p];if(A&&!(A.fadeEndTime&&A.fadeEndTime<=t.browser.now())){var v=this.findLoadedParent(d,a);v&&(this._addTile(v.tileID),l[v.tileID.key]=v.tileID),c[p]=d}}for(var g in this._retainLoadedChildren(c,o,s,u),l)u[g]||(this._coveredTiles[g]=!0,u[g]=l[g])}for(var m in u)this._tiles[m].clearFadeHold();for(var y=0,_=t.keysDifference(this._tiles,u);y<_.length;y+=1){var b=_[y],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 r={},i={},o=Math.max(e-n.maxOverzooming,this._source.minzoom),a=Math.max(e+n.maxUnderzooming,this._source.minzoom),s={},u=0,l=t;u<l.length;u+=1){var c=l[u],h=this._addTile(c);r[c.key]=c,h.hasData()||e<this._source.maxzoom&&(s[c.key]=c)}this._retainLoadedChildren(s,e,a,r);for(var f=0,p=t;f<p.length;f+=1){var d=p[f],A=this._tiles[d.key];if(!A.hasData()){if(e+1>this._source.maxzoom){var v=d.children(this._source.maxzoom)[0],g=this.getTile(v);if(g&&g.hasData()){r[v.key]=v;continue}}else{var m=d.children(this._source.maxzoom);if(r[m[0].key]&&r[m[1].key]&&r[m[2].key]&&r[m[3].key])continue}for(var y=A.wasRequested(),_=d.overscaledZ-1;_>=o;--_){var b=d.scaledTo(_);if(i[b.key])break;if(i[b.key]=!0,!(A=this.getTile(b))&&y&&(A=this._addTile(b)),A&&(r[b.key]=b,y=A.wasRequested(),A.hasData()))break}}}return r},n.prototype._updateLoadedParentTileCache=function(){for(var t in this._loadedParentTiles={},this._tiles){for(var e=[],n=void 0,r=this._tiles[t].tileID;r.overscaledZ>0;){if(r.key in this._loadedParentTiles){n=this._loadedParentTiles[r.key];break}e.push(r.key);var i=r.scaledTo(r.overscaledZ-1);if(n=this._getLoadedTile(i))break;r=i}for(var o=0,a=e;o<a.length;o+=1)this._loadedParentTiles[a[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 r=Boolean(n);return r||(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,r||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 r=e.getExpiryTimeout();r&&(this._timers[t]=setTimeout((function(){n._reloadTile(t,"expired"),delete n._timers[t]}),r))},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,r){var i=this,o=[],a=this.transform;if(!a)return o;for(var s=r?a.getCameraQueryGeometry(e):e,u=e.map((function(t){return a.pointCoordinate(t)})),l=s.map((function(t){return a.pointCoordinate(t)})),c=this.getIds(),h=1/0,f=1/0,p=-1/0,d=-1/0,A=0,v=l;A<v.length;A+=1){var g=v[A];h=Math.min(h,g.x),f=Math.min(f,g.y),p=Math.max(p,g.x),d=Math.max(d,g.y)}for(var m=function(e){var r=i._tiles[c[e]];if(!r.holdingForFade()){var s=r.tileID,A=Math.pow(2,a.zoom-r.tileID.overscaledZ),v=n*r.queryPadding*t.EXTENT/r.tileSize/A,g=[s.getTilePoint(new t.MercatorCoordinate(h,f)),s.getTilePoint(new t.MercatorCoordinate(p,d))];if(g[0].x-v<t.EXTENT&&g[0].y-v<t.EXTENT&&g[1].x+v>=0&&g[1].y+v>=0){var m=u.map((function(t){return s.getTilePoint(t)})),y=l.map((function(t){return s.getTilePoint(t)}));o.push({tile:r,tileID:s,queryGeometry:m,cameraQueryGeometry:y,scale:A})}}},y=0;y<c.length;y++)m(y);return o},n.prototype.getVisibleCoordinates=function(t){for(var e=this,n=this.getRenderableIds(t).map((function(t){return e._tiles[t].tileID})),r=0,i=n;r<i.length;r+=1){var o=i[r];o.posMatrix=this.transform.calculatePosMatrix(o.toUnwrapped())}return n},n.prototype.hasTransition=function(){if(this._source.hasTransition())return!0;if(Pt(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 r=this._tiles[t];r&&r.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 It(t,e){var n=Math.abs(2*t.wrap)-+(t.wrap<0),r=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||r-n||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function Pt(t){return"raster"===t||"image"===t||"video"===t}function Zt(){return new t.window.Worker(qi.workerUrl)}Mt.maxOverzooming=10,Mt.maxUnderzooming=3;var Dt="mapboxgl_preloaded_worker_pool",Lt=function(){this.active={}};Lt.prototype.acquire=function(t){if(!this.workers)for(this.workers=[];this.workers.length<Lt.workerCount;)this.workers.push(new Zt);return this.active[t]=!0,this.workers.slice()},Lt.prototype.release=function(t){delete this.active[t],0===this.numActive()&&(this.workers.forEach((function(t){t.terminate()})),this.workers=null)},Lt.prototype.isPreloaded=function(){return!!this.active[Dt]},Lt.prototype.numActive=function(){return Object.keys(this.active).length};var Ot,Ft=Math.floor(t.browser.hardwareConcurrency/2);function Rt(){return Ot||(Ot=new Lt),Ot}function zt(e,n){var r={};for(var i in e)"ref"!==i&&(r[i]=e[i]);return t.refProperties.forEach((function(t){t in n&&(r[t]=n[t])})),r}function Ut(t){t=t.slice();for(var e=Object.create(null),n=0;n<t.length;n++)e[t[n].id]=t[n];for(var r=0;r<t.length;r++)"ref"in t[r]&&(t[r]=zt(t[r],e[t[r].ref]));return t}Lt.workerCount=Math.max(Math.min(Ft,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 Gt(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,r){jt(t,n,r),Gt(t,e,n)}function Ht(e,n,r){var i;for(i in e[r])if(e[r].hasOwnProperty(i)&&"data"!==i&&!t.deepEqual(e[r][i],n[r][i]))return!1;for(i in n[r])if(n[r].hasOwnProperty(i)&&"data"!==i&&!t.deepEqual(e[r][i],n[r][i]))return!1;return!0}function Jt(e,n,r,i,o,a){var s;for(s in n=n||{},e=e||{})e.hasOwnProperty(s)&&(t.deepEqual(e[s],n[s])||r.push({command:a,args:[i,s,n[s],o]}));for(s in n)n.hasOwnProperty(s)&&!e.hasOwnProperty(s)&&(t.deepEqual(e[s],n[s])||r.push({command:a,args:[i,s,n[s],o]}))}function Wt(t){return t.id}function Qt(t,e){return t[e.id]=e,t}var qt=function(t,e){this.reset(t,e)};qt.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},qt.prototype.lerp=function(e){if(1===this.points.length)return this.points[0];e=t.clamp(e,0,1);for(var n=1,r=this._distances[n],i=e*this.paddedLength+this.padding;r<i&&n<this._distances.length;)r=this._distances[++n];var o=n-1,a=this._distances[o],s=r-a,u=s>0?(i-a)/s:0;return this.points[o].mult(1-u).add(this.points[n].mult(u))};var Kt=function(t,e,n){var r=this.boxCells=[],i=this.circleCells=[];this.xCellCount=Math.ceil(t/n),this.yCellCount=Math.ceil(e/n);for(var o=0;o<this.xCellCount*this.yCellCount;o++)r.push([]),i.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,r,i,o){var a=t.create();return n?(t.scale(a,a,[1/o,1/o,1]),r||t.rotateZ(a,a,i.angle)):t.multiply(a,i.labelPlaneMatrix,e),a}function Yt(e,n,r,i,o){if(n){var a=t.clone(e);return t.scale(a,a,[o,o,1]),r||t.rotateZ(a,a,-i.angle),a}return i.glCoordMatrix}function $t(e,n){var r=[e.x,e.y,0,1];ce(r,r,n);var i=r[3];return{point:new t.Point(r[0]/i,r[1]/i),signedDistanceFromCamera:i}}function te(t,e){return.5+t/e*.5}function ee(t,e){var n=t[0]/t[3],r=t[1]/t[3];return n>=-e[0]&&n<=e[0]&&r>=-e[1]&&r<=e[1]}function ne(e,n,r,i,o,a,s,u){var l=i?e.textSizeData:e.iconSizeData,c=t.evaluateSizeForZoom(l,r.transform.zoom),h=[256/r.width*2+1,256/r.height*2+1],f=i?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;f.clear();for(var p=e.lineVertexArray,d=i?e.text.placedSymbolArray:e.icon.placedSymbolArray,A=r.transform.width/r.transform.height,v=!1,g=0;g<d.length;g++){var m=d.get(g);if(m.hidden||m.writingMode===t.WritingMode.vertical&&!v)le(m.numGlyphs,f);else{v=!1;var y=[m.anchorX,m.anchorY,0,1];if(t.transformMat4(y,y,n),ee(y,h)){var _=te(r.transform.cameraToCenterDistance,y[3]),b=t.evaluateSizeForFeature(l,c,m),x=s?b/_:b*_,w=new t.Point(m.anchorX,m.anchorY),C=$t(w,o).point,B={},k=oe(m,x,!1,u,n,o,a,e.glyphOffsetArray,p,f,C,w,B,A);v=k.useVertical,(k.notEnoughRoom||v||k.needsFlipping&&oe(m,x,!0,u,n,o,a,e.glyphOffsetArray,p,f,C,w,B,A).notEnoughRoom)&&le(m.numGlyphs,f)}else le(m.numGlyphs,f)}}i?e.text.dynamicLayoutVertexBuffer.updateData(f):e.icon.dynamicLayoutVertexBuffer.updateData(f)}function re(t,e,n,r,i,o,a,s,u,l,c){var h=s.glyphStartIndex+s.numGlyphs,f=s.lineStartIndex,p=s.lineStartIndex+s.lineLength,d=e.getoffsetX(s.glyphStartIndex),A=e.getoffsetX(h-1),v=se(t*d,n,r,i,o,a,s.segment,f,p,u,l,c);if(!v)return null;var g=se(t*A,n,r,i,o,a,s.segment,f,p,u,l,c);return g?{first:v,last:g}:null}function ie(e,n,r,i){return e===t.WritingMode.horizontal&&Math.abs(r.y-n.y)>Math.abs(r.x-n.x)*i?{useVertical:!0}:(e===t.WritingMode.vertical?n.y<r.y:n.x>r.x)?{needsFlipping:!0}:null}function oe(e,n,r,i,o,a,s,u,l,c,h,f,p,d){var A,v=n/24,g=e.lineOffsetX*v,m=e.lineOffsetY*v;if(e.numGlyphs>1){var y=e.glyphStartIndex+e.numGlyphs,_=e.lineStartIndex,b=e.lineStartIndex+e.lineLength,x=re(v,u,g,m,r,h,f,e,l,a,p);if(!x)return{notEnoughRoom:!0};var w=$t(x.first.point,s).point,C=$t(x.last.point,s).point;if(i&&!r){var B=ie(e.writingMode,w,C,d);if(B)return B}A=[x.first];for(var k=e.glyphStartIndex+1;k<y-1;k++)A.push(se(v*u.getoffsetX(k),g,m,r,h,f,e.segment,_,b,l,a,p));A.push(x.last)}else{if(i&&!r){var E=$t(f,o).point,S=e.lineStartIndex+e.segment+1,T=new t.Point(l.getx(S),l.gety(S)),M=$t(T,o),I=M.signedDistanceFromCamera>0?M.point:ae(f,T,E,1,o),P=ie(e.writingMode,E,I,d);if(P)return P}var Z=se(v*u.getoffsetX(e.glyphStartIndex),g,m,r,h,f,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,l,a,p);if(!Z)return{notEnoughRoom:!0};A=[Z]}for(var D=0,L=A;D<L.length;D+=1){var O=L[D];t.addDynamicAttributes(c,O.point,O.angle)}return{}}function ae(t,e,n,r,i){var o=$t(t.add(t.sub(e)._unit()),i).point,a=n.sub(o);return n.add(a._mult(r/a.mag()))}function se(e,n,r,i,o,a,s,u,l,c,h,f){var p=i?e-n:e+n,d=p>0?1:-1,A=0;i&&(d*=-1,A=Math.PI),d<0&&(A+=Math.PI);for(var v=d>0?u+s:u+s+1,g=o,m=o,y=0,_=0,b=Math.abs(p),x=[];y+_<=b;){if((v+=d)<u||v>=l)return null;if(m=g,x.push(g),void 0===(g=f[v])){var w=new t.Point(c.getx(v),c.gety(v)),C=$t(w,h);if(C.signedDistanceFromCamera>0)g=f[v]=C.point;else{var B=v-d;g=ae(0===y?a:new t.Point(c.getx(B),c.gety(B)),w,m,b-y+1,h)}}y+=_,_=m.dist(g)}var k=(b-y)/_,E=g.sub(m),S=E.mult(k)._add(m);S._add(E._unit()._perp()._mult(r*d));var T=A+Math.atan2(g.y-m.y,g.x-m.x);return x.push(S),{point:S,angle:T,path:x}}Kt.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Kt.prototype.insert=function(t,e,n,r,i){this._forEachCell(e,n,r,i,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(n),this.bboxes.push(r),this.bboxes.push(i)},Kt.prototype.insertCircle=function(t,e,n,r){this._forEachCell(e-r,n-r,e+r,n+r,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(e),this.circles.push(n),this.circles.push(r)},Kt.prototype._insertBoxCell=function(t,e,n,r,i,o){this.boxCells[i].push(o)},Kt.prototype._insertCircleCell=function(t,e,n,r,i,o){this.circleCells[i].push(o)},Kt.prototype._query=function(t,e,n,r,i,o){if(n<0||t>this.width||r<0||e>this.height)return!i&&[];var a=[];if(t<=0&&e<=0&&this.width<=n&&this.height<=r){if(i)return!0;for(var s=0;s<this.boxKeys.length;s++)a.push({key:this.boxKeys[s],x1:this.bboxes[4*s],y1:this.bboxes[4*s+1],x2:this.bboxes[4*s+2],y2:this.bboxes[4*s+3]});for(var u=0;u<this.circleKeys.length;u++){var l=this.circles[3*u],c=this.circles[3*u+1],h=this.circles[3*u+2];a.push({key:this.circleKeys[u],x1:l-h,y1:c-h,x2:l+h,y2:c+h})}return o?a.filter(o):a}return this._forEachCell(t,e,n,r,this._queryCell,a,{hitTest:i,seenUids:{box:{},circle:{}}},o),i?a.length>0:a},Kt.prototype._queryCircle=function(t,e,n,r,i){var o=t-n,a=t+n,s=e-n,u=e+n;if(a<0||o>this.width||u<0||s>this.height)return!r&&[];var l=[];return this._forEachCell(o,s,a,u,this._queryCellCircle,l,{hitTest:r,circle:{x:t,y:e,radius:n},seenUids:{box:{},circle:{}}},i),r?l.length>0:l},Kt.prototype.query=function(t,e,n,r,i){return this._query(t,e,n,r,!1,i)},Kt.prototype.hitTest=function(t,e,n,r,i){return this._query(t,e,n,r,!0,i)},Kt.prototype.hitTestCircle=function(t,e,n,r){return this._queryCircle(t,e,n,!0,r)},Kt.prototype._queryCell=function(t,e,n,r,i,o,a,s){var u=a.seenUids,l=this.boxCells[i];if(null!==l)for(var c=this.bboxes,h=0,f=l;h<f.length;h+=1){var p=f[h];if(!u.box[p]){u.box[p]=!0;var d=4*p;if(t<=c[d+2]&&e<=c[d+3]&&n>=c[d+0]&&r>=c[d+1]&&(!s||s(this.boxKeys[p]))){if(a.hitTest)return o.push(!0),!0;o.push({key:this.boxKeys[p],x1:c[d],y1:c[d+1],x2:c[d+2],y2:c[d+3]})}}}var A=this.circleCells[i];if(null!==A)for(var v=this.circles,g=0,m=A;g<m.length;g+=1){var y=m[g];if(!u.circle[y]){u.circle[y]=!0;var _=3*y;if(this._circleAndRectCollide(v[_],v[_+1],v[_+2],t,e,n,r)&&(!s||s(this.circleKeys[y]))){if(a.hitTest)return o.push(!0),!0;var b=v[_],x=v[_+1],w=v[_+2];o.push({key:this.circleKeys[y],x1:b-w,y1:x-w,x2:b+w,y2:x+w})}}}},Kt.prototype._queryCellCircle=function(t,e,n,r,i,o,a,s){var u=a.circle,l=a.seenUids,c=this.boxCells[i];if(null!==c)for(var h=this.bboxes,f=0,p=c;f<p.length;f+=1){var d=p[f];if(!l.box[d]){l.box[d]=!0;var A=4*d;if(this._circleAndRectCollide(u.x,u.y,u.radius,h[A+0],h[A+1],h[A+2],h[A+3])&&(!s||s(this.boxKeys[d])))return o.push(!0),!0}}var v=this.circleCells[i];if(null!==v)for(var g=this.circles,m=0,y=v;m<y.length;m+=1){var _=y[m];if(!l.circle[_]){l.circle[_]=!0;var b=3*_;if(this._circlesCollide(g[b],g[b+1],g[b+2],u.x,u.y,u.radius)&&(!s||s(this.circleKeys[_])))return o.push(!0),!0}}},Kt.prototype._forEachCell=function(t,e,n,r,i,o,a,s){for(var u=this._convertToXCellCoord(t),l=this._convertToYCellCoord(e),c=this._convertToXCellCoord(n),h=this._convertToYCellCoord(r),f=u;f<=c;f++)for(var p=l;p<=h;p++)if(i.call(this,t,e,n,r,this.xCellCount*p+f,o,a,s))return},Kt.prototype._convertToXCellCoord=function(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))},Kt.prototype._convertToYCellCoord=function(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))},Kt.prototype._circlesCollide=function(t,e,n,r,i,o){var a=r-t,s=i-e,u=n+o;return u*u>a*a+s*s},Kt.prototype._circleAndRectCollide=function(t,e,n,r,i,o,a){var s=(o-r)/2,u=Math.abs(t-(r+s));if(u>s+n)return!1;var l=(a-i)/2,c=Math.abs(e-(i+l));if(c>l+n)return!1;if(u<=s||c<=l)return!0;var h=u-s,f=c-l;return h*h+f*f<=n*n};var ue=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function le(t,e){for(var n=0;n<t;n++){var r=e.length;e.resize(r+4),e.float32.set(ue,3*r)}}function ce(t,e,n){var r=e[0],i=e[1];return t[0]=n[0]*r+n[4]*i+n[12],t[1]=n[1]*r+n[5]*i+n[13],t[3]=n[3]*r+n[7]*i+n[15],t}var he=function(t,e,n){void 0===e&&(e=new Kt(t.width+200,t.height+200,25)),void 0===n&&(n=new Kt(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 fe(e,n,r){return n*(t.EXTENT/(e.tileSize*Math.pow(2,r-e.tileID.overscaledZ)))}he.prototype.placeCollisionBox=function(t,e,n,r,i){var o=this.projectAndGetPerspectiveRatio(r,t.anchorPointX,t.anchorPointY),a=n*o.perspectiveRatio,s=t.x1*a+o.point.x,u=t.y1*a+o.point.y,l=t.x2*a+o.point.x,c=t.y2*a+o.point.y;return!this.isInsideGrid(s,u,l,c)||!e&&this.grid.hitTest(s,u,l,c,i)?{box:[],offscreen:!1}:{box:[s,u,l,c],offscreen:this.isOffscreen(s,u,l,c)}},he.prototype.placeCollisionCircles=function(e,n,r,i,o,a,s,u,l,c,h,f,p){var d=[],A=new t.Point(n.anchorX,n.anchorY),v=$t(A,a),g=te(this.transform.cameraToCenterDistance,v.signedDistanceFromCamera),m=(c?o/g:o*g)/t.ONE_EM,y=$t(A,s).point,_=re(m,i,n.lineOffsetX*m,n.lineOffsetY*m,!1,y,A,n,r,s,{}),b=!1,x=!1,w=!0;if(_){for(var C=.5*f*g+p,B=new t.Point(-100,-100),k=new t.Point(this.screenRightBoundary,this.screenBottomBoundary),E=new qt,S=_.first,T=_.last,M=[],I=S.path.length-1;I>=1;I--)M.push(S.path[I]);for(var P=1;P<T.path.length;P++)M.push(T.path[P]);var Z=2.5*C;if(u){var D=M.map((function(t){return $t(t,u)}));M=D.some((function(t){return t.signedDistanceFromCamera<=0}))?[]:D.map((function(t){return t.point}))}var L=[];if(M.length>0){for(var O=M[0].clone(),F=M[0].clone(),R=1;R<M.length;R++)O.x=Math.min(O.x,M[R].x),O.y=Math.min(O.y,M[R].y),F.x=Math.max(F.x,M[R].x),F.y=Math.max(F.y,M[R].y);L=O.x>=B.x&&F.x<=k.x&&O.y>=B.y&&F.y<=k.y?[M]:F.x<B.x||O.x>k.x||F.y<B.y||O.y>k.y?[]:t.clipLine([M],B.x,B.y,k.x,k.y)}for(var z=0,U=L;z<U.length;z+=1){var N;E.reset(U[z],.25*C),N=E.length<=.5*C?1:Math.ceil(E.paddedLength/Z)+1;for(var G=0;G<N;G++){var j=G/Math.max(N-1,1),V=E.lerp(j),H=V.x+100,J=V.y+100;d.push(H,J,C,0);var W=H-C,Q=J-C,q=H+C,K=J+C;if(w=w&&this.isOffscreen(W,Q,q,K),x=x||this.isInsideGrid(W,Q,q,K),!e&&this.grid.hitTestCircle(H,J,C,h)&&(b=!0,!l))return{circles:[],offscreen:!1,collisionDetected:b}}}}return{circles:!l&&b||!x?[]:d,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=[],r=1/0,i=1/0,o=-1/0,a=-1/0,s=0,u=e;s<u.length;s+=1){var l=u[s],c=new t.Point(l.x+100,l.y+100);r=Math.min(r,c.x),i=Math.min(i,c.y),o=Math.max(o,c.x),a=Math.max(a,c.y),n.push(c)}for(var h={},f={},p=0,d=this.grid.query(r,i,o,a).concat(this.ignoredGrid.query(r,i,o,a));p<d.length;p+=1){var A=d[p],v=A.key;if(void 0===h[v.bucketInstanceId]&&(h[v.bucketInstanceId]={}),!h[v.bucketInstanceId][v.featureIndex]){var g=[new t.Point(A.x1,A.y1),new t.Point(A.x2,A.y1),new t.Point(A.x2,A.y2),new t.Point(A.x1,A.y2)];t.polygonIntersectsPolygon(n,g)&&(h[v.bucketInstanceId][v.featureIndex]=!0,void 0===f[v.bucketInstanceId]&&(f[v.bucketInstanceId]=[]),f[v.bucketInstanceId].push(v.featureIndex))}}return f},he.prototype.insertCollisionBox=function(t,e,n,r,i){(e?this.ignoredGrid:this.grid).insert({bucketInstanceId:n,featureIndex:r,collisionGroupID:i},t[0],t[1],t[2],t[3])},he.prototype.insertCollisionCircles=function(t,e,n,r,i){for(var o=e?this.ignoredGrid:this.grid,a={bucketInstanceId:n,featureIndex:r,collisionGroupID:i},s=0;s<t.length;s+=4)o.insertCircle(a,t[s],t[s+1],t[s+2])},he.prototype.projectAndGetPerspectiveRatio=function(e,n,r){var i=[n,r,0,1];return ce(i,i,e),{point:new t.Point((i[0]/i[3]+1)/2*this.transform.width+100,(-i[1]/i[3]+1)/2*this.transform.height+100),perspectiveRatio:.5+this.transform.cameraToCenterDistance/i[3]*.5}},he.prototype.isOffscreen=function(t,e,n,r){return n<100||t>=this.screenRightBoundary||r<100||e>this.screenBottomBoundary},he.prototype.isInsideGrid=function(t,e,n,r){return n>=0&&t<this.gridRightBoundary&&r>=0&&e<this.gridBottomBoundary},he.prototype.getViewportMatrix=function(){var e=t.identity([]);return t.translate(e,e,[-100,-100,0]),e};var pe=function(t,e,n,r){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?e:-e))):r&&n?1:0,this.placed=n};pe.prototype.isHidden=function(){return 0===this.opacity&&!this.placed};var de=function(t,e,n,r,i){this.text=new pe(t?t.text:null,e,n,i),this.icon=new pe(t?t.icon:null,e,r,i)};de.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var Ae=function(t,e,n){this.text=t,this.icon=e,this.skipFade=n},ve=function(){this.invProjMatrix=t.create(),this.viewportMatrix=t.create(),this.circles=[]},ge=function(t,e,n,r,i){this.bucketInstanceId=t,this.featureIndex=e,this.sourceLayerIndex=n,this.bucketIndex=r,this.tileID=i},me=function(t){this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={}};function ye(e,n,r,i,o){var a=t.getAnchorAlignment(e),s=-(a.horizontalAlign-.5)*n,u=-(a.verticalAlign-.5)*r,l=t.evaluateVariableOffset(e,i);return new t.Point(s+l[0]*o,u+l[1]*o)}function _e(e,n,r,i,o,a){var s=e.x1,u=e.x2,l=e.y1,c=e.y2,h=e.anchorPointX,f=e.anchorPointY,p=new t.Point(n,r);return i&&p._rotate(o?a:-a),{x1:s+p.x,y1:l+p.y,x2:u+p.x,y2:c+p.y,anchorPointX:h,anchorPointY:f}}me.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,r){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 me(n),this.collisionCircleArrays={},this.prevPlacement=r,r&&(r.prevPlacement=void 0),this.placedOrientations={}};function xe(t,e,n,r,i){t.emplaceBack(e?1:0,n?1:0,r||0,i||0),t.emplaceBack(e?1:0,n?1:0,r||0,i||0),t.emplaceBack(e?1:0,n?1:0,r||0,i||0),t.emplaceBack(e?1:0,n?1:0,r||0,i||0)}be.prototype.getBucketParts=function(e,n,r,i){var o=r.getBucket(n),a=r.latestFeatureIndex;if(o&&a&&n.id===o.layerIds[0]){var s=r.collisionBoxArray,u=o.layers[0].layout,l=Math.pow(2,this.transform.zoom-r.tileID.overscaledZ),c=r.tileSize/t.EXTENT,h=this.transform.calculatePosMatrix(r.tileID.toUnwrapped()),f="map"===u.get("text-pitch-alignment"),p="map"===u.get("text-rotation-alignment"),d=fe(r,1,this.transform.zoom),A=Xt(h,f,p,this.transform,d),v=null;if(f){var g=Yt(h,f,p,this.transform,d);v=t.multiply([],this.transform.labelPlaneMatrix,g)}this.retainedQueryData[o.bucketInstanceId]=new ge(o.bucketInstanceId,a,o.sourceLayerIndex,o.index,r.tileID);var m={bucket:o,layout:u,posMatrix:h,textLabelPlaneMatrix:A,labelToScreenMatrix:v,scale:l,textPixelRatio:c,holdingForFade:r.holdingForFade(),collisionBoxArray:s,partiallyEvaluatedTextSize:t.evaluateSizeForZoom(o.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(o.sourceID)};if(i)for(var y=0,_=o.sortKeyRanges;y<_.length;y+=1){var b=_[y];e.push({sortKey:b.sortKey,symbolInstanceStart:b.symbolInstanceStart,symbolInstanceEnd:b.symbolInstanceEnd,parameters:m})}else e.push({symbolInstanceStart:0,symbolInstanceEnd:o.symbolInstances.length,parameters:m})}},be.prototype.attemptAnchorPlacement=function(t,e,n,r,i,o,a,s,u,l,c,h,f,p,d){var A,v=[h.textOffset0,h.textOffset1],g=ye(t,n,r,v,i),m=this.collisionIndex.placeCollisionBox(_e(e,g.x,g.y,o,a,this.transform.angle),c,s,u,l.predicate);if(!d||0!==this.collisionIndex.placeCollisionBox(_e(d,g.x,g.y,o,a,this.transform.angle),c,s,u,l.predicate).box.length)return m.box.length>0?(this.prevPlacement&&this.prevPlacement.variableOffsets[h.crossTileID]&&this.prevPlacement.placements[h.crossTileID]&&this.prevPlacement.placements[h.crossTileID].text&&(A=this.prevPlacement.variableOffsets[h.crossTileID].anchor),this.variableOffsets[h.crossTileID]={textOffset:v,width:n,height:r,anchor:t,textBoxScale:i,prevAnchor:A},this.markUsedJustification(f,t,h,p),f.allowVerticalPlacement&&(this.markUsedOrientation(f,p,h),this.placedOrientations[h.crossTileID]=p),{shift:g,placedGlyphBoxes:m}):void 0},be.prototype.placeLayerBucketPart=function(e,n,r){var i=this,o=e.parameters,a=o.bucket,s=o.layout,u=o.posMatrix,l=o.textLabelPlaneMatrix,c=o.labelToScreenMatrix,h=o.textPixelRatio,f=o.holdingForFade,p=o.collisionBoxArray,d=o.partiallyEvaluatedTextSize,A=o.collisionGroup,v=s.get("text-optional"),g=s.get("icon-optional"),m=s.get("text-allow-overlap"),y=s.get("icon-allow-overlap"),_="map"===s.get("text-rotation-alignment"),b="map"===s.get("text-pitch-alignment"),x="none"!==s.get("icon-text-fit"),w="viewport-y"===s.get("symbol-z-order"),C=m&&(y||!a.hasIconData()||g),B=y&&(m||!a.hasTextData()||v);!a.collisionArrays&&p&&a.deserializeCollisionBoxes(p);var k=function(e,o){if(!n[e.crossTileID])if(f)i.placements[e.crossTileID]=new Ae(!1,!1,!1);else{var p,w=!1,k=!1,E=!0,S=null,T={box:null,offscreen:null},M={box:null,offscreen:null},I=null,P=null,Z=0,D=0,L=0;o.textFeatureIndex?Z=o.textFeatureIndex:e.useRuntimeCollisionCircles&&(Z=e.featureIndex),o.verticalTextFeatureIndex&&(D=o.verticalTextFeatureIndex);var O=o.textBox;if(O){var F=function(n){var r=t.WritingMode.horizontal;if(a.allowVerticalPlacement&&!n&&i.prevPlacement){var o=i.prevPlacement.placedOrientations[e.crossTileID];o&&(i.placedOrientations[e.crossTileID]=o,i.markUsedOrientation(a,r=o,e))}return r},R=function(n,r){if(a.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&o.verticalTextBox)for(var i=0,s=a.writingModes;i<s.length&&(s[i]===t.WritingMode.vertical?(T=r(),M=T):T=n(),!(T&&T.box&&T.box.length));i+=1);else T=n()};if(s.get("text-variable-anchor")){var z=s.get("text-variable-anchor");if(i.prevPlacement&&i.prevPlacement.variableOffsets[e.crossTileID]){var U=i.prevPlacement.variableOffsets[e.crossTileID];z.indexOf(U.anchor)>0&&(z=z.filter((function(t){return t!==U.anchor}))).unshift(U.anchor)}var N=function(t,n,r){for(var o=t.x2-t.x1,s=t.y2-t.y1,l=e.textBoxScale,c=x&&!y?n:null,f={box:[],offscreen:!1},p=m?2*z.length:z.length,d=0;d<p;++d){var v=i.attemptAnchorPlacement(z[d%z.length],t,o,s,l,_,b,h,u,A,d>=z.length,e,a,r,c);if(v&&(f=v.placedGlyphBoxes)&&f.box&&f.box.length){w=!0,S=v.shift;break}}return f};R((function(){return N(O,o.iconBox,t.WritingMode.horizontal)}),(function(){var n=o.verticalTextBox;return a.allowVerticalPlacement&&!(T&&T.box&&T.box.length)&&e.numVerticalGlyphVertices>0&&n?N(n,o.verticalIconBox,t.WritingMode.vertical):{box:null,offscreen:null}})),T&&(w=T.box,E=T.offscreen);var G=F(T&&T.box);if(!w&&i.prevPlacement){var j=i.prevPlacement.variableOffsets[e.crossTileID];j&&(i.variableOffsets[e.crossTileID]=j,i.markUsedJustification(a,j.anchor,e,G))}}else{var V=function(t,n){var r=i.collisionIndex.placeCollisionBox(t,m,h,u,A.predicate);return r&&r.box&&r.box.length&&(i.markUsedOrientation(a,n,e),i.placedOrientations[e.crossTileID]=n),r};R((function(){return V(O,t.WritingMode.horizontal)}),(function(){var n=o.verticalTextBox;return a.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&n?V(n,t.WritingMode.vertical):{box:null,offscreen:null}})),F(T&&T.box&&T.box.length)}}if(w=(p=T)&&p.box&&p.box.length>0,E=p&&p.offscreen,e.useRuntimeCollisionCircles){var H=a.text.placedSymbolArray.get(e.centerJustifiedTextSymbolIndex),J=t.evaluateSizeForFeature(a.textSizeData,d,H),W=s.get("text-padding");I=i.collisionIndex.placeCollisionCircles(m,H,a.lineVertexArray,a.glyphOffsetArray,J,u,l,c,r,b,A.predicate,e.collisionCircleDiameter,W),w=m||I.circles.length>0&&!I.collisionDetected,E=E&&I.offscreen}if(o.iconFeatureIndex&&(L=o.iconFeatureIndex),o.iconBox){var Q=function(t){var e=x&&S?_e(t,S.x,S.y,_,b,i.transform.angle):t;return i.collisionIndex.placeCollisionBox(e,y,h,u,A.predicate)};k=M&&M.box&&M.box.length&&o.verticalIconBox?(P=Q(o.verticalIconBox)).box.length>0:(P=Q(o.iconBox)).box.length>0,E=E&&P.offscreen}var q=v||0===e.numHorizontalGlyphVertices&&0===e.numVerticalGlyphVertices,K=g||0===e.numIconVertices;if(q||K?K?q||(k=k&&w):w=k&&w:k=w=k&&w,w&&p&&p.box&&i.collisionIndex.insertCollisionBox(p.box,s.get("text-ignore-placement"),a.bucketInstanceId,M&&M.box&&D?D:Z,A.ID),k&&P&&i.collisionIndex.insertCollisionBox(P.box,s.get("icon-ignore-placement"),a.bucketInstanceId,L,A.ID),I&&(w&&i.collisionIndex.insertCollisionCircles(I.circles,s.get("text-ignore-placement"),a.bucketInstanceId,Z,A.ID),r)){var X=a.bucketInstanceId,Y=i.collisionCircleArrays[X];void 0===Y&&(Y=i.collisionCircleArrays[X]=new ve);for(var $=0;$<I.circles.length;$+=4)Y.circles.push(I.circles[$+0]),Y.circles.push(I.circles[$+1]),Y.circles.push(I.circles[$+2]),Y.circles.push(I.collisionDetected?1:0)}i.placements[e.crossTileID]=new Ae(w||C,k||B,E||a.justReloaded),n[e.crossTileID]=!0}};if(w)for(var E=a.getSortedSymbolIndexes(this.transform.angle),S=E.length-1;S>=0;--S){var T=E[S];k(a.symbolInstances.get(T),a.collisionArrays[T])}else for(var M=e.symbolInstanceStart;M<e.symbolInstanceEnd;M++)k(a.symbolInstances.get(M),a.collisionArrays[M]);if(r&&a.bucketInstanceId in this.collisionCircleArrays){var I=this.collisionCircleArrays[a.bucketInstanceId];t.invert(I.invProjMatrix,u),I.viewportMatrix=this.collisionIndex.getViewportMatrix()}a.justReloaded=!1},be.prototype.markUsedJustification=function(e,n,r,i){var o;o=i===t.WritingMode.vertical?r.verticalPlacedTextSymbolIndex:{left:r.leftJustifiedTextSymbolIndex,center:r.centerJustifiedTextSymbolIndex,right:r.rightJustifiedTextSymbolIndex}[t.getAnchorJustification(n)];for(var a=0,s=[r.leftJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.rightJustifiedTextSymbolIndex,r.verticalPlacedTextSymbolIndex];a<s.length;a+=1){var u=s[a];u>=0&&(e.text.placedSymbolArray.get(u).crossTileID=o>=0&&u!==o?0:r.crossTileID)}},be.prototype.markUsedOrientation=function(e,n,r){for(var i=n===t.WritingMode.horizontal||n===t.WritingMode.horizontalOnly?n:0,o=n===t.WritingMode.vertical?n:0,a=0,s=[r.leftJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.rightJustifiedTextSymbolIndex];a<s.length;a+=1)e.text.placedSymbolArray.get(s[a]).placedOrientation=i;r.verticalPlacedTextSymbolIndex&&(e.text.placedSymbolArray.get(r.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 r=e?e.symbolFadeChange(t):1,i=e?e.opacities:{},o=e?e.variableOffsets:{},a=e?e.placedOrientations:{};for(var s in this.placements){var u=this.placements[s],l=i[s];l?(this.opacities[s]=new de(l,r,u.text,u.icon),n=n||u.text!==l.text.placed||u.icon!==l.icon.placed):(this.opacities[s]=new de(null,r,u.text,u.icon,u.skipFade),n=n||u.text||u.icon)}for(var c in i){var h=i[c];if(!this.opacities[c]){var f=new de(h,r,!1,!1);f.isHidden()||(this.opacities[c]=f,n=n||h.text.placed||h.icon.placed)}}for(var p in o)this.variableOffsets[p]||!this.opacities[p]||this.opacities[p].isHidden()||(this.variableOffsets[p]=o[p]);for(var d in a)this.placedOrientations[d]||!this.opacities[d]||this.opacities[d].isHidden()||(this.placedOrientations[d]=a[d]);n?this.lastPlacementChangeTime=t:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=e?e.lastPlacementChangeTime:t)},be.prototype.updateLayerOpacities=function(t,e){for(var n={},r=0,i=e;r<i.length;r+=1){var o=i[r],a=o.getBucket(t);a&&o.latestFeatureIndex&&t.id===a.layerIds[0]&&this.updateBucketOpacities(a,n,o.collisionBoxArray)}},be.prototype.updateBucketOpacities=function(e,n,r){var i=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,a=new de(null,0,!1,!1,!0),s=o.get("text-allow-overlap"),u=o.get("icon-allow-overlap"),l=o.get("text-variable-anchor"),c="map"===o.get("text-rotation-alignment"),h="map"===o.get("text-pitch-alignment"),f="none"!==o.get("icon-text-fit"),p=new de(null,0,s&&(u||!e.hasIconData()||o.get("icon-optional")),u&&(s||!e.hasTextData()||o.get("text-optional")),!0);!e.collisionArrays&&r&&(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData())&&e.deserializeCollisionBoxes(r);for(var d=function(t,e,n){for(var r=0;r<e/4;r++)t.opacityVertexArray.emplaceBack(n)},A=function(r){var o=e.symbolInstances.get(r),s=o.numHorizontalGlyphVertices,u=o.numVerticalGlyphVertices,A=o.crossTileID,v=i.opacities[A];n[A]?v=a:v||(i.opacities[A]=v=p),n[A]=!0;var g=o.numIconVertices>0,m=i.placedOrientations[o.crossTileID],y=m===t.WritingMode.vertical,_=m===t.WritingMode.horizontal||m===t.WritingMode.horizontalOnly;if(s>0||u>0){var b=Me(v.text);d(e.text,s,y?Ie:b),d(e.text,u,_?Ie:b);var x=v.text.isHidden();[o.rightJustifiedTextSymbolIndex,o.centerJustifiedTextSymbolIndex,o.leftJustifiedTextSymbolIndex].forEach((function(t){t>=0&&(e.text.placedSymbolArray.get(t).hidden=x||y?1:0)})),o.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(o.verticalPlacedTextSymbolIndex).hidden=x||_?1:0);var w=i.variableOffsets[o.crossTileID];w&&i.markUsedJustification(e,w.anchor,o,m);var C=i.placedOrientations[o.crossTileID];C&&(i.markUsedJustification(e,"left",o,C),i.markUsedOrientation(e,C,o))}if(g){var B=Me(v.icon),k=!(f&&o.verticalPlacedIconSymbolIndex&&y);o.placedIconSymbolIndex>=0&&(d(e.icon,o.numIconVertices,k?B:Ie),e.icon.placedSymbolArray.get(o.placedIconSymbolIndex).hidden=v.icon.isHidden()),o.verticalPlacedIconSymbolIndex>=0&&(d(e.icon,o.numVerticalIconVertices,k?Ie:B),e.icon.placedSymbolArray.get(o.verticalPlacedIconSymbolIndex).hidden=v.icon.isHidden())}if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){var E=e.collisionArrays[r];if(E){var S=new t.Point(0,0);if(E.textBox||E.verticalTextBox){var T=!0;if(l){var M=i.variableOffsets[A];M?(S=ye(M.anchor,M.width,M.height,M.textOffset,M.textBoxScale),c&&S._rotate(h?i.transform.angle:-i.transform.angle)):T=!1}E.textBox&&xe(e.textCollisionBox.collisionVertexArray,v.text.placed,!T||y,S.x,S.y),E.verticalTextBox&&xe(e.textCollisionBox.collisionVertexArray,v.text.placed,!T||_,S.x,S.y)}var I=Boolean(!_&&E.verticalIconBox);E.iconBox&&xe(e.iconCollisionBox.collisionVertexArray,v.icon.placed,I,f?S.x:0,f?S.y:0),E.verticalIconBox&&xe(e.iconCollisionBox.collisionVertexArray,v.icon.placed,!I,f?S.x:0,f?S.y:0)}}},v=0;v<e.symbolInstances.length;v++)A(v);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 g=this.collisionCircleArrays[e.bucketInstanceId];e.placementInvProjMatrix=g.invProjMatrix,e.placementViewportMatrix=g.viewportMatrix,e.collisionCircleArray=g.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),ke=Math.pow(2,16),Ee=Math.pow(2,9),Se=Math.pow(2,8),Te=Math.pow(2,1);function Me(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*ke+n*Ee+e*Se+n*Te+e}var Ie=0,Pe=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=[]};Pe.prototype.continuePlacement=function(t,e,n,r,i){for(var o=this._bucketParts;this._currentTileIndex<t.length;)if(e.getBucketParts(o,r,t[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,i())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++,i())return!0;return!1};var Ze=function(t,e,n,r,i,o,a){this.placement=new be(t,i,o,a),this._currentPlacementIndex=e.length-1,this._forceFullPlacement=n,this._showCollisionBoxes=r,this._done=!1};Ze.prototype.isDone=function(){return this._done},Ze.prototype.continuePlacement=function(e,n,r){for(var i=this,o=t.browser.now(),a=function(){var e=t.browser.now()-o;return!i._forceFullPlacement&&e>2};this._currentPlacementIndex>=0;){var s=n[e[this._currentPlacementIndex]],u=this.placement.collisionIndex.transform.zoom;if("symbol"===s.type&&(!s.minzoom||s.minzoom<=u)&&(!s.maxzoom||s.maxzoom>u)){if(this._inProgressLayer||(this._inProgressLayer=new Pe(s)),this._inProgressLayer.continuePlacement(r[s.source],this.placement,this._showCollisionBoxes,s,a))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},Ze.prototype.commit=function(t){return this.placement.commit(t),this.placement};var De=512/t.EXTENT/2,Le=function(t,e,n){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=n;for(var r=0;r<e.length;r++){var i=e.get(r),o=i.key;this.indexedSymbolInstances[o]||(this.indexedSymbolInstances[o]=[]),this.indexedSymbolInstances[o].push({crossTileID:i.crossTileID,coord:this.getScaledCoordinates(i,t)})}};Le.prototype.getScaledCoordinates=function(e,n){var r=De/Math.pow(2,n.canonical.z-this.tileID.canonical.z);return{x:Math.floor((n.canonical.x*t.EXTENT+e.anchorX)*r),y:Math.floor((n.canonical.y*t.EXTENT+e.anchorY)*r)}},Le.prototype.findMatches=function(t,e,n){for(var r=this.tileID.canonical.z<e.canonical.z?1:Math.pow(2,this.tileID.canonical.z-e.canonical.z),i=0;i<t.length;i++){var o=t.get(i);if(!o.crossTileID){var a=this.indexedSymbolInstances[o.key];if(a)for(var s=this.getScaledCoordinates(o,e),u=0,l=a;u<l.length;u+=1){var c=l[u];if(Math.abs(c.coord.x-s.x)<=r&&Math.abs(c.coord.y-s.y)<=r&&!n[c.crossTileID]){n[c.crossTileID]=!0,o.crossTileID=c.crossTileID;break}}}}};var Oe=function(){this.maxCrossTileID=0};Oe.prototype.generate=function(){return++this.maxCrossTileID};var Fe=function(){this.indexes={},this.usedCrossTileIDs={},this.lng=0};Fe.prototype.handleWrapJump=function(t){var e=Math.round((t-this.lng)/360);if(0!==e)for(var n in this.indexes){var r=this.indexes[n],i={};for(var o in r){var a=r[o];a.tileID=a.tileID.unwrapTo(a.tileID.wrap+e),i[a.tileID.key]=a}this.indexes[n]=i}this.lng=t},Fe.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 r=0;r<e.symbolInstances.length;r++)e.symbolInstances.get(r).crossTileID=0;this.usedCrossTileIDs[t.overscaledZ]||(this.usedCrossTileIDs[t.overscaledZ]={});var i=this.usedCrossTileIDs[t.overscaledZ];for(var o in this.indexes){var a=this.indexes[o];if(Number(o)>t.overscaledZ)for(var s in a){var u=a[s];u.tileID.isChildOf(t)&&u.findMatches(e.symbolInstances,t,i)}else{var l=a[t.scaledTo(Number(o)).key];l&&l.findMatches(e.symbolInstances,t,i)}}for(var c=0;c<e.symbolInstances.length;c++){var h=e.symbolInstances.get(c);h.crossTileID||(h.crossTileID=n.generate(),i[h.crossTileID]=!0)}return void 0===this.indexes[t.overscaledZ]&&(this.indexes[t.overscaledZ]={}),this.indexes[t.overscaledZ][t.key]=new Le(t,e.symbolInstances,e.bucketInstanceId),!0},Fe.prototype.removeBucketCrossTileIDs=function(t,e){for(var n in e.indexedSymbolInstances)for(var r=0,i=e.indexedSymbolInstances[n];r<i.length;r+=1)delete this.usedCrossTileIDs[t][i[r].crossTileID]},Fe.prototype.removeStaleBuckets=function(t){var e=!1;for(var n in this.indexes){var r=this.indexes[n];for(var i in r)t[r[i].bucketInstanceId]||(this.removeBucketCrossTileIDs(n,r[i]),delete r[i],e=!0)}return e};var Re=function(){this.layerIndexes={},this.crossTileIDs=new Oe,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}};Re.prototype.addLayer=function(t,e,n){var r=this.layerIndexes[t.id];void 0===r&&(r=this.layerIndexes[t.id]=new Fe);var i=!1,o={};r.handleWrapJump(n);for(var a=0,s=e;a<s.length;a+=1){var u=s[a],l=u.getBucket(t);l&&t.id===l.layerIds[0]&&(l.bucketInstanceId||(l.bucketInstanceId=++this.maxBucketInstanceId),r.addBucket(u.tileID,l,this.crossTileIDs)&&(i=!0),o[l.bucketInstanceId]=!0)}return r.removeStaleBuckets(o)&&(i=!0),i},Re.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})))},Ue=t.pick(Nt,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),Ne=t.pick(Nt,["setCenter","setZoom","setBearing","setP
2itch"]),Ge=function(){var e={},n=t.styleSpec.$version;for(var r in t.styleSpec.$root){var i,o=t.styleSpec.$root[r];o.required&&null!=(i="version"===r?n:"array"===o.type?[]:{})&&(e[r]=i)}return e}(),je=function(e){function n(r,i){var o=this;void 0===i&&(i={}),e.call(this),this.map=r,this.dispatcher=new C(Rt(),this),this.imageManager=new f,this.imageManager.setEventedParent(this),this.glyphManager=new y(r._requestManager,i.localIdeographFontFamily),this.lineAtlas=new w(256,512),this.crossTileSymbolIndex=new Re,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 a=this;this._rtlTextPluginCallback=n.registerForPluginStateChange((function(e){a.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 r in a.sourceCaches)a.sourceCaches[r].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 r in o._layers){var i=o._layers[r];i.source===n.id&&o._validateLayer(i)}}}}))}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.loadURL=function(e,n){var r=this;void 0===n&&(n={}),this.fire(new t.Event("dataloading",{dataType:"style"}));var i="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){r._request=null,e?r.fire(new t.ErrorEvent(e)):n&&r._load(n,i)}))},n.prototype.loadJSON=function(e,n){var r=this;void 0===n&&(n={}),this.fire(new t.Event("dataloading",{dataType:"style"})),this._request=t.browser.frame((function(){r._request=null,r._load(e,!1!==n.validate)}))},n.prototype.loadEmpty=function(){this.fire(new t.Event("dataloading",{dataType:"style"})),this._load(Ge,!1)},n.prototype._load=function(e,n){if(!n||!ze(this,t.validateStyle(e))){for(var r in this._loaded=!0,this.stylesheet=e,e.sources)this.addSource(r,e.sources[r],{validate:!1});e.sprite?this._loadSprite(e.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(e.glyphs);var i=Ut(this.stylesheet.layers);this._order=i.map((function(t){return t.id})),this._layers={},this._serializedLayers={};for(var o=0,a=i;o<a.length;o+=1){var s=a[o];(s=t.createStyleLayer(s)).setEventedParent(this,{layer:{id:s.id}}),this._layers[s.id]=s,this._serializedLayers[s.id]=s.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,r){var i,o,a,s=t.browser.devicePixelRatio>1?"@2x":"",u=t.getJSON(n.transformRequest(n.normalizeSpriteURL(e,s,".json"),t.ResourceType.SpriteJSON),(function(t,e){u=null,a||(a=t,i=e,c())})),l=t.getImage(n.transformRequest(n.normalizeSpriteURL(e,s,".png"),t.ResourceType.SpriteImage),(function(t,e){l=null,a||(a=t,o=e,c())}));function c(){if(a)r(a);else if(i&&o){var e=t.browser.getImageData(o),n={};for(var s in i){var u=i[s],l=u.width,c=u.height,h=u.x,f=u.y,p=u.sdf,d=u.pixelRatio,A=u.stretchX,v=u.stretchY,g=u.content,m=new t.RGBAImage({width:l,height:c});t.RGBAImage.copy(e,m,{x:h,y:f},{x:0,y:0},{width:l,height:c}),n[s]={data:m,pixelRatio:d,sdf:p,stretchX:A,stretchY:v,content:g}}r(null,n)}}return{cancel:function(){u&&(u.cancel(),u=null),l&&(l.cancel(),l=null)}}}(e,this.map._requestManager,(function(e,r){if(n._spriteRequest=null,e)n.fire(new t.ErrorEvent(e));else if(r)for(var i in r)n.imageManager.addImage(i,r[i]);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 r=e.sourceLayer;if(r){var i=n.getSource();
vendor: 8,708 bytes, line 2
2("geojson"===i.type||i.vectorLayerIds&&-1===i.vectorLayerIds.indexOf(r))&&this.fire(new t.ErrorEvent(new Error('Source layer "'+r+'" does not exist on source "'+i.id+'" as specified by style layer "'+e.id+'"')))}}},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,r=t;n<r.length;n+=1){var i=this._layers[r[n]];"custom"!==i.type&&e.push(i.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 r=Object.keys(this._updatedLayers),i=Object.keys(this._removedLayers);for(var o in(r.length||i.length)&&this._updateWorkerLayers(r,i),this._updatedSources){var a=this._updatedSources[o];"reload"===a?this._reloadSource(o):"clear"===a&&this._clearSource(o)}for(var s in this._updateTilesForChangedImages(),this._updatedPaintProps)this._layers[s].updateTransitions(e);this.light.updateTransitions(e),this._resetUpdates()}var u={};for(var l in this.sourceCaches){var c=this.sourceCaches[l];u[l]=c.used,c.used=!1}for(var h=0,f=this._order;h<f.length;h+=1){var p=this._layers[f[h]];p.recalculate(e,this._availableImages),!p.isHidden(e.zoom)&&p.source&&(this.sourceCaches[p.source].used=!0)}for(var d in u){var A=this.sourceCaches[d];u[d]!==A.used&&A.fire(new t.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:d}))}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=Ut(e.layers);var r=function(e,n){if(!e)return[{command:Nt.setStyle,args:[n]}];var r=[];try{if(!t.deepEqual(e.version,n.version))return[{command:Nt.setStyle,args:[n]}];t.deepEqual(e.center,n.center)||r.push({command:Nt.setCenter,args:[n.center]}),t.deepEqual(e.zoom,n.zoom)||r.push({command:Nt.setZoom,args:[n.zoom]}),t.deepEqual(e.bearing,n.bearing)||r.push({command:Nt.setBearing,args:[n.bearing]}),t.deepEqual(e.pitch,n.pitch)||r.push({command:Nt.setPitch,args:[n.pitch]}),t.deepEqual(e.sprite,n.sprite)||r.push({command:Nt.setSprite,args:[n.sprite]}),t.deepEqual(e.glyphs,n.glyphs)||r.push({command:Nt.setGlyphs,args:[n.glyphs]}),t.deepEqual(e.transition,n.transition)||r.push({command:Nt.setTransition,args:[n.transition]}),t.deepEqual(e.light,n.light)||r.push({command:Nt.setLight,args:[n.light]});var i={},o=[];!function(e,n,r,i){var o;for(o in n=n||{},e=e||{})e.hasOwnProperty(o)&&(n.hasOwnProperty(o)||jt(o,r,i));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)?r.push({command:Nt.setGeoJSONSourceData,args:[o,n[o].data]}):Vt(o,n,r,i)):Gt(o,n,r))}(e.sources,n.sources,o,i);var a=[];e.layers&&e.layers.forEach((function(t){i[t.source]?r.push({command:Nt.removeLayer,args:[t.id]}):a.push(t)})),r=r.concat(o),function(e,n,r){n=n||[];var i,o,a,s,u,l,c,h=(e=e||[]).map(Wt),f=n.map(Wt),p=e.reduce(Qt,{}),d=n.reduce(Qt,{}),A=h.slice(),v=Object.create(null);for(i=0,o=0;i<h.length;i++)d.hasOwnProperty(a=h[i])?o++:(r.push({command:Nt.removeLayer,args:[a]}),A.splice(A.indexOf(a,o),1));for(i=0,o=0;i<f.length;i++)A[A.length-1-i]!==(a=f[f.length-1-i])&&(p.hasOwnProperty(a)?(r.push({command:Nt.removeLayer,args:[a]}),A.splice(A.lastIndexOf(a,A.length-o),1)):o++,r.push({command:Nt.addLayer,args:[d[a],l=A[A.length-i]]}),A.splice(A.length-i,0,a),v[a]=!0);for(i=0;i<f.length;i++)if(s=p[a=f[i]],u=d[a],!v[a]&&!t.deepEqual(s,u))if(t.deepEqual(s.source,u.source)&&t.deepEqual(s["source-layer"],u["source-layer"])&&t.deepEqual(s.type,u.type)){for(c in Jt(s.layout,u.layout,r,a,null,Nt.setLayoutProperty),Jt(s.paint,u.paint,r,a,null,Nt.setPaintProperty),t.deepEqual(s.filter,u.filter)||r.push({command:Nt.setFilter,args:[a,u.filter]}),t.deepEqual(s.minzoom,u.minzoom)&&t.deepEqual(s.maxzoom,u.maxzoom)||r.push({command:Nt.setLayerZoomRange,args:[a,u.minzoom,u.maxzoom]}),s)s.hasOwnProperty(c)&&"layout"!==c&&"paint"!==c&&"filter"!==c&&"metadata"!==c&&"minzoom"!==c&&"maxzoom"!==c&&(0===c.indexOf("paint.")?Jt(s[c],u[c],r,a,c.slice(6),Nt.setPaintProperty):t.deepEqual(s[c],u[c])||r.push({command:Nt.setLayerProperty,args:[a,c,u[c]]}));for(c in u)u.hasOwnProperty(c)&&!s.hasOwnProperty(c)&&"layout"!==c&&"paint"!==c&&"filter"!==c&&"metadata"!==c&&"minzoom"!==c&&"maxzoom"!==c&&(0===c.indexOf("paint.")?Jt(s[c],u[c],r,a,c.slice(6),Nt.setPaintProperty):t.deepEqual(s[c],u[c])||r.push({command:Nt.setLayerProperty,args:[a,c,u[c]]}))}else r.push({command:Nt.removeLayer,args:[a]}),l=A[A.lastIndexOf(a)+1],r.push({command:Nt.addLayer,args:[u,l]})}(a,n.layers,r)}catch(t){console.warn("Unable to compute style diff:",t),r=[{command:Nt.setStyle,args:[n]}]}return r}(this.serialize(),e).filter((function(t){return!(t.command in Ne)}));if(0===r.length)return!1;var i=r.filter((function(t){return!(t.command in Ue)}));if(i.length>0)throw new Error("Unimplemented: "+i.map((function(t){return t.command})).join(", ")+".");return r.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,r){var i=this;if(void 0===r&&(r={}),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,r))){this.map&&this.map._collectResourceTiming&&(n.collectResourceTiming=!0);var o=this.sourceCaches[e]=new Mt(e,n,this.dispatcher);o.style=this,o.setEventedParent(this,(function(){return{isSourceLoaded:i.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 r=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],r.fire(new t.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),r.setEventedParent(null),r.clearTiles(),r.onRemove&&r.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,r){void 0===r&&(r={}),this._checkLoaded();var i=e.id;if(this.getLayer(i))this.fire(new t.ErrorEvent(new Error('Layer with i
2d "'+i+'" 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(i,e.source),e=t.clone$1(e),e=t.extend(e,{source:i})),this._validate(t.validateStyle.layer,"layers."+i,e,{arrayIndex:-1},r))return;o=t.createStyleLayer(e),this._validateLayer(o),o.setEventedParent(this,{layer:{id:i}}),this._serializedLayers[o.id]=o.serialize()}var a=n?this._order.indexOf(n):this._order.length;if(n&&-1===a)this.fire(new t.ErrorEvent(new Error('Layer with id "'+n+'" does not exist on this map.')));else{if(this._order.splice(a,0,i),this._layerOrderChanged=!0,this._layers[i]=o,this._removedLayers[i]&&o.source&&"custom"!==o.type){var s=this._removedLayers[i];delete this._removedLayers[i],s.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 r=this._order.indexOf(e);this._order.splice(r,1);var i=n?this._order.indexOf(n):this._order.length;
vendor: 13,287 bytes, line 2
2n&&-1===i?this.fire(new t.ErrorEvent(new Error('Layer with id "'+n+'" does not exist on this map.'))):(this._order.splice(i,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 r=this._order.indexOf(e);this._order.splice(r,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,r){this._checkLoaded();var i=this.getLayer(e);i?i.minzoom===n&&i.maxzoom===r||(null!=n&&(i.minzoom=n),null!=r&&(i.maxzoom=r),this._updateLayer(i)):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,r){void 0===r&&(r={}),this._checkLoaded();var i=this.getLayer(e);if(i){if(!t.deepEqual(i.filter,n))return null==n?(i.filter=void 0,void this._updateLayer(i)):void(this._validate(t.validateStyle.filter,"layers."+i.id+".filter",n,null,r)||(i.filter=t.clone$1(n),this._updateLayer(i)))}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,r,i){void 0===i&&(i={}),this._checkLoaded();var o=this.getLayer(e);o?t.deepEqual(o.getLayoutProperty(n),r)||(o.setLayoutProperty(n,r,i),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 r=this.getLayer(e);if(r)return r.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,r,i){void 0===i&&(i={}),this._checkLoaded();var o=this.getLayer(e);o?t.deepEqual(o.getPaintProperty(n),r)||(o.setPaintProperty(n,r,i)&&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 r=e.source,i=e.sourceLayer,o=this.sourceCaches[r];if(void 0!==o){var a=o.getSource().type;"geojson"===a&&i?this.fire(new t.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==a||i?(void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),o.setFeatureState(i,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 '"+r+"' does not exist in the map's style.")))},n.prototype.removeFeatureState=function(e,n){this._checkLoaded();var r=e.source,i=this.sourceCaches[r];if(void 0!==i){var o=i.getSource().type,a="vector"===o?e.sourceLayer:void 0;"vector"!==o||a?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."))):i.removeFeatureState(a,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 '"+r+"' does not exist in the map's style.")))},n.prototype.getFeatureState=function(e){this._checkLoaded();var n=e.source,r=e.sourceLayer,i=this.sourceCaches[n];if(void 0!==i){if("vector"!==i.getSource().type||r)return void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),i.getFeatureState(r,e.id);this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+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},r={},i=[],o=this._order.length-1;o>=0;o--){var a=this._order[o];if(n(a)){r[a]=o;for(var s=0,u=t;s<u.length;s+=1){var l=u[s][a];if(l)for(var c=0,h=l;c<h.length;c+=1)i.push(h[c])}}}i.sort((function(t,e){return e.intersectionZ-t.intersectionZ}));for(var f=[],p=this._order.length-1;p>=0;p--){var d=this._order[p];if(n(d))for(var A=i.length-1;A>=0;A--){var v=i[A].feature;if(r[v.layer.id]<p)break;f.push(v),i.pop()}else for(var g=0,m=t;g<m.length;g+=1){var y=m[g][d];if(y)for(var _=0,b=y;_<b.length;_+=1)f.push(b[_].feature)}}return f},n.prototype.queryRenderedFeatures=function(e,n,r){n&&n.filter&&this._validate(t.validateStyle.filter,"queryRenderedFeatures.filter",n.filter,null,n);var i={};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,a=n.layers;o<a.length;o+=1){var s=a[o],u=this._layers[s];if(!u)return this.fire(new t.ErrorEvent(new Error("The layer '"+s+"' does not exist in the map's style and cannot be queried for features."))),[];i[u.source]=!0}}var l=[];for(var c in n.availableImages=this._availableImages,this.sourceCaches)n.layers&&!i[c]||l.push(F(this.sourceCaches[c],this._layers,this._serializedLayers,e,n,r));return this.placement&&l.push(function(t,e,n,r,i,o,a){for(var s={},u=o.queryRenderedSymbols(r),l=[],c=0,h=Object.keys(u).map(Number);c<h.length;c+=1)l.push(a[h[c]]);l.sort(R);for(var f=function(){var n=d[p],r=n.featureIndex.lookupSymbolFeatures(u[n.bucketInstanceId],e,n.bucketIndex,n.sourceLayerIndex,i.filter,i.layers,i.availableImages,t);for(var o in r){var a=s[o]=s[o]||[],l=r[o];l.sort((function(t,e){var r=n.featureSortOrder;if(r){var i=r.indexOf(t.featureIndex);return r.indexOf(e.featureIndex)-i}return e.featureIndex-t.featureIndex}));for(var c=0,h=l;c<h.length;c+=1)a.push(h[c])}},p=0,d=l;p<d.length;p+=1)f();var A=function(e){s[e].forEach((function(r){var i=r.feature,o=n[t[e].source].getFeatureState(i.layer["source-layer"],i.id);i.source=i.layer.source,i.layer["source-layer"]&&(i.sourceLayer=i.layer["source-layer"]),i.state=o}))};for(var v in s)A(v);return s}(this._layers,this._serializedLayers,this.sourceCaches,e,n,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(l)},n.prototype.querySourceFeatures=function(e,n){n&&n.filter&&this._validate(t.validateStyle.filter,"querySourceFeatures.filter",n.filter,null,n);var r=this.sourceCaches[e];return r?function(t,e){for(var n=t.getRenderableIds().map((function(e){return t.getTileByID(e)})),r=[],i={},o=0;o<n.length;o++){var a=n[o],s=a.tileID.canonical.key;i[s]||(i[s]=!0,a.querySourceFeatures(r,e))}return r}(r,n):[]},n.prototype.addSourceType=function(t,e,r){return n.getSourceType(t)?r(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},r):r(null,null))},n.prototype.getLight=function(){return this.light.getLight()},n.prototype.setLight=function(e,n){void 0===n&&(n={}),this._checkLoaded();var r=this.light.getLight(),i=!1;for(var o in e)if(!t.deepEqual(e[o],r[o])){i=!0;break}if(i){var a={now:t.browser.now(),transition:t.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(e,n),this.light.updateTransitions(a)}},n.prototype._validate=function(e,n,r,i,o){return void 0===o&&(o={}),(!o||!1!==o.validate)&&ze(this,e.call(t.validateStyle,t.extend({key:n,style:this.serialize(),value:r,styleSpec:t.styleSpec},i)))},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,r,i,o){void 0===o&&(o=!1);for(var a=!1,s=!1,u={},l=0,c=this._order;l<c.length;l+=1){var h=this._layers[c[l]];if("symbol"===h.type){if(!u[h.source]){var f=this.sourceCaches[h.source];u[h.source]=f.getRenderableIds(!0).map((function(t){return f.getTileByID(t)})).sort((function(t,e){return e.tileID.overscaledZ-t.tileID.overscaledZ||(t.tileID.isLessThan(e.tileID)?-1:1)}))}var p=this.crossTileSymbolIndex.addLayer(h,u[h.source],e.center.lng);a=a||p}}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((o=o||this._layerOrderChanged||0===r)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(t.browser.now(),e.zoom))&&(this.pauseablePlacement=new Ze(e,this._order,o,n,r,i,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,u),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(t.browser.now()),s=!0),a&&this.pauseablePlacement.placement.setStale()),s||a)for(var d=0,A=this._order;d<A.length;d+=1){var v=this._layers[A[d]];"symbol"===v.type&&this.placement.updateLayerOpacities(v,u[v.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 r=this.sourceCaches[e.source];r&&r.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,r){return t.makeRequest(n,r)},n}(t.Evented);je.getSourceType=function(t){return L[t]},je.setSourceType=function(t,e){L[t]=e},je.registerForPluginStateChange=t.registerForPluginStateChange;var Ve=t.createLayout([{name:"a_pos",type:"Int16",components:2}]),He=mn("#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);
2return (tile_units_to_pixels*pos+offset)/pattern_size;}"),Je=mn("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=mn("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=mn("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);}"),qe=mn("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);}"),Ke=mn("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=mn("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=mn("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=mn("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=mn("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=mn("#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=mn("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=mn("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=mn("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);}"),an=mn("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+=amb
2ientlight;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;}"),sn=mn("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;}"),un=mn("#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;}"),ln=mn("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;
2\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;}"),cn=mn("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=mn("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);}"),fn=mn("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;}"),pn=mn("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;
2uniform 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);}"),dn=mn("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;}"),An=mn("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));}"),vn=mn("#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);}"),gn=mn("#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;
2gl_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 mn(t,e){var n=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,r=e.match(/attribute ([\w]+) ([\w]+)/g),i=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),o=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),a=o?o.concat(i):i,s={};return{fragmentSource:t=t.replace(n,(function(t,e,n,r,i){return s[i]=!0,"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nvarying "+n+" "+r+" "+i+";\n#else\nuniform "+n+" "+r+" u_"+i+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+i+"\n    "+n+" "+r+" "+i+" = u_"+i+";\n#endif\n"})),vertexSource:e=e.replace(n,(function(t,e,n,r,i){var o="float"===r?"vec2":"vec4",a=i.match(/color/)?"color":o;return s[i]?"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nuniform lowp float u_"+i+"_t;\nattribute "+n+" "+o+" a_"+i+";\nvarying "+n+" "+r+" "+i+";\n#else\nuniform "+n+" "+r+" u_"+i+";\n#endif\n":"vec4"===a?"\n#ifndef HAS_UNIFORM_u_"+i+"\n    "+i+" = a_"+i+";\n#else\n    "+n+" "+r+" "+i+" = u_"+i+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+i+"\n    "+i+" = unpack_mix_"+a+"(a_"+i+", u_"+i+"_t);\n#else\n    "+n+" "+r+" "+i+" = u_"+i+";\n#endif\n":"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nuniform lowp float u_"+i+"_t;\nattribute "+n+" "+o+" a_"+i+";\n#else\nuniform "+n+" "+r+" u_"+i+";\n#endif\n":"vec4"===a?"\n#ifndef HAS_UNIFORM_u_"+i+"\n    "+n+" "+r+" "+i+" = a_"+i+";\n#else\n    "+n+" "+r+" "+i+" = u_"+i+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+i+"\n    "+n+" "+r+" "+i+" = unpack_mix_"+a+"(a_"+i+", u_"+i+"_t);\n#else\n    "+n+" "+r+" "+i+" = u_"+i+";\n#endif\n"})),staticAttributes:r,staticUniforms:a}}var yn=Object.freeze({__proto__:null,prelude:He,background:Je,backgroundPattern:We,circle:Qe,clippingMask:qe,heatmap:Ke,heatmapTexture:Xe,collisionBox:Ye,collisionCircle:$e,debug:tn,fill:en,fillOutline:nn,fillOutlinePattern:rn,fillPattern:on,fillExtrusion:an,fillExtrusionPattern:sn,hillshadePrepare:un,hillshade:ln,line:cn,lineGradient:hn,linePattern:fn,lineSDF:pn,raster:dn,symbolIcon:An,symbolSDF:vn,symbolTextAndIcon:gn}),_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 r=t[n].split(" ");e.push(r.pop())}return e}_n.prototype.bind=function(t,e,n,r,i,o,a,s){this.context=t;for(var u=this.boundPaintVertexBuffers.length!==r.length,l=0;!u&&l<r.length;l++)this.boundPaintVertexBuffers[l]!==r[l]&&(u=!0);t.extVertexArrayObject&&this.vao&&this.boundProgram===e&&this.boundLayoutVertexBuffer===n&&!u&&this.boundIndexBuffer===i&&this.boundVertexOffset===o&&this.boundDynamicVertexBuffer===a&&this.boundDynamicVertexBuffer2===s?(t.bindVertexArrayOES.set(this.vao),a&&a.bind(),i&&i.dynamicDraw&&i.bind(),s&&s.bind()):this.freshBind(e,n,r,i,o,a,s)}
vendor: 11,326 bytes, line 2
2,_n.prototype.freshBind=function(t,e,n,r,i,o,a){var s,u=t.numAttributes,l=this.context,c=l.gl;if(l.extVertexArrayObject)this.vao&&this.destroy(),this.vao=l.extVertexArrayObject.createVertexArrayOES(),l.bindVertexArrayOES.set(this.vao),s=0,this.boundProgram=t,this.boundLayoutVertexBuffer=e,this.boundPaintVertexBuffers=n,this.boundIndexBuffer=r,this.boundVertexOffset=i,this.boundDynamicVertexBuffer=o,this.boundDynamicVertexBuffer2=a;else{s=l.currentNumAttributes||0;for(var h=u;h<s;h++)c.disableVertexAttribArray(h)}e.enableAttributes(c,t);for(var f=0,p=n;f<p.length;f+=1)p[f].enableAttributes(c,t);o&&o.enableAttributes(c,t),a&&a.enableAttributes(c,t),e.bind(),e.setVertexAttribPointers(c,t,i);for(var d=0,A=n;d<A.length;d+=1){var v=A[d];v.bind(),v.setVertexAttribPointers(c,t,i)}o&&(o.bind(),o.setVertexAttribPointers(c,t,i)),r&&r.bind(),a&&(a.bind(),a.setVertexAttribPointers(c,t,i)),l.currentNumAttributes=u},_n.prototype.destroy=function(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)};var xn=function(t,e,n,r,i,o){var a=t.gl;this.program=a.createProgram();for(var s=bn(n.staticAttributes),u=r?r.getBinderAttributes():[],l=s.concat(u),c=n.staticUniforms?bn(n.staticUniforms):[],h=r?r.getBinderUniforms():[],f=[],p=0,d=c.concat(h);p<d.length;p+=1){var A=d[p];f.indexOf(A)<0&&f.push(A)}var v=r?r.defines():[];o&&v.push("#define OVERDRAW_INSPECTOR;");var g=v.concat(He.fragmentSource,n.fragmentSource).join("\n"),m=v.concat(He.vertexSource,n.vertexSource).join("\n"),y=a.createShader(a.FRAGMENT_SHADER);if(a.isContextLost())this.failedToCreate=!0;else{a.shaderSource(y,g),a.compileShader(y),a.attachShader(this.program,y);var _=a.createShader(a.VERTEX_SHADER);if(a.isContextLost())this.failedToCreate=!0;else{a.shaderSource(_,m),a.compileShader(_),a.attachShader(this.program,_),this.attributes={};var b={};this.numAttributes=l.length;for(var x=0;x<this.numAttributes;x++)l[x]&&(a.bindAttribLocation(this.program,x,l[x]),this.attributes[l[x]]=x);a.linkProgram(this.program),a.deleteShader(_),a.deleteShader(y);for(var w=0;w<f.length;w++){var C=f[w];if(C&&!b[C]){var B=a.getUniformLocation(this.program,C);B&&(b[C]=B)}}this.fixedUniforms=i(t,b),this.binderUniforms=r?r.getUniforms(t,b):[]}}};function wn(t,e,n){var r=1/fe(n,1,e.transform.tileZoom),i=Math.pow(2,n.tileID.overscaledZ),o=n.tileSize*Math.pow(2,e.transform.tileZoom)/i,a=o*(n.tileID.canonical.x+n.tileID.wrap*i),s=o*n.tileID.canonical.y;return{u_image:0,u_texsize:n.imageAtlasTexture.size,u_scale:[r,t.fromScale,t.toScale],u_fade:t.t,u_pixel_coord_upper:[a>>16,s>>16],u_pixel_coord_lower:[65535&a,65535&s]}}xn.prototype.draw=function(t,e,n,r,i,o,a,s,u,l,c,h,f,p,d,A){var v,g=t.gl;if(!this.failedToCreate){for(var m in t.program.set(this.program),t.setDepthMode(n),t.setStencilMode(r),t.setColorMode(i),t.setCullFace(o),this.fixedUniforms)this.fixedUniforms[m].set(a[m]);p&&p.setUniforms(t,this.binderUniforms,h,{zoom:f});for(var y=(v={},v[g.LINES]=2,v[g.TRIANGLES]=3,v[g.LINE_STRIP]=1,v)[e],_=0,b=c.get();_<b.length;_+=1){var x=b[_],w=x.vaos||(x.vaos={});(w[s]||(w[s]=new _n)).bind(t,this,u,p?p.getPaintVertexBuffers():[],l,x.vertexOffset,d,A),g.drawElements(e,x.primitiveLength*y,g.UNSIGNED_SHORT,x.primitiveOffset*y*2)}}};var Cn=function(e,n,r,i){var o=n.style.light,a=o.properties.get("position"),s=[a.x,a.y,a.z],u=t.create$1();"viewport"===o.properties.get("anchor")&&t.fromRotation(u,-n.transform.angle),t.transformMat3(s,s,u);var l=o.properties.get("color");return{u_matrix:e,u_lightpos:s,u_lightintensity:o.properties.get("intensity"),u_lightcolor:[l.r,l.g,l.b],u_vertical_gradient:+r,u_opacity:i}},Bn=function(e,n,r,i,o,a,s){return t.extend(Cn(e,n,r,i),wn(a,n,s),{u_height_factor:-Math.pow(2,o.overscaledZ)/s.tileSize/8})},kn=function(t){return{u_matrix:t}},En=function(e,n,r,i){return t.extend(kn(e),wn(r,n,i))},Sn=function(t,e){return{u_matrix:t,u_world:e}},Tn=function(e,n,r,i,o){return t.extend(En(e,n,r,i),{u_world:o})},Mn=function(e,n,r,i){var o,a,s=e.transform;if("map"===i.paint.get("circle-pitch-alignment")){var u=fe(r,1,s.zoom);o=!0,a=[u,u]}else o=!1,a=s.pixelsToGLUnits;return{u_camera_to_center_distance:s.cameraToCenterDistance,u_scale_with_map:+("map"===i.paint.get("circle-pitch-scale")),u_matrix:e.translatePosMatrix(n.posMatrix,r,i.paint.get("circle-translate"),i.paint.get("circle-translate-anchor")),u_pitch_with_map:+o,u_device_pixel_ratio:t.browser.devicePixelRatio,u_extrude_scale:a}},In=function(t,e,n){var r=fe(n,1,e.zoom),i=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:r,u_extrude_scale:[e.pixelsToGLUnits[0]/(r*i),e.pixelsToGLUnits[1]/(r*i)],u_overscale_factor:o}},Pn=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]}},Zn=function(t,e,n){return void 0===n&&(n=1),{u_matrix:t,u_color:e,u_overlay:0,u_overlay_scale:n}},Dn=function(t){return{u_matrix:t}},Ln=function(t,e,n,r){return{u_matrix:t,u_extrude_scale:fe(e,1,n),u_intensity:r}},On=function(e,n,r){var i=e.transform;return{u_matrix:Nn(e,n,r),u_ratio:1/fe(n,1,i.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_units_to_pixels:[1/i.pixelsToGLUnits[0],1/i.pixelsToGLUnits[1]]}},Fn=function(e,n,r,i){return t.extend(On(e,n,r),{u_image:0,u_image_height:i})},Rn=function(e,n,r,i){var o=e.transform,a=Un(n,o);return{u_matrix:Nn(e,n,r),u_texsize:n.imageAtlasTexture.size,u_ratio:1/fe(n,1,o.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_image:0,u_scale:[a,i.fromScale,i.toScale],u_fade:i.t,u_units_to_pixels:[1/o.pixelsToGLUnits[0],1/o.pixelsToGLUnits[1]]}},zn=function(e,n,r,i,o){var a=e.lineAtlas,s=Un(n,e.transform),u="round"===r.layout.get("line-cap"),l=a.getDash(i.from,u),c=a.getDash(i.to,u),h=l.width*o.fromScale,f=c.width*o.toScale;return t.extend(On(e,n,r),{u_patternscale_a:[s/h,-l.height/2],u_patternscale_b:[s/f,-c.height/2],u_sdfgamma:a.width/(256*Math.min(h,f)*t.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:l.y,u_tex_y_b:c.y,u_mix:o.t})};function Un(t,e){return 1/fe(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 Gn=function(t,e,n,r,i){return{u_matrix:t,u_tl_parent:e,u_scale_parent:n,u_buffer_scale:1,u_fade_t:r.mix,u_opacity:r.opacity*i.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:i.paint.get("raster-brightness-min"),u_brightness_high:i.paint.get("raster-brightness-max"),u_saturation_factor:(a=i.paint.get("raster-saturation"),a>0?1-1/(1.001-a):-a),u_contrast_factor:(o=i.paint.get("raster-contrast"),o>0?1/(1-o):1+o),u_spin_weights:jn(i.paint.get("raster-hue-rotate"))};var o,a};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,r,i,o,a,s,u,l){var c=i.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:c.cameraToCenterDistance,u_pitch:c.pitch/360*2*Math.PI,u_rotate_symbol:+n,u_aspect_ratio:c.width/c.height,u_fade_change:i.options.fadeDuration?i.symbolFadeChange:1,u_matrix:o,u_label_plane_matrix:a,u_coord_matrix:s,u_is_text:+u,u_pitch_with_map:+r,u_texsize:l,u_texture:0}},Jn=function(e,n,r,i,o,a,s,u,l,c,h){var f=o.transform;return t.extend(Hn(e,n,r,i,o,a,s,u,l,c),{u_gamma_scale:i?Math.cos(f._pitch)*f.cameraToCenterDistance:1,u_device_pixel_ratio:t.browser.devicePixelRatio,u_is_halo:+h})},Wn=function(e,n,r,i,o,a,s,u,l,c){return t.extend(Jn(e,n,r,i,o,a,s,u,!0,l,!0),{u_texsize_icon:c,u_texture_icon:1})},Qn=function(t,e,n){return{u_matrix:t,u_opacity:e,u_color:n}},qn=function(e,n,r,i,o,a){return t.extend(function(t,e,n,r){var i=n.imageManager.getPattern(t.from.toString()),o=n.imageManager.getPattern(t.to.toString()),a=n.imageManager.getPixelSize(),s=a.width,u=a.height,l=Math.pow(2,r.tileID.overscaledZ),c=r.tileSize*Math.pow(2,n.transform.tileZoom)/l,h=c*(r.tileID.canonical.x+r.tileID.wrap*l),f=c*r.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:i.tl,u_pattern_br_a:i.br,u_pattern_tl_b:o.tl,u_pattern_br_b:o.br,u_texsize:[s,u],u_mix:e.t,u_pattern_size_a:i.displaySize,u_pattern_size_b:o.displaySize,u_scale_a:e.fromScale,u_scale_b:e.toScale,u_tile_units_to_pixels:1/fe(r,1,n.transform.tileZoom),u_pixel_coord_upper:[h>>16,f>>16],u_pixel_coord_lower:[65535&h,65535&f]}}(i,a,r,o),{u_matrix:e,u_opacity:n})},Kn={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
2),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
vendor: 121,253 bytes, line 2
2),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,r,i,o,a,s){for(var u=e.context,l=u.gl,c=e.useProgram("collisionBox"),h=[],f=0,p=0,d=0;d<i.length;d++){var A=i[d],v=n.getTile(A),g=v.getBucket(r);if(g){var m=A.posMatrix;0===o[0]&&0===o[1]||(m=e.translatePosMatrix(A.posMatrix,v,o,a));var y=s?g.textCollisionBox:g.iconCollisionBox,_=g.collisionCircleArray;if(_.length>0){var b=t.create(),x=m;t.mul(b,g.placementInvProjMatrix,e.transform.glCoordMatrix),t.mul(b,b,g.placementViewportMatrix),h.push({circleArray:_,circleOffset:p,transform:x,invTransform:b}),p=f+=_.length/4}y&&c.draw(u,l.LINES,Bt.disabled,kt.disabled,e.colorModeForRenderPass(),St.disabled,In(m,e.transform,v),r.id,y.layoutVertexBuffer,y.indexBuffer,y.segments,null,e.transform.zoom,null,null,y.collisionVertexBuffer)}}if(s&&h.length){var w=e.useProgram("collisionCircle"),C=new t.StructArrayLayout2f1f2i16;C.resize(4*f),C._trim();for(var B=0,k=0,E=h;k<E.length;k+=1)for(var S=E[k],T=0;T<S.circleArray.length/4;T++){var M=4*T,I=S.circleArray[M+0],P=S.circleArray[M+1],Z=S.circleArray[M+2],D=S.circleArray[M+3];C.emplace(B++,I,P,Z,D,0),C.emplace(B++,I,P,Z,D,1),C.emplace(B++,I,P,Z,D,2),C.emplace(B++,I,P,Z,D,3)}(!Vn||Vn.length<2*f)&&(Vn=function(e){var n=2*e,r=new t.StructArrayLayout3ui6;r.resize(n),r._trim();for(var i=0;i<n;i++){var o=6*i;r.uint16[o+0]=4*i+0,r.uint16[o+1]=4*i+1,r.uint16[o+2]=4*i+2,r.uint16[o+3]=4*i+2,r.uint16[o+4]=4*i+3,r.uint16[o+5]=4*i+0}return r}(f));for(var L=u.createIndexBuffer(Vn,!0),O=u.createVertexBuffer(C,t.collisionCircleLayout.members,!0),F=0,R=h;F<R.length;F+=1){var z=R[F],U=Pn(z.transform,z.invTransform,e.transform);w.draw(u,l.TRIANGLES,Bt.disabled,kt.disabled,e.colorModeForRenderPass(),St.disabled,U,r.id,O,L,t.SegmentVector.simpleSegment(0,2*z.circleOffset,z.circleArray.length,z.circleArray.length/2),null,e.transform.zoom,null,null,null)}O.destroy(),L.destroy()}}var Yn=t.identity(new Float32Array(16));function $n(e,n,r,i,o,a){var s=t.getAnchorAlignment(e),u=-(s.horizontalAlign-.5)*n,l=-(s.verticalAlign-.5)*r,c=t.evaluateVariableOffset(e,i);return new t.Point((u/o+c[0])*a,(l/o+c[1])*a)}function tr(e,n,r,i,o,a,s,u,l,c,h){var f=e.text.placedSymbolArray,p=e.text.dynamicLayoutVertexArray,d=e.icon.dynamicLayoutVertexArray,A={};p.clear();for(var v=0;v<f.length;v++){var g=f.get(v),m=g.hidden||!g.crossTileID||e.allowVerticalPlacement&&!g.placedOrientation?null:i[g.crossTileID];if(m){var y=new t.Point(g.anchorX,g.anchorY),_=$t(y,r?u:s),b=te(a.cameraToCenterDistance,_.signedDistanceFromCamera),x=o.evaluateSizeForFeature(e.textSizeData,c,g)*b/t.ONE_EM;r&&(x*=e.tilePixelRatio/l);for(var w=$n(m.anchor,m.width,m.height,m.textOffset,m.textBoxScale,x),C=r?$t(y.add(w),s).point:_.point.add(n?w.rotate(-a.angle):w),B=e.allowVerticalPlacement&&g.placedOrientation===t.WritingMode.vertical?Math.PI/2:0,k=0;k<g.numGlyphs;k++)t.addDynamicAttributes(p,C,B);h&&g.associatedIconIndex>=0&&(A[g.associatedIconIndex]={shiftedAnchor:C,angle:B})}else le(g.numGlyphs,p)}if(h){d.clear();for(var E=e.icon.placedSymbolArray,S=0;S<E.length;S++){var T=E.get(S);if(T.hidden)le(T.numGlyphs,d);else{var M=A[S];if(M)for(var I=0;I<T.numGlyphs;I++)t.addDynamicAttributes(d,M.shiftedAnchor,M.angle);else le(T.numGlyphs,d)}}e.icon.dynamicLayoutVertexBuffer.updateData(d)}e.text.dynamicLayoutVertexBuffer.updateData(p)}function er(t,e,n){return n.iconsInText&&e?"symbolTextAndIcon":t?"symbolSDF":"symbolIcon"}function nr(e,n,r,i,o,a,s,u,l,c,h,f){for(var p=e.context,d=p.gl,A=e.transform,v="map"===u,g="map"===l,m=v&&"point"!==r.layout.get("symbol-placement"),y=v&&!g&&!m,_=void 0!==r.layout.get("symbol-sort-key").constantOr(1),b=!1,x=e.depthModeForSublayer(0,Bt.ReadOnly),w=r.layout.get("text-variable-anchor"),C=[],B=0,k=i;B<k.length;B+=1){var E=k[B],S=n.getTile(E),T=S.getBucket(r);if(T){var M=o?T.text:T.icon;if(M&&M.segments.get().length){var I=M.programConfigurations.get(r.id),P=o||T.sdfIcons,Z=o?T.textSizeData:T.iconSizeData,D=g||0!==A.pitch,L=e.useProgram(er(P,o,T),I),O=t.evaluateSizeForZoom(Z,A.zoom),F=void 0,R=[0,0],z=void 0,U=void 0,N=null,G=void 0;if(o)z=S.glyphAtlasTexture,U=d.LINEAR,F=S.glyphAtlasTexture.size,T.iconsInText&&(R=S.imageAtlasTexture.size,N=S.imageAtlasTexture,G=D||e.options.rotating||e.options.zooming||"composite"===Z.kind||"camera"===Z.kind?d.LINEAR:d.NEAREST);else{var j=1!==r.layout.get("icon-size").constantOr(0)||T.iconsNeedLinear;z=S.imageAtlasTexture,U=P||e.options.rotating||e.options.zooming||j||D?d.LINEAR:d.NEAREST,F=S.imageAtlasTexture.size}var V=fe(S,1,e.transform.zoom),H=Xt(E.posMatrix,g,v,e.transform,V),J=Yt(E.posMatrix,g,v,e.transform,V),W=w&&T.hasTextData(),Q="none"!==r.layout.get("icon-text-fit")&&W&&T.hasIconData();m&&ne(T,E.posMatrix,e,o,H,J,g,c);var q=e.translatePosMatrix(E.posMatrix,S,a,s),K=m||o&&w||Q?Yn:H,X=e.translatePosMatrix(J,S,a,s,!0),Y=P&&0!==r.paint.get(o?"text-halo-width":"icon-halo-width").constantOr(1),$={program:L,buffers:M,uniformValues:P?T.iconsInText?Wn(Z.kind,O,y,g,e,q,K,X,F,R):Jn(Z.kind,O,y,g,e,q,K,X,o,F,!0):Hn(Z.kind,O,y,g,e,q,K,X,o,F),atlasTexture:z,atlasTextureIcon:N,atlasInterpolation:U,atlasInterpolationIcon:G,isSDF:P,hasHalo:Y};if(_&&T.canOverlap){b=!0;for(var tt=0,et=M.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:M.segments,sortKey:0,state:$})}}}b&&C.sort((function(t,e){return t.sortKey-e.sortKey}));for(var rt=0,it=C;rt<it.length;rt+=1){var ot=it[rt],at=ot.state;if(p.activeTexture.set(d.TEXTURE0),at.atlasTexture.bind(at.atlasInterpolation,d.CLAMP_TO_EDGE),at.atlasTextureIcon&&(p.activeTexture.set(d.TEXTURE1),at.atlasTextureIcon&&at.atlasTextureIcon.bind(at.atlasInterpolationIcon,d.CLAMP_TO_EDGE)),at.isSDF){var st=at.uniformValues;at.hasHalo&&(st.u_is_halo=1,rr(at.buffers,ot.segments,r,e,at.program,x,h,f,st)),st.u_is_halo=0}rr(at.buffers,ot.segments,r,e,at.program,x,h,f,at.uniformValues)}}function rr(t,e,n,r,i,o,a,s,u){var l=r.context;i.draw(l,l.gl.TRIANGLES,o,a,s,St.disabled,u,n.id,t.layoutVertexBuffer,t.indexBuffer,e,n.paint,r.transform.zoom,t.programConfigurations.get(n.id),t.dynamicLayoutVertexBuffer,t.opacityVertexBuffer)}function ir(t,e,n,r,i,o,a){var s,u,l,c,h,f=t.context.gl,p=n.paint.get("fill-pattern"),d=p&&p.constantOr(1),A=n.getCrossfadeParameters();a?(u=d&&!n.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",s=f.LINES):(u=d?"fillPattern":"fill",s=f.TRIANGLES);for(var v=0,g=r;v<g.length;v+=1){var m=g[v],y=e.getTile(m);if(!d||y.patternsLoaded()){var _=y.getBucket(n);if(_){var b=_.programConfigurations.get(n.id),x=t.useProgram(u,b);d&&(t.context.activeTexture.set(f.TEXTURE0),y.imageAtlasTexture.bind(f.LINEAR,f.CLAMP_TO_EDGE),b.updatePaintBuffers(A));var w=p.constantOr(null);if(w&&y.imageAtlas){var C=y.imageAtlas,B=C.patternPositions[w.to.toString()],k=C.patternPositions[w.from.toString()];B&&k&&b.setConstantPatternPositions(B,k)}var E=t.translatePosMatrix(m.posMatrix,y,n.paint.get("fill-translate"),n.paint.get("fill-translate-anchor"));if(a){c=_.indexBuffer2,h=_.segments2;var S=[f.drawingBufferWidth,f.drawingBufferHeight];l="fillOutlinePattern"===u&&d?Tn(E,t,A,y,S):Sn(E,S)}else c=_.indexBuffer,h=_.segments,l=d?En(E,t,A,y):kn(E);x.draw(t.context,s,i,t.stencilModeForClipping(m),o,St.disabled,l,n.id,_.layoutVertexBuffer,c,h,n.paint,t.transform.zoom,b)}}}}function or(t,e,n,r,i,o,a){for(var s=t.context,u=s.gl,l=n.paint.get("fill-extrusion-pattern"),c=l.constantOr(1),h=n.getCrossfadeParameters(),f=n.paint.get("fill-extrusion-opacity"),p=0,d=r;p<d.length;p+=1){var A=d[p],v=e.getTile(A),g=v.getBucket(n);if(g){var m=g.programConfigurations.get(n.id),y=t.useProgram(c?"fillExtrusionPattern":"fillExtrusion",m);c&&(t.context.activeTexture.set(u.TEXTURE0),v.imageAtlasTexture.bind(u.LINEAR,u.CLAMP_TO_EDGE),m.updatePaintBuffers(h));var _=l.constantOr(null);if(_&&v.imageAtlas){var b=v.imageAtlas,x=b.patternPositions[_.to.toString()],w=b.patternPositions[_.from.toString()];x&&w&&m.setConstantPatternPositions(x,w)}var C=t.translatePosMatrix(A.posMatrix,v,n.paint.get("fill-extrusion-translate"),n.paint.get("fill-extrusion-translate-anchor")),B=n.paint.get("fill-extrusion-vertical-gradient"),k=c?Bn(C,t,B,f,A,h,v):Cn(C,t,B,f);y.draw(s,s.gl.TRIANGLES,i,o,a,St.backCCW,k,n.id,g.layoutVertexBuffer,g.indexBuffer,g.segments,n.paint,t.transform.zoom,m)}}}function ar(e,n,r,i,o,a){var s=e.context,u=s.gl,l=n.fbo;if(l){var c=e.useProgram("hillshade");s.activeTexture.set(u.TEXTURE0),u.bindTexture(u.TEXTURE_2D,l.colorAttachment.get());var h=function(e,n,r){var i=r.paint.get("hillshade-shadow-color"),o=r.paint.get("hillshade-highlight-color"),a=r.paint.get("hillshade-accent-color"),s=r.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===r.paint.get("hillshade-illumination-anchor")&&(s-=e.transform.angle);var u,l,c,h=!e.options.moving;return{u_matrix:e.transform.calculatePosMatrix(n.tileID.toUnwrapped(),h),u_image:0,u_latrange:(u=n.tileID,l=Math.pow(2,u.canonical.z),c=u.canonical.y,[new t.MercatorCoordinate(0,c/l).toLngLat().lat,new t.MercatorCoordinate(0,(c+1)/l).toLngLat().lat]),u_light:[r.paint.get("hillshade-exaggeration"),s],u_shadow:i,u_highlight:o,u_accent:a}}(e,n,r);c.draw(s,u.TRIANGLES,i,o,a,St.disabled,h,r.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments)}}function sr(e,n,r,i,o,a){var s=e.context,u=s.gl,l=n.dem;if(l&&l.data){var c=l.dim,h=l.stride,f=l.getPixels();if(s.activeTexture.set(u.TEXTURE1),s.pixelStoreUnpackPremultiplyAlpha.set(!1),n.demTexture=n.demTexture||e.getTileTexture(h),n.demTexture){var p=n.demTexture;p.update(f,{premultiply:!1}),p.bind(u.NEAREST,u.CLAMP_TO_EDGE)}else n.demTexture=new t.Texture(s,f,u.RGBA,{premultiply:!1}),n.demTexture.bind(u.NEAREST,u.CLAMP_TO_EDGE);s.activeTexture.set(u.TEXTURE0);var d=n.fbo;if(!d){var A=new t.Texture(s,{width:c,height:c,data:null},u.RGBA);A.bind(u.LINEAR,u.CLAMP_TO_EDGE),(d=n.fbo=s.createFramebuffer(c,c,!0)).colorAttachment.set(A.texture)}s.bindFramebuffer.set(d.framebuffer),s.viewport.set([0,0,c,c]),e.useProgram("hillshadePrepare").draw(s,u.TRIANGLES,i,o,a,St.disabled,function(e,n){var r=n.stride,i=t.create();return t.ortho(i,0,t.EXTENT,-t.EXTENT,0,0,1),t.translate(i,i,[0,-t.EXTENT,0]),{u_matrix:i,u_image:1,u_dimension:[r,r],u_zoom:e.overscaledZ,u_unpack:n.getUnpackVector()}}(n.tileID,l),r.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments),n.needsHillshadePrepare=!1}}function ur(e,n,r,i,o){var a=i.paint.get("raster-fade-duration");if(a>0){var s=t.browser.now(),u=(s-e.timeAdded)/a,l=n?(s-n.timeAdded)/a:-1,c=r.getSource(),h=o.coveringZoomLevel({tileSize:c.tileSize,roundZoom:c.roundZoom}),f=!n||Math.abs(n.tileID.overscaledZ-h)>Math.abs(e.tileID.overscaledZ-h),p=f&&e.refreshedUponExpiration?1:t.clamp(f?u:1-l,0,1);return e.refreshedUponExpiration&&u>=1&&(e.refreshedUponExpiration=!1),n?{opacity:1,mix:1-p}:{opacity:p,mix:0}}return{opacity:1,mix:0}}var lr=new t.Color(1,0,0,1),cr=new t.Color(0,1,0,1),hr=new t.Color(0,0,1,1),fr=new t.Color(1,0,1,1),pr=new t.Color(0,1,1,1);function dr(t,e,n,r){vr(t,0,e+n/2,t.transform.width,n,r)}function Ar(t,e,n,r){vr(t,e-n/2,0,n,t.transform.height,r)}function vr(e,n,r,i,o,a){var s=e.context,u=s.gl;u.enable(u.SCISSOR_TEST),u.scissor(n*t.browser.devicePixelRatio,r*t.browser.devicePixelRatio,i*t.browser.devicePixelRatio,o*t.browser.devicePixelRatio),s.clear({color:a}),u.disable(u.SCISSOR_TEST)}function gr(e,n,r){var i=e.context,o=i.gl,a=r.posMatrix,s=e.useProgram("debug"),u=Bt.disabled,l=kt.disabled,c=e.colorModeForRenderPass();i.activeTexture.set(o.TEXTURE0),e.emptyTexture.bind(o.LINEAR,o.CLAMP_TO_EDGE),s.draw(i,o.LINE_STRIP,u,l,c,St.disabled,Zn(a,t.Color.red),"$debug",e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments);var h=n.getTileByID(r.key).latestRawTileData,f=Math.floor((h&&h.byteLength||0)/1024),p=n.getTile(r).tileSize,d=512/Math.min(p,512)*(r.overscaledZ/e.transform.zoom)*.5,A=r.canonical.toString();r.overscaledZ!==r.canonical.z&&(A+=" => "+r.overscaledZ),function(t,e){t.initDebugOverlayCanvas();var n=t.debugOverlayCanvas,r=t.context.gl,i=t.debugOverlayCanvas.getContext("2d");i.clearRect(0,0,n.width,n.height),i.shadowColor="white",i.shadowBlur=2,i.lineWidth=1.5,i.strokeStyle="white",i.textBaseline="top",i.font="bold 36px Open Sans, sans-serif",i.fillText(e,5,5),i.strokeText(e,5,5),t.debugOverlayTexture.update(n),t.debugOverlayTexture.bind(r.LINEAR,r.CLAMP_TO_EDGE)}(e,A+" "+f+"kb"),s.draw(i,o.TRIANGLES,u,l,Et.alphaBlended,St.disabled,Zn(a,t.Color.transparent,d),"$debug",e.debugBuffer,e.quadTriangleIndexBuffer,e.debugSegments)}var mr={symbol:function(e,n,r,i,o){if("translucent"===e.renderPass){var a=kt.disabled,s=e.colorModeForRenderPass();r.layout.get("text-variable-anchor")&&function(e,n,r,i,o,a,s){for(var u=n.transform,l="map"===o,c="map"===a,h=0,f=e;h<f.length;h+=1){var p=f[h],d=i.getTile(p),A=d.getBucket(r);if(A&&A.text&&A.text.segments.get().length){var v=t.evaluateSizeForZoom(A.textSizeData,u.zoom),g=fe(d,1,n.transform.zoom),m=Xt(p.posMatrix,c,l,n.transform,g),y="none"!==r.layout.get("icon-text-fit")&&A.hasIconData();if(v){var _=Math.pow(2,u.zoom-d.tileID.overscaledZ);tr(A,l,c,s,t.symbolSize,u,m,p.posMatrix,_,v,y)}}}}(i,e,r,n,r.layout.get("text-rotation-alignment"),r.layout.get("text-pitch-alignment"),o),0!==r.paint.get("icon-opacity").constantOr(1)&&nr(e,n,r,i,!1,r.paint.get("icon-translate"),r.paint.get("icon-translate-anchor"),r.layout.get("icon-rotation-alignment"),r.layout.get("icon-pitch-alignment"),r.layout.get("icon-keep-upright"),a,s),0!==r.paint.get("text-opacity").constantOr(1)&&nr(e,n,r,i,!0,r.paint.get("text-translate"),r.paint.get("text-translate-anchor"),r.layout.get("text-rotation-alignment"),r.layout.get("text-pitch-alignment"),r.layout.get("text-keep-upright"),a,s),n.map.showCollisionBoxes&&(Xn(e,n,r,i,r.paint.get("text-translate"),r.paint.get("text-translate-anchor"),!0),Xn(e,n,r,i,r.paint.get("icon-translate"),r.paint.get("icon-translate-anchor"),!1))}},circle:function(e,n,r,i){if("translucent"===e.renderPass){var o=r.paint.get("circle-opacity"),a=r.paint.get("circle-stroke-width"),s=r.paint.get("circle-stroke-opacity"),u=void 0!==r.layout.get("circle-sort-key").constantOr(1);if(0!==o.constantOr(1)||0!==a.constantOr(1)&&0!==s.constantOr(1)){for(var l=e.context,c=l.gl,h=e.depthModeForSublayer(0,Bt.ReadOnly),f=kt.disabled,p=e.colorModeForRenderPass(),d=[],A=0;A<i.length;A++){var v=i[A],g=n.getTile(v),m=g.getBucket(r);if(m){var y=m.programConfigurations.get(r.id),_={programConfiguration:y,program:e.useProgram("circle",y),layoutVertexBuffer:m.layoutVertexBuffer,indexBuffer:m.indexBuffer,uniformValues:Mn(e,v,g,r)};if(u)for(var b=0,x=m.segments.get();b<x.length;b+=1){var w=x[b];d.push({segments:new t.SegmentVector([w]),sortKey:w.sortKey,state:_})}else d.push({segments:m.segments,sortKey:0,state:_})}}u&&d.sort((function(t,e){return t.sortKey-e.sortKey}));for(var C=0,B=d;C<B.length;C+=1){var k=B[C],E=k.state;E.program.draw(l,c.TRIANGLES,h,f,p,St.disabled,E.uniformValues,r.id,E.layoutVertexBuffer,E.indexBuffer,k.segments,r.paint,e.transform.zoom,E.programConfiguration)}}}},heatmap:function(e,n,r,i){if(0!==r.paint.get("heatmap-opacity"))if("offscreen"===e.renderPass){var o=e.context,a=o.gl,s=kt.disabled,u=new Et([a.ONE,a.ONE],t.Color.transparent,[!0,!0,!0,!0]);!function(t,e,n){var r=t.gl;t.activeTexture.set(r.TEXTURE1),t.viewport.set([0,0,e.width/4,e.height/4]);var i=n.heatmapFbo;if(i)r.bindTexture(r.TEXTURE_2D,i.colorAttachment.get()),t.bindFramebuffer.set(i.framebuffer);else{var o=r.createTexture();r.bindTexture(r.TEXTURE_2D,o),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),i=n.heatmapFbo=t.createFramebuffer(e.width/4,e.height/4,!1),function(t,e,n,r){var i=t.gl;i.texImage2D(i.TEXTURE_2D,0,i.RGBA,e.width/4,e.height/4,0,i.RGBA,t.extRenderToTextureHalfFloat?t.extTextureHalfFloat.HALF_FLOAT_OES:i.UNSIGNED_BYTE,null),r.colorAttachment.set(n)}(t,e,o,i)}}(o,e,r),o.clear({color:t.Color.transparent});for(var l=0;l<i.length;l++){var c=i[l];if(!n.hasRenderableParent(c)){var h=n.getTile(c),f=h.getBucket(r);if(f){var p=f.programConfigurations.get(r.id);e.useProgram("heatmap",p).draw(o,a.TRIANGLES,Bt.disabled,s,u,St.disabled,Ln(c.posMatrix,h,e.transform.zoom,r.paint.get("heatmap-intensity")),r.id,f.layoutVertexBuffer,f.indexBuffer,f.segments,r.paint,e.transform.zoom,p)}}}o.viewport.set([0,0,e.width,e.height])}else"translucent"===e.renderPass&&(e.context.setColorMode(e.colorModeForRenderPass()),function(e,n){var r=e.context,i=r.gl,o=n.heatmapFbo;if(o){r.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,o.colorAttachment.get()),r.activeTexture.set(i.TEXTURE1);var a=n.colorRampTexture;a||(a=n.colorRampTexture=new t.Texture(r,n.colorRamp,i.RGBA)),a.bind(i.LINEAR,i.CLAMP_TO_EDGE),e.useProgram("heatmapTexture").draw(r,i.TRIANGLES,Bt.disabled,kt.disabled,e.colorModeForRenderPass(),St.disabled,function(e,n,r,i){var o=t.create();t.ortho(o,0,e.width,e.height,0,0,1);var a=e.context.gl;return{u_matrix:o,u_world:[a.drawingBufferWidth,a.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,r))},line:function(e,n,r,i){if("translucent"===e.renderPass){var o=r.paint.get("line-opacity"),a=r.paint.get("line-width");if(0!==o.constantOr(1)&&0!==a.constantOr(1))for(var s=e.depthModeForSublayer(0,Bt.ReadOnly),u=e.colorModeForRenderPass(),l=r.paint.get("line-dasharray"),c=r.paint.get("line-pattern"),h=c.constantOr(1),f=r.paint.get("line-gradient"),p=r.getCrossfadeParameters(),d=h?"linePattern":l?"lineSDF":f?"lineGradient":"line",A=e.context,v=A.gl,g=!0,m=0,y=i;m<y.length;m+=1){var _=y[m],b=n.getTile(_);if(!h||b.patternsLoaded()){var x=b.getBucket(r);if(x){var w=x.programConfigurations.get(r.id),C=e.context.program.get(),B=e.useProgram(d,w),k=g||B.program!==C,E=c.constantOr(null);if(E&&b.imageAtlas){var S=b.imageAtlas,T=S.patternPositions[E.to.toString()],M=S.patternPositions[E.from.toString()];T&&M&&w.setConstantPatternPositions(T,M)}var I=h?Rn(e,b,r,p):l?zn(e,b,r,l,p):f?Fn(e,b,r,x.lineClipsArray.length):On(e,b,r);if(h)A.activeTexture.set(v.TEXTURE0),b.imageAtlasTexture.bind(v.LINEAR,v.CLAMP_TO_EDGE),w.updatePaintBuffers(p);else if(l&&(k||e.lineAtlas.dirty))A.activeTexture.set(v.TEXTURE0),e.lineAtlas.bind(A);else if(f){var P=x.gradients[r.id],Z=P.texture;if(r.gradientVersion!==P.version){var D=256;if(r.stepInterpolant){var L=n.getSource().maxzoom,O=_.canonical.z===L?Math.ceil(1<<e.transform.maxZoom-_.canonical.z):1;D=t.clamp(t.nextPowerOfTwo(x.maxLineLength/t.EXTENT*1024*O),256,A.maxTextureSize)}P.gradient=t.renderColorRamp({expression:r.gradientExpression(),evaluationKey:"lineProgress",resolution:D,image:P.gradient||void 0,clips:x.lineClipsArray}),P.texture?P.texture.update(P.gradient):P.texture=new t.Texture(A,P.gradient,v.RGBA),P.version=r.gradientVersion,Z=P.texture}A.activeTexture.set(v.TEXTURE0),Z.bind(r.stepInterpolant?v.NEAREST:v.LINEAR,v.CLAMP_TO_EDGE)}B.draw(A,v.TRIANGLES,s,e.stencilModeForClipping(_),u,St.disabled,I,r.id,x.layoutVertexBuffer,x.indexBuffer,x.segments,r.paint,e.transform.zoom,w,x.layoutVertexBuffer2),g=!1}}}}},fill:function(e,n,r,i){var o=r.paint.get("fill-color"),a=r.paint.get("fill-opacity");if(0!==a.constantOr(1)){var s=e.colorModeForRenderPass(),u=r.paint.get("fill-pattern"),l=e.opaquePassEnabledForLayer()&&!u.constantOr(1)&&1===o.constantOr(t.Color.transparent).a&&1===a.constantOr(0)?"opaque":"translucent";if(e.renderPass===l){var c=e.depthModeForSublayer(1,"opaque"===e.renderPass?Bt.ReadWrite:Bt.ReadOnly);ir(e,n,r,i,c,s,!1)}if("translucent"===e.renderPass&&r.paint.get("fill-antialias")){var h=e.depthModeForSublayer(r.getPaintProperty("fill-outline-color")?2:0,Bt.ReadOnly);ir(e,n,r,i,h,s,!0)}}},"fill-extrusion":function(t,e,n,r){var i=n.paint.get("fill-extrusion-opacity");if(0!==i&&"translucent"===t.renderPass){var o=new Bt(t.context.gl.LEQUAL,Bt.ReadWrite,t.depthRangeFor3D);if(1!==i||n.paint.get("fill-extrusion-pattern").constantOr(1))or(t,e,n,r,o,kt.disabled,Et.disabled),or(t,e,n,r,o,t.stencilModeFor3D(),t.colorModeForRenderPass());else{var a=t.colorModeForRenderPass();or(t,e,n,r,o,kt.disabled,a)}}},hillshade:function(t,e,n,r){if("offscreen"===t.renderPass||"translucent"===t.renderPass){for(var i=t.context,o=t.depthModeForSublayer(0,Bt.ReadOnly),a=t.colorModeForRenderPass(),s="translucent"===t.renderPass?t.stencilConfigForOverlap(r):[{},r],u=s[0],l=0,c=s[1];l<c.length;l+=1){var h=c[l],f=e.getTile(h);f.needsHillshadePrepare&&"offscreen"===t.renderPass?sr(t,f,n,o,kt.disabled,a):"translucent"===t.renderPass&&ar(t,f,n,o,u[h.overscaledZ],a)}i.viewport.set([0,0,t.width,t.height])}},raster:function(t,e,n,r){if("translucent"===t.renderPass&&0!==n.paint.get("raster-opacity")&&r.length)for(var i=t.context,o=i.gl,a=e.getSource(),s=t.useProgram("raster"),u=t.colorModeForRenderPass(),l=a instanceof P?[{},r]:t.stencilConfigForOverlap(r),c=l[0],h=l[1],f=h[h.length-1].overscaledZ,p=!t.options.moving,d=0,A=h;d<A.length;d+=1){var v=A[d],g=t.depthModeForSublayer(v.overscaledZ-f,1===n.paint.get("raster-opacity")?Bt.ReadWrite:Bt.ReadOnly,o.LESS),m=e.getTile(v),y=t.transform.calculatePosMatrix(v.toUnwrapped(),p);m.registerFadeDuration(n.paint.get("raster-fade-duration"));var _=e.findLoadedParent(v,0),b=ur(m,_,e,n,t.transform),x=void 0,w=void 0,C="nearest"===n.paint.get("raster-resampling")?o.NEAREST:o.LINEAR;i.activeTexture.set(o.TEXTURE0),m.texture.bind(C,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST),i.activeTexture.set(o.TEXTURE1),_?(_.texture.bind(C,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST),x=Math.pow(2,_.tileID.overscaledZ-m.tileID.overscaledZ),w=[m.tileID.canonical.x*x%1,m.tileID.canonical.y*x%1]):m.texture.bind(C,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST);var B=Gn(y,w||[0,0],x||1,b,n);a instanceof P?s.draw(i,o.TRIANGLES,g,kt.disabled,u,St.disabled,B,n.id,a.boundsBuffer,t.quadTriangleIndexBuffer,a.boundsSegments):s.draw(i,o.TRIANGLES,g,c[v.overscaledZ],u,St.disabled,B,n.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments)}},background:function(t,e,n){var r=n.paint.get("background-color"),i=n.paint.get("background-opacity");if(0!==i){var o=t.context,a=o.gl,s=t.transform,u=s.tileSize,l=n.paint.get("background-pattern");if(!t.isPatternMissing(l)){var c=!l&&1===r.a&&1===i&&t.opaquePassEnabledForLayer()?"opaque":"translucent";if(t.renderPass===c){var h=kt.disabled,f=t.depthModeForSublayer(0,"opaque"===c?Bt.ReadWrite:Bt.ReadOnly),p=t.colorModeForRenderPass(),d=t.useProgram(l?"backgroundPattern":"background"),A=s.coveringTiles({tileSize:u});l&&(o.activeTexture.set(a.TEXTURE0),t.imageManager.bind(t.context));for(var v=n.getCrossfadeParameters(),g=0,m=A;g<m.length;g+=1){var y=m[g],_=t.transform.calculatePosMatrix(y.toUnwrapped()),b=l?qn(_,i,t,l,{tileID:y,tileSize:u},v):Qn(_,i,r);d.draw(o,a.TRIANGLES,f,h,p,St.disabled,b,n.id,t.tileExtentBuffer,t.quadTriangleIndexBuffer,t.tileExtentSegments)}}}}},debug:function(t,e,n){for(var r=0;r<n.length;r++)gr(t,e,n[r])},custom:function(t,e,n){var r=t.context,i=n.implementation;if("offscreen"===t.renderPass){var o=i.prerender;o&&(t.setCustomLayerDefaults(),r.setColorMode(t.colorModeForRenderPass()),o.call(i,r.gl,t.transform.customLayerMatrix()),r.setDirty(),t.setBaseState())}else if("translucent"===t.renderPass){t.setCustomLayerDefaults(),r.setColorMode(t.colorModeForRenderPass()),r.setStencilMode(kt.disabled);var a="3d"===i.renderingMode?new Bt(t.context.gl.LEQUAL,Bt.ReadWrite,t.depthRangeFor3D):t.depthModeForSublayer(0,Bt.ReadOnly);r.setDepthMode(a),i.render(r.gl,t.transform.customLayerMatrix()),r.setDirty(),t.setBaseState(),r.bindFramebuffer.set(null)}}},yr=function(t,e){this.context=new Tt(t),this.transform=e,this._tileTextures={},this.setup(),this.numSublayers=Mt.maxUnderzooming+Mt.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Re,this.gpuTimers={}};yr.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 r=0,i=this.style._order;r<i.length;r+=1)this.style._layers[i[r]].resize()},yr.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 r=new t.StructArrayLayout2i4;r.emplaceBack(0,0),r.emplaceBack(t.EXTENT,0),r.emplaceBack(0,t.EXTENT),r.emplaceBack(t.EXTENT,t.EXTENT),this.debugBuffer=e.createVertexBuffer(r,Ve.members),this.debugSegments=t.SegmentVector.simpleSegment(0,0,4,5);var i=new t.StructArrayLayout4i8;i.emplaceBack(0,0,0,0),i.emplaceBack(t.EXTENT,0,t.EXTENT,0),i.emplaceBack(0,t.EXTENT,0,t.EXTENT),i.emplaceBack(t.EXTENT,t.EXTENT,t.EXTENT,t.EXTENT),this.rasterBoundsBuffer=e.createVertexBuffer(i,I.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 a=new t.StructArrayLayout1ui2;a.emplaceBack(0),a.emplaceBack(1),a.emplaceBack(3),a.emplaceBack(2),a.emplaceBack(0),this.tileBorderIndexBuffer=e.createIndexBuffer(a);var s=new t.StructArrayLayout3ui6;s.emplaceBack(0,1,2),s.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=e.createIndexBuffer(s),this.emptyTexture=new t.Texture(e,{width:1,height:1,data:new Uint8Array([0,0,0,0])},e.gl.RGBA);var u=this.context.gl;this.stencilClearMode=new kt({func:u.ALWAYS,mask:0},0,255,u.ZERO,u.ZERO,u.ZERO)},yr.prototype.clearStencil=function(){var e=this.context,n=e.gl;this.nextStencilID=1,this.currentStencilSource=void 0;var r=t.create();t.ortho(r,0,this.width,this.height,0,0,1),t.scale(r,r,[n.drawingBufferWidth,n.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(e,n.TRIANGLES,Bt.disabled,this.stencilClearMode,Et.disabled,St.disabled,Dn(r),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)},yr.prototype._renderTileClippingMasks=function(t,e){if(this.currentStencilSource!==t.source&&t.isTileClipped()&&e&&e.length){this.currentStencilSource=t.source;var n=this.context,r=n.gl;this.nextStencilID+e.length>256&&this.clearStencil(),n.setColorMode(Et.disabled),n.setDepthMode(Bt.disabled);var i=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var o=0,a=e;o<a.length;o+=1){var s=a[o],u=this._tileClippingMaskIDs[s.key]=this.nextStencilID++;i.draw(n,r.TRIANGLES,Bt.disabled,new kt({func:r.ALWAYS,mask:0},u,255,r.KEEP,r.KEEP,r.REPLACE),Et.disabled,St.disabled,Dn(s.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}},yr.prototype.stencilModeFor3D=function(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();var t=this.nextStencilID++,e=this.context.gl;return new kt({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)},yr.prototype.stencilModeForClipping=function(t){var e=this.context.gl;return new kt({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)},yr.prototype.stencilConfigForOverlap=function(t){var e,n=this.context.gl,r=t.sort((function(t,e){return e.overscaledZ-t.overscaledZ})),i=r[r.length-1].overscaledZ,o=r[0].overscaledZ-i+1;if(o>1){this.currentStencilSource=void 0,this.nextStencilID+o>256&&this.clearStencil();for(var a={},s=0;s<o;s++)a[s+i]=new kt({func:n.GEQUAL,mask:255},s+this.nextStencilID,255,n.KEEP,n.KEEP,n.REPLACE);return this.nextStencilID+=o,[a,r]}return[(e={},e[i]=kt.disabled,e),r]},yr.prototype.colorModeForRenderPass=function(){var e=this.context.gl;return this._showOverdrawInspector?new Et([e.CONSTANT_COLOR,e.ONE],new t.Color(1/8,1/8,1/8,0),[!0,!0,!0,!0]):"opaque"===this.renderPass?Et.unblended:Et.alphaBlended},yr.prototype.depthModeForSublayer=function(t,e,n){if(!this.opaquePassEnabledForLayer())return Bt.disabled;var r=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new Bt(n||this.context.gl.LEQUAL,e,[r,r])},yr.prototype.opaquePassEnabledForLayer=function(){return this.currentLayer<this.opaquePassCutoff},yr.prototype.render=function(e,n){var r=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 i=this.style._order,o=this.style.sourceCaches;for(var a in o){var s=o[a];s.used&&s.prepare(this.context)}var u,l,c={},h={},f={};for(var p in o){var d=o[p];c[p]=d.getVisibleCoordinates(),h[p]=c[p].slice().reverse(),f[p]=d.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(var A=0;A<i.length;A++)if(this.style._layers[i[A]].is3D()){this.opaquePassCutoff=A;break}this.renderPass="offscreen";for(var v=0,g=i;v<g.length;v+=1){var m=this.style._layers[g[v]];if(m.hasOffscreenPass()&&!m.isHidden(this.transform.zoom)){var y=h[m.source];("custom"===m.type||y.length)&&this.renderLayer(this,o[m.source],m,y)}}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=i.length-1;this.currentLayer>=0;this.currentLayer--){var _=this.style._layers[i[this.currentLayer]],b=o[_.source],x=c[_.source];this._renderTileClippingMasks(_,x),this.renderLayer(this,b,_,x)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<i.length;this.currentLayer++){var w=this.style._layers[i[this.currentLayer]],C=o[w.source],B=("symbol"===w.type?f:h)[w.source];this._renderTileClippingMasks(w,c[w.source]),this.renderLayer(this,C,w,B)}this.options.showTileBoundaries&&(t.values(this.style._layers).forEach((function(t){t.source&&!t.isHidden(r.transform.zoom)&&(t.source!==(l&&l.id)&&(l=r.style.sourceCaches[t.source]),(!u||u.getSource().maxzoom<l.getSource().maxzoom)&&(u=l))})),u&&mr.debug(this,u,u.getVisibleCoordinates())),this.options.showPadding&&function(t){var e=t.transform.padding;dr(t,t.transform.height-(e.top||0),3,lr),dr(t,e.bottom||0,3,cr),Ar(t,e.left||0,3,hr),Ar(t,t.transform.width-(e.right||0),3,fr);var n=t.transform.centerPoint;!function(t,e,n,r){vr(t,e-1,n-10,2,20,r),vr(t,e-10,n-1,20,2,r)}(t,n.x,t.transform.height-n.y,pr)}(this),this.context.setDefault()},yr.prototype.renderLayer=function(t,e,n,r){n.isHidden(this.transform.zoom)||("background"===n.type||"custom"===n.type||r.length)&&(this.id=n.id,this.gpuTimingStart(n),mr[n.type](t,e,n,r,this.style.placement.variableOffsets),this.gpuTimingEnd())},yr.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)}},yr.prototype.gpuTimingEnd=function(){if(this.options.gpuTiming){var t=this.context.extTimerQuery;t.endQueryEXT(t.TIME_ELAPSED_EXT)}},yr.prototype.collectGpuTimers=function(){var t=this.gpuTimers;return this.gpuTimers={},t},yr.prototype.queryGpuTimers=function(t){var e={};for(var n in t){var r=t[n],i=this.context.extTimerQuery,o=i.getQueryObjectEXT(r.query,i.QUERY_RESULT_EXT)/1e6;i.deleteQueryEXT(r.query),e[n]=o}return e},yr.prototype.translatePosMatrix=function(e,n,r,i,o){if(!r[0]&&!r[1])return e;var a=o?"map"===i?this.transform.angle:0:"viewport"===i?-this.transform.angle:0;if(a){var s=Math.sin(a),u=Math.cos(a);r=[r[0]*u-r[1]*s,r[0]*s+r[1]*u]}var l=[o?r[0]:fe(n,r[0],this.transform.zoom),o?r[1]:fe(n,r[1],this.transform.zoom),0],c=new Float32Array(16);return t.translate(c,e,l),c},yr.prototype.saveTileTexture=function(t){var e=this._tileTextures[t.size[0]];e?e.push(t):this._tileTextures[t.size[0]]=[t]},yr.prototype.getTileTexture=function(t){var e=this._tileTextures[t];return e&&e.length>0?e.pop():null},yr.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},yr.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,yn[t],e,Kn[t],this._showOverdrawInspector)),this.cache[n]},yr.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()},yr.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)},yr.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))},yr.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var _r=function(t,e){this.points=t,this.planes=e};_r.fromInvProjectionMatrix=function(e,n,r){var i=Math.pow(2,r),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*i)})),a=[[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]]),r=t.sub([],o[e[2]],o[e[1]]),i=t.normalize([],t.cross([],n,r)),a=-t.dot(i,o[e[1]]);return i.concat(a)}));return new _r(o,a)};var br=function(e,n){this.min=e,this.max=n,this.center=t.scale$2([],t.add([],this.min,this.max),.5)};br.prototype.quadrant=function(e){for(var n=[e%2==0,e<2],r=t.clone$2(this.min),i=t.clone$2(this.max),o=0;o<n.length;o++)r[o]=n[o]?this.min[o]:this.center[o],i[o]=n[o]?this.center[o]:this.max[o];return i[2]=this.max[2],new br(r,i)},br.prototype.distanceX=function(t){return Math.max(Math.min(this.max[0],t[0]),this.min[0])-t[0]},br.prototype.distanceY=function(t){return Math.max(Math.min(this.max[1],t[1]),this.min[1])-t[1]},br.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]],r=!0,i=0;i<e.planes.length;i++){for(var o=e.planes[i],a=0,s=0;s<n.length;s++)a+=t.dot$1(o,n[s])>=0;if(0===a)return 0;a!==n.length&&(r=!1)}if(r)return 2;for(var u=0;u<3;u++){for(var l=Number.MAX_VALUE,c=-Number.MAX_VALUE,h=0;h<e.points.length;h++){var f=e.points[h][u]-this.min[u];l=Math.min(l,f),c=Math.max(c,f)}if(c<0||l>this.max[u]-this.min[u])return 0}return 1};var xr=function(t,e,n,r){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===r&&(r=0),isNaN(t)||t<0||isNaN(e)||e<0||isNaN(n)||n<0||isNaN(r)||r<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=e,this.left=n,this.right=r};xr.prototype.interpolate=function(e,n,r){return null!=n.top&&null!=e.top&&(this.top=t.number(e.top,n.top,r)),null!=n.bottom&&null!=e.bottom&&(this.bottom=t.number(e.bottom,n.bottom,r)),null!=n.left&&null!=e.left&&(this.left=t.number(e.left,n.left,r)),null!=n.right&&null!=e.right&&(this.right=t.number(e.right,n.right,r)),this},xr.prototype.getCenter=function(e,n){var r=t.clamp((this.left+e-this.right)/2,0,e),i=t.clamp((this.top+n-this.bottom)/2,0,n);return new t.Point(r,i)},xr.prototype.equals=function(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right},xr.prototype.clone=function(){return new xr(this.top,this.bottom,this.left,this.right)},xr.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var wr=function(e,n,r,i,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==r?0:r,this._maxPitch=null==i?60:i,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 xr,this._posMatrixCache={},this._alignedPosMatrixCache={}},Cr={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}};wr.prototype.clone=function(){var t=new wr(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},Cr.minZoom.get=function(){return this._minZoom},Cr.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},Cr.maxZoom.get=function(){return this._maxZoom},Cr.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},Cr.minPitch.get=function(){return this._minPitch},Cr.minPitch.set=function(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))},Cr.maxPitch.get=function(){return this._maxPitch},Cr.maxPitch.set=function(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))},Cr.renderWorldCopies.get=function(){return this._renderWorldCopies},Cr.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t},Cr.worldSize.get=function(){return this.tileSize*this.scale},Cr.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},Cr.size.get=function(){return new t.Point(this.width,this.height)},Cr.bearing.get=function(){return-this.angle/Math.PI*180},Cr.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))},Cr.pitch.get=function(){return this._pitch/Math.PI*180},Cr.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())},Cr.fov.get=function(){return this._fov/Math.PI*180},Cr.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())},Cr.zoom.get=function(){return this._zoom},Cr.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())},Cr.center.get=function(){return this._center},Cr.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},Cr.padding.get=function(){return this._edgeInsets.toJSON()},Cr.padding.set=function(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())},Cr.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},wr.prototype.isPaddingEqual=function(t){return this._edgeInsets.equals(t)},wr.prototype.interpolatePadding=function(t,e,n){this._unmodified=!1,this._edgeInsets.interpolate(t,e,n),this._constrain(),this._calcMatrices()},wr.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)},wr.prototype.getVisibleUnwrappedCoordinates=function(e){var n=[new t.UnwrappedTileID(0,e)];if(this._renderWorldCopies)for(var r=this.pointCoordinate(new t.Point(0,0)),i=this.pointCoordinate(new t.Point(this.width,0)),o=this.pointCoordinate(new t.Point(this.width,this.height)),a=this.pointCoordinate(new t.Point(0,this.height)),s=Math.floor(Math.min(r.x,i.x,o.x,a.x)),u=Math.floor(Math.max(r.x,i.x,o.x,a.x)),l=s-1;l<=u+1;l++)0!==l&&n.push(new t.UnwrappedTileID(l,e));return n},wr.prototype.coveringTiles=function(e){var n=this.coveringZoomLevel(e),r=n;if(void 0!==e.minzoom&&n<e.minzoom)return[];void 0!==e.maxzoom&&n>e.maxzoom&&(n=e.maxzoom);var i=t.MercatorCoordinate.fromLngLat(this.center),o=Math.pow(2,n),a=[o*i.x,o*i.y,0],s=_r.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,n),u=e.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(u=n);var l=function(t){return{aabb:new br([t*o,0,0],[(t+1)*o,o,0]),zoom:0,x:0,y:0,wrap:t,fullyVisible:!1}},c=[],h=[],f=n,p=e.reparseOverscaled?r:n;if(this._renderWorldCopies)for(var d=1;d<=3;d++)c.push(l(-d)),c.push(l(d));for(c.push(l(0));c.length>0;){var A=c.pop(),v=A.x,g=A.y,m=A.fullyVisible;if(!m){var y=A.aabb.intersects(s);if(0===y)continue;m=2===y}var _=A.aabb.distanceX(a),b=A.aabb.distanceY(a),x=Math.max(Math.abs(_),Math.abs(b));if(A.zoom===f||x>3+(1<<f-A.zoom)-2&&A.zoom>=u)h.push({tileID:new t.OverscaledTileID(A.zoom===f?p:A.zoom,A.wrap,A.zoom,v,g),distanceSq:t.sqrLen([a[0]-.5-v,a[1]-.5-g])});else for(var w=0;w<4;w++){var C=(v<<1)+w%2,B=(g<<1)+(w>>1);c.push({aabb:A.aabb.quadrant(w),zoom:A.zoom+1,x:C,y:B,wrap:A.wrap,fullyVisible:m})}}return h.sort((function(t,e){return t.distanceSq-e.distanceSq})).map((function(t){return t.tileID}))},wr.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()},Cr.unmodified.get=function(){return this._unmodified},wr.prototype.zoomScale=function(t){return Math.pow(2,t)},wr.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},wr.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)},wr.prototype.unproject=function(e){return new t.MercatorCoordinate(e.x/this.worldSize,e.y/this.worldSize).toLngLat()},Cr.point.get=function(){return this.project(this.center)},wr.prototype.setLocationAtPoint=function(e,n){var r=this.pointCoordinate(n),i=this.pointCoordinate(this.centerPoint),o=this.locationCoordinate(e),a=new t.MercatorCoordinate(o.x-(r.x-i.x),o.y-(r.y-i.y));this.center=this.coordinateLocation(a),this._renderWorldCopies&&(this.center=this.center.wrap())},wr.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},wr.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},wr.prototype.locationCoordinate=function(e){return t.MercatorCoordinate.fromLngLat(e)},wr.prototype.coordinateLocation=function(t){return t.toLngLat()},wr.prototype.pointCoordinate=function(e){var n=[e.x,e.y,0,1],r=[e.x,e.y,1,1];t.transformMat4(n,n,this.pixelMatrixInverse),t.transformMat4(r,r,this.pixelMatrixInverse);var i=n[3],o=r[3],a=n[1]/i,s=r[1]/o,u=n[2]/i,l=r[2]/o,c=u===l?0:(0-u)/(l-u);return new t.MercatorCoordinate(t.number(n[0]/i,r[0]/o,c)/this.worldSize,t.number(a,s,c)/this.worldSize)},wr.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])},wr.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)))},wr.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},wr.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])},wr.prototype.calculatePosMatrix=function(e,n){void 0===n&&(n=!1);var r=e.key,i=n?this._alignedPosMatrixCache:this._posMatrixCache;if(i[r])return i[r];var o=e.canonical,a=this.worldSize/this.zoomScale(o.z),s=o.x+Math.pow(2,o.z)*e.wrap,u=t.identity(new Float64Array(16));return t.translate(u,u,[s*a,o.y*a,0]),t.scale(u,u,[a/t.EXTENT,a/t.EXTENT,1]),t.multiply(u,n?this.alignedProjMatrix:this.projMatrix,u),i[r]=new Float32Array(u),i[r]},wr.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},wr.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var e,n,r,i,o=-90,a=90,s=-180,u=180,l=this.size,c=this._unmodified;if(this.latRange){var h=this.latRange;o=t.mercatorYfromLat(h[1])*this.worldSize,e=(a=t.mercatorYfromLat(h[0])*this.worldSize)-o<l.y?l.y/(a-o):0}if(this.lngRange){var f=this.lngRange;s=t.mercatorXfromLng(f[0])*this.worldSize,n=(u=t.mercatorXfromLng(f[1])*this.worldSize)-s<l.x?l.x/(u-s):0}var p=this.point,d=Math.max(n||0,e||0);if(d)return this.center=this.unproject(new t.Point(n?(u+s)/2:p.x,e?(a+o)/2:p.y)),this.zoom+=this.scaleZoom(d),this._unmodified=c,void(this._constraining=!1);if(this.latRange){var A=p.y,v=l.y/2;A-v<o&&(i=o+v),A+v>a&&(i=a-v)}if(this.lngRange){var g=p.x,m=l.x/2;g-m<s&&(r=s+m),g+m>u&&(r=u-m)}void 0===r&&void 0===i||(this.center=this.unproject(new t.Point(void 0!==r?r:p.x,void 0!==i?i:p.y))),this._unmodified=c,this._constraining=!1}},wr.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,r=this._fov*(.5+e.y/this.height),i=Math.sin(r)*this.cameraToCenterDistance/Math.sin(t.clamp(Math.PI-n-r,.01,Math.PI-.01)),o=this.point,a=o.x,s=o.y,u=1.01*(Math.cos(Math.PI/2-this._pitch)*i+this.cameraToCenterDistance),l=this.height/50,c=new Float64Array(16);t.perspective(c,this._fov,this.width/this.height,l,u),c[8]=2*-e.x/this.width,c[9]=2*e.y/this.height,t.scale(c,c,[1,-1,1]),t.translate(c,c,[0,0,-this.cameraToCenterDistance]),t.rotateX(c,c,this._pitch),t.rotateZ(c,c,this.angle),t.translate(c,c,[-a,-s,0]),this.mercatorMatrix=t.scale([],c,[this.worldSize,this.worldSize,this.worldSize]),t.scale(c,c,[1,1,t.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=c,this.invProjMatrix=t.invert([],this.projMatrix);var h=this.width%2/2,f=this.height%2/2,p=Math.cos(this.angle),d=Math.sin(this.angle),A=a-Math.round(a)+p*h+d*f,v=s-Math.round(s)+p*f+d*h,g=new Float64Array(c);if(t.translate(g,g,[A>.5?A-1:A,v>.5?v-1:v,0]),this.alignedProjMatrix=g,c=t.create(),t.scale(c,c,[this.width/2,-this.height/2,1]),t.translate(c,c,[1,-1,0]),this.labelPlaneMatrix=c,c=t.create(),t.scale(c,c,[1,-1,1]),t.translate(c,c,[-1,-1,0]),t.scale(c,c,[2/this.width,2/this.height,1]),this.glCoordMatrix=c,this.pixelMatrix=t.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(c=t.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=c,this._posMatrixCache={},this._alignedPosMatrixCache={}}},wr.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},wr.prototype.getCameraPoint=function(){var e=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.Point(0,e))},wr.prototype.getCameraQueryGeometry=function(e){var n=this.getCameraPoint();if(1===e.length)return[e[0],n];for(var r=n.x,i=n.y,o=n.x,a=n.y,s=0,u=e;s<u.length;s+=1){var l=u[s];r=Math.min(r,l.x),i=Math.min(i,l.y),o=Math.max(o,l.x),a=Math.max(a,l.y)}return[new t.Point(r,i),new t.Point(o,i),new t.Point(o,a),new t.Point(r,a),new t.Point(r,i)]},Object.defineProperties(wr.prototype,Cr);var Br=function(e){var n,r,i,o;this._hashName=e&&encodeURIComponent(e),t.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=(n=this._updateHashUnthrottled.bind(this),r=!1,i=null,o=function(){i=null,r&&(n(),i=setTimeout(o,300),r=!1)},function(){return r=!0,i||o(),i})};Br.prototype.addTo=function(e){return this._map=e,t.window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},Br.prototype.remove=function(){return t.window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},Br.prototype.getHashString=function(e){var n=this._map.getCenter(),r=Math.round(100*this._map.getZoom())/100,i=Math.ceil((r*Math.LN2+Math.log(512/360/.5))/Math.LN10),o=Math.pow(10,i),a=Math.round(n.lng*o)/o,s=Math.round(n.lat*o)/o,u=this._map.getBearing(),l=this._map.getPitch(),c="";if(c+=e?"/"+a+"/"+s+"/"+r:r+"/"+s+"/"+a,(u||l)&&(c+="/"+Math.round(10*u)/10),l&&(c+="/"+Math.round(l)),this._hashName){var h=this._hashName,f=!1,p=t.window.location.hash.slice(1).split("&").map((function(t){var e=t.split("=")[0];return e===h?(f=!0,e+"="+c):t})).filter((function(t){return t}));return f||p.push(h+"="+c),"#"+p.join("&")}return"#"+c},Br.prototype._getCurrentHash=function(){var e,n=this,r=t.window.location.hash.replace("#","");return this._hashName?(r.split("&").map((function(t){return t.split("=")})).forEach((function(t){t[0]===n._hashName&&(e=t)})),(e&&e[1]||"").split("/")):r.split("/")},Br.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},Br.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 kr={linearity:.3,easing:t.bezier(0,0,.3,1)},Er=t.extend({deceleration:2500,maxSpeed:1400},kr),Sr=t.extend({deceleration:20,maxSpeed:1400},kr),Tr=t.extend({deceleration:1e3,maxSpeed:360},kr),Mr=t.extend({deceleration:1e3,maxSpeed:90},kr),Ir=function(t){this._map=t,this.clear()};function Pr(t,e){(!t.duration||t.duration<e.duration)&&(t.duration=e.duration,t.easing=e.easing)}function Zr(e,n,r){var i=r.maxSpeed,o=r.linearity,a=r.deceleration,s=t.clamp(e*o/(n/1e3),-i,i),u=Math.abs(s)/(a*o);return{easing:r.easing,duration:1e3*u,amount:s*(u/2)}}Ir.prototype.clear=function(){this._inertiaBuffer=[]},Ir.prototype.record=function(e){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:t.browser.now(),settings:e})},Ir.prototype._drainInertiaBuffer=function(){for(var e=this._inertiaBuffer,n=t.browser.now();e.length>0&&n-e[0].time>160;)e.shift()},Ir.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},r=0,i=this._inertiaBuffer;r<i.length;r+=1){var o=i[r].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 a=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,s={};if(n.pan.mag()){var u=Zr(n.pan.mag(),a,t.extend({},Er,e||{}));s.offset=n.pan.mult(u.amount/n.pan.mag()),s.center=this._map.transform.center,Pr(s,u)}if(n.zoom){var l=Zr(n.zoom,a,Sr);s.zoom=this._map.transform.zoom+l.amount,Pr(s,l)}if(n.bearing){var c=Zr(n.bearing,a,Tr);s.bearing=this._map.transform.bearing+t.clamp(c.amount,-179,179),Pr(s,c)}if(n.pitch){var h=Zr(n.pitch,a,Mr);s.pitch=this._map.transform.pitch+h.amount,Pr(s,h)}if(s.zoom||s.bearing){var f=void 0===n.pinchAround?n.around:n.pinchAround;s.around=f?this._map.unproject(f):this._map.getCenter()}return this.clear(),t.extend(s,{noMoveStart:!0})}};var Dr=function(e){function r(r,i,o,a){void 0===a&&(a={});var s=n.mousePos(i.getCanvasContainer(),o),u=i.unproject(s);e.call(this,r,t.extend({point:s,lngLat:u,originalEvent:o},a)),this._defaultPrevented=!1,this.target=i}e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r;var i={defaultPrevented:{configurable:!0}};return r.prototype.preventDefault=function(){this._defaultPrevented=!0},i.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(r.prototype,i),r}(t.Event),Lr=function(e){function r(r,i,o){var a="touchend"===r?o.changedTouches:o.touches,s=n.touchPos(i.getCanvasContainer(),a),u=s.map((function(t){return i.unproject(t)})),l=s.reduce((function(t,e,n,r){return t.add(e.div(r.length))}),new t.Point(0,0)),c=i.unproject(l);e.call(this,r,{points:s,point:l,lngLats:u,lngLat:c,originalEvent:o}),this._defaultPrevented=!1}e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r;var i={defaultPrevented:{configurable:!0}};return r.prototype.preventDefault=function(){this._defaultPrevented=!0},i.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(r.prototype,i),r}(t.Event),Or=function(t){function e(e,n,r){t.call(this,e,{originalEvent:r}),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),Fr=function(t,e){this._map=t,this._clickTolerance=e.clickTolerance};Fr.prototype.reset=function(){delete this._mousedownPos},Fr.prototype.wheel=function(t){return this._firePreventable(new Or(t.type,this._map,t))},Fr.prototype.mousedown=function(t,e){return this._mousedownPos=e,this._firePreventable(new Dr(t.type,this._map,t))},Fr.prototype.mouseup=function(t){this._map.fire(new Dr(t.type,this._map,t))},Fr.prototype.click=function(t,e){this._mousedownPos&&this._mousedownPos.dist(e)>=this._clickTolerance||this._map.fire(new Dr(t.type,this._map,t))},Fr.prototype.dblclick=function(t){return this._firePreventable(new Dr(t.type,this._map,t))},Fr.prototype.mouseover=function(t){this._map.fire(new Dr(t.type,this._map,t))},Fr.prototype.mouseout=function(t){this._map.fire(new Dr(t.type,this._map,t))},Fr.prototype.touchstart=function(t){return this._firePreventable(new Lr(t.type,this._map,t))},Fr.prototype.touchmove=function(t){this._map.fire(new Lr(t.type,this._map,t))},Fr.prototype.touchend=function(t){this._map.fire(new Lr(t.type,this._map,t))},Fr.prototype.touchcancel=function(t){this._map.fire(new Lr(t.type,this._map,t))},Fr.prototype._firePreventable=function(t){if(this._map.fire(t),t.defaultPrevented)return{}},Fr.prototype.isEnabled=function(){return!0},Fr.prototype.isActive=function(){return!1},Fr.prototype.enable=function(){},Fr.prototype.disable=function(){};var Rr=function(t){this._map=t};Rr.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},Rr.prototype.mousemove=function(t){this._map.fire(new Dr(t.type,this._map,t))},Rr.prototype.mousedown=function(){this._delayContextMenu=!0},Rr.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Dr("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},Rr.prototype.contextmenu=function(t){this._delayContextMenu?this._contextMenuEvent=t:this._map.fire(new Dr(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()},Rr.prototype.isEnabled=function(){return!0},Rr.prototype.isActive=function(){return!1},Rr.prototype.enable=function(){},Rr.prototype.disable=function(){};var zr=function(t,e){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=e.clickTolerance||1};function Ur(t,e){for(var n={},r=0;r<t.length;r++)n[t[r].identifier]=e[r];return n}zr.prototype.isEnabled=function(){return!!this._enabled},zr.prototype.isActive=function(){return!!this._active},zr.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},zr.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},zr.prototype.mousedown=function(t,e){this.isEnabled()&&t.shiftKey&&0===t.button&&(n.disableDrag(),this._startPos=this._lastPos=e,this._active=!0)},zr.prototype.mousemoveWindow=function(t,e){if(this._active){var r=e;if(!(this._lastPos.equals(r)||!this._box&&r.dist(this._startPos)<this._clickTolerance)){var i=this._startPos;this._lastPos=r,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(i.x,r.x),a=Math.max(i.x,r.x),s=Math.min(i.y,r.y),u=Math.max(i.y,r.y);n.setTransform(this._box,"translate("+o+"px,"+s+"px)"),this._box.style.width=a-o+"px",this._box.style.height=u-s+"px"}}},zr.prototype.mouseupWindow=function(e,r){var i=this;if(this._active&&0===e.button){var o=this._startPos,a=r;if(this.reset(),n.suppressClick(),o.x!==a.x||o.y!==a.y)return this._map.fire(new t.Event("boxzoomend",{originalEvent:e})),{cameraAnimation:function(t){return t.fitScreenCoordinates(o,a,i._map.getBearing(),{linear:!0})}};this._fireEvent("boxzoomcancel",e)}},zr.prototype.keydown=function(t){this._active&&27===t.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",t))},zr.prototype.blur=function(){this.reset()},zr.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},zr.prototype._fireEvent=function(e,n){return this._map.fire(new t.Event(e,{originalEvent:n}))};var Nr=function(t){this.reset(),this.numTouches=t.numTouches};Nr.prototype.reset=function(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1},Nr.prototype.touchstart=function(e,n,r){(this.centroid||r.length>this.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=e.timeStamp),r.length===this.numTouches&&(this.centroid=function(e){for(var n=new t.Point(0,0),r=0,i=e;r<i.length;r+=1)n._add(i[r]);return n.div(e.length)}(n),this.touches=Ur(r,n)))},Nr.prototype.touchmove=function(t,e,n){if(!this.aborted&&this.centroid){var r=Ur(n,e);for(var i in this.touches){var o=r[i];(!o||o.dist(this.touches[i])>30)&&(this.aborted=!0)}}},Nr.prototype.touchend=function(t,e,n){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),0===n.length){var r=!this.aborted&&this.centroid;if(this.reset(),r)return r}};var Gr=function(t){this.singleTap=new Nr(t),this.numTaps=t.numTaps,this.reset()};Gr.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},Gr.prototype.touchstart=function(t,e,n){this.singleTap.touchstart(t,e,n)},Gr.prototype.touchmove=function(t,e,n){this.singleTap.touchmove(t,e,n)},Gr.prototype.touchend=function(t,e,n){var r=this.singleTap.touchend(t,e,n);if(r){var i=t.timeStamp-this.lastTime<500,o=!this.lastTap||this.lastTap.dist(r)<30;if(i&&o||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=r,this.count===this.numTaps)return this.reset(),r}};var jr=function(){this._zoomIn=new Gr({numTouches:1,numTaps:2}),this._zoomOut=new Gr({numTouches:2,numTaps:1}),this.reset()};jr.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},jr.prototype.touchstart=function(t,e,n){this._zoomIn.touchstart(t,e,n),this._zoomOut.touchstart(t,e,n)},jr.prototype.touchmove=function(t,e,n){this._zoomIn.touchmove(t,e,n),this._zoomOut.touchmove(t,e,n)},jr.prototype.touchend=function(t,e,n){var r=this,i=this._zoomIn.touchend(t,e,n),o=this._zoomOut.touchend(t,e,n);return i?(this._active=!0,t.preventDefault(),setTimeout((function(){return r.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()+1,around:e.unproject(i)},{originalEvent:t})}}):o?(this._active=!0,t.preventDefault(),setTimeout((function(){return r.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()-1,around:e.unproject(o)},{originalEvent:t})}}):void 0},jr.prototype.touchcancel=function(){this.reset()},jr.prototype.enable=function(){this._enabled=!0},jr.prototype.disable=function(){this._enabled=!1,this.reset()},jr.prototype.isEnabled=function(){return this._enabled},jr.prototype.isActive=function(){return this._active};var Vr={0:1,2:2},Hr=function(t){this.reset(),this._clickTolerance=t.clickTolerance||1};Hr.prototype.blur=function(){this.reset()},Hr.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},Hr.prototype._correctButton=function(t,e){return!1},Hr.prototype._move=function(t,e){return{}},Hr.prototype.mousedown=function(t,e){if(!this._lastPoint){var r=n.mouseButton(t);this._correctButton(t,r)&&(this._lastPoint=e,this._eventButton=r)}},Hr.prototype.mousemoveWindow=function(t,e){var n=this._lastPoint;if(n)if(t.preventDefault(),function(t,e){var n=Vr[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)},Hr.prototype.mouseupWindow=function(t){this._lastPoint&&n.mouseButton(t)===this._eventButton&&(this._moved&&n.suppressClick(),this.reset())},Hr.prototype.enable=function(){this._enabled=!0},Hr.prototype.disable=function(){this._enabled=!1,this.reset()},Hr.prototype.isEnabled=function(){return this._enabled},Hr.prototype.isActive=function(){return this._active};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.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}(Hr),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._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}(Hr),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._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}(Hr),qr=function(t){this._minTouches=1,this._clickTolerance=t.clickTolerance||1,this.reset()};qr.prototype.reset=function(){this._active=!1,this._touches={},this._sum=new t.Point(0,0)},qr.prototype.touchstart=function(t,e,n){return this._calculateTransform(t,e,n)},qr.prototype.touchmove=function(t,e,n){if(this._active&&!(n.length<this._minTouches))return t.preventDefault(),this._calculateTransform(t,e,n)},qr.prototype.touchend=function(t,e,n){this._calculateTransform(t,e,n),this._active&&n.length<this._minTouches&&this.reset()},qr.prototype.touchcancel=function(){this.reset()},qr.prototype._calculateTransform=function(e,n,r){r.length>0&&(this._active=!0);var i=Ur(r,n),o=new t.Point(0,0),a=new t.Point(0,0),s=0;for(var u in i){var l=i[u],c=this._touches[u];c&&(o._add(l),a._add(l.sub(c)),s++,i[u]=l)}if(this._touches=i,!(s<this._minTouches)&&a.mag()){var h=a.div(s);if(this._sum._add(h),!(this._sum.mag()<this._clickTolerance))return{around:o.div(s),panDelta:h}}},qr.prototype.enable=function(){this._enabled=!0},qr.prototype.disable=function(){this._enabled=!1,this.reset()},qr.prototype.isEnabled=function(){return this._enabled},qr.prototype.isActive=function(){return this._active};var Kr=function(){this.reset()};function Xr(t,e,n){for(var r=0;r<t.length;r++)if(t[r].identifier===n)return e[r]}function Yr(t,e){return Math.log(t/e)/Math.LN2}Kr.prototype.reset=function(){this._active=!1,delete this._firstTwoTouches},Kr.prototype._start=function(t){},Kr.prototype._move=function(t,e,n){return{}},Kr.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]]))},Kr.prototype.touchmove=function(t,e,n){if(this._firstTwoTouches){t.preventDefault();var r=this._firstTwoTouches,i=r[1],o=Xr(n,e,r[0]),a=Xr(n,e,i);if(o&&a){var s=this._aroundCenter?null:o.add(a).div(2);return this._move([o,a],s,t)}}},Kr.prototype.touchend=function(t,e,r){if(this._firstTwoTouches){var i=this._firstTwoTouches,o=i[1],a=Xr(r,e,i[0]),s=Xr(r,e,o);a&&s||(this._active&&n.suppressClick(),this.reset())}},Kr.prototype.touchcancel=function(){this.reset()},Kr.prototype.enable=function(t){this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around},Kr.prototype.disable=function(){this._enabled=!1,this.reset()},Kr.prototype.isEnabled=function(){return this._enabled},Kr.prototype.isActive=function(){return this._active};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.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(Yr(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:Yr(this._distance,n),pinchAround:e}},e}(Kr);function ti(t,e){return 180*t.angleWith(e)/Math.PI}var ei=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:ti(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=ti(t,this._startVector);return Math.abs(n)<e},e}(Kr);function ni(t){return Math.abs(t.y)>Math.abs(t.x)}var ri=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,ni(t[0].sub(t[1]))&&(this._valid=!1)},e.prototype._move=function(t,e,n){var r=t[0].sub(this._lastPoints[0]),i=t[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(r,i,n.timeStamp),this._valid)return this._lastPoints=t,this._active=!0,{pitchDelta:(r.y+i.y)/2*-.5}},e.prototype.gestureBeginsVertically=function(t,e,n){if(void 0!==this._valid)return this._valid;var r=t.mag()>=2,i=e.mag()>=2;if(r||i){if(!r||!i)return void 0===this._firstMove&&(this._firstMove=n),n-this._firstMove<100&&void 0;var o=t.y>0==e.y>0;return ni(t)&&ni(e)&&o}},e}(Kr),ii={panStep:100,bearingStep:15,pitchStep:10},oi=function(){var t=ii;this._panStep=t.panStep,this._bearingStep=t.bearingStep,this._pitchStep=t.pitchStep,this._rotationDisabled=!1};function ai(t){return t*(2-t)}oi.prototype.blur=function(){this.reset()},oi.prototype.reset=function(){this._active=!1},oi.prototype.keydown=function(t){var e=this;if(!(t.altKey||t.ctrlKey||t.metaKey)){var n=0,r=0,i=0,o=0,a=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?r=-1:(t.preventDefault(),o=-1);break;case 39:t.shiftKey?r=1:(t.preventDefault(),o=1);break;case 38:t.shiftKey?i=1:(t.preventDefault(),a=-1);break;case 40:t.shiftKey?i=-1:(t.preventDefault(),a=1);break;default:return}return this._rotationDisabled&&(r=0,i=0),{cameraAnimation:function(s){var u=s.getZoom();s.easeTo({duration:300,easeId:"keyboardHandler",easing:ai,zoom:n?Math.round(u)+n*(t.shiftKey?2:1):u,bearing:s.getBearing()+r*e._bearingStep,pitch:s.getPitch()+i*e._pitchStep,offset:[-o*e._panStep,-a*e._panStep],center:s.getCenter()},{originalEvent:t})}}}},oi.prototype.enable=function(){this._enabled=!0},oi.prototype.disable=function(){this._enabled=!1,this.reset()},oi.prototype.isEnabled=function(){return this._enabled},oi.prototype.isActive=function(){return this._active},oi.prototype.disableRotation=function(){this._rotationDisabled=!0},oi.prototype.enableRotation=function(){this._rotationDisabled=!1};var si=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)};si.prototype.setZoomRate=function(t){this._defaultZoomRate=t},si.prototype.setWheelZoomRate=function(t){this._wheelZoomRate=t},si.prototype.isEnabled=function(){return!!this._enabled},si.prototype.isActive=function(){return!!this._active||void 0!==this._finishTimeout},si.prototype.isZooming=function(){return!!this._zooming},si.prototype.enable=function(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},si.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},si.prototype.wheel=function(e){if(this.isEnabled()){var n=e.deltaMode===t.window.WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY,r=t.browser.now(),i=r-(this._lastWheelEventTime||0);this._lastWheelEventTime=r,0!==n&&n%4.000244140625==0?this._type="wheel":0!==n&&Math.abs(n)<4?this._type="trackpad":i>400?(this._type=null,this._lastValue=n,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(i*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()}},si.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)},si.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 r=n.mousePos(this._el,e);this._around=t.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(r)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},si.prototype.renderFrame=function(){var e=this;if(this._frameId&&(this._frameId=null,this.isActive())){var n=this._map.transform;if(0!==this._delta){var r="wheel"===this._type&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,i=2/(1+Math.exp(-Math.abs(this._delta*r)));this._delta<0&&0!==i&&(i=1/i);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*i))),"wheel"===this._type&&(this._startZoom=n.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var a,s="number"==typeof this._targetZoom?this._targetZoom:n.zoom,u=this._startZoom,l=this._easing,c=!1;if("wheel"===this._type&&u&&l){var h=Math.min((t.browser.now()-this._lastWheelEventTime)/200,1),f=l(h);a=t.number(u,s,f),h<1?this._frameId||(this._frameId=!0):c=!0}else a=s,c=!0;return this._active=!0,c&&(this._active=!1,this._finishTimeout=setTimeout((function(){e._zooming=!1,e._handler._triggerRenderFrame(),delete e._targetZoom,delete e._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!c,zoomDelta:a-n.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},si.prototype._smoothOutEasing=function(e){var n=t.ease;if(this._prevEase){var r=this._prevEase,i=(t.browser.now()-r.start)/r.duration,o=r.easing(i+.01)-r.easing(i),a=.27/Math.sqrt(o*o+1e-4)*.01,s=Math.sqrt(.0729-a*a);n=t.bezier(a,s,.25,1)}return this._prevEase={start:t.browser.now(),duration:e,easing:n},n},si.prototype.blur=function(){this.reset()},si.prototype.reset=function(){this._active=!1};var ui=function(t,e){this._clickZoom=t,this._tapZoom=e};ui.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},ui.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},ui.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},ui.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var li=function(){this.reset()};li.prototype.reset=function(){this._active=!1},li.prototype.blur=function(){this.reset()},li.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})}}},li.prototype.enable=function(){this._enabled=!0},li.prototype.disable=function(){this._enabled=!1,this.reset()},li.prototype.isEnabled=function(){return this._enabled},li.prototype.isActive=function(){return this._active};var ci=function(){this._tap=new Gr({numTouches:1,numTaps:1}),this.reset()};ci.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},ci.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))},ci.prototype.touchmove=function(t,e,n){if(this._tapTime){if(this._swipePoint){if(n[0].identifier!==this._swipeTouch)return;var r=e[0],i=r.y-this._swipePoint.y;return this._swipePoint=r,t.preventDefault(),this._active=!0,{zoomDelta:i/128}}}else this._tap.touchmove(t,e,n)},ci.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)},ci.prototype.touchcancel=function(){this.reset()},ci.prototype.enable=function(){this._enabled=!0},ci.prototype.disable=function(){this._enabled=!1,this.reset()},ci.prototype.isEnabled=function(){return this._enabled},ci.prototype.isActive=function(){return this._active};var hi=function(t,e,n){this._el=t,this._mousePan=e,this._touchPan=n};hi.prototype.enable=function(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},hi.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},hi.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},hi.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var fi=function(t,e,n){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=e,this._mousePitch=n};fi.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},fi.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},fi.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},fi.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var pi=function(t,e,n,r){this._el=t,this._touchZoom=e,this._touchRotate=n,this._tapDragZoom=r,this._rotationDisabled=!1,this._enabled=!0};pi.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")},pi.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},pi.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},pi.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},pi.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},pi.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var di=function(t){return t.zoom||t.drag||t.pitch||t.rotate},Ai=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 vi(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta}var gi=function(e,r){this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Ir(e),this._bearingSnap=r.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(r),t.bindAll(["handleEvent","handleWindowEvent"],this);var i=this._el;this._listeners=[[i,"touchstart",{passive:!0}],[i,"touchmove",{passive:!1}],[i,"touchend",void 0],[i,"touchcancel",void 0],[i,"mousedown",void 0],[i,"mousemove",void 0],[i,"mouseup",void 0],[t.window.document,"mousemove",{capture:!0}],[t.window.document,"mouseup",void 0],[i,"mouseover",void 0],[i,"mouseout",void 0],[i,"dblclick",void 0],[i,"click",void 0],[i,"keydown",{capture:!1}],[i,"keyup",void 0],[i,"wheel",{passive:!1}],[i,"contextmenu",void 0],[t.window,"blur",void 0]];for(var o=0,a=this._listeners;o<a.length;o+=1){var s=a[o],u=s[0];n.addEventListener(u,s[1],u===t.window.document?this.handleWindowEvent:this.handleEvent,s[2])}};gi.prototype.destroy=function(){for(var e=0,r=this._listeners;e<r.length;e+=1){var i=r[e],o=i[0];n.removeEventListener(o,i[1],o===t.window.document?this.handleWindowEvent:this.handleEvent,i[2])}},gi.prototype._addDefaultHandlers=function(t){var e=this._map,n=e.getCanvasContainer();this._add("mapEvent",new Fr(e,t));var r=e.boxZoom=new zr(e,t);this._add("boxZoom",r);var i=new jr,o=new li;e.doubleClickZoom=new ui(o,i),this._add("tapZoom",i),this._add("clickZoom",o);var a=new ci;this._add("tapDragZoom",a);var s=e.touchPitch=new ri;this._add("touchPitch",s);var u=new Wr(t),l=new Qr(t);e.dragRotate=new fi(t,u,l),this._add("mouseRotate",u,["mousePitch"]),this._add("mousePitch",l,["mouseRotate"]);var c=new Jr(t),h=new qr(t);e.dragPan=new hi(n,c,h),this._add("mousePan",c),this._add("touchPan",h,["touchZoom","touchRotate"]);var f=new ei,p=new $r;e.touchZoomRotate=new pi(n,p,f,a),this._add("touchRotate",f,["touchPan","touchZoom"]),this._add("touchZoom",p,["touchPan","touchRotate"]);var d=e.scrollZoom=new si(e,this);this._add("scrollZoom",d,["mousePan"]);var A=e.keyboard=new oi;this._add("keyboard",A),this._add("blockableMapEvent",new Rr(e));for(var v=0,g=["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"];v<g.length;v+=1){var m=g[v];t.interactive&&t[m]&&e[m].enable(t[m])}},gi.prototype._add=function(t,e,n){this._handlers.push({handlerName:t,handler:e,allowed:n}),this._handlersById[t]=e},gi.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=[]}},gi.prototype.isActive=function(){for(var t=0,e=this._handlers;t<e.length;t+=1)if(e[t].handler.isActive())return!0;return!1},gi.prototype.isZooming=function(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()},gi.prototype.isRotating=function(){return!!this._eventsInProgress.rotate},gi.prototype.isMoving=function(){return Boolean(di(this._eventsInProgress))||this.isZooming()},gi.prototype._blockedByActive=function(t,e,n){for(var r in t)if(r!==n&&(!e||e.indexOf(r)<0))return!0;return!1},gi.prototype.handleWindowEvent=function(t){this.handleEvent(t,t.type+"Window")},gi.prototype._getMapTouches=function(t){for(var e=[],n=0,r=t;n<r.length;n+=1){var i=r[n];this._el.contains(i.target)&&e.push(i)}return e},gi.prototype.handleEvent=function(t,e){this._updatingCamera=!0;for(var r="renderFrame"===t.type?void 0:t,i={needsRenderFrame:!1},o={},a={},s=t.touches?this._getMapTouches(t.touches):void 0,u=s?n.touchPos(this._el,s):n.mousePos(this._el,t),l=0,c=this._handlers;l<c.length;l+=1){var h=c[l],f=h.handlerName,p=h.handler,d=h.allowed;if(p.isEnabled()){var A=void 0;this._blockedByActive(a,d,f)?p.reset():p[e||t.type]&&(A=p[e||t.type](t,u,s),this.mergeHandlerResult(i,o,A,f,r),A&&A.needsRenderFrame&&this._triggerRenderFrame()),(A||p.isActive())&&(a[f]=p)}}var v={};for(var g in this._previousActiveHandlers)a[g]||(v[g]=r);this._previousActiveHandlers=a,(Object.keys(v).length||vi(i))&&(this._changes.push([i,o,v]),this._triggerRenderFrame()),(Object.keys(a).length||vi(i))&&this._map._stop(!0),this._updatingCamera=!1;var m=i.cameraAnimation;m&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],m(this._map))},gi.prototype.mergeHandlerResult=function(e,n,r,i,o){if(r){t.extend(e,r);var a={handlerName:i,originalEvent:r.originalEvent||o};void 0!==r.zoomDelta&&(n.zoom=a),void 0!==r.panDelta&&(n.drag=a),void 0!==r.pitchDelta&&(n.pitch=a),void 0!==r.bearingDelta&&(n.rotate=a)}},gi.prototype._applyChanges=function(){for(var e={},n={},r={},i=0,o=this._changes;i<o.length;i+=1){var a=o[i],s=a[0],u=a[1],l=a[2];s.panDelta&&(e.panDelta=(e.panDelta||new t.Point(0,0))._add(s.panDelta)),s.zoomDelta&&(e.zoomDelta=(e.zoomDelta||0)+s.zoomDelta),s.bearingDelta&&(e.bearingDelta=(e.bearingDelta||0)+s.bearingDelta),s.pitchDelta&&(e.pitchDelta=(e.pitchDelta||0)+s.pitchDelta),void 0!==s.around&&(e.around=s.around),void 0!==s.pinchAround&&(e.pinchAround=s.pinchAround),s.noInertia&&(e.noInertia=s.noInertia),t.extend(n,u),t.extend(r,l)}this._updateMapTransform(e,n,r),this._changes=[]},gi.prototype._updateMapTransform=function(t,e,n){var r=this._map,i=r.transform;if(!vi(t))return this._fireEvents(e,n,!0);var o=t.panDelta,a=t.zoomDelta,s=t.bearingDelta,u=t.pitchDelta,l=t.around,c=t.pinchAround;void 0!==c&&(l=c),r._stop(!0),l=l||r.transform.centerPoint;var h=i.pointLocation(o?l.sub(o):l);s&&(i.bearing+=s),u&&(i.pitch+=u),a&&(i.zoom+=a),i.setLocationAtPoint(h,l),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(e,n,!0)},gi.prototype._fireEvents=function(e,n,r){var i=this,o=di(this._eventsInProgress),a=di(e),s={};for(var u in e)this._eventsInProgress[u]||(s[u+"start"]=e[u].originalEvent),this._eventsInProgress[u]=e[u];for(var l in!o&&a&&this._fireEvent("movestart",a.originalEvent),s)this._fireEvent(l,s[l]);for(var c in a&&this._fireEvent("move",a.originalEvent),e)this._fireEvent(c,e[c].originalEvent);var h,f={};for(var p in this._eventsInProgress){var d=this._eventsInProgress[p],A=d.handlerName,v=d.originalEvent;this._handlersById[A].isActive()||(delete this._eventsInProgress[p],f[p+"end"]=h=n[A]||v)}for(var g in f)this._fireEvent(g,f[g]);var m=di(this._eventsInProgress);if(r&&(o||a)&&!m){this._updatingCamera=!0;var y=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),_=function(t){return 0!==t&&-i._bearingSnap<t&&t<i._bearingSnap};y?(_(y.bearing||this._map.getBearing())&&(y.bearing=0),this._map.easeTo(y,{originalEvent:h})):(this._map.fire(new t.Event("moveend",{originalEvent:h})),_(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}},gi.prototype._fireEvent=function(e,n){this._map.fire(new t.Event(e,n?{originalEvent:n}:{}))},gi.prototype._requestFrame=function(){var t=this;return this._map.triggerRepaint(),this._map._renderTaskQueue.add((function(e){delete t._frameId,t.handleEvent(new Ai("renderFrame",{timeStamp:e})),t._applyChanges()}))},gi.prototype._triggerRenderFrame=function(){void 0===this._frameId&&(this._frameId=this._requestFrame())};var mi=function(e){function n(n,r){e.call(this),this._moving=!1,this._zooming=!1,this.transform=n,this._bearingSnap=r.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,r){return e=t.Point.convert(e).mult(-1),this.panTo(this.transform.center,t.extend({offset:e},n),r)},n.prototype.panTo=function(e,n,r){return this.easeTo(t.extend({center:e},n),r)},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,r){return this.easeTo(t.extend({zoom:e},n),r)},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,r){return this.easeTo(t.extend({bearing:e},n),r)},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 r=n&&n.bearing||0;return this._cameraForBoxAndBearing(e.getNorthWest(),e.getSouthEast(),r,n)},n.prototype._cameraForBoxAndBearing=function(e,n,r,i){var o={top:0,bottom:0,right:0,left:0};if("number"==typeof(i=t.extend({padding:o,offset:[0,0],maxZoom:this.transform.maxZoom},i)).padding){var a=i.padding;i.padding={top:a,bottom:a,right:a,left:a}}i.padding=t.extend(o,i.padding);var s=this.transform,u=s.padding,l=s.project(t.LngLat.convert(e)),c=s.project(t.LngLat.convert(n)),h=l.rotate(-r*Math.PI/180),f=c.rotate(-r*Math.PI/180),p=new t.Point(Math.max(h.x,f.x),Math.max(h.y,f.y)),d=new t.Point(Math.min(h.x,f.x),Math.min(h.y,f.y)),A=p.sub(d),v=(s.width-(u.left+u.right+i.padding.left+i.padding.right))/A.x,g=(s.height-(u.top+u.bottom+i.padding.top+i.padding.bottom))/A.y;if(!(g<0||v<0)){var m=Math.min(s.scaleZoom(s.scale*Math.min(v,g)),i.maxZoom),y="number"==typeof i.offset.x?new t.Point(i.offset.x,i.offset.y):t.Point.convert(i.offset),_=new t.Point((i.padding.left-i.padding.right)/2,(i.padding.top-i.padding.bottom)/2).rotate(r*Math.PI/180),b=y.add(_).mult(s.scale/s.zoomScale(m));return{center:s.unproject(l.add(c).div(2).sub(b)),zoom:m,bearing:r}}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,r,i,o){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(t.Point.convert(e)),this.transform.pointLocation(t.Point.convert(n)),r,i),i,o)},n.prototype._fitInternal=function(e,n,r){return e?(delete(n=t.extend(e,n)).padding,n.linear?this.easeTo(n,r):this.flyTo(n,r)):this},n.prototype.jumpTo=function(e,n){this.stop();var r=this.transform,i=!1,o=!1,a=!1;return"zoom"in e&&r.zoom!==+e.zoom&&(i=!0,r.zoom=+e.zoom),void 0!==e.center&&(r.center=t.LngLat.convert(e.center)),"bearing"in e&&r.bearing!==+e.bearing&&(o=!0,r.bearing=+e.bearing),"pitch"in e&&r.pitch!==+e.pitch&&(a=!0,r.pitch=+e.pitch),null==e.padding||r.isPaddingEqual(e.padding)||(r.padding=e.padding),this.fire(new t.Event("movestart",n)).fire(new t.Event("move",n)),i&&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)),a&&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 r=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 i=this.transform,o=this.getZoom(),a=this.getBearing(),s=this.getPitch(),u=this.getPadding(),l="zoom"in e?+e.zoom:o,c="bearing"in e?this._normalizeBearing(e.bearing,a):a,h="pitch"in e?+e.pitch:s,f="padding"in e?e.padding:i.padding,p=t.Point.convert(e.offset),d=i.centerPoint.add(p),A=i.pointLocation(d),v=t.LngLat.convert(e.center||A);this._normalizeCenter(v);var g,m,y=i.project(A),_=i.project(v).sub(y),b=i.zoomScale(l-o);e.around&&(g=t.LngLat.convert(e.around),m=i.locationPoint(g));var x={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||l!==o,this._rotating=this._rotating||a!==c,this._pitching=this._pitching||h!==s,this._padding=!i.isPaddingEqual(f),this._easeId=e.easeId,this._prepareEase(n,e.noMoveStart,x),this._ease((function(e){if(r._zooming&&(i.zoom=t.number(o,l,e)),r._rotating&&(i.bearing=t.number(a,c,e)),r._pitching&&(i.pitch=t.number(s,h,e)),r._padding&&(i.interpolatePadding(u,f,e),d=i.centerPoint.add(p)),g)i.setLocationAtPoint(g,m);else{var A=i.zoomScale(i.zoom-o),v=l>o?Math.min(2,b):Math.max(.5,b),x=Math.pow(v,1-e),w=i.unproject(y.add(_.mult(e*x)).mult(A));i.setLocationAtPoint(i.renderWorldCopies?w.wrap():w,d)}r._fireMoveEvents(n)}),(function(t){r._afterEase(n,t)}),e),this},n.prototype._prepareEase=function(e,n,r){void 0===r&&(r={}),this._moving=!0,n||r.moving||this.fire(new t.Event("movestart",e)),this._zooming&&!r.zooming&&this.fire(new t.Event("zoomstart",e)),this._rotating&&!r.rotating&&this.fire(new t.Event("rotatestart",e)),this._pitching&&!r.pitching&&this.fire(new t.Event("pitchstart",e))},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 r=this._zooming,i=this._rotating,o=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,r&&this.fire(new t.Event("zoomend",e)),i&&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 r=this;if(!e.essential&&t.browser.prefersReducedMotion){var i=t.pick(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(i,n)}this.stop(),e=t.extend({offset:[0,0],speed:1.2,curve:1.42,easing:t.ease},e);var o=this.transform,a=this.getZoom(),s=this.getBearing(),u=this.getPitch(),l=this.getPadding(),c="zoom"in e?t.clamp(+e.zoom,o.minZoom,o.maxZoom):a,h="bearing"in e?this._normalizeBearing(e.bearing,s):s,f="pitch"in e?+e.pitch:u,p="padding"in e?e.padding:o.padding,d=o.zoomScale(c-a),A=t.Point.convert(e.offset),v=o.centerPoint.add(A),g=o.pointLocation(v),m=t.LngLat.convert(e.center||g);this._normalizeCenter(m);var y=o.project(g),_=o.project(m).sub(y),b=e.curve,x=Math.max(o.width,o.height),w=x/d,C=_.mag();if("minZoom"in e){var B=t.clamp(Math.min(e.minZoom,a,c),o.minZoom,o.maxZoom),k=x/o.zoomScale(B-a);b=Math.sqrt(k/C*2)}var E=b*b;function S(t){var e=(w*w-x*x+(t?-1:1)*E*E*C*C)/(2*(t?w:x)*E*C);return Math.log(Math.sqrt(e*e+1)-e)}function T(t){return(Math.exp(t)-Math.exp(-t))/2}function M(t){return(Math.exp(t)+Math.exp(-t))/2}var I=S(0),P=function(t){return M(I)/M(I+b*t)},Z=function(t){return x*((M(I)*(T(e=I+b*t)/M(e))-T(I))/E)/C;var e},D=(S(1)-I)/b;if(Math.abs(C)<1e-6||!isFinite(D)){if(Math.abs(x-w)<1e-6)return this.easeTo(e,n);var L=w<x?-1:1;D=Math.abs(Math.log(w/x))/b,Z=function(){return 0},P=function(t){return Math.exp(L*b*t)}}return e.duration="duration"in e?+e.duration:1e3*D/("screenSpeed"in e?+e.screenSpeed/b:+e.speed),e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=s!==h,this._pitching=f!==u,this._padding=!o.isPaddingEqual(p),this._prepareEase(n,!1),this._ease((function(e){var i=e*D,d=1/P(i);o.zoom=1===e?c:a+o.scaleZoom(d),r._rotating&&(o.bearing=t.number(s,h,e)),r._pitching&&(o.pitch=t.number(u,f,e)),r._padding&&(o.interpolatePadding(l,p,e),v=o.centerPoint.add(A));var g=1===e?m:o.unproject(y.add(_.mult(Z(i))).mult(d));o.setLocationAtPoint(o.renderWorldCopies?g.wrap():g,v),r._fireMoveEvents(n)}),(function(){return r._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 r=this.handlers;r&&r.stop(!1)}return this},n.prototype._ease=function(e,n,r){!1===r.animate||0===r.duration?(e(1),n()):(this._easeStart=t.browser.now(),this._easeOptions=r,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 r=Math.abs(e-n);return Math.abs(e-360-n)<r&&(e-=360),Math.abs(e+360-n)<r&&(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),yi=function(e){void 0===e&&(e={}),this.options=e,t.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};yi.prototype.getDefaultPosition=function(){return"bottom-right"},yi.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},yi.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},yi.prototype._setElementTitle=function(t,e){var n=this._map._getUIString("AttributionControl."+e);t.title=n,t.setAttribute("aria-label",n)},yi.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"))},yi.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 r=n.reduce((function(t,e,r){return e.value&&(t+=e.key+"="+e.value+(r<n.length-1?"&":"")),t}),"?");e.href=t.config.FEEDBACK_URL+"/"+r+(this._map._hash?this._map._hash.getHashString(!0):""),e.rel="noopener nofollow",this._setElementTitle(e,"MapFeedback")}},yi.prototype._updateData=function(t){!t||"metadata"!==t.sourceDataType&&"visibility"!==t.sourceDataType&&"style"!==t.dataType||(this._updateAttributions(),this._updateEditLink())},yi.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 r in n){var i=n[r];if(i.used){var o=i.getSource();o.attribution&&t.indexOf(o.attribution)<0&&t.push(o.attribution)}}t.sort((function(t,e){return t.length-e.length}));var a=(t=t.filter((function(e,n){for(var r=n+1;r<t.length;r++)if(t[r].indexOf(e)>=0)return!1;return!0}))).join(" | ");a!==this._attribHTML&&(this._attribHTML=a,t.length?(this._innerContainer.innerHTML=a,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},yi.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var _i=function(){t.bindAll(["_updateLogo"],this),t.bindAll(["_updateCompact"],this)};_i.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},_i.prototype.onRemove=function(){n.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},_i.prototype.getDefaultPosition=function(){return"bottom-left"},_i.prototype._updateLogo=function(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")},_i.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}},_i.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 bi=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};bi.prototype.add=function(t){var e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e},bi.prototype.remove=function(t){for(var e=this._currentlyRunning,n=0,r=e?this._queue.concat(e):this._queue;n<r.length;n+=1){var i=r[n];if(i.id===t)return void(i.cancelled=!0)}},bi.prototype.run=function(t){void 0===t&&(t=0);var e=this._currentlyRunning=this._queue;this._queue=[];for(var n=0,r=e;n<r.length;n+=1){var i=r[n];if(!i.cancelled&&(i.callback(t),this._cleared))break}this._cleared=!1,this._currentlyRunning=!1},bi.prototype.clear=function(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]};var xi={"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"},wi=t.window.HTMLImageElement,Ci=t.window.HTMLElement,Bi=t.window.ImageBitmap,ki={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},Ei=function(r){function i(e){var n=this;if(null!=(e=t.extend({},ki,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 i=new wr(e.minZoom,e.maxZoom,e.minPitch,e.maxPitch,e.renderWorldCopies);if(r.call(this,i,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 bi,this._controls=[],this._mapId=t.uniqueId(),this._locale=t.extend({},xi,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 Ci))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 gi(this,e),this._hash=e.hash&&new Br("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 yi({customAttribution:e.customAttribution})),this.addControl(new _i,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))}))}r&&(i.__proto__=r),(i.prototype=Object.create(r&&r.prototype)).constructor=i;var o={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return i.prototype._getMapId=function(){return this._mapId},i.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 r=e.onAdd(this);this._controls.push(e);var i=this._controlPositions[n];return-1!==n.indexOf("bottom")?i.insertBefore(r,i.firstChild):i.appendChild(r),this},i.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},i.prototype.hasControl=function(t){return this._controls.indexOf(t)>-1},i.prototype.resize=function(e){var n=this._containerDimensions(),r=n[0],i=n[1];if(r===this.transform.width&&i===this.transform.height)return this;this._resizeCanvas(r,i),this.transform.resize(r,i),this.painter.resize(r,i);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},i.prototype.getBounds=function(){return this.transform.getBounds()},i.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},i.prototype.setMaxBounds=function(e){return this.transform.setMaxBounds(t.LngLatBounds.convert(e)),this._update()},i.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")},i.prototype.getMinZoom=function(){return this.transform.minZoom},i.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")},i.prototype.getMaxZoom=function(){return this.transform.maxZoom},i.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")},i.prototype.getMinPitch=function(){return this.transform.minPitch},i.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")},i.prototype.getMaxPitch=function(){return this.transform.maxPitch},i.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},i.prototype.setRenderWorldCopies=function(t){return this.transform.renderWorldCopies=t,this._update()},i.prototype.project=function(e){return this.transform.locationPoint(t.LngLat.convert(e))},i.prototype.unproject=function(e){return this.transform.pointLocation(t.Point.convert(e))},i.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},i.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},i.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},i.prototype._createDelegatedListener=function(t,e,n){var r,i=this;if("mouseenter"===t||"mouseover"===t){var o=!1;return{layer:e,listener:n,delegates:{mousemove:function(r){var a=i.getLayer(e)?i.queryRenderedFeatures(r.point,{layers:[e]}):[];a.length?o||(o=!0,n.call(i,new Dr(t,i,r.originalEvent,{features:a}))):o=!1},mouseout:function(){o=!1}}}}if("mouseleave"===t||"mouseout"===t){var a=!1;return{layer:e,listener:n,delegates:{mousemove:function(r){(i.getLayer(e)?i.queryRenderedFeatures(r.point,{layers:[e]}):[]).length?a=!0:a&&(a=!1,n.call(i,new Dr(t,i,r.originalEvent)))},mouseout:function(e){a&&(a=!1,n.call(i,new Dr(t,i,e.originalEvent)))}}}}return{layer:e,listener:n,delegates:(r={},r[t]=function(t){var r=i.getLayer(e)?i.queryRenderedFeatures(t.point,{layers:[e]}):[];r.length&&(t.features=r,n.call(i,t),delete t.features)},r)}},i.prototype.on=function(t,e,n){if(void 0===n)return r.prototype.on.call(this,t,e);var i=this._createDelegatedListener(t,e,n);for(var o in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(i),i.delegates)this.on(o,i.delegates[o]);return this},i.prototype.once=function(t,e,n){if(void 0===n)return r.prototype.once.call(this,t,e);var i=this._createDelegatedListener(t,e,n);for(var o in i.delegates)this.once(o,i.delegates[o]);return this},i.prototype.off=function(t,e,n){var i=this;return void 0===n?r.prototype.off.call(this,t,e):(this._delegatedListeners&&this._delegatedListeners[t]&&function(r){for(var o=r[t],a=0;a<o.length;a++){var s=o[a];if(s.layer===e&&s.listener===n){for(var u in s.delegates)i.off(u,s.delegates[u]);return o.splice(a,1),i}}}(this._delegatedListeners),this)},i.prototype.queryRenderedFeatures=function(e,n){if(!this.style)return[];var r;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])r=[t.Point.convert(e)];else{var i=t.Point.convert(e[0]),o=t.Point.convert(e[1]);r=[i,new t.Point(o.x,i.y),o,new t.Point(i.x,o.y),i]}return this.style.queryRenderedFeatures(r,n,this.transform)},i.prototype.querySourceFeatures=function(t,e){return this.style.querySourceFeatures(t,e)},i.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))},i.prototype._getUIString=function(t){var e=this._locale[t];if(null==e)throw new Error("Missing UI string '"+t+"'");return e},i.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)},i.prototype._lazyInitEmptyStyle=function(){this.style||(this.style=new je(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())},i.prototype._diffStyle=function(e,n){var r=this;if("string"==typeof e){var i=this._requestManager.normalizeStyleURL(e),o=this._requestManager.transformRequest(i,t.ResourceType.Style);t.getJSON(o,(function(e,i){e?r.fire(new t.ErrorEvent(e)):i&&r._updateDiff(i,n)}))}else"object"==typeof e&&this._updateDiff(e,n)},i.prototype._updateDiff=function(e,n){try{this.style.setState(e)&&this._update(!0)}catch(r){t.warnOnce("Unable to perform style diff: "+(r.message||r.error||r)+".  Rebuilding the style from scratch."),this._updateStyle(e,n)}},i.prototype.getStyle=function(){if(this.style)return this.style.serialize()},i.prototype.isStyleLoaded=function(){return this.style?this.style.loaded():t.warnOnce("There is no style added to the map.")},i.prototype.addSource=function(t,e){return this._lazyInitEmptyStyle(),this.style.addSource(t,e),this._update(!0)},i.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+"'")))},i.prototype.areTilesLoaded=function(){var t=this.style&&this.style.sourceCaches;for(var e in t){var n=t[e]._tiles;for(var r in n){var i=n[r];if("loaded"!==i.state&&"errored"!==i.state)return!1}}return!0},i.prototype.addSourceType=function(t,e,n){return this._lazyInitEmptyStyle(),this.style.addSourceType(t,e,n)},i.prototype.removeSource=function(t){return this.style.removeSource(t),this._update(!0)},i.prototype.getSource=function(t){return this.style.getSource(t)},i.prototype.addImage=function(e,n,r){void 0===r&&(r={});var i=r.pixelRatio;void 0===i&&(i=1);var o=r.sdf;void 0===o&&(o=!1);var a=r.stretchX,s=r.stretchY,u=r.content;if(this._lazyInitEmptyStyle(),n instanceof wi||Bi&&n instanceof Bi){var l=t.browser.getImageData(n);this.style.addImage(e,{data:new t.RGBAImage({width:l.width,height:l.height},l.data),pixelRatio:i,stretchX:a,stretchY:s,content:u,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 c=n;this.style.addImage(e,{data:new t.RGBAImage({width:n.width,height:n.height},new Uint8Array(n.data)),pixelRatio:i,stretchX:a,stretchY:s,content:u,sdf:o,version:0,userImage:c}),c.onAdd&&c.onAdd(this,e)}},i.prototype.updateImage=function(e,n){var r=this.style.getImage(e);if(!r)return this.fire(new t.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));var i=n instanceof wi||Bi&&n instanceof Bi?t.browser.getImageData(n):n,o=i.width,a=i.height,s=i.data;return void 0===o||void 0===a?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!==r.data.width||a!==r.data.height?this.fire(new t.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image"))):(r.data.replace(s,!(n instanceof wi||Bi&&n instanceof Bi)),void this.style.updateImage(e,r))},i.prototype.hasImage=function(e){return e?!!this.style.getImage(e):(this.fire(new t.ErrorEvent(new Error("Missing required image id"))),!1)},i.prototype.removeImage=function(t){this.style.removeImage(t)},i.prototype.loadImage=function(e,n){t.getImage(this._requestManager.transformRequest(e,t.ResourceType.Image),n)},i.prototype.listImages=function(){return this.style.listImages()},i.prototype.addLayer=function(t,e){return this._lazyInitEmptyStyle(),this.style.addLayer(t,e),this._update(!0)},i.prototype.moveLayer=function(t,e){return this.style.moveLayer(t,e),this._update(!0)},i.prototype.removeLayer=function(t){return this.style.removeLayer(t),this._update(!0)},i.prototype.getLayer=function(t){return this.style.getLayer(t)},i.prototype.setLayerZoomRange=function(t,e,n){return this.style.setLayerZoomRange(t,e,n),this._update(!0)},i.prototype.setFilter=function(t,e,n){return void 0===n&&(n={}),this.style.setFilter(t,e,n),this._update(!0)},i.prototype.getFilter=function(t){return this.style.getFilter(t)},i.prototype.setPaintProperty=function(t,e,n,r){return void 0===r&&(r={}),this.style.setPaintProperty(t,e,n,r),this._update(!0)},i.prototype.getPaintProperty=function(t,e){return this.style.getPaintProperty(t,e)},i.prototype.setLayoutProperty=function(t,e,n,r){return void 0===r&&(r={}),this.style.setLayoutProperty(t,e,n,r),this._update(!0)},i.prototype.getLayoutProperty=function(t,e){return this.style.getLayoutProperty(t,e)},i.prototype.setLight=function(t,e){return void 0===e&&(e={}),this._lazyInitEmptyStyle(),this.style.setLight(t,e),this._update(!0)},i.prototype.getLight=function(){return this.style.getLight()},i.prototype.setFeatureState=function(t,e){return this.style.setFeatureState(t,e),this._update()},i.prototype.removeFeatureState=function(t,e){return this.style.removeFeatureState(t,e),this._update()},i.prototype.getFeatureState=function(t){return this.style.getFeatureState(t)},i.prototype.getContainer=function(){return this._container},i.prototype.getCanvasContainer=function(){return this._canvasContainer},i.prototype.getCanvas=function(){return this._canvas},i.prototype._containerDimensions=function(){var t=0,e=0;return this._container&&(t=this._container.clientWidth||400,e=this._container.clientHeight||300),[t,e]},i.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 
2in https://www.mapbox.com/mapbox-gl-js/api/.")},i.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 r=this._containerDimensions();this._resizeCanvas(r[0],r[1]);var i=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,i)})),this._container.addEventListener("scroll",this._onMapScroll,!1)},i.prototype._resizeCanvas=function(e,n){var r=t.browser.devicePixelRatio||1;this._canvas.width=r*e,this._canvas.height=r*n,this._canvas.style.width=e+"px",this._canvas.style.height=n+"px"},i.prototype._setupPainter=function(){var n=t.extend({},e.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),r=this._canvas.getContext("webgl",n)||this._canvas.getContext("experimental-webgl",n);r?(this.painter=new yr(r,this.transform),t.webpSupported.testSupport(r)):this.fire(new t.ErrorEvent(new Error("Failed to initialize WebGL")))},i.prototype._contextLost=function(e){e.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new t.Event("webglcontextlost",{originalEvent:e}))},i.prototype._contextRestored=function(e){this._setupPainter(),this.resize(),this._update(),this.fire(new t.Event("webglcontextrestored",{originalEvent:e}))},i.prototype._onMapScroll=function(t){if(t.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},i.prototype.loaded=function(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()},i.prototype._update=function(t){return this.style?(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this.triggerRepaint(),this):this},i.prototype._requestRenderFrame=function(t){return this._update(),this._renderTaskQueue.add(t)},i.prototype._cancelRenderFrame=function(t){this._renderTaskQueue.remove(t)},i.prototype._render=function(e){var n,r=this,i=0,o=this.painter.context.extTimerQuery;if(this.listens("gpu-timing-frame")&&(n=o.createQueryEXT(),o.beginQueryEXT(o.TIME_ELAPSED_EXT,n),i=t.browser.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(e),!this._removed){var a=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;var s=this.transform.zoom,u=t.browser.now();this.style.zoomHistory.update(s,u);var l=new t.EvaluationParameters(s,{now:u,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),c=l.crossFadingFactor();1===c&&c===this._crossFadingFactor||(a=!0,this._crossFadingFactor=c),this.style.update(l)}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()||a)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){var h=t.browser.now()-i;o.endQueryEXT(o.TIME_ELAPSED_EXT,n),setTimeout((function(){var e=o.getQueryObjectEXT(n,o.QUERY_RESULT_EXT)/1e6;o.deleteQueryEXT(n),r.fire(new t.Event("gpu-timing-frame",{cpuTime:h,gpuTime:e}))}),50)}if(this.listens("gpu-timing-layer")){var f=this.painter.collectGpuTimers();setTimeout((function(){var e=r.painter.queryGpuTimers(f);r.fire(new t.Event("gpu-timing-layer",{layerTimes:e}))}),50)}var p=this._sourcesDirty||this._styleDirty||this._placementDirty;return p||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new t.Event("idle")),!this._loaded||this._fullyLoaded||p||(this._fullyLoaded=!0),this}},i.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 r=this.painter.context.gl.getExtension("WEBGL_lose_context");r&&r.loseContext(),Si(this._canvasContainer),Si(this._controlContainer),Si(this._missingCSSCanary),this._container.classList.remove("mapboxgl-map"),this._removed=!0,this.fire(new t.Event("remove"))},i.prototype.triggerRepaint=function(){var e=this;this.style&&!this._frame&&(this._frame=t.browser.frame((function(t){e._frame=null,e._render(t)})))},i.prototype._onWindowOnline=function(){this._update()},i.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}
vendor: 18,198 bytes, line 2
2,o.vertices.set=function(t){this._vertices=t,this._update()},i.prototype._setCacheLimits=function(e,n){t.setCacheLimits(e,n)},o.version.get=function(){return t.version},Object.defineProperties(i.prototype,o),i}(mi);function Si(t){t.parentNode&&t.parentNode.removeChild(t)}var Ti={showCompass:!0,showZoom:!0,visualizePitch:!1},Mi=function(e){var r=this;this.options=t.extend({},Ti,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 r._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 r._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){r.options.visualizePitch?r._map.resetNorthPitch({},{originalEvent:t}):r._map.resetNorth({},{originalEvent:t})})),this._compassIcon=n.create("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden",!0))};Mi.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())},Mi.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},Mi.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 Ii(this._map,this._compass,this.options.visualizePitch)),this._container},Mi.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},Mi.prototype._createButton=function(t,e){var r=n.create("button",t,this._container);return r.type="button",r.addEventListener("click",e),r},Mi.prototype._setButtonTitle=function(t,e){var n=this._map._getUIString("NavigationControl."+e);t.title=n,t.setAttribute("aria-label",n)};var Ii=function(e,r,i){void 0===i&&(i=!1),this._clickTolerance=10,this.element=r,this.mouseRotate=new Wr({clickTolerance:e.dragRotate._mouseRotate._clickTolerance}),this.map=e,i&&(this.mousePitch=new Qr({clickTolerance:e.dragRotate._mousePitch._clickTolerance})),t.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),n.addEventListener(r,"mousedown",this.mousedown),n.addEventListener(r,"touchstart",this.touchstart,{passive:!1}),n.addEventListener(r,"touchmove",this.touchmove),n.addEventListener(r,"touchend",this.touchend),n.addEventListener(r,"touchcancel",this.reset)};function Pi(e,n,r){if(e=new t.LngLat(e.lng,e.lat),n){var i=new t.LngLat(e.lng-360,e.lat),o=new t.LngLat(e.lng+360,e.lat),a=r.locationPoint(e).distSqr(n);r.locationPoint(i).distSqr(n)<a?e=i:r.locationPoint(o).distSqr(n)<a&&(e=o)}for(;Math.abs(e.lng-r.center.lng)>180;){var s=r.locationPoint(e);if(s.x>=0&&s.y>=0&&s.x<=r.width&&s.y<=r.height)break;e.lng>r.center.lng?e.lng-=360:e.lng+=360}return e}Ii.prototype.down=function(t,e){this.mouseRotate.mousedown(t,e),this.mousePitch&&this.mousePitch.mousedown(t,e),n.disableDrag()},Ii.prototype.move=function(t,e){var n=this.map,r=this.mouseRotate.mousemoveWindow(t,e);if(r&&r.bearingDelta&&n.setBearing(n.getBearing()+r.bearingDelta),this.mousePitch){var i=this.mousePitch.mousemoveWindow(t,e);i&&i.pitchDelta&&n.setPitch(n.getPitch()+i.pitchDelta)}},Ii.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()},Ii.prototype.offTemp=function(){n.enableDrag(),n.removeEventListener(t.window,"mousemove",this.mousemove),n.removeEventListener(t.window,"mouseup",this.mouseup)},Ii.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)},Ii.prototype.mousemove=function(t){this.move(t,n.mousePos(this.element,t))},Ii.prototype.mouseup=function(t){this.mouseRotate.mouseupWindow(t),this.mousePitch&&this.mousePitch.mouseupWindow(t),this.offTemp()},Ii.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))},Ii.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))},Ii.prototype.touchend=function(t){0===t.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()},Ii.prototype.reset=function(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()};var Zi={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 Di(t,e,n){var r=t.classList;for(var i in Zi)r.remove("mapboxgl-"+n+"-anchor-"+i);r.add("mapboxgl-"+n+"-anchor-"+e)}var Li,Oi=function(e){function r(r,i){if(e.call(this),(r instanceof t.window.HTMLElement||i)&&(r=t.extend({element:r},i)),t.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=r&&r.anchor||"center",this._color=r&&r.color||"#3FB1CE",this._scale=r&&r.scale||1,this._draggable=r&&r.draggable||!1,this._clickTolerance=r&&r.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=r&&r.rotation||0,this._rotationAlignment=r&&r.rotationAlignment||"auto",this._pitchAlignment=r&&r.pitchAlignment&&"auto"!==r.pitchAlignment?r.pitchAlignment:this._rotationAlignment,r&&r.element)this._element=r.element,this._offset=t.Point.convert(r&&r.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 a=n.createNS("http://www.w3.org/2000/svg","g");a.setAttributeNS(null,"stroke","none"),a.setAttributeNS(null,"stroke-width","1"),a.setAttributeNS(null,"fill","none"),a.setAttributeNS(null,"fill-rule","evenodd");var s=n.createNS("http://www.w3.org/2000/svg","g");s.setAttributeNS(null,"fill-rule","nonzero");var u=n.createNS("http://www.w3.org/2000/svg","g");u.setAttributeNS(null,"transform","translate(3.0, 29.0)"),u.setAttributeNS(null,"fill","#000000");for(var l=0,c=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];l<c.length;l+=1){var h=c[l],f=n.createNS("http://www.w3.org/2000/svg","ellipse");f.setAttributeNS(null,"opacity","0.04"),f.setAttributeNS(null,"cx","10.5"),f.setAttributeNS(null,"cy","5.80029008"),f.setAttributeNS(null,"rx",h.rx),f.setAttributeNS(null,"ry",h.ry),u.appendChild(f)}var p=n.createNS("http://www.w3.org/2000/svg","g");p.setAttributeNS(null,"fill",this._color);var d=n.createNS("http://www.w3.org/2000/svg","path");d.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"),p.appendChild(d);var A=n.createNS("http://www.w3.org/2000/svg","g");A.setAttributeNS(null,"opacity","0.25"),A.setAttributeNS(null,"fill","#000000");var v=n.createNS("http://www.w3.org/2000/svg","path");v.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"),A.appendChild(v);var g=n.createNS("http://www.w3.org/2000/svg","g");g.setAttributeNS(null,"transform","translate(6.0, 7.0)"),g.setAttributeNS(null,"fill","#FFFFFF");var m=n.createNS("http://www.w3.org/2000/svg","g");m.setAttributeNS(null,"transform","translate(8.0, 8.0)");var y=n.createNS("http://www.w3.org/2000/svg","circle");y.setAttributeNS(null,"fill","#000000"),y.setAttributeNS(null,"opacity","0.25"),y.setAttributeNS(null,"cx","5.5"),y.setAttributeNS(null,"cy","5.5"),y.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"),m.appendChild(y),m.appendChild(_),s.appendChild(u),s.appendChild(p),s.appendChild(A),s.appendChild(g),s.appendChild(m),o.appendChild(s),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(r&&r.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()})),Di(this._element,this._anchor,"marker"),this._popup=null}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.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},r.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},r.prototype.getLngLat=function(){return this._lngLat},r.prototype.setLngLat=function(e){return this._lngLat=t.LngLat.convert(e),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this},r.prototype.getElement=function(){return this._element},r.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},r.prototype._onKeyPress=function(t){var e=t.code,n=t.charCode||t.keyCode;"Space"!==e&&"Enter"!==e&&32!==n&&13!==n||this.togglePopup()},r.prototype._onMapClick=function(t){var e=t.originalEvent.target,n=this._element;this._popup&&(e===n||n.contains(e))&&this.togglePopup()},r.prototype.getPopup=function(){return this._popup},r.prototype.togglePopup=function(){var t=this._popup;return t?(t.isOpen()?t.remove():t.addTo(this._map),this):this},r.prototype._update=function(t){if(this._map){this._map.transform.renderWorldCopies&&(this._lngLat=Pi(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 r="";"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?r="rotateX(0deg)":"map"===this._pitchAlignment&&(r="rotateX("+this._map.getPitch()+"deg)"),t&&"moveend"!==t.type||(this._pos=this._pos.round()),n.setTransform(this._element,Zi[this._anchor]+" translate("+this._pos.x+"px, "+this._pos.y+"px) "+r+" "+e)}},r.prototype.getOffset=function(){return this._offset},r.prototype.setOffset=function(e){return this._offset=t.Point.convert(e),this._update(),this},r.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")))},r.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"},r.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))},r.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},r.prototype.isDraggable=function(){return this._draggable},r.prototype.setRotation=function(t){return this._rotation=t||0,this._update(),this},r.prototype.getRotation=function(){return this._rotation},r.prototype.setRotationAlignment=function(t){return this._rotationAlignment=t||"auto",this._update(),this},r.prototype.getRotationAlignment=function(){return this._rotationAlignment},r.prototype.setPitchAlignment=function(t){return this._pitchAlignment=t&&"auto"!==t?t:this._rotationAlignment,this._update(),this},r.prototype.getPitchAlignment=function(){return this._pitchAlignment},r}(t.Evented),Fi={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Ri=0,zi=!1,Ui=function(e){function r(n){e.call(this),this.options=t.extend({},Fi,n),t.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.onAdd=function(e){var r;return this._map=e,this._container=n.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),r=this._setupUI,void 0!==Li?r(Li):void 0!==t.window.navigator.permissions?t.window.navigator.permissions.query({name:"geolocation"}).then((function(t){r(Li="denied"!==t.state)})):r(Li=!!t.window.navigator.geolocation),this._container},r.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,Ri=0,zi=!1},r.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())},r.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_E
2RROR",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")}},r.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()}},r.prototype._updateCamera=function(e){var n=new t.LngLat(e.coords.longitude,e.coords.latitude),r=e.coords.accuracy,i=this._map.getBearing(),o=t.extend({bearing:i},this.options.fitBoundsOptions);this._map.fitBounds(n.toBounds(r),o,{geolocateSource:!0})},r.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()},r.prototype._updateCircleRadius=function(){var t=this._map._container.clientHeight/2,e=this._map.unproject([0,t]),n=this._map.unproject([1,t]),r=e.distanceTo(n),i=Math.ceil(2*this._accuracy/r);this._circleElement.style.width=i+"px",this._circleElement.style.height=i+"px"},r.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},r.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&&zi)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()}},r.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},r.prototype._setupUI=function(e){var r=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 i=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i)}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","fal
2se"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=n.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Oi(this._dotElement),this._circleElement=n.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Oi({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"!==r._watchState||e.originalEvent&&"resize"===e.originalEvent.type||(r._watchState="BACKGROUND",r._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),r._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),r.fire(new t.Event("trackuserlocationend")))}))},r.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":Ri--,zi=!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"),++Ri>1?(e={maximumAge:6e5,timeout:0},zi=!0):(e=this.options.positionOptions,zi=!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},r.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)},r}(t.Evented),Ni={maxWidth:100,unit:"metric"},Gi=function(e){this.options=t.extend({},Ni,e),t.bindAll(["_onMove","setUnit"],this)};function ji(t,e,n){var r=n&&n.maxWidth||100,i=t._container.clientHeight/2,o=t.unproject([0,i]),a=t.unproject([r,i]),s=o.distanceTo(a);if(n&&"imperial"===n.unit){var u=3.2808*s;u>5280?Vi(e,r,u/5280,t._getUIString("ScaleControl.Miles")):Vi(e,r,u,t._getUIString("ScaleControl.Feet"))}else n&&"nautical"===n.unit?Vi(e,r,s/1852,t._getUIString("ScaleControl.NauticalMiles")):s>=1e3?Vi(e,r,s/1e3,t._getUIString("ScaleControl.Kilometers")):Vi(e,r,s,t._getUIString("ScaleControl.Meters"))}function Vi(t,e,n,r){var i,o,a,s=(i=n,(o=Math.pow(10,(""+Math.floor(i)).length-1))*(a=(a=i/o)>=10?10:a>=5?5:a>=3?3:a>=2?2:a>=1?1:function(t){var e=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*e)/e}(a)));t.style.width=e*(s/n)+"px",t.innerHTML=s+"&nbsp;"+r}Gi.prototype.getDefaultPosition=function(){return"bottom-left"},Gi.prototype._onMove=function(){ji(this._map,this._container,this.options)},Gi.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},Gi.prototype.onRemove=function(){n.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},Gi.prototype.setUnit=function(t){this.options.unit=t,ji(this._map,this._container,this.options)};var Hi=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")};Hi.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},Hi.prototype.onRemove=function(){n.remove(this._controlContainer),this._map=null,t.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},Hi.prototype._checkFullscreenSupport=function(){return!!(t.window.document.fullscreenEnabled||t.window.document.mozFullScreenEnabled||t.window.document.msFullscreenEnabled||t.window.document.webkitFullscreenEnabled)},Hi.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)},Hi.prototype._updateTitle=function(){var t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t},Hi.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},Hi.prototype._isFullscreen=function(){return this._fullscreen},Hi.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())},Hi.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 Ji={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"}
vendor: 6,977 bytes, line 2
2,Wi=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),Qi=function(e){function r(n){e.call(this),this.options=t.extend(Object.create(Ji),n),t.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.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},r.prototype.isOpen=function(){return!!this._map},r.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},r.prototype.getLngLat=function(){return this._lngLat},r.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},r.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},r.prototype.getElement=function(){return this._container},r.prototype.setText=function(e){return this.setDOMContent(t.window.document.createTextNode(e))},r.prototype.setHTML=function(e){var n,r=t.window.document.createDocumentFragment(),i=t.window.document.createElement("body");for(i.innerHTML=e;n=i.firstChild;)r.appendChild(n);return this.setDOMContent(r)},r.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},r.prototype.setMaxWidth=function(t){return this.options.maxWidth=t,this._update(),this},r.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},r.prototype.addClassName=function(t){this._container&&this._container.classList.add(t)},r.prototype.removeClassName=function(t){this._container&&this._container.classList.remove(t)},r.prototype.setOffset=function(t){return this.options.offset=t,this._update(),this},r.prototype.toggleClassName=function(t){if(this._container)return this._container.classList.toggle(t)},r.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))},r.prototype._onMouseUp=function(t){this._update(t.point)},r.prototype._onMouseMove=function(t){this._update(t.point)},r.prototype._onDrag=function(t){this._update(t.point)},r.prototype._update=function(e){var r=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 r._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=Pi(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||e)){var i=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat),o=this.options.anchor,a=function e(n){if(n){if("number"==typeof n){var r=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(r,r),"top-right":new t.Point(-r,r),bottom:new t.Point(0,-n),"bottom-left":new t.Point(r,-r),"bottom-right":new t.Point(-r,-r),left:new t.Point(n,0),right:new t.Point(-n,0)}}if(n instanceof t.Point||Array.isArray(n)){var i=t.Point.convert(n);return{center:i,top:i,"top-left":i,"top-right":i,bottom:i,"bottom-left":i,"bottom-right":i,left:i,right:i}}return{center:t.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 s,u=this._container.offsetWidth,l=this._container.offsetHeight;s=i.y+a.bottom.y<l?["top"]:i.y>this._map.transform.height-l?["bottom"]:[],i.x<u/2?s.push("left"):i.x>this._map.transform.width-u/2&&s.push("right"),o=0===s.length?"bottom":s.join("-")}var c=i.add(a[o]).round();n.setTransform(this._container,Zi[o]+" translate("+c.x+"px,"+c.y+"px)"),Di(this._container,o,"popup")}},r.prototype._focusFirstElement=function(){if(this.options.focusAfterOpen&&this._container){var t=this._container.querySelector(Wi);t&&t.focus()}},r.prototype._onClose=function(){this.remove()},r}(t.Evented),qi={version:t.version,supported:e,setRTLTextPlugin:t.setRTLTextPlugin,getRTLTextPluginStatus:t.getRTLTextPluginStatus,Map:Ei,NavigationControl:Mi,GeolocateControl:Ui,AttributionControl:yi,ScaleControl:Gi,FullscreenControl:Hi,Popup:Qi,Marker:Oi,Style:je,LngLat:t.LngLat,LngLatBounds:t.LngLatBounds,Point:t.Point,MercatorCoordinate:t.MercatorCoordinate,Evented:t.
2Evented,config:t.config,prewarm:function(){Rt().acquire(Dt)},clearPrewarmedResources:function(){var t=Ot;t&&(t.isPreloaded()&&1===t.numActive()?(t.release(Dt),Ot=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 Lt.workerCount},set workerCount(t){Lt.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 qi})),n}()},48331:function(t,e,n){"use strict";n.d(e,{Q:function(){return K}});var r=n(11026),i=n(60726),o=n(50189),a=n(22951),s=n(91976),u=n(37659),l={mousedown:1,mousemove:2,mouseup:4};!function(t){var e=t.prototype.handler;t.prototype.handler=function(t){var n=this.store;t.button>0&&"pointerdown"===t.type&&(function(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return!0;return!1}(n,(function(e){return e.pointerId===t.pointerId}))||n.push(t)),e.call(this,t)}}(u.PointerEventInput),u.MouseInput.prototype.handler=function(t){var e=l[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}))};var c=u.Manager,h=u,f=n(67591),p=n(94337),d=(0,s.Z)((function t(e,n,r){(0,a.Z)(this,t),this.element=e,this.callback=n,this.options=(0,o.Z)({enable:!0},r)})),A=h?[[h.Pan,{event:"tripan",pointers:3,threshold:0,enable:!1}],[h.Rotate,{enable:!1}],[h.Pinch,{enable:!1}],[h.Swipe,{enable:!1}],[h.Pan,{threshold:0,enable:!1}],[h.Press,{enable:!1}],[h.Tap,{event:"doubletap",taps:2,enable:!1}],[h.Tap,{event:"anytap",enable:!1}],[h.Tap,{enable:!1}]]:null,v={tripan:["rotate","pinch","pan"],rotate:["pinch"],pinch:["pan"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},g={doubletap:["tap"]},m={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},y=["keydown","keyup"],_=["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],b=["wheel","mousewheel"],x={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"},w={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},C="undefined"!==typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",B="undefined"!==typeof window?window:n.g,k=("undefined"!==typeof n.g?n.g:window,"undefined"!==typeof document&&document,!1);try{var E={get passive(){return k=!0,!0}};B.addEventListener("test",null,E),B.removeEventListener("test",null)}catch(X){k=!1}var S=-1!==C.indexOf("firefox"),T=b,M="wheel",I=4.000244140625,P=function(t){(0,f.Z)(n,t);var e=(0,p.Z)(n);function n(t,r,i){var o;return(0,a.Z)(this,n),(o=e.call(this,t,r,i)).handleEvent=function(t){if(o.options.enable){var e=t.deltaY;B.WheelEvent&&(S&&t.deltaMode===B.WheelEvent.DOM_DELTA_PIXEL&&(e/=B.devicePixelRatio),t.deltaMode===B.WheelEvent.DOM_DELTA_LINE&&(e*=40)),0!==e&&e%I===0&&(e=Math.floor(e/I)),t.shiftKey&&e&&(e*=.25),o.callback({type:M,center:{x:t.clientX,y:t.clientY},delta:-e,srcEvent:t,pointerType:"mouse",target:t.target})}}
2,o.events=(o.options.events||[]).concat(T),o.events.forEach((function(e){return t.addEventListener(e,o.handleEvent,!!k&&{passive:!1})})),o}return(0,s.Z)(n,[{key:"destroy",value:function(){var t=this;this.events.forEach((function(e){return t.element.removeEventListener(e,t.handleEvent)}))}},{key:"enableEventType",value:function(t,e){t===M&&(this.options.enable=e)}}]),n}(d),Z=_,D="pointermove",L="pointerover",O="pointerout",F="pointerenter",R="pointerleave",z=function(t){(0,f.Z)(n,t);var e=(0,p.Z)(n);function n(t,r,i){var o;(0,a.Z)(this,n),(o=e.call(this,t,r,i)).handleEvent=function(t){o.handleOverEvent(t),o.handleOutEvent(t),o.handleEnterEvent(t),o.handleLeaveEvent(t),o.handleMoveEvent(t)},o.pressed=!1;var s=o.options.enable;return o.enableMoveEvent=s,o.enableLeaveEvent=s,o.enableEnterEvent=s,o.enableOutEvent=s,o.enableOverEvent=s,o.events=(o.options.events||[]).concat(Z),o.events.forEach((function(e){return t.addEventListener(e,o.handleEvent)})),o}return(0,s.Z)(n,[{key:"destroy",value:function(){var t=this;this.events.forEach((function(e){return t.element.removeEventListener(e,t.handleEvent)}))}},{key:"enableEventType",value:function(t,e){t===D&&(this.enableMoveEvent=e),t===L&&(this.enableOverEvent=e),t===O&&(this.enableOutEvent=e),t===F&&(this.enableEnterEvent=e),t===R&&(this.enableLeaveEvent=e)}},{key:"handleOverEvent",value:function(t){this.enableOverEvent&&"mouseover"===t.type&&this._emit(L,t)}},{key:"handleOutEvent",value:function(t){this.enableOutEvent&&"mouseout"===t.type&&this._emit(O,t)}},{key:"handleEnterEvent",value:function(t){this.enableEnterEvent&&"mouseenter"===t.type&&this._emit(F,t)}},{key:"handleLeaveEvent",value:function(t){this.enableLeaveEvent&&"mouseleave"===t.type&&this._emit(R,t)}},{key:"handleMoveEvent",value:function(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(D,t);break;case"mouseup":this.pressed=!1}}},{key:"_emit",value:function(t,e){this.callback({type:t,center:{x:e.clientX,y:e.clientY},srcEvent:e,pointerType:"mouse",target:e.target})}}]),n}(d),U=y,N="keydown",G="keyup",j=function(t){(0,f.Z)(n,t);var e=(0,p.Z)(n);function n(t,r,i){var o;return(0,a.Z)(this,n),(o=e.call(this,t,r,i)).handleEvent=function(t){var e=t.target||t.srcElement;"INPUT"===e.tagName&&"text"===e.type||"TEXTAREA"===e.tagName||(o.enableDownEvent&&"keydown"===t.type&&o.callback({type:N,srcEvent:t,key:t.key,target:t.target}),o.enableUpEvent&&"keyup"===t.type&&o.callback({type:G,srcEvent:t,key:t.key,target:t.target}))},o.enableDownEvent=o.options.enable,o.enableUpEvent=o.options.enable,o.events=(o.options.events||[]).concat(U),t.tabIndex=o.options.tabIndex||0,t.style.outline="none",o.events.forEach((function(e){return t.addEventListener(e,o.handleEvent)})),o}return(0,s.Z)(n,[{key:"destroy",value:function(){var t=this;this.events.forEach((function(e){return t.element.removeEventListener(e,t.handleEvent)}))}},{key:"enableEventType",value:function(t,e){t===N&&(this.enableDownEvent=e),t===G&&(this.enableUpEvent=e)}}]),n}(d),V="contextmenu",H=function(t){(0,f.Z)(n,t);var e=(0,p.Z)(n);function n(t,r,i){var o;return(0,a.Z)(this,n),(o=e.call(this,t,r,i)).handleEvent=function(t){o.options.enable&&o.callback({type:V,center:{x:t.clientX,y:t.clientY},srcEvent:t,pointerType:"mouse",target:t.target})},t.addEventListener("contextmenu",o.handleEvent),o}return(0,s.Z)(n,[{key:"destroy",value:function(){this.element.removeEventListener("contextmenu",this.handleEvent)}},{key:"enableEventType",value:function(t,e){t===V&&(this.options.enable=e)}}]),n}(d),J={pointerdown:1,pointermove:2,pointerup:4,mousedown:1,mousemove:2,mouseup:4};var W={srcElement:"root",priority:0},Q=function(){function t(e){var n=this;(0,a.Z)(this,t),this.handleEvent=function(t){if(!n.isEmpty()){for(var e=n._normalizeEvent(t),r=t.srcEvent.target;r&&r!==e.rootElement;){if(n._emit(e,r),e.handled)return;r=r.parentNode}n._emit(e,"root")}},this.eventManager=e,this.handlers=[],this.handlersByElement=new Map,this._active=!1}return(0,s.Z)(t,[{key:"isEmpty",value:function(){return!this._active}},{key:"add",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=this.handlers,s=this.handlersByElement,u=W;"string"===typeof n||n&&n.addEventListener?u=(0,o.Z)((0,o.Z)({},W),{},{srcElement:n}):n&&(u=(0,o.Z)((0,o.Z)({},W),n));var l=s.get(u.srcElement);l||(l=[],s.set(u.srcElement,l));var c={type:t,handler:e,srcElement:u.srcElement,priority:u.priority};r&&(c.once=!0),i&&(c.passive=!0),a.push(c),this._active=this._active||!c.passive;for(var h=l.length-1;h>=0&&!(l[h].priority>=c.priority);)h--;l.splice(h+1,0,c)}},{key:"remove",value:function(t,e){for(var n=this.handlers,r=this.handlersByElement,i=n.length-1;i>=0;i--){var o=n[i];if(o.type===t&&o.handler===e){n.splice(i,1);var a=r.get(o.srcElement);a.splice(a.indexOf(o),1),0===a.length&&r.delete(o.srcElement)}}this._active=n.some((function(t){return!t.passive}))}},{key:"_emit",value:function(t,e){var n=this.handlersByElement.get(e);if(n){for(var r=!1,i=function(){t.handled=!0},a=function(){t.handled=!0,r=!0},s=[],u=0;u<n.length;u++){var l=n[u],c=l.type,h=l.handler,f=l.once;if(h((0,o.Z)((0,o.Z)({},t),{},{type:c,stopPropagation:i,stopImmediatePropagation:a})),f&&s.push(n[u]),r)break}for(var p=0;p<s.length;p++){var d=s[p],A=d.type,v=d.handler;this.remove(A,v)}
2}}},{key:"_normalizeEvent",value:function(t){var e=this.eventManager.getElement();return(0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)({},t),function(t){var e=J[t.srcEvent.type];if(!e)return null;var n=t.srcEvent,r=n.buttons,i=n.button,o=n.which,a=!1,s=!1,u=!1;return 4===e||2===e&&!Number.isFinite(r)?(a=1===o,s=2===o,u=3===o):2===e?(a=Boolean(1&r),s=Boolean(4&r),u=Boolean(2&r)):1===e&&(a=0===i,s=1===i,u=2===i),{leftButton:a,middleButton:s,rightButton:u}}(t)),function(t,e){var n=t.center;if(!n)return null;var r=e.getBoundingClientRect(),i=r.width/e.offsetWidth||1,o=r.height/e.offsetHeight||1;return{center:n,offsetCenter:{x:(n.x-r.left-e.clientLeft)/i,y:(n.y-r.top-e.clientTop)/o}}}(t,e)),{},{preventDefault:function(){t.srcEvent.preventDefault()},stopImmediatePropagation:null,stopPropagation:null,handled:!1,rootElement:e})}}]),t}(),q={events:null,recognizers:null,recognizerOptions:{},Manager:c,touchAction:"none",tabIndex:0},K=function(){function t(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1?arguments[1]:void 0;(0,a.Z)(this,t),this._onBasicInput=function(t){var n=t.srcEvent,r=m[n.type];r&&e.manager.emit(r,t)},this._onOtherEvent=function(t){e.manager.emit(t.type,t)},this.options=(0,o.Z)((0,o.Z)({},q),r),this.events=new Map,this.setElement(n);var i=this.options.events;i&&this.on(i)}return(0,s.Z)(t,[{key:"getElement",value:function(){return this.element}},{key:"setElement",value:function(t){var e=this;if(this.element&&this.destroy(),this.element=t,t){var n=this.options,o=n.Manager;for(var a in this.manager=new o(t,{touchAction:n.touchAction,recognizers:n.recognizers||A}).on("hammer.input",this._onBasicInput),n.recognizers||Object.keys(v).forEach((function(t){var n=e.manager.get(t);n&&v[t].forEach((function(t){n.recognizeWith(t)}))})),n.recognizerOptions){var s=this.manager.get(a);if(s){var u=n.recognizerOptions[a];delete u.enable,s.set(u)}}this.wheelInput=new P(t,this._onOtherEvent,{enable:!1}),this.moveInput=new z(t,this._onOtherEvent,{enable:!1}),this.keyInput=new j(t,this._onOtherEvent,{enable:!1,tabIndex:n.tabIndex}),this.contextmenuInput=new H(t,this._onOtherEvent,{enable:!1});var l,c=(0,i.Z)(this.events);try{for(c.s();!(l=c.n()).done;){var h=(0,r.Z)(l.value,2),f=h[0],p=h[1];p.isEmpty()||(this._toggleRecognizer(p.recognizerName,!0),this.manager.on(f,p.handleEvent))}}catch(X){c.e(X)}finally{c.f()}}}},{key:"destroy",value:function(){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)}},{key:"on",value:function(t,e,n){this._addEventHandler(t,e,n,!1)}},{key:"once",value:function(t,e,n){this._addEventHandler(t,e,n,!0)}},{key:"watch",value:function(t,e,n){this._addEventHandler(t,e,n,!1,!0)}},{key:"off",value:function(t,e){this._removeEventHandler(t,e)}},{key:"_toggleRecognizer",value:function(t,e){var n=this.manager;if(n){var r=n.get(t);if(r&&r.options.enable!==e){r.set({enable:e});var i=g[t];i&&!this.options.recognizers&&i.forEach((function(i){var o=n.get(i);e?(o.requireFailure(t),r.dropRequireFailure(i)):o.dropRequireFailure(t)}))}this.wheelInput.enableEventType(t,e),this.moveInput.enableEventType(t,e),this.keyInput.enableEventType(t,e),this.contextmenuInput.enableEventType(t,e)}}},{key:"_addEventHandler",value:function(t,e,n,r,i){if("string"===typeof t){var o=this.manager,a=this.events,s=w[t]||t,u=a.get(s);u||(u=new Q(this),a.set(s,u),u.recognizerName=x[s]||s,o&&o.on(s,u.handleEvent)),u.add(t,e,n,r,i),u.isEmpty()||this._toggleRecognizer(u.recognizerName,!0)}else for(var l in n=e,t)this._addEventHandler(l,t[l],n,r,i)}},{key:"_removeEventHandler",value:function(t,e){if("string"===typeof t){var n=this.events,r=w[t]||t,o=n.get(r);if(o&&(o.remove(t,e),o.isEmpty())){var a,s=o.recognizerName,u=!1,l=(0,i.Z)(n.values());try{for(l.s();!(a=l.n()).done;){var c=a.value;if(c.recognizerName===s&&!c.isEmpty()){u=!0;break}}}catch(X){l.e(X)}finally{l.f()}u||this._toggleRecognizer(s,!1)}}else for(var h in t)this._removeEventHandler(h,t[h])}}]),t}()},32408:function(t,e,n){"use strict";
vendor: 93,750 bytes, line 2
2t.exports=i;var r=n(70356);function i(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}i.Varint=0,i.Fixed64=1,i.Bytes=2,i.Fixed32=5;var o=4294967296,a=1/o,s="undefined"===typeof TextDecoder?null:new TextDecoder("utf8");function u(t){return t.type===i.Bytes?t.readVarint()+t.pos:t.pos+1}function l(t,e,n){return n?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function c(t,e,n){var r=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));n.realloc(r);for(var i=n.pos-1;i>=t;i--)n.buf[i+r]=n.buf[i]}function h(t,e){for(var n=0;n<t.length;n++)e.writeVarint(t[n])}function f(t,e){for(var n=0;n<t.length;n++)e.writeSVarint(t[n])}function p(t,e){for(var n=0;n<t.length;n++)e.writeFloat(t[n])}function d(t,e){for(var n=0;n<t.length;n++)e.writeDouble(t[n])}function A(t,e){for(var n=0;n<t.length;n++)e.writeBoolean(t[n])}function v(t,e){for(var n=0;n<t.length;n++)e.writeFixed32(t[n])}function g(t,e){for(var n=0;n<t.length;n++)e.writeSFixed32(t[n])}function m(t,e){for(var n=0;n<t.length;n++)e.writeFixed64(t[n])}function y(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)}i.prototype={destroy:function(){this.buf=null},readFields:function(t,e,n){for(n=n||this.length;this.pos<n;){var r=this.readVarint(),i=r>>3,o=this.pos;this.type=7&r,t(i,e,this),this.pos===o&&this.skip(r)}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=r.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=r.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,n,r=this.buf;return e=127&(n=r[this.pos++]),n<128?e:(e|=(127&(n=r[this.pos++]))<<7,n<128?e:(e|=(127&(n=r[this.pos++]))<<14,n<128?e:(e|=(127&(n=r[this.pos++]))<<21,n<128?e:function(t,e,n){var r,i,o=n.buf;if(i=o[n.pos++],r=(112&i)>>4,i<128)return l(t,r,e);if(i=o[n.pos++],r|=(127&i)<<3,i<128)return l(t,r,e);if(i=o[n.pos++],r|=(127&i)<<10,i<128)return l(t,r,e);if(i=o[n.pos++],r|=(127&i)<<17,i<128)return l(t,r,e);if(i=o[n.pos++],r|=(127&i)<<24,i<128)return l(t,r,e);if(i=o[n.pos++],r|=(1&i)<<31,i<128)return l(t,r,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(n=r[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2===1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&s?function(t,e,n){return s.decode(t.subarray(e,n))}(this.buf,e,t):function(t,e,n){var r="",i=e;for(;i<n;){var o,a,s,u=t[i],l=null,c=u>239?4:u>223?3:u>191?2:1;if(i+c>n)break;1===c?u<128&&(l=u):2===c?128===(192&(o=t[i+1]))&&(l=(31&u)<<6|63&o)<=127&&(l=null):3===c?(o=t[i+1],a=t[i+2],128===(192&o)&&128===(192&a)&&((l=(15&u)<<12|(63&o)<<6|63&a)<=2047||l>=55296&&l<=57343)&&(l=null)):4===c&&(o=t[i+1],a=t[i+2],s=t[i+3],128===(192&o)&&128===(192&a)&&128===(192&s)&&((l=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||l>=1114112)&&(l=null)),null===l?(l=65533,c=1):l>65535&&(l-=65536,r+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),r+=String.fromCharCode(l),i+=c}return r}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==i.Bytes)return t.push(this.readVarint(e));var n=u(this);for(t=t||[];this.pos<n;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==i.Bytes)return t.push(this.readSVarint());var e=u(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==i.Bytes)return t.push(this.readBoolean());var e=u(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==i.Bytes)return t.push(this.readFloat());var e=u(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==i.Bytes)return t.push(this.readDouble());var e=u(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==i.Bytes)return t.push(this.readFixed32());var e=u(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==i.Bytes)return t.push(this.readSFixed32());var e=u(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==i.Bytes)return t.push(this.readFixed64());var e=u(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==i.Bytes)return t.push(this.readSFixed64());var e=u(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===i.Varint)for(;this.buf[this.pos++]>127;);else if(e===i.Bytes)this.pos=this.readVarint()+this.pos;else if(e===i.Fixed32)this.pos+=4;else{if(e!==i.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*a),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*a),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var n,r;t>=0?(n=t%4294967296|0,r=t/4294967296|0):(r=~(-t/4294967296),4294967295^(n=~(-t%4294967296))?n=n+1|0:(n=0,r=r+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}(r,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,n){for(var r,i,o=0;o<e.length;o++){if((r=e.charCodeAt(o))>55295&&r<57344){if(!i){r>56319||o+1===e.length?(t[n++]=239,t[n++]=191,t[n++]=189):i=r;continue}if(r<56320){t[n++]=239,t[n++]=191,t[n++]=189,i=r;continue}r=i-55296<<10|r-56320|65536,i=null}else i&&(t[n++]=239,t[n++]=191,t[n++]=189,i=null);r<128?t[n++]=r:(r<2048?t[n++]=r>>6|192:(r<65536?t[n++]=r>>12|224:(t[n++]=r>>18|240,t[n++]=r>>12&63|128),t[n++]=r>>6&63|128),t[n++]=63&r|128)}return n}(this.buf,t,this.pos);var n=this.pos-e;n>=128&&c(e,n,this),this.pos=e-1,this.writeVarint(n),this.pos+=n},writeFloat:function(t){this.realloc(4),r.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),r.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 r=this.pos-n;r>=128&&c(n,r,this),this.pos=n-1,this.writeVarint(r),this.pos+=r},writeMessage:function(t,e,n){this.writeTag(t,i.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,f,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,A,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,p,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,d,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,v,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,g,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,m,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,y,e)},writeBytesField:function(t,e){this.writeTag(t,i.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,i.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,i.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,i.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,i.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,i.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,i.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,i.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,i.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,i.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}}},3717:function(t,e,n){"use strict";n.d(e,{X$:function(){return lt},Pv:function(){return Ln},Z3:function(){return _t}});var r=n(25773),i=n(649),o=n(64649),a=n(66845),s=n(8984),u=n(11026),l=n(75818),c=function(){if("undefined"!==typeof Map)return Map;function t(t,e){var n=-1;return t.some((function(t,r){return t[0]===e&&(n=r,!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),r=this.__entries__[n];return r&&r[1]},e.prototype.set=function(e,n){var r=t(this.__entries__,e);~r?this.__entries__[r][1]=n:this.__entries__.push([e,n])},e.prototype.delete=function(e){var n=this.__entries__,r=t(n,e);~r&&n.splice(r,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,r=this.__entries__;n<r.length;n++){var i=r[n];t.call(e,i[1],i[0])}},e}()}(),h="undefined"!==typeof window&&"undefined"!==typeof document&&window.document===document,f="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")(),p="function"===typeof requestAnimationFrame?requestAnimationFrame.bind(f):function(t){return setTimeout((function(){return t(Date.now())}),1e3/60)};var d=["top","right","bottom","left","width","height","size","weight"],A="undefined"!==typeof MutationObserver,v=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,r=!1,i=0;function o(){n&&(n=!1,t()),r&&s()}function a(){p(o)}function s(){var t=Date.now();if(n){if(t-i<2)return;r=!0}else n=!0,r=!1,setTimeout(a,e);i=t}return s}(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),A?(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;d.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}(),g=function(t,e){for(var n=0,r=Object.keys(e);n<r.length;n++){var i=r[n];Object.defineProperty(t,i,{value:e[i],enumerable:!1,writable:!1,configurable:!0})}return t},m=function(t){return t&&t.ownerDocument&&t.ownerDocument.defaultView||f},y=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 y;var r=m(t).getComputedStyle(t),i=function(t){for(var e={},n=0,r=["top","right","bottom","left"];n<r.length;n++){var i=r[n],o=t["padding-"+i];e[i]=_(o)}return e}(r),o=i.left+i.right,a=i.top+i.bottom,s=_(r.width),u=_(r.height);if("border-box"===r.boxSizing&&(Math.round(s+o)!==e&&(s-=b(r,"left","right")+o),Math.round(u+a)!==n&&(u-=b(r,"top","bottom")+a)),!function(t){return t===m(t).document.documentElement}(t)){var l=Math.round(s+o)-e,c=Math.round(u+a)-n;1!==Math.abs(l)&&(s-=l),1!==Math.abs(c)&&(u-=c)}return B(i.left,i.top,s,u)}var w="undefined"!==typeof SVGGraphicsElement?function(t){return t instanceof m(t).SVGGraphicsElement}:function(t){return t instanceof m(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):y}function B(t,e,n,r){return{x:t,y:e,width:n,height:r}}var k=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}(),E=function(t,e){var n=function(t){var e=t.x,n=t.y,r=t.width,i=t.height,o="undefined"!==typeof DOMRectReadOnly?DOMRectReadOnly:Object,a=Object.create(o.prototype);return g(a,{x:e,y:n,width:r,height:i,top:n,right:e+r,bottom:i+n,left:e}),a}(e);g(this,{target:t,contentRect:n})},S=function(){function t(t,e,n){if(this.activeObservations_=[],this.observations_=new c,"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 m(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)||(e.set(t,new k(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 m(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 E(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}(),T="undefined"!==typeof WeakMap?new WeakMap:new c,M=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=v.getInstance(),r=new S(e,n,this);T.set(this,r)};["observe","unobserve","disconnect"].forEach((function(t){M.prototype[t]=function(){var e;return(e=T.get(this))[t].apply(e,arguments)}}));var I="undefined"!==typeof f.ResizeObserver?f.ResizeObserver:M,P=n(22951),Z=n(91976),D=("undefined"!==typeof window?window:n.g,"undefined"!==typeof n.g?n.g:window,"undefined"!==typeof document?document:{});function L(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function O(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?L(Object(n),!0).forEach((function(e){(0,o.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):L(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function F(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 R(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 R(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function R(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var z=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function U(t){if(!t)return null;if("string"===typeof t)return t;t.toJS&&(t=t.toJS());var e,n={},r=F(t.layers);try{for(r.s();!(e=r.n()).done;){var i=e.value;n[i.id]=i}}catch(a){r.e(a)}finally{r.f()}var o=t.layers.map((function(t){var e=n[t.ref],r=null;if("interactive"in t&&delete(r=O({},t)).interactive,e){delete(r=r||O({},t)).ref;var i,o=F(z);try{for(o.s();!(i=o.n()).done;){var s=i.value;s in e&&(r[s]=e[s])}}catch(a){o.e(a)}finally{o.f()}}return r||t}));return O(O({},t),{},{layers:o})}var N={container:s.object,gl:s.object,mapboxApiAccessToken:s.string,mapboxApiUrl:s.string,attributionControl:s.bool,preserveDrawingBuffer:s.bool,reuseMaps:s.bool,transformRequest:s.func,mapOptions:s.object,mapStyle:s.oneOfType([s.string,s.object]),preventStyleDiffing:s.bool,visible:s.bool,asyncRender:s.bool,onLoad:s.func,onError:s.func,width:s.number,height:s.number,viewState:s.object,longitude:s.number,latitude:s.number,zoom:s.number,bearing:s.number,pitch:s.number,altitude:s.number},G={container:D.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&&s.checkPropTypes(N,t,"prop",e)}var V=function(){function t(e){var n=this;if((0,P.Z)(this,t),(0,o.Z)(this,"props",G),(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,Z.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(),r=e.container;for(r.classList.add("mapboxgl-map");n.childNodes.length>0;)r.appendChild(n.childNodes[0]);this._map._container=r,t.savedMap=null,e.mapStyle&&this._map.setStyle(U(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 r={container:e.container,center:[0,0],zoom:8,pitch:0,bearing:0,maxZoom:24,style:U(e.mapStyle),interactive:!1,trackResize:!1,attributionControl:e.attributionControl,preserveDrawingBuffer:e.preserveDrawingBuffer};e.transformRequest&&(r.transformRequest=e.transformRequest),this._map=new this.mapboxgl.Map(Object.assign({},r,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({},G,t),"Mapbox"),this.mapboxgl.accessToken=t.mapboxApiAccessToken||G.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 r=this._map.getCanvas();r&&(r.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),r=this._updateMapSize(t,e);this._updateMapStyle(t,e),e.asyncRender||!n&&!r||this.redraw(),this.props=e}}},{key:"_updateMapStyle",value:function(t,e){t.mapStyle!==e.mapStyle&&this._map.setStyle(U(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),r=this._getViewState(e),i=r.latitude!==n.latitude||r.longitude!==n.longitude||r.zoom!==n.zoom||r.pitch!==n.pitch||r.bearing!==n.bearing||r.altitude!==n.altitude;return i&&(this._map.jumpTo(this._viewStateToMapboxProps(r)),r.altitude!==n.altitude&&(this._map.transform.altitude=r.altitude)),i}},{key:"_getViewState",value:function(t){var e=t.viewState||t,n=e.longitude,r=e.latitude,i=e.zoom,o=e.pitch,a=void 0===o?0:o,s=e.bearing,u=void 0===s?0:s,l=e.altitude;return{longitude:n,latitude:r,zoom:i,pitch:a,bearing:u,altitude:void 0===l?1.5:l}}},{key:"_checkStyleSheet",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"0.47.0";if("undefined"!==typeof D)try{var e=D.createElement("div");if(e.className="mapboxgl-map",e.style.display="none",D.body.appendChild(e),!("static"!==window.getComputedStyle(e).position)){var n=D.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")),D.head.appendChild(n)}}catch(r){}}},{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",G),(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 q(t,e,n){return Math.max(e,Math.min(n,t))}function K(t,e,n){return W(t)?t.map((function(t,r){return K(t,e[r],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 r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}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,rt=1.5,it=function(){function t(e){var n=e.width,r=e.height,i=e.latitude,o=e.longitude,a=e.zoom,s=e.bearing,u=void 0===s?nt:s,l=e.pitch,c=void 0===l?et:l,h=e.altitude,f=void 0===h?rt:h,p=e.maxZoom,d=void 0===p?tt.maxZoom:p,A=e.minZoom,v=void 0===A?tt.minZoom:A,g=e.maxPitch,m=void 0===g?tt.maxPitch:g,y=e.minPitch,_=void 0===y?tt.minPitch:y,b=e.transitionDuration,x=e.transitionEasing,w=e.transitionInterpolator,C=e.transitionInterruption,B=e.startPanLngLat,k=e.startZoomLngLat,E=e.startRotatePos,S=e.startBearing,T=e.startPitch,M=e.startZoom;(0,P.Z)(this,t),X(Number.isFinite(n),"`width` must be supplied"),X(Number.isFinite(r),"`height` must be supplied"),X(Number.isFinite(o),"`longitude` must be supplied"),X(Number.isFinite(i),"`latitude` must be supplied"),X(Number.isFinite(a),"`zoom` must be supplied"),this._viewportProps=this._applyConstraints({width:n,height:r,latitude:i,longitude:o,zoom:a,bearing:u,pitch:c,altitude:f,maxZoom:d,minZoom:v,maxPitch:m,minPitch:_,transitionDuration:b,transitionEasing:x,transitionInterpolator:w,transitionInterruption:C}),this._state={startPanLngLat:B,startZoomLngLat:k,startRotatePos:E,startBearing:S,startPitch:T,startZoom:M}}return(0,Z.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,r=this._state.startPanLngLat||this._unproject(n);if(!r)return this;var i=this._calculateNewLngLat({startPanLngLat:r,pos:e}),o=(0,u.Z)(i,2),a=o[0],s=o[1];return this._getUpdatedMapState({longitude:a,latitude:s})}},{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,r=t.deltaAngleX,i=void 0===r?0:r,o=t.deltaAngleY,a=void 0===o?0:o,s=this._state,u=s.startRotatePos,l=s.startBearing,c=s.startPitch;return Number.isFinite(l)&&Number.isFinite(c)?(e=n?this._calculateNewPitchAndBearing($($({},this._getRotationParams(n,u)),{},{startBearing:l,startPitch:c})):{bearing:l+i,pitch:c+a},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,r=t.scale;X(r>0,"`scale` must be a positive number");var i=this._state,o=i.startZoom,a=i.startZoomLngLat;Number.isFinite(o)||(o=this._viewportProps.zoom,a=this._unproject(n)||this._unproject(e)),X(a,"`startZoomLngLat` prop is required for zoom behavior to calculate where to position the map.");var s=this._calculateNewZoom({scale:r,startZoom:o||0}),c=new l.DW(Object.assign({},this._viewportProps,{zoom:s})).getMapCenterByLngLatPosition({lngLat:a,pos:e}),h=(0,u.Z)(c,2),f=h[0],p=h[1];return this._getUpdatedMapState({zoom:s,longitude:f,latitude:p})}},{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,r=t.zoom;t.zoom=q(r,n,e);var i=t.maxPitch,o=t.minPitch,a=t.pitch;return t.pitch=q(a,o,i),Object.assign(t,(0,l.QA)(t)),t}},{key:"_unproject",value:function(t){var e=new l.DW(this._viewportProps);return t&&e.unproject(t)}},{key:"_calculateNewLngLat",value:function(t){var e=t.startPanLngLat,n=t.pos;return new l.DW(this._viewportProps).getMapCenterByLngLatPosition({lngLat:e,pos:n})}},{key:"_calculateNewZoom",value:function(t){var e=t.scale,n=t.startZoom,r=this._viewportProps,i=r.maxZoom,o=r.minZoom;return q(n+Math.log2(e),o,i)}},{key:"_calculateNewPitchAndBearing",value:function(t){var e=t.deltaScaleX,n=t.deltaScaleY,r=t.startBearing,i=t.startPitch;n=q(n,-1,1);var o=this._viewportProps,a=o.minPitch,s=o.maxPitch,u=i;return n>0?u=i+n*(s-i):n<0&&(u=i-n*(a-i)),{pitch:u,bearing:r+180*e}}},{key:"_getRotationParams",value:function(t,e){var n=t[0]-e[0],r=t[1]-e[1],i=t[1],o=e[1],a=this._viewportProps,s=a.width,u=a.height,l=n/s,c=0;return r>0?Math.abs(u-o)>5&&(c=r/(o-u)*1.2):r<0&&o>5&&(c=1-i/o),{deltaScaleX:l,deltaScaleY:c=Math.min(1,Math.max(-1,c))}}}]),t}();function ot(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function at(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 st=(0,a.createContext)({viewport:null,map:null,container:null,onViewportChange:null,onViewStateChange:null,eventManager:null}),ut=st.Provider;st.Provider=function(t){var e=t.value,n=t.children,r=(0,a.useState)(null),i=(0,u.Z)(r,2),o=i[0],s=i[1],l=(0,a.useContext)(st);return e=at(at({setMap:s},l),{},{map:l&&l.map||o},e),a.createElement(ut,{value:e},n)};var lt=st,ct="undefined"!==typeof window?a.useLayoutEffect:a.useEffect;function ht(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ft(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 pt="A valid API access token is required to use Mapbox data";function dt(t){var e=t.props,n=t.width,r=t.height;return new l.DW(ft(ft(ft({},e),e.viewState),{},{width:n,height:r}))}var At={position:"absolute",width:"100%",height:"100%",overflow:"hidden"},vt=Object.assign({},V.propTypes,{width:s.oneOfType([s.number,s.string]),height:s.oneOfType([s.number,s.string]),onResize:s.func,disableTokenWarning:s.bool,visible:s.bool,className:s.string,style:s.object,visibilityConstraints:s.object}),gt=Object.assign({},V.defaultProps,{disableTokenWarning:!1,visible:!0,onResize:function(){},className:"",style:null,visibilityConstraints:tt});function mt(){return a.createElement("div",{key:"warning",id:"no-token-warning",style:{position:"absolute",left:0,top:0}},a.createElement("h3",{key:"header"},pt),a.createElement("div",{key:"text"},"For information on setting up your basemap, read"),a.createElement("a",{key:"link",href:"https://visgl.github.io/react-map-gl/docs/get-started/mapbox-tokens"},"Note on Map Tokens"))}var yt=(0,a.forwardRef)((function(t,e){var n=(0,a.useState)(!0),r=(0,u.Z)(n,2),i=r[0],o=r[1],s=(0,a.useState)({width:0,height:0}),l=(0,u.Z)(s,2),c=l[0],h=l[1],f=(0,a.useRef)(null),p=(0,a.useRef)(null),d=(0,a.useRef)(null),A=(0,a.useRef)(null),v=(0,a.useContext)(lt);ct((function(){if(yt.supported()){var e=new V(ft(ft(ft({},t),c),{},{mapboxgl:J(),container:p.current,onError:function(e){401===(e.error&&e.error.status||e.status)&&i&&(console.error(pt),o(!1)),t.onError(e)}}));f.current=e,v&&v.setMap&&v.setMap(e.getMap());var n=new I((function(e){if(e[0].contentRect){var n=e[0].contentRect,r=n.width,i=n.height;h({width:r,height:i}),t.onResize({width:r,height:i})}}));return n.observe(d.current),function(){e.finalize(),f.current=null,n.disconnect()}}}),[]),ct((function(){f.current&&f.current.setProps(ft(ft({},t),c))}));var g=f.current&&f.current.getMap();(0,a.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]:{},r=t.current&&t.current.getMap();return r&&r.queryRenderedFeatures(e,n)}}}(f)}),[]);var m=(0,a.useCallback)((function(t){var e=t.target;e===A.current&&e.scrollTo(0,0)}),[]),y=g&&a.createElement(ut,{value:ft(ft({},v),{},{viewport:v.viewport||dt(ft({map:g,props:t},c)),map:g,container:v.container||d.current})},a.createElement("div",{key:"map-overlays",className:"overlays",ref:A,style:At,onScroll:m},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}),k=t.visible&&function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tt;for(var r in n){var i=r.slice(0,3),o=(e=r.slice(3))[0].toLowerCase()+e.slice(1);if("min"===i&&t[o]<n[r])return!1;if("max"===i&&t[o]>n[r])return!1}return!0}(t.viewState||t,C),E=Object.assign({},At,{visibility:k?"inherit":"hidden"});return a.createElement("div",{key:"map-container",ref:d,style:B},a.createElement("div",{key:"map-mapbox",ref:p,style:E,className:_}),y,!i&&!t.disableTokenWarning&&a.createElement(mt,null))}));yt.supported=function(){return J()&&J().supported()},yt.propTypes=vt,yt.defaultProps=gt;var _t=yt;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 r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function xt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var wt=function(){function t(){(0,P.Z)(this,t),(0,o.Z)(this,"propNames",[])}return(0,Z.Z)(t,[{key:"arePropsEqual",value:function(t,e){var n,r=bt(this.propNames||[]);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(!Q(t[i],e[i]))return!1}}catch(o){r.e(o)}finally{r.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),kt=n(99492),Et=n(27597),St={longitude:1,bearing:1};function Tt(t){return Number.isFinite(t)||Array.isArray(t)}function Mt(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 It(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 Pt(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 Pt(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function Pt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Zt(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,r=(0,Et.Z)(t);if(e){var i=(0,Et.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,kt.Z)(this,n)}}var Dt=["longitude","latitude","zoom","bearing","pitch"],Lt=["latitude","longitude","zoom","width","height"],Ot=["bearing","pitch"],Ft={speed:1.2,curve:1.414};!function(t){(0,Bt.Z)(n,t);var e=Zt(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,P.Z)(this,n),t=e.call(this),(0,o.Z)((0,Ct.Z)(t),"propNames",Dt),t.props=Object.assign({},Ft,r),t}(0,Z.Z)(n,[{key:"initializeProps",value:function(t,e){var n,r={},i={},o=It(Lt);try{for(o.s();!(n=o.n()).done;){var a=n.value,s=t[a],u=e[a];X(Tt(s)&&Tt(u),"".concat(a," must be supplied for transition")),r[a]=s,i[a]=Mt(a,s,u)}}catch(d){o.e(d)}finally{o.f()}var l,c=It(Ot);try{for(c.s();!(l=c.n()).done;){var h=l.value,f=t[h]||0,p=e[h]||0;r[h]=f,i[h]=Mt(h,f,p)}}catch(d){c.e(d)}finally{c.f()}return{start:r,end:i}}},{key:"interpolateProps",value:function(t,e,n){var r,i=(0,l.if)(t,e,n,this.props),o=It(Ot);try{for(o.s();!(r=o.n()).done;){var a=r.value;i[a]=K(t[a],e[a],n)}}catch(s){o.e(s)}finally{o.f()}return i}},{key:"getDuration",value:function(t,e){var n=e.transitionDuration;return"auto"===n&&(n=(0,l.up)(t,e,this.props)),n}}])}(wt);function Rt(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 r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}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,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function zt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Ut(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,r=(0,Et.Z)(t);if(e){var i=(0,Et.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,kt.Z)(this,n)}}var Nt=["longitude","latitude","zoom","bearing","pitch"],Gt=function(t){(0,Bt.Z)(n,t);var e=Ut(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,P.Z)(this,n),t=e.call(this),Array.isArray(r)&&(r={transitionProps:r}),t.propNames=r.transitionProps||Nt,r.around&&(t.around=r.around),t}return(0,Z.Z)(n,[{key:"initializeProps",value:function(t,e){var n={},r={};if(this.around){n.around=this.around;var i=new l.DW(t).unproject(this.around);Object.assign(r,e,{around:new l.DW(e).project(i),aroundLngLat:i})}var o,a=Rt(this.propNames);try{for(a.s();!(o=a.n()).done;){var s=o.value,u=t[s],c=e[s];X(Tt(u)&&Tt(c),"".concat(s," must be supplied for transition")),n[s]=u,r[s]=Mt(s,u,c)}}catch(h){a.e(h)}finally{a.f()}return{start:n,end:r}}},{key:"interpolateProps",value:function(t,e,n){var r,i={},o=Rt(this.propNames);try{for(o.s();!(r=o.n()).done;){var a=r.value;i[a]=K(t[a],e[a],n)}}catch(p){o.e(p)}finally{o.f()}if(e.around){var s=new l.DW(Object.assign({},e,i)).getMapCenterByLngLatPosition({lngLat:e.aroundLngLat,pos:K(t.around,e.around,n)}),c=(0,u.Z)(s,2),h=c[0],f=c[1];i.longitude=h,i.latitude=f}return i}}]),n}(wt),jt=function(){};var Vt=1,Ht=2,Jt=3,Wt=4,Qt={transitionDuration:0,transitionEasing:function(t){return t},transitionInterpolator:new Gt,transitionInterruption:Vt,onTransitionStart:jt,onTransitionInterrupt:jt,onTransitionEnd:jt},qt=function(){function t(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,P.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,Z.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),r=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 i=this.time(),o=(i-this.state.startTime)/this.state.duration;r.transitionDuration=this.state.duration-(i-this.state.startTime),r.transitionEasing=function(t,e){var n=t(e);return function(r){return 1/(1-n)*(t(r*(1-e)+e)-n)}}(this.state.easing,o),r.transitionInterpolator=n.transitionInterpolator}return r.onTransitionStart(),this._triggerTransition(n,r),!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,r=n.getDuration?n.getDuration(t,e):e.transitionDuration;if(0!==r){var i=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:r,easing:e.transitionEasing,interpolator:e.transitionInterpolator,interruption:e.transitionInterruption,startTime:this.time(),startProps:i.start,endProps:i.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,r=e.duration,i=e.easing,o=e.interpolator,a=e.startProps,s=e.endProps,u=!1,l=(t-n)/r;l>=1&&(l=1,u=!0),l=i(l);var c=o.interpolateProps(a,s,l),h=new it(Object.assign({},this.props,c));this.state.propsInTransition=h.getViewportProps(),this.onViewportChange(this.state.propsInTransition,this.props),u&&(this._endTransition(),this.props.onTransitionEnd())}}]),t}();(0,o.Z)(qt,"defaultProps",Qt);var Kt=n(48331);function Xt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}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 Gt,transitionInterruption:Vt},ee=300,ne=function(t){return 1-(1-t)*(1-t)},re=["wheel"],ie=["panstart","panmove","panend"],oe=["pinchstart","pinchmove","pinchend"],ae=["tripanstart","tripanmove","tripanend"],se=["doubletap"],ue=["keydown"],le=function(){function t(){var e=this;(0,P.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 qt({onViewportChange:this._onTransition,onStateChange:this._setInteractionState})}return(0,Z.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 r=this.mapState instanceof it?this.mapState.getViewportProps():this.mapState,i=Yt(Yt({},t.getViewportProps()),e),o=Object.keys(i).some((function(t){return r[t]!==i[t]}));this._state=t.getState(),this._setInteractionState(n),o&&this.onViewportChange(i,this._interactionState,r)}},{key:"getMapState",value:function(t){return new it(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,r=t.eventManager,i=void 0===r?this.eventManager:r,o=t.isInteractive,a=void 0===o||o,s=t.scrollZoom,u=void 0===s?this.scrollZoom:s,l=t.dragPan,c=void 0===l?this.dragPan:l,h=t.dragRotate,f=void 0===h?this.dragRotate:h,p=t.doubleClickZoom,d=void 0===p?this.doubleClickZoom:p,A=t.touchZoom,v=void 0===A?this.touchZoom:A,g=t.touchRotate,m=void 0===g?this.touchRotate:g,y=t.keyboard,_=void 0===y?this.keyboard:y;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 it(t))),this._transitionManager.processViewportChange(t),this.eventManager!==i&&(this.eventManager=i,this._events={},this.toggleEvents(this.events,!0)),this.toggleEvents(re,a&&Boolean(u)),this.toggleEvents(ie,a&&Boolean(c||f)),this.toggleEvents(oe,a&&Boolean(v||m)),this.toggleEvents(ae,a&&Boolean(m)),this.toggleEvents(se,a&&Boolean(d)),this.toggleEvents(ue,a&&Boolean(_)),this.scrollZoom=u,this.dragPan=c,this.dragRotate=f,this.doubleClickZoom=d,this.touchZoom=v,this.touchRotate=m,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 r=this.getCenter(t),i=[r[0]+t.velocityX*n/2,r[1]+t.velocityY*n/2],o=this.mapState.pan({pos:i}).panEnd();return this.updateViewport(o,Yt(Yt({},te),{},{transitionDuration:n,transitionEasing:ne}),{isDragging:!1,isPanning:!0}),!0}}var a=this.mapState.panEnd();return this.updateViewport(a,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 r=this.getCenter(t),i=[r[0]+t.velocityX*n/2,r[1]+t.velocityY*n/2],o=this.mapState.rotate({pos:i}).rotateEnd();return this.updateViewport(o,Yt(Yt({},te),{},{transitionDuration:n,transitionEasing:ne}),{isDragging:!1,isRotating:!0}),!0}}var a=this.mapState.panEnd();return this.updateViewport(a,null,{isDragging:!1,isRotating:!1}),!0}},{key:"_onWheel",value:function(t){if(!this.scrollZoom)return!1;var e=this.scrollZoom,n=e.speed,r=void 0===n?.01:n,i=e.smooth,o=void 0!==i&&i;t.preventDefault();var a=this.getCenter(t),s=t.delta,u=2/(1+Math.exp(-Math.abs(s*r)));s<0&&0!==u&&(u=1/u);var l=this.mapState.zoom({pos:a,scale:u});return l.getViewportProps().zoom!==this.mapStateProps.zoom&&(this.updateViewport(l,Yt(Yt({},te),{},{transitionInterpolator:new Gt({around:a}),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,r=this.getCenter(t);e=e.zoom({pos:r,scale:n})}if(this.touchRotate){var i=t.rotation;e=e.rotate({deltaAngleX:this._startPinchRotation-i})}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,r=this._lastPinchEvent;if(n&&r&&t.scale!==r.scale){var i=this.getCenter(t),o=this.mapState.rotateEnd(),a=Math.log2(t.scale),s=(a-Math.log2(r.scale))/(t.deltaTime-r.deltaTime),u=Math.pow(2,a+s*n/2);return o=o.zoom({pos:i,scale:u}).zoomEnd(),this.updateViewport(o,Yt(Yt({},te),{},{transitionInterpolator:new Gt({around:i}),transitionDuration:n,transitionEasing:ne}),{isDragging:!1,isPanning:Boolean(this.touchZoom),isZooming:Boolean(this.touchZoom),isRotating:!1}),this.blockEvents(n),!0}}var l=this.mapState.zoomEnd().rotateEnd();return this._state.startPinchRotation=0,this.updateViewport(l,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 r=this.getCenter(t),i=[r[0],r[1]+=t.velocityY*n/2],o=this.mapState.rotate({pos:i});return this.updateViewport(o,Yt(Yt({},te),{},{transitionDuration:n,transitionEasing:ne}),{isDragging:!1,isRotating:!0}),this.blockEvents(n),!1}}var a=this.mapState.rotateEnd();return this.updateViewport(a,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),r=this.mapState.zoom({pos:e,scale:n?.5:2});return this.updateViewport(r,Object.assign({},te,{transitionInterpolator:new Gt({around:e})}),{isZooming:!0}),!0}},{key:"_onKeyDown",value:function(t){if(!this.keyboard)return!1;var e,n=this.isFunctionKeyPressed(t),r=this.keyboard,i=r.zoomSpeed,o=void 0===i?2:i,a=r.moveSpeed,s=void 0===a?100:a,u=r.rotateSpeedX,l=void 0===u?15:u,c=r.rotateSpeedY,h=void 0===c?10:c,f=this.mapStateProps;switch(t.srcEvent.keyCode){case 189:e=n?this.getMapState({zoom:f.zoom-Math.log2(o)-1}):this.getMapState({zoom:f.zoom-Math.log2(o)});break;case 187:e=n?this.getMapState({zoom:f.zoom+Math.log2(o)+1}):this.getMapState({zoom:f.zoom+Math.log2(o)});break;case 37:e=n?this.getMapState({bearing:f.bearing-l}):this.mapState.pan({pos:[s,0],startPos:[0,0]});break;case 39:e=n?this.getMapState({bearing:f.bearing+l}):this.mapState.pan({pos:[-s,0],startPos:[0,0]});break;case 38:e=n?this.getMapState({pitch:f.pitch+h}):this.mapState.pan({pos:[0,s],startPos:[0,0]});break;case 40:e=n?this.getMapState({pitch:f.pitch-h}):this.mapState.pan({pos:[0,-s],startPos:[0,0]});break;default:return!1}return this.updateViewport(e,te)}}]),t}();function ce(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function he(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}var fe=Object.assign({},_t.propTypes,{maxZoom:s.number,minZoom:s.number,maxPitch:s.number,minPitch:s.number,onViewStateChange:s.func,onViewportChange:s.func,onInteractionStateChange:s.func,transitionDuration:s.oneOfType([s.number,s.string]),transitionInterpolator:s.object,transitionInterruption:s.number,transitionEasing:s.func,onTransitionStart:s.func,onTransitionInterrupt:s.func,onTransitionEnd:s.func,scrollZoom:s.oneOfType([s.bool,s.object]),dragPan:s.oneOfType([s.bool,s.object]),dragRotate:s.oneOfType([s.bool,s.object]),doubleClickZoom:s.bool,touchZoom:s.oneOfType([s.bool,s.object]),touchRotate:s.oneOfType([s.bool,s.object]),keyboard:s.oneOfType([s.bool,s.object]),onHover:s.func,onClick:s.func,onDblClick:s.func,onContextMenu:s.func,onMouseDown:s.func,onMouseMove:s.func,onMouseUp:s.func,onTouchStart:s.func,onTouchMove:s.func,onTouchEnd:s.func,onMouseEnter:s.func,onMouseLeave:s.func,onMouseOut:s.func,onWheel:s.func,touchAction:s.string,eventRecognizerOptions:s.object,clickRadius:s.number,interactiveLayerIds:s.array,getCursor:s.func,controller:s.instanceOf(le)}),pe=Object.assign({},_t.defaultProps,tt,qt.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 de(t){if(t.lngLat||!t.offsetCenter)return t;var e=t.offsetCenter,n=e.x,r=e.y;if(!Number.isFinite(n)||!Number.isFinite(r))return t;var i=[n,r];return t.point=i,t.lngLat=this.viewport.unproject(i),t}function Ae(t){var e=this.map;if(!e||!t)return null;var n={},r=this.props.clickRadius;this.props.interactiveLayerIds&&(n.layers=this.props.interactiveLayerIds);try{return e.queryRenderedFeatures(r?[[t[0]-r,t[1]+r],[t[0]+r,t[1]-r]]:t,n)}catch(i){return null}}function ve(t,e){var n=this.props[t];n&&n(de.call(this,e))}function ge(t){ve.call(this,"touch"===t.pointerType?"onTouchStart":"onMouseDown",t)}function me(t){ve.call(this,"touch"===t.pointerType?"onTouchEnd":"onMouseUp",t)}function ye(t){if(ve.call(this,"touch"===t.pointerType?"onTouchMove":"onMouseMove",t),!this.state.isDragging){var e,n=this.props,r=n.onHover,i=n.interactiveLayerIds;t=de.call(this,t),(i||r)&&(e=Ae.call(this,t.point));var o=Boolean(i&&e&&e.length>0),a=o&&!this.state.isHovering,s=!o&&this.state.isHovering;(r||a)&&(t.features=e,r&&r(t)),a&&ve.call(this,"onMouseEnter",t),s&&ve.call(this,"onMouseLeave",t),(a||s)&&this.setState({isHovering:o})}}function _e(t){var e=this.props,n=e.onClick,r=e.onNativeClick,i=e.onDblClick,o=e.doubleClickZoom,a=[],s=i||o;switch(t.type){case"anyclick":a.push(r),s||a.push(n);break;case"click":s&&a.push(n)}(a=a.filter(Boolean)).length&&((t=de.call(this,t)).features=Ae.call(this,t.point),a.forEach((function(e){return e(t)})))}var be=(0,a.forwardRef)((function(t,e){var n=(0,a.useContext)(lt),o=(0,a.useMemo)((function(){return t.controller||new le}),[]),s=(0,a.useMemo)((function(){return new Kt.Q(null,{touchAction:t.touchAction,recognizerOptions:t.eventRecognizerOptions})}),[]),u=(0,a.useRef)(null),l=(0,a.useRef)(null),c=(0,a.useRef)({width:0,height:0,state:{isHovering:!1,isDragging:!1}}).current;c.props=t,c.map=l.current&&l.current.getMap(),c.setState=function(e){c.state=he(he({},c.state),e),u.current.style.cursor=t.getCursor(c.state)};var h,f,p=!0,d=function(t,e,n){if(p)h=[t,e,n];else{var r=c.props,i=r.onViewStateChange,o=r.onViewportChange;i&&i({viewState:t,interactionState:e,oldViewState:n}),o&&o(t,e,n)}};(0,a.useImperativeHandle)(e,(function(){return function(t){return{getMap:t.current&&t.current.getMap,queryRenderedFeatures:t.current&&t.current.queryRenderedFeatures}}(l)}),[]);var A=(0,a.useMemo)((function(){return he(he({},n),{},{eventManager:s,container:n.container||u.current})}),[n,u.current]);A.onViewportChange=d,A.viewport=n.viewport||dt(c),c.viewport=A.viewport;var v=function(t){var e=t.isDragging,n=void 0!==e&&e;if(n!==c.state.isDragging&&c.setState({isDragging:n}),p)f=t;else{var r=c.props.onInteractionStateChange;r&&r(t)}},g=function(){c.width&&c.height&&o.setOptions(he(he(he({},c.props),c.props.viewState),{},{isInteractive:Boolean(c.props.onViewStateChange||c.props.onViewportChange),onViewportChange:d,onStateChange:v,eventManager:s,width:c.width,height:c.height}))};(0,a.useEffect)((function(){return s.setElement(u.current),s.on({pointerdown:ge.bind(c),pointermove:ye.bind(c),pointerup:me.bind(c),pointerleave:ve.bind(c,"onMouseOut"),click:_e.bind(c),anyclick:_e.bind(c),dblclick:ve.bind(c,"onDblClick"),wheel:ve.bind(c,"onWheel"),contextmenu:ve.bind(c,"onContextMenu")}),function(){s.destroy()}}),[]),ct((function(){h&&d.apply(void 0,(0,i.Z)(h)),f&&v(f)})),g();var m=t.width,y=t.height,_=t.style,b=t.getCursor,x=(0,a.useMemo)((function(){return he(he({position:"relative"},_),{},{width:m,height:y,cursor:b(c.state)})}),[_,m,y,b,c.state]);return h&&c._child||(c._child=a.createElement(ut,{value:A},a.createElement("div",{key:"event-canvas",ref:u,style:x},a.createElement(_t,(0,r.Z)({},t,{width:"100%",height:"100%",style:null,onResize:function(t){var e=t.width,n=t.height;c.width=e,c.height=n,g(),c.props.onResize({width:e,height:n})},ref:l}))))),p=!1,c._child}));be.supported=_t.supported,be.propTypes=fe,be.defaultProps=pe;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 r=Object.keys(t),i=Object.keys(e);if(r.length!==i.length)return!1;for(var o=0,a=r;o<a.length;o++){var s=a[o];if(!e.hasOwnProperty(s))return!1;if(!we(t[s],e[s]))return!1}return!0}return!1}function Ce(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}var Be={type:s.string.isRequired,id:s.string},ke=0;function Ee(t,e,n){if(t&&t.style&&t.style._loaded){var r=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 r.id,delete r.children,t.addSource(e,r),t.getSource(e)}return null}function Se(t){var e=(0,a.useContext)(lt),n=(0,a.useRef)({id:t.id,type:t.type}),r=(0,a.useState)(0),i=(0,u.Z)(r,2)[1],o=(0,a.useMemo)((function(){return t.id||"jsx-source-".concat(ke++)}),[]),s=e.map;(0,a.useEffect)((function(){if(s){var t=function(){return i((function(t){return t+1}))};return s.on("styledata",t),function(){s.off("styledata",t),requestAnimationFrame((function(){s.style&&s.style._loaded&&s.getSource(o)&&s.removeSource(o)}))}}}),[s,o]);var l=s&&s.style&&s.getSource(o);return l?function(t,e,n){X(e.id===n.id,"source id changed"),X(e.type===n.type,"source type changed");var r="",i=0;for(var o in e)"children"===o||"id"===o||we(n[o],e[o])||(r=o,i++);if(i){var a=e.type;if("geojson"===a)t.setData(e.data);else if("image"===a)t.updateImage({url:e.url,coordinates:e.coordinates});else if("canvas"!==a&&"video"!==a||1!==i||"coordinates"!==r)if("vector"===a&&t.setUrl)switch(r){case"url":t.setUrl(e.url);break;case"tiles":t.setTiles(e.tiles)}else console.warn("Unable to update <Source> prop: ".concat(r));else t.setCoordinates(e.coordinates)}}(l,t,n.current):l=Ee(s,o,t),n.current=t,l&&a.Children.map(t.children,(function(t){return t&&(0,a.cloneElement)(t,{source:o})}))||null}Se.propTypes=Be;var Te=n(53782);function Me(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Ie(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Me(Object(n),!0).forEach((function(e){(0,o.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Me(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Pe={type:s.oneOf(["fill","line","symbol","circle","fill-extrusion","raster","background","heatmap","hillshade"]).isRequired,id:s.string,source:s.string,beforeId:s.string};function Ze(t,e,n,r){X(n.id===r.id,"layer id changed"),X(n.type===r.type,"layer type changed");try{!function(t,e,n,r){var i=n.layout,o=void 0===i?{}:i,a=n.paint,s=void 0===a?{}:a,u=n.filter,l=n.minzoom,c=n.maxzoom,h=n.beforeId,f=(0,Te.Z)(n,["layout","paint","filter","minzoom","maxzoom","beforeId"]);if(h!==r.beforeId&&t.moveLayer(e,h),o!==r.layout){var p=r.layout||{};for(var d in o)we(o[d],p[d])||t.setLayoutProperty(e,d,o[d]);for(var A in p)o.hasOwnProperty(A)||t.setLayoutProperty(e,A,void 0)}if(s!==r.paint){var v=r.paint||{};for(var g in s)we(s[g],v[g])||t.setPaintProperty(e,g,s[g]);for(var m in v)s.hasOwnProperty(m)||t.setPaintProperty(e,m,void 0)}for(var y in we(u,r.filter)||t.setFilter(e,u),l===r.minzoom&&c===r.maxzoom||t.setLayerZoomRange(e,l,c),f)we(f[y],r[y])||t.setLayerProperty(e,y,f[y])}(t,e,n,r)}catch(i){console.warn(i)}}var De=0;function Le(t){var e=(0,a.useContext)(lt),n=(0,a.useRef)({id:t.id,type:t.type}),r=(0,a.useState)(0),i=(0,u.Z)(r,2)[1],o=(0,a.useMemo)((function(){return t.id||"jsx-layer-".concat(De++)}),[]),s=e.map;return(0,a.useEffect)((function(){if(s){var t=function(){return i((function(t){return t+1}))};return s.on("styledata",t),function(){s.off("styledata",t),s.style&&s.style._loaded&&s.removeLayer(o)}}}),[s]),s&&s.style&&s.getLayer(o)?Ze(s,o,t,n.current):function(t,e,n){if(t.style&&t.style._loaded){var r=Ie(Ie({},n),{},{id:e});delete r.beforeId,t.addLayer(r,n.beforeId)}}(s,o,t),n.current=t,null}Le.propTypes=Pe;var Oe={captureScroll:!1,captureDrag:!0,captureClick:!0,captureDoubleClick:!0,capturePointerMove:!1},Fe={captureScroll:s.bool,captureDrag:s.bool,captureClick:s.bool,captureDoubleClick:s.bool,capturePointerMove:s.bool};function Re(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=(0,a.useContext)(lt),n=(0,a.useRef)(null),r=(0,a.useRef)({props:t,state:{},context:e,containerRef:n}).current;return r.props=t,r.context=e,(0,a.useEffect)((function(){return function(t){var e=t.containerRef.current,n=t.context.eventManager;if(e&&n){var r={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(r,e),function(){n.off(r)}}}(r)}),[e.eventManager]),r}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,r=(0,Et.Z)(t);if(e){var i=(0,Et.Z)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,kt.Z)(this,n)}}function Ue(t){var e=t.instance,n=Re(t),r=n.context,i=n.containerRef;return e._context=r,e._containerRef=i,e._render()}var Ne=function(t){(0,Bt.Z)(n,t);var e=ze(n);function n(){var t;(0,P.Z)(this,n);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return t=e.call.apply(e,[this].concat(i)),(0,o.Z)((0,Ct.Z)(t),"_context",{}),(0,o.Z)((0,Ct.Z)(t),"_containerRef",(0,a.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,Z.Z)(n,[{key:"_render",value:function(){throw new Error("_render() not implemented")}},{key:"render",value:function(){return a.createElement(Ue,(0,r.Z)({instance:this},this.props,{onScroll:this._onScroll,onDragStart:this._onDragStart,onDblClick:this._onDblClick,onClick:this._onClick,onPointerMove:this._onPointerMove}))}}]),n}(a.PureComponent);function Ge(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function je(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ge(Object(n),!0).forEach((function(e){(0,o.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ge(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}(0,o.Z)(Ne,"propTypes",Fe),(0,o.Z)(Ne,"defaultProps",Oe);var Ve=Object.assign({},Fe,{draggable:s.bool,onDrag:s.func,onDragEnd:s.func,onDragStart:s.func,offsetLeft:s.number,offsetTop:s.number}),He=Object.assign({},Oe,{draggable:!1,offsetLeft:0,offsetTop:0});function Je(t){var e=t.offsetCenter;return[e.x,e.y]}function We(t,e,n,r){var i=t[0]+e[0]-n.offsetLeft,o=t[1]+e[1]-n.offsetTop;return r.viewport.unproject([i,o])}function Qe(t,e){var n=e.props,r=e.callbacks,i=e.state,o=e.context,a=e.containerRef;if(n.draggable){t.stopPropagation();var s=Je(t),u=function(t,e){var n=t.center,r=n.x,i=n.y;if(e){var o=e.getBoundingClientRect();return[o.left-r,o.top-i]}return null}(t,a.current);if(i.setDragPos(s),i.setDragOffset(u),r.onDragStart&&u){var l=Object.assign({},t);l.lngLat=We(s,u,n,o),r.onDragStart(l)}}}function qe(t){var e=t.context.eventManager;if(e&&t.state.dragPos){var n={panmove:function(e){return function(t,e){var n=e.props,r=e.callbacks,i=e.state,o=e.context;t.stopPropagation();var a=Je(t);i.setDragPos(a);var s=i.dragOffset;if(r.onDrag&&s){var u=Object.assign({},t);u.lngLat=We(a,s,n,o),r.onDrag(u)}}(e,t)},panend:function(e){return function(t,e){var n=e.props,r=e.callbacks,i=e.state,o=e.context;t.stopPropagation();var a=i.dragPos,s=i.dragOffset;if(i.setDragPos(null),i.setDragOffset(null),r.onDragEnd&&a&&s){var u=Object.assign({},t);u.lngLat=We(a,s,n,o),r.onDragEnd(u)}}(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 Ke="undefined"!==typeof window&&window.devicePixelRatio||1,Xe=function(t){return Math.round(t*Ke)/Ke},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 r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}var tn=Object.assign({},Ve,{className:s.string,longitude:s.number.isRequired,latitude:s.number.isRequired,style:s.object}),en=Object.assign({},He,{className:""});function nn(t){var e=function(t){var e=(0,a.useState)(null),n=(0,u.Z)(e,2),r=n[0],i=n[1],o=(0,a.useState)(null),s=(0,u.Z)(o,2),l=s[0],c=s[1],h=Re(je(je({},t),{},{onDragStart:Qe}));return h.callbacks=t,h.state.dragPos=r,h.state.setDragPos=i,h.state.dragOffset=l,h.state.setDragOffset=c,(0,a.useEffect)((function(){return qe(h)}),[h.context.eventManager,Boolean(r)]),h}(t),n=e.state,r=e.containerRef,i=t.children,s=t.className,l=t.draggable,c=t.style,h=n.dragPos,f=function(t){var e=t.props,n=t.state,r=t.context,i=e.longitude,o=e.latitude,a=e.offsetLeft,s=e.offsetTop,l=n.dragPos,c=n.dragOffset;if(l&&c)return[l[0]+c[0],l[1]+c[1]];var h=r.viewport.project([i,o]),f=(0,u.Z)(h,2),p=f[0],d=f[1];return[p+=a,d+=s]}(e),p=(0,u.Z)(f,2),d=p[0],A=p[1],v="translate(".concat(Xe(d),"px, ").concat(Xe(A),"px)"),g=l?h?"grabbing":"grab":"auto",m=(0,a.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:v,cursor:g},c);return a.createElement("div",{className:"mapboxgl-marker ".concat(s),ref:e.containerRef,style:t},i)}),[i,s]),y=r.current;return y&&(y.style.transform=v,y.style.cursor=g),m}nn.defaultProps=en,nn.propTypes=tn;a.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 an=Object.assign({},Fe,{className:s.string,longitude:s.number.isRequired,latitude:s.number.isRequired,altitude:s.number,offsetLeft:s.number,offsetTop:s.number,tipSize:s.number,closeButton:s.bool,closeOnClick:s.bool,anchor:s.oneOf(Object.keys(rn)),dynamicPosition:s.bool,sortByDepth:s.bool,onClose:s.func}),sn=Object.assign({},Oe,{className:"",altitude:0,offsetLeft:0,offsetTop:0,tipSize:10,anchor:"bottom",dynamicPosition:!0,sortByDepth:!1,closeButton:!0,closeOnClick:!0,onClose:function(){}});function un(t,e,n,r){var i=(0,u.Z)(r,2),o=i[0],a=i[1],s=t.anchor,l=t.dynamicPosition,c=t.tipSize;return n&&l?function(t){var e=t.x,n=t.y,r=t.width,i=t.height,o=t.selfWidth,a=t.selfHeight,s=t.anchor,u=t.padding,l=void 0===u?0:u,c=rn[s],h=c.x,f=c.y,p=n-f*a,d=p+a,A=Math.max(0,l-p)+Math.max(0,d-i+l);if(A>0){var v=f,g=A;for(f=0;f<=1;f+=.5)d=(p=n-f*a)+a,(A=Math.max(0,l-p)+Math.max(0,d-i+l))<g&&(g=A,v=f);f=v}var m=.5;.5===f&&(h=Math.floor(h),m=1);var y=e-h*o,_=y+o,b=Math.max(0,l-y)+Math.max(0,_-r+l);if(b>0){var x=h,w=b;for(h=0;h<=1;h+=m)_=(y=e-h*o)+o,(b=Math.max(0,l-y)+Math.max(0,_-r+l))<w&&(w=b,x=h);h=x}return on.find((function(t){var e=rn[t];return e.x===h&&e.y===f}))||s}({x:o,y:a,anchor:s,padding:c,width:e.width,height:e.height,selfWidth:n.clientWidth,selfHeight:n.clientHeight}):s}function ln(t){var e=(0,a.useRef)(null),n=Re(t),r=n.context,i=n.containerRef,o=(0,a.useState)(!1),s=(0,u.Z)(o,2)[1];(0,a.useEffect)((function(){s(!0)}),[e.current]),(0,a.useEffect)((function(){if(r.eventManager&&t.closeOnClick){var e=function(){return n.props.onClose()};return r.eventManager.on("anyclick",e),function(){r.eventManager.off("anyclick",e)}}}),[r.eventManager,t.closeOnClick]);var l=r.viewport,c=t.className,h=t.longitude,f=t.latitude,p=t.altitude,d=t.tipSize,A=t.closeButton,v=t.children,g=l.project([h,f,p]),m=un(t,l,e.current,g),y=function(t,e,n,r,i){var o=(0,u.Z)(r,3),a=o[0],s=o[1],l=o[2],c=t.offsetLeft,h=t.offsetTop,f=t.sortByDepth,p=rn[i],d=a+c,A=s+h,v=Ye(n,100*-p.x),g=Ye(n,100*-p.y,"y"),m={position:"absolute",transform:"\n      translate(".concat(v,"%, ").concat(g,"%)\n      translate(").concat(Xe(d),"px, ").concat(Xe(A),"px)\n    "),display:void 0,zIndex:void 0};return f?(l>1||l<-1||a<0||a>e.width||s<0||s>e.height?m.display="none":m.zIndex=Math.floor((1-l)/2*1e5),m):m}(t,l,i.current,g,m),_=(0,a.useCallback)((function(t){n.props.onClose();var e=n.context.eventManager;e&&e.once("click",(function(t){return t.stopPropagation()}),t.target)}),[]);return a.createElement("div",{className:"mapboxgl-popup mapboxgl-popup-anchor-".concat(m," ").concat(c),style:y,ref:i},a.createElement("div",{key:"tip",className:"mapboxgl-popup-tip",style:{borderWidth:d}}),a.createElement("div",{key:"content",ref:e,className:"mapboxgl-popup-content"},A&&a.createElement("button",{key:"close-button",className:"mapboxgl-popup-close-button",type:"button",onClick:_},"\xd7"),v))}ln.propTypes=an,ln.defaultProps=sn;a.memo(ln);function cn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}var hn=Object.assign({},Fe,{toggleLabel:s.string,className:s.string,style:s.object,compact:s.bool,customAttribution:s.oneOfType([s.string,s.arrayOf(s.string)])}),fn=Object.assign({},Oe,{className:"",toggleLabel:"Toggle Attribution"});function pn(t){var e=Re(t),n=e.context,r=e.containerRef,i=(0,a.useRef)(null),s=(0,a.useState)(!1),l=(0,u.Z)(s,2),c=l[0],h=l[1];(0,a.useEffect)((function(){var e;return n.map&&(e=function(t,e,n,r){var i=new(J().AttributionControl)(t);return i._map=e,i._container=n,i._innerContainer=r,i._updateAttributions(),i._updateEditLink(),e.on("styledata",i._updateData),e.on("sourcedata",i._updateData),i}({customAttribution:t.customAttribution},n.map,r.current,i.current)),function(){return e&&function(t){t._map.off("styledata",t._updateData),t._map.off("sourcedata",t._updateData)}(e)}}),[n.map]);var f=void 0===t.compact?n.viewport.width<=640:t.compact;(0,a.useEffect)((function(){!f&&c&&h(!1)}),[f]);var p=(0,a.useCallback)((function(){return h((function(t){return!t}))}),[]),d=(0,a.useMemo)((function(){return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?cn(Object(n),!0).forEach((function(e){(0,o.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):cn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({position:"absolute"},t.style)}),[t.style]);return a.createElement("div",{style:d,className:t.className},a.createElement("div",{ref:r,"aria-pressed":c,className:"mapboxgl-ctrl mapboxgl-ctrl-attrib ".concat(f?"mapboxgl-compact":""," ").concat(c?"mapboxgl-compact-show":"")},a.createElement("button",{type:"button",className:"mapboxgl-ctrl-attrib-button",title:t.toggleLabel,onClick:p}),a.createElement("div",{ref:i,className:"mapboxgl-ctrl-attrib-inner",role:"list"})))}pn.propTypes=hn,pn.defaultProps=fn;a.memo(pn);function dn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}var An=Object.assign({},Fe,{className:s.string,style:s.object,container:s.object,label:s.string}),vn=Object.assign({},Oe,{className:"",container:null,label:"Toggle fullscreen"});function gn(t){var e=Re(t),n=e.context,r=e.containerRef,i=(0,a.useState)(!1),s=(0,u.Z)(i,2),l=s[0],c=s[1],h=(0,a.useState)(!1),f=(0,u.Z)(h,2),p=f[0],d=f[1],A=(0,a.useState)(null),v=(0,u.Z)(A,2),g=v[0],m=v[1];(0,a.useEffect)((function(){var t=new(J().FullscreenControl);m(t),d(t._checkFullscreenSupport());var e=function(){var e=!t._fullscreen;t._fullscreen=e,c(e)};return D.addEventListener(t._fullscreenchange,e),function(){D.removeEventListener(t._fullscreenchange,e)}}),[]);var y=(0,a.useMemo)((function(){return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?dn(Object(n),!0).forEach((function(e){(0,o.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):dn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({position:"absolute"},t.style)}),[t.style]);if(!p)return null;var _=t.className,b=t.label,x=l?"shrink":"fullscreen";return a.createElement("div",{style:y,className:_},a.createElement("div",{className:"mapboxgl-ctrl mapboxgl-ctrl-group",ref:r},a.createElement("button",{key:x,className:"mapboxgl-ctrl-icon mapboxgl-ctrl-".concat(x),type:"button",title:b,onClick:function(){g&&(g._container=t.container||n.container,g._onClickFullscreen())}},a.createElement("span",{className:"mapboxgl-ctrl-icon","aria-hidden":"true"}))))}gn.propTypes=An,gn.defaultProps=vn;var mn;a.memo(gn);function yn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}var _n=function(){},bn=Object.assign({},Fe,{className:s.string,style:s.object,label:s.string,disabledLabel:s.string,auto:s.bool,positionOptions:s.object,fitBoundsOptions:s.object,trackUserLocation:s.bool,showUserLocation:s.bool,showAccuracyCircle:s.bool,showUserHeading:s.bool,onViewStateChange:s.func,onViewportChange:s.func,onGeolocate:s.func}),xn=Object.assign({},Oe,{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,r=e.props,i=function(t){var e=new(J().LngLat)(t.coords.longitude,t.coords.latitude),n=t.coords.accuracy,r=e.toBounds(n);return[[r._ne.lng,r._ne.lat],[r._sw.lng,r._sw.lat]]}(t),o=n.viewport.fitBounds(i,r.fitBoundsOptions),a=o.longitude,s=o.latitude,u=o.zoom,l=Object.assign({},n.viewport,{longitude:a,latitude:s,zoom:u}),c=new it(l),h=Object.assign({},c.getViewportProps(),te),f=r.onViewportChange||n.onViewportChange||_n;(r.onViewStateChange||n.onViewStateChange||_n)({viewState:h}),f(h)}function Cn(t){var e=Re(t),n=e.context,r=e.containerRef,i=(0,a.useRef)(null),s=(0,a.useState)(null),l=(0,u.Z)(s,2),c=l[0],h=l[1],f=(0,a.useState)(!1),p=(0,u.Z)(f,2),d=p[0],A=p[1];(0,a.useEffect)((function(){var r;return n.map&&(void 0!==mn?Promise.resolve(mn):void 0!==window.navigator.permissions?window.navigator.permissions.query({name:"geolocation"}).then((function(t){return mn="denied"!==t.state})):(mn=Boolean(window.navigator.geolocation),Promise.resolve(mn))).then((function(o){A(o),i.current&&(r=function(t,e,n){var r=new(J().GeolocateControl)(e);r._container=D.createElement("div"),r._map={on:function(){},_getUIString:function(){return""}},r._setupUI(!0),r._map=t.map,r._geolocateButton=n;var i=t.eventManager;return r.options.trackUserLocation&&i&&i.on("panstart",(function(){"ACTIVE_LOCK"===r._watchState&&(r._watchState="BACKGROUND",n.classList.add("mapboxgl-ctrl-geolocate-background"),n.classList.remove("mapboxgl-ctrl-geolocate-active"))})),r.on("geolocate",e.onGeolocate),r}(n,t,i.current),r._updateCamera=function(t){return wn(t,e)},h(r))})),function(){r&&r._clearWatch()}}),[n.map]);var v=(0,a.useCallback)((function(){c&&(c.options=e.props,c.trigger())}),[c]);(0,a.useEffect)((function(){t.auto&&v()}),[c,t.auto]),(0,a.useEffect)((function(){c&&c._onZoom()}),[n.viewport.zoom]);var g=t.className,m=t.label,y=t.disabledLabel,_=t.trackUserLocation,b=(0,a.useMemo)((function(){return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?yn(Object(n),!0).forEach((function(e){(0,o.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):yn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({position:"absolute"},t.style)}),[t.style]);return a.createElement("div",{style:b,className:g},a.createElement("div",{key:"geolocate-control",className:"mapboxgl-ctrl mapboxgl-ctrl-group",ref:r},a.createElement("button",{key:"geolocate",className:"mapboxgl-ctrl-icon mapboxgl-ctrl-geolocate",ref:i,disabled:!d,"aria-pressed":!_,type:"button",title:d?m:y,"aria-label":d?m:y,onClick:v},a.createElement("span",{className:"mapboxgl-ctrl-icon","aria-hidden":"true"}))))}Cn.propTypes=bn,Cn.defaultProps=xn;a.memo(Cn);function Bn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}var kn=function(){},En=Object.assign({},Fe,{className:s.string,style:s.object,onViewStateChange:s.func,onViewportChange:s.func,showCompass:s.bool,showZoom:s.bool,zoomInLabel:s.string,zoomOutLabel:s.string,compassLabel:s.string}),Sn=Object.assign({},Oe,{className:"",showCompass:!0,showZoom:!0,zoomInLabel:"Zoom In",zoomOutLabel:"Zoom Out",compassLabel:"Reset North"}),Tn=1,Mn=2;function In(t){return function(t,e){for(var n=(t||"").split(".").map(Number),r=(e||"").split(".").map(Number),i=0;i<3;i++){var o=n[i]||0,a=r[i]||0;if(o<a)return-1;if(o>a)return 1}return 0}(t,"1.6.0")>=0?Mn:Tn}function Pn(t,e,n){var r=t.viewport,i=new it(Object.assign({},r,n)),o=Object.assign({},i.getViewportProps(),te),a=e.onViewportChange||t.onViewportChange||kn;(e.onViewStateChange||t.onViewStateChange||kn)({viewState:o}),a(o)}function Zn(t,e,n,r){return a.createElement("button",{key:t,className:"mapboxgl-ctrl-icon mapboxgl-ctrl-".concat(t),type:"button",title:e,onClick:n},r||a.createElement("span",{className:"mapboxgl-ctrl-icon","aria-hidden":"true"}))}function Dn(t){var e=Re(t),n=e.context,r=e.containerRef,i=t.className,s=t.showCompass,u=t.showZoom,l=t.zoomInLabel,c=t.zoomOutLabel,h=t.compassLabel,f=(0,a.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 a.createElement("div",{style:f,className:i},a.createElement("div",{className:"mapboxgl-ctrl mapboxgl-ctrl-group",ref:r},u&&Zn("zoom-in",l,(function(){Pn(n,t,{zoom:n.viewport.zoom+1})})),u&&Zn("zoom-out",c,(function(){Pn(n,t,{zoom:n.viewport.zoom-1})})),s&&Zn("compass",h,(function(){Pn(n,t,{bearing:0,pitch:0})}),function(t){var e=(0,a.useMemo)((function(){return t.map?In(t.map.version):Mn}),[t.map]),n=t.viewport.bearing,r={transform:"rotate(".concat(-n,"deg)")};return e===Mn?a.createElement("span",{className:"mapboxgl-ctrl-icon","aria-hidden":"true",style:r}):a.createElement("span",{className:"mapboxgl-ctrl-compass-arrow",style:r})}(n))))}Dn.propTypes=En,Dn.defaultProps=Sn;var Ln=a.memo(Dn);function On(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}var Fn=Object.assign({},Fe,{className:s.string,style:s.object,maxWidth:s.number,unit:s.oneOf(["imperial","metric","nautical"])}),Rn=Object.assign({},Oe,{className:"",maxWidth:100,unit:"metric"});function zn(t){var e=Re(t),n=e.context,r=e.containerRef,i=(0,a.useState)(null),s=(0,u.Z)(i,2),l=s[0],c=s[1];(0,a.useEffect)((function(){if(n.map){var t=new(J().ScaleControl);t._map=n.map,t._container=r.current,c(t)}}),[n.map]),l&&(l.options=t,l._onMove&&l._onMove());var h=(0,a.useMemo)((function(){return function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?On(Object(n),!0).forEach((function(e){(0,o.Z)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):On(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({position:"absolute"},t.style)}),[t.style]);return a.createElement("div",{style:h,className:t.className},a.createElement("div",{ref:r,className:"mapboxgl-ctrl mapboxgl-ctrl-scale"}))}zn.propTypes=Fn,zn.defaultProps=Rn;a.memo(zn);var Un="undefined"!==typeof window&&window.devicePixelRatio||1,Nn=Object.assign({},Fe,{redraw:s.func.isRequired});function Gn(t){var e=Re(t),n=e.context,r=e.containerRef,i=(0,a.useState)(null),o=(0,u.Z)(i,2),s=o[0],l=o[1];(0,a.useEffect)((function(){l(r.current.getContext("2d"))}),[]);var c=n.viewport,h=n.isDragging;return s&&(s.save(),s.scale(Un,Un),t.redraw({width:c.width,height:c.height,ctx:s,isDragging:h,project:c.project,unproject:c.unproject}),s.restore()),a.createElement("canvas",{ref:r,width:c.width*Un,height:c.height*Un,style:{width:"".concat(c.width,"px"),height:"".concat(c.height,"px"),position:"absolute",left:0,top:0}})}Gn.propTypes=Nn,Gn.defaultProps={captureScroll:!1,captureDrag:!1,captureClick:!1,captureDoubleClick:!1,capturePointerMove:!1};function jn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}var Vn=Object.assign({},Fe,{redraw:s.func.isRequired,style:s.object});function Hn(t){var e=Re(t),n=e.context,r=e.containerRef,i=n.viewport,s=n.isDragging,u=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:i.width,height:i.height},t.style);return a.createElement("div",{ref:r,style:u},t.redraw({width:i.width,height:i.height,isDragging:s,project:i.project,unproject:i.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 r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}var Wn=Object.assign({},Fe,{redraw:s.func.isRequired,style:s.object});function Qn(t){var e=Re(t),n=e.context,r=e.containerRef,i=n.viewport,s=n.isDragging,u=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 a.createElement("svg",{width:i.width,height:i.height,ref:r,style:u},t.redraw({width:i.width,height:i.height,isDragging:s,project:i.project,unproject:i.unproject}))}Qn.propTypes=Wn,Qn.defaultProps={captureScroll:!1,captureDrag:!1,captureClick:!1,captureDoubleClick:!1,capturePointerMove:!1};J()&&J().setRTLTextPlugin},79259:function(){},17358:function(t){t.exports=function(t){if(Array.isArray(t))return t}
vendor: 5,908 bytes, line 2
2,t.exports.__esModule=!0,t.exports.default=t.exports},10029:function(t){function e(t,e,n,r,i,o,a){try{var s=t[o](a),u=s.value}catch(l){return void n(l)}s.done?e(u):Promise.resolve(u).then(r,i)}t.exports=function(t){return function(){var n=this,r=arguments;return new Promise((function(i,o){var a=t.apply(n,r);function s(t){e(a,i,o,s,u,"next",t)}function u(t){e(a,i,o,s,u,"throw",t)}s(void 0)}))}},t.exports.__esModule=!0,t.exports.default=t.exports},40608:function(t){t.exports=function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,s=[],u=!0,l=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(c){l=!0,i=c}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}},t.exports.__esModule=!0,t.exports.default=t.exports},56894:function(t){t.exports=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.")},t.exports.__esModule=!0,t.exports.default=t.exports},21337:function(t,e,n){var r=n(7501).default;function i(){"use strict";t.exports=i=function(){return e},t.exports.__esModule=!0,t.exports.default=t.exports;var e={},n=Object.prototype,o=n.hasOwnProperty,a=Object.defineProperty||function(t,e,n){t[e]=n.value},s="function"==typeof Symbol?Symbol:{},u=s.iterator||"@@iterator",l=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function h(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(I){h=function(t,e,n){return t[e]=n}}function f(t,e,n,r){var i=e&&e.prototype instanceof A?e:A,o=Object.create(i.prototype),s=new S(r||[]);return a(o,"_invoke",{value:C(t,n,s)}),o}function p(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(I){return{type:"throw",arg:I}}}e.wrap=f;var d={};function A(){}function v(){}function g(){}var m={};h(m,u,(function(){return this}));var y=Object.getPrototypeOf,_=y&&y(y(T([])));_&&_!==n&&o.call(_,u)&&(m=_);var b=g.prototype=A.prototype=Object.create(m);function x(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function n(i,a,s,u){var l=p(t[i],t,a);if("throw"!==l.type){var c=l.arg,h=c.value;return h&&"object"==r(h)&&o.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,s,u)}),(function(t){n("throw",t,s,u)})):e.resolve(h).then((function(t){c.value=t,s(c)}),(function(t){return n("throw",t,s,u)}))}u(l.arg)}var i;a(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,i){n(t,r,e,i)}))}return i=i?i.then(o,o):o()}})}function C(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return M()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=B(a,n);if(s){if(s===d)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=p(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===d)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}function B(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,B(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var i=p(r,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,d;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,d):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,d)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function T(t){if(t){var e=t[u];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,r=function e(){for(;++n<t.length;)if(o.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return r.next=r}}return{next:M}}function M(){return{value:void 0,done:!0}}return v.prototype=g,a(b,"constructor",{value:g,configurable:!0}),a(g,"constructor",{value:v,configurable:!0}),v.displayName=h(g,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,h(t,c,"GeneratorFunction")),t.prototype=Object.create(b),t},e.awrap=function(t){return{__await:t}},x(w.prototype),h(w.prototype,l,(function(){return this})),e.AsyncIterator=w,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new w(f(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(b),h(b,c,"Generator"),h(b,u,(function(){return this})),h(b,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=T,S.prototype={constructor:S,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEac
vendor: 3,125 bytes, line 2
2h(E),!t)for(var e in this)"t"===e.charAt(0)&&o.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),E(n),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;E(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:T(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),d}},e}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports},40131:function(t,e,n){var r=n(17358),i=n(40608),o=n(35068),a=n(56894);t.exports=function(t,e){return r(t)||i(t,e)||o(t,e)||a()},t.exports.__esModule=!0,t.exports.default=t.exports},187:function(t,e,n){"use strict";function r(t){var e,n,r,o=2;for("undefined"!=typeof Symbol&&(n=Symbol.asyncIterator,r=Symbol.iterator);o--;){if(n&&null!=(e=t[n]))return e.call(t);if(r&&null!=(e=t[r]))return new i(e.call(t));n="@@asyncIterator",r="@@iterator"}throw new TypeError("Object is not async iterable")}function i(t){function e(t){if(Object(t)!==t)return Promise.reject(new TypeError(t+" is not an object."));var e=t.done;return Promise.resolve(t.value).then((function(t){return{value:t,done:e}}))}return i=function(t){this.s=t,this.n=t.next},i.prototype={s:null,n:null,next:function(){return e(this.n.apply(this.s,arguments))},return:function(t){var n=this.s.return;return void 0===n?Promise.resolve({value:t,done:!0}):e(n.apply(this.s,arguments))},throw:function(t){var n=this.s.return;return void 0===n?Promise.reject(t):e(n.apply(this.s,arguments))}},new i(t)}n.d(e,{Z:function(){return r}})}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.