Files
2026-03-14 21:48:05 +00:00

26 lines
2.1 MiB
Plaintext
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("@jupyter-widgets/base"));else if("function"==typeof define&&define.amd)define(["@jupyter-widgets/base"],e);else{var n="object"==typeof exports?e(require("@jupyter-widgets/base")):e(t["@jupyter-widgets/base"]);for(var r in n)("object"==typeof exports?exports:t)[r]=n[r]}}(window,(function(t){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=243)}([function(t,e){t.exports=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}},function(t,e,n){"use strict";function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n.d(e,"a",(function(){return r}))},function(t,e){function n(e){return t.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},n(e)}t.exports=n},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e){function n(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}t.exports=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t}},function(t,e,n){var r=n(244);t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&r(t,e)}},function(t,e,n){var r=n(27),i=n(26);t.exports=function(t,e){return!e||"object"!==r(e)&&"function"!=typeof e?i(t):e}},function(t,e,n){var r=n(245);function i(e,n,o){return"undefined"!=typeof Reflect&&Reflect.get?t.exports=i=Reflect.get:t.exports=i=function(t,e,n){var i=r(t,e);if(i){var o=Object.getOwnPropertyDescriptor(i,e);return o.get?o.get.call(n):o.value}},i(e,n,o||e)}t.exports=i},function(t,e,n){"use strict";const r=new(n(273).a)({id:"luma.gl"});function i(t,e){if(!t)throw new Error(e||"luma.gl: assertion failed.")}function o(t){return"undefined"!=typeof WebGLRenderingContext&&t instanceof WebGLRenderingContext||("undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||Boolean(t&&Number.isFinite(t._version)))}function a(t){return"undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||Boolean(t&&2===t._version)}function s(t){return a(t)?t:null}function u(t){return i(o(t),"Invalid WebGLRenderingContext"),t}function c(t){return i(a(t),"Requires WebGL2"),t}const l={};function h(t,e){var n;l[t]=!0,void 0!==e&&(n=e,globalThis.console&&globalThis.console.error&&globalThis.console.error(n))}const f=function t(e){const n=e.gl;this.ext=e,this.isAlive=!0,this.hasBeenBound=!1,this.elementArrayBuffer=null,this.attribs=new Array(e.maxVertexAttribs);for(let e=0;e<this.attribs.length;e++){const r=new t.VertexAttrib(n);this.attribs[e]=r}this.maxAttrib=0};(f.VertexAttrib=function(t){this.enabled=!1,this.buffer=null,this.size=4,this.type=5126,this.normalized=!1,this.stride=16,this.offset=0,this.cached="",this.recache()}).prototype.recache=function(){this.cached=[this.size,this.type,this.normalized,this.stride,this.offset].join(":")};const p=function(t){const e=this;this.gl=t,function(t){const e=t.getError;t.getError=function(){let n;do{n=e.apply(t),0!==n&&(l[n]=!0)}while(0!==n);for(n in l)if(l[n])return delete l[n],parseInt(n,10);return 0}}(t);const n=this.original={getParameter:t.getParameter,enableVertexAttribArray:t.enableVertexAttribArray,disableVertexAttribArray:t.disableVertexAttribArray,bindBuffer:t.bindBuffer,getVertexAttrib:t.getVertexAttrib,vertexAttribPointer:t.vertexAttribPointer};t.getParameter=function(t){return t===e.VERTEX_ARRAY_BINDING_OES?e.currentVertexArrayObject===e.defaultVertexArrayObject?null:e.currentVertexArrayObject:n.getParameter.apply(this,arguments)},t.enableVertexAttribArray=function(t){const r=e.currentVertexArrayObject;r.maxAttrib=Math.max(r.maxAttrib,t);const i=r.attribs[t];return i.enabled=!0,n.enableVertexAttribArray.apply(this,arguments)},t.disableVertexAttribArray=function(t){const r=e.currentVertexArrayObject;r.maxAttrib=Math.max(r.maxAttrib,t);const i=r.attribs[t];return i.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){const i=e.currentVertexArrayObject,o=i.attribs[t];switch(r){case 34975:return o.buffer;case 34338:return o.enabled;case 34339:return o.size;case 34340:return o.stride;case 34341:return o.type;case 34922:return o.normalized;default:return n.getVertexAttrib.apply(this,arguments)}},t.vertexAttribPointer=function(t,r,i,o,a,s){const u=e.currentVertexArrayObject;u.maxAttrib=Math.max(u.maxAttrib,t);const c=u.attribs[t];return c.buffer=e.currentArrayBuffer,c.size=r,c.type=i,c.normalized=o,c.stride=a,c.offset=s,c.recache(),n.vertexAttribPointer.apply(this,arguments)},t.instrumentExtension&&t.instrumentExtension(this,"OES_vertex_array_object"),t.canvas&&t.canvas.addEventListener("webglcontextrestored",()=>{var t;t="OESVertexArrayObject emulation library context restored",globalThis.console&&globalThis.console.log&&globalThis.console.log(t),e.reset_()},!0),this.reset_()};p.prototype.VERTEX_ARRAY_BINDING_OES=34229,p.prototype.reset_=function(){if(void 0!==this.vertexArrayObjects)for(let t=0;t<this.vertexArrayObjects.length;++t)this.vertexArrayObjects.isAlive=!1;const t=this.gl;this.maxVertexAttribs=t.getParameter(34921),this.defaultVertexArrayObject=new f(this),this.currentVertexArrayObject=null,this.currentArrayBuffer=null,this.vertexArrayObjects=[this.defaultVertexArrayObject],this.bindVertexArrayOES(null)},p.prototype.createVertexArrayOES=function(){const t=new f(this);return this.vertexArrayObjects.push(t),t},p.prototype.deleteVertexArrayOES=function(t){t.isAlive=!1,this.vertexArrayObjects.splice(this.vertexArrayObjects.indexOf(t),1),this.currentVertexArrayObject===t&&this.bindVertexArrayOES(null)},p.prototype.isVertexArrayOES=function(t){return!!(t&&t instanceof f&&t.hasBeenBound&&t.ext===this)},p.prototype.bindVertexArrayOES=function(t){const e=this.gl;if(t&&!t.isAlive)return void h(1282,"bindVertexArrayOES: attempt to bind deleted arrayObject");const n=this.original,r=this.currentVertexArrayObject;this.currentVertexArrayObject=t||this.defaultVertexArrayObject,this.currentVertexArrayObject.hasBeenBound=!0;const i=this.currentVertexArrayObject;if(r===i)return;r&&i.elementArrayBuffer===r.elementArrayBuffer||n.bindBuffer.call(e,34963,i.elementArrayBuffer);let o=this.currentArrayBuffer;const a=Math.max(r?r.maxAttrib:0,i.maxAttrib);for(let t=0;t<=a;t++){const a=i.attribs[t],s=r?r.attribs[t]:null;if(r&&a.enabled===s.enabled||(a.enabled?n.enableVertexAttribArray.call(e,t):n.disableVertexAttribArray.call(e,t)),a.enabled){let i=!1;r&&a.buffer===s.buffer||(o!==a.buffer&&(n.bindBuffer.call(e,34962,a.buffer),o=a.buffer),i=!0),(i||a.cached!==s.cached)&&n.vertexAttribPointer.call(e,t,a.size,a.type,a.normalized,a.stride,a.offset)}}this.currentArrayBuffer!==o&&n.bindBuffer.call(e,34962,this.currentArrayBuffer)};const d=t=>a(t)?void 0:0,A={3074:t=>a(t)?void 0:36064,35723:t=>a(t)?void 0:4352,35977:d,32937:d,36795:(t,e)=>{const n=a(t)?t.getExtension("EXT_disjoint_timer_query_webgl2"):t.getExtension("EXT_disjoint_timer_query");return n&&n.GPU_DISJOINT_EXT?e(n.GPU_DISJOINT_EXT):0},37445:(t,e)=>{const n=t.getExtension("WEBGL_debug_renderer_info");return e(n&&n.UNMASKED_VENDOR_WEBGL||7936)},37446:(t,e)=>{const n=t.getExtension("WEBGL_debug_renderer_info");return e(n&&n.UNMASKED_RENDERER_WEBGL||7937)},34047:(t,e)=>{const n=t.luma.extensions.EXT_texture_filter_anisotropic;return n?e(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1},32883:d,35071:d,37447:d,36063:(t,e)=>{if(!a(t)){const n=t.getExtension("WEBGL_draw_buffers");return n?e(n.MAX_COLOR_ATTACHMENTS_WEBGL):0}},35379:d,35374:d,35377:d,34852:t=>{if(!a(t)){const e=t.getExtension("WEBGL_draw_buffers");return e?e.MAX_DRAW_BUFFERS_WEBGL:0}},36203:t=>t.getExtension("OES_element_index")?2147483647:65535,33001:t=>t.getExtension("OES_element_index")?16777216:65535,33e3:t=>16777216,37157:d,35373:d,35657:d,36183:d,37137:d,34045:d,35978:d,35979:d,35968:d,35376:d,35375:d,35659:d,37154:d,35371:d,35658:d,35076:d,35077:d,35380:d};const g={OES_vertex_array_object:{meta:{suffix:"OES"},createVertexArray:()=>{i(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:()=>{},bindVertexArray:()=>{},isVertexArray:()=>!1},ANGLE_instanced_arrays:{meta:{suffix:"ANGLE"},vertexAttribDivisor(t,e){i(0===e,"WebGL instanced rendering not supported")},drawElementsInstanced:()=>{},drawArraysInstanced:()=>{}},WEBGL_draw_buffers:{meta:{suffix:"WEBGL"},drawBuffers:()=>{i(!1)}},EXT_disjoint_timer_query:{meta:{suffix:"EXT"},createQuery:()=>{i(!1)},deleteQuery:()=>{i(!1)},beginQuery:()=>{i(!1)},endQuery:()=>{},getQuery(t,e){return this.getQueryObject(t,e)},getQueryParameter(t,e){return this.getQueryObject(t,e)},getQueryObject:()=>{}}},m={readBuffer:(t,e,n)=>{a(t)&&e(n)},getVertexAttrib:(t,e,n,r)=>{const{webgl2:i,ext:o}=function(t,e){return{webgl2:a(t),ext:t.getExtension(e)}}(t,"ANGLE_instanced_arrays");let s;switch(r){case 35069:s=!!i&&void 0;break;case 35070:s=i||o?void 0:0}return void 0!==s?s:e(n,r)},getProgramParameter:(t,e,n,r)=>{if(!a(t))switch(r){case 35967:return 35981;case 35971:case 35382:return 0}return e(n,r)},getInternalformatParameter:(t,e,n,r,i)=>{if(!a(t))switch(i){case 32937:return new Int32Array([0])}return t.getInternalformatParameter(n,r,i)},getTexParameter(t,e,n,r){switch(r){case 34046:const{extensions:e}=t.luma,n=e.EXT_texture_filter_anisotropic;r=n&&n.TEXTURE_MAX_ANISOTROPY_EXT||34046}return e(n,r)},getParameter:function(t,e,n){const r=A[n],i="function"==typeof r?r(t,e,n):r;return void 0!==i?i:e(n)},hint:(t,e,n,r)=>e(n,r)};function y(t,e){let{extension:n,target:r,target2:o}=e;const a=g[n];i(a);const{meta:s={}}=a,{suffix:u=""}=s,c=t.getExtension(n);for(const e of Object.keys(a)){const n="".concat(e).concat(u);let i=null;"meta"===e||"function"==typeof t[e]||(c&&"function"==typeof c[n]?i=function(){return c[n](...arguments)}:"function"==typeof a[e]&&(i=a[e].bind(r))),i&&(r[e]=i,o[e]=i)}}globalThis.polyfillContext=function(t){t.luma=t.luma||{};const{luma:e}=t;return e.polyfilled||(!function(t){if("function"==typeof t.createVertexArray)return;const e=t.getSupportedExtensions;t.getSupportedExtensions=function(){const t=e.call(this)||[];return t.indexOf("OES_vertex_array_object")<0&&t.push("OES_vertex_array_object"),t};const n=t.getExtension;t.getExtension=function(e){const r=n.call(this,e);return r||("OES_vertex_array_object"!==e?null:(t.__OESVertexArrayObject||(this.__OESVertexArrayObject=new p(this)),this.__OESVertexArrayObject))}}(t),function(t){t.luma.extensions={};const e=t.getSupportedExtensions()||[];for(const n of e)t.luma[n]=t.getExtension(n)}(t),function(t,e){for(const n of Object.getOwnPropertyNames(e))"overrides"!==n&&y(t,{extension:n,target:t.luma,target2:t})}(t,g),function(t,e){let{target:n,target2:r}=e;Object.keys(m).forEach(e=>{if("function"==typeof m[e]){const i=t[e]?t[e].bind(t):()=>{},o=m[e].bind(null,t,i);n[e]=o,r[e]=o}})}(t,{target:e,target2:t}),e.polyfilled=!0),t};const v={3042:!1,32773:new Float32Array([0,0,0,0]),32777:32774,34877:32774,32969:1,32968:0,32971:1,32970:0,3106:new Float32Array([0,0,0,0]),3107:[!0,!0,!0,!0],2884:!1,2885:1029,2929:!1,2931:1,2932:513,2928:new Float32Array([0,1]),2930:!0,3024:!0,36006:null,2886:2305,33170:4352,2849:1,32823:!1,32824:0,10752:0,32938:1,32939:!1,3089:!1,3088:new Int32Array([0,0,1024,1024]),2960:!1,2961:0,2968:4294967295,36005:4294967295,2962:519,2967:0,2963:4294967295,34816:519,36003:0,36004:4294967295,2964:7680,2965:7680,2966:7680,34817:7680,34818:7680,34819:7680,2978:[0,0,1024,1024],3333:4,3317:4,37440:!1,37441:!1,37443:37444,35723:4352,36010:null,35977:!1,3330:0,3332:0,3331:0,3314:0,32878:0,3316:0,3315:0,32877:0},_=(t,e,n)=>e?t.enable(n):t.disable(n),b=(t,e,n)=>t.hint(n,e),x=(t,e,n)=>t.pixelStorei(n,e);function w(t){return Array.isArray(t)||ArrayBuffer.isView(t)}const E={3042:_,32773:(t,e)=>t.blendColor(...e),32777:"blendEquation",34877:"blendEquation",32969:"blendFunc",32968:"blendFunc",32971:"blendFunc",32970:"blendFunc",3106:(t,e)=>t.clearColor(...e),3107:(t,e)=>t.colorMask(...e),2884:_,2885:(t,e)=>t.cullFace(e),2929:_,2931:(t,e)=>t.clearDepth(e),2932:(t,e)=>t.depthFunc(e),2928:(t,e)=>t.depthRange(...e),2930:(t,e)=>t.depthMask(e),3024:_,35723:b,36006:(t,e)=>{const n=a(t)?36009:36160;return t.bindFramebuffer(n,e)},2886:(t,e)=>t.frontFace(e),33170:b,2849:(t,e)=>t.lineWidth(e),32823:_,32824:"polygonOffset",10752:"polygonOffset",35977:_,32938:"sampleCoverage",32939:"sampleCoverage",3089:_,3088:(t,e)=>t.scissor(...e),2960:_,2961:(t,e)=>t.clearStencil(e),2968:(t,e)=>t.stencilMaskSeparate(1028,e),36005:(t,e)=>t.stencilMaskSeparate(1029,e),2962:"stencilFuncFront",2967:"stencilFuncFront",2963:"stencilFuncFront",34816:"stencilFuncBack",36003:"stencilFuncBack",36004:"stencilFuncBack",2964:"stencilOpFront",2965:"stencilOpFront",2966:"stencilOpFront",34817:"stencilOpBack",34818:"stencilOpBack",34819:"stencilOpBack",2978:(t,e)=>t.viewport(...e),3333:x,3317:x,37440:x,37441:x,37443:x,3330:x,3332:x,3331:x,36010:(t,e)=>t.bindFramebuffer(36008,e),3314:x,32878:x,3316:x,3315:x,32877:x,framebuffer:(t,e)=>{const n=e&&"handle"in e?e.handle:e;return t.bindFramebuffer(36160,n)},blend:(t,e)=>e?t.enable(3042):t.disable(3042),blendColor:(t,e)=>t.blendColor(...e),blendEquation:(t,e)=>{e=w(e)?e:[e,e],t.blendEquationSeparate(...e)},blendFunc:(t,e)=>{e=w(e)&&2===e.length?[...e,...e]:e,t.blendFuncSeparate(...e)},clearColor:(t,e)=>t.clearColor(...e),clearDepth:(t,e)=>t.clearDepth(e),clearStencil:(t,e)=>t.clearStencil(e),colorMask:(t,e)=>t.colorMask(...e),cull:(t,e)=>e?t.enable(2884):t.disable(2884),cullFace:(t,e)=>t.cullFace(e),depthTest:(t,e)=>e?t.enable(2929):t.disable(2929),depthFunc:(t,e)=>t.depthFunc(e),depthMask:(t,e)=>t.depthMask(e),depthRange:(t,e)=>t.depthRange(...e),dither:(t,e)=>e?t.enable(3024):t.disable(3024),derivativeHint:(t,e)=>{t.hint(35723,e)},frontFace:(t,e)=>t.frontFace(e),mipmapHint:(t,e)=>t.hint(33170,e),lineWidth:(t,e)=>t.lineWidth(e),polygonOffsetFill:(t,e)=>e?t.enable(32823):t.disable(32823),polygonOffset:(t,e)=>t.polygonOffset(...e),sampleCoverage:(t,e)=>t.sampleCoverage(...e),scissorTest:(t,e)=>e?t.enable(3089):t.disable(3089),scissor:(t,e)=>t.scissor(...e),stencilTest:(t,e)=>e?t.enable(2960):t.disable(2960),stencilMask:(t,e)=>{e=w(e)?e:[e,e];const[n,r]=e;t.stencilMaskSeparate(1028,n),t.stencilMaskSeparate(1029,r)},stencilFunc:(t,e)=>{e=w(e)&&3===e.length?[...e,...e]:e;const[n,r,i,o,a,s]=e;t.stencilFuncSeparate(1028,n,r,i),t.stencilFuncSeparate(1029,o,a,s)},stencilOp:(t,e)=>{e=w(e)&&3===e.length?[...e,...e]:e;const[n,r,i,o,a,s]=e;t.stencilOpSeparate(1028,n,r,i),t.stencilOpSeparate(1029,o,a,s)},viewport:(t,e)=>t.viewport(...e)};function O(t,e,n){return void 0!==e[t]?e[t]:n[t]}const S={blendEquation:(t,e,n)=>t.blendEquationSeparate(O(32777,e,n),O(34877,e,n)),blendFunc:(t,e,n)=>t.blendFuncSeparate(O(32969,e,n),O(32968,e,n),O(32971,e,n),O(32970,e,n)),polygonOffset:(t,e,n)=>t.polygonOffset(O(32824,e,n),O(10752,e,n)),sampleCoverage:(t,e,n)=>t.sampleCoverage(O(32938,e,n),O(32939,e,n)),stencilFuncFront:(t,e,n)=>t.stencilFuncSeparate(1028,O(2962,e,n),O(2967,e,n),O(2963,e,n)),stencilFuncBack:(t,e,n)=>t.stencilFuncSeparate(1029,O(34816,e,n),O(36003,e,n),O(36004,e,n)),stencilOpFront:(t,e,n)=>t.stencilOpSeparate(1028,O(2964,e,n),O(2965,e,n),O(2966,e,n)),stencilOpBack:(t,e,n)=>t.stencilOpSeparate(1029,O(34817,e,n),O(34818,e,n),O(34819,e,n))},T={enable:(t,e)=>t({[e]:!0}),disable:(t,e)=>t({[e]:!1}),pixelStorei:(t,e,n)=>t({[e]:n}),hint:(t,e,n)=>t({[e]:n}),bindFramebuffer:(t,e,n)=>{switch(e){case 36160:return t({36006:n,36010:n});case 36009:return t({36006:n});case 36008:return t({36010:n});default:return null}},blendColor:(t,e,n,r,i)=>t({32773:new Float32Array([e,n,r,i])}),blendEquation:(t,e)=>t({32777:e,34877:e}),blendEquationSeparate:(t,e,n)=>t({32777:e,34877:n}),blendFunc:(t,e,n)=>t({32969:e,32968:n,32971:e,32970:n}),blendFuncSeparate:(t,e,n,r,i)=>t({32969:e,32968:n,32971:r,32970:i}),clearColor:(t,e,n,r,i)=>t({3106:new Float32Array([e,n,r,i])}),clearDepth:(t,e)=>t({2931:e}),clearStencil:(t,e)=>t({2961:e}),colorMask:(t,e,n,r,i)=>t({3107:[e,n,r,i]}),cullFace:(t,e)=>t({2885:e}),depthFunc:(t,e)=>t({2932:e}),depthRange:(t,e,n)=>t({2928:new Float32Array([e,n])}),depthMask:(t,e)=>t({2930:e}),frontFace:(t,e)=>t({2886:e}),lineWidth:(t,e)=>t({2849:e}),polygonOffset:(t,e,n)=>t({32824:e,10752:n}),sampleCoverage:(t,e,n)=>t({32938:e,32939:n}),scissor:(t,e,n,r,i)=>t({3088:new Int32Array([e,n,r,i])}),stencilMask:(t,e)=>t({2968:e,36005:e}),stencilMaskSeparate:(t,e,n)=>t({[1028===e?2968:36005]:n}),stencilFunc:(t,e,n,r)=>t({2962:e,2967:n,2963:r,34816:e,36003:n,36004:r}),stencilFuncSeparate:(t,e,n,r,i)=>t({[1028===e?2962:34816]:n,[1028===e?2967:36003]:r,[1028===e?2963:36004]:i}),stencilOp:(t,e,n,r)=>t({2964:e,2965:n,2966:r,34817:e,34818:n,34819:r}),stencilOpSeparate:(t,e,n,r,i)=>t({[1028===e?2964:34817]:n,[1028===e?2965:34818]:r,[1028===e?2966:34819]:i}),viewport:(t,e,n,r,i)=>t({2978:[e,n,r,i]})},C=(t,e)=>t.isEnabled(e),P={3042:C,2884:C,2929:C,3024:C,32823:C,32926:C,32928:C,3089:C,2960:C,35977:C};function M(t){for(const e in t)return!1;return!0}function I(t,e){if(t===e)return!0;const n=Array.isArray(t)||ArrayBuffer.isView(t),r=Array.isArray(e)||ArrayBuffer.isView(e);if(n&&r&&t.length===e.length){for(let n=0;n<t.length;++n)if(t[n]!==e[n])return!1;return!0}return!1}function B(t,e){const n=t[e].bind(t);t[e]=function(){const e=arguments.length<=0?void 0:arguments[0];return e in t.state.cache&&t.state.enable?t.state.cache[e]:n(...arguments)},Object.defineProperty(t[e],"name",{value:"".concat(e,"-from-cache"),configurable:!1})}function R(t,e,n){const 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];const{valueChanged:a,oldValue:s}=n(t.state._updateCache,...i);return a&&r(...i),s},Object.defineProperty(t[e],"name",{value:"".concat(e,"-to-cache"),configurable:!1})}function k(t){const e=t.useProgram.bind(t);t.useProgram=function(n){t.state.program!==n&&(e(n),t.state.program=n)}}class L{constructor(t){let{copyState:e=!1,log:n=(()=>{})}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.gl=t,this.program=null,this.stateStack=[],this.enable=!0,this.cache=e?z(t):Object.assign({},v),this.log=n,this._updateCache=this._updateCache.bind(this),Object.seal(this)}push(){this.stateStack.push({})}pop(){i(this.stateStack.length>0);const t=this.stateStack[this.stateStack.length-1];F(this.gl,t),this.stateStack.pop()}_updateCache(t){let e,n=!1;const r=this.stateStack.length>0&&this.stateStack[this.stateStack.length-1];for(const o in t){i(void 0!==o);const a=t[o],s=this.cache[o];I(a,s)||(n=!0,e=s,r&&!(o in r)&&(r[o]=s),this.cache[o]=a)}return{valueChanged:n,oldValue:e}}}function D(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{enable:n=!0,copyState:r}=e;if(i(void 0!==r),!t.state){const{polyfillContext:e}=globalThis;e&&e(t),t.state=new L(t,{copyState:r}),k(t);for(const e in T){R(t,e,T[e])}B(t,"getParameter"),B(t,"isEnabled")}return t.state.enable=n,t}function j(t){i(t.state),t.state.pop()}function F(t,e){if(i(o(t),"setParameters requires a WebGL context"),M(e))return;const n={};for(const r in e){const i=Number(r),o=E[r];o&&("string"==typeof o?n[o]=!0:o(t,e[r],i))}const r=t.state&&t.state.cache;if(r)for(const i in n){(0,S[i])(t,e,r)}}function z(t,e){if("number"==typeof(e=e||v)){const n=e,r=P[n];return r?r(t,n):t.getParameter(n)}const n=Array.isArray(e)?e:Object.keys(e),r={};for(const e of n){const n=P[e];r[e]=n?n(t,Number(e)):t.getParameter(Number(e))}return r}function U(t){F(t,v)}function N(t,e,n){if(M(e))return n(t);const{nocatch:r=!0}=e;let i;if(function(t){t.state||D(t,{copyState:!1}),t.state.push()}(t),F(t,e),r)i=n(t),j(t);else try{i=n(t)}finally{j(t)}return i}var G=n(134);function V(t){const{luma:e}=t;if(t.canvas&&e){const{clientWidth:n}=e.canvasSizeInfo;return n?t.drawingBufferWidth/n:1}return 1}function H(t,e){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const r=V(t),i=t.drawingBufferWidth,o=t.drawingBufferHeight;return q(e,r,i,o,n)}function W(t){const e="undefined"==typeof window?1:window.devicePixelRatio||1;return Number.isFinite(t)?t<=0?1:t:t?e:1}function q(t,e,n,r,i){const o=X(t[0],e,n);let a=J(t[1],e,r,i),s=X(t[0]+1,e,n);const u=s===n-1?s:s-1;let c;return s=J(t[1]+1,e,r,i),i?(s=0===s?s:s+1,c=a,a=s):c=s===r-1?s:s-1,{x:o,y:a,width:Math.max(u-o+1,1),height:Math.max(c-a+1,1)}}function X(t,e,n){return Math.min(Math.round(t*e),n-1)}function J(t,e,n,r){return r?Math.max(0,n-1-Math.round(t*e)):Math.min(Math.round(t*e),n-1)}const Z=Object(G.a)(),Q=Z&&"undefined"!=typeof document,K={webgl2:!0,webgl1:!0,throwOnError:!0,manageState:!0,canvas:null,debug:!1,width:800,height:600};function Y(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(Z,"createGLContext only available in the browser.\nCreate your own headless context or use 'createHeadlessContext' from @luma.gl/test-utils"),t=Object.assign({},K,t);const{width:e,height:n}=t;function r(e){if(t.throwOnError)throw new Error(e);return console.error(e),null}let o;t.onError=r;const{canvas:a}=t,s=nt({canvas:a,width:e,height:n,onError:r});return o=et(s,t),o?(o=$(o,t),rt(o),o):null}function $(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t||t._instrumented)return t;t._version=t._version||it(t),t.luma=t.luma||{},t.luma.canvasSizeInfo=t.luma.canvasSizeInfo||{},e=Object.assign({},K,e);const{manageState:n,debug:i}=e;return n&&D(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(1,...e)()}}),Z&&i&&(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 tt(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t.canvas){return void ot(t,W(e.useDevicePixels),e)}const n=t.getExtension("STACKGL_resize_drawingbuffer");n&&"width"in e&&"height"in e&&n.resize(e.width,e.height)}function et(t,e){const{onError:n}=e;let r=null;const i=t=>r=t.statusMessage||r;t.addEventListener("webglcontextcreationerror",i,!1);const{webgl1:o=!0,webgl2:a=!0}=e;let s=null;return a&&(s=s||t.getContext("webgl2",e),s=s||t.getContext("experimental-webgl2",e)),o&&(s=s||t.getContext("webgl",e),s=s||t.getContext("experimental-webgl",e)),t.removeEventListener("webglcontextcreationerror",i,!1),s?(e.onContextLost&&t.addEventListener("webglcontextlost",e.onContextLost,!1),e.onContextRestored&&t.addEventListener("webglcontextrestored",e.onContextRestored,!1),s):n("Failed to create ".concat(a&&!o?"WebGL2":"WebGL"," context: ").concat(r||"Unknown error"))}function nt(t){let e,{canvas:n,width:r=800,height:i=600,onError:o}=t;if("string"==typeof n){Q&&"complete"===document.readyState||o("createGLContext called on canvas '".concat(n,"' before page was loaded")),e=document.getElementById(n)}else n?e=n:(e=document.createElement("canvas"),e.id="lumagl-canvas",e.style.width=Number.isFinite(r)?"".concat(r,"px"):"100%",e.style.height=Number.isFinite(i)?"".concat(i,"px"):"100%",document.body.insertBefore(e,document.body.firstChild));return e}function rt(t){const e=a(t)?"WebGL2":"WebGL1",n=function(t){const e=t.getParameter(7936),n=t.getParameter(7937),r=t.getExtension("WEBGL_debug_renderer_info");return{vendor:r&&t.getParameter(r.UNMASKED_VENDOR_WEBGL||7936)||e,renderer:r&&t.getParameter(r.UNMASKED_RENDERER_WEBGL||7937)||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))()}function it(t){return"undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext?2:1}function ot(t,e,n){let 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||{};const a=t.luma.canvasSizeInfo;if(a.clientWidth!==i||a.clientHeight!==o||a.devicePixelRatio!==e){let n=e;const a=Math.floor(i*n),s=Math.floor(o*n);t.canvas.width=a,t.canvas.height=s,t.drawingBufferWidth===a&&t.drawingBufferHeight===s||(r.warn("Device pixel ratio clamped")(),n=Math.min(t.drawingBufferWidth/i,t.drawingBufferHeight/o),t.canvas.width=Math.floor(i*n),t.canvas.height=Math.floor(o*n)),Object.assign(t.luma.canvasSizeInfo,{clientWidth:i,clientHeight:o,devicePixelRatio:e})}}n.d(e,"k",(function(){return r})),n.d(e,"i",(function(){return o})),n.d(e,"j",(function(){return a})),n.d(e,"g",(function(){return s})),n.d(e,"b",(function(){return u})),n.d(e,"a",(function(){return c})),n.d(e,"f",(function(){return z})),n.d(e,"n",(function(){return F})),n.d(e,"l",(function(){return U})),n.d(e,"o",(function(){return N})),n.d(e,"c",(function(){return Y})),n.d(e,"m",(function(){return tt})),n.d(e,"h",(function(){return $})),n.d(e,"e",(function(){return V})),n.d(e,"d",(function(){return H}))},function(t,e,n){var r=n(252),i=n(253),o=n(254);t.exports=function(t,e){return r(t)||i(t,e)||o()}},function(t,e,n){"use strict";function r(t,e){if(!t)throw new Error(e||"luma.gl: assertion failed.")}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return i})),n.d(e,"c",(function(){return o}));var r=1e-6,i="undefined"!=typeof Float32Array?Float32Array:Array,o=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)})},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"d",(function(){return o})),n.d(e,"e",(function(){return a})),n.d(e,"b",(function(){return s})),n.d(e,"c",(function(){return u}));var r=n(20),i={DEFAULT:-1,LNGLAT:1,METER_OFFSETS:2,LNGLAT_OFFSETS:3,CARTESIAN:0};Object.defineProperty(i,"IDENTITY",{get:function(){return r.a.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"}},function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"e",(function(){return a})),n.d(e,"f",(function(){return s})),n.d(e,"j",(function(){return u})),n.d(e,"i",(function(){return c})),n.d(e,"h",(function(){return l})),n.d(e,"c",(function(){return h})),n.d(e,"a",(function(){return f})),n.d(e,"g",(function(){return p})),n.d(e,"d",(function(){return d}));n(136);const 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,{precision:e=o.precision}={}){return t=function(t){return Math.round(t/o.EPSILON)*o.EPSILON}(t),"".concat(parseFloat(t.toPrecision(e)))}function s(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function u(t){return l(t)}function c(t){return h(t)}function l(t,e){return A(t,t=>t*i,e)}function h(t,e){return A(t,t=>t*r,e)}function f(t,e,n){return A(t,t=>Math.max(e,Math.min(n,t)))}function p(t,e,n){return s(t)?t.map((t,r)=>p(t,e[r],n)):n*e+(1-n)*t}function d(t,e,n){const r=o.EPSILON;n&&(o.EPSILON=n);try{if(t===e)return!0;if(s(t)&&s(e)){if(t.length!==e.length)return!1;for(let n=0;n<t.length;++n)if(!d(t[n],e[n]))return!1;return!0}return t&&t.equals?t.equals(e):e&&e.equals?e.equals(t):"number"==typeof t&&"number"==typeof e&&Math.abs(t-e)<=o.EPSILON*Math.max(1,Math.abs(t),Math.abs(e))}finally{o.EPSILON=r}}function A(t,e,n){if(s(t)){const r=t;n=n||function(t){return t.clone?t.clone():new Array(t.length)}(r);for(let i=0;i<n.length&&i<r.length;++i)n[i]=e(t[i],i,n);return n}return e(t)}},,function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return i})),n.d(e,"c",(function(){return o}));var r=1e-6,i="undefined"!=typeof Float32Array?Float32Array:Array,o=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)})},function(t,e,n){"use strict";n.r(e);var r=n(12),i=n(132),o=n(145),a=n(97),s=n(3),u=n.n(s),c=n(4),l=n.n(c),h=n(0),f=n.n(h),p=n(137);function d(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 A(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?d(Object(n),!0).forEach((function(e){f()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var g=[255,255,255],m=[0,0,1],y=[0,0,1],v=0,_=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};u()(this,t),f()(this,"type","point");var n=e.color,r=void 0===n?g:n,i=e.intensity,o=void 0===i?1:i,a=e.position,s=void 0===a?y:a;this.id=e.id||"point-".concat(v++),this.color=r,this.intensity=o,this.type="point",this.position=s,this.attenuation=b(e),this.projectedLight=A({},this)}return l()(t,[{key:"getProjectedLight",value:function(t){var e=t.layer,n=this.projectedLight,i=e.context.viewport,o=e.props,a=o.coordinateSystem,s=o.coordinateOrigin,u=Object(p.b)(this.position,{viewport:i,coordinateSystem:a,coordinateOrigin:s,fromCoordinateSystem:i.isGeospatial?r.a.LNGLAT:r.a.CARTESIAN,fromCoordinateOrigin:[0,0,0]});return n.color=this.color,n.intensity=this.intensity,n.position=u,n}}]),t}();function b(t){return t.attenuation?t.attenuation:"intensity"in t?[0,0,t.intensity||0]:m}var x=n(5),w=n.n(x),E=n(6),O=n.n(E),S=n(2),T=n.n(S),C=n(117);function P(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=T()(t);if(e){var i=T()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return O()(this,n)}}var M=function(t){w()(n,t);var e=P(n);function n(){return u()(this,n),e.apply(this,arguments)}return l()(n,[{key:"getProjectedLight",value:function(t){var e=t.layer,n=this.projectedLight,r=e.context.viewport,i=e.props,o=i.coordinateSystem,a=i.coordinateOrigin,s=i.modelMatrix,u=Object(C.b)({viewport:r,modelMatrix:s,coordinateSystem:o,coordinateOrigin:a}).project_uCameraPosition;return n.color=this.color,n.intensity=this.intensity,n.position=u,n}}]),n}(_),I=n(9),B=n.n(I);const R=Math.PI/180,k=23.4397*R;function L(t,e,n){const r=R*-n,i=R*e,o=function(t){return function(t){return("number"==typeof t?t:t.getTime())/864e5-.5+2440588}(t)-2451545}(t),a=function(t){const e=function(t){const e=t,n=R*(1.9148*Math.sin(e)+.02*Math.sin(2*e)+3e-4*Math.sin(3*e));return e+n+102.9372*R+Math.PI}((n=t,R*(357.5291+.98560028*n)));var n;return{declination:F(e,0),rightAscension:j(e,0)}}(o),s=function(t,e){return R*(280.147+360.9856235*t)-e}(o,r)-a.rightAscension;return{azimuth:z(s,i,a.declination),altitude:U(s,i,a.declination)}}function D(t,e,n){const{azimuth:r,altitude:i}=L(t,e,n);return[Math.sin(r)*Math.cos(i),Math.cos(r)*Math.cos(i),-Math.sin(i)]}function j(t,e){const n=t;return Math.atan2(Math.sin(n)*Math.cos(k)-Math.tan(e)*Math.sin(k),Math.cos(n))}function F(t,e){const n=t;return Math.asin(Math.sin(e)*Math.cos(k)+Math.cos(e)*Math.sin(k)*Math.sin(n))}function z(t,e,n){const r=t,i=e,o=n;return Math.atan2(Math.sin(r),Math.cos(r)*Math.sin(i)-Math.tan(o)*Math.cos(i))}function U(t,e,n){const r=t,i=e,o=n;return Math.asin(Math.sin(i)*Math.sin(o)+Math.cos(i)*Math.cos(o)*Math.cos(r))}function N(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=T()(t);if(e){var i=T()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return O()(this,n)}}var G=function(t){w()(n,t);var e=N(n);function n(t){var r;return u()(this,n),(r=e.call(this,t)).timestamp=t.timestamp,r}return l()(n,[{key:"getProjectedLight",value:function(t){var e=t.layer.context.viewport;if(e.resolution&&e.resolution>0){var n=D(this.timestamp,0,0),r=B()(n,3),i=r[0],o=r[1],a=r[2];this.direction=[i,-a,o]}else{var s=e.latitude,u=e.longitude;this.direction=D(this.timestamp,s,u)}return this}}]),n}(a.a),V=n(178),H=n(58);const W=[-1,-1,1,-1,-1,1,1,1];class q extends V.a{constructor(t,e){const n=W.map(t=>-1===t?0:t);super(t,Object.assign({},e,{vs:"attribute vec2 aClipSpacePosition;\nattribute vec2 aTexCoord;\nattribute vec2 aCoordinate;\n\nvarying vec2 position;\nvarying vec2 coordinate;\nvarying vec2 uv;\n\nvoid main(void) {\n gl_Position = vec4(aClipSpacePosition, 0., 1.);\n position = aClipSpacePosition;\n coordinate = aCoordinate;\n uv = aTexCoord;\n}\n",geometry:new H.a({drawMode:5,vertexCount:4,attributes:{aClipSpacePosition:{size:2,value:new Float32Array(W)},aTexCoord:{size:2,value:new Float32Array(n)},aCoordinate:{size:2,value:new Float32Array(n)}}})})),this.setVertexCount(4)}}var X=n(8),J=n(180);function Z(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=T()(t);if(e){var i=T()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return O()(this,n)}}var Q=function(t){w()(n,t);var e=Z(n);function n(t,r){var i;u()(this,n),i=e.call(this,t,r);var o=r.module,a=r.fs,s=r.id;return i.model=new q(t,{id:s,fs:a,modules:[o]}),i}return l()(n,[{key:"render",value:function(t){var e=this,n=this.gl;Object(X.n)(n,{viewport:[0,0,n.drawingBufferWidth,n.drawingBufferHeight]}),Object(X.o)(n,{framebuffer:t.outputBuffer,clearColor:[0,0,0,0]},(function(){return e._renderPass(n,t)}))}},{key:"delete",value:function(){this.model.delete(),this.model=null}},{key:"_renderPass",value:function(t,e){var n=e.inputBuffer;Object(J.a)(t,{color:!0}),this.model.draw({moduleSettings:this.props.moduleSettings,uniforms:{texture:n,texSize:[n.width,n.height]},parameters:{depthWrite:!1,depthTest:!1}})}}]),n}(n(170).a),K=n(196);function Y(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return $(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 $(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=n.call(t)},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 $(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 tt=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};u()(this,t),this.id="".concat(e.name,"-pass"),this.props=n,Object(K.b)(e),this.module=e}return l()(t,[{key:"preRender",value:function(){}},{key:"postRender",value:function(t,e){var n=this.passes||function(t,e,n,r){if(!e.passes){var i=rt(e);return[new Q(t,{id:n,module:e,fs:i,moduleSettings:r})]}return e.passes.map((function(i,o){var a=rt(e,i),s="".concat(n,"-").concat(o);return new Q(t,{id:s,module:e,fs:a,moduleSettings:r})}))}(t,this.module,this.id,this.props);this.passes=n;for(var r=e.target,i=e.inputBuffer,o=e.swapBuffer,a=0;a<this.passes.length;a++){r&&a===this.passes.length-1&&(o=r),this.passes[a].render({inputBuffer:i,outputBuffer:o});var s=o;o=i,i=s}return i}},{key:"cleanup",value:function(){if(this.passes){var t,e=Y(this.passes);try{for(e.s();!(t=e.n()).done;){t.value.delete()}}catch(t){e.e(t)}finally{e.f()}this.passes=void 0}}}]),t}();var et=function(t){return"uniform sampler2D texture;\nuniform vec2 texSize;\n\nvarying vec2 position;\nvarying vec2 coordinate;\nvarying vec2 uv;\n\nvoid main() {\n vec2 texCoord = coordinate;\n\n gl_FragColor = texture2D(texture, texCoord);\n gl_FragColor = ".concat(t,"(gl_FragColor, texSize, texCoord);\n}\n")},nt=function(t){return"uniform sampler2D texture;\nuniform vec2 texSize;\n\nvarying vec2 position;\nvarying vec2 coordinate;\nvarying vec2 uv;\n\nvoid main() {\n vec2 texCoord = coordinate;\n\n gl_FragColor = ".concat(t,"(texture, texSize, texCoord);\n}\n")};function rt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;if(e.filter){var n="string"==typeof e.filter?e.filter:"".concat(t.name,"_filterColor");return et(n)}if(e.sampler){var r="string"==typeof e.sampler?e.sampler:"".concat(t.name,"_sampleColor");return nt(r)}return null}var it=n(70),ot=n(190),at=n(163),st=n(158),ut=n(157),ct=n(189),lt=n(165),ht=n(41),ft=n(84),pt=n(156),dt=n(75),At=n(18);function gt(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 mt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?gt(Object(n),!0).forEach((function(e){f()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):gt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function yt(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=T()(t);if(e){var i=T()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return O()(this,n)}}var vt=Math.PI/180;function _t(t){var e=t.height,n=t.focalDistance,r=t.orbitAxis,i=t.rotationX,o=t.rotationOrbit,a=t.zoom,s="Z"===r?[0,0,1]:[0,1,0],u="Z"===r?[0,-n,0]:[0,0,n],c=(new dt.a).lookAt({eye:u,up:s});c.rotateX(i*vt),"Z"===r?c.rotateZ(o*vt):c.rotateY(o*vt);var l=Math.pow(2,a)/e;return c.scale(l),c}var bt=function(t){w()(n,t);var e=yt(n);function n(t){var r;u()(this,n);var i=t.height,o=t.projectionMatrix,a=t.fovy,s=void 0===a?50:a,c=t.orbitAxis,l=void 0===c?"Z":c,h=t.target,f=void 0===h?[0,0,0]:h,p=t.rotationX,d=void 0===p?0:p,A=t.rotationOrbit,g=void 0===A?0:A,m=t.zoom,y=void 0===m?0:m,v=o?o[5]/2:Object(At.e)(s);return(r=e.call(this,mt(mt({},t),{},{longitude:void 0,viewMatrix:_t({height:i||1,focalDistance:v,orbitAxis:l,rotationX:d,rotationOrbit:g,zoom:y}),fovy:s,focalDistance:v,position:f,zoom:y}))).projectedCenter=r.project(r.center),r}return l()(n,[{key:"unproject",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.topLeft,r=void 0===n||n,i=B()(t,3),o=i[0],a=i[1],s=i[2],u=void 0===s?this.projectedCenter[2]:s,c=r?a:this.height-a,l=Object(At.n)([o,c,u],this.pixelUnprojectionMatrix),h=B()(l,3),f=h[0],p=h[1],d=h[2];return[f,p,d]}},{key:"panByPosition",value:function(t,e){var n=this.project(t),r=[this.width/2+n[0]-e[0],this.height/2+n[1]-e[1],this.projectedCenter[2]];return{target:this.unproject(r)}}}]),n}(ht.a),xt=n(152);function wt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Et=n(81),Ot=n(13),St=n(24);class Tt{constructor({phi:t=0,theta:e=0,radius:n=1,bearing:r,pitch:i,altitude:o,radiusScale:a=6371e3}={}){wt(this,"phi",void 0),wt(this,"theta",void 0),wt(this,"radius",void 0),wt(this,"radiusScale",void 0),this.phi=t,this.theta=e,this.radius=n||o||1,this.radiusScale=a||1,void 0!==r&&(this.bearing=r),void 0!==i&&(this.pitch=i),this.check()}toString(){return this.formatString(Ot.b)}formatString({printTypes:t=!1}){const e=Ot.e;return"".concat(t?"Spherical":"","[rho:").concat(e(this.radius),",theta:").concat(e(this.theta),",phi:").concat(e(this.phi),"]")}equals(t){return Object(Ot.d)(this.radius,t.radius)&&Object(Ot.d)(this.theta,t.theta)&&Object(Ot.d)(this.phi,t.phi)}exactEquals(t){return this.radius===t.radius&&this.theta===t.theta&&this.phi===t.phi}get bearing(){return 180-Object(Ot.c)(this.phi)}set bearing(t){this.phi=Math.PI-Object(Ot.h)(t)}get pitch(){return Object(Ot.c)(this.theta)}set pitch(t){this.theta=Object(Ot.h)(t)}get longitude(){return Object(Ot.c)(this.phi)}get latitude(){return Object(Ot.c)(this.theta)}get lng(){return Object(Ot.c)(this.phi)}get lat(){return Object(Ot.c)(this.theta)}get z(){return(this.radius-1)*this.radiusScale}set(t,e,n){return this.radius=t,this.phi=e,this.theta=n,this.check()}clone(){return(new Tt).copy(this)}copy(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this.check()}fromLngLatZ([t,e,n]){return this.radius=1+n/this.radiusScale,this.phi=Object(Ot.h)(e),this.theta=Object(Ot.h)(t),this.check()}fromVector3(t){return this.radius=St.h(t),this.radius>0&&(this.theta=Math.atan2(t[0],t[1]),this.phi=Math.acos(Object(Ot.a)(t[2]/this.radius,-1,1))),this.check()}toVector3(){return new Et.a(0,0,this.radius).rotateX({radians:this.theta}).rotateZ({radians:this.phi})}makeSafe(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this}check(){if(!(Number.isFinite(this.phi)&&Number.isFinite(this.theta)&&this.radius>0))throw new Error("SphericalCoordinates: some fields set to invalid numbers");return this}}function Ct(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 Pt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ct(Object(n),!0).forEach((function(e){f()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ct(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Mt(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=T()(t);if(e){var i=T()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return O()(this,n)}}var It=function(t){w()(n,t);var e=Mt(n);function n(t){var r;u()(this,n);var i=t.longitude,o=t.latitude,a=t.modelMatrix,s=t.bearing,c=void 0===s?0:s,l=t.pitch,h=void 0===l?0:l,f=t.up,p=void 0===f?[0,0,1]:f,d=new Tt({bearing:c,pitch:-90===h?1e-4:90+h}).toVector3().normalize(),A=a?new dt.a(a).transformAsVector(d):d,g=Number.isFinite(o)?Object(At.i)({latitude:o}):0,m=Math.pow(2,g),y=(new dt.a).lookAt({eye:[0,0,0],center:A,up:p}).scale(m);return(r=e.call(this,Pt(Pt({},t),{},{zoom:g,viewMatrix:y}))).latitude=o,r.longitude=i,r}return n}(ht.a),Bt=n(220),Rt=n(99),kt=n(204),Lt=n(221),Dt=n(116),jt=n(57),Ft=n(146),zt=n(26),Ut=n.n(zt),Nt=n(56),Gt=n(118),Vt=n(34),Ht=n(48);function Wt(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 qt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Wt(Object(n),!0).forEach((function(e){f()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Wt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Xt(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=T()(t);if(e){var i=T()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return O()(this,n)}}var Jt=function(t){w()(n,t);var e=Xt(n);function n(t){u()(this,n);var r=t.width,i=t.height,o=t.position,a=void 0===o?[0,0,0]:o,s=t.bearing,c=void 0===s?0:s,l=t.pitch,h=void 0===l?0:l,f=t.longitude,p=void 0===f?null:f,d=t.latitude,A=void 0===d?null:d,g=t.maxPitch,m=void 0===g?90:g,y=t.minPitch,v=void 0===y?-90:y,_=t.startRotatePos,b=t.startBearing,x=t.startPitch,w=t.startZoomPosition;return e.call(this,{width:r,height:i,position:a,bearing:c,pitch:h,longitude:p,latitude:A,maxPitch:m,minPitch:v},{startRotatePos:_,startBearing:b,startPitch:x,startZoomPosition:w})}return l()(n,[{key:"panStart",value:function(){return this}},{key:"pan",value:function(){return this}},{key:"panEnd",value:function(){return this}},{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,c=s.startBearing,l=s.startPitch,h=this.getViewportProps(),f=h.width,p=h.height;if(!u||void 0===c||void 0===l)return this;n?e={bearing:c-180*((n[0]-u[0])/f),pitch:l-90*((n[1]-u[1])/p)}:e={bearing:c-i,pitch:l-a};return this._getUpdatedState(e)}},{key:"rotateEnd",value:function(){return this._getUpdatedState({startRotatePos:null,startBearing:null,startPitch:null})}},{key:"zoomStart",value:function(){return this._getUpdatedState({startZoomPosition:this.getViewportProps().position})}},{key:"zoom",value:function(t){var e=t.scale,n=this.getState().startZoomPosition;n||(n=this.getViewportProps().position);var r=this.getDirection();return this._move(r,20*Math.log2(e),n)}},{key:"zoomEnd",value:function(){return this._getUpdatedState({startZoomPosition:null})}},{key:"moveLeft",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20,e=this.getDirection(!0);return this._move(e.rotateZ({radians:Math.PI/2}),t)}},{key:"moveRight",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20,e=this.getDirection(!0);return this._move(e.rotateZ({radians:-Math.PI/2}),t)}},{key:"moveUp",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20,e=this.getDirection(!0);return this._move(e,t)}},{key:"moveDown",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20,e=this.getDirection(!0);return this._move(e.negate(),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;return 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:"zoomIn",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2;return this.zoom({scale:t})}},{key:"zoomOut",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2;return this.zoom({scale:1/t})}},{key:"shortestPathFrom",value:function(t){var e=t.getViewportProps(),n=qt({},this.getViewportProps()),r=n.bearing,i=n.longitude;return Math.abs(r-e.bearing)>180&&(n.bearing=r<0?r+360:r-360),null!==i&&null!==e.longitude&&Math.abs(i-e.longitude)>180&&(n.longitude=i<0?i+360:i-360),n}},{key:"_move",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.getViewportProps().position,r=t.scale(e);return this._getUpdatedState({position:new Et.a(n).add(r)})}},{key:"getDirection",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=new Tt({bearing:this.getViewportProps().bearing,pitch:t?90:90+this.getViewportProps().pitch}),n=e.toVector3().normalize();return n}},{key:"_getUpdatedState",value:function(t){return new n(qt(qt(qt({},this.getViewportProps()),this.getState()),t))}},{key:"applyConstraints",value:function(t){var e=t.pitch,n=t.maxPitch,r=t.minPitch,i=t.longitude,o=t.bearing;return t.pitch=Object(Ot.a)(e,r,n),null!==i&&(i<-180||i>180)&&(t.longitude=Object(Vt.e)(i+180,360)-180),(o<-180||o>180)&&(t.bearing=Object(Vt.e)(o+180,360)-180),t}}]),n}(Gt.a),Zt=function(t){w()(n,t);var e=Xt(n);function n(){var t;u()(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)),f()(Ut()(t),"ControllerState",Jt),f()(Ut()(t),"transition",{transitionDuration:300,transitionInterpolator:new Ht.a(["position","pitch","bearing"])}),t}return n}(Nt.a);function Qt(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=T()(t);if(e){var i=T()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return O()(this,n)}}var Kt=function(t){w()(n,t);var e=Qt(n);function n(){return u()(this,n),e.apply(this,arguments)}return l()(n,[{key:"ViewportType",get:function(){return It}},{key:"ControllerType",get:function(){return Zt}}]),n}(jt.a);f()(Kt,"displayName","FirstPersonView");var Yt=n(110);function $t(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=T()(t);if(e){var i=T()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return O()(this,n)}}var te=function(t){w()(n,t);var e=$t(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return u()(this,n),(t=e.call(this,r)).props.orbitAxis=r.orbitAxis||"Z",t}return l()(n,[{key:"ViewportType",get:function(){return bt}},{key:"ControllerType",get:function(){return Yt.b}}]),n}(jt.a);f()(te,"displayName","OrbitView");var ee=n(151),ne=n(7),re=n.n(ne),ie=n(108);function oe(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=T()(t);if(e){var i=T()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return O()(this,n)}}var ae=function(t){w()(n,t);var e=oe(n);function n(){return u()(this,n),e.apply(this,arguments)}return l()(n,[{key:"applyConstraints",value:function(t){var e=t.maxZoom,n=t.minZoom,r=t.zoom;t.zoom=Object(Ot.a)(r,n,e);var i=t.longitude,o=t.latitude;return(i<-180||i>180)&&(t.longitude=Object(Vt.e)(i+180,360)-180),t.latitude=Object(Ot.a)(o,-89,89),t}}]),n}(ie.a),se=function(t){w()(n,t);var e=oe(n);function n(){var t;u()(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)),f()(Ut()(t),"ControllerState",ae),f()(Ut()(t),"transition",{transitionDuration:300,transitionInterpolator:new Ht.a(["longitude","latitude","zoom"])}),f()(Ut()(t),"dragMode","pan"),t}return l()(n,[{key:"setProps",value:function(t){re()(T()(n.prototype),"setProps",this).call(this,t),this.dragRotate=!1,this.touchRotate=!1}}]),n}(Nt.a);function ue(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=T()(t);if(e){var i=T()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return O()(this,n)}}var ce=function(t){w()(n,t);var e=ue(n);function n(){return u()(this,n),e.apply(this,arguments)}return l()(n,[{key:"ViewportType",get:function(){return pt.a}},{key:"ControllerType",get:function(){return se}}]),n}(jt.a);f()(ce,"displayName","GlobeView");var le=n(153),he=n(205),fe=n(147),pe=n(109);function de(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Ae(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 Ae(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=n.call(t)},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 Ae(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 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 me(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){f()(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}function ye(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=T()(t);if(e){var i=T()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return O()(this,n)}}var ve=["bearing","pitch"],_e={speed:1.2,curve:1.414},be=function(t){w()(n,t);var e=ye(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return u()(this,n),(t=e.call(this,{compare:["longitude","latitude","zoom","bearing","pitch"],extract:["width","height","longitude","latitude","zoom","bearing","pitch"],required:["width","height","latitude","longitude","zoom"]})).opts=me(me({},_e),r),t}return l()(n,[{key:"interpolateProps",value:function(t,e,n){var r,i=Object(At.d)(t,e,n,this.opts),o=de(ve);try{for(o.s();!(r=o.n()).done;){var a=r.value;i[a]=Object(Ot.g)(t[a]||0,e[a]||0,n)}}catch(t){o.e(t)}finally{o.f()}return i}},{key:"getDuration",value:function(t,e){var n=e.transitionDuration;return"auto"===n&&(n=Object(At.h)(t,e,this.opts)),n}}]),n}(pe.a),xe=n(20),we=n(28),Ee=n(50),Oe=n(206),Se=n(65),Te=n(154),Ce=n(77),Pe=n(155),Me=n(131);n.d(e,"COORDINATE_SYSTEM",(function(){return r.a})),n.d(e,"OPERATION",(function(){return r.c})),n.d(e,"UNIT",(function(){return r.e})),n.d(e,"LightingEffect",(function(){return i.a})),n.d(e,"AmbientLight",(function(){return o.a})),n.d(e,"DirectionalLight",(function(){return a.a})),n.d(e,"PointLight",(function(){return _})),n.d(e,"_CameraLight",(function(){return M})),n.d(e,"_SunLight",(function(){return G})),n.d(e,"PostProcessEffect",(function(){return tt})),n.d(e,"_LayersPass",(function(){return it.a})),n.d(e,"Deck",(function(){return ot.a})),n.d(e,"LayerManager",(function(){return at.a})),n.d(e,"AttributeManager",(function(){return st.a})),n.d(e,"Layer",(function(){return ut.a})),n.d(e,"CompositeLayer",(function(){return ct.a})),n.d(e,"DeckRenderer",(function(){return lt.a})),n.d(e,"Viewport",(function(){return ht.a})),n.d(e,"WebMercatorViewport",(function(){return ft.a})),n.d(e,"_GlobeViewport",(function(){return pt.a})),n.d(e,"OrbitViewport",(function(){return bt})),n.d(e,"OrthographicViewport",(function(){return xt.a})),n.d(e,"FirstPersonViewport",(function(){return It})),n.d(e,"picking",(function(){return Bt.a})),n.d(e,"project",(function(){return Rt.a})),n.d(e,"project32",(function(){return kt.a})),n.d(e,"gouraudLighting",(function(){return Lt.a})),n.d(e,"phongLighting",(function(){return Lt.b})),n.d(e,"shadow",(function(){return Dt.a})),n.d(e,"View",(function(){return jt.a})),n.d(e,"MapView",(function(){return Ft.a})),n.d(e,"FirstPersonView",(function(){return Kt})),n.d(e,"OrbitView",(function(){return te})),n.d(e,"OrthographicView",(function(){return ee.a})),n.d(e,"_GlobeView",(function(){return ce})),n.d(e,"Controller",(function(){return Nt.a})),n.d(e,"MapController",(function(){return ie.b})),n.d(e,"_GlobeController",(function(){return se})),n.d(e,"FirstPersonController",(function(){return Zt})),n.d(e,"OrbitController",(function(){return Yt.b})),n.d(e,"OrthographicController",(function(){return le.a})),n.d(e,"LayerExtension",(function(){return he.a})),n.d(e,"TRANSITION_EVENTS",(function(){return fe.a})),n.d(e,"TransitionInterpolator",(function(){return pe.a})),n.d(e,"LinearInterpolator",(function(){return Ht.a})),n.d(e,"FlyToInterpolator",(function(){return be})),n.d(e,"log",(function(){return xe.a})),n.d(e,"assert",(function(){return we.a})),n.d(e,"createIterable",(function(){return Ee.a})),n.d(e,"fp64LowPart",(function(){return Vt.b})),n.d(e,"Tesselator",(function(){return Oe.a})),n.d(e,"_fillArray",(function(){return Se.a})),n.d(e,"_flatten",(function(){return Se.b})),n.d(e,"_count",(function(){return Te.a})),n.d(e,"_memoize",(function(){return Ce.a})),n.d(e,"_mergeShaders",(function(){return Pe.a})),n.d(e,"_compareProps",(function(){return Me.a}))},,function(t,e,n){"use strict";var r=n(35);function i(t,e){const n=Object(r.n)([],e,t);return Object(r.k)(n,n,1/n[3]),n}function o(t,e){const n=t%e;return n<0?e+n:n}function a(t,e,n){return t<e?e:t>n?n:t}const s=Math.log2||function(t){return Math.log(t)*Math.LOG2E};var u=n(25),c=n(33),l=n(24);function h(t,e){if(!t)throw new Error(e||"@math.gl/web-mercator: assertion failed.")}const f=Math.PI,p=f/4,d=f/180,A=180/f,g=1.5;function m(t){return Math.pow(2,t)}function y(t){return s(t)}function v(t){const[e,n]=t;h(Number.isFinite(e)),h(Number.isFinite(n)&&n>=-90&&n<=90,"invalid latitude");const r=n*d;return[512*(e*d+f)/(2*f),512*(f+Math.log(Math.tan(p+.5*r)))/(2*f)]}function _(t){const[e,n]=t,r=e/512*(2*f)-f,i=2*(Math.atan(Math.exp(n/512*(2*f)-f))-p);return[r*A,i*A]}function b(t){const{latitude:e}=t;h(Number.isFinite(e));return y(4003e4*Math.cos(e*d))-9}function x(t){return 512/4003e4/Math.cos(t*d)}function w(t){const{latitude:e,longitude:n,highPrecision:r=!1}=t;h(Number.isFinite(e)&&Number.isFinite(n));const i=Math.cos(e*d),o=512/360/i,a=512/4003e4/i,s={unitsPerMeter:[a,a,a],metersPerUnit:[1/a,1/a,1/a],unitsPerDegree:[512/360,o,a],degreesPerUnit:[.703125,1/o,1/a]};if(r){const t=d*Math.tan(e*d)/i,n=512/360*t/2,r=512/4003e4*t,u=r/o*a;s.unitsPerDegree2=[0,n,r],s.unitsPerMeter2=[u,0,u]}return s}function E(t,e){const[n,r,i]=t,[o,a,s]=e,{unitsPerMeter:u,unitsPerMeter2:c}=w({longitude:n,latitude:r,highPrecision:!0}),l=v(t);l[0]+=o*(u[0]+c[0]*a),l[1]+=a*(u[1]+c[1]*a);const h=_(l),f=(i||0)+(s||0);return Number.isFinite(i)||Number.isFinite(s)?[h[0],h[1],f]:h}function O(t){const{height:e,pitch:n,bearing:r,altitude:i,scale:o,center:a}=t,s=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];u.p(s,s,[0,0,-i]),u.l(s,s,-n*d),u.n(s,s,r*d);const c=o/e;return u.o(s,s,[c,c,c]),a&&u.p(s,s,l.j([],a)),s}function S(t){const{width:e,height:n,altitude:r,pitch:i=0,offset:o,center:s,scale:u,nearZMultiplier:c=1,farZMultiplier:l=1}=t;let{fovy:h=T(g)}=t;void 0!==r&&(h=T(r));const f=h*d,p=i*d,A=C(h);let m=A;s&&(m+=s[2]*u/Math.cos(p)/n);const y=f*(.5+(o?o[1]:0)/n),v=Math.sin(y)*m/Math.sin(a(Math.PI/2-p-y,.01,Math.PI-.01)),_=Math.sin(p)*v+m,b=10*m;return{fov:f,aspect:e/n,focalDistance:A,near:c,far:Math.min(_*l,b)}}function T(t){return 2*Math.atan(.5/t)*A}function C(t){return.5/Math.tan(.5*t*d)}function P(t,e){const[n,r,o=0]=t;return h(Number.isFinite(n)&&Number.isFinite(r)&&Number.isFinite(o)),i(e,[n,r,o,1])}function M(t,e,n=0){const[r,o,a]=t;if(h(Number.isFinite(r)&&Number.isFinite(o),"invalid pixel coordinate"),Number.isFinite(a)){return i(e,[r,o,a,1])}const s=i(e,[r,o,0,1]),u=i(e,[r,o,1,1]),l=s[2],f=u[2],p=l===f?0:((n||0)-l)/(f-l);return c.c([],s,u,p)}function I(t){const{width:e,height:n,bounds:r,minExtent:i=0,maxZoom:o=24,offset:u=[0,0]}=t,[[c,l],[f,p]]=r,d=function(t=0){if("number"==typeof t)return{top:t,bottom:t,left:t,right:t};return h(Number.isFinite(t.top)&&Number.isFinite(t.bottom)&&Number.isFinite(t.left)&&Number.isFinite(t.right)),t}(t.padding),A=v([c,a(p,-85.051129,85.051129)]),g=v([f,a(l,-85.051129,85.051129)]),m=[Math.max(Math.abs(g[0]-A[0]),i),Math.max(Math.abs(g[1]-A[1]),i)],y=[e-d.left-d.right-2*Math.abs(u[0]),n-d.top-d.bottom-2*Math.abs(u[1])];h(y[0]>0&&y[1]>0);const b=y[0]/m[0],x=y[1]/m[1],w=(d.right-d.left)/2/b,E=(d.bottom-d.top)/2/x,O=_([(g[0]+A[0])/2+w,(g[1]+A[1])/2+E]),S=Math.min(o,s(Math.abs(Math.min(b,x))));return h(Number.isFinite(S)),{longitude:O[0],latitude:O[1],zoom:S}}const B=Math.PI/180;function R(t,e=0){const{width:n,height:r,unproject:i}=t,o={targetZ:e},a=i([0,r],o),s=i([n,r],o);let u,c;return(t.fovy?.5*t.fovy*B:Math.atan(.5/t.altitude))>(90-t.pitch)*B-.01?(u=k(t,0,e),c=k(t,n,e)):(u=i([0,0],o),c=i([n,0],o)),[a,s,c,u]}function k(t,e,n){const{pixelUnprojectionMatrix:r}=t,o=i(r,[e,0,1,1]),a=i(r,[e,t.height,1,1]),s=(n*t.distanceScales.unitsPerMeter[2]-o[2])/(a[2]-o[2]),u=_(c.c([],o,a,s));return u.push(n),u}function L(t){const{width:e,height:n,pitch:r=0}=t;let{longitude:i,latitude:a,zoom:u,bearing:c=0}=t;(i<-180||i>180)&&(i=o(i+180,360)-180),(c<-180||c>180)&&(c=o(c+180,360)-180);const l=s(n/512);if(u<=l)u=l,a=0;else{const t=n/2/Math.pow(2,u),e=_([0,t])[1];if(a<e)a=e;else{const e=_([0,512-t])[1];a>e&&(a=e)}}return{width:e,height:n,longitude:i,latitude:a,zoom:u,pitch:r,bearing:c}}const D=["longitude","latitude","zoom"],j={curve:1.414,speed:1.2};function F(t,e,n,r){const{startZoom:i,startCenterXY:o,uDelta:a,w0:s,u1:u,S:l,rho:h,rho2:f,r0:p}=U(t,e,r);if(u<.01){const r={};for(const i of D){const o=t[i],a=e[i];r[i]=(d=n)*a+(1-d)*o}return r}var d;const A=n*l,g=Math.cosh(p)/Math.cosh(p+h*A),m=s*((Math.cosh(p)*Math.tanh(p+h*A)-Math.sinh(p))/f)/u,v=i+y(1/g),b=c.e([],a,m);c.a(b,b,o);const x=_(b);return{longitude:x[0],latitude:x[1],zoom:v}}function z(t,e,n){const r={...j,...n},{screenSpeed:i,speed:o,maxDuration:a}=r,{S:s,rho:u}=U(t,e,r),c=1e3*s;let l;return l=Number.isFinite(i)?c/(i/u):c/o,Number.isFinite(a)&&l>a?0:l}function U(t,e,n){const r=(n=Object.assign({},j,n)).curve,i=t.zoom,o=[t.longitude,t.latitude],a=m(i),s=e.zoom,u=[e.longitude,e.latitude],l=m(s-i),h=v(o),f=v(u),p=c.f([],f,h),d=Math.max(t.width,t.height),A=d/l,g=c.b(p)*a,y=Math.max(g,.01),_=r*r,b=(A*A-d*d+_*_*y*y)/(2*d*_*y),x=(A*A-d*d-_*_*y*y)/(2*A*_*y),w=Math.log(Math.sqrt(b*b+1)-b),E=Math.log(Math.sqrt(x*x+1)-x);return{startZoom:i,startCenterXY:h,uDelta:p,w0:d,u1:g,S:(E-w)/r,rho:r,rho2:_,r0:w,r1:E}}n.d(e,"f",(function(){return R})),n.d(e,"c",(function(){return I})),n.d(e,"m",(function(){return L})),n.d(e,"d",(function(){return F})),n.d(e,"h",(function(){return z})),n.d(e,"l",(function(){return v})),n.d(e,"p",(function(){return _})),n.d(e,"q",(function(){return P})),n.d(e,"n",(function(){return M})),n.d(e,"b",(function(){return T})),n.d(e,"e",(function(){return C})),n.d(e,"i",(function(){return b})),n.d(e,"o",(function(){return x})),n.d(e,"g",(function(){return w})),n.d(e,"a",(function(){return E})),n.d(e,"k",(function(){return O})),n.d(e,"j",(function(){return S}))},function(t,e,n){"use strict";var r={};function i(t){const e=t&&t.lastIndexOf("/");return e>=0?t.substr(e+1):""}function o(t){const e=t&&t.lastIndexOf("/");return e>=0?t.substr(0,e):""}function a(...t){return(t=t.map((e,n)=>(n&&(e=e.replace(new RegExp("^".concat("/")),"")),n!==t.length-1&&(e=e.replace(new RegExp("".concat("/","$")),"")),e))).join("/")}n.r(r),n.d(r,"filename",(function(){return i})),n.d(r,"dirname",(function(){return o})),n.d(r,"join",(function(){return a}));n(142);var s=n(203);n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return s}))},function(t,e,n){"use strict";var r=n(273);e.a=new r.a({id:"deck"})},function(t,e,n){"use strict";n.d(e,"f",(function(){return o})),n.d(e,"h",(function(){return a})),n.d(e,"g",(function(){return s})),n.d(e,"d",(function(){return u})),n.d(e,"a",(function(){return c})),n.d(e,"e",(function(){return l})),n.d(e,"j",(function(){return h})),n.d(e,"b",(function(){return f})),n.d(e,"c",(function(){return p})),n.d(e,"i",(function(){return d})),n.d(e,"k",(function(){return A}));const r=t=>"boolean"==typeof t,i=t=>"function"==typeof t,o=t=>null!==t&&"object"==typeof t,a=t=>o(t)&&t.constructor==={}.constructor,s=t=>o(t)&&i(t.then),u=t=>t&&"function"==typeof t[Symbol.iterator],c=t=>t&&"function"==typeof t[Symbol.asyncIterator],l=t=>t&&i(t.next),h=t=>"undefined"!=typeof Response&&t instanceof Response||t&&t.arrayBuffer&&t.text&&t.json,f=t=>"undefined"!=typeof Blob&&t instanceof Blob,p=t=>t&&"object"==typeof t&&t.isBuffer,d=t=>(t=>"undefined"!=typeof ReadableStream&&t instanceof ReadableStream||o(t)&&i(t.tee)&&i(t.cancel)&&i(t.getReader))(t)||(t=>o(t)&&i(t.read)&&i(t.pipe)&&r(t.readable))(t),A=t=>(t=>o(t)&&i(t.abort)&&i(t.getWriter))(t)||(t=>o(t)&&i(t.end)&&i(t.write)&&r(t.writable))(t)},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return o}));var r=n(13);function i(t){if(!Number.isFinite(t))throw new Error("Invalid number ".concat(t));return t}function o(t,e,n=""){if(r.b.debug&&!function(t,e){if(t.length!==e)return!1;for(let e=0;e<t.length;++e)if(!Number.isFinite(t[e]))return!1;return!0}(t,e))throw new Error("math.gl: ".concat(n," some fields set to invalid numbers'"));return t}},function(t,e,n){"use strict";n.d(e,"e",(function(){return r})),n.d(e,"d",(function(){return i})),n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return s}));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")},function(t,e,n){"use strict";n.d(e,"c",(function(){return i})),n.d(e,"h",(function(){return o})),n.d(e,"f",(function(){return a})),n.d(e,"a",(function(){return s})),n.d(e,"j",(function(){return u})),n.d(e,"k",(function(){return c})),n.d(e,"e",(function(){return l})),n.d(e,"d",(function(){return h})),n.d(e,"p",(function(){return f})),n.d(e,"o",(function(){return p})),n.d(e,"q",(function(){return d})),n.d(e,"l",(function(){return A})),n.d(e,"m",(function(){return g})),n.d(e,"n",(function(){return m})),n.d(e,"b",(function(){return y})),n.d(e,"i",(function(){return _})),n.d(e,"g",(function(){return b}));var r=n(11);function i(){var t=new r.a(3);return r.a!=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.a(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 c(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 l(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){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 p(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 d(t,e,n){var r=n[0],i=n[1],o=n[2],a=n[3],s=e[0],u=e[1],c=e[2],l=i*c-o*u,h=o*s-r*c,f=r*u-i*s,p=i*f-o*h,d=o*l-r*f,A=r*h-i*l,g=2*a;return l*=g,h*=g,f*=g,p*=2,d*=2,A*=2,t[0]=s+l+p,t[1]=u+h+d,t[2]=c+f+A,t}function A(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),c=u&&l(t,e)/u;return Math.acos(Math.min(Math.max(c,-1),1))}var v,_=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=o;v=i()},function(t,e,n){"use strict";n.d(e,"q",(function(){return i})),n.d(e,"f",(function(){return o})),n.d(e,"a",(function(){return a})),n.d(e,"h",(function(){return s})),n.d(e,"p",(function(){return u})),n.d(e,"o",(function(){return c})),n.d(e,"k",(function(){return l})),n.d(e,"l",(function(){return h})),n.d(e,"m",(function(){return f})),n.d(e,"n",(function(){return p})),n.d(e,"e",(function(){return d})),n.d(e,"c",(function(){return A})),n.d(e,"d",(function(){return g})),n.d(e,"j",(function(){return m})),n.d(e,"i",(function(){return y})),n.d(e,"g",(function(){return v})),n.d(e,"b",(function(){return _}));var r=n(11);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],c=e[7],l=e[8],h=e[9],f=e[10],p=e[11],d=e[12],A=e[13],g=e[14],m=e[15],y=n*s-r*a,v=n*u-i*a,_=n*c-o*a,b=r*u-i*s,x=r*c-o*s,w=i*c-o*u,E=l*A-h*d,O=l*g-f*d,S=l*m-p*d,T=h*g-f*A,C=h*m-p*A,P=f*m-p*g,M=y*P-v*C+_*T+b*S-x*O+w*E;return M?(M=1/M,t[0]=(s*P-u*C+c*T)*M,t[1]=(i*C-r*P-o*T)*M,t[2]=(A*w-g*x+m*b)*M,t[3]=(f*x-h*w-p*b)*M,t[4]=(u*S-a*P-c*O)*M,t[5]=(n*P-i*S+o*O)*M,t[6]=(g*_-d*w-m*v)*M,t[7]=(l*w-f*_+p*v)*M,t[8]=(a*C-s*S+c*E)*M,t[9]=(r*S-n*C-o*E)*M,t[10]=(d*x-A*_+m*y)*M,t[11]=(h*_-l*x-p*y)*M,t[12]=(s*O-a*T-u*E)*M,t[13]=(n*T-r*O+i*E)*M,t[14]=(A*v-d*b-g*y)*M,t[15]=(l*b-h*v+f*y)*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],c=t[8],l=t[9],h=t[10],f=t[11],p=t[12],d=t[13],A=t[14],g=t[15];return(e*a-n*o)*(h*g-f*A)-(e*s-r*o)*(l*g-f*d)+(e*u-i*o)*(l*A-h*d)+(n*s-r*a)*(c*g-f*p)-(n*u-i*a)*(c*A-h*p)+(r*u-i*s)*(c*d-l*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],c=e[6],l=e[7],h=e[8],f=e[9],p=e[10],d=e[11],A=e[12],g=e[13],m=e[14],y=e[15],v=n[0],_=n[1],b=n[2],x=n[3];return t[0]=v*r+_*s+b*h+x*A,t[1]=v*i+_*u+b*f+x*g,t[2]=v*o+_*c+b*p+x*m,t[3]=v*a+_*l+b*d+x*y,v=n[4],_=n[5],b=n[6],x=n[7],t[4]=v*r+_*s+b*h+x*A,t[5]=v*i+_*u+b*f+x*g,t[6]=v*o+_*c+b*p+x*m,t[7]=v*a+_*l+b*d+x*y,v=n[8],_=n[9],b=n[10],x=n[11],t[8]=v*r+_*s+b*h+x*A,t[9]=v*i+_*u+b*f+x*g,t[10]=v*o+_*c+b*p+x*m,t[11]=v*a+_*l+b*d+x*y,v=n[12],_=n[13],b=n[14],x=n[15],t[12]=v*r+_*s+b*h+x*A,t[13]=v*i+_*u+b*f+x*g,t[14]=v*o+_*c+b*p+x*m,t[15]=v*a+_*l+b*d+x*y,t}function u(t,e,n){var r,i,o,a,s,u,c,l,h,f,p,d,A=n[0],g=n[1],m=n[2];return e===t?(t[12]=e[0]*A+e[4]*g+e[8]*m+e[12],t[13]=e[1]*A+e[5]*g+e[9]*m+e[13],t[14]=e[2]*A+e[6]*g+e[10]*m+e[14],t[15]=e[3]*A+e[7]*g+e[11]*m+e[15]):(r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=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]=c,t[7]=l,t[8]=h,t[9]=f,t[10]=p,t[11]=d,t[12]=r*A+s*g+h*m+e[12],t[13]=i*A+u*g+f*m+e[13],t[14]=o*A+c*g+p*m+e[14],t[15]=a*A+l*g+d*m+e[15]),t}function c(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 l(t,e,n,i){var o,a,s,u,c,l,h,f,p,d,A,g,m,y,v,_,b,x,w,E,O,S,T,C,P=i[0],M=i[1],I=i[2],B=Math.hypot(P,M,I);return B<r.b?null:(P*=B=1/B,M*=B,I*=B,o=Math.sin(n),s=1-(a=Math.cos(n)),u=e[0],c=e[1],l=e[2],h=e[3],f=e[4],p=e[5],d=e[6],A=e[7],g=e[8],m=e[9],y=e[10],v=e[11],_=P*P*s+a,b=M*P*s+I*o,x=I*P*s-M*o,w=P*M*s-I*o,E=M*M*s+a,O=I*M*s+P*o,S=P*I*s+M*o,T=M*I*s-P*o,C=I*I*s+a,t[0]=u*_+f*b+g*x,t[1]=c*_+p*b+m*x,t[2]=l*_+d*b+y*x,t[3]=h*_+A*b+v*x,t[4]=u*w+f*E+g*O,t[5]=c*w+p*E+m*O,t[6]=l*w+d*E+y*O,t[7]=h*w+A*E+v*O,t[8]=u*S+f*T+g*C,t[9]=c*S+p*T+m*C,t[10]=l*S+d*T+y*C,t[11]=h*S+A*T+v*C,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],c=e[8],l=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+c*r,t[5]=a*i+l*r,t[6]=s*i+h*r,t[7]=u*i+f*r,t[8]=c*i-o*r,t[9]=l*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],c=e[8],l=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-c*r,t[1]=a*i-l*r,t[2]=s*i-h*r,t[3]=u*i-f*r,t[8]=o*r+c*i,t[9]=a*r+l*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],c=e[4],l=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+c*r,t[1]=a*i+l*r,t[2]=s*i+h*r,t[3]=u*i+f*r,t[4]=c*i-o*r,t[5]=l*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],c=e[9],l=e[10];return t[0]=Math.hypot(n,r,i),t[1]=Math.hypot(o,a,s),t[2]=Math.hypot(u,c,l),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,c=n*a,l=r*a,h=r*s,f=i*a,p=i*s,d=i*u,A=o*a,g=o*s,m=o*u;return t[0]=1-h-d,t[1]=l+m,t[2]=f-g,t[3]=0,t[4]=l-m,t[5]=1-c-d,t[6]=p+A,t[7]=0,t[8]=f+g,t[9]=p-A,t[10]=1-c-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function g(t,e,n,r,i,o,a){var s=1/(n-e),u=1/(i-r),c=1/(o-a);return 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)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*c,t[15]=0,t}var m=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 y=function(t,e,n,r,i,o,a){var s=1/(e-n),u=1/(r-i),c=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*c,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*u,t[14]=(a+o)*c,t[15]=1,t};function v(t,e,n,i){var o,a,s,u,c,l,h,f,p,d,A=e[0],g=e[1],m=e[2],y=i[0],v=i[1],_=i[2],b=n[0],x=n[1],w=n[2];return Math.abs(A-b)<r.b&&Math.abs(g-x)<r.b&&Math.abs(m-w)<r.b?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=g-x,p=m-w,o=v*(p*=d=1/Math.hypot(h,f,p))-_*(f*=d),a=_*(h*=d)-y*p,s=y*f-v*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,c=p*o-h*s,l=h*a-f*o,(d=Math.hypot(u,c,l))?(u*=d=1/d,c*=d,l*=d):(u=0,c=0,l=0),t[0]=o,t[1]=u,t[2]=h,t[3]=0,t[4]=a,t[5]=c,t[6]=f,t[7]=0,t[8]=s,t[9]=l,t[10]=p,t[11]=0,t[12]=-(o*A+a*g+s*m),t[13]=-(u*A+c*g+l*m),t[14]=-(h*A+f*g+p*m),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],c=t[6],l=t[7],h=t[8],f=t[9],p=t[10],d=t[11],A=t[12],g=t[13],m=t[14],y=t[15],v=e[0],_=e[1],b=e[2],x=e[3],w=e[4],E=e[5],O=e[6],S=e[7],T=e[8],C=e[9],P=e[10],M=e[11],I=e[12],B=e[13],R=e[14],k=e[15];return Math.abs(n-v)<=r.b*Math.max(1,Math.abs(n),Math.abs(v))&&Math.abs(i-_)<=r.b*Math.max(1,Math.abs(i),Math.abs(_))&&Math.abs(o-b)<=r.b*Math.max(1,Math.abs(o),Math.abs(b))&&Math.abs(a-x)<=r.b*Math.max(1,Math.abs(a),Math.abs(x))&&Math.abs(s-w)<=r.b*Math.max(1,Math.abs(s),Math.abs(w))&&Math.abs(u-E)<=r.b*Math.max(1,Math.abs(u),Math.abs(E))&&Math.abs(c-O)<=r.b*Math.max(1,Math.abs(c),Math.abs(O))&&Math.abs(l-S)<=r.b*Math.max(1,Math.abs(l),Math.abs(S))&&Math.abs(h-T)<=r.b*Math.max(1,Math.abs(h),Math.abs(T))&&Math.abs(f-C)<=r.b*Math.max(1,Math.abs(f),Math.abs(C))&&Math.abs(p-P)<=r.b*Math.max(1,Math.abs(p),Math.abs(P))&&Math.abs(d-M)<=r.b*Math.max(1,Math.abs(d),Math.abs(M))&&Math.abs(A-I)<=r.b*Math.max(1,Math.abs(A),Math.abs(I))&&Math.abs(g-B)<=r.b*Math.max(1,Math.abs(g),Math.abs(B))&&Math.abs(m-R)<=r.b*Math.max(1,Math.abs(m),Math.abs(R))&&Math.abs(y-k)<=r.b*Math.max(1,Math.abs(y),Math.abs(k))}},function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}},function(t,e){function n(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=n=function(t){return typeof t}:t.exports=n=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(e)}t.exports=n},function(t,e,n){"use strict";function r(t,e){if(!t)throw new Error(e||"deck.gl: assertion failed.")}n.d(e,"a",(function(){return r}))},function(t,e,n){t.exports=n(258)()},,function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return a}));var r=n(20),i={};function o(t){i=t}function a(t,e,n,o){r.a.level>0&&i[t]&&i[t].call(null,e,n,o)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var r=n(38),i=n(61),o=n(51),a=n(8),s=n(10),u=n(135);const c={offset:"accessor.offset",stride:"accessor.stride",type:"accessor.type",size:"accessor.size",divisor:"accessor.divisor",normalized:"accessor.normalized",integer:"accessor.integer",instanced:"accessor.divisor",isInstanced:"accessor.divisor"},l={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:c},h={removedProps:c};class f extends r.a{get[Symbol.toStringTag](){return"Buffer"}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(t,e),this.stubRemovedMethods("Buffer","v6.0",["layout","setLayout","getIndexedParameter"]),this.target=e.target||(this.gl.webgl2?36662:34962),this.initialize(e),Object.seal(this)}getElementCount(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/i.a.getBytesPerElement(t))}getVertexCount(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/i.a.getBytesPerVertex(t))}initialize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ArrayBuffer.isView(t)&&(t={data:t}),Number.isFinite(t)&&(t={byteLength:t}),t=Object(u.a)("Buffer",t,l),this.usage=t.usage||35044,this.debugData=null,this.setAccessor(Object.assign({},t,t.accessor)),t.data?this._setData(t.data,t.offset,t.byteLength):this._setByteLength(t.byteLength||0),this}setProps(t){return"accessor"in(t=Object(u.a)("Buffer",t,h))&&this.setAccessor(t.accessor),this}setAccessor(t){return delete(t=Object.assign({},t)).buffer,this.accessor=new i.a(t),this}reallocate(t){return t>this.byteLength?(this._setByteLength(t),!0):(this.bytesUsed=t,!1)}setData(t){return this.initialize(t)}subData(t){ArrayBuffer.isView(t)&&(t={data:t});const{data:e,offset:n=0,srcOffset:r=0}=t,i=t.byteLength||t.length;Object(s.a)(e);const o=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(o,this.handle),0!==r||void 0!==i?(Object(a.a)(this.gl),this.gl.bufferSubData(this.target,n,e,r,i)):this.gl.bufferSubData(o,n,e),this.gl.bindBuffer(o,null),this.debugData=null,this._inferType(e),this}copyData(t){let{sourceBuffer:e,readOffset:n=0,writeOffset:r=0,size:i}=t;const{gl:o}=this;return Object(a.a)(o),o.bindBuffer(36662,e.handle),o.bindBuffer(36663,this.handle),o.copyBufferSubData(36662,36663,n,r,i),o.bindBuffer(36662,null),o.bindBuffer(36663,null),this.debugData=null,this}getData(){let{dstData:t=null,srcByteOffset:e=0,dstOffset:n=0,length:r=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(a.a)(this.gl);const i=Object(o.c)(this.accessor.type||5126,{clamped:!1}),u=this._getAvailableElementCount(e),c=n;let l,h;t?(h=t.length,l=h-c):(l=Math.min(u,r||u),h=c+l);const f=Math.min(u,l);return r=r||f,Object(s.a)(r<=f),t=t||new i(h),this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,e,t,n,r),this.gl.bindBuffer(36662,null),t}bind(){let{target:t=this.target,index:e=this.accessor&&this.accessor.index,offset:n=0,size:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return 35345===t||35982===t?void 0!==r?this.gl.bindBufferRange(t,e,this.handle,n,r):(Object(s.a)(0===n),this.gl.bindBufferBase(t,e,this.handle)):this.gl.bindBuffer(t,this.handle),this}unbind(){let{target:t=this.target,index:e=this.accessor&&this.accessor.index}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return 35345===t||35982===t?this.gl.bindBufferBase(t,e,null):this.gl.bindBuffer(t,null),this}getDebugData(){return this.debugData?{data:this.debugData,changed:!1}:(this.debugData=this.getData({length:Math.min(10,this.byteLength)}),{data:this.debugData,changed:!0})}invalidateDebugData(){this.debugData=null}_setData(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.byteLength+e;Object(s.a)(ArrayBuffer.isView(t)),this._trackDeallocatedMemory();const 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);const a=Object(o.b)(t);return Object(s.a)(a),this.setAccessor(new i.a(this.accessor,{type:a})),this}_setByteLength(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.usage;Object(s.a)(t>=0),this._trackDeallocatedMemory();let n=t;0===t&&(n=new Float32Array(0));const 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}_getTarget(){return this.gl.webgl2?36663:this.target}_getAvailableElementCount(t){const e=t/Object(o.c)(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-e}_inferType(t){this.accessor.type||this.setAccessor(new i.a(this.accessor,{type:Object(o.b)(t)}))}_createHandle(){return this.gl.createBuffer()}_deleteHandle(){this.gl.deleteBuffer(this.handle),this._trackDeallocatedMemory()}_getParameter(t){this.gl.bindBuffer(this.target,this.handle);const e=this.gl.getBufferParameter(this.target,t);return this.gl.bindBuffer(this.target,null),e}get type(){return a.k.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}get bytes(){return a.k.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}setByteLength(t){return a.k.deprecated("setByteLength","reallocate")(),this.reallocate(t)}updateAccessor(t){return a.k.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new i.a(this.accessor,t),this}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"e",(function(){return o})),n.d(e,"b",(function(){return a})),n.d(e,"d",(function(){return s})),n.d(e,"c",(function(){return u})),n.d(e,"g",(function(){return c})),n.d(e,"h",(function(){return l})),n.d(e,"i",(function(){return h})),n.d(e,"j",(function(){return f})),n.d(e,"f",(function(){return A}));var r=n(11);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 c(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 l(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,d,A=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t};p=new r.a(2),r.a!=Float32Array&&(p[0]=0,p[1]=0),d=p},function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"e",(function(){return a})),n.d(e,"c",(function(){return s})),n.d(e,"d",(function(){return u})),n.d(e,"b",(function(){return f})),n.d(e,"f",(function(){return p}));var r=n(66),i=n(81);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],t[15]+t[14]),far:h(t[3]-t[2],t[7]-t[6],t[11]-t[10],t[15]-t[14])}}var c,l=new i.a;function h(t,e,n,r){l.set(t,e,n);var o=l.len();return{distance:r/o,normal:new i.a(-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;c=r.a.allocate(c,u,{type:Float32Array,size:2*i});for(var l=a,h=0;l<s;){for(var p=0;p<i;p++){var d=t[l++];c[h+p]=d,c[h+p+i]=f(d)}h+=2*i}return c.subarray(0,u*i*2)}},function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"g",(function(){return o})),n.d(e,"c",(function(){return a})),n.d(e,"l",(function(){return s})),n.d(e,"a",(function(){return u})),n.d(e,"k",(function(){return c})),n.d(e,"h",(function(){return l})),n.d(e,"m",(function(){return h})),n.d(e,"j",(function(){return f})),n.d(e,"d",(function(){return p})),n.d(e,"i",(function(){return d})),n.d(e,"n",(function(){return A})),n.d(e,"o",(function(){return g})),n.d(e,"f",(function(){return m})),n.d(e,"e",(function(){return y}));var r=n(11);function i(t){var e=new r.a(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.a(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 c(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t}function l(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 g(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],u=n[2],c=n[3],l=c*r+s*o-u*i,h=c*i+u*r-a*o,f=c*o+a*i-s*r,p=-a*r-s*i-u*o;return t[0]=l*c+p*-a+h*-u-f*-s,t[1]=h*c+p*-s+f*-a-l*-u,t[2]=f*c+p*-u+l*-s-h*-a,t[3]=e[3],t}function m(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function y(t,e){var n=t[0],i=t[1],o=t[2],a=t[3],s=e[0],u=e[1],c=e[2],l=e[3];return Math.abs(n-s)<=r.b*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-u)<=r.b*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(o-c)<=r.b*Math.max(1,Math.abs(o),Math.abs(c))&&Math.abs(a-l)<=r.b*Math.max(1,Math.abs(a),Math.abs(l))}var v,_;v=new r.a(4),r.a!=Float32Array&&(v[0]=0,v[1]=0,v[2]=0,v[3]=0),_=v},function(t,e,n){"use strict";n(1),n(13);const r={CLOCKWISE:1,COUNTER_CLOCKWISE:-1};function i(t,e,n={}){return function(t,e={}){return Math.sign(o(t,e))}(t,n)!==e&&(function(t,e){const{start:n=0,end:r=t.length,size:i=2}=e,o=(r-n)/i,a=Math.floor(o/2);for(let e=0;e<a;++e){const r=n+e*i,a=n+(o-1-e)*i;for(let e=0;e<i;++e){const n=t[r+e];t[r+e]=t[a+e],t[a+e]=n}}}(t,n),!0)}function o(t,e={}){const{start:n=0,end:r=t.length}=e,i=e.size||2;let o=0;for(let e=n,a=r-i;e<r;e+=i)o+=(t[e]-t[a])*(t[e+1]+t[a+1]),a=e;return o/2}function a(t,e,n=2,r){const i=e&&e.length,o=i?e[0]*n:t.length;let a=s(t,0,o,n,!0,r&&r[0]);const l=[];if(!a||a.next===a.prev)return l;let h,f,p,g,m,v,_;if(i&&(a=function(t,e,n,r,i){const o=[];let a,c,l,h,f;for(a=0,c=e.length;a<c;a++)l=e[a]*r,h=a<c-1?e[a+1]*r:t.length,f=s(t,l,h,r,!1,i&&i[a+1]),f===f.next&&(f.steiner=!0),o.push(y(f));for(o.sort(d),a=0;a<o.length;a++)A(o[a],n),n=u(n,n.next);return n}(t,e,a,n,r)),t.length>80*n){g=f=t[0],m=p=t[1];for(let e=n;e<o;e+=n)v=t[e],_=t[e+1],v<g&&(g=v),_<m&&(m=_),v>f&&(f=v),_>p&&(p=_);h=Math.max(f-g,p-m),h=0!==h?1/h:0}return c(a,l,n,g,m,h),l}function s(t,e,n,r,i,a){let 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=C(s,t[s],t[s+1],u);else for(s=n-r;s>=e;s-=r)u=C(s,t[s],t[s+1],u);return u&&x(u,u.next)&&(P(u),u=u.next),u}function u(t,e){if(!t)return t;e||(e=t);let 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(P(r),r=e=r.prev,r===r.next)break;n=!0}}while(n||r!==e);return e}function c(t,e,n,r,i,o,a){if(!t)return;!a&&o&&function(t,e,n,r){let i=t;do{null===i.z&&(i.z=m(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){let e,n,r,i,o,a,s,u,c=1;do{for(i=t,t=null,u=null,r=0;i;){for(r++,a=i,o=0,n=0;n<c&&(o++,a=a.nextZ,a);n++);for(s=c;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:t=e,e.prevZ=u,u=e;i=a}u.nextZ=null,c*=2}while(r>1)}(i)}(t,r,i,o);let s,d,A=t;for(;t.prev!==t.next;)if(s=t.prev,d=t.next,o?h(t,r,i,o):l(t))e.push(s.i/n),e.push(t.i/n),e.push(d.i/n),P(t),t=d.next,A=d.next;else if((t=d)===A){a?1===a?c(t=f(u(t),e,n),e,n,r,i,o,2):2===a&&p(t,e,n,r,i,o):c(u(t),e,n,r,i,o,1);break}}function l(t){const e=t.prev,n=t,r=t.next;if(b(e,n,r)>=0)return!1;let i=t.next.next;for(;i!==t.prev;){if(v(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){const i=t.prev,o=t,a=t.next;if(b(i,o,a)>=0)return!1;const 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,c=i.x>o.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,l=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,h=m(s,u,e,n,r),f=m(c,l,e,n,r);let p=t.prevZ,d=t.nextZ;for(;p&&p.z>=h&&d&&d.z<=f;){if(p!==t.prev&&p!==t.next&&v(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&&v(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&&v(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&&v(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){let r=t;do{const i=r.prev,o=r.next.next;!x(i,o)&&w(i,r,r.next,o)&&S(i,o)&&S(o,i)&&(e.push(i.i/n),e.push(r.i/n),e.push(o.i/n),P(r),P(r.next),r=t=o),r=r.next}while(r!==t);return u(r)}function p(t,e,n,r,i,o){let a=t;do{let t=a.next.next;for(;t!==a.prev;){if(a.i!==t.i&&_(a,t)){let s=T(a,t);return a=u(a,a.next),s=u(s,s.next),c(a,e,n,r,i,o),void c(s,e,n,r,i,o)}t=t.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){let n=e;const r=t.x,i=t.y;let o,a=-1/0;do{if(i<=n.y&&i>=n.next.y&&n.next.y!==n.y){const t=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(t<=r&&t>a){if(a=t,t===r){if(i===n.y)return n;if(i===n.next.y)return n.next}o=n.x<n.next.x?n:n.next}}n=n.next}while(n!==e);if(!o)return null;if(r===a)return o;const s=o,u=o.x,c=o.y;let l,h=1/0;n=o;do{r>=n.x&&n.x>=u&&r!==n.x&&v(i<c?r:a,i,u,c,i<c?a:r,i,n.x,n.y)&&(l=Math.abs(i-n.y)/(r-n.x),S(n,t)&&(l<h||l===h&&(n.x>o.x||n.x===o.x&&g(o,n)))&&(o=n,h=l)),n=n.next}while(n!==s);return o}(t,e)){const n=T(e,t);u(e,e.next),u(n,n.next)}}function g(t,e){return b(t.prev,t,e.prev)<0&&b(e.next,t,t.next)<0}function m(t,e,n,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 y(t){let e=t,n=t;do{(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next}while(e!==t);return n}function v(t,e,n,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){let n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&w(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(S(t,e)&&S(e,t)&&function(t,e){let n=t,r=!1;const 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){const i=O(b(t,e,n)),o=O(b(t,e,r)),a=O(b(n,r,t)),s=O(b(n,r,e));return i!==o&&a!==s||(!(0!==i||!E(t,n,e))||(!(0!==o||!E(t,r,e))||(!(0!==a||!E(n,t,r))||!(0!==s||!E(n,e,r)))))}function E(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 O(t){return t>0?1:t<0?-1:0}function S(t,e){return b(t.prev,t,t.next)<0?b(t,e,t.next)>=0&&b(t,t.prev,e)>=0:b(t,e,t.prev)<0||b(t,t.next,e)<0}function T(t,e){const n=new 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 C(t,e,n,r){const 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 P(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){const n=e.length,r=t.length;if(r>0){let i=!0;for(let o=0;o<n;o++)if(t[r-n+o]!==e[o]){i=!1;break}if(i)return!1}for(let i=0;i<n;i++)t[r+i]=e[i];return!0}function B(t,e){const n=e.length;for(let r=0;r<n;r++)t[r]=e[r]}function R(t,e,n,r,i=[]){const o=r+e*n;for(let e=0;e<n;e++)i[e]=t[o+e];return i}function k(t,e,n,r,i=[]){let o,a;if(8&n)o=(r[3]-t[1])/(e[1]-t[1]),a=3;else if(4&n)o=(r[1]-t[1])/(e[1]-t[1]),a=1;else if(2&n)o=(r[2]-t[0])/(e[0]-t[0]),a=2;else{if(!(1&n))return null;o=(r[0]-t[0])/(e[0]-t[0]),a=0}for(let n=0;n<t.length;n++)i[n]=(1&a)===n?r[a]:o*(e[n]-t[n])+t[n];return i}function L(t,e){let n=0;return t[0]<e[0]?n|=1:t[0]>e[2]&&(n|=2),t[1]<e[1]?n|=4:t[1]>e[3]&&(n|=8),n}function D(t,e){const{size:n=2,broken:r=!1,gridResolution:i=10,gridOffset:o=[0,0],startIndex:a=0,endIndex:s=t.length}=e||{},u=(s-a)/n;let c=[];const l=[c],h=R(t,0,n,a);let f,p;const d=U(h,i,o,[]),A=[];I(c,h);for(let e=1;e<u;e++){for(f=R(t,e,n,a,f),p=L(f,d);p;){k(h,f,p,d,A);const t=L(A,d);t&&(k(h,A,t,d,A),p=t),I(c,A),B(h,A),N(d,i,p),r&&c.length>n&&(c=[],l.push(c),I(c,h)),p=L(f,d)}I(c,f),B(h,f)}return r?l:l[0]}function j(t,e){for(let n=0;n<e.length;n++)t.push(e[n]);return t}function F(t,e=null,n){if(!t.length)return[];const{size:r=2,gridResolution:i=10,gridOffset:o=[0,0],edgeTypes:a=!1}=n||{},s=[],u=[{pos:t,types:a?new Array(t.length/r).fill(1):null,holes:e||[]}],c=[[],[]];let l=[];for(;u.length;){const{pos:t,types:e,holes:n}=u.shift();G(t,r,n[0]||t.length,c),l=U(c[0],i,o,l);const h=L(c[1],l);if(h){let i=z(t,e,r,0,n[0]||t.length,l,h);const o={pos:i[0].pos,types:i[0].types,holes:[]},s={pos:i[1].pos,types:i[1].types,holes:[]};u.push(o,s);for(let u=0;u<n.length;u++)i=z(t,e,r,n[u],n[u+1]||t.length,l,h),i[0]&&(o.holes.push(o.pos.length),o.pos=j(o.pos,i[0].pos),a&&(o.types=j(o.types,i[0].types))),i[1]&&(s.holes.push(s.pos.length),s.pos=j(s.pos,i[1].pos),a&&(s.types=j(s.types,i[1].types)))}else{const r={positions:t};a&&(r.edgeTypes=e),n.length&&(r.holeIndices=n),s.push(r)}}return s}function z(t,e,n,r,i,o,a){const s=(i-r)/n,u=[],c=[],l=[],h=[],f=[];let p,d,A;const g=R(t,s-1,n,r);let m=Math.sign(8&a?g[1]-o[3]:g[0]-o[2]),y=e&&e[s-1],v=0,_=0;for(let i=0;i<s;i++)p=R(t,i,n,r,p),d=Math.sign(8&a?p[1]-o[3]:p[0]-o[2]),A=e&&e[r/n+i],d&&m&&m!==d&&(k(g,p,a,o,f),I(u,f)&&l.push(y),I(c,f)&&h.push(y)),d<=0?(I(u,p)&&l.push(A),v-=d):l.length&&(l[l.length-1]=0),d>=0?(I(c,p)&&h.push(A),_+=d):h.length&&(h[h.length-1]=0),B(g,p),m=d,y=A;return[v?{pos:u,types:e&&l}:null,_?{pos:c,types:e&&h}:null]}function U(t,e,n,r){const 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 N(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 G(t,e,n,r){let i=1/0,o=-1/0,a=1/0,s=-1/0;for(let r=0;r<n;r+=e){const e=t[r],n=t[r+1];i=e<i?e:i,o=e>o?e:o,a=n<a?n:a,s=n>s?n:s}return r[0][0]=i,r[0][1]=a,r[1][0]=o,r[1][1]=s,r}function V(t,e){const{size:n=2,startIndex:r=0,endIndex:i=t.length,normalize:o=!0}=e||{},a=t.slice(r,i);X(a,n,0,i-r);const s=D(a,{size:n,broken:!0,gridResolution:360,gridOffset:[-180,-180]});if(o)for(const t of s)J(t,n);return s}function H(t,e=null,n){const{size:r=2,normalize:i=!0,edgeTypes:o=!1}=n||{};e=e||[];const a=[],s=[];let u=0,c=0;for(let i=0;i<=e.length;i++){const o=e[i]||t.length,l=c,h=W(t,r,u,o);for(let e=h;e<o;e++)a[c++]=t[e];for(let e=u;e<h;e++)a[c++]=t[e];X(a,r,l,c),q(a,r,l,c,null==n?void 0:n.maxLatitude),u=o,s[i]=c}s.pop();const l=F(a,s,{size:r,gridResolution:360,gridOffset:[-180,-180],edgeTypes:o});if(i)for(const t of l)J(t.positions,r);return l}function W(t,e,n,r){let i=-1,o=-1;for(let a=n+1;a<r;a+=e){const e=Math.abs(t[a]);e>i&&(i=e,o=a-1)}return o}function q(t,e,n,r,i=85.051129){const o=t[n],a=t[r-e];if(Math.abs(o-a)>180){const r=R(t,0,e,n);r[0]+=360*Math.round((a-o)/360),I(t,r),r[1]=Math.sign(r[1])*i,I(t,r),r[0]=o,I(t,r)}}function X(t,e,n,r){let i,o=t[0];for(let a=n;a<r;a+=e){i=t[a];const e=i-o;(e>180||e<-180)&&(i-=360*Math.round(e/360)),t[a]=o=i}}function J(t,e){let n;const r=t.length/e;for(let i=0;i<r&&(n=t[i*e],(n+180)%360==0);i++);const i=360*-Math.round(n/360);if(0!==i)for(let n=0;n<r;n++)t[n*e]+=i}n.d(e,"g",(function(){return o})),n.d(e,"h",(function(){return i})),n.d(e,"a",(function(){return r})),n.d(e,"f",(function(){return a})),n.d(e,"b",(function(){return F})),n.d(e,"d",(function(){return D})),n.d(e,"e",(function(){return V})),n.d(e,"c",(function(){return H}))},function(t,e,n){var r=n(249),i=n(250),o=n(251);t.exports=function(t){return r(t)||i(t)||o()}},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var r=n(8),i=n(125),o=n(46),a=n(10),s=n(45),u=n(168);const c="Resource subclass must define virtual methods";class l{get[Symbol.toStringTag](){return"Resource"}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(r.b)(t);const{id:n,userData:i={}}=e;this.gl=t,this.gl2=t,this.id=n||Object(s.c)(this[Symbol.toStringTag]),this.userData=i,this._bound=!1,this._handle=e.handle,void 0===this._handle&&(this._handle=this._createHandle()),this.byteLength=0,this._initStats(),this._addStats()}toString(){return"".concat(this[Symbol.toStringTag]||this.constructor.name,"(").concat(this.id,")")}get handle(){return this._handle}delete(){let{deleteChildren:t=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=this._handle&&this._deleteHandle(this._handle);return this._handle&&this._removeStats(),this._handle=null,e&&t&&e.filter(Boolean).forEach(t=>t.delete()),this}bind(){let t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.handle;return"function"!=typeof e?(this._bindHandle(e),this):(this._bound?t=e():(this._bindHandle(this.handle),this._bound=!0,t=e(),this._bound=!1,this._bindHandle(null)),t)}unbind(){this.bind(null)}getParameter(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t=Object(o.b)(this.gl,t),Object(a.a)(t);const n=(this.constructor.PARAMETERS||{})[t];if(n){const t=Object(r.j)(this.gl);if(!((!("webgl2"in n)||t)&&(!("extension"in n)||this.gl.getExtension(n.extension)))){const e=n.webgl1,r="webgl2"in n?n.webgl2:n.webgl1;return t?r:e}}return this._getParameter(t,e)}getParameters(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{parameters:e,keys:n}=t,i=this.constructor.PARAMETERS||{},a=Object(r.j)(this.gl),s={},u=e||Object.keys(i);for(const e of u){const r=i[e];if(r&&(!("webgl2"in r)||a)&&(!("extension"in r)||this.gl.getExtension(r.extension))){const i=n?Object(o.a)(this.gl,e):e;s[i]=this.getParameter(e,t),n&&"GLenum"===r.type&&(s[i]=Object(o.a)(this.gl,s[i]))}}return s}setParameter(t,e){t=Object(o.b)(this.gl,t),Object(a.a)(t);const n=(this.constructor.PARAMETERS||{})[t];if(n){const t=Object(r.j)(this.gl);if(!((!("webgl2"in n)||t)&&(!("extension"in n)||this.gl.getExtension(n.extension))))throw new Error("Parameter not available on this platform");"GLenum"===n.type&&(e=Object(o.b)(e))}return this._setParameter(t,e),this}setParameters(t){for(const e in t)this.setParameter(e,t[e]);return this}stubRemovedMethods(t,e,n){return Object(u.a)(this,t,e,n)}initialize(t){}_createHandle(){throw new Error(c)}_deleteHandle(){throw new Error(c)}_bindHandle(t){throw new Error(c)}_getOptsFromHandle(){throw new Error(c)}_getParameter(t,e){throw new Error(c)}_setParameter(t,e){throw new Error(c)}_context(){return this.gl.luma=this.gl.luma||{},this.gl.luma}_initStats(){this.gl.stats=this.gl.stats||new i.a}_addStats(){const t=this[Symbol.toStringTag],e=i.b.get("Resource Counts");e.get("Resources Created").incrementCount(),e.get("".concat(t,"s Created")).incrementCount(),e.get("".concat(t,"s Active")).incrementCount()}_removeStats(){const t=this[Symbol.toStringTag];i.b.get("Resource Counts").get("".concat(t,"s Active")).decrementCount()}_trackAllocatedMemory(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this[Symbol.toStringTag];this._doTrackAllocatedMemory(t,e),this._doTrackAllocatedMemory(t,e,this.gl.stats.get("Memory Usage"))}_doTrackAllocatedMemory(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this[Symbol.toStringTag],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i.b.get("Memory Usage");n.get("GPU Memory").addCount(t),n.get("".concat(e," Memory")).addCount(t),this.byteLength=t}_trackDeallocatedMemory(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this[Symbol.toStringTag];this._doTrackDeallocatedMemory(t),this._doTrackDeallocatedMemory(t,this.gl.stats.get("Memory Usage"))}_doTrackDeallocatedMemory(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this[Symbol.toStringTag],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.b.get("Memory Usage");e.get("GPU Memory").subtractCount(this.byteLength),e.get("".concat(t," Memory")).subtractCount(this.byteLength),this.byteLength=0}}},function(t,e,n){t.exports=n(256)},function(t,e,n){var r=n(247);Object.assign(r,n(64),n(267),n(266),n(144),n(269),n(187)),t.exports=r},function(t,e,n){"use strict";n.d(e,"a",(function(){return w}));var r=n(9),i=n.n(r),o=n(3),a=n.n(o),s=n(4),u=n.n(s),c=n(0),l=n.n(c),h=n(20),f=n(34),p=n(75),d=n(13),A=n(81),g=n(68),m=n(18),y=n(12),v=Math.PI/180,_=Object(f.a)(),b=[0,0,0],x={unitsPerMeter:[1,1,1],metersPerUnit:[1,1,1]};var w=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};a()(this,t),l()(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.distanceScales=e.distanceScales||x,this.focalDistance=e.focalDistance||1,this.position=e.position||b,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 u()(t,[{key:"metersPerPixel",get:function(){return this.distanceScales.metersPerUnit[2]/this.scale}},{key:"projectionMode",get:function(){return this.isGeospatial?this.zoom<12?y.d.WEB_MERCATOR:y.d.WEB_MERCATOR_AUTO_OFFSET:y.d.IDENTITY}},{key:"equals",value:function(e){return e instanceof t&&(this===e||e.width===this.width&&e.height===this.height&&e.scale===this.scale&&Object(d.d)(e.projectionMatrix,this.projectionMatrix)&&Object(d.d)(e.viewMatrix,this.viewMatrix))}},{key:"project",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.topLeft,r=void 0===n||n,o=this.projectPosition(t),a=Object(m.q)(o,this.pixelProjectionMatrix),s=i()(a,2),u=s[0],c=s[1],l=r?c:this.height-c;return 2===t.length?[u,l]:[u,l,a[2]]}},{key:"unproject",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.topLeft,r=void 0===n||n,o=e.targetZ,a=i()(t,3),s=a[0],u=a[1],c=a[2],l=r?u:this.height-u,h=o&&o*this.distanceScales.unitsPerMeter[2],f=Object(m.n)([s,l,c],this.pixelUnprojectionMatrix,h),p=this.unprojectPosition(f),d=i()(p,3),A=d[0],g=d[1],y=d[2];return Number.isFinite(c)?[A,g,y]:Number.isFinite(o)?[A,g,o]:[A,g]}},{key:"projectPosition",value:function(t){var e=this.projectFlat(t),n=i()(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=i()(e,2);return[n[0],n[1],(t[2]||0)*this.distanceScales.metersPerUnit[2]]}},{key:"projectFlat",value:function(t){if(this.isGeospatial){var e=Object(m.l)(t);return e[1]=Object(d.a)(e[1],-318,830),e}return t}},{key:"unprojectFlat",value:function(t){return this.isGeospatial?Object(m.p)(t):t}},{key:"getBounds",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e={targetZ:t.z||0},n=this.unproject([0,0],e),r=this.unproject([this.width,0],e),i=this.unproject([0,this.height],e),o=this.unproject([this.width,this.height],e);return[Math.min(n[0],r[0],i[0],o[0]),Math.min(n[1],r[1],i[1],o[1]),Math.max(n[0],r[0],i[0],o[0]),Math.max(n[1],r[1],i[1],o[1])]}},{key:"getDistanceScales",value:function(t){return t?Object(m.g)({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,Object(f.d)(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=Object(m.i)({latitude:n})+Math.log2(this.focalDistance)),this.distanceScales=t.distanceScales||Object(m.g)({latitude:n,longitude:e}));var r=Math.pow(2,this.zoom);this.scale=r;var i=t.position,o=t.modelMatrix,a=b;if(i&&(a=o?new p.a(o).transformAsVector(i,[]):i),this.isGeospatial){var s=this.projectPosition([e,n,0]);this.center=new A.a(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?_:e,r=t.projectionMatrix,i=void 0===r?null:r,o=t.orthographic,a=void 0!==o&&o,s=t.fovyRadians,u=t.fovy,c=void 0===u?75:u,l=t.near,m=void 0===l?.1:l,y=t.far,b=void 0===y?1e3:y,x=t.padding,w=void 0===x?null:x,E=t.focalDistance,O=void 0===E?1:E;this.viewMatrixUncentered=n,this.viewMatrix=(new p.a).multiplyRight(n).translate(new A.a(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,c=e/n,l=r?(new p.a).orthographic({fovy:i,aspect:c,focalDistance:o,near:s,far:u}):(new p.a).perspective({fovy:i,aspect:c,near:s,far:u});if(a){var h=a.left,f=void 0===h?0:h,A=a.right,g=void 0===A?0:A,m=a.top,y=void 0===m?0:m,v=a.bottom,_=void 0===v?0:v,b=Object(d.a)((f+e-g)/2,0,e)-e/2,x=Object(d.a)((y+n-_)/2,0,n)-n/2;l[8]-=2*b/e,l[9]+=2*x/n}return l}({width:this.width,height:this.height,orthographic:a,fovyRadians:s||c*v,focalDistance:O,padding:w,near:m,far:b});var S=Object(f.a)();g.b(S,S,this.projectionMatrix),g.b(S,S,this.viewMatrix),this.viewProjectionMatrix=S,this.viewMatrixInverse=g.a([],this.viewMatrix)||this.viewMatrix,this.cameraPosition=Object(f.c)(this.viewMatrixInverse);var T=Object(f.a)(),C=Object(f.a)();g.c(T,T,[this.width/2,-this.height/2,1]),g.d(T,T,[1,-1,0]),g.b(C,T,this.viewProjectionMatrix),this.pixelProjectionMatrix=C,this.pixelUnprojectionMatrix=g.a(Object(f.a)(),this.pixelProjectionMatrix),this.pixelUnprojectionMatrix||h.a.warn("Pixel project matrix not invertible")()}}]),t}();l()(w,"displayName","Viewport")},function(t,e,n){"use strict";var r=n(0),i=n.n(r);function o(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,c=s-i;if(u>c)n.set(e.subarray(0,c),i);else if(n.set(e,i),a)for(var l=u;l<c;)for(var h=a(l,e),f=0;f<o;f++)n[i+l]=h[f]||0,l++}function a(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 s(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?a(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}n.d(e,"e",(function(){return c})),n.d(e,"d",(function(){return l})),n.d(e,"c",(function(){return h})),n.d(e,"a",(function(){return f})),n.d(e,"b",(function(){return p})),n.d(e,"f",(function(){return d}));var u={interpolation:{duration:0,easing:function(t){return t}},spring:{stiffness:.05,damping:.5}};function c(t,e){if(!t)return null;Number.isFinite(t)&&(t={type:"interpolation",duration:t});var n=t.type||"interpolation";return s(s(s(s({},u[n]),e),t),{},{type:n})}function l(t,e){var n=e.getBuffer();return n?[n,{divisor:0,size:e.size,normalized:e.settings.normalized}]:e.value}function h(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 f(t){t.push(t.shift())}function p(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 d(t){var e=t.buffer,n=t.numInstances,r=t.attribute,i=t.fromLength,a=t.fromStartIndices,s=t.getData,u=void 0===s?function(t){return t}:s,c=r.doublePrecision&&r.value instanceof Float64Array?2:1,l=r.size*c,h=r.byteOffset,f=r.startIndices,d=a&&f,A=p(r,n),g=r.isConstant;if(d||!(i>=A)){var m=g?r.value:r.getBuffer().getData({srcByteOffset:h});if(r.settings.normalized&&!g){var y=u;u=function(t,e){return r.normalizeConstant(y(t,e))}}var v=g?function(t,e){return u(m,e)}:function(t,e){return u(m.subarray(t,t+l),e)},_=e.getData({length:i}),b=new Float32Array(A);!function(t){var e=t.source,n=t.target,r=t.size,i=t.getData,a=t.sourceStartIndices,s=t.targetStartIndices;if(!Array.isArray(s))return o({source:e,target:n,size:r,getData:i}),n;for(var u=0,c=0,l=i&&function(t,e){return i(t+c,e)},h=Math.min(a.length,s.length),f=1;f<h;f++){var p=a[f]*r,d=s[f]*r;o({source:e.subarray(u,p),target:n,start:c,end:d,size:r,getData:l}),u=p,c=d}c<n.length&&o({source:[],target:n,start:c,size:r,getData:l})}({source:_,target:b,sourceStartIndices:a,targetStartIndices:f,size:l,getData:v}),e.byteLength<b.byteLength+h&&e.reallocate(b.byteLength+h),e.subData({data:b,offset:h})}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return o}));var r=n(101);function i(t){var e;if(!t)return!1;Array.isArray(t)&&(t=t[0]);return Array.isArray(null===(e=t)||void 0===e?void 0:e.extensions)}function o(t){var e,n;let o;return Object(r.a)(t,"null loader"),Object(r.a)(i(t),"invalid loader"),Array.isArray(t)&&(o=t[1],t=t[0],t={...t,options:{...t.options,...o}}),(null!==(e=t)&&void 0!==e&&e.parseTextSync||null!==(n=t)&&void 0!==n&&n.parseText)&&(t.text=!0),t.text||(t.binary=!0),t}},function(t,e,n){"use strict";var r=n(21),i=n(98),o=n(1),a=n(225);const s=Object(a.a)();class u{constructor(t,e,n="sessionStorage"){this.storage=function(t){try{const e=window[t],n="__storage_test__";return e.setItem(n,n),e.removeItem(n),e}catch(t){return null}}(n),this.id=t,this.config={},Object.assign(this.config,e),this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(t){return this.config={},this.updateConfiguration(t)}updateConfiguration(t){if(Object.assign(this.config,t),this.storage){const t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}return this}_loadConfiguration(){let t={};if(this.storage){const e=this.storage.getItem(this.id);t=e?JSON.parse(e):{}}return Object.assign(this.config,t),this}}function c(t,e,n,r=600){const i=t.src.replace(/\(/g,"%28").replace(/\)/g,"%29");t.width>r&&(n=Math.min(n,r/t.width));const 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]}const l={BLACK:30,RED:31,GREEN:32,YELLOW:33,BLUE:34,MAGENTA:35,CYAN:36,WHITE:37,BRIGHT_BLACK:90,BRIGHT_RED:91,BRIGHT_GREEN:92,BRIGHT_YELLOW:93,BRIGHT_BLUE:94,BRIGHT_MAGENTA:95,BRIGHT_CYAN:96,BRIGHT_WHITE:97};function h(t){return"string"==typeof t?l[t.toUpperCase()]||l.WHITE:t}function f(t,e){if(!t)throw new Error(e||"Assertion failed")}var p=n(94);function d(){let t;if(s&&p.b.performance)t=p.b.performance.now();else if(p.a.hrtime){const e=p.a.hrtime();t=1e3*e[0]+e[1]/1e6}else t=Date.now();return t}const A={debug:s&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},g={enabled:!0,level:0};function m(){}const y={},v={once:!0};function _(t){for(const e in t)for(const n in t[e])return n||"untitled";return"empty"}class b{constructor({id:t}={id:""}){this.id=t,this.VERSION="8.9.0-alpha.5",this._startTs=d(),this._deltaTs=d(),this.LOG_THROTTLE_TIMEOUT=0,this._storage=new u("__probe-".concat(this.id,"__"),g),this.userData={},this.timeStamp("".concat(this.id," started")),function(t,e=["constructor"]){const n=Object.getPrototypeOf(t),r=Object.getOwnPropertyNames(n);for(const n of r)"function"==typeof t[n]&&(e.find(t=>n===t)||(t[n]=t[n].bind(t)))}(this),Object.seal(this)}set level(t){this.setLevel(t)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((d()-this._startTs).toPrecision(10))}getDelta(){return Number((d()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(t=!0){return this._storage.updateConfiguration({enabled:t}),this}setLevel(t){return this._storage.updateConfiguration({level:t}),this}assert(t,e){f(t,e)}warn(t){return this._getLogFunction(0,t,A.warn,arguments,v)}error(t){return this._getLogFunction(0,t,A.error,arguments)}deprecated(t,e){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(e,"` instead"))}removed(t,e){return this.error("`".concat(t,"` has been removed. Use `").concat(e,"` instead"))}probe(t,e){return this._getLogFunction(t,e,A.log,arguments,{time:!0,once:!0})}log(t,e){return this._getLogFunction(t,e,A.debug,arguments)}info(t,e){return this._getLogFunction(t,e,console.info,arguments)}once(t,e){return this._getLogFunction(t,e,A.debug||A.info,arguments,v)}table(t,e,n){return e?this._getLogFunction(t,e,console.table||m,n&&[n],{tag:_(e)}):m}image({logLevel:t,priority:e,image:r,message:i="",scale:o=1}){return this._shouldLog(t||e)?s?function({image:t,message:e="",scale:n=1}){if("string"==typeof t){const r=new Image;return r.onload=()=>{const t=c(r,e,n);console.log(...t)},r.src=t,m}const r=t.nodeName||"";if("img"===r.toLowerCase())return console.log(...c(t,e,n)),m;if("canvas"===r.toLowerCase()){const r=new Image;return r.onload=()=>console.log(...c(r,e,n)),r.src=t.toDataURL(),m}return m}({image:r,message:i,scale:o}):function({image:t,message:e="",scale:r=1}){let i=null;try{i=n(255)}catch(t){}if(i)return()=>i(t,{fit:"box",width:"".concat(Math.round(80*r),"%")}).then(t=>console.log(t));return m}({image:r,message:i,scale:o}):m}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}get(t){return this._storage.config[t]}set(t,e){this._storage.updateConfiguration({[t]:e})}time(t,e){return this._getLogFunction(t,e,console.time?console.time:console.info)}timeEnd(t,e){return this._getLogFunction(t,e,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,e){return this._getLogFunction(t,e,console.timeStamp||m)}group(t,e,n={collapsed:!1}){n=w({logLevel:t,message:e,opts:n});const{collapsed:r}=n;return n.method=(r?console.groupCollapsed:console.group)||console.info,this._getLogFunction(n)}groupCollapsed(t,e,n={}){return this.group(t,e,Object.assign({},n,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||m)}withGroup(t,e,n){this.group(t,e)();try{n()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=x(t)}_getLogFunction(t,e,n,r=[],i){if(this._shouldLog(t)){i=w({logLevel:t,message:e,args:r,opts:i}),f(n=n||i.method),i.total=this.getTotal(),i.delta=this.getDelta(),this._deltaTs=d();const o=i.tag||i.message;if(i.once){if(y[o])return m;y[o]=d()}return e=function(t,e,n){if("string"==typeof e){const a=n.time?function(t,e=8){const n=Math.max(e-t.length,0);return"".concat(" ".repeat(n)).concat(t)}(function(t){let e;return e=t<10?"".concat(t.toFixed(2),"ms"):t<100?"".concat(t.toFixed(1),"ms"):t<1e3?"".concat(t.toFixed(0),"ms"):"".concat((t/1e3).toFixed(2),"s"),e}(n.total)):"";e=n.time?"".concat(t,": ").concat(a," ").concat(e):"".concat(t,": ").concat(e),r=e,i=n.color,o=n.background,s||"string"!=typeof r||(i&&(i=h(i),r="[".concat(i,"m").concat(r,"")),o&&(i=h(o),r="[".concat(o+10,"m").concat(r,""))),e=r}var r,i,o;return e}(this.id,i.message,i),n.bind(console,e,...i.args)}return m}}function x(t){if(!t)return 0;let e;switch(typeof t){case"number":e=t;break;case"object":e=t.logLevel||t.priority||0;break;default:return 0}return f(Number.isFinite(e)&&e>=0),e}function w(t){const{logLevel:e,message:n}=t;t.logLevel=x(e);const r=t.args?Array.from(t.args):[];for(;r.length&&r.shift()!==n;);switch(t.args=r,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());const i=typeof t.message;return f("string"===i||"object"===i),Object.assign(t,t.opts)}b.VERSION="8.9.0-alpha.5";const E=new b({id:"loaders.gl"});class O{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}var S=n(69);const T={fetch:null,mimeType:void 0,nothrow:!1,log:new class{constructor(){Object(o.a)(this,"console",void 0),this.console=console}log(...t){return this.console.log.bind(this.console,...t)}info(...t){return this.console.info.bind(this.console,...t)}warn(...t){return this.console.warn.bind(this.console,...t)}error(...t){return this.console.error.bind(this.console,...t)}},CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:S.c,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},C={throws:"nothrow",dataType:"(no longer used)",uri:"baseUri",method:"fetch.method",headers:"fetch.headers",body:"fetch.body",mode:"fetch.mode",credentials:"fetch.credentials",cache:"fetch.cache",redirect:"fetch.redirect",referrer:"fetch.referrer",referrerPolicy:"fetch.referrerPolicy",integrity:"fetch.integrity",keepalive:"fetch.keepalive",signal:"fetch.signal"};function P(){globalThis.loaders=globalThis.loaders||{};const{loaders:t}=globalThis;return t._state=t._state||{},t._state}n.d(e,"c",(function(){return P})),n.d(e,"b",(function(){return M})),n.d(e,"e",(function(){return I})),n.d(e,"d",(function(){return B})),n.d(e,"a",(function(){return R}));const M=()=>{const t=P();return t.globalOptions=t.globalOptions||{...T},t.globalOptions};function I(t){const e=P(),n=M();e.globalOptions=D(n,t)}function B(t,e,n,r){return n=n||[],function(t,e){k(t,null,T,C,e);for(const n of e){const r=t&&t[n.id]||{},i=n.options&&n.options[n.id]||{},o=n.deprecatedOptions&&n.deprecatedOptions[n.id]||{};k(r,n.id,i,o,e)}}(t,n=Array.isArray(n)?n:[n]),D(e,t,r)}function R(t,e){const n=M(),o=t||n;return"function"==typeof o.fetch?o.fetch:Object(r.f)(o.fetch)?t=>Object(i.a)(t,o):null!=e&&e.fetch?null==e?void 0:e.fetch:i.a}function k(t,e,n,i,o){const a=e||"Top level",s=e?"".concat(e,"."):"";for(const u in t){const c=!e&&Object(r.f)(t[u]),l="baseUri"===u&&!e,h="workerUrl"===u&&e;if(!(u in n)&&!l&&!h)if(u in i)E.warn("".concat(a," loader option '").concat(s).concat(u,"' no longer supported, use '").concat(i[u],"'"))();else if(!c){const t=L(u,o);E.warn("".concat(a," loader option '").concat(s).concat(u,"' not recognized. ").concat(t))()}}}function L(t,e){const n=t.toLowerCase();let r="";for(const i of e)for(const e in i.options){if(t===e)return"Did you mean '".concat(i.id,".").concat(e,"'?");const o=e.toLowerCase();(n.startsWith(o)||o.startsWith(n))&&(r=r||"Did you mean '".concat(i.id,".").concat(e,"'?"))}return r}function D(t,e,n){const r={...t.options||{}};return function(t,e){e&&!("baseUri"in t)&&(t.baseUri=e)}(r,n),null===r.log&&(r.log=new O),j(r,M()),j(r,e),r}function j(t,e){for(const n in e)if(n in e){const i=e[n];Object(r.h)(i)&&Object(r.h)(t[n])?t[n]={...t[n],...e[n]}:t[n]=e[n]}}},function(t,e,n){"use strict";n.d(e,"c",(function(){return o})),n.d(e,"b",(function(){return a})),n.d(e,"a",(function(){return s}));var r=n(10);const i={};function o(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"id";i[t]=i[t]||1;const e=i[t]++;return"".concat(t,"-").concat(e)}function a(t){return Object(r.a)("number"==typeof t,"Input must be a number"),t&&0==(t&t-1)}function s(t){let e=!0;for(const n in t){e=!1;break}return e}},function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"a",(function(){return o}));var r=n(10);function i(t,e){if("string"!=typeof e)return e;const n=Number(e);if(!isNaN(n))return n;const i=t[e=e.replace(/^.*\./,"")];return Object(r.a)(void 0!==i,"Accessing undefined constant GL.".concat(e)),i}function o(t,e){e=Number(e);for(const n in t)if(t[n]===e)return"GL.".concat(n);return String(e)}},function(t,e,n){"use strict";(function(t,r){n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return a})),n.d(e,"d",(function(){return s})),n.d(e,"c",(function(){return u}));const i={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==t&&t,document:"undefined"!=typeof document&&document},o=i.global||i.self||i.window||{},a="object"!=typeof r||"[object process]"!==String(r)||r.browser,s="function"==typeof importScripts,u="undefined"!=typeof window&&void 0!==window.orientation,c=void 0!==r&&r.version&&/v([0-9]*)/.exec(r.version);c&&parseFloat(c[1])}).call(this,n(82),n(63))},function(t,e,n){"use strict";n.d(e,"a",(function(){return S}));var r=n(0),i=n.n(r),o=n(3),a=n.n(o),s=n(4),u=n.n(s),c=n(7),l=n.n(c),h=n(5),f=n.n(h),p=n(6),d=n.n(p),A=n(2),g=n.n(A),m=n(109),y=n(13);function v(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?v(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function b(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return x(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 x(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=n.call(t)},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 x(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 w(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=g()(t);if(e){var i=g()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return d()(this,n)}}var E=["longitude","latitude","zoom","bearing","pitch"],O=["longitude","latitude","zoom"],S=function(t){f()(n,t);var e=w(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};a()(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:E,required:O},(t=e.call(this,o.transitionProps)).opts=o,t}return u()(n,[{key:"initializeProps",value:function(t,e){var r=l()(g()(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),c=s.unproject(a);r.start.around=a,Object.assign(r.end,{around:u.project(c),aroundPosition:c,width:e.width,height:e.height})}return r}},{key:"interpolateProps",value:function(t,e,n){var r,i={},o=b(this._propsToExtract);try{for(o.s();!(r=o.n()).done;){var a=r.value;i[a]=Object(y.g)(t[a]||0,e[a]||0,n)}}catch(t){o.e(t)}finally{o.f()}if(e.aroundPosition&&this.opts.makeViewport){var s=this.opts.makeViewport(_(_({},e),i));Object.assign(i,s.panByPosition(e.aroundPosition,Object(y.g)(t.around,e.around,n)))}return i}}]),n}(m.a)},function(t,e,n){"use strict";function r(t,e){if(!t)throw new Error(e||"loaders.gl assertion failed.")}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"c",(function(){return a})),n.d(e,"b",(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,c=i?i/s:0,l=Math.floor((t.length-c)/u);return function(e,r){var i=r.index,s=r.target;if(!o){for(var h=i*u+c,f=0;f<n;f++)s[f]=t[h+f];return s}var p,d=o[i],A=o[i+1]||l;if(a){p=new Array(A-d);for(var g=d;g<A;g++){var m=g*u+c;s=new Array(n);for(var y=0;y<n;y++)s[y]=t[m+y];p[g-d]=s}}else if(u===n)p=t.subarray(d*n+c,A*n+c);else{p=new t.constructor((A-d)*n);for(var v=0,_=d;_<A;_++)for(var b=_*u+c,x=0;x<n;x++)p[v++]=t[b+x]}return p}}},function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"c",(function(){return i})),n.d(e,"a",(function(){return o})),n.d(e,"d",(function(){return a}));function r(t){switch(ArrayBuffer.isView(t)?t.constructor:t){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error("Failed to deduce GL constant from typed array")}}function i(t){let{clamped:e=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};switch(t){case 5126:return Float32Array;case 5123:case 33635:case 32819:case 32820:return Uint16Array;case 5125:return Uint32Array;case 5121:return e?Uint8ClampedArray:Uint8Array;case 5120:return Int8Array;case 5122:return Int16Array;case 5124:return Int32Array;default:throw new Error("Failed to deduce typed array type from GL constant")}}function o(t){let{data:e,width:n,height:r,bytesPerPixel:i=4,temp:o}=t;const a=n*i;o=o||new Uint8Array(a);for(let t=0;t<r/2;++t){const n=t*a,i=(r-t-1)*a;o.set(e.subarray(n,n+a)),e.copyWithin(n,i,i+a),e.set(o,i)}}function a(t){let{data:e,width:n,height:r}=t;const i=Math.round(n/2),o=Math.round(r/2),a=new Uint8Array(i*o*4);for(let t=0;t<o;t++)for(let r=0;r<i;r++)for(let o=0;o<4;o++)a[4*(t*i+r)+o]=e[4*(2*t*n+2*r)+o];return{data:a,width:i,height:o}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var r=n(8),i=n(38),o=n(32),a=n(79),s=n(10),u=n(45);const c=[9729,9728],l=globalThis.WebGLBuffer||function(){};class h extends i.a{get[Symbol.toStringTag](){return"Texture"}static isSupported(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{format:n,linearFiltering:r}=e;let i=!0;return n&&(i=i&&Object(a.d)(t,n),i=i&&(!r||Object(a.e)(t,n))),i}constructor(t,e){const{id:n=Object(u.c)("texture"),handle:r,target:i}=e;super(t,{id:n,handle:r}),this.target=i,this.textureUnit=void 0,this.loaded=!1,this.width=void 0,this.height=void 0,this.depth=void 0,this.format=void 0,this.type=void 0,this.dataFormat=void 0,this.border=void 0,this.textureUnit=void 0,this.mipmaps=void 0}toString(){return"Texture(".concat(this.id,",").concat(this.width,"x").concat(this.height,")")}initialize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.data;if(e instanceof Promise)return e.then(e=>this.initialize(Object.assign({},t,{pixels:e,data:e}))),this;const n="undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement;if(n&&e.readyState<HTMLVideoElement.HAVE_METADATA)return this._video=null,e.addEventListener("loadeddata",()=>this.initialize(t)),this;const{pixels:i=null,format:o=6408,border:a=0,recreate:s=!1,parameters:u={},pixelStore:c={},textureUnit:l}=t;e||(e=i);let{width:h,height:f,dataFormat:p,type:d,compressed:A=!1,mipmaps:g=!0}=t;const{depth:m=0}=t;return({width:h,height:f,compressed:A,dataFormat:p,type:d}=this._deduceParameters({format:o,type:d,dataFormat:p,compressed:A,data:e,width:h,height:f})),this.width=h,this.height=f,this.depth=m,this.format=o,this.type=d,this.dataFormat=p,this.border=a,this.textureUnit=l,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle)),g&&this._isNPOT()&&(r.k.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),g=!1,this._updateForNPOT(u)),this.mipmaps=g,this.setImageData({data:e,width:h,height:f,depth:m,format:o,type:d,dataFormat:p,border:a,mipmaps:g,parameters:c,compressed:A}),g&&this.generateMipmap(),this.setParameters(u),s&&(this.data=e),n&&(this._video={video:e,parameters:u,lastTime:e.readyState>=HTMLVideoElement.HAVE_CURRENT_DATA?e.currentTime:-1}),this}update(){if(this._video){const{video:t,parameters:e,lastTime:n}=this._video;if(n===t.currentTime||t.readyState<HTMLVideoElement.HAVE_CURRENT_DATA)return;this.setSubImageData({data:t,parameters:e}),this.mipmaps&&this.generateMipmap(),this._video.lastTime=t.currentTime}}resize(t){let{height:e,width:n,mipmaps:r=!1}=t;return n!==this.width||e!==this.height?this.initialize({width:n,height:e,format:this.format,type:this.type,dataFormat:this.dataFormat,border:this.border,mipmaps:r}):this}generateMipmap(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._isNPOT()?(r.k.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),this):(this.mipmaps=!0,this.gl.bindTexture(this.target,this.handle),Object(r.o)(this.gl,t,()=>{this.gl.generateMipmap(this.target)}),this.gl.bindTexture(this.target,null),this)}setImageData(t){this._trackDeallocatedMemory("Texture");const{target:e=this.target,pixels:n=null,level:i=0,format:o=this.format,border:u=this.border,offset:c=0,parameters:l={}}=t;let{data:h=null,type:f=this.type,width:p=this.width,height:d=this.height,dataFormat:A=this.dataFormat,compressed:g=!1}=t;h||(h=n),({type:f,dataFormat:A,compressed:g,width:p,height:d}=this._deduceParameters({format:o,type:f,dataFormat:A,compressed:g,data:h,width:p,height:d}));const{gl:m}=this;m.bindTexture(this.target,this.handle);let y,v=null;({data:h,dataType:v}=this._getDataType({data:h,compressed:g}));let _=0;if(Object(r.o)(this.gl,l,()=>{switch(v){case"null":m.texImage2D(e,i,o,p,d,u,A,f,h);break;case"typed-array":m.texImage2D(e,i,o,p,d,u,A,f,h,c);break;case"buffer":y=Object(r.a)(m),y.bindBuffer(35052,h.handle||h),y.texImage2D(e,i,o,p,d,u,A,f,c),y.bindBuffer(35052,null);break;case"browser-object":Object(r.j)(m)?m.texImage2D(e,i,o,p,d,u,A,f,h):m.texImage2D(e,i,o,A,f,h);break;case"compressed":for(const[t,n]of h.entries())m.compressedTexImage2D(e,t,n.format,n.width,n.height,u,n.data),_+=n.levelSize;break;default:Object(s.a)(!1,"Unknown image data type")}}),"compressed"===v)this._trackAllocatedMemory(_,"Texture");else if(h&&h.byteLength)this._trackAllocatedMemory(h.byteLength,"Texture");else{const t=a.a[this.dataFormat]||4,e=a.c[this.type]||1;this._trackAllocatedMemory(this.width*this.height*t*e,"Texture")}return this.loaded=!0,this}setSubImageData(t){let{target:e=this.target,pixels:n=null,data:i=null,x:a=0,y:u=0,width:c=this.width,height:h=this.height,level:f=0,format:p=this.format,type:d=this.type,dataFormat:A=this.dataFormat,compressed:g=!1,offset:m=0,border:y=this.border,parameters:v={}}=t;if(({type:d,dataFormat:A,compressed:g,width:c,height:h}=this._deduceParameters({format:p,type:d,dataFormat:A,compressed:g,data:i,width:c,height:h})),Object(s.a)(0===this.depth,"texSubImage not supported for 3D textures"),i||(i=n),i&&i.data){const t=i;i=t.data,c=t.shape[0],h=t.shape[1]}i instanceof o.a&&(i=i.handle),this.gl.bindTexture(this.target,this.handle),Object(r.o)(this.gl,v,()=>{if(g)this.gl.compressedTexSubImage2D(e,f,a,u,c,h,p,i);else if(null===i)this.gl.texSubImage2D(e,f,a,u,c,h,A,d,null);else if(ArrayBuffer.isView(i))this.gl.texSubImage2D(e,f,a,u,c,h,A,d,i,m);else if(i instanceof l){const t=Object(r.a)(this.gl);t.bindBuffer(35052,i),t.texSubImage2D(e,f,a,u,c,h,A,d,m),t.bindBuffer(35052,null)}else if(Object(r.j)(this.gl)){Object(r.a)(this.gl).texSubImage2D(e,f,a,u,c,h,A,d,i)}else this.gl.texSubImage2D(e,f,a,u,A,d,i)}),this.gl.bindTexture(this.target,null)}copyFramebuffer(){return r.k.error("Texture.copyFramebuffer({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}getActiveUnit(){return this.gl.getParameter(34016)-33984}bind(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit;const{gl:e}=this;return void 0!==t&&(this.textureUnit=t,e.activeTexture(33984+t)),e.bindTexture(this.target,this.handle),t}unbind(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit;const{gl:e}=this;return void 0!==t&&(this.textureUnit=t,e.activeTexture(33984+t)),e.bindTexture(this.target,null),t}_getDataType(t){let{data:e,compressed:n=!1}=t;return n?{data:e,dataType:"compressed"}:null===e?{data:e,dataType:"null"}:ArrayBuffer.isView(e)?{data:e,dataType:"typed-array"}:e instanceof o.a?{data:e.handle,dataType:"buffer"}:e instanceof l?{data:e,dataType:"buffer"}:{data:e,dataType:"browser-object"}}_deduceParameters(t){const{format:e,data:n}=t;let{width:r,height:i,dataFormat:o,type:s,compressed:u}=t;const c=a.b[e];return o=o||c&&c.dataFormat,s=s||c&&c.types[0],u=u||c&&c.compressed,({width:r,height:i}=this._deduceImageSize(n,r,i)),{dataFormat:o,type:s,compressed:u,width:r,height:i,format:e,data:n}}_deduceImageSize(t,e,n){let 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},Object(s.a)(r,"Could not deduced texture size"),Object(s.a)(void 0===e||r.width===e,"Deduced texture width does not match supplied width"),Object(s.a)(void 0===n||r.height===n,"Deduced texture height does not match supplied height"),r}_createHandle(){return this.gl.createTexture()}_deleteHandle(){this.gl.deleteTexture(this.handle),this._trackDeallocatedMemory("Texture")}_getParameter(t){switch(t){case 4096:return this.width;case 4097:return this.height;default:this.gl.bindTexture(this.target,this.handle);const e=this.gl.getTexParameter(this.target,t);return this.gl.bindTexture(this.target,null),e}}_setParameter(t,e){switch(this.gl.bindTexture(this.target,this.handle),e=this._getNPOTParam(t,e),t){case 33082:case 33083:this.gl.texParameterf(this.handle,t,e);break;case 4096:case 4097:Object(s.a)(!1);break;default:this.gl.texParameteri(this.target,t,e)}return this.gl.bindTexture(this.target,null),this}_isNPOT(){return!Object(r.j)(this.gl)&&(!(!this.width||!this.height)&&(!Object(u.b)(this.width)||!Object(u.b)(this.height)))}_updateForNPOT(t){void 0===t[this.gl.TEXTURE_MIN_FILTER]&&(t[this.gl.TEXTURE_MIN_FILTER]=this.gl.LINEAR),void 0===t[this.gl.TEXTURE_WRAP_S]&&(t[this.gl.TEXTURE_WRAP_S]=this.gl.CLAMP_TO_EDGE),void 0===t[this.gl.TEXTURE_WRAP_T]&&(t[this.gl.TEXTURE_WRAP_T]=this.gl.CLAMP_TO_EDGE)}_getNPOTParam(t,e){if(this._isNPOT())switch(t){case 10241:-1===c.indexOf(e)&&(e=9729);break;case 10242:case 10243:33071!==e&&(e=33071)}return e}}},function(t,e,n){"use strict";function r(t,e,n){const 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){const 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){const 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){const 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){const 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,"a",(function(){return r})),n.d(e,"c",(function(){return i})),n.d(e,"b",(function(){return o})),n.d(e,"d",(function(){return a})),n.d(e,"e",(function(){return s}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"i",(function(){return o})),n.d(e,"d",(function(){return a})),n.d(e,"b",(function(){return s})),n.d(e,"e",(function(){return u})),n.d(e,"h",(function(){return c})),n.d(e,"f",(function(){return l})),n.d(e,"g",(function(){return h})),n.d(e,"c",(function(){return f}));var r=n(11);function i(){var t=new r.a(9);return r.a!=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],c=e[7],l=e[8],h=l*a-s*c,f=-l*o+s*u,p=c*o-a*u,d=n*h+r*f+i*p;return d?(d=1/d,t[0]=h*d,t[1]=(-l*r+i*c)*d,t[2]=(s*r-i*a)*d,t[3]=f*d,t[4]=(l*n-i*u)*d,t[5]=(-s*n+i*o)*d,t[6]=p*d,t[7]=(-c*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],c=t[8];return e*(c*o-a*u)+n*(-c*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],c=e[6],l=e[7],h=e[8],f=n[0],p=n[1],d=n[2],A=n[3],g=n[4],m=n[5],y=n[6],v=n[7],_=n[8];return t[0]=f*r+p*a+d*c,t[1]=f*i+p*s+d*l,t[2]=f*o+p*u+d*h,t[3]=A*r+g*a+m*c,t[4]=A*i+g*s+m*l,t[5]=A*o+g*u+m*h,t[6]=y*r+v*a+_*c,t[7]=y*i+v*s+_*l,t[8]=y*o+v*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],c=e[6],l=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+c,t[7]=f*i+p*s+l,t[8]=f*o+p*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],c=e[6],l=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]=c,t[7]=l,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,c=n*a,l=r*a,h=r*s,f=i*a,p=i*s,d=i*u,A=o*a,g=o*s,m=o*u;return t[0]=1-h-d,t[3]=l-m,t[6]=f+g,t[1]=l+m,t[4]=1-c-d,t[7]=p-A,t[2]=f-g,t[5]=p+A,t[8]=1-c-h,t}},function(t,e,n){"use strict";n.r(e);var r=n(98),i=n(19);async function o(t,e,n){if("number"==typeof t)return await i.a._readToArrayBuffer(t,e,n);t instanceof Blob||(t=new Blob([t]));const r=t.slice(e,e+n);return await async function(t){return await new Promise((e,n)=>{const r=new FileReader;r.onload=t=>{var n;return e(null==t||null===(n=t.target)||void 0===n?void 0:n.result)},r.onerror=t=>n(t),r.readAsArrayBuffer(t)})}(r)}var a=n(95),s=n(69),u=n(83),c=n(101);function l(t,e={}){if(t=Object(a.b)(t),!s.c){const n=i.a.readFileSync(t,e);return"string"!=typeof n?Object(u.d)(n):n}return e.nothrow||Object(c.a)(!1),null}var h=n(96);async function f(t,e,n){t=Object(a.b)(t),s.c||await i.a.writeFile(t,Object(h.c)(e),{flag:"w"}),Object(c.a)(!1)}function p(t,e,n){t=Object(a.b)(t),s.c||i.a.writeFileSync(t,Object(h.c)(e),{flag:"w"}),Object(c.a)(!1)}var d=n(44),A=n(107),g=n(76),m=n(100),y=n(43),v=n(119),_=n(87),b=n(60);function x(t,e,n,r){Object(c.a)(!r||"object"==typeof r),Array.isArray(e)||Object(y.a)(e)||(r=void 0,n=e,e=void 0),n=n||{};const i=e,o=Object(_.b)(i,r),a=Object(g.b)(t,o,n);if(!a)return null;n=Object(d.d)(n,a,o);const{url:s}=Object(b.b)(t);return function(t,e,n,r){if(e=Object(v.b)(e,t,n),t.parseTextSync&&"string"==typeof e)return t.parseTextSync(e,n);if(t.parseSync&&e instanceof ArrayBuffer)return t.parseSync(e,n,r);throw new Error("".concat(t.name," loader: 'parseSync' not supported by this loader, use 'parse' instead. ").concat(r.url||""))}(a,t,n,r=Object(_.a)({url:s,parseSync:x,parse:()=>{throw new Error("parseSync called parse")},loaders:e},n))}var w=n(149);async function E(t,e,n,r){Object(c.a)(!r||"object"==typeof r),Array.isArray(e)||Object(y.a)(e)||(r=void 0,n=e,e=void 0),t=await t,n=n||{};const{url:i}=Object(b.b)(t),o=await Object(g.a)(t,e,n);return o?(n=Object(d.d)(n,o,e,i),r=Object(_.a)({url:i,parseInBatches:E,parse:m.a,loaders:e},n,r),await async function(t,e,n,r){const i=await async function(t,e,n,r){const i=await Object(v.c)(e,n),o=await async function(t,e=[]){let n=t;for await(const t of e)n=t(n);return n}(i,(null==n?void 0:n.transforms)||[]);if(t.parseInBatches)return t.parseInBatches(o,n,r);return async function*(){const e=await Object(w.a)(o),i=await Object(m.a)(e,t,{...n,mimeType:t.mimeTypes[0]},r),a={mimeType:t.mimeTypes[0],shape:Array.isArray(i)?"row-table":"unknown",batchType:"data",data:i,length:Array.isArray(i)?i.length:1};yield a}()}(t,e,n,r);if(!n.metadata)return i;const o={batchType:"metadata",metadata:{_loader:t,_context:r},data:[],bytesUsed:0};return async function*(t){yield o,yield*t}(i)}(o,t,n,r)):null}var O=n(202);function S(t,e,n,r){Array.isArray(e)||Object(y.a)(e)||(void 0,n=e,e=null);const i=Object(d.a)(n||{});if(!Array.isArray(t))return T(t,e,n,i);return t.map(t=>T(t,e,n,i))}async function T(t,e,n,r){if("string"==typeof t){const i=t,o=await r(i);return await E(o,e,n)}return await E(t,e,n)}var C=n(207),P=n(127),M=n(182),I=n(171);async function B(t,e,n={},r={}){const i=Object(M.a)(t),o=P.a.getWorkerFarm(n),{source:a}=n,s={name:i,source:a};a||(s.url=Object(M.b)(t,n));const u=o.getWorkerPool(s),c=n.jobName||t.name,l=await u.startJob(c,R.bind(null,r)),h=Object(I.b)(n);l.postMessage("process",{input:e,options:h});return(await l.result).result}async function R(t,e,n,r){switch(n){case"done":e.done(r);break;case"error":e.error(new Error(r.error));break;case"process":const{id:i,input:o,options:a}=r;try{if(!t.process)return void e.postMessage("error",{id:i,error:"Worker not set up to process on main thread"});const n=await t.process(o,a);e.postMessage("done",{id:i,result:n})}catch(t){const n=t instanceof Error?t.message:"unknown error";e.postMessage("error",{id:i,error:n})}break;default:console.warn("process-on-worker: unknown message ".concat(n))}}async function k(t,e,n){if(n={...Object(d.b)(),...n},Object(C.a)(e,n))return await B(e,t,n);if(e.encode)return await e.encode(t,n);if(e.encodeSync)return e.encodeSync(t,n);if(e.encodeText)return(new TextEncoder).encode(await e.encodeText(t,n));if(e.encodeInBatches){const r=j(t,e,n),i=[];for await(const t of r)i.push(t);return Object(u.b)(...i)}if(!s.c&&e.encodeURLtoURL){const i=z("input");await f(i,t);const o=z("output"),a=await F(i,o,e,n);return(await Object(r.a)(a)).arrayBuffer()}throw new Error("Writer could not encode data")}function L(t,e,n){if(e.encodeSync)return e.encodeSync(t,n);throw new Error("Writer could not synchronously encode data")}async function D(t,e,n){if(e.text&&e.encodeText)return await e.encodeText(t,n);if(e.text&&(e.encode||e.encodeInBatches)){const r=await k(t,e,n);return(new TextDecoder).decode(r)}throw new Error("Writer could not encode data as text")}function j(t,e,n){if(e.encodeInBatches){const r=function(t){return[{table:t,start:0,end:t.length}]}(t);return e.encodeInBatches(r,n)}throw new Error("Writer could not encode data in batches")}async function F(t,e,n,r){if(t=Object(a.b)(t),e=Object(a.b)(e),s.c||!n.encodeURLtoURL)throw new Error;return await n.encodeURLtoURL(t,e,r)}function z(t){return"/tmp/".concat(t)}async function U(t,e,n,r){const i=await k(t,n,r);return await f(e,i)}function N(t,e,n,r){return p(e,L(t,n,r))}var G=n(208),V=n(120);function H(t,e){const n=t[Symbol.asyncIterator]?t[Symbol.asyncIterator]():t[Symbol.iterator]();return new ReadableStream({type:"bytes",async pull(t){try{const{done:e,value:r}=await n.next();e?t.close():t.enqueue(new Uint8Array(r))}catch(e){t.error(e)}},async cancel(){var t;await(null==n||null===(t=n.return)||void 0===t?void 0:t.call(n))}},{highWaterMark:2**24,...e})}const W={name:"Null loader",id:"null",module:"core",version:"3.2.10",worker:!0,mimeTypes:["application/x.empty"],extensions:["null"],tests:[()=>!1],options:{null:{}}};function q(t,e,n){return e.null.echoParameters?{arrayBuffer:t,options:e,context:n=n&&JSON.parse(JSON.stringify(n))}:null}const X={name:"Null loader",id:"null",module:"core",version:"3.2.10",mimeTypes:["application/x.empty"],extensions:["null"],parse:async(t,e,n)=>q(t,e,n),parseSync:q,parseInBatches:async function*(t,e,n){for await(const r of t)yield q(r,e,n)},tests:[()=>!1],options:{null:{echoParameters:!1}}};var J=n(209);async function Z(t,e,n=(()=>{}),r=(()=>{})){if(!(t=await t).ok)return t;const i=t.body;if(!i)return t;const o=t.headers.get("content-length")||0,a=o&&parseInt(o);if(!(o>0))return t;if("undefined"==typeof ReadableStream||!i.getReader)return t;const s=new ReadableStream({async start(t){const o=i.getReader();await async function t(e,n,r,i,o,a,s){try{const{done:u,value:c}=await n.read();if(u)return a(),void e.close();r+=c.byteLength;const l=Math.round(r/i*100);o(l,{loadedBytes:r,totalBytes:i}),e.enqueue(c),await t(e,n,r,i,o,a,s)}catch(t){e.error(t),s(t)}}(t,o,0,a,e,n,r)}});return new Response(s)}var Q=n(1);class K{constructor(t,e){Object(Q.a)(this,"_fetch",void 0),Object(Q.a)(this,"files",{}),Object(Q.a)(this,"lowerCaseFiles",{}),Object(Q.a)(this,"usedFiles",{}),this._fetch=(null==e?void 0:e.fetch)||fetch;for(let e=0;e<t.length;++e){const n=t[e];this.files[n.name]=n,this.lowerCaseFiles[n.name.toLowerCase()]=n,this.usedFiles[n.name]=!1}this.fetch=this.fetch.bind(this)}async fetch(t,e){if(t.includes("://"))return this._fetch(t,e);const n=this.files[t];if(!n)return new Response(t,{status:400,statusText:"NOT FOUND"});const r=new Headers(null==e?void 0:e.headers).get("Range"),i=r&&/bytes=($1)-($2)/.exec(r);if(i){const e=parseInt(i[1]),r=parseInt(i[2]),o=await n.slice(e,r).arrayBuffer(),a=new Response(o);return Object.defineProperty(a,"url",{value:t}),a}const o=new Response(n);return Object.defineProperty(o,"url",{value:t}),o}async readdir(t){const e=[];for(const t in this.files)e.push(t);return e}async stat(t,e){const n=this.files[t];if(!n)throw new Error(t);return{size:n.size}}async unlink(t){delete this.files[t],delete this.lowerCaseFiles[t],this.usedFiles[t]=!0}async open(t,e,n){return this.files[t]}async read(t,e,n=0,r=e.byteLength,i=null){const o=t;return{bytesRead:r,buffer:await o.slice(0,0+r).arrayBuffer()}}async close(t){}_getFile(t,e){const n=this.files[t]||this.lowerCaseFiles[t];return n&&e&&(this.usedFiles[t]=!0),n}}var Y=n(128),$=n(21);n.d(e,"fetchFile",(function(){return r.a})),n.d(e,"readArrayBuffer",(function(){return o})),n.d(e,"readFileSync",(function(){return l})),n.d(e,"writeFile",(function(){return f})),n.d(e,"writeFileSync",(function(){return p})),n.d(e,"setLoaderOptions",(function(){return d.e})),n.d(e,"getLoaderOptions",(function(){return d.b})),n.d(e,"registerLoaders",(function(){return A.c})),n.d(e,"selectLoader",(function(){return g.a})),n.d(e,"selectLoaderSync",(function(){return g.b})),n.d(e,"parse",(function(){return m.a})),n.d(e,"parseSync",(function(){return x})),n.d(e,"parseInBatches",(function(){return E})),n.d(e,"load",(function(){return O.a})),n.d(e,"loadInBatches",(function(){return S})),n.d(e,"encode",(function(){return k})),n.d(e,"encodeSync",(function(){return L})),n.d(e,"encodeInBatches",(function(){return j})),n.d(e,"encodeText",(function(){return D})),n.d(e,"encodeURLtoURL",(function(){return F})),n.d(e,"save",(function(){return U})),n.d(e,"saveSync",(function(){return N})),n.d(e,"setPathPrefix",(function(){return a.c})),n.d(e,"getPathPrefix",(function(){return a.a})),n.d(e,"resolvePath",(function(){return a.b})),n.d(e,"RequestScheduler",(function(){return G.a})),n.d(e,"makeIterator",(function(){return V.a})),n.d(e,"makeStream",(function(){return H})),n.d(e,"NullWorkerLoader",(function(){return W})),n.d(e,"NullLoader",(function(){return X})),n.d(e,"JSONLoader",(function(){return J.a})),n.d(e,"_fetchProgress",(function(){return Z})),n.d(e,"_BrowserFileSystem",(function(){return K})),n.d(e,"_unregisterLoaders",(function(){return A.a})),n.d(e,"isBrowser",(function(){return s.c})),n.d(e,"isWorker",(function(){return s.d})),n.d(e,"self",(function(){return s.e})),n.d(e,"window",(function(){return s.f})),n.d(e,"global",(function(){return s.b})),n.d(e,"document",(function(){return s.a})),n.d(e,"assert",(function(){return c.a})),n.d(e,"forEach",(function(){return w.b})),n.d(e,"concatenateArrayBuffersAsync",(function(){return w.a})),n.d(e,"makeTextDecoderIterator",(function(){return Y.c})),n.d(e,"makeTextEncoderIterator",(function(){return Y.d})),n.d(e,"makeLineIterator",(function(){return Y.a})),n.d(e,"makeNumberedLineIterator",(function(){return Y.b})),n.d(e,"isPureObject",(function(){return $.h})),n.d(e,"isPromise",(function(){return $.g})),n.d(e,"isIterable",(function(){return $.d})),n.d(e,"isAsyncIterable",(function(){return $.a})),n.d(e,"isIterator",(function(){return $.e})),n.d(e,"isResponse",(function(){return $.j})),n.d(e,"isReadableStream",(function(){return $.i})),n.d(e,"isWritableStream",(function(){return $.k}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return x}));var r=n(3),i=n.n(r),o=n(4),a=n.n(o),s=n(0),u=n.n(s),c=n(147),l=n(48);function h(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 f(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?h(Object(n),!0).forEach((function(e){u()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var p={transitionDuration:0},d=function(t){return 1-(1-t)*(1-t)},A=["wheel"],g=["panstart","panmove","panend"],m=["pinchstart","pinchmove","pinchend"],y=["tripanstart","tripanmove","tripanend"],v=["doubletap"],_=["keydown"],b={},x=function(){function t(e){var n=this;i()(this,t),u()(this,"state",{}),u()(this,"_events",{}),u()(this,"_interactionState",{isDragging:!1}),u()(this,"_customEvents",[]),u()(this,"_eventStartBlocked",null),u()(this,"_panMove",!1),u()(this,"invertPan",!1),u()(this,"dragMode","rotate"),u()(this,"inertia",0),u()(this,"scrollZoom",!0),u()(this,"dragPan",!0),u()(this,"dragRotate",!0),u()(this,"doubleClickZoom",!0),u()(this,"touchZoom",!0),u()(this,"touchRotate",!1),u()(this,"keyboard",!0),this.transitionManager=new c.b(f(f({},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 a()(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(f(f({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,c=void 0===u||u,l=t.touchZoom,h=void 0===l||l,f=t.touchRotate,p=void 0!==f&&f,d=t.keyboard,b=void 0===d||d,x=Boolean(this.onViewStateChange);this.toggleEvents(A,x&&r),this.toggleEvents(g,x&&(o||s)),this.toggleEvents(m,x&&(h||p)),this.toggleEvents(y,x&&p),this.toggleEvents(v,x&&c),this.toggleEvents(_,x&&b),this.scrollZoom=r,this.dragPan=o,this.dragRotate=s,this.doubleClickZoom=c,this.touchZoom=h,this.touchRotate=p,this.keyboard=b}},{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=f(f({},t.getViewportProps()),e),i=this.controllerState!==t;if(this.state=t.getState(),this._setInteractionState(n),i){var o=this.controllerState&&this.controllerState.getViewportProps();this.onViewStateChange&&this.onViewStateChange({viewState:r,interactionState:this._interactionState,oldViewState:o})}}},{key:"_onTransition",value:function(t){this.onViewStateChange(f(f({},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,p,{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,p,{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],i=this.controllerState.pan({pos:r}).panEnd();this.updateViewport(i,f(f({},this._getTransitionProps()),{},{transitionDuration:e,transitionEasing:d}),{isDragging:!1,isPanning:!0})}else{var o=this.controllerState.panEnd();this.updateViewport(o,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,p,{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],i=this.controllerState.rotate({pos:r}).rotateEnd();this.updateViewport(i,f(f({},this._getTransitionProps()),{},{transitionDuration:e,transitionEasing:d}),{isDragging:!1,isRotating:!0})}else{var o=this.controllerState.rotateEnd();this.updateViewport(o,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,i=void 0===r?.01:r,o=n.smooth,a=void 0!==o&&o,s=t.delta,u=2/(1+Math.exp(-Math.abs(s*i)));s<0&&0!==u&&(u=1/u);var c=this.controllerState.zoom({pos:e,scale:u});return this.updateViewport(c,f(f({},this._getTransitionProps({around:e})),{},{transitionDuration:a?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,p,{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,p,{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],i=this.controllerState.rotate({pos:r});this.updateViewport(i,f(f({},this._getTransitionProps()),{},{transitionDuration:e,transitionEasing:d}),{isDragging:!1,isRotating:!0}),this.blockEvents(e)}else{var o=this.controllerState.rotateEnd();this.updateViewport(o,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 b._startPinchRotation=t.rotation,b._lastPinchEvent=t,this.updateViewport(n,p,{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:b._startPinchRotation-i})}return this.updateViewport(e,p,{isDragging:!0,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:this.touchRotate}),b._lastPinchEvent=t,!0}},{key:"_onPinchEnd",value:function(t){if(!this.isDragging())return!1;var e=this.inertia,n=b._lastPinchEvent;if(this.touchZoom&&e&&n&&t.scale!==n.scale){var r=this.getCenter(t),i=this.controllerState.rotateEnd(),o=Math.log2(t.scale),a=(o-Math.log2(n.scale))/(t.deltaTime-n.deltaTime),s=Math.pow(2,o+a*e/2);i=i.zoom({pos:r,scale:s}).zoomEnd(),this.updateViewport(i,f(f({},this._getTransitionProps({around:r})),{},{transitionDuration:e,transitionEasing:d}),{isDragging:!1,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:!1}),this.blockEvents(e)}else{var u=this.controllerState.zoomEnd().rotateEnd();this.updateViewport(u,null,{isDragging:!1,isPanning:!1,isZooming:!1,isRotating:!1})}return b._startPinchRotation=null,b._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,c={};switch(t.srcEvent.code){case"Minus":e=n?u.zoomOut(i).zoomOut(i):u.zoomOut(i),c.isZooming=!0;break;case"Equal":e=n?u.zoomIn(i).zoomIn(i):u.zoomIn(i),c.isZooming=!0;break;case"ArrowLeft":n?(e=u.rotateLeft(a),c.isRotating=!0):(e=u.moveLeft(o),c.isPanning=!0);break;case"ArrowRight":n?(e=u.rotateRight(a),c.isRotating=!0):(e=u.moveRight(o),c.isPanning=!0);break;case"ArrowUp":n?(e=u.rotateUp(s),c.isRotating=!0):(e=u.moveUp(o),c.isPanning=!0);break;case"ArrowDown":n?(e=u.rotateDown(s),c.isRotating=!0):(e=u.moveDown(o),c.isPanning=!0);break;default:return!1}return this.updateViewport(e,this._getTransitionProps(),c),!0}},{key:"_getTransitionProps",value:function(t){var e=this.transition;return e&&e.transitionInterpolator?t?f(f({},e),{},{transitionInterpolator:new l.a(f(f(f({},t),e.transitionInterpolator.opts),{},{makeViewport:this.controllerState.makeViewport}))}):e:p}}]),t}()},function(t,e,n){"use strict";var r=n(27),i=n.n(r),o=n(0),a=n.n(o),s=n(3),u=n.n(s),c=n(4),l=n.n(c),h=n(41),f=/([0-9]+\.?[0-9]*)(%|px)/;function p(t){switch(i()(t)){case"number":return{position:t,relative:!1};case"string":var e=f.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 A=n(59),g=n(28);function m(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 y(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?m(Object(n),!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}n.d(e,"a",(function(){return v}));var v=function(){function t(e){u()(this,t);var n=e||{},r=n.id,i=n.x,o=void 0===i?0:i,a=n.y,s=void 0===a?0:a,c=n.width,l=void 0===c?"100%":c,f=n.height,d=void 0===f?"100%":f,A=n.padding,m=void 0===A?null:A,v=n.viewportInstance;Object(g.a)(!v||v instanceof h.a),this.viewportInstance=v,this.id=r||this.constructor.displayName||"view",this.props=y(y({},e),{},{id:this.id}),this._x=p(o),this._y=p(s),this._width=p(l),this._height=p(d),this._padding=m&&{left:p(m.left||0),right:p(m.right||0),top:p(m.top||0),bottom:p(m.bottom||0)},this.equals=this.equals.bind(this),Object.seal(this)}return l()(t,[{key:"equals",value:function(t){return this===t||(this.viewportInstance?!!t.viewportInstance&&this.viewportInstance.equals(t.viewportInstance):this.ViewportType===t.ViewportType&&Object(A.a)(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 i=this.getDimensions({width:e,height:n});return new this.ViewportType(y(y(y({},r),this.props),i))}},{key:"getViewStateId",value:function(){var t=this.props.viewState;return"string"==typeof t?t:(null==t?void 0:t.id)||this.id}},{key:"filterViewState",value:function(t){if(this.props.viewState&&"object"===i()(this.props.viewState)){if(!this.props.viewState.id)return this.props.viewState;var e=y({},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}:y({type:this.ControllerType},t):null}}]),t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(45),i=n(10);const o={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6};class a{static get DRAW_MODE(){return o}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{id:e=Object(r.c)("geometry"),drawMode:n=o.TRIANGLES,attributes:i={},indices:a=null,vertexCount:s=null}=t;this.id=e,this.drawMode=0|n,this.attributes={},this.userData={},this._setAttributes(i,a),this.vertexCount=s||this._calculateVertexCount(this.attributes,this.indices)}get mode(){return this.drawMode}getVertexCount(){return this.vertexCount}getAttributes(){return this.indices?{indices:this.indices,...this.attributes}:this.attributes}_print(t){return"Geometry ".concat(this.id," attribute ").concat(t)}_setAttributes(t,e){e&&(this.indices=ArrayBuffer.isView(e)?{value:e,size:1}:e);for(const e in t){let n=t[e];n=ArrayBuffer.isView(n)?{value:n}:n,Object(i.a)(ArrayBuffer.isView(n.value),"".concat(this._print(e),": must be typed array or object with value as typed array")),"POSITION"!==e&&"positions"!==e||n.size||(n.size=3),"indices"===e?(Object(i.a)(!this.indices),this.indices=n):this.attributes[e]=n}return this.indices&&void 0!==this.indices.isIndexed&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed),this}_calculateVertexCount(t,e){if(e)return e.value.length;let n=1/0;for(const e in t){const r=t[e],{value:i,size:o,constant:a}=r;!a&&i&&o>=1&&(n=Math.min(n,i.length/o))}return Object(i.a)(Number.isFinite(n)),n}}},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,"a",(function(){return r}))},function(t,e,n){"use strict";var r=n(21);const i=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,o=/^([-\w.]+\/[-\w.+]+)/;function a(t){const e=o.exec(t);return e?e[1]:t}function s(t){const e=i.exec(t);return e?e[1]:""}n.d(e,"b",(function(){return c})),n.d(e,"a",(function(){return l}));const u=/\?.*/;function c(t){if(Object(r.j)(t)){const e=h(t.url||"");return{url:e,type:a(t.headers.get("content-type")||"")||s(e)}}return Object(r.b)(t)?{url:h(t.name||""),type:t.type||""}:"string"==typeof t?{url:h(t),type:s(t)}:{url:"",type:""}}function l(t){return Object(r.j)(t)?t.headers["content-length"]||-1:Object(r.b)(t)?t.size:"string"==typeof t?t.length:t instanceof ArrayBuffer||ArrayBuffer.isView(t)?t.byteLength:-1}function h(t){return t.replace(u,"")}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(51),i=n(10),o=n(135);const a={offset:0,stride:0,type:5126,size:1,divisor:0,normalized:!1,integer:!1},s={deprecatedProps:{instanced:"divisor",isInstanced:"divisor"}};class u{static getBytesPerElement(t){return Object(r.c)(t.type||5126).BYTES_PER_ELEMENT}static getBytesPerVertex(t){Object(i.a)(t.size);return Object(r.c)(t.type||5126).BYTES_PER_ELEMENT*t.size}static resolve(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new u(...[a,...e])}constructor(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];e.forEach(t=>this._assign(t)),Object.freeze(this)}toString(){return JSON.stringify(this)}get BYTES_PER_ELEMENT(){return u.getBytesPerElement(this)}get BYTES_PER_VERTEX(){return u.getBytesPerVertex(this)}_assign(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=Object(o.a)("Accessor",t,s),void 0!==t.type&&(this.type=t.type,5124!==t.type&&5125!==t.type||(this.integer=!0)),void 0!==t.size&&(this.size=t.size),void 0!==t.offset&&(this.offset=t.offset),void 0!==t.stride&&(this.stride=t.stride),void 0!==t.normalized&&(this.normalized=t.normalized),void 0!==t.integer&&(this.integer=t.integer),void 0!==t.divisor&&(this.divisor=t.divisor),void 0!==t.buffer&&(this.buffer=t.buffer),void 0!==t.index&&("boolean"==typeof t.index?this.index=t.index?1:0:this.index=t.index),void 0!==t.instanced&&(this.divisor=t.instanced?1:0),void 0!==t.isInstanced&&(this.divisor=t.isInstanced?1:0),this}}},function(t,e,n){"use strict";n.d(e,"b",(function(){return p})),n.d(e,"a",(function(){return d})),n.d(e,"d",(function(){return y})),n.d(e,"c",(function(){return b}));var r=n(9),i=n.n(r),o=n(231),a=n.n(o),s=n(36);function u(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return c(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 c(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=n.call(t)},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 c(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 l=s.a.CLOCKWISE,h=s.a.COUNTER_CLOCKWISE,f={isClosed:!0};function p(t){return"positions"in t?t.positions:t}function d(t){return"holeIndices"in t?t.holeIndices:null}function A(t,e,n,r){for(var i=0;i<e;i++)if(t[n+i]!==t[r-e+i])return!1;return!0}function g(t,e,n,r,i){for(var o=e,a=n.length,u=0;u<a;u++)for(var c=0;c<r;c++)t[o++]=n[u][c]||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 l=0;l<r;l++)t[o++]=n[0][l]||0;return f.start=e,f.end=o,f.size=r,Object(s.h)(t,i,f),o}function m(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 c=e,l=0;l<u;l++)t[c++]=n[i+l];if(!A(n,r,i,o))for(var h=0;h<r;h++)t[c++]=n[i+h];return f.start=e,f.end=c,f.size=r,Object(s.h)(t,a,f),c}function y(t,e){!function(t){if(t=t&&t.positions||t,!Array.isArray(t)&&!ArrayBuffer.isView(t))throw new Error("invalid polygon")}(t);var n=[],r=[];if("positions"in t){var o=t,a=o.positions,s=o.holeIndices;if(s){for(var c=0,f=0;f<=s.length;f++)c=m(n,c,a,e,s[f-1],s[f],0===f?l:h),r.push(c);return r.pop(),{positions:n,holeIndices:r}}t=a}if(!function(t){return Array.isArray(t[0])}(t))return m(n,0,t,e,0,n.length,l),n;if(!function(t){return t.length>=1&&t[0].length>=2&&Number.isFinite(t[0][0])}(t)){var p,d=0,A=u(t.entries());try{for(A.s();!(p=A.n()).done;){var y=i()(p.value,2),v=y[0];d=g(n,d,y[1],e,0===v?l:h),r.push(d)}}catch(t){A.e(t)}finally{A.f()}return r.pop(),{positions:n,holeIndices:r}}return g(n,0,t,e,l),n}function v(t,e,n){for(var r=t.length/3,i=0,o=0;o<r;o++){var a=(o+1)%r;i+=t[3*o+e]*t[3*a+n],i-=t[3*a+e]*t[3*o+n]}return Math.abs(i/2)}function _(t,e,n,r){for(var i=t.length/3,o=0;o<i;o++){var a=3*o,s=t[a+0],u=t[a+1],c=t[a+2];t[a+e]=s,t[a+n]=u,t[a+r]=c}}function b(t,e,n,r){var i=d(t);i&&(i=i.map((function(t){return t/e})));var o=p(t),s=r&&3===e;if(n){var u=o.length;o=o.slice();for(var c=[],l=0;l<u;l+=e){c[0]=o[l],c[1]=o[l+1],s&&(c[2]=o[l+2]);var h=n(c);o[l]=h[0],o[l+1]=h[1],s&&(o[l+2]=h[2])}}if(s){var f=v(o,0,1),A=v(o,0,2),g=v(o,1,2);if(!f&&!A&&!g)return[];f>A&&f>g||(A>g?(n||(o=o.slice()),_(o,0,2,1)):(n||(o=o.slice()),_(o,1,2,0)))}return a()(o,i,e)}},function(t,e){var n,r,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(t){r=a}}();var u,c=[],l=!1,h=-1;function f(){l&&u&&(l=!1,u.length?c=u.concat(c):h=-1,c.length&&p())}function p(){if(!l){var t=s(f);l=!0;for(var e=c.length;e;){for(u=c,c=[];++h<e;)u&&u[h].run();h=-1,e=c.length}u=null,l=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function d(t,e){this.fun=t,this.array=e}function A(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];c.push(new d(t,e)),1!==c.length||l||s(p)},d.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=A,i.addListener=A,i.once=A,i.off=A,i.removeListener=A,i.removeAllListeners=A,i.emit=A,i.prependListener=A,i.prependOnceListener=A,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e,n){"use strict";n.r(e);var r=n(216),i=n(9),o=n.n(i),a=n(3),s=n.n(a),u=n(4),c=n.n(u),l=n(7),h=n.n(l),f=n(5),p=n.n(f),d=n(6),A=n.n(d),g=n(2),m=n.n(g),y=n(0),v=n.n(y),_=n(12),b=n(204),x=n(220),w=n(157),E=n(178),O=n(58),S=n(18),T=n(13),C=new Uint16Array([0,2,1,0,3,2]),P=new Float32Array([0,1,0,0,1,0,1,1]);function M(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:C,texCoords:P}}(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),c=new Float64Array(i*o*3),l=0,h=0,f=0;f<i;f++)for(var p=f/(i-1),d=0;d<o;d++){var A=d/(o-1),g=I(t,p,A);c[3*l+0]=g[0],c[3*l+1]=g[1],c[3*l+2]=g[2]||0,u[2*l+0]=p,u[2*l+1]=1-A,f>0&&d>0&&(s[h++]=l-o,s[h++]=l-o-1,s[h++]=l-1,s[h++]=l-o,s[h++]=l-1,s[h++]=l),l++}return{vertexCount:a,positions:c,indices:s,texCoords:u}}function I(t,e,n){return Object(T.g)(Object(T.g)(t[0],t[1],n),Object(T.g)(t[3],t[2],n),e)}var B="\n#define SHADER_NAME bitmap-layer-fragment-shader\n\n#ifdef GL_ES\nprecision highp float;\n#endif\n\nuniform sampler2D bitmapTexture;\n\nvarying vec2 vTexCoord;\nvarying vec2 vTexPos;\n\nuniform float desaturate;\nuniform vec4 transparentColor;\nuniform vec3 tintColor;\nuniform float opacity;\n\nuniform float coordinateConversion;\nuniform vec4 bounds;\n\n/* projection utils */\nconst float TILE_SIZE = 512.0;\nconst float PI = 3.1415926536;\nconst float WORLD_SCALE = TILE_SIZE / PI / 2.0;\n\n// from degrees to Web Mercator\nvec2 lnglat_to_mercator(vec2 lnglat) {\n float x = lnglat.x;\n float y = clamp(lnglat.y, -89.9, 89.9);\n return vec2(\n radians(x) + PI,\n PI + log(tan(PI * 0.25 + radians(y) * 0.5))\n ) * WORLD_SCALE;\n}\n\n// from Web Mercator to degrees\nvec2 mercator_to_lnglat(vec2 xy) {\n xy /= WORLD_SCALE;\n return degrees(vec2(\n xy.x - PI,\n atan(exp(xy.y - PI)) * 2.0 - PI * 0.5\n ));\n}\n/* End projection utils */\n\n// apply desaturation\nvec3 color_desaturate(vec3 color) {\n float luminance = (color.r + color.g + color.b) * 0.333333333;\n return mix(color, vec3(luminance), desaturate);\n}\n\n// apply tint\nvec3 color_tint(vec3 color) {\n return color * tintColor;\n}\n\n// blend with background color\nvec4 apply_opacity(vec3 color, float alpha) {\n 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");function R(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 k(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?R(Object(n),!0).forEach((function(e){v()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):R(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function L(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=m()(t);if(e){var i=m()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return A()(this,n)}}var D={image:{type:"image",value:null,async:!0},bounds:{type:"array",value:[1,0,0,1],compare:!0},_imageCoordinateSystem:_.a.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]}},j=function(t){p()(n,t);var e=L(n);function n(){return s()(this,n),e.apply(this,arguments)}return c()(n,[{key:"getShaders",value:function(){return h()(m()(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:B,modules:[b.a,x.a]})}},{key:"initializeState",value:function(){var t=this,e=this.getAttributeManager();e.remove(["instancePickingColors"]);e.add({indices:{size:1,isIndexed:!0,update:function(e){return e.value=t.state.mesh.indices},noAlloc:!0},positions:{size:3,type:5130,fp64:this.use64bitPositions(),update:function(e){return e.value=t.state.mesh.positions},noAlloc:!0},texCoords:{size:2,update:function(e){return e.value=t.state.mesh.texCoords},noAlloc:!0}})}},{key:"updateState",value:function(t){var e=t.props,n=t.oldProps,r=t.changeFlags,i=this.getAttributeManager();if(r.extensionsChanged){var o,a=this.context.gl;null===(o=this.state.model)||void 0===o||o.delete(),this.state.model=this._getModel(a),i.invalidateAll()}if(e.bounds!==n.bounds){var s=this.state.mesh,u=this._createMesh();for(var c in this.state.model.setVertexCount(u.vertexCount),u)s&&s[c]!==u[c]&&i.invalidate(c);this.setState(k({mesh:u},this._getCoordinateUniforms()))}else e._imageCoordinateSystem!==n._imageCoordinateSystem&&this.setState(this._getCoordinateUniforms())}},{key:"getPickingInfo",value:function(t){var e=this.props.image,n=t.info;if(!n.color||!e)return n.bitmap=null,n;var r=e,i=r.width,a=r.height;n.index=0;var s,u,c,l,h,f=(s=n.color,u=o()(s,3),c=u[0],l=u[1],h=u[2],[(c+(15&h)/16)/256,(l+(240&h)/256)/256]),p=[Math.floor(f[0]*i),Math.floor(f[1]*a)];return n.bitmap={size:{width:i,height:a},uv:f,pixel:p},n}},{key:"disablePickingIndex",value:function(){this.setState({disablePicking:!0})}},{key:"restorePickingColors",value:function(){this.setState({disablePicking:!1})}},{key:"_updateAutoHighlight",value:function(t){h()(m()(n.prototype),"_updateAutoHighlight",this).call(this,k(k({},t),{},{color:this.encodePickingColor(0)}))}},{key:"_createMesh",value:function(){var t=this.props.bounds,e=t;return F(t)&&(e=[[t[0],t[1]],[t[0],t[3]],[t[2],t[3]],[t[2],t[1]]]),M(e,this.context.viewport.resolution)}},{key:"_getModel",value:function(t){return t?new E.a(t,k(k({},this.getShaders()),{},{id:this.props.id,geometry:new O.a({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,c=u.image,l=u.desaturate,h=u.transparentColor,f=u.tintColor;n.pickingActive&&s||c&&i&&i.setUniforms(e).setUniforms({bitmapTexture:c,desaturate:l,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=_.a.LNGLAT,e=_.a.CARTESIAN,n=_.a.DEFAULT,r=this.props._imageCoordinateSystem;if(r!==n){var i=this.props.bounds;if(!F(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=Object(S.l)([i[0],i[1]]),s=Object(S.l)([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}(w.a);function F(t){return Number.isFinite(t[0])}v()(j,"layerName","BitmapLayer"),v()(j,"defaultProps",D);var z=n(113),U=n(217),N=n(218),G=n(161),V=n(160),H=n(210),W=n(112),q=n(211),X=n(215),J=n(159),Z=n(111),Q=n(164),K=n(162);n.d(e,"ArcLayer",(function(){return r.a})),n.d(e,"BitmapLayer",(function(){return j})),n.d(e,"IconLayer",(function(){return z.a})),n.d(e,"LineLayer",(function(){return U.a})),n.d(e,"PointCloudLayer",(function(){return N.a})),n.d(e,"ScatterplotLayer",(function(){return G.a})),n.d(e,"ColumnLayer",(function(){return V.a})),n.d(e,"GridCellLayer",(function(){return H.a})),n.d(e,"PathLayer",(function(){return W.a})),n.d(e,"PolygonLayer",(function(){return q.a})),n.d(e,"GeoJsonLayer",(function(){return X.a})),n.d(e,"TextLayer",(function(){return J.a})),n.d(e,"SolidPolygonLayer",(function(){return Z.a})),n.d(e,"_MultiIconLayer",(function(){return Q.a})),n.d(e,"_TextBackgroundLayer",(function(){return K.a}))},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,c=0,l=i;c<s;c++)e[l++]=n[c];for(;c<u;)c<u-c?(e.copyWithin(i+c,i,i+c),c*=2):(e.copyWithin(i+c,i,i+u-c),c=u);return e}n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return o}))},function(t,e,n){"use strict";var r=n(3),i=n.n(r),o=n(4),a=n.n(o),s=n(0),u=n.n(s),c=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i()(this,t),u()(this,"_pool",[]),u()(this,"opts",{overAlloc:2,poolSize:100}),this.setOptions(e)}return a()(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,c=void 0!==u&&u,l=n.initialize,h=void 0!==l&&l,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 g=this._allocate(p,d,h,A);return t&&c?g.set(t):h||g.fill(0,0,4),this._release(t),g}},{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.a=new c},function(t,e){function n(t,e,n,r,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,i)}t.exports=function(t){return function(){var e=this,r=arguments;return new Promise((function(i,o){var a=t.apply(e,r);function s(t){n(a,i,o,s,u,"next",t)}function u(t){n(a,i,o,s,u,"throw",t)}s(void 0)}))}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return i})),n.d(e,"d",(function(){return o})),n.d(e,"c",(function(){return a}));n(15);function r(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],h=e[9],f=e[10],p=e[11],d=e[12],A=e[13],g=e[14],m=e[15],y=n*s-r*a,v=n*u-i*a,_=n*c-o*a,b=r*u-i*s,x=r*c-o*s,w=i*c-o*u,E=l*A-h*d,O=l*g-f*d,S=l*m-p*d,T=h*g-f*A,C=h*m-p*A,P=f*m-p*g,M=y*P-v*C+_*T+b*S-x*O+w*E;return M?(M=1/M,t[0]=(s*P-u*C+c*T)*M,t[1]=(i*C-r*P-o*T)*M,t[2]=(A*w-g*x+m*b)*M,t[3]=(f*x-h*w-p*b)*M,t[4]=(u*S-a*P-c*O)*M,t[5]=(n*P-i*S+o*O)*M,t[6]=(g*_-d*w-m*v)*M,t[7]=(l*w-f*_+p*v)*M,t[8]=(a*C-s*S+c*E)*M,t[9]=(r*S-n*C-o*E)*M,t[10]=(d*x-A*_+m*y)*M,t[11]=(h*_-l*x-p*y)*M,t[12]=(s*O-a*T-u*E)*M,t[13]=(n*T-r*O+i*E)*M,t[14]=(A*v-d*b-g*y)*M,t[15]=(l*b-h*v+f*y)*M,t):null}function i(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=e[8],f=e[9],p=e[10],d=e[11],A=e[12],g=e[13],m=e[14],y=e[15],v=n[0],_=n[1],b=n[2],x=n[3];return t[0]=v*r+_*s+b*h+x*A,t[1]=v*i+_*u+b*f+x*g,t[2]=v*o+_*c+b*p+x*m,t[3]=v*a+_*l+b*d+x*y,v=n[4],_=n[5],b=n[6],x=n[7],t[4]=v*r+_*s+b*h+x*A,t[5]=v*i+_*u+b*f+x*g,t[6]=v*o+_*c+b*p+x*m,t[7]=v*a+_*l+b*d+x*y,v=n[8],_=n[9],b=n[10],x=n[11],t[8]=v*r+_*s+b*h+x*A,t[9]=v*i+_*u+b*f+x*g,t[10]=v*o+_*c+b*p+x*m,t[11]=v*a+_*l+b*d+x*y,v=n[12],_=n[13],b=n[14],x=n[15],t[12]=v*r+_*s+b*h+x*A,t[13]=v*i+_*u+b*f+x*g,t[14]=v*o+_*c+b*p+x*m,t[15]=v*a+_*l+b*d+x*y,t}function o(t,e,n){var r,i,o,a,s,u,c,l,h,f,p,d,A=n[0],g=n[1],m=n[2];return e===t?(t[12]=e[0]*A+e[4]*g+e[8]*m+e[12],t[13]=e[1]*A+e[5]*g+e[9]*m+e[13],t[14]=e[2]*A+e[6]*g+e[10]*m+e[14],t[15]=e[3]*A+e[7]*g+e[11]*m+e[15]):(r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=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]=c,t[7]=l,t[8]=h,t[9]=f,t[10]=p,t[11]=d,t[12]=r*A+s*g+h*m+e[12],t[13]=i*A+u*g+f*m+e[13],t[14]=o*A+c*g+p*m+e[14],t[15]=a*A+l*g+d*m+e[15]),t}function a(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(t,e,n){"use strict";(function(t,r){n.d(e,"e",(function(){return o})),n.d(e,"f",(function(){return a})),n.d(e,"b",(function(){return s})),n.d(e,"a",(function(){return u})),n.d(e,"c",(function(){return c})),n.d(e,"d",(function(){return l}));const i={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==t&&t,document:"undefined"!=typeof document&&document},o=i.self||i.window||i.global||{},a=i.window||i.self||i.global||{},s=i.global||i.self||i.window||{},u=i.document||{},c=Boolean("object"!=typeof r||"[object process]"!==String(r)||r.browser),l="function"==typeof importScripts,h=void 0!==r&&r.version&&/v([0-9]*)/.exec(r.version);h&&parseFloat(h[1])}).call(this,n(82),n(63))},function(t,e,n){"use strict";n.d(e,"a",(function(){return w}));var r=n(3),i=n.n(r),o=n(4),a=n.n(o),s=n(26),u=n.n(s),c=n(5),l=n.n(c),h=n(6),f=n.n(h),p=n(2),d=n.n(p),A=n(0),g=n.n(A),m=n(170),y=n(8),v=n(180);function _(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return b(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 b(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=n.call(t)},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 b(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 x(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=d()(t);if(e){var i=d()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return f()(this,n)}}var w=function(t){l()(n,t);var e=x(n);function n(){var t;i()(this,n);for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];return t=e.call.apply(e,[this].concat(o)),g()(u()(t),"_lastRenderIndex",-1),t}return a()(n,[{key:"render",value:function(t){var e=this.gl;return Object(y.n)(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,s=void 0===a||a,u=t.clearCanvas,c=void 0===u||u;t.pass=t.pass||"unknown";var l=this.gl;c&&function(t){var e=t.drawingBufferWidth,n=t.drawingBufferHeight;Object(y.n)(t,{viewport:[0,0,e,n]}),t.clear(16640)}(l),s&&(this._lastRenderIndex=-1);var h,f=[],p=_(r);try{for(p.s();!(h=p.n()).done;){var d=h.value,A=i&&i[d.id];o(d);var g,m=this._getDrawLayerParams(d,t),v=_(d.subViewports||[d]);try{for(v.s();!(g=v.n()).done;){var b=g.value,x=this._drawLayersInViewport(l,{target:e,moduleParameters:n,viewport:b,view:A,pass:t.pass,layers:t.layers},m);f.push(x)}}catch(t){v.e(t)}finally{v.f()}}}catch(t){p.e(t)}finally{p.f()}return f}},{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=[],c=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={},i=function i(o,a){var s,u=o.props._offset,c=o.id,l=o.parent&&o.parent.id;if(l&&!(l in n)&&i(o.parent,!1),l in r){var h=r[l]=r[l]||t(n[l],n);s=h(o,a),r[c]=h}else Number.isFinite(u)?(s=u+(n[l]||0),r[c]=null):s=e;return a&&s>=e&&(e=s+1),n[c]=s,s};return i}(this._lastRenderIndex+1),l={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,l,i,h),A={shouldDrawLayer:d};d&&(A.layerRenderIndex=c(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,c=function(t,e){var n=e.moduleParameters,r=e.target,i=e.viewport,o=r&&"default-framebuffer"!==r.id,a=n&&n.devicePixelRatio||Object(y.e)(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 l=!0===u.props.clear?{color:!0,depth:!0}:u.props.clear;Object(y.o)(t,{scissorTest:!0,scissor:c},(function(){return Object(v.a)(t,l)}))}var h={totalCount:r.length,visibleCount:0,compositeCount:0,pickableCount:0};Object(y.n)(t,{viewport:c});for(var f=0;f<r.length;f++){var p=r[f],d=n[f],A=d.shouldDrawLayer,g=d.layerRenderIndex,m=d.moduleParameters,_=d.layerParameters;if(A&&p.props.pickable&&h.pickableCount++,p.isComposite)h.compositeCount++;else if(A){h.visibleCount++,this._lastRenderIndex=Math.max(this._lastRenderIndex,g),m.viewport=s;try{p._drawLayer({moduleParameters:m,uniforms:{layerIndex:g},parameters:_})}catch(t){p.raiseError(t,"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:Object(y.e)(this.gl)});if(e){var a,s=_(e);try{for(s.s();!(a=s.n()).done;){var u,c=a.value;Object.assign(o,null===(u=c.getModuleParameters)||void 0===u?void 0:u.call(c,t))}}catch(t){s.e(t)}finally{s.f()}}return Object.assign(o,this.getModuleParameters(t,e),r)}}]),n}(m.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var r=n(8),i=n(38),o=n(102),a=n(104),s=n(180),u=n(197),c=n(234),l=n(46),h=n(10);class f extends i.a{get[Symbol.toStringTag](){return"Framebuffer"}static isSupported(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{colorBufferFloat:n,colorBufferHalfFloat:r}=e;let 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}static getDefaultFramebuffer(t){return t.luma=t.luma||{},t.luma.defaultFramebuffer=t.luma.defaultFramebuffer||new f(t,{id:"default-framebuffer",handle:null,attachments:{}}),t.luma.defaultFramebuffer}get MAX_COLOR_ATTACHMENTS(){const t=Object(r.a)(this.gl);return t.getParameter(t.MAX_COLOR_ATTACHMENTS)}get MAX_DRAW_BUFFERS(){const t=Object(r.a)(this.gl);return t.getParameter(t.MAX_DRAW_BUFFERS)}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(t,e),this.width=null,this.height=null,this.attachments={},this.readBuffer=36064,this.drawBuffers=[36064],this.ownResources=[],this.initialize(e),Object.seal(this)}get color(){return this.attachments[36064]||null}get texture(){return this.attachments[36064]||null}get depth(){return this.attachments[36096]||this.attachments[33306]||null}get stencil(){return this.attachments[36128]||this.attachments[33306]||null}initialize(t){let{width:e=1,height:n=1,attachments:r=null,color:i=!0,depth:o=!0,stencil:a=!1,check:s=!0,readBuffer:u,drawBuffers:c}=t;if(Object(h.a)(e>=0&&n>=0,"Width and height need to be integers"),this.width=e,this.height=n,r)for(const t in r){const i=r[t];(Array.isArray(i)?i[0]:i).resize({width:e,height:n})}else r=this._createDefaultAttachments(i,o,a,e,n);this.update({clearAttachments:!0,attachments:r,readBuffer:u,drawBuffers:c}),r&&s&&this.checkStatus()}delete(){for(const t of this.ownResources)t.delete();return super.delete(),this}update(t){let{attachments:e={},readBuffer:n,drawBuffers:r,clearAttachments:i=!1,resizeAttachments:o=!0}=t;this.attach(e,{clearAttachments:i,resizeAttachments:o});const{gl:a}=this,s=a.bindFramebuffer(36160,this.handle);return n&&this._setReadBuffer(n),r&&this._setDrawBuffers(r),a.bindFramebuffer(36160,s||null),this}resize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{width:e,height:n}=t;if(null===this.handle)return Object(h.a)(void 0===e&&void 0===n),this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;void 0===e&&(e=this.gl.drawingBufferWidth),void 0===n&&(n=this.gl.drawingBufferHeight),e!==this.width&&n!==this.height&&r.k.log(2,"Resizing framebuffer ".concat(this.id," to ").concat(e,"x").concat(n))();for(const t in this.attachments)this.attachments[t].resize({width:e,height:n});return this.width=e,this.height=n,this}attach(t){let{clearAttachments:e=!1,resizeAttachments:n=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r={};e&&Object.keys(this.attachments).forEach(t=>{r[t]=null}),Object.assign(r,t);const i=this.gl.bindFramebuffer(36160,this.handle);for(const t in r){Object(h.a)(void 0!==t,"Misspelled framebuffer binding point?");const e=Number(t),i=r[e];let o=i;if(o)if(o instanceof a.a)this._attachRenderbuffer({attachment:e,renderbuffer:o});else if(Array.isArray(i)){const[t,n=0,r=0]=i;o=t,this._attachTexture({attachment:e,texture:t,layer:n,level:r})}else this._attachTexture({attachment:e,texture:o,layer:0,level:0});else this._unattach(e);n&&o&&o.resize({width:this.width,height:this.height})}this.gl.bindFramebuffer(36160,i||null),Object.assign(this.attachments,t),Object.keys(this.attachments).filter(t=>!this.attachments[t]).forEach(t=>{delete this.attachments[t]})}checkStatus(){const{gl:t}=this,e=this.getStatus();if(36053!==e)throw new Error(function(t){return(f.STATUS||{})[t]||"Framebuffer error ".concat(t)}(e));return this}getStatus(){const{gl:t}=this,e=t.bindFramebuffer(36160,this.handle),n=t.checkFramebufferStatus(36160);return t.bindFramebuffer(36160,e||null),n}clear(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{color:e,depth:n,stencil:r,drawBuffers:i=[]}=t,o=this.gl.bindFramebuffer(36160,this.handle);return(e||n||r)&&Object(s.a)(this.gl,{color:e,depth:n,stencil:r}),i.forEach((t,e)=>{Object(s.b)(this.gl,{drawBuffer:e,value:t})}),this.gl.bindFramebuffer(36160,o||null),this}readPixels(){return r.k.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}readPixelsToBuffer(){return r.k.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}copyToDataUrl(){return r.k.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}copyToImage(){return r.k.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}copyToTexture(){return r.k.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}blit(){return r.k.error("Framebuffer.blit({...}) is no logner supported, use blit(source, target, opts)")(),null}invalidate(t){let{attachments:e=[],x:n=0,y:i=0,width:o,height:a}=t;const s=Object(r.a)(this.gl),u=s.bindFramebuffer(36008,this.handle);return 0===n&&0===i&&void 0===o&&void 0===a?s.invalidateFramebuffer(36008,e):s.invalidateFramebuffer(36008,e,n,i,o,a),s.bindFramebuffer(36008,u),this}getAttachmentParameter(t,e,n){let 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=Object(l.a)(this.gl,r)),r}getAttachmentParameters(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:36064,e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.constructor.ATTACHMENT_PARAMETERS||[];const r={};for(const i of n){r[e?Object(l.a)(this.gl,i):i]=this.getAttachmentParameter(t,i,e)}return r}getParameters(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const e=Object.keys(this.attachments),n={};for(const r of e){const e=Number(r);n[t?Object(l.a)(this.gl,e):e]=this.getAttachmentParameters(e,t)}return n}show(){return"undefined"!=typeof window&&window.open(Object(u.a)(this),"luma-debug-texture"),this}log(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(t>r.k.level||"undefined"==typeof window)return this;e=e||"Framebuffer ".concat(this.id);const n=Object(u.a)(this,{targetMaxHeight:100});return r.k.image({logLevel:t,message:e,image:n},e)(),this}bind(){let{target:t=36160}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.gl.bindFramebuffer(t,this.handle),this}unbind(){let{target:t=36160}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.gl.bindFramebuffer(t,null),this}_createDefaultAttachments(t,e,n,r,i){let s=null;return t&&(s=s||{},s[36064]=new o.a(this.gl,{id:"".concat(this.id,"-color0"),pixels:null,format:6408,type:5121,width:r,height:i,mipmaps:!1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.ownResources.push(s[36064])),e&&n?(s=s||{},s[33306]=new a.a(this.gl,{id:"".concat(this.id,"-depth-stencil"),format:35056,width:r,height:111}),this.ownResources.push(s[33306])):e?(s=s||{},s[36096]=new a.a(this.gl,{id:"".concat(this.id,"-depth"),format:33189,width:r,height:i}),this.ownResources.push(s[36096])):n&&Object(h.a)(!1),s}_unattach(t){const e=this.attachments[t];e&&(e instanceof a.a?this.gl.framebufferRenderbuffer(36160,t,36161,null):this.gl.framebufferTexture2D(36160,t,3553,null,0),delete this.attachments[t])}_attachRenderbuffer(t){let{attachment:e=36064,renderbuffer:n}=t;const{gl:r}=this;r.framebufferRenderbuffer(36160,e,36161,n.handle),this.attachments[e]=n}_attachTexture(t){let{attachment:e=36064,texture:n,layer:i,level:o}=t;const{gl:a}=this;switch(a.bindTexture(n.target,n.handle),n.target){case 35866:case 32879:Object(r.a)(a).framebufferTextureLayer(36160,e,n.target,o,i);break;case 34067:const t=function(t){return t<34069?t+34069:t}(i);a.framebufferTexture2D(36160,e,t,n.handle,o);break;case 3553:a.framebufferTexture2D(36160,e,3553,n.handle,o);break;default:Object(h.a)(!1,"Illegal texture type")}a.bindTexture(n.target,null),this.attachments[e]=n}_setReadBuffer(t){const e=Object(r.g)(this.gl);e?e.readBuffer(t):Object(h.a)(36064===t||1029===t,"Multiple render targets not supported"),this.readBuffer=t}_setDrawBuffers(t){const{gl:e}=this,n=Object(r.a)(e);if(n)n.drawBuffers(t);else{const n=e.getExtension("WEBGL_draw_buffers");n?n.drawBuffersWEBGL(t):Object(h.a)(1===t.length&&(36064===t[0]||1029===t[0]),"Multiple render targets not supported")}this.drawBuffers=t}_getAttachmentParameterFallback(t){const e=Object(c.a)(this.gl);switch(t){case 36052:return e.WEBGL2?null:0;case 33298:case 33299:case 33300:case 33301:case 33302:case 33303:return e.WEBGL2?null:8;case 33297:return e.WEBGL2?null:5125;case 33296:return e.WEBGL2||e.EXT_sRGB?null:9729;default:return null}}_createHandle(){return this.gl.createFramebuffer()}_deleteHandle(){this.gl.deleteFramebuffer(this.handle)}_bindHandle(t){return this.gl.bindFramebuffer(36160,t)}}f.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303]},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(3),i=n.n(r),o=n(4),a=n.n(o),s=function(){function t(e){i()(this,t),this._inProgress=!1,this._handle=null,this._timeline=e,this.time=0,this.settings={duration:0}}return a()(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}()},function(t,e,n){"use strict";var r=n(1),i=n(130);class o{constructor(t,e){Object(r.a)(this,"name",void 0),Object(r.a)(this,"type",void 0),Object(r.a)(this,"sampleSize",1),Object(r.a)(this,"time",void 0),Object(r.a)(this,"count",void 0),Object(r.a)(this,"samples",void 0),Object(r.a)(this,"lastTiming",void 0),Object(r.a)(this,"lastSampleTime",void 0),Object(r.a)(this,"lastSampleCount",void 0),Object(r.a)(this,"_count",0),Object(r.a)(this,"_time",0),Object(r.a)(this,"_samples",0),Object(r.a)(this,"_startTime",0),Object(r.a)(this,"_timerPending",!1),this.name=t,this.type=e,this.reset()}setSampleSize(t){return this.sampleSize=t,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(t){return this._count+=t,this._samples++,this._checkSampling(),this}subtractCount(t){return this._count-=t,this._samples++,this._checkSampling(),this}addTime(t){return this._time+=t,this.lastTiming=t,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=Object(i.a)(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(Object(i.a)()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}}class a{constructor(t){Object(r.a)(this,"id",void 0),Object(r.a)(this,"stats",{}),this.id=t.id,this.stats={},this._initializeStats(t.stats),Object.seal(this)}get(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"count";return this._getOrCreate({name:t,type:e})}get size(){return Object.keys(this.stats).length}reset(){for(const t in this.stats)this.stats[t].reset();return this}forEach(t){for(const e in this.stats)t(this.stats[e])}getTable(){const t={};return this.forEach(e=>{t[e.name]={time:e.time||0,count:e.count||0,average:e.getAverageTime()||0,hz:e.getHz()||0}}),t}_initializeStats(){(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach(t=>this._getOrCreate(t))}_getOrCreate(t){if(!t||!t.name)return null;const{name:e,type:n}=t;return this.stats[e]||(this.stats[e]=t instanceof o?t:new o(e,n)),this.stats[e]}}n.d(e,"a",(function(){return a}))},function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return i}));const r="vs",i="fs"},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var r,i=n(169),o=n(22),a=n(53),s=n(25),u=n(33),c=n(24),l=n(35);!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={}));const h=45*Math.PI/180,f=1,p=.1,d=500,A=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);class g extends i.a{static get IDENTITY(){return function(){y||(y=new g,Object.freeze(y));return y}()}static get ZERO(){return function(){m||(m=new g([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(m));return m}()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return r}constructor(t){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(t)?this.copy(t):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this[9]=t[9],this[10]=t[10],this[11]=t[11],this[12]=t[12],this[13]=t[13],this[14]=t[14],this[15]=t[15],this.check()}set(t,e,n,r,i,o,a,s,u,c,l,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]=c,this[10]=l,this[11]=h,this[12]=f,this[13]=p,this[14]=d,this[15]=A,this.check()}setRowMajor(t,e,n,r,i,o,a,s,u,c,l,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]=c,this[7]=p,this[8]=n,this[9]=a,this[10]=l,this[11]=d,this[12]=r,this[13]=s,this[14]=h,this[15]=A,this.check()}toRowMajor(t){return t[0]=this[0],t[1]=this[4],t[2]=this[8],t[3]=this[12],t[4]=this[1],t[5]=this[5],t[6]=this[9],t[7]=this[13],t[8]=this[2],t[9]=this[6],t[10]=this[10],t[11]=this[14],t[12]=this[3],t[13]=this[7],t[14]=this[11],t[15]=this[15],t}identity(){return this.copy(A)}fromObject(t){return this.check()}fromQuaternion(t){return s.c(this,t),this.check()}frustum(t){const{left:e,right:n,bottom:r,top:i,near:o=p,far:a=d}=t;return a===1/0?function(t,e,n,r,i,o){const a=2*o/(n-e),s=2*o/(i-r),u=(n+e)/(n-e),c=(i+r)/(i-r),l=-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]=c,t[10]=-1,t[11]=-1,t[12]=0,t[13]=0,t[14]=l,t[15]=0}(this,e,n,r,i,o):s.d(this,e,n,r,i,o,a),this.check()}lookAt(t){const{eye:e,center:n=[0,0,0],up:r=[0,1,0]}=t;return s.g(this,e,n,r),this.check()}ortho(t){const{left:e,right:n,bottom:r,top:i,near:o=p,far:a=d}=t;return s.i(this,e,n,r,i,o,a),this.check()}orthographic(t){const{fovy:e=h,aspect:n=f,focalDistance:r=1,near:i=p,far:o=d}=t;v(e);const a=e/2,s=r*Math.tan(a),u=s*n;return this.ortho({left:-u,right:u,bottom:-s,top:s,near:i,far:o})}perspective(t){const{fovy:e=45*Math.PI/180,aspect:n=1,near:r=.1,far:i=500}=t;return v(e),s.j(this,e,n,r,i),this.check()}determinant(){return s.a(this)}getScale(t=[-0,-0,-0]){return t[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),t[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),t[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),t}getTranslation(t=[-0,-0,-0]){return t[0]=this[12],t[1]=this[13],t[2]=this[14],t}getRotation(t,e){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],e=e||[-0,-0,-0];const n=this.getScale(e),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}getRotationMatrix3(t,e){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0],e=e||[-0,-0,-0];const 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}transpose(){return s.q(this,this),this.check()}invert(){return s.f(this,this),this.check()}multiplyLeft(t){return s.h(this,t,this),this.check()}multiplyRight(t){return s.h(this,this,t),this.check()}rotateX(t){return s.l(this,this,t),this.check()}rotateY(t){return s.m(this,this,t),this.check()}rotateZ(t){return s.n(this,this,t),this.check()}rotateXYZ(t){return this.rotateX(t[0]).rotateY(t[1]).rotateZ(t[2])}rotateAxis(t,e){return s.k(this,this,t,e),this.check()}scale(t){return s.o(this,this,Array.isArray(t)?t:[t,t,t]),this.check()}translate(t){return s.p(this,this,t),this.check()}transform(t,e){return 4===t.length?(e=l.n(e||[-0,-0,-0,-0],t,this),Object(o.b)(e,4),e):this.transformAsPoint(t,e)}transformAsPoint(t,e){const{length:n}=t;let r;switch(n){case 2:r=u.j(e||[-0,-0],t,this);break;case 3:r=c.p(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Object(o.b)(r,t.length),r}transformAsVector(t,e){let n;switch(t.length){case 2:n=Object(a.a)(e||[-0,-0],t,this);break;case 3:n=Object(a.c)(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Object(o.b)(n,t.length),n}transformPoint(t,e){return this.transformAsPoint(t,e)}transformVector(t,e){return this.transformAsPoint(t,e)}transformDirection(t,e){return this.transformAsVector(t,e)}makeRotationX(t){return this.identity().rotateX(t)}makeTranslation(t,e,n){return this.identity().translate([t,e,n])}}let m,y;function v(t){if(t>2*Math.PI)throw Error("expected radians")}},function(t,e,n){"use strict";var r=n(19),i=n(83),o=n(43);const a=new(n(273).a)({id:"loaders.gl"});var s=n(60),u=n(107),c=n(21);n.d(e,"a",(function(){return h})),n.d(e,"b",(function(){return f}));const l=/\.([^.]+)$/;async function h(t,e=[],n,r){if(!p(t))return null;let i=f(t,e,{...n,nothrow:!0},r);if(i)return i;if(Object(c.b)(t)&&(i=f(t=await t.slice(0,10).arrayBuffer(),e,n,r)),!(i||null!=n&&n.nothrow))throw new Error(d(t));return i}function f(t,e=[],n,r){if(!p(t))return null;if(e&&!Array.isArray(e))return Object(o.b)(e);let i=[];e&&(i=i.concat(e)),null!=n&&n.ignoreRegisteredLoaders||i.push(...Object(u.b)()),function(t){for(const e of t)Object(o.b)(e)}(i);const c=function(t,e,n,r){const{url:i,type:o}=Object(s.b)(t),u=i||(null==r?void 0:r.url);let c=null,h="";null!=n&&n.mimeType&&(c=A(e,null==n?void 0:n.mimeType),h="match forced by supplied MIME type ".concat(null==n?void 0:n.mimeType));var f;c=c||function(t,e){const n=e&&l.exec(e),r=n&&n[1];return r?function(t,e){e=e.toLowerCase();for(const n of t)for(const t of n.extensions)if(t.toLowerCase()===e)return n;return null}(t,r):null}(e,u),h=h||(c?"matched url ".concat(u):""),c=c||A(e,o),h=h||(c?"matched MIME type ".concat(o):""),c=c||function(t,e){if(!e)return null;for(const n of t)if("string"==typeof e){if(g(e,n))return n}else if(ArrayBuffer.isView(e)){if(m(e.buffer,e.byteOffset,n))return n}else if(e instanceof ArrayBuffer){if(m(e,0,n))return n}return null}(e,t),h=h||(c?"matched initial data ".concat(y(t)):""),c=c||A(e,null==n?void 0:n.fallbackMimeType),h=h||(c?"matched fallback MIME type ".concat(o):""),h&&a.log(1,"selectLoader selected ".concat(null===(f=c)||void 0===f?void 0:f.name,": ").concat(h,"."));return c}(t,i,n,r);if(!(c||null!=n&&n.nothrow))throw new Error(d(t));return c}function p(t){return!(t instanceof Response&&204===t.status)}function d(t){const{url:e,type:n}=Object(s.b)(t);let i="No valid loader found (";i+=e?"".concat(r.b.filename(e),", "):"no url provided, ",i+="MIME type: ".concat(n?'"'.concat(n,'"'):"not provided",", ");const o=t?y(t):"";return i+=o?' first bytes: "'.concat(o,'"'):"first bytes: not available",i+=")",i}function A(t,e){for(const n of t){if(n.mimeTypes&&n.mimeTypes.includes(e))return n;if(e==="application/x.".concat(n.id))return n}return null}function g(t,e){if(e.testText)return e.testText(t);return(Array.isArray(e.tests)?e.tests:[e.tests]).some(e=>t.startsWith(e))}function m(t,e,n){return(Array.isArray(n.tests)?n.tests:[n.tests]).some(r=>function(t,e,n,r){if(r instanceof ArrayBuffer)return Object(i.a)(r,t,r.byteLength);switch(typeof r){case"function":return r(t,n);case"string":const i=v(t,e,r.length);return r===i;default:return!1}}(t,e,n,r))}function y(t,e=5){if("string"==typeof t)return t.slice(0,e);if(ArrayBuffer.isView(t))return v(t.buffer,t.byteOffset,e);if(t instanceof ArrayBuffer){return v(t,0,e)}return""}function v(t,e,n){if(t.byteLength<e+n)return"";const r=new DataView(t);let i="";for(let t=0;t<n;t++)i+=String.fromCharCode(r.getUint8(e+t));return i}},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,"a",(function(){return i}))},function(t,e,n){"use strict";n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return a})),n.d(e,"b",(function(){return s}));var r=n(10);const i={5126:[5126,1,"float"],35664:[5126,2,"vec2"],35665:[5126,3,"vec3"],35666:[5126,4,"vec4"],5124:[5124,1,"int"],35667:[5124,2,"ivec2"],35668:[5124,3,"ivec3"],35669:[5124,4,"ivec4"],5125:[5125,1,"uint"],36294:[5125,2,"uvec2"],36295:[5125,3,"uvec3"],36296:[5125,4,"uvec4"],35670:[5126,1,"bool"],35671:[5126,2,"bvec2"],35672:[5126,3,"bvec3"],35673:[5126,4,"bvec4"],35674:[5126,8,"mat2"],35685:[5126,8,"mat2x3"],35686:[5126,8,"mat2x4"],35675:[5126,12,"mat3"],35687:[5126,12,"mat3x2"],35688:[5126,12,"mat3x4"],35676:[5126,16,"mat4"],35689:[5126,16,"mat4x2"],35690:[5126,16,"mat4x3"]};function o(t){switch(t){case 0:return 0;case 1:case 3:case 2:return 1;case 4:case 5:case 6:return 4;default:return Object(r.a)(!1),0}}function a(t){const e=i[t];if(!e)return null;const[n,r]=e;return{type:n,components:r}}function s(t,e){switch(t){case 5120:case 5121:case 5122:case 5123:t=5126}for(const n in i){const[r,o,a]=i[n];if(r===t&&o===e)return{glType:n,name:a}}return null}},function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"a",(function(){return o})),n.d(e,"c",(function(){return a})),n.d(e,"d",(function(){return s})),n.d(e,"e",(function(){return u}));var r=n(8);const i={6407:{dataFormat:6407,types:[5121,33635]},6408:{dataFormat:6408,types:[5121,32819,32820]},6406:{dataFormat:6406,types:[5121]},6409:{dataFormat:6409,types:[5121]},6410:{dataFormat:6410,types:[5121]},33326:{dataFormat:6403,types:[5126],gl2:!0},33328:{dataFormat:33319,types:[5126],gl2:!0},34837:{dataFormat:6407,types:[5126],gl2:!0},34836:{dataFormat:6408,types:[5126],gl2:!0}},o={6403:1,36244:1,33319:2,33320:2,6407:3,36248:3,6408:4,36249:4,6402:1,34041:1,6406:1,6409:1,6410:2},a={5126:4,5125:4,5124:4,5123:2,5122:2,5131:2,5120:1,5121:1};function s(t,e){const n=i[e];if(!n)return!1;if(void 0===n.gl1&&void 0===n.gl2)return!0;const o=Object(r.j)(t)&&n.gl2||n.gl1;return"string"==typeof o?t.getExtension(o):o}function u(t,e){const n=i[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}}},function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"d",(function(){return s})),n.d(e,"a",(function(){return u})),n.d(e,"c",(function(){return c}));var r=n(15);function i(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}var o,a,s=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t},u=function(t){var e=t[0],n=t[1],r=t[2];return Math.hypot(e,n,r)},c=function(t){var e=t[0],n=t[1],r=t[2];return e*e+n*n+r*r};o=new r.a(3),r.a!=Float32Array&&(o[0]=0,o[1]=0,o[2]=0),a=o},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var r=n(114),i=n(13),o=n(22),a=n(24),s=n(53);const u=[0,0,0];let c;class l extends r.a{static get ZERO(){return c||(c=new l(0,0,0),Object.freeze(c)),c}constructor(t=0,e=0,n=0){super(-0,-0,-0),1===arguments.length&&Object(i.f)(t)?this.copy(t):(i.b.debug&&(Object(o.a)(t),Object(o.a)(e),Object(o.a)(n)),this[0]=t,this[1]=e,this[2]=n)}set(t,e,n){return this[0]=t,this[1]=e,this[2]=n,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this.check()}fromObject(t){return i.b.debug&&(Object(o.a)(t.x),Object(o.a)(t.y),Object(o.a)(t.z)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t}get ELEMENTS(){return 3}get z(){return this[2]}set z(t){this[2]=Object(o.a)(t)}angle(t){return a.b(this,t)}cross(t){return a.d(this,this,t),this.check()}rotateX({radians:t,origin:e=u}){return a.l(this,this,e,t),this.check()}rotateY({radians:t,origin:e=u}){return a.m(this,this,e,t),this.check()}rotateZ({radians:t,origin:e=u}){return a.n(this,this,e,t),this.check()}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return a.p(this,this,t),this.check()}transformAsVector(t){return Object(s.c)(this,this,t),this.check()}transformByMatrix3(t){return a.o(this,this,t),this.check()}transformByMatrix2(t){return Object(s.b)(this,this,t),this.check()}transformByQuaternion(t){return a.q(this,this,t),this.check()}}},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";n.d(e,"d",(function(){return i})),n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return s}));var r=n(96);function i(t){if(Object(r.b)(t))return Object(r.a)(t);if(t instanceof ArrayBuffer)return t;if(ArrayBuffer.isView(t))return 0===t.byteOffset&&t.byteLength===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);if("string"==typeof t){const e=t;return(new TextEncoder).encode(e).buffer}if(t&&"object"==typeof t&&t._toArrayBuffer)return t._toArrayBuffer();throw new Error("toArrayBuffer")}function o(t,e,n){if(n=n||t.byteLength,t.byteLength<n||e.byteLength<n)return!1;const r=new Uint8Array(t),i=new Uint8Array(e);for(let t=0;t<r.length;++t)if(r[t]!==i[t])return!1;return!0}function a(...t){const e=t.map(t=>t instanceof ArrayBuffer?new Uint8Array(t):t),n=e.reduce((t,e)=>t+e.byteLength,0),r=new Uint8Array(n);let i=0;for(const t of e)r.set(t,i),i+=t.byteLength;return r.buffer}function s(t,e,n){const r=void 0!==n?new Uint8Array(t).subarray(e,e+n):new Uint8Array(t).subarray(e);return new Uint8Array(r).buffer}},function(t,e,n){"use strict";n.d(e,"a",(function(){return P}));var r=n(9),i=n.n(r),o=n(3),a=n.n(o),s=n(4),u=n.n(s),c=n(26),l=n.n(c),h=n(7),f=n.n(h),p=n(5),d=n.n(p),A=n(6),g=n.n(A),m=n(2),y=n.n(m),v=n(0),_=n.n(v),b=n(41),x=n(18),w=n(88),E=n(13),O=n(75);function S(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(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?S(Object(n),!0).forEach((function(e){_()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):S(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function C(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=y()(t);if(e){var i=y()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return g()(this,n)}}var P=function(t){d()(n,t);var e=C(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};a()(this,n);var i,o=r.latitude,s=void 0===o?0:o,u=r.longitude,c=void 0===u?0:u,h=r.zoom,f=void 0===h?0:h,p=r.pitch,d=void 0===p?0:p,A=r.bearing,g=void 0===A?0:A,m=r.nearZMultiplier,y=void 0===m?.1:m,v=r.farZMultiplier,_=void 0===v?1.01:v,b=r.orthographic,w=void 0!==b&&b,S=r.projectionMatrix,C=r.repeat,P=void 0!==C&&C,M=r.worldOffset,I=void 0===M?0:M,B=r.position,R=r.padding,k=r.legacyMeterSizes,L=void 0!==k&&k,D=r.width,j=r.height,F=r.altitude,z=void 0===F?1.5:F,U=Math.pow(2,f);D=D||1,j=j||1;var N=null;if(S)z=S[5]/2,i=Object(x.b)(z);else{var G;if(r.fovy?(i=r.fovy,z=Object(x.e)(i)):i=Object(x.b)(z),R){var V=R.top,H=void 0===V?0:V,W=R.bottom,q=void 0===W?0:W;G=[0,Object(E.a)((H+j-q)/2,0,j)-j/2]}N=Object(x.j)({width:D,height:j,scale:U,center:B&&[0,0,B[2]*Object(x.o)(s)],offset:G,pitch:d,fovy:i,nearZMultiplier:y,farZMultiplier:_})}var X=Object(x.k)({height:j,pitch:d,bearing:g,scale:U,altitude:z});if(I){var J=(new O.a).translate([512*I,0,0]);X=J.multiplyLeft(X)}return(t=e.call(this,T(T(T({},r),{},{width:D,height:j,viewMatrix:X,longitude:c,latitude:s,zoom:f},N),{},{fovy:i,focalDistance:z}))).latitude=s,t.longitude=c,t.zoom=f,t.pitch=d,t.bearing=g,t.altitude=z,t.fovy=i,t.orthographic=w,t._subViewports=P?[]:null,t._pseudoMeters=L,Object.freeze(l()(t)),t}return u()(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),i=e;i<=r;i++){var o=i?new n(T(T({},this),{},{worldOffset:i})):this;this._subViewports.push(o)}return this._subViewports}},{key:"projectPosition",value:function(t){if(this._pseudoMeters)return f()(y()(n.prototype),"projectPosition",this).call(this,t);var e=this.projectFlat(t),r=i()(e,2);return[r[0],r[1],(t[2]||0)*Object(x.o)(t[1])]}},{key:"unprojectPosition",value:function(t){if(this._pseudoMeters)return f()(y()(n.prototype),"unprojectPosition",this).call(this,t);var e=this.unprojectFlat(t),r=i()(e,2),o=r[0],a=r[1];return[o,a,(t[2]||0)/Object(x.o)(a)]}},{key:"addMetersToLngLat",value:function(t,e){return Object(x.a)(t,e)}},{key:"panByPosition",value:function(t,e){var n=Object(x.n)(e,this.pixelUnprojectionMatrix),r=this.projectFlat(t),o=w.a([],r,w.b([],n)),a=w.a([],this.center,o),s=this.unprojectFlat(a),u=i()(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=Object(x.f)(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,i=this.height,o=Object(x.c)(T({width:r,height:i,bounds:t},e)),a=o.longitude,s=o.latitude,u=o.zoom;return new n({width:r,height:i,longitude:a,latitude:s,zoom:u})}}]),n}(b.a);_()(P,"displayName","WebMercatorViewport")},function(t,e,n){"use strict";n.r(e);var r=n(0),i=n.n(r);function o(t,e){if(!t)throw new Error("null row");if(!e)throw new Error("no headers");const n={};for(let r=0;r<e.length;r++)n[e[r]]=t[r];return n}function a(t,e){if(!t)throw new Error("null row");if(!e)throw new Error("no headers");const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=t[e[r]];return n}var s=n(1);let u;class c extends Array{enqueue(t){return this.push(t)}dequeue(){return this.shift()}}u=Symbol.asyncIterator;class l{constructor(){Object(s.a)(this,"_values",void 0),Object(s.a)(this,"_settlers",void 0),Object(s.a)(this,"_closed",void 0),this._values=new c,this._settlers=new c,this._closed=!1}close(){for(;this._settlers.length>0;)this._settlers.dequeue().resolve({done:!0});this._closed=!0}[u](){return this}enqueue(t){if(this._closed)throw new Error("Closed");if(this._settlers.length>0){if(this._values.length>0)throw new Error("Illegal internal state");const e=this._settlers.dequeue();t instanceof Error?e.reject(t):e.resolve({value:t})}else this._values.enqueue(t)}next(){if(this._values.length>0){const t=this._values.dequeue();return t instanceof Error?Promise.reject(t):Promise.resolve({value:t})}if(this._closed){if(this._settlers.length>0)throw new Error("Illegal internal state");return Promise.resolve({done:!0})}return new Promise((t,e)=>{this._settlers.enqueue({resolve:t,reject:e})})}}class h{constructor(t,e){if(Object(s.a)(this,"schema",void 0),Object(s.a)(this,"options",void 0),Object(s.a)(this,"length",0),Object(s.a)(this,"rows",null),Object(s.a)(this,"cursor",0),Object(s.a)(this,"_headers",[]),this.options=e,this.schema=t,!Array.isArray(t)){this._headers=[];for(const e in t)this._headers[t[e].index]=t[e].name}}rowCount(){return this.length}addArrayRow(t,e){Number.isFinite(e)&&(this.cursor=e),this.rows=this.rows||new Array(100),this.rows[this.length]=t,this.length++}addObjectRow(t,e){Number.isFinite(e)&&(this.cursor=e),this.rows=this.rows||new Array(100),this.rows[this.length]=t,this.length++}getBatch(){let t=this.rows;if(!t)return null;t=t.slice(0,this.length),this.rows=null;return{shape:this.options.shape,batchType:"data",data:t,length:this.length,schema:this.schema,cursor:this.cursor}}}class f{constructor(t,e){if(Object(s.a)(this,"schema",void 0),Object(s.a)(this,"options",void 0),Object(s.a)(this,"length",0),Object(s.a)(this,"objectRows",null),Object(s.a)(this,"arrayRows",null),Object(s.a)(this,"cursor",0),Object(s.a)(this,"_headers",[]),this.options=e,this.schema=t,!Array.isArray(t)){this._headers=[];for(const e in t)this._headers[t[e].index]=t[e].name}}rowCount(){return this.length}addArrayRow(t,e){switch(Number.isFinite(e)&&(this.cursor=e),this.options.shape){case"object-row-table":const n=o(t,this._headers);this.addObjectRow(n,e);break;case"array-row-table":this.arrayRows=this.arrayRows||new Array(100),this.arrayRows[this.length]=t,this.length++}}addObjectRow(t,e){switch(Number.isFinite(e)&&(this.cursor=e),this.options.shape){case"array-row-table":const n=a(t,this._headers);this.addArrayRow(n,e);break;case"object-row-table":this.objectRows=this.objectRows||new Array(100),this.objectRows[this.length]=t,this.length++}}getBatch(){let t=this.arrayRows||this.objectRows;return t?(t=t.slice(0,this.length),this.arrayRows=null,this.objectRows=null,{shape:this.options.shape,batchType:"data",data:t,length:this.length,schema:this.schema,cursor:this.cursor}):null}}class p{constructor(t,e){Object(s.a)(this,"schema",void 0),Object(s.a)(this,"length",0),Object(s.a)(this,"allocated",0),Object(s.a)(this,"columns",{}),this.schema=t,this._reallocateColumns()}rowCount(){return this.length}addArrayRow(t){this._reallocateColumns();let e=0;for(const n in this.columns)this.columns[n][this.length]=t[e++];this.length++}addObjectRow(t){this._reallocateColumns();for(const e in t)this.columns[e][this.length]=t[e];this.length++}getBatch(){this._pruneColumns();const t=Array.isArray(this.schema)?this.columns:{};if(!Array.isArray(this.schema))for(const e in this.schema){const n=this.schema[e];t[n.name]=this.columns[n.index]}this.columns={};return{shape:"columnar-table",batchType:"data",data:t,schema:this.schema,length:this.length}}_reallocateColumns(){if(!(this.length<this.allocated)){this.allocated=this.allocated>0?this.allocated*=2:100,this.columns={};for(const t in this.schema){const e=this.schema[t],n=e.type||Float32Array,r=this.columns[e.index];if(r&&ArrayBuffer.isView(r)){const t=new n(this.allocated);t.set(r),this.columns[e.index]=t}else r?(r.length=this.allocated,this.columns[e.index]=r):this.columns[e.index]=new n(this.allocated)}}}_pruneColumns(){for(const[t,e]of Object.entries(this.columns))this.columns[t]=e.slice(0,this.length)}}const d={shape:"array-row-table",batchSize:"auto",batchDebounceMs:0,limit:0,_limitMB:0};class A{constructor(t,e){Object(s.a)(this,"schema",void 0),Object(s.a)(this,"options",void 0),Object(s.a)(this,"aggregator",null),Object(s.a)(this,"batchCount",0),Object(s.a)(this,"bytesUsed",0),Object(s.a)(this,"isChunkComplete",!1),Object(s.a)(this,"lastBatchEmittedMs",Date.now()),Object(s.a)(this,"totalLength",0),Object(s.a)(this,"totalBytes",0),Object(s.a)(this,"rowBytes",0),this.schema=t,this.options={...d,...e}}limitReached(){var t,e;return!!(Boolean(null===(t=this.options)||void 0===t?void 0:t.limit)&&this.totalLength>=this.options.limit)||!!(Boolean(null===(e=this.options)||void 0===e?void 0:e._limitMB)&&this.totalBytes/1e6>=this.options._limitMB)}addRow(t){this.limitReached()||(this.totalLength++,this.rowBytes=this.rowBytes||this._estimateRowMB(t),this.totalBytes+=this.rowBytes,Array.isArray(t)?this.addArrayRow(t):this.addObjectRow(t))}addArrayRow(t){if(!this.aggregator){const t=this._getTableBatchType();this.aggregator=new t(this.schema,this.options)}this.aggregator.addArrayRow(t)}addObjectRow(t){if(!this.aggregator){const t=this._getTableBatchType();this.aggregator=new t(this.schema,this.options)}this.aggregator.addObjectRow(t)}chunkComplete(t){t instanceof ArrayBuffer&&(this.bytesUsed+=t.byteLength),"string"==typeof t&&(this.bytesUsed+=t.length),this.isChunkComplete=!0}getFullBatch(t){return this._isFull()?this._getBatch(t):null}getFinalBatch(t){return this._getBatch(t)}_estimateRowMB(t){return Array.isArray(t)?8*t.length:8*Object.keys(t).length}_isFull(){if(!this.aggregator||0===this.aggregator.rowCount())return!1;if("auto"===this.options.batchSize){if(!this.isChunkComplete)return!1}else if(this.options.batchSize>this.aggregator.rowCount())return!1;return!(this.options.batchDebounceMs>Date.now()-this.lastBatchEmittedMs)&&(this.isChunkComplete=!1,this.lastBatchEmittedMs=Date.now(),!0)}_getBatch(t){if(!this.aggregator)return null;null!=t&&t.bytesUsed&&(this.bytesUsed=t.bytesUsed);const e=this.aggregator.getBatch();return e.count=this.batchCount,e.bytesUsed=this.bytesUsed,Object.assign(e,t),this.batchCount++,this.aggregator=null,e}_getTableBatchType(){switch(this.options.shape){case"row-table":return h;case"array-row-table":case"object-row-table":return f;case"columnar-table":return p;case"arrow-table":if(!A.ArrowBatch)throw new Error("TableBatchBuilder");return A.ArrowBatch;default:throw new Error("TableBatchBuilder")}}}Object(s.a)(A,"ArrowBatch",void 0);
/* @license
Papa Parse
v5.0.0-beta.0
https://github.com/mholt/PapaParse
License: MIT
*/
const g={parse:function(t,e,n){var r=(e=e||{}).dynamicTyping||!1;E(r)&&(e.dynamicTypingFunction=r,r={});if(e.dynamicTyping=r,e.transform=!!E(e.transform)&&e.transform,e.worker&&g.WORKERS_SUPPORTED){var i=newWorker();return i.userStep=e.step,i.userChunk=e.chunk,i.userComplete=e.complete,i.userError=e.error,e.step=E(e.step),e.chunk=E(e.chunk),e.complete=E(e.complete),e.error=E(e.error),delete e.worker,void i.postMessage({input:t,config:e,workerId:i.id})}var o=null;"string"==typeof t&&(o=new v(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,c=null;!function(){if("object"!=typeof e)return;"string"!=typeof e.delimiter||g.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");c=e.columns}void 0!==e.escapeChar&&(s=e.escapeChar+a)}();var l=new RegExp(b(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(c||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 c=0;c<t.length;c++)c>0&&(a+=i),a+=p(t[c],c);e.length>0&&(a+=o)}for(var l=0;l<e.length;l++){var h=s?t.length:e[l].length,f=!1,d=s?0===Object.keys(e[l]).length:0===e[l].length;if(n&&!s&&(f="greedy"===n?""===e[l].join("").trim():1===e[l].length&&0===e[l][0].length),"greedy"===n&&s){for(var A=[],g=0;g<h;g++){var m=u?t[g]:g;A.push(e[l][m])}f=""===A.join("").trim()}if(!f){for(var y=0;y<h;y++){y>0&&!d&&(a+=i);var v=s&&u?t[y]:y;a+=p(e[l][v],y)}l<e.length-1&&(!n||h>0&&!d)&&(a+=o)}}return a}function p(t,e){return null==t?"":t.constructor===Date?JSON.stringify(t).slice(1,25):(t=t.toString().replace(l,s),"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,g.BAD_DELIMITERS)||t.indexOf(i)>-1||" "===t.charAt(0)||" "===t.charAt(t.length-1)?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:x,ParserHandle:_,ChunkStreamer:y,StringStreamer:v};var m=g;function y(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=w(t);e.chunkSize=parseInt(e.chunkSize),t.step||t.chunk||(e.chunkSize=null);this._handle=new _(e),this._handle.streamer=this,this._config=e}.call(this,t),this.parseChunk=function(t,e){if(this.isFirstChunk&&E(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(E(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||!E(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){E(this._config.error)&&this._config.error(t)}}function v(t){var e;t=t||{},y.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 _(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,c=!1,l=!1,h=[],f={data:[],errors:[],meta:{}};if(E(t.step)){var p=t.step;t.step=function(e){if(f=e,m())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&&(v("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+g.DefaultDelimiter+"'"),r=!1),t.skipEmptyLines)for(var e=0;e<f.data.length;e++)d(f.data[e])&&f.data.splice(e--,1);return m()&&function(){if(!f)return;function e(e){E(t.transformHeader)&&(e=t.transformHeader(e)),h.push(e)}if(Array.isArray(f.data[0])){for(var n=0;m()&&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=y(o,a),"__parsed_extra"===o?(i[o]=i[o]||[],i[o].push(a)):i[o]=a}return t.header&&(r>h.length?v("FieldMismatch","TooManyFields","Too many fields: expected "+h.length+" fields but parsed "+r,u+n):r<h.length&&v("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 m(){return t.header&&0===h.length}function y(e,n){return function(e){return t.dynamicTypingFunction&&void 0===t.dynamicTyping[e]&&(t.dynamicTyping[e]=t.dynamicTypingFunction(e)),!0===(t.dynamicTyping[e]||t.dynamicTyping)}(e)?"true"===n||"TRUE"===n||"false"!==n&&"FALSE"!==n&&(i.test(n)?parseFloat(n):o.test(n)?new Date(n):""===n?null:n):n}function v(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(b(e)+"([^]*?)"+b(e),"gm"),r=(t=t.replace(n,"")).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)E(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","|",";",g.RECORD_SEP,g.UNIT_SEP];for(var c=0;c<o.length;c++){var l=o[c],h=0,f=0,p=0;u=void 0;for(var A=new x({comments:i,delimiter:l,newline:n,preview:10}).parse(e),m=0;m<A.data.length;m++)if(r&&d(A.data[m]))p++;else{var y=A.data[m].length;f+=y,void 0!==u?y>1&&(h+=Math.abs(y-u),u=y):u=0}A.data.length>0&&(f/=A.data.length-p),(void 0===s||h>s)&&f>1.99&&(s=h,a=l)}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=g.DefaultDelimiter),f.meta.delimiter=t.delimiter}var l=w(t);return t.preview&&t.header&&l.preview++,e=i,n=new x(l),f=n.parse(e,o,a),A(),c?{meta:{paused:!0}}:f||{meta:{paused:!1}}},this.paused=function(){return c},this.pause=function(){c=!0,n.abort(),e=e.substr(n.getCharIndex())},this.resume=function(){c=!1,a.streamer.parseChunk(e,!0)},this.aborted=function(){return l},this.abort=function(){l=!0,n.abort(),f.meta.aborted=!0,E(t.complete)&&t.complete(f),e=""}}function b(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function x(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||g.BAD_DELIMITERS.indexOf(n)>-1)&&(n=","),i===n)throw new Error("Comment character same as delimiter");!0===i?i="#":("string"!=typeof i||g.BAD_DELIMITERS.indexOf(i)>-1)&&(i=!1),"\n"!==r&&"\r"!==r&&"\r\n"!==r&&(r="\n");var c=0,l=!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,g=i.length,m=E(o);c=0;var y=[],v=[],_=[],x=0;if(!t)return D();if(s||!1!==s&&-1===t.indexOf(e)){for(var w=t.split(r),O=0;O<w.length;O++){if(_=w[O],c+=_.length,O!==w.length-1)c+=r.length;else if(f)return D();if(!i||_.substr(0,g)!==i){if(m){if(y=[],B(_.split(n)),j(),l)return D()}else B(_.split(n));if(a&&O>=a)return y=y.slice(0,a),D(!0)}}return D()}for(var S,T=t.indexOf(n,c),C=t.indexOf(r,c),P=new RegExp(b(u)+b(e),"g");;)if(t[c]!==e)if(i&&0===_.length&&t.substr(c,g)===i){if(-1===C)return D();c=C+A,C=t.indexOf(r,c),T=t.indexOf(n,c)}else if(-1!==T&&(T<C||-1===C))_.push(t.substring(c,T)),c=T+d,T=t.indexOf(n,c);else{if(-1===C)break;if(_.push(t.substring(c,C)),L(C+A),m&&(j(),l))return D();if(a&&y.length>=a)return D(!0)}else{for(S=c,c++;;){if(-1===(S=t.indexOf(e,S+1)))return f||v.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:y.length,index:c}),k();if(S===p-1)return k(t.substring(c,S).replace(P,e));if(e!==u||t[S+1]!==u){if(e===u||0===S||t[S-1]!==u){var M=R(-1===C?T:Math.min(T,C));if(t[S+1+M]===n){if(_.push(t.substring(c,S).replace(P,e)),c=S+1+M+d,T=t.indexOf(n,c),C=t.indexOf(r,c),m&&(j(),l))return D();if(a&&y.length>=a)return D(!0);break}var I=R(C);if(t.substr(S+1+I,A)===r){if(_.push(t.substring(c,S).replace(P,e)),L(S+1+I+A),T=t.indexOf(n,c),m&&(j(),l))return D();if(a&&y.length>=a)return D(!0);break}v.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:y.length,index:c}),S++}}else S++}if(m&&(j(),l))return D();if(a&&y.length>=a)return D(!0)}return k();function B(t){y.push(t),x=c}function R(e){var n=0;if(-1!==e){var r=t.substring(S+1,e);r&&""===r.trim()&&(n=r.length)}return n}function k(e){return f||(void 0===e&&(e=t.substr(c)),_.push(e),c=p,B(_),m&&j()),D()}function L(e){c=e,B(_),_=[],C=t.indexOf(r,c)}function D(t,e){return{data:e||!1?y[0]:y,errors:v,meta:{delimiter:n,linebreak:r,aborted:l,truncated:!!t,cursor:x+(h||0)}}}function j(){o(D(void 0,!0)),y=[],v=[]}},this.abort=function(){l=!0},this.getCharIndex=function(){return c}}function w(t){if("object"!=typeof t||null===t)return t;var e=Array.isArray(t)?[]:{};for(var n in t)e[n]=w(t[n]);return e}function E(t){return"function"==typeof t}v.prototype=Object.create(v.prototype),v.prototype.constructor=v;const{ChunkStreamer:O}=m;function S(t){t=t||{},O.call(this,t),this.textDecoder=new TextDecoder(this._config.encoding),this.stream=async function(t){this._input=t;try{for await(const e of t)this.parseChunk(this.getStringChunk(e));this._finished=!0,this.parseChunk("")}catch(t){this._sendError(t)}},this._nextChunk=function(){},this.getStringChunk=function(t){return"string"==typeof t?t:this.textDecoder.decode(t,{stream:!0})}}S.prototype=Object.create(O.prototype),S.prototype.constructor=S;const T={csv:{shape:"object-row-table",optimizeMemoryUsage:!1,header:"auto",columnPrefix:"column",quoteChar:'"',escapeChar:'"',dynamicTyping:!0,comments:!1,skipEmptyLines:!0,delimitersToGuess:[",","\t","|",";"]}},C={id:"csv",module:"csv",name:"CSV",version:"3.2.10",extensions:["csv","tsv","dsv"],mimeTypes:["text/csv","text/tab-separated-values","text/dsv"],category:"table",parse:async(t,e)=>P((new TextDecoder).decode(t),e),parseText:(t,e)=>P(t,e),parseInBatches:function(t,e){var n;"auto"===(e={...e}).batchSize&&(e.batchSize=4e3);const r={...T.csv,...null===(n=e)||void 0===n?void 0:n.csv},i=new l;let o=!0,a=null,s=null,u=null;const c={...r,header:!1,download:!1,chunkSize:5242880,skipEmptyLines:!1,step(t){let n=t.data;if(r.skipEmptyLines){if(""===n.flat().join("").trim())return}const c=t.meta.cursor;if(o&&!a){if("auto"===r.header?M(n):Boolean(r.header))return void(a=n.map(I()))}o&&(o=!1,a||(a=B(r.columnPrefix,n.length)),u=function(t,e){const n=e?{}:[];for(let r=0;r<t.length;r++){const i=e&&e[r]||r;switch(typeof t[r]){case"number":case"boolean":n[i]={name:String(i),index:r,type:Float32Array};break;case"string":default:n[i]={name:String(i),index:r,type:Array}}}return n}(n,a)),r.optimizeMemoryUsage&&(n=JSON.parse(JSON.stringify(n))),s=s||new A(u,{shape:r.shape||"array-row-table",...e});try{s.addRow(n);const t=s&&s.getFullBatch({bytesUsed:c});t&&i.enqueue(t)}catch(t){i.enqueue(t)}},complete(t){try{const e=t.meta.cursor,n=s&&s.getFinalBatch({bytesUsed:e});n&&i.enqueue(n)}catch(t){i.enqueue(t)}i.close()}};return m.parse(t,c,S),i},options:T};async function P(t,e){const n={...T.csv,...null==e?void 0:e.csv},r=function(t){return m.parse(t,{download:!1,dynamicTyping:!0,preview:1}).data[0]}(t),i="auto"===n.header?M(r):Boolean(n.header),s={...n,header:i,download:!1,transformHeader:i?I():void 0,error:t=>{throw new Error(t)}},u=m.parse(t,s);let{data:c}=u;const l=u.meta.fields||B(n.columnPrefix,r.length);switch(n.shape){case"object-row-table":c=c.map(t=>Array.isArray(t)?o(t,l):t);break;case"array-row-table":c=c.map(t=>Array.isArray(t)?t:a(t,l))}return c}function M(t){return t&&t.every(t=>"string"==typeof t)}function I(){const t=new Set;return e=>{let n=e,r=1;for(;t.has(n);)n="".concat(e,".").concat(r),r++;return t.add(n),n}}function B(t,e=0){const n=[];for(let r=0;r<e;r++)n.push("".concat(t).concat(r+1));return n}var R,k,L=n(107),D=n(37),j=n.n(D);function F(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return z(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 z(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=n.call(t)},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 z(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 U={fontFamily:'"Helvetica Neue", Helvetica, Arial, sans-serif',display:"flex",flex:"wrap",maxWidth:"500px",flexDirection:"column",zIndex:2};function N(){return document.createElement("div")}function G(t){if(!t.picked)return null;if(t.object===R)return k;var e={html:H(t.object),style:U};return k=e,R=t.object,e}var V=new Set(["position","index"]);function H(t){var e=N();for(var n in t)if(!V.has(n)){var r=N();r.className="header",r.textContent=n;var i=N();i.className="value",i.textContent=q(t[n]);var o=N();W(o,r,i),o.appendChild(r),o.appendChild(i),e.appendChild(o)}return e.innerHTML}function W(t,e,n){Object.assign(e.style,{fontWeight:700,marginRight:"10px",flex:"1 1 0%"}),Object.assign(n.style,{flex:"none",maxWidth:"250px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),Object.assign(t.style,{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"stretch"})}function q(t){var e;if(Array.isArray(t)&&t.length>4)e="Array<".concat(t.length,">");else if("string"==typeof t)e=t;else if("number"==typeof t)e=String(t);else try{e=JSON.stringify(t)}catch(t){e="<Non-Serializable Object>"}return e.length>50&&(e=e.slice(0,50)),e}function X(t,e){var n,r,i=t,o=F(j()(new Set(t.match(/{[^}]*}/g).map((function(t){return t.replace(/[{}]/g,"")})))));try{for(o.s();!(r=o.n()).done;){var a=r.value;if(a.includes(".")){n=e;var s,u=F(a.split("."));try{for(u.s();!(s=u.n()).done;){var c=s.value;if(!n.hasOwnProperty(c)){n=void 0;break}n=n[c]}}catch(t){u.e(t)}finally{u.f()}}else n=e.hasOwnProperty(a)?e[a]:e.properties&&e.properties.hasOwnProperty(a)?e.properties[a]:void 0;i=i.replaceAll("{".concat(a,"}"),n)}}catch(t){o.e(t)}finally{o.f()}return i}var J=n(124),Z={};var Q=n(40);var K=n(3),Y=n.n(K),$=n(4),tt=n.n($),et={position:"absolute",top:"0px",left:"0px",width:344,padding:"12px 24px",margin:24,overflowX:"hidden",overflowY:"overlay",outline:"none",maxHeight:"94%",boxSizing:"border-box",backgroundColor:"rgb(255, 255, 255)",fontFamily:'"Fira Sans", sans-serif',zIndex:1},nt=function(){function t(e){var n=e.container,r=e.props;Y()(this,t);var i=r.description,o=document.createElement("div");o.className="deck-json-description-box",Object.assign(o.style,et),this.el=o;var a=document.createElement("div");a.innerHTML=i,o.appendChild(a),n.append(o)}return tt()(t,[{key:"remove",value:function(){this.el.remove(),this.description=null}}],[{key:"stringName",get:function(){return"description"}}]),t}();function rt(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 it(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?rt(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):rt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function ot(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return at(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 at(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=n.call(t)},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 at(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}n.d(e,"addCustomLibraries",(function(){return ft})),n.d(e,"createDeck",(function(){return At})),n.d(e,"updateDeck",(function(){return pt})),n.d(e,"jsonConverter",(function(){return ht}));var st=function(t){return t.charAt(0)===t.charAt(0).toUpperCase()},ut=function(t){return t.charAt(0)===t.charAt(0).toLowerCase()&&"_"!=t.charAt(0)};function ct(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r={},i=Object.keys(e).filter(n),o=ot(i);try{for(o.s();!(t=o.n()).done;){var a=t.value;r[a]=e[a]}}catch(t){o.e(t)}finally{o.f()}return r}var lt={classes:ct(Q,st),enumerations:{COORDINATE_SYSTEM:Q.COORDINATE_SYSTEM,GL:{DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,FUNC_ADD:32774,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,BLEND_COLOR:32773,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,VENDOR:7936,RENDERER:7937,VERSION:7938,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,BROWSER_DEFAULT_WEBGL:37444,STATIC_DRAW:35044,STREAM_DRAW:35040,DYNAMIC_DRAW:35048,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,CULL_FACE:2884,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,BLEND:3042,DEPTH_TEST:2929,DITHER:3024,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,SCISSOR_TEST:3089,STENCIL_TEST:2960,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CONTEXT_LOST_WEBGL:37442,CW:2304,CCW:2305,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,COMPILE_STATUS:35713,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_ATTRIBUTES:35721,ACTIVE_UNIFORMS:35718,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,ALWAYS:519,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,GEQUAL:518,NOTEQUAL:517,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,TEXTURE_WIDTH:4096,TEXTURE_HEIGHT:4097,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,MAX_3D_TEXTURE_SIZE:32883,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,MAX_TEXTURE_LOD_BIAS:34045,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,RASTERIZER_DISCARD:35977,VERTEX_ARRAY_BINDING:34229,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,MAX_ELEMENT_INDEX:36203,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,RGB9_E5:35901,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,RGB10_A2UI:36975,TEXTURE_IMMUTABLE_FORMAT:37167,TEXTURE_IMMUTABLE_LEVELS:33503,UNSIGNED_INT_2_10_10_10_REV:33640,UNSIGNED_INT_10F_11F_11F_REV:35899,UNSIGNED_INT_5_9_9_9_REV:35902,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,UNSIGNED_INT_24_8:34042,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,INT_2_10_10_10_REV:36255,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,MAX_SAMPLES:36183,SAMPLER_BINDING:35097,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,UNSIGNED_NORMALIZED:35863,SIGNED_NORMALIZED:36764,VERTEX_ATTRIB_ARRAY_INTEGER:35069,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,DEPTH24_STENCIL8:35056,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,COLOR:6144,DEPTH:6145,STENCIL:6146,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,INVALID_INDEX:4294967295,TIMEOUT_IGNORED:-1,MAX_CLIENT_WAIT_TIMEOUT_WEBGL:37447,VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE:35070,UNMASKED_VENDOR_WEBGL:37445,UNMASKED_RENDERER_WEBGL:37446,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047,TEXTURE_MAX_ANISOTROPY_EXT:34046,COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_RGBA8_ETC2_EAC:37493,COMPRESSED_SRGB8_ETC2:37494,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37495,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37496,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37497,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGB_ATC_WEBGL:35986,COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL:35986,COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL:34798,UNSIGNED_INT_24_8_WEBGL:34042,HALF_FLOAT_OES:36193,RGBA32F_EXT:34836,RGB32F_EXT:34837,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT:33297,UNSIGNED_NORMALIZED_EXT:35863,MIN_EXT:32775,MAX_EXT:32776,SRGB_EXT:35904,SRGB_ALPHA_EXT:35906,SRGB8_ALPHA8_EXT:35907,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT:33296,FRAGMENT_SHADER_DERIVATIVE_HINT_OES:35723,COLOR_ATTACHMENT0_WEBGL:36064,COLOR_ATTACHMENT1_WEBGL:36065,COLOR_ATTACHMENT2_WEBGL:36066,COLOR_ATTACHMENT3_WEBGL:36067,COLOR_ATTACHMENT4_WEBGL:36068,COLOR_ATTACHMENT5_WEBGL:36069,COLOR_ATTACHMENT6_WEBGL:36070,COLOR_ATTACHMENT7_WEBGL:36071,COLOR_ATTACHMENT8_WEBGL:36072,COLOR_ATTACHMENT9_WEBGL:36073,COLOR_ATTACHMENT10_WEBGL:36074,COLOR_ATTACHMENT11_WEBGL:36075,COLOR_ATTACHMENT12_WEBGL:36076,COLOR_ATTACHMENT13_WEBGL:36077,COLOR_ATTACHMENT14_WEBGL:36078,COLOR_ATTACHMENT15_WEBGL:36079,DRAW_BUFFER0_WEBGL:34853,DRAW_BUFFER1_WEBGL:34854,DRAW_BUFFER2_WEBGL:34855,DRAW_BUFFER3_WEBGL:34856,DRAW_BUFFER4_WEBGL:34857,DRAW_BUFFER5_WEBGL:34858,DRAW_BUFFER6_WEBGL:34859,DRAW_BUFFER7_WEBGL:34860,DRAW_BUFFER8_WEBGL:34861,DRAW_BUFFER9_WEBGL:34862,DRAW_BUFFER10_WEBGL:34863,DRAW_BUFFER11_WEBGL:34864,DRAW_BUFFER12_WEBGL:34865,DRAW_BUFFER13_WEBGL:34866,DRAW_BUFFER14_WEBGL:34867,DRAW_BUFFER15_WEBGL:34868,MAX_COLOR_ATTACHMENTS_WEBGL:36063,MAX_DRAW_BUFFERS_WEBGL:34852,VERTEX_ARRAY_BINDING_OES:34229,QUERY_COUNTER_BITS_EXT:34916,CURRENT_QUERY_EXT:34917,QUERY_RESULT_EXT:34918,QUERY_RESULT_AVAILABLE_EXT:34919,TIME_ELAPSED_EXT:35007,TIMESTAMP_EXT:36392,GPU_DISJOINT_EXT:36795}}};Object(L.c)([C]);var ht=new Q.JSONConverter({configuration:lt});function ft(t,e){if(t){var n={};t.forEach((function(t){var e=t.libraryName,i=t.resourceUri;n[e]=!1,e in window?r(e,window[e]):(Object.defineProperty(window,e,{set:function(t){return r(e,t)},get:function(){return n[e]}}),function(t){if(!Z[t]){var e=document.createElement("script");e.type="text/javascript",e.src=t,document.querySelector("head").appendChild(e),Z[t]=new Promise((function(t){e.onload=t}))}Z[t]}(i))}))}function r(t,r){!function(t,e){var n={classes:ct(t,st),functions:ct(t,ut)};e.mergeConfiguration(n)}(r,ht),n[t]=r,Object.values(n).every((function(t){return t}))&&"function"==typeof e&&e()}}function pt(t,e){var n=ht.convert(t);e.setProps(n)}function dt(t){var e=t.mapProvider,n=t.props,r=t.mapboxApiKey,i=t.googleMapsKey,o=t.handleEvent,a=t.getTooltip,s=t.container,u=it(it({},o?{onClick:function(t){return o("deck-click-event",t)},onHover:function(t){return o("deck-hover-event",t)},onResize:function(t){return o("deck-resize-event",t)},onViewStateChange:function(t){var e=t.viewState,n=(t.interactionState,t.oldViewState,new Q.WebMercatorViewport(e));e.nw=n.unproject([0,0]),e.se=n.unproject([n.width,n.height]),o("deck-view-state-change-event",e)},onDragStart:function(t){return o("deck-drag-start-event",t)},onDrag:function(t){return o("deck-drag-event",t)},onDragEnd:function(t){return o("deck-drag-end-event",t)}}:null),{},{getTooltip:a,container:s});switch(e){case"mapbox":return Q.log.info("Using Mapbox base maps")(),new Q.DeckGL(it(it(it({},u),n),{},{map:J.a,mapboxApiAccessToken:r,onLoad:J.c}));case"carto":return Q.log.info("Using Carto base maps")(),new Q.DeckGL(it(it({map:J.a},u),n));case"google_maps":return Q.log.info("Using Google Maps base maps")(),function(t){var e=t.container,n=(t.onClick,t.onComplete,t.getTooltip,t.googleMapsKey),r=t.layers,i=t.mapStyle,o=void 0===i?"satellite":i,a=t.initialViewState,s=void 0===a?{latitude:0,longitude:0,zoom:1}:a;if(!n)return Q.log.warn("No Google Maps API key set")(),null;var u=new Q.GoogleMapsOverlay({layers:r}),c={center:{lat:s.latitude,lng:s.longitude},mapTypeId:o,zoom:s.zoom},l=new window.google.maps.Map(e,c);return u.setMap(l),u}(it(it(it({},u),n),{},{googleMapsKey:i}));default:return Q.log.info("No recognized map provider specified")(),new Q.DeckGL(it(it(it({},u),n),{},{map:null,mapboxApiAccessToken:null}))}}function At(t){var e,n=t.mapboxApiKey,r=t.googleMapsKey,i=t.container,o=t.jsonInput,a=t.tooltip,s=t.handleEvent,u=t.customLibraries,c=t.configuration;try{c&&ht.mergeConfiguration(c);var l=o.layers||[],h=ht.convert(o);!function(t,e){var n=document.createElement("div");n.className="deckgl-ui-elements-overlay",n.style.zIndex=1,t.insertAdjacentElement("beforebegin",n);for(var r=[],i=0,o=Object.keys(e);i<o.length;i++){switch(o[i]){case"description":var a=new nt({container:n,props:e});r.push(a)}}}(i,h);var f=(h.layers||[]).filter((function(t){return t})),p=function(t,e){return t.filter((function(t){return t&&t.id&&!e.find((function(e){return e.id===t.id}))}))}(l,f),d=function(t){return t?t.html||t.text?function(e){if(!e.picked)return null;var n={style:t.style||U};return t.html?n.html=X(t.html,e.object):n.text=X(t.text,e.object),n}:G:null}(a),A=h.mapProvider;e=dt({mapProvider:A,props:h,mapboxApiKey:n,googleMapsKey:r,handleEvent:s,getTooltip:d,container:i});ft(u,(function(){if(p.length){var t=(ht.convert({layers:o.layers}).layers||[]).filter((function(t){return t}));t.length>f.length&&e.setProps({layers:t})}}))}catch(t){console.error(t)}return e}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return o}));var r=n(15);function i(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 o(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}var a,s;a=new r.a(4),r.a!=Float32Array&&(a[0]=0,a[1]=0,a[2]=0,a[3]=0),s=a},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return o}));var r=n(44);function i(t,e,n=null){if(n)return n;const i={fetch:Object(r.a)(e,t),...t};return Array.isArray(i.loaders)||(i.loaders=null),i}function o(t,e){if(!e&&t&&!Array.isArray(t))return t;let n;if(t&&(n=Array.isArray(t)?t:[t]),e&&e.loaders){const t=Array.isArray(e.loaders)?e.loaders:[e.loaders];n=n?[...n,...t]:t}return n&&n.length?n:null}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return o}));var r=n(15);function i(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t}function o(t,e){return t[0]=-e[0],t[1]=-e[1],t}var a,s;a=new r.a(2),r.a!=Float32Array&&(a[0]=0,a[1]=0),s=a},,,,,function(t,e,n){"use strict";(function(t,r){n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return a}));const i={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==t&&t,document:"undefined"!=typeof document&&document,process:"object"==typeof r&&r},o=(globalThis,i.window||i.self||i.global),a=i.process||{};console}).call(this,n(82),n(63))},function(t,e,n){"use strict";(function(t,r){n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return a}));const i={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==t&&t,document:"undefined"!=typeof document&&document,process:"object"==typeof r&&r},o=i.window||i.self||i.global,a=i.process||{};console}).call(this,n(82),n(63))},function(t,e,n){"use strict";n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return a})),n.d(e,"b",(function(){return s}));let r="";const i={};function o(t){r=t}function a(){return r}function s(t){for(const e in i)if(t.startsWith(e)){const n=i[e];t=t.replace(e,n)}return t.startsWith("http://")||t.startsWith("https://")||(t="".concat(r).concat(t)),t}},function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return a}));var r=n(192);function i(t){return t&&"object"==typeof t&&t.isBuffer}function o(t){return r.toBuffer?r.toBuffer(t):t}function a(t){if(i(t)){return new Uint8Array(t.buffer,t.byteOffset,t.length).slice().buffer}return t}},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var r=n(3),i=n.n(r),o=n(4),a=n.n(o),s=n(0),u=n.n(s),c=n(81),l=[255,255,255],h=[0,0,-1],f=0,p=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i()(this,t),u()(this,"type","directional");var n=e.color,r=void 0===n?l:n,o=e.intensity,a=void 0===o?1:o,s=e.direction,p=void 0===s?h:s,d=e._shadow,A=void 0!==d&&d;this.id=e.id||"directional-".concat(f++),this.color=r,this.intensity=a,this.type="directional",this.direction=new c.a(p).normalize().toArray(),this.shadow=A}return a()(t,[{key:"getProjectedLight",value:function(t){return this}}]),t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(95),i=n(103);async function o(t,e){if("string"==typeof t){t=Object(r.b)(t);let n=e;return null!=e&&e.fetch&&"function"!=typeof(null==e?void 0:e.fetch)&&(n=e.fetch),await fetch(t,n)}return await Object(i.b)(t)}},function(t,e,n){"use strict";const 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;\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};var 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(12),s=Object.keys(a.a).map((function(t){return"const int COORDINATE_SYSTEM_".concat(t," = ").concat(a.a[t],";")})).join(""),u=Object.keys(a.d).map((function(t){return"const int PROJECTION_MODE_".concat(t," = ").concat(a.d[t],";")})).join(""),c=Object.keys(a.e).map((function(t){return"const int UNIT_".concat(t.toUpperCase()," = ").concat(a.e[t],";")})).join(""),l="".concat(s,"\n").concat(u,"\n").concat(c,'\n\nuniform int project_uCoordinateSystem;\nuniform int project_uProjectionMode;\nuniform float project_uScale;\nuniform bool project_uWrapLongitude;\nuniform vec3 project_uCommonUnitsPerMeter;\nuniform vec3 project_uCommonUnitsPerWorldUnit;\nuniform vec3 project_uCommonUnitsPerWorldUnit2;\nuniform vec4 project_uCenter;\nuniform mat4 project_uModelMatrix;\nuniform mat4 project_uViewProjectionMatrix;\nuniform vec2 project_uViewportSize;\nuniform float project_uDevicePixelRatio;\nuniform float project_uFocalDistance;\nuniform vec3 project_uCameraPosition;\nuniform vec3 project_uCoordinateOrigin;\nuniform vec3 project_uCommonOrigin;\nuniform bool project_uPseudoMeters;\n\nconst float TILE_SIZE = 512.0;\nconst float PI = 3.1415926536;\nconst float WORLD_SCALE = TILE_SIZE / (PI * 2.0);\nconst vec3 ZERO_64_LOW = vec3(0.0);\nconst float EARTH_RADIUS = 6370972.0; // 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;\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;\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}\nvec2 project_pixel_size(vec2 pixels) {\n return pixels / project_uScale;\n}\n'),h=n(117),f={};e.a={name:"project",dependencies:[r,o],vs:l,getUniforms:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:f;return"viewport"in t?Object(h.b)(t):{}}}},function(t,e,n){"use strict";var r=n(49),i=n(148);var o=n(186),a=n(43),s=n(21),u=n(44),c=n(119),l=n(87),h=n(60),f=n(76);async function p(t,e,n,d){Object(r.a)(!d||"object"==typeof d),!e||Array.isArray(e)||Object(a.a)(e)||(d=void 0,n=e,e=void 0),t=await t,n=n||{};const{url:A}=Object(h.b)(t),g=e,m=Object(l.b)(g,d),y=await Object(f.a)(t,m,n);return y?(n=Object(u.d)(n,y,m,A),d=Object(l.a)({url:A,parse:p,loaders:m},n,d),await async function(t,e,n,a){if(function(t,e=i.a){Object(r.a)(t,"no worker provided");const n=t.version}(t),Object(s.j)(e)){const t=e,{ok:n,redirected:r,status:i,statusText:o,type:s,url:u}=t,c=Object.fromEntries(t.headers.entries());a.response={headers:c,ok:n,redirected:r,status:i,statusText:o,type:s,url:u}}if(e=await Object(c.a)(e,t,n),t.parseTextSync&&"string"==typeof e)return n.dataType="text",t.parseTextSync(e,n,a,t);if(Object(o.a)(t,n))return await Object(o.b)(t,e,n,a,p);if(t.parseText&&"string"==typeof e)return await t.parseText(e,n,a,t);if(t.parse)return await t.parse(e,n,a,t);throw Object(r.a)(!t.parseSync),new Error("".concat(t.id," loader - no parser found and worker is disabled"))}(y,t,n,d)):null}n.d(e,"a",(function(){return p}))},function(t,e,n){"use strict";function r(t,e){if(!t)throw new Error(e||"loader assertion failed.")}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";var r=n(8),i=n(52),o=n(10);let a="";n.d(e,"a",(function(){return s}));class s extends i.a{get[Symbol.toStringTag](){return"Texture2D"}static isSupported(t,e){return i.a.isSupported(t,e)}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var n,i;Object(r.b)(t),(e instanceof Promise||"string"==typeof e)&&(e={data:e}),"string"==typeof e.data&&(e=Object.assign({},e,{data:(n=e.data,Object(o.a)("string"==typeof n),n=a+n,new Promise((t,e)=>{try{const r=new Image;r.onload=()=>t(r),r.onerror=()=>e(new Error("Could not load image ".concat(n,"."))),r.crossOrigin=i&&i.crossOrigin||"anonymous",r.src=n}catch(t){e(t)}}))})),super(t,Object.assign({},e,{target:3553})),this.initialize(e),Object.seal(this)}}},function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return a}));var r=n(21),i=n(60);async function o(t){if(Object(r.j)(t))return t;const e={},n=Object(i.a)(t);n>=0&&(e["content-length"]=String(n));const{url:o,type:a}=Object(i.b)(t);a&&(e["content-type"]=a);const s=await async function(t){if("string"==typeof t)return"data:,".concat(t.slice(0,5));if(t instanceof Blob){const e=t.slice(0,5);return await new Promise(t=>{const n=new FileReader;n.onload=e=>{var n;return t(null==e||null===(n=e.target)||void 0===n?void 0:n.result)},n.readAsDataURL(e)})}if(t instanceof ArrayBuffer){const e=function(t){let e="";const n=new Uint8Array(t);for(let t=0;t<n.byteLength;t++)e+=String.fromCharCode(n[t]);return btoa(e)}(t.slice(0,5));return"data:base64,".concat(e)}return null}(t);s&&(e["x-first-bytes"]=s),"string"==typeof t&&(t=(new TextEncoder).encode(t));const u=new Response(t,{headers:e});return Object.defineProperty(u,"url",{value:o}),u}async function a(t){if(!t.ok){const e=await async function(t){let e="Failed to fetch resource ".concat(t.url," (").concat(t.status,"): ");try{const n=t.headers.get("Content-Type");let r=t.statusText;n.includes("application/json")&&(r+=" ".concat(await t.text())),e+=r,e=e.length>60?"".concat(e.slice(0,60),"..."):e}catch(t){}return e}(t);throw new Error(e)}}},function(t,e,n){"use strict";var r=n(38);const i="EXT_color_buffer_float";var o={33189:{bpp:2},33190:{gl2:!0,bpp:3},36012:{gl2:!0,bpp:4},36168:{bpp:1},34041:{bpp:4},35056:{gl2:!0,bpp:4},36013:{gl2:!0,bpp:5},32854:{bpp:2},36194:{bpp:2},32855:{bpp:2},33321:{gl2:!0,bpp:1},33330:{gl2:!0,bpp:1},33329:{gl2:!0,bpp:1},33332:{gl2:!0,bpp:2},33331:{gl2:!0,bpp:2},33334:{gl2:!0,bpp:4},33333:{gl2:!0,bpp:4},33323:{gl2:!0,bpp:2},33336:{gl2:!0,bpp:2},33335:{gl2:!0,bpp:2},33338:{gl2:!0,bpp:4},33337:{gl2:!0,bpp:4},33340:{gl2:!0,bpp:8},33339:{gl2:!0,bpp:8},32849:{gl2:!0,bpp:3},32856:{gl2:!0,bpp:4},32857:{gl2:!0,bpp:4},36220:{gl2:!0,bpp:4},36238:{gl2:!0,bpp:4},36975:{gl2:!0,bpp:4},36214:{gl2:!0,bpp:8},36232:{gl2:!0,bpp:8},36226:{gl2:!0,bpp:16},36208:{gl2:!0,bpp:16},33325:{gl2:i,bpp:2},33327:{gl2:i,bpp:4},34842:{gl2:i,bpp:8},33326:{gl2:i,bpp:4},33328:{gl2:i,bpp:8},34836:{gl2:i,bpp:16},35898:{gl2:i,bpp:4}},a=n(8),s=n(10);n.d(e,"a",(function(){return u}));class u extends r.a{get[Symbol.toStringTag](){return"Renderbuffer"}static isSupported(t){let{format:e}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{format:null};return!e||function(t,e,n){const r=n[e];if(!r)return!1;const i=Object(a.j)(t)&&r.gl2||r.gl1;return"string"==typeof i?t.getExtension(i):i}(t,e,o)}static getSamplesForFormat(t,e){let{format:n}=e;return t.getInternalformatParameter(36161,n,32937)}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(t,e),this.initialize(e),Object.seal(this)}initialize(t){let{format:e,width:n=1,height:r=1,samples:i=0}=t;return Object(s.a)(e,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==i&&Object(a.j)(this.gl)?this.gl.renderbufferStorageMultisample(36161,i,e,n,r):this.gl.renderbufferStorage(36161,e,n,r),this.format=e,this.width=n,this.height=r,this.samples=i,this._trackAllocatedMemory(this.width*this.height*(this.samples||1)*o[this.format].bpp),this}resize(t){let{width:e,height:n}=t;return e!==this.width||n!==this.height?this.initialize({width:e,height:n,format:this.format,samples:this.samples}):this}_createHandle(){return this.gl.createRenderbuffer()}_deleteHandle(){this.gl.deleteRenderbuffer(this.handle),this._trackDeallocatedMemory()}_bindHandle(t){this.gl.bindRenderbuffer(36161,t)}_syncHandle(t){this.format=this.getParameter(36164),this.width=this.getParameter(36162),this.height=this.getParameter(36163),this.samples=this.getParameter(36011)}_getParameter(t){this.gl.bindRenderbuffer(36161,this.handle);return this.gl.getRenderbufferParameter(36161,t)}}},function(t,e,n){"use strict";(function(t){n.d(e,"b",(function(){return r})),n.d(e,"c",(function(){return i})),n.d(e,"a",(function(){return o}));const r="undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",i="undefined"!=typeof window?window:t;void 0!==t||window,"undefined"!=typeof document&&document;let o=!1;try{const t={get passive(){return o=!0,!0}};i.addEventListener("test",null,t),i.removeEventListener("test",null)}catch(t){o=!1}}).call(this,n(82))},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return r}));"undefined"!=typeof window&&window,void 0!==t||window;var r="undefined"!=typeof document?document:{}}).call(this,n(82))},function(t,e,n){"use strict";n.d(e,"c",(function(){return a})),n.d(e,"b",(function(){return s})),n.d(e,"a",(function(){return u}));var r=n(43),i=n(44);const o=()=>{const t=Object(i.c)();return t.loaderRegistry=t.loaderRegistry||[],t.loaderRegistry};function a(t){const e=o();t=Array.isArray(t)?t:[t];for(const n of t){const t=Object(r.b)(n);e.find(e=>t===e)||e.unshift(t)}}function s(){return o()}function u(){Object(i.c)().loaderRegistry=[]}},function(t,e,n){"use strict";n.d(e,"a",(function(){return C})),n.d(e,"b",(function(){return P}));var r=n(26),i=n.n(r),o=n(7),a=n.n(o),s=n(0),u=n.n(s),c=n(3),l=n.n(c),h=n(4),f=n.n(h),p=n(5),d=n.n(p),A=n(6),g=n.n(A),m=n(2),y=n.n(m),v=n(13),_=n(56),b=n(118),x=n(18),w=n(28),E=n(48);function O(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 S(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?O(Object(n),!0).forEach((function(e){u()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function T(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=y()(t);if(e){var i=y()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return g()(this,n)}}var C=function(t){d()(n,t);var e=T(n);function n(t){var r;l()(this,n);var i=t.width,o=t.height,a=t.latitude,s=t.longitude,u=t.zoom,c=t.bearing,h=void 0===c?0:c,f=t.pitch,p=void 0===f?0:f,d=t.altitude,A=void 0===d?1.5:d,g=t.position,m=void 0===g?[0,0,0]:g,y=t.maxZoom,v=void 0===y?20:y,_=t.minZoom,b=void 0===_?0:_,x=t.maxPitch,E=void 0===x?60:x,O=t.minPitch,S=void 0===O?0:O,T=t.startPanLngLat,C=t.startZoomLngLat,P=t.startRotatePos,M=t.startBearing,I=t.startPitch,B=t.startZoom,R=t.normalize,k=void 0===R||R;return Object(w.a)(Number.isFinite(s)),Object(w.a)(Number.isFinite(a)),Object(w.a)(Number.isFinite(u)),(r=e.call(this,{width:i,height:o,latitude:a,longitude:s,zoom:u,bearing:h,pitch:p,altitude:A,maxZoom:v,minZoom:b,maxPitch:E,minPitch:S,normalize:k,position:m},{startPanLngLat:T,startZoomLngLat:C,startRotatePos:P,startBearing:M,startPitch:I,startZoom:B})).makeViewport=t.makeViewport,r}return f()(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,c=s.startBearing,l=s.startPitch;return u&&void 0!==c&&void 0!==l?(e=n?this._getNewRotation(n,u,l,c):{bearing:c+i,pitch:l+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,i=this.getState(),o=i.startZoom,a=i.startZoomLngLat;if(a||(o=this.getViewportProps().zoom,a=this._unproject(n)||this._unproject(e)),!a)return this;var s=this.getViewportProps(),u=s.maxZoom,c=s.minZoom,l=o+Math.log2(r);l=Object(v.a)(l,c,u);var h=this.makeViewport(S(S({},this.getViewportProps()),{},{zoom:l}));return this._getUpdatedState(S({zoom:l},h.panByPosition(a,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;return 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=S({},this.getViewportProps()),r=n.bearing,i=n.longitude;return Math.abs(r-e.bearing)>180&&(n.bearing=r<0?r+360:r-360),Math.abs(i-e.longitude)>180&&(n.longitude=i<0?i+360:i-360),n}},{key:"applyConstraints",value:function(t){var e=t.maxZoom,n=t.minZoom,r=t.zoom;t.zoom=Object(v.a)(r,n,e);var i=t.maxPitch,o=t.minPitch,a=t.pitch;t.pitch=Object(v.a)(a,o,i);var s=t.normalize;return(void 0===s||s)&&Object.assign(t,Object(x.m)(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(S(S(S({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(),c=u.width,l=u.height,h=i/c,f=0;o>0?Math.abs(l-s)>5&&(f=o/(s-l)*1.2):o<0&&s>5&&(f=1-a/s),f=Object(v.a)(f,-1,1);var p=this.getViewportProps(),d=p.minPitch,A=p.maxPitch,g=n;return f>0?g=n+f*(A-n):f<0&&(g=n-f*(d-n)),{pitch:g,bearing:r+180*h}}}]),n}(b.a),P=function(t){d()(n,t);var e=T(n);function n(){var t;l()(this,n);for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];return t=e.call.apply(e,[this].concat(o)),u()(i()(t),"ControllerState",C),u()(i()(t),"transition",{transitionDuration:300,transitionInterpolator:new E.a({transitionProps:{compare:["longitude","latitude","zoom","bearing","pitch","position"],required:["longitude","latitude","zoom"]}})}),u()(i()(t),"dragMode","pan"),t}return f()(n,[{key:"setProps",value:function(t){t.position=t.position||[0,0,0];var e=this.props;a()(y()(n.prototype),"setProps",this).call(this,t),(!e||e.height!==t.height)&&this.updateViewport(new this.ControllerState(S(S({makeViewport:this.makeViewport},t),this.state)))}}]),n}(_.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var r=n(3),i=n.n(r),o=n(4),a=n.n(o),s=n(13),u=n(28);function c(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return l(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 l(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=n.call(t)},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 l(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 h=function(){function t(e){i()(this,t);var n=e.compare,r=e.extract,o=e.required;this._propsToCompare=n,this._propsToExtract=r||n,this._requiredProps=o}return a()(t,[{key:"arePropsEqual",value:function(t,e){var n,r=c(this._propsToCompare);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(!(i in t)||!(i in e)||!Object(s.d)(t[i],e[i]))return!1}}catch(t){r.e(t)}finally{r.f()}return!0}},{key:"initializeProps",value:function(t,e){var n,r={},i={},o=c(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(t){o.e(t)}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];Object(u.a)(Number.isFinite(n)||Array.isArray(n),"".concat(e," is required for transition"))}))}}]),t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return O})),n.d(e,"b",(function(){return S}));var r=n(26),i=n.n(r),o=n(0),a=n.n(o),s=n(3),u=n.n(s),c=n(4),l=n.n(c),h=n(5),f=n.n(h),p=n(6),d=n.n(p),A=n(2),g=n.n(A),m=n(13),y=n(56),v=n(118),_=n(34),b=n(48);function x(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 w(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?x(Object(n),!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):x(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function E(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=g()(t);if(e){var i=g()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return d()(this,n)}}var O=function(t){f()(n,t);var e=E(n);function n(t){var r;u()(this,n);var i=t.width,o=t.height,a=t.rotationX,s=void 0===a?0:a,c=t.rotationOrbit,l=void 0===c?0:c,h=t.target,f=void 0===h?[0,0,0]:h,p=t.zoom,d=void 0===p?0:p,A=t.minRotationX,g=void 0===A?-90:A,m=t.maxRotationX,y=void 0===m?90:m,v=t.minZoom,_=void 0===v?-1/0:v,b=t.maxZoom,x=void 0===b?1/0:b,w=t.startPanPosition,E=t.startRotatePos,O=t.startRotationX,S=t.startRotationOrbit,T=t.startZoomPosition,C=t.startZoom;return(r=e.call(this,{width:i,height:o,rotationX:s,rotationOrbit:l,target:f,zoom:d,minRotationX:g,maxRotationX:y,minZoom:_,maxZoom:x},{startPanPosition:w,startRotatePos:E,startRotationX:O,startRotationOrbit:S,startZoomPosition:T,startZoom:C})).makeViewport=t.makeViewport,r}return l()(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,c=s.startRotationX,l=s.startRotationOrbit,h=this.getViewportProps(),f=h.width,p=h.height;if(!u||void 0===c||void 0===l)return this;if(n){var d=(n[0]-u[0])/f;(c<-90||c>90)&&(d*=-1),e={rotationX:c+180*((n[1]-u[1])/p),rotationOrbit:l+180*d}}else e={rotationX:c+a,rotationOrbit:l+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=w({},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;return 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,i=this.getState(),o=i.startZoom,a=i.startZoomPosition;if(a||(o=this.getViewportProps().zoom,a=this._unproject(n)||this._unproject(e)),!a)return this;var s=this._calculateNewZoom({scale:r,startZoom:o}),u=this.makeViewport(w(w({},this.getViewportProps()),{},{zoom:s}));return this._getUpdatedState(w({zoom:s},u.panByPosition(a,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 Object(m.a)(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(w(w(w({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)?[Object(m.a)(r[0],n,e),Object(m.a)(r[1],n,e)]:Object(m.a)(r,n,e),t.rotationX=Object(m.a)(t.rotationX,o,i),(a<-180||a>180)&&(t.rotationOrbit=Object(_.e)(a+180,360)-180),t}}]),n}(v.a),S=function(t){f()(n,t);var e=E(n);function n(){var t;u()(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)),a()(i()(t),"ControllerState",O),a()(i()(t),"transition",{transitionDuration:300,transitionInterpolator:new b.a({transitionProps:{compare:["target","zoom","rotationX","rotationOrbit"],required:["target","zoom"]}})}),t}return n}(y.a)},function(t,e,n){"use strict";var r=n(3),i=n.n(r),o=n(4),a=n.n(o),s=n(7),u=n.n(s),c=n(5),l=n.n(c),h=n(6),f=n.n(h),p=n(2),d=n.n(p),A=n(0),g=n.n(A),m=n(204),y=n(221),v=n(220),_=n(12),b=n(157),x=n(234),w=n(181),E=n(178),O=n(58),S=n(62),T=n(206),C=n(36);function P(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return M(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 M(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=n.call(t)},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 M(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 I(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 B(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?I(Object(n),!0).forEach((function(e){g()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):I(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function R(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=d()(t);if(e){var i=d()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return f()(this,n)}}var k=function(t){l()(n,t);var e=R(n);function n(t){i()(this,n);var r=t.fp64,o=t.IndexType,a=void 0===o?Uint32Array:o;return e.call(this,B(B({},t),{},{attributes:{positions:{size:3,type:r?Float64Array:Float32Array},vertexValid:{type:Uint8ClampedArray,size:1},indices:{type:a,size:1}}}))}return a()(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){u()(d()(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=S.d(t,this.positionSize);return this.opts.resolution?Object(C.b)(S.b(e),S.a(e),{size:this.positionSize,gridResolution:this.opts.resolution,edgeTypes:!0}):this.opts.wrapLongitude?Object(C.c)(S.b(e),S.a(e),{size:this.positionSize,maxLatitude:86,edgeTypes:!0}):e}return t}},{key:"getGeometrySize",value:function(t){if(L(t)){var e,n=0,r=P(t);try{for(r.s();!(e=r.n()).done;){var i=e.value;n+=this.getGeometrySize(i)}}catch(t){r.e(t)}finally{r.f()}return n}return S.b(t).length/this.positionSize}},{key:"getGeometryFromBuffer",value:function(t){return this.normalize||!this.buffers.indices?u()(d()(n.prototype),"getGeometryFromBuffer",this).call(this,t):null}},{key:"updateGeometryAttributes",value:function(t,e){if(t&&L(t)){var n,r=P(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(t){r.e(t)}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 c=i,l=S.c(t,this.positionSize,this.opts.preproject,this.opts.full3d);u=s.allocate(u,i+l.length,{copy:!0});for(var h=0;h<l.length;h++)u[c++]=l[h]+r;a[n+1]=i+l.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=S.b(t),s=n,u=0;u<r;s++,u++){var c=a[u*o],l=a[u*o+1],h=o>2?a[u*o+2]:0;i[3*s]=c,i[3*s+1]=l,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&&S.a(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}(T.a);function L(t){return Array.isArray(t)&&t.length>0&&!Number.isFinite(t[0])}var D="\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",j="#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(D,"\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"),F="#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(D,"\n\nvoid main(void) {\n PolygonProps props;\n\n #if RING_WINDING_ORDER_CW == 1\n props.positions = instancePositions;\n props.positions64Low = instancePositions64Low;\n props.nextPositions = nextPositions;\n props.nextPositions64Low = nextPositions64Low;\n #else\n props.positions = nextPositions;\n props.positions64Low = nextPositions64Low;\n props.nextPositions = instancePositions;\n props.nextPositions64Low = instancePositions64Low;\n #endif\n props.elevations = instanceElevations;\n props.fillColors = instanceFillColors;\n props.lineColors = instanceLineColors;\n props.pickingColors = instancePickingColors;\n\n calculatePosition(props);\n}\n");function z(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 U(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?z(Object(n),!0).forEach((function(e){g()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):z(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function N(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=d()(t);if(e){var i=d()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return f()(this,n)}}n.d(e,"a",(function(){return W}));var G=[0,0,0,255],V={filled:!0,extruded:!1,wireframe:!1,_normalize:!0,_windingOrder:"CW",_full3d:!1,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:G},getLineColor:{type:"accessor",value:G},material:!0},H={enter:function(t,e){return e.length?e.subarray(e.length-t.length):t}},W=function(t){l()(n,t);var e=N(n);function n(){return i()(this,n),e.apply(this,arguments)}return a()(n,[{key:"getShaders",value:function(t){return u()(d()(n.prototype),"getShaders",this).call(this,{vs:"top"===t?j:F,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:[m.a,y.a,v.a]})}},{key:"wrapLongitude",get:function(){return!1}},{key:"initializeState",value:function(){var t,e=this,n=this.context,r=n.gl,i=n.viewport,o=this.props.coordinateSystem,a=this.props._full3d;i.isGeospatial&&o===_.a.DEFAULT&&(o=_.a.LNGLAT),o===_.a.LNGLAT&&(t=a?i.projectPosition.bind(i):i.projectFlat.bind(i)),this.setState({numInstances:0,polygonTesselator:new k({preproject:t,fp64:this.use64bitPositions(),IndexType:!r||Object(x.c)(r,w.a.ELEMENT_INDEX_UINT32)?Uint32Array:Uint16Array})});var s=this.getAttributeManager();s.remove(["instancePickingColors"]),s.add({indices:{size:1,isIndexed:!0,update:this.calculateIndices,noAlloc:!0},positions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:H,accessor:"getPolygon",update:this.calculatePositions,noAlloc:!0,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:!0},elevations:{size:1,transition:H,accessor:"getElevation",shaderAttributes:{elevations:{divisor:0},instanceElevations:{divisor:1}}},fillColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:H,accessor:"getFillColor",defaultValue:G,shaderAttributes:{fillColors:{divisor:0},instanceFillColors:{divisor:1}}},lineColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:H,accessor:"getLineColor",defaultValue:G,shaderAttributes:{lineColors:{divisor:0},instanceLineColors:{divisor:1}}},pickingColors:{size:3,type:5121,accessor:function(t,n){var r=n.index,i=n.target;return e.encodePickingColor(t&&t.__source?t.__source.index:r,i)},shaderAttributes:{pickingColors:{divisor:0},instancePickingColors:{divisor:1}}}})}},{key:"getPickingInfo",value:function(t){var e=u()(d()(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.extruded,i=n.filled,o=n.wireframe,a=n.elevationScale,s=this.state,u=s.topModel,c=s.sideModel,l=s.polygonTesselator,h=U(U({},e),{},{extruded:Boolean(r),elevationScale:a});c&&(c.setInstanceCount(l.instanceCount-1),c.setUniforms(h),o&&(c.setDrawMode(3),c.setUniforms({isWireframe:!0}).draw()),i&&(c.setDrawMode(6),c.setUniforms({isWireframe:!1}).draw())),u&&(u.setVertexCount(l.vertexCount),u.setUniforms(h).draw())}},{key:"updateState",value:function(t){u()(d()(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,full3d:e._full3d}),this.setState({numInstances:r.instanceCount,startIndices:r.vertexStarts}),n.dataChanged||this.getAttributeManager().invalidateAll()}}},{key:"_getModels",value:function(t){var e,n,r=this.props,i=r.id,o=r.filled,a=r.extruded;if(o){var s=this.getShaders("top");s.defines.NON_INSTANCED_MODEL=1,e=new E.a(t,U(U({},s),{},{id:"".concat(i,"-top"),drawMode:4,attributes:{vertexPositions:new Float32Array([0,1])},uniforms:{isWireframe:!1,isSideVertex:!1},vertexCount:0,isIndexed:!0}))}return a&&((n=new E.a(t,U(U({},this.getShaders("side")),{},{id:"".concat(i,"-side"),geometry:new O.a({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}(b.a);g()(W,"defaultProps",V),g()(W,"layerName","SolidPolygonLayer")},function(t,e,n){"use strict";var r=n(3),i=n.n(r),o=n(4),a=n.n(o),s=n(7),u=n.n(s),c=n(5),l=n.n(c),h=n(6),f=n.n(h),p=n(2),d=n.n(p),A=n(0),g=n.n(A),m=n(204),y=n(220),v=n(12),_=n(157),b=n(178),x=n(58),w=n(206),E=n(36);function O(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return S(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 S(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=n.call(t)},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 S(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 T(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 C(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?T(Object(n),!0).forEach((function(e){g()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function P(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=d()(t);if(e){var i=d()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return f()(this,n)}}var M=function(t){l()(n,t);var e=P(n);function n(t){return i()(this,n),e.call(this,C(C({},t),{},{attributes:{positions:{size:3,padding:18,initialize:!0,type:t.fp64?Float64Array:Float32Array},segmentTypes:{size:1,type:Uint8ClampedArray}}}))}return a()(n,[{key:"get",value:function(t){return this.attributes[t]}},{key:"getGeometryFromBuffer",value:function(t){return this.normalize?u()(d()(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;return n?Object(E.d)(i,{size:e,gridResolution:n}):r?Object(E.e)(i,{size:e}):i}(t,this.positionSize,this.opts.resolution,this.opts.wrapLongitude):t}},{key:"getGeometrySize",value:function(t){if(I(t)){var e,n=0,r=O(t);try{for(r.s();!(e=r.n()).done;){var i=e.value;n+=this.getGeometrySize(i)}}catch(t){r.e(t)}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&&I(t)){var n,r=O(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(t){r.e(t)}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}(w.a);function I(t){return Array.isArray(t[0])}function B(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 R(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?B(Object(n),!0).forEach((function(e){g()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):B(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function k(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=d()(t);if(e){var i=d()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return f()(this,n)}}n.d(e,"a",(function(){return F}));var L=[0,0,0,255],D={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:L},getWidth:{type:"accessor",value:1},rounded:{deprecatedFor:["jointRounded","capRounded"]}},j={enter:function(t,e){return e.length?e.subarray(e.length-t.length):t}},F=function(t){l()(n,t);var e=k(n);function n(){return i()(this,n),e.apply(this,arguments)}return a()(n,[{key:"getShaders",value:function(){return u()(d()(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;\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:[m.a,y.a]})}},{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:j,accessor:"getPath",update:this.calculatePositions,noAlloc:!0,shaderAttributes:{instanceLeftPositions:{vertexOffset:0},instanceStartPositions:{vertexOffset:1},instanceEndPositions:{vertexOffset:2},instanceRightPositions:{vertexOffset:3}}},instanceTypes:{size:1,type:5121,update:this.calculateSegmentTypes,noAlloc:!0},instanceStrokeWidths:{size:1,accessor:"getWidth",transition:j,defaultValue:1},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,accessor:"getColor",transition:j,defaultValue:L},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 M({fp64:this.use64bitPositions()})})}},{key:"updateState",value:function(t){u()(d()(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 s,c=this.context.gl;null===(s=this.state.model)||void 0===s||s.delete(),this.state.model=this._getModel(c),i.invalidateAll()}}},{key:"getPickingInfo",value:function(t){var e=u()(d()(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,c=n.widthMinPixels,l=n.widthMaxPixels;this.state.model.setUniforms(e).setUniforms({jointType:Number(r),capType:Number(i),billboard:o,widthUnits:v.e[s],widthScale:u,miterLimit:a,widthMinPixels:c,widthMaxPixels:l}).draw()}},{key:"_getModel",value:function(t){return new b.a(t,R(R({},this.getShaders()),{},{id:this.props.id,geometry:new x.a({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);g()(F,"defaultProps",D),g()(F,"layerName","PathLayer")},function(t,e,n){"use strict";var r,i=n(3),o=n.n(i),a=n(4),s=n.n(a),u=n(7),c=n.n(u),l=n(5),h=n.n(l),f=n(6),p=n.n(f),d=n(2),A=n.n(d),g=n(0),m=n.n(g),y=n(204),v=n(220),_=n(12),b=n(20),x=n(157),w=n(178),E=n(58),O=n(102),S=n(197),T=n(291),C=n(202),P=n(50);function M(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return I(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 I(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=n.call(t)},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 I(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 B(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 R(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?B(Object(n),!0).forEach((function(e){m()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):B(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var k=function(){},L=(r={},m()(r,10241,9987),m()(r,10240,9729),m()(r,10242,33071),m()(r,10243,33071),r);function D(t){return t&&(t.id||t.url)}function j(t,e,n){for(var r=0;r<e.length;r++){var i=e[r],o=i.icon,a=i.xOffset;t[D(o)]=R(R({},o),{},{x:a,y:n})}}var F=function(){function t(e,n){var r=n.onUpdate,i=void 0===r?k:r,a=n.onError,s=void 0===a?k:a;o()(this,t),m()(this,"_loadOptions",null),m()(this,"_texture",null),m()(this,"_externalTexture",null),m()(this,"_mapping",{}),m()(this,"_textureParameters",null),m()(this,"_pendingCount",0),m()(this,"_autoPacking",!1),m()(this,"_xOffset",0),m()(this,"_yOffset",0),m()(this,"_rowHeight",0),m()(this,"_buffer",4),m()(this,"_canvasWidth",1024),m()(this,"_canvasHeight",0),m()(this,"_canvas",null),this.gl=e,this.onUpdate=i,this.onError=s}return s()(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?D(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,r,i,o,a,s,u,c=Object.values(function(t,e,n){if(!t||!e)return null;n=n||{};var r,i={},o=Object(P.a)(t),a=o.iterable,s=o.objectInfo,u=M(a);try{for(u.s();!(r=u.n()).done;){var c=r.value;s.index++;var l=e(c,s),h=D(l);if(!l)throw new Error("Icon is missing.");if(!l.url)throw new Error("Icon url is missing.");i[h]||n[h]&&l.url===n[h].url||(i[h]=R(R({},l),{},{source:c,sourceIndex:s.index}))}}catch(t){u.e(t)}finally{u.f()}return i}(t,e,this._mapping)||{});if(c.length>0){var l=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,c=void 0===u?0:u,l=t.rowHeight,h=void 0===l?0:l,f=t.canvasWidth,p=[],d=0;d<n.length;d++){var A=n[d];if(!o[D(A)]){var g=A.height,m=A.width;s+m+r>f&&(j(o,p,c),s=0,c=h+c+r,h=0,p=[]),p.push({icon:A,xOffset:s}),s=s+m+r,h=Math.max(h,g)}}return p.length>0&&j(o,p,c),{mapping:o,rowHeight:h,xOffset:s,yOffset:c,canvasWidth:f,canvasHeight:(e=h+c+r,Math.pow(2,Math.ceil(Math.log2(e))))}}({icons:c,buffer:this._buffer,canvasWidth:this._canvasWidth,mapping:this._mapping,rowHeight:this._rowHeight,xOffset:this._xOffset,yOffset:this._yOffset}),h=l.mapping,f=l.xOffset,p=l.yOffset,d=l.rowHeight,A=l.canvasHeight;this._rowHeight=d,this._mapping=h,this._xOffset=f,this._yOffset=p,this._canvasHeight=A,this._texture||(this._texture=new O.a(this.gl,{width:this._canvasWidth,height:this._canvasHeight,parameters:this._textureParameters||L})),this._texture.height!==this._canvasHeight&&(this._texture=(n=this._texture,r=this._canvasWidth,i=this._canvasHeight,o=this._textureParameters||L,a=n.width,s=n.height,u=new O.a(n.gl,{width:r,height:i,parameters:o}),Object(S.b)(n,u,{targetY:0,width:a,height:s}),n.delete(),u)),this.onUpdate(),this._canvas=this._canvas||document.createElement("canvas"),this._loadIcons(c)}}}},{key:"_loadIcons",value:function(t){var e,n=this,r=this._canvas.getContext("2d"),i=M(t);try{var o=function(){var t=e.value;n._pendingCount++,Object(C.a)(t.url,T.a,n._loadOptions).then((function(e){var i=D(t),o=n._mapping[i],a=o.x,s=o.y,u=o.width,c=o.height,l=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,c);n._texture.setSubImageData({data:l,x:a,y:s,width:u,height:c}),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(t){i.e(t)}finally{i.f()}}}]),t}();function z(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 U(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?z(Object(n),!0).forEach((function(e){m()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):z(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function N(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=A()(t);if(e){var i=A()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return p()(this,n)}}n.d(e,"a",(function(){return H}));var G=[0,0,0,255],V={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:G},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}},H=function(t){h()(n,t);var e=N(n);function n(){return o()(this,n),e.apply(this,arguments)}return s()(n,[{key:"getShaders",value:function(){return c()(A()(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 sizeMinPixels, 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:[y.a,v.a]})}},{key:"initializeState",value:function(){this.state={iconManager:new F(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:G},instanceAngles:{size:1,transition:!0,accessor:"getAngle"},instancePixelOffset:{size:2,transition:!0,accessor:"getPixelOffset"}})}},{key:"updateState",value:function(t){c()(A()(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,u=e.data,l=e.getIcon,h=e.textureParameters,f=this.state.iconManager,p=a||this.internalState.isAsyncPropLoading("iconAtlas");if(f.setProps({loadOptions:e.loadOptions,autoPacking:!p,iconAtlas:a,iconMapping:p?s:null,textureParameters:h}),p?r.iconMapping!==e.iconMapping&&o.invalidate("getIcon"):(i.dataChanged||i.updateTriggersChanged&&(i.updateTriggersChanged.all||i.updateTriggersChanged.getIcon))&&f.packIcons(u,l),i.extensionsChanged){var d,g=this.context.gl;null===(d=this.state.model)||void 0===d||d.delete(),this.state.model=this._getModel(g),o.invalidateAll()}}},{key:"isLoaded",get:function(){return c()(A()(n.prototype),"isLoaded",this)&&this.state.iconManager.isLoaded}},{key:"finalizeState",value:function(t){c()(A()(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.sizeMinPixels,o=n.sizeMaxPixels,a=n.sizeUnits,s=n.billboard,u=n.alphaCutoff,c=this.state.iconManager.getTexture();c&&this.state.model.setUniforms(e).setUniforms({iconsTexture:c,iconsTextureDim:[c.width,c.height],sizeUnits:_.e[a],sizeScale:r,sizeMinPixels:i,sizeMaxPixels:o,billboard:s,alphaCutoff:u}).draw()}},{key:"_getModel",value:function(t){return new w.a(t,U(U({},this.getShaders()),{},{id:this.props.id,geometry:new E.a({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):b.a.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}(x.a);m()(H,"defaultProps",V),m()(H,"layerName","IconLayer")},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(115),i=n(22),o=n(136);class a extends r.a{get x(){return this[0]}set x(t){this[0]=Object(i.a)(t)}get y(){return this[1]}set y(t){this[1]=Object(i.a)(t)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let t=0;for(let e=0;e<this.ELEMENTS;++e)t+=this[e]*this[e];return t}magnitudeSquared(){return this.lengthSquared()}distance(t){return Math.sqrt(this.distanceSquared(t))}distanceSquared(t){let e=0;for(let n=0;n<this.ELEMENTS;++n){const r=this[n]-t[n];e+=r*r}return Object(i.a)(e)}dot(t){let e=0;for(let n=0;n<this.ELEMENTS;++n)e+=this[n]*t[n];return Object(i.a)(e)}normalize(){const t=this.magnitude();if(0!==t)for(let e=0;e<this.ELEMENTS;++e)this[e]/=t;return this.check()}multiply(...t){for(const e of t)for(let t=0;t<this.ELEMENTS;++t)this[t]*=e[t];return this.check()}divide(...t){for(const e of t)for(let t=0;t<this.ELEMENTS;++t)this[t]/=e[t];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(t){return this.distance(t)}distanceToSquared(t){return this.distanceSquared(t)}getComponent(t){return Object(o.a)(t>=0&&t<this.ELEMENTS,"index is out of range"),Object(i.a)(this[t])}setComponent(t,e){return Object(o.a)(t>=0&&t<this.ELEMENTS,"index is out of range"),this[t]=e,this.check()}addVectors(t,e){return this.copy(t).add(e)}subVectors(t,e){return this.copy(t).subtract(e)}multiplyVectors(t,e){return this.copy(t).multiply(e)}addScaledVector(t,e){return this.add(new this.constructor(t).multiplyScalar(e))}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(13);class i extends(function(t){function e(){var e=Reflect.construct(t,Array.from(arguments));return Object.setPrototypeOf(e,Object.getPrototypeOf(this)),e}return e.prototype=Object.create(t.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t,e}(Array)){clone(){return(new this.constructor).copy(this)}fromArray(t,e=0){for(let n=0;n<this.ELEMENTS;++n)this[n]=t[n+e];return this.check()}toArray(t=[],e=0){for(let n=0;n<this.ELEMENTS;++n)t[e+n]=this[n];return t}from(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}to(t){return t===this?this:Object(r.f)(t)?this.toArray(t):this.toObject(t)}toTarget(t){return t?this.to(t):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(r.b)}formatString(t){let e="";for(let n=0;n<this.ELEMENTS;++n)e+=(n>0?", ":"")+Object(r.e)(this[n],t);return"".concat(t.printTypes?this.constructor.name:"","[").concat(e,"]")}equals(t){if(!t||this.length!==t.length)return!1;for(let e=0;e<this.ELEMENTS;++e)if(!Object(r.d)(this[e],t[e]))return!1;return!0}exactEquals(t){if(!t||this.length!==t.length)return!1;for(let e=0;e<this.ELEMENTS;++e)if(this[e]!==t[e])return!1;return!0}negate(){for(let t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}lerp(t,e,n){if(void 0===n)return this.lerp(this,t,e);for(let r=0;r<this.ELEMENTS;++r){const i=t[r];this[r]=i+n*(e[r]-i)}return this.check()}min(t){for(let e=0;e<this.ELEMENTS;++e)this[e]=Math.min(t[e],this[e]);return this.check()}max(t){for(let e=0;e<this.ELEMENTS;++e)this[e]=Math.max(t[e],this[e]);return this.check()}clamp(t,e){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t[n]),e[n]);return this.check()}add(...t){for(const e of t)for(let t=0;t<this.ELEMENTS;++t)this[t]+=e[t];return this.check()}subtract(...t){for(const e of t)for(let t=0;t<this.ELEMENTS;++t)this[t]-=e[t];return this.check()}scale(t){if("number"==typeof t)for(let e=0;e<this.ELEMENTS;++e)this[e]*=t;else for(let e=0;e<this.ELEMENTS&&e<t.length;++e)this[e]*=t[e];return this.check()}multiplyByScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}check(){if(r.b.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}validate(){let t=this.length===this.ELEMENTS;for(let e=0;e<this.ELEMENTS;++e)t=t&&Number.isFinite(this[e]);return t}sub(t){return this.subtract(t)}setScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]=t;return this.check()}addScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]+=t;return this.check()}subScalar(t){return this.addScalar(-t)}multiplyScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}divideScalar(t){return this.multiplyByScalar(1/t)}clampScalar(t,e){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t),e);return this.check()}get elements(){return this}}},function(t,e,n){"use strict";var r=n(37),i=n.n(r),o=n(9),a=n.n(o),s=n(12),u=n(99),c=n(75),l=n(81),h=n(77),f=n(18);function p(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return d(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 d(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=n.call(t)},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 d(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 A=Object(h.a)((function(t){var e=t.viewport,n=t.center;return new c.a(e.viewProjectionMatrix).invert().transform(n)})),g=Object(h.a)((function(t){var e,n=t.viewport,r=t.shadowMatrices,o=[],s=n.pixelUnprojectionMatrix,u=n.isGeospatial?void 0:1,h=[[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=a()(t,3),r=n[0],i=n[1],o=n[2],s=Object(f.n)([r,i,o],e);if(Number.isFinite(o))return s;return[s[0],s[1],0]}(t,s)})),d=p(r);try{var A=function(){var t=e.value,r=t.clone().translate(new l.a(n.center).negate()),a=h.map((function(t){return r.transform(t)})),s=(new c.a).ortho({left:Math.min.apply(Math,i()(a.map((function(t){return t[0]})))),right:Math.max.apply(Math,i()(a.map((function(t){return t[0]})))),bottom:Math.min.apply(Math,i()(a.map((function(t){return t[1]})))),top:Math.max.apply(Math,i()(a.map((function(t){return t[1]})))),near:Math.min.apply(Math,i()(a.map((function(t){return-t[2]})))),far:Math.max.apply(Math,i()(a.map((function(t){return-t[2]}))))});o.push(s.multiplyRight(t))};for(d.s();!(e=d.n()).done;)A()}catch(t){d.e(t)}finally{d.f()}return o})),m=[0,0,0,1],y=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0];function v(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||m,shadow_uLightId:t.shadowLightId||0,shadow_uLightCount:t.shadowMatrices.length},i=A({viewport:t.viewport,center:e.project_uCenter}),o=[],a=g({shadowMatrices:t.shadowMatrices,viewport:t.viewport}).slice(),u=0;u<t.shadowMatrices.length;u++){var c=a[u],h=c.clone().translate(new l.a(t.viewport.center).negate());e.project_uCoordinateSystem===s.a.LNGLAT&&e.project_uProjectionMode===s.d.WEB_MERCATOR?(a[u]=h,o[u]=i):(a[u]=c.clone().multiplyRight(y),o[u]=h.transform(i))}for(var f=0;f<a.length;f++)r["shadow_uViewProjectionMatrices[".concat(f,"]")]=a[f],r["shadow_uProjectCenters[".concat(f,"]")]=o[f],t.shadowMaps&&t.shadowMaps.length>0?r["shadow_uShadowMap".concat(f)]=t.shadowMaps[f]:r["shadow_uShadowMap".concat(f)]=t.dummyShadowMap;return r}e.a={name:"shadow",dependencies:[u.a],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)?v(t,e):{}}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return p})),n.d(e,"b",(function(){return d}));var r=n(68),i=n(86),o=n(12),a=n(77),s=[0,0,0,0],u=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],c=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],l=[0,0,0],h=[0,0,0],f=Object(a.a)((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,c=t.viewMatrix,l=t.viewProjectionMatrix,h=s,f=s,d=t.cameraPosition,A=p(t,e,n),g=A.geospatialOrigin,m=A.shaderCoordinateOrigin;A.offsetMode&&(f=t.projectPosition(g||m),d=[d[0]-f[0],d[1]-f[1],d[2]-f[2]],f[3]=1,h=i.b([],f,l),c=o||c,l=r.b([],a,c),l=r.b([],l,u));return{viewMatrix:c,viewProjectionMatrix:l,projectionCenter:h,originCommon:f,cameraPosCommon:d,shaderCoordinateOrigin:m,geospatialOrigin:g}}(e,a,h),d=f.projectionCenter,A=f.viewProjectionMatrix,g=f.originCommon,m=f.cameraPosCommon,y=f.shaderCoordinateOrigin,v=f.geospatialOrigin,_=e.getDistanceScales(),b=[e.width*n,e.height*n],x=i.b([],[0,0,-e.focalDistance,1],e.projectionMatrix)[3]||1,w={project_uCoordinateSystem:a,project_uProjectionMode:e.projectionMode,project_uCoordinateOrigin:y,project_uCommonOrigin:g.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:l,project_uScale:e.scale,project_uWrapLongitude:!1,project_uViewProjectionMatrix:A,project_uModelMatrix:c,project_uCameraPosition:m};if(v){var E=e.getDistanceScales(v);switch(a){case o.a.METER_OFFSETS:w.project_uCommonUnitsPerWorldUnit=E.unitsPerMeter,w.project_uCommonUnitsPerWorldUnit2=E.unitsPerMeter2;break;case o.a.LNGLAT:case o.a.LNGLAT_OFFSETS:e._pseudoMeters||(w.project_uCommonUnitsPerMeter=E.unitsPerMeter),w.project_uCommonUnitsPerWorldUnit=E.unitsPerDegree,w.project_uCommonUnitsPerWorldUnit2=E.unitsPerDegree2;break;case o.a.CARTESIAN:w.project_uCommonUnitsPerWorldUnit=[1,1,E.unitsPerMeter[2]],w.project_uCommonUnitsPerWorldUnit2=[0,0,E.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.a.LNGLAT_OFFSETS||e===o.a.METER_OFFSETS?n:t.isGeospatial?[Math.fround(t.longitude),Math.fround(t.latitude),0]:null,t.projectionMode){case o.d.WEB_MERCATOR:e!==o.a.LNGLAT&&e!==o.a.CARTESIAN||(r=[0,0,0],a=!1);break;case o.d.WEB_MERCATOR_AUTO_OFFSET:e===o.a.LNGLAT?i=r:e===o.a.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.d.IDENTITY:(i=t.position.map(Math.fround))[2]=i[2]||0;break;case o.d.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.a.DEFAULT:s,l=t.coordinateOrigin,p=void 0===l?h:l,d=t.autoWrapLongitude,A=void 0!==d&&d;u===o.a.DEFAULT&&(u=e.isGeospatial?o.a.LNGLAT:o.a.CARTESIAN);var g=f({viewport:e,devicePixelRatio:r,coordinateSystem:u,coordinateOrigin:p});return g.project_uWrapLongitude=A,g.project_uModelMatrix=a||c,g}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(3),i=n.n(r),o=n(4),a=n.n(o),s=function(){function t(e,n){i()(this,t),this._viewportProps=this.applyConstraints(e),this._state=n}return a()(t,[{key:"getViewportProps",value:function(){return this._viewportProps}},{key:"getState",value:function(){return this._state}}]),t}()},function(t,e,n){"use strict";n.d(e,"b",(function(){return u})),n.d(e,"a",(function(){return c})),n.d(e,"c",(function(){return l}));var r=n(149),i=n(21),o=n(120),a=n(103);const s="Cannot convert supplied data type";function u(t,e,n){if(e.text&&"string"==typeof t)return t;if(Object(i.c)(t)&&(t=t.buffer),t instanceof ArrayBuffer){const n=t;if(e.text&&!e.binary){return new TextDecoder("utf8").decode(n)}return n}if(ArrayBuffer.isView(t)){if(e.text&&!e.binary){return new TextDecoder("utf8").decode(t)}let n=t.buffer;const r=t.byteLength||t.length;return 0===t.byteOffset&&r===n.byteLength||(n=n.slice(t.byteOffset,t.byteOffset+r)),n}throw new Error(s)}async function c(t,e,n){const c=t instanceof ArrayBuffer||ArrayBuffer.isView(t);if("string"==typeof t||c)return u(t,e);if(Object(i.b)(t)&&(t=await Object(a.b)(t)),Object(i.j)(t)){const n=t;return await Object(a.a)(n),e.binary?await n.arrayBuffer():await n.text()}if(Object(i.i)(t)&&(t=Object(o.a)(t,n)),Object(i.d)(t)||Object(i.a)(t))return Object(r.a)(t);throw new Error(s)}async function l(t,e){if(Object(i.e)(t))return t;if(Object(i.j)(t)){const n=t;await Object(a.a)(n);const r=await n.body;return Object(o.a)(r,e)}return Object(i.b)(t)||Object(i.i)(t)?Object(o.a)(t,e):Object(i.a)(t)?t[Symbol.asyncIterator]():function(t){if(ArrayBuffer.isView(t))return function*(){yield t.buffer}();if(t instanceof ArrayBuffer)return function*(){yield t}();if(Object(i.e)(t))return t;if(Object(i.d)(t))return t[Symbol.iterator]();throw new Error(s)}(t)}},function(t,e,n){"use strict";const r=262144;var i=n(69),o=n(83);function a(t,e){return i.c?async function*(t,e){const n=t.getReader();let r;try{for(;;){const t=r||n.read();null!=e&&e._streamReadAhead&&(r=n.read());const{done:i,value:a}=await t;if(i)return;yield Object(o.d)(a)}}catch(t){n.releaseLock()}}(t,e):async function*(t,e){for await(const e of t)yield Object(o.d)(e)}(t)}var s=n(21);function u(t,e){if("string"==typeof t)return function*(t,e){const n=(null==e?void 0:e.chunkSize)||262144;let r=0;const i=new TextEncoder;for(;r<t.length;){const e=Math.min(t.length-r,n),o=t.slice(r,r+e);r+=e,yield i.encode(o)}}(t,e);if(t instanceof ArrayBuffer)return function*(t,e={}){const{chunkSize:n=r}=e;let i=0;for(;i<t.byteLength;){const e=Math.min(t.byteLength-i,n),r=new ArrayBuffer(e),o=new Uint8Array(t,i,e);new Uint8Array(r).set(o),i+=e,yield r}}(t,e);if(Object(s.b)(t))return async function*(t,e){const n=(null==e?void 0:e.chunkSize)||1048576;let r=0;for(;r<t.size;){const e=r+n,i=await t.slice(r,e).arrayBuffer();r=e,yield i}}(t,e);if(Object(s.i)(t))return a(t,e);if(Object(s.j)(t)){return a(t.body,e)}throw new Error("makeIterator")}n.d(e,"a",(function(){return u}))},function(t,e,n){"use strict";n.r(e),n.d(e,"MODULE_VERSION",(function(){return r})),n.d(e,"MODULE_NAME",(function(){return i}));var r="8.9.0-alpha.5",i="@deck.gl/jupyter-widget"},function(t,e,n){var r,i,o;
/**
* @license long.js (c) 2013 Daniel Wirtz <dcode@dcode.io>
* Released under the Apache License, Version 2.0
* see: https://github.com/dcodeIO/long.js for details
*/i=[],void 0===(o="function"==typeof(r=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?A:d;if(e){if(t<0)return A;if(t>=h)return _}else{if(t<=-f)return b;if(t+1>=f)return v}return t<0?o(-t,e).neg():a(t%l|0,t/l|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 d;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=d,c=0;c<t.length;c+=8){var l=Math.min(8,t.length-c),h=parseInt(t.substring(c,c+l),n);if(l<8){var f=o(s(n,l));a=a.mul(f).add(o(h))}else a=(a=a.mul(i)).add(o(h))}return a.unsigned=e,a}function c(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=c;var l=4294967296,h=l*l,f=h/2,p=i(1<<24),d=i(0);t.ZERO=d;var A=i(0,!0);t.UZERO=A;var g=i(1);t.ONE=g;var m=i(1,!0);t.UONE=m;var y=i(-1);t.NEG_ONE=y;var v=a(-1,2147483647,!1);t.MAX_VALUE=v;var _=a(-1,-1,!0);t.MAX_UNSIGNED_VALUE=_;var b=a(0,-2147483648,!1);t.MIN_VALUE=b;var x=t.prototype;return x.toInt=function(){return this.unsigned?this.low>>>0:this.low},x.toNumber=function(){return this.unsigned?(this.high>>>0)*l+(this.low>>>0):this.high*l+(this.low>>>0)},x.toString=function(t){if((t=t||10)<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(b)){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 c=a.div(i),l=(a.sub(c.mul(i)).toInt()>>>0).toString(t);if((a=c).isZero())return l+u;for(;l.length<6;)l="0"+l;u=""+l+u}},x.getHighBits=function(){return this.high},x.getHighBitsUnsigned=function(){return this.high>>>0},x.getLowBits=function(){return this.low},x.getLowBitsUnsigned=function(){return this.low>>>0},x.getNumBitsAbs=function(){if(this.isNegative())return this.eq(b)?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},x.isZero=function(){return 0===this.high&&0===this.low},x.isNegative=function(){return!this.unsigned&&this.high<0},x.isPositive=function(){return this.unsigned||this.high>=0},x.isOdd=function(){return 1==(1&this.low)},x.isEven=function(){return 0==(1&this.low)},x.equals=function(t){return e(t)||(t=c(t)),(this.unsigned===t.unsigned||this.high>>>31!=1||t.high>>>31!=1)&&this.high===t.high&&this.low===t.low},x.eq=x.equals,x.notEquals=function(t){return!this.eq(t)},x.neq=x.notEquals,x.lessThan=function(t){return this.comp(t)<0},x.lt=x.lessThan,x.lessThanOrEqual=function(t){return this.comp(t)<=0},x.lte=x.lessThanOrEqual,x.greaterThan=function(t){return this.comp(t)>0},x.gt=x.greaterThan,x.greaterThanOrEqual=function(t){return this.comp(t)>=0},x.gte=x.greaterThanOrEqual,x.compare=function(t){if(e(t)||(t=c(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},x.comp=x.compare,x.negate=function(){return!this.unsigned&&this.eq(b)?b:this.not().add(g)},x.neg=x.negate,x.add=function(t){e(t)||(t=c(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,l=t.low>>>16,h=0,f=0,p=0,d=0;return p+=(d+=o+(65535&t.low))>>>16,f+=(p+=i+l)>>>16,h+=(f+=r+u)>>>16,h+=n+s,a((p&=65535)<<16|(d&=65535),(h&=65535)<<16|(f&=65535),this.unsigned)},x.subtract=function(t){return e(t)||(t=c(t)),this.add(t.neg())},x.sub=x.subtract,x.multiply=function(t){if(this.isZero())return d;if(e(t)||(t=c(t)),t.isZero())return d;if(this.eq(b))return t.isOdd()?b:d;if(t.eq(b))return this.isOdd()?b:d;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(p)&&t.lt(p))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,l=65535&t.high,h=t.low>>>16,f=65535&t.low,A=0,g=0,m=0,y=0;return m+=(y+=s*f)>>>16,g+=(m+=i*f)>>>16,m&=65535,g+=(m+=s*h)>>>16,A+=(g+=r*f)>>>16,g&=65535,A+=(g+=i*h)>>>16,g&=65535,A+=(g+=s*l)>>>16,A+=n*f+r*h+i*l+s*u,a((m&=65535)<<16|(y&=65535),(A&=65535)<<16|(g&=65535),this.unsigned)},x.mul=x.multiply,x.divide=function(t){if(e(t)||(t=c(t)),t.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?A:d;var n,r,i;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return A;if(t.gt(this.shru(1)))return m;i=A}else{if(this.eq(b))return t.eq(g)||t.eq(y)?b:t.eq(b)?g:(n=this.shr(1).div(t).shl(1)).eq(d)?t.isNegative()?g:y:(r=this.sub(t.mul(n)),i=n.add(r.div(t)));if(t.eq(b))return this.unsigned?A:d;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=d}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),l=o(n),h=l.mul(t);h.isNegative()||h.gt(r);)h=(l=o(n-=u,this.unsigned)).mul(t);l.isZero()&&(l=g),i=i.add(l),r=r.sub(h)}return i},x.div=x.divide,x.modulo=function(t){return e(t)||(t=c(t)),this.sub(this.div(t).mul(t))},x.mod=x.modulo,x.not=function(){return a(~this.low,~this.high,this.unsigned)},x.and=function(t){return e(t)||(t=c(t)),a(this.low&t.low,this.high&t.high,this.unsigned)},x.or=function(t){return e(t)||(t=c(t)),a(this.low|t.low,this.high|t.high,this.unsigned)},x.xor=function(t){return e(t)||(t=c(t)),a(this.low^t.low,this.high^t.high,this.unsigned)},x.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)},x.shl=x.shiftLeft,x.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)},x.shr=x.shiftRight,x.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)},x.shru=x.shiftRightUnsigned,x.toSigned=function(){return this.unsigned?a(this.low,this.high,!1):this},x.toUnsigned=function(){return this.unsigned?this:a(this.low,this.high,!0)},x.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},x.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]},x.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})?r.apply(e,i):r)||(t.exports=o)},function(t,e,n){"use strict";n.d(e,"a",(function(){return f})),n.d(e,"b",(function(){return p}));var r=n(50),i=n(12);function o(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return a(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 a(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,s=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){u=!0,o=t},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw o}}}}function a(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 s=Math.PI/180,u=new Float32Array(16),c=new Float32Array(12);function l(t,e,n){var r=e[0]*s,i=e[1]*s,o=e[2]*s,a=Math.sin(o),u=Math.sin(r),c=Math.sin(i),l=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*c*h,t[2]=p*-u,t[3]=d*(-c*l+f*u*a),t[4]=d*(f*l+c*u*a),t[5]=d*h*a,t[6]=A*(c*a+f*u*l),t[7]=A*(-f*a+c*u*l),t[8]=A*h*l}function h(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 f={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,i=e.endRow,a=this.props,s=a.data,f=a.getOrientation,p=a.getScale,d=a.getTranslation,A=a.getTransformMatrix,g=Array.isArray(A),m=g&&16===A.length,y=Array.isArray(p),v=Array.isArray(f),_=Array.isArray(d),b=m||!g&&Boolean(A(s[0]));t.constant=b?m:v&&y&&_;var x=t.value;if(t.constant){var w;if(b)u.set(A),w=h(u);else l(w=c,f,p),w.set(d,9);t.value=new Float32Array(w)}else{var E,O=n*t.size,S=Object(r.a)(s,n,i),T=S.iterable,C=S.objectInfo,P=o(T);try{for(P.s();!(E=P.n()).done;){var M=E.value;C.index++;var I=void 0;if(b)u.set(m?A:A(M,C)),I=h(u);else l(I=c,v?f:f(M,C),y?p:p(M,C)),I.set(_?d:d(M,C),9);x[O++]=I[0],x[O++]=I[1],x[O++]=I[2],x[O++]=I[3],x[O++]=I[4],x[O++]=I[5],x[O++]=I[6],x[O++]=I[7],x[O++]=I[8],x[O++]=I[9],x[O++]=I[10],x[O++]=I[11]}}catch(t){P.e(t)}finally{P.f()}}}};function p(t,e){return e===i.a.CARTESIAN||e===i.a.METER_OFFSETS||e===i.a.DEFAULT&&!t.isGeospatial}},function(t,e,n){"use strict";(function(t){n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return s}));var r,i=n(176);t.browser&&(r=n(265));var o="https://api.tiles.mapbox.com/mapbox-gl-js/v1.2.1/mapbox-gl.css";function a(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o;Object(i.b)(t)}function s(){for(var t=0,e=["mapboxgl-missing-css"];t<e.length;t++){var n=e[t],r=document.getElementsByClassName(n)[0];r&&r.style&&(r.style.display="none")}}e.a=r}).call(this,n(63))},function(t,e,n){"use strict";n.d(e,"a",(function(){return a})),n.d(e,"b",(function(){return s}));var r=n(8),i=n(73),o=n(134);class a{constructor(){this.stats=new Map}get(t){return this.stats.has(t)||this.stats.set(t,new i.a({id:t})),this.stats.get(t)}}const s=new a;if(globalThis.luma&&"8.5.16"!==globalThis.luma.VERSION)throw new Error("luma.gl - multiple VERSIONs detected: ".concat(globalThis.luma.VERSION," vs ").concat("8.5.16"));globalThis.luma||(Object(o.a)()&&r.k.log(1,"luma.gl ".concat("8.5.16"," - ").concat("set luma.log.level=1 (or higher) to trace rendering"))(),globalThis.luma=globalThis.luma||{VERSION:"8.5.16",version:"8.5.16",log:r.k,stats:s,globals:{modules:{},nodeIO:{}}});globalThis.luma},function(t,e){},function(t,e,n){"use strict";var r=n(1),i=n(47);class o{}var a=n(49);const s=new Map;function u(t){Object(a.a)(t.source&&!t.url||!t.source&&t.url);let e=s.get(t.source||t.url);return e||(t.url&&(e=function(t){if(!t.startsWith("http"))return t;return c((e=t,"try {\n importScripts('".concat(e,"');\n} catch (error) {\n console.error(error);\n throw error;\n}")));var e}(t.url),s.set(t.url,e)),t.source&&(e=c(t.source),s.set(t.source,e))),Object(a.a)(e),e}function c(t){const e=new Blob([t],{type:"application/javascript"});return URL.createObjectURL(e)}var l=n(171);const h=()=>{};class f{static isSupported(){return"undefined"!=typeof Worker&&i.b||void 0!==o&&!i.b}constructor(t){Object(r.a)(this,"name",void 0),Object(r.a)(this,"source",void 0),Object(r.a)(this,"url",void 0),Object(r.a)(this,"terminated",!1),Object(r.a)(this,"worker",void 0),Object(r.a)(this,"onMessage",void 0),Object(r.a)(this,"onError",void 0),Object(r.a)(this,"_loadableURL","");const{name:e,source:n,url:o}=t;Object(a.a)(n||o),this.name=e,this.source=n,this.url=o,this.onMessage=h,this.onError=t=>console.log(t),this.worker=i.b?this._createBrowserWorker():this._createNodeWorker()}destroy(){this.onMessage=h,this.onError=h,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(t,e){e=e||Object(l.a)(t),this.worker.postMessage(t,e)}_getErrorFromErrorEvent(t){let e="Failed to load ";return e+="worker ".concat(this.name," from ").concat(this.url,". "),t.message&&(e+="".concat(t.message," in ")),t.lineno&&(e+=":".concat(t.lineno,":").concat(t.colno)),new Error(e)}_createBrowserWorker(){this._loadableURL=u({source:this.source,url:this.url});const t=new Worker(this._loadableURL,{name:this.name});return t.onmessage=t=>{t.data?this.onMessage(t.data):this.onError(new Error("No data received"))},t.onerror=t=>{this.onError(this._getErrorFromErrorEvent(t)),this.terminated=!0},t.onmessageerror=t=>console.error(t),t}_createNodeWorker(){let t;if(this.url){const e=this.url.includes(":/")||this.url.startsWith("/")?this.url:"./".concat(this.url);t=new o(e,{eval:!1})}else{if(!this.source)throw new Error("no worker");t=new o(this.source,{eval:!0})}return t.on("message",t=>{this.onMessage(t)}),t.on("error",t=>{this.onError(t)}),t.on("exit",t=>{}),t}}class p{constructor(t,e){Object(r.a)(this,"name",void 0),Object(r.a)(this,"workerThread",void 0),Object(r.a)(this,"isRunning",!0),Object(r.a)(this,"result",void 0),Object(r.a)(this,"_resolve",()=>{}),Object(r.a)(this,"_reject",()=>{}),this.name=t,this.workerThread=e,this.result=new Promise((t,e)=>{this._resolve=t,this._reject=e})}postMessage(t,e){this.workerThread.postMessage({source:"loaders.gl",type:t,payload:e})}done(t){Object(a.a)(this.isRunning),this.isRunning=!1,this._resolve(t)}error(t){Object(a.a)(this.isRunning),this.isRunning=!1,this._reject(t)}}class d{static isSupported(){return f.isSupported()}constructor(t){Object(r.a)(this,"name","unnamed"),Object(r.a)(this,"source",void 0),Object(r.a)(this,"url",void 0),Object(r.a)(this,"maxConcurrency",1),Object(r.a)(this,"maxMobileConcurrency",1),Object(r.a)(this,"onDebug",()=>{}),Object(r.a)(this,"reuseWorkers",!0),Object(r.a)(this,"props",{}),Object(r.a)(this,"jobQueue",[]),Object(r.a)(this,"idleQueue",[]),Object(r.a)(this,"count",0),Object(r.a)(this,"isDestroyed",!1),this.source=t.source,this.url=t.url,this.setProps(t)}destroy(){this.idleQueue.forEach(t=>t.destroy()),this.isDestroyed=!0}setProps(t){this.props={...this.props,...t},void 0!==t.name&&(this.name=t.name),void 0!==t.maxConcurrency&&(this.maxConcurrency=t.maxConcurrency),void 0!==t.maxMobileConcurrency&&(this.maxMobileConcurrency=t.maxMobileConcurrency),void 0!==t.reuseWorkers&&(this.reuseWorkers=t.reuseWorkers),void 0!==t.onDebug&&(this.onDebug=t.onDebug)}async startJob(t,e=((t,e,n)=>t.done(n)),n=((t,e)=>t.error(e))){const r=new Promise(r=>(this.jobQueue.push({name:t,onMessage:e,onError:n,onStart:r}),this));return this._startQueuedJob(),await r}async _startQueuedJob(){if(!this.jobQueue.length)return;const t=this._getAvailableWorker();if(!t)return;const e=this.jobQueue.shift();if(e){this.onDebug({message:"Starting job",name:e.name,workerThread:t,backlog:this.jobQueue.length});const n=new p(e.name,t);t.onMessage=t=>e.onMessage(n,t.type,t.payload),t.onError=t=>e.onError(n,t),e.onStart(n);try{await n.result}finally{this.returnWorkerToQueue(t)}}}returnWorkerToQueue(t){this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(t.destroy(),this.count--):this.idleQueue.push(t),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count<this._getMaxConcurrency()){this.count++;const t="".concat(this.name.toLowerCase()," (#").concat(this.count," of ").concat(this.maxConcurrency,")");return new f({name:t,source:this.source,url:this.url})}return null}_getMaxConcurrency(){return i.c?this.maxMobileConcurrency:this.maxConcurrency}}n.d(e,"a",(function(){return g}));const A={maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:()=>{}};class g{static isSupported(){return f.isSupported()}static getWorkerFarm(t={}){return g._workerFarm=g._workerFarm||new g({}),g._workerFarm.setProps(t),g._workerFarm}constructor(t){Object(r.a)(this,"props",void 0),Object(r.a)(this,"workerPools",new Map),this.props={...A},this.setProps(t),this.workerPools=new Map}destroy(){for(const t of this.workerPools.values())t.destroy();this.workerPools=new Map}setProps(t){this.props={...this.props,...t};for(const t of this.workerPools.values())t.setProps(this._getWorkerPoolProps())}getWorkerPool(t){const{name:e,source:n,url:r}=t;let i=this.workerPools.get(e);return i||(i=new d({name:e,source:n,url:r}),i.setProps(this._getWorkerPoolProps()),this.workerPools.set(e,i)),i}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}}Object(r.a)(g,"_workerFarm",void 0)},function(t,e,n){"use strict";async function*r(t,e={}){const n=new TextDecoder(void 0,e);for await(const e of t)yield"string"==typeof e?e:n.decode(e,{stream:!0})}async function*i(t){const e=new TextEncoder;for await(const n of t)yield"string"==typeof n?e.encode(n):n}async function*o(t){let e="";for await(const n of t){let t;for(e+=n;(t=e.indexOf("\n"))>=0;){const n=e.slice(0,t+1);e=e.slice(t+1),yield n}}e.length>0&&(yield e)}async function*a(t){let e=1;for await(const n of t)yield{counter:e,line:n},e++}n.d(e,"c",(function(){return r})),n.d(e,"d",(function(){return i})),n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return a}))},function(t,e,n){"use strict";function r(t,e=5){if("string"==typeof t)return t.slice(0,e);if(ArrayBuffer.isView(t))return i(t.buffer,t.byteOffset,e);if(t instanceof ArrayBuffer){return i(t,0,e)}return""}function i(t,e,n){if(t.byteLength<=e+n)return"";const r=new DataView(t);let i="";for(let t=0;t<n;t++)i+=String.fromCharCode(r.getUint8(e+t));return i}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";(function(t){function r(){let e;if("undefined"!=typeof window&&window.performance)e=window.performance.now();else if(void 0!==t&&t.hrtime){const n=t.hrtime();e=1e3*n[0]+n[1]/1e6}else e=Date.now();return e}n.d(e,"a",(function(){return r}))}).call(this,n(63))},function(t,e,n){"use strict";n.d(e,"c",(function(){return a})),n.d(e,"b",(function(){return s})),n.d(e,"a",(function(){return c}));var r=n(27),i=n.n(r),o=n(23);function a(t){var e=p(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 s(t,e){var n=c({newProps:t,oldProps:e,propTypes:p(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(f(t,e,"all"))return{all:!0}}var n={},r=!1;for(var i in t.updateTriggers){if("all"!==i)f(t,e,i)&&(n[i]=!0,r=!0)}return!!r&&n}(t,e)),{dataChanged:r,propsChanged:n,updateTriggersChanged:i,extensionsChanged:h(t,e),transitionsChanged:u(t,e)}}function u(t,e){if(!t.transitions)return!1;var n={},r=p(t),i=!1;for(var o in t.transitions){var a=r[o],s=a&&a.type;("number"===s||"color"===s||"array"===s)&&l(t[o],e[o],a)&&(n[o]=!0,i=!0)}return!!i&&n}function c(t){var e=t.newProps,n=t.oldProps,r=t.ignoreProps,o=void 0===r?{}:r,a=t.propTypes,s=void 0===a?{}:a,u=t.triggerName,c=void 0===u?"props":u;if(n===e)return!1;if("object"!==i()(e)||null===e)return"".concat(c," changed shallowly");if("object"!==i()(n)||null===n)return"".concat(c," changed shallowly");for(var h=0,f=Object.keys(e);h<f.length;h++){var p=f[h];if(!(p in o)){if(!(p in n))return"".concat(c,".").concat(p," added");var d=l(e[p],n[p],s[p]);if(d)return"".concat(c,".").concat(p," ").concat(d)}}for(var A=0,g=Object.keys(n);A<g.length;A++){var m=g[A];if(!(m in o)){if(!(m in e))return"".concat(c,".").concat(m," dropped");if(!Object.hasOwnProperty.call(e,m)){var y=l(e[m],n[m],s[m]);if(y)return"".concat(c,".").concat(m," ").concat(y)}}}return!1}function l(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 h(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 f(t,e,n){var r=t.updateTriggers[n];r=null==r?{}:r;var i=e.updateTriggers[n];return c({oldProps:i=null==i?{}:i,newProps:r,triggerName:n})}function p(t){var e=t[o.d],n=e&&e.constructor;return n?n._propTypes:{}}},function(t,e,n){"use strict";var r=n(3),i=n.n(r),o=n(4),a=n.n(o),s=n(0),u=n.n(s),c=n(195),l=n(102),h=n(145),f=n(97),p=n(75),d=n(81),A=n(7),g=n.n(A),m=n(5),y=n.n(m),v=n(6),_=n.n(v),b=n(2),x=n.n(b),w=n(70),E=n(104),O=n(71),S=n(8);function T(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 C(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?T(Object(n),!0).forEach((function(e){u()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function P(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=x()(t);if(e){var i=x()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return _()(this,n)}}var M=function(t){y()(n,t);var e=P(n);function n(t,r){var o,a,s;return i()(this,n),(s=e.call(this,t,r)).shadowMap=new l.a(t,{width:1,height:1,parameters:(o={},u()(o,10241,9729),u()(o,10240,9729),u()(o,10242,33071),u()(o,10243,33071),o)}),s.depthBuffer=new E.a(t,{format:33189,width:1,height:1}),s.fbo=new O.a(t,{id:"shadowmap",width:1,height:1,attachments:(a={},u()(a,36064,s.shadowMap),u()(a,36096,s.depthBuffer),a)}),s}return a()(n,[{key:"render",value:function(t){var e=this,r=this.fbo;Object(S.o)(this.gl,{depthRange:[0,1],depthTest:!0,blend:!1,clearColor:[1,1,1,1]},(function(){var i=t.viewports[0],o=Object(S.e)(e.gl),a=i.width*o,s=i.height*o;a===r.width&&s===r.height||r.resize({width:a,height:s}),g()(x()(n.prototype),"render",e).call(e,C(C({},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}(w.a),I=n(116);function B(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){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=n.call(t)},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}n.d(e,"a",(function(){return j}));var k={color:[255,255,255],intensity:1},L=[{color:[255,255,255],intensity:1,direction:[-1,3,-1]},{color:[255,255,255],intensity:.9,direction:[1,-8,-2.5]}],D=[0,0,0,200/255],j=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};for(var n in i()(this,t),u()(this,"id","lighting-effect"),u()(this,"props",null),u()(this,"shadowColor",D),u()(this,"ambientLight",null),u()(this,"directionalLights",[]),u()(this,"pointLights",[]),u()(this,"shadowPasses",[]),u()(this,"shadowMaps",[]),u()(this,"dummyShadowMap",null),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 a()(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=c.a.getDefaultProgramManager(t),I.a&&this.programManager.addDefaultModule(I.a)),this.dummyShadowMap||(this.dummyShadowMap=new l.a(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=B(this.shadowPasses);try{for(e.s();!(t=e.n()).done;){t.value.delete()}}catch(t){e.e(t)}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(I.a),this.programManager=null)}},{key:"_calculateMatrices",value:function(){var t,e=[],n=B(this.directionalLights);try{for(n.s();!(t=n.n()).done;){var r=t.value,i=(new p.a).lookAt({eye:new d.a(r.direction).negate()});e.push(i)}}catch(t){n.e(t)}finally{n.f()}return e}},{key:"_createShadowPasses",value:function(t){for(var e=0;e<this.directionalLights.length;e++){var n=new M(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 h.a(k),this.directionalLights.push(new f.a(L[0]),new f.a(L[1])))}}]),t}()},function(e,n){e.exports=t},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return i}));var r=n(167);function i(){return!("object"==typeof t&&"[object process]"===String(t)&&!t.browser)||Object(r.a)()}}).call(this,n(63))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(8);function i(t,e,n){const{removedProps:i={},deprecatedProps:o={},replacedProps:a={}}=n;for(const n in i)if(n in e){const e=i[n]?"".concat(t,".").concat(i[n]):"N/A";r.k.removed("".concat(t,".").concat(n),e)()}for(const n in o)if(n in e){const e=o[n];r.k.deprecated("".concat(t,".").concat(n),"".concat(t,".").concat(e))()}let s=null;for(const n in a)if(n in e){const i=a[n];r.k.deprecated("".concat(t,".").concat(n),"".concat(t,".").concat(i))(),s=s||Object.assign({},e),s[i]=e[n],delete s[n]}return s||e}},function(t,e,n){"use strict";function r(t,e){if(!t)throw new Error("math.gl assertion ".concat(e))}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return f})),n.d(e,"b",(function(){return p}));var r=n(9),i=n.n(r),o=n(12),a=n(117),s=n(84),u=n(86),c=n(80),l=n(18);function h(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=e.projectPosition(t);if(n&&e instanceof s.a){var o=i()(t,3),a=o[0],u=o[1],c=o[2],l=void 0===c?0:c,h=e.getDistanceScales([a,u]);r[2]=l*h.unitsPerMeter[2]}return r}function f(t,e){var n=e.viewport,r=e.modelMatrix,a=e.coordinateSystem,s=e.coordinateOrigin,c=e.offsetMode,f=i()(t,3),p=f[0],d=f[1],A=f[2],g=void 0===A?0:A;if(r){var m=u.b([],[p,d,g,1],r),y=i()(m,3);p=y[0],d=y[1],g=y[2]}switch(a){case o.a.LNGLAT:return h([p,d,g],n,c);case o.a.LNGLAT_OFFSETS:return h([p+s[0],d+s[1],g+(s[2]||0)],n,c);case o.a.METER_OFFSETS:return h(Object(l.a)(s,[p,d,g]),n,c);case o.a.CARTESIAN:default:return n.isGeospatial?[p+s[0],d+s[1],g+s[2]]:n.projectPosition([p,d,g])}}function p(t,e){var n=function(t){var e=t.viewport,n=t.modelMatrix,r=t.coordinateOrigin,i=t.coordinateSystem,a=t.fromCoordinateSystem,s=t.fromCoordinateOrigin;return i===o.a.DEFAULT&&(i=e.isGeospatial?o.a.LNGLAT:o.a.CARTESIAN),void 0===a&&(a=i),void 0===s&&(s=r),{viewport:e,coordinateSystem:i,coordinateOrigin:r,modelMatrix:n,fromCoordinateSystem:a,fromCoordinateOrigin:s}}(e),r=n.viewport,i=n.coordinateSystem,s=n.coordinateOrigin,u=n.modelMatrix,l=n.fromCoordinateSystem,h=n.fromCoordinateOrigin,p=Object(a.a)(r,i,s),d=p.geospatialOrigin,A=p.shaderCoordinateOrigin,g=p.offsetMode,m=f(t,{viewport:r,modelMatrix:u,coordinateSystem:l,coordinateOrigin:h,offsetMode:g});if(g){var y=r.projectPosition(d||A);c.d(m,m,y)}return m}},function(t,e,n){"use strict";var r="#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";n.d(e,"a",(function(){return s}));const i={lightSources:{}};function o(){let{color:t=[0,0,0],intensity:e=1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.map(t=>t*e/255)}function a(t){let{ambientLight:e,pointLights:n=[],directionalLights:r=[]}=t;const i={};return i["lighting_uAmbientLight.color"]=e?o(e):[0,0,0],n.forEach((t,e)=>{i["lighting_uPointLight[".concat(e,"].color")]=o(t),i["lighting_uPointLight[".concat(e,"].position")]=t.position,i["lighting_uPointLight[".concat(e,"].attenuation")]=t.attenuation||[1,0,0]}),i.lighting_uPointLightCount=n.length,r.forEach((t,e)=>{i["lighting_uDirectionalLight[".concat(e,"].color")]=o(t),i["lighting_uDirectionalLight[".concat(e,"].direction")]=t.direction}),i.lighting_uDirectionalLightCount=r.length,i}const s={name:"lights",vs:r,fs:r,getUniforms:function t(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i;if("lightSources"in e){const{ambientLight:t,pointLights:n,directionalLights:r}=e.lightSources||{};return t||n&&n.length>0||r&&r.length>0?Object.assign({},a({ambientLight:t,pointLights:n,directionalLights:r}),{lighting_uEnabled:!0}):{lighting_uEnabled:!1}}if("lights"in e){const n={pointLights:[],directionalLights:[]};for(const t of e.lights||[])switch(t.type){case"ambient":n.ambientLight=t;break;case"directional":n.directionalLights.push(t);break;case"point":n.pointLights.push(t)}return t({lightSources:n})}return{}},defines:{MAX_LIGHTS:3}}},function(t,e,n){var r;
/*! Hammer.JS - v2.0.7 - 2016-04-22
* http://hammerjs.github.io/
*
* Copyright (c) 2016 Jorik Tangelder;
* Licensed under the MIT license */!function(i,o,a,s){"use strict";var u,c=["","webkit","Moz","MS","ms","o"],l=o.createElement("div"),h=Math.round,f=Math.abs,p=Date.now;function d(t,e,n){return setTimeout(b(t,n),e)}function A(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(void 0!==t.length)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(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(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&&void 0===t[r[i]])&&(t[r[i]]=e[r[i]]),i++;return t}),"extend","Use `assign`."),v=m((function(t,e){return y(t,e,!0)}),"merge","Use `assign`.");function _(t,e,n){var r,i=e.prototype;(r=t.prototype=Object.create(i)).constructor=t,r._super=i,n&&u(r,n)}function b(t,e){return function(){return t.apply(e,arguments)}}function x(t,e){return"function"==typeof t?t.apply(e&&e[0]||void 0,e):t}function w(t,e){return void 0===t?e:t}function E(t,e,n){g(C(e),(function(e){t.addEventListener(e,n,!1)}))}function O(t,e,n){g(C(e),(function(e){t.removeEventListener(e,n,!1)}))}function S(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1}function T(t,e){return t.indexOf(e)>-1}function C(t){return t.trim().split(/\s+/g)}function P(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 M(t){return Array.prototype.slice.call(t,0)}function I(t,e,n){for(var r=[],i=[],o=0;o<t.length;){var a=e?t[o][e]:t[o];P(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 B(t,e){for(var n,r,i=e[0].toUpperCase()+e.slice(1),o=0;o<c.length;){if((r=(n=c[o])?n+i:e)in t)return r;o++}}var R=1;function k(t){var e=t.ownerDocument||t;return e.defaultView||e.parentWindow||i}var L="ontouchstart"in i,D=void 0!==B(i,"PointerEvent"),j=L&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),F=["x","y"],z=["clientX","clientY"];function U(t,e){var n=this;this.manager=t,this.callback=e,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(e){x(t.options.enable,[t])&&n.handler(e)},this.init()}function N(t,e,n){var r=n.pointers.length,i=n.changedPointers.length,o=1&e&&r-i==0,a=12&e&&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=G(e));i>1&&!n.firstMultiple?n.firstMultiple=G(e):1===i&&(n.firstMultiple=!1);var o=n.firstInput,a=n.firstMultiple,s=a?a.center:o.center,u=e.center=V(r);e.timeStamp=p(),e.deltaTime=e.timeStamp-o.timeStamp,e.angle=X(s,u),e.distance=q(s,u),function(t,e){var n=e.center,r=t.offsetDelta||{},i=t.prevDelta||{},o=t.prevInput||{};1!==e.eventType&&4!==o.eventType||(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=W(e.deltaX,e.deltaY);var c=H(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=c.x,e.overallVelocityY=c.y,e.overallVelocity=f(c.x)>f(c.y)?c.x:c.y,e.scale=a?(l=a.pointers,h=r,q(h[0],h[1],z)/q(l[0],l[1],z)):1,e.rotation=a?function(t,e){return X(e[1],e[0],z)+X(t[1],t[0],z)}(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,s=e.timeStamp-a.timeStamp;if(8!=e.eventType&&(s>25||void 0===a.velocity)){var u=e.deltaX-a.deltaX,c=e.deltaY-a.deltaY,l=H(s,u,c);r=l.x,i=l.y,n=f(l.x)>f(l.y)?l.x:l.y,o=W(u,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 l,h;var d=t.element;S(e.srcEvent.target,d)&&(d=e.srcEvent.target);e.target=d}(t,n),t.emit("hammer.input",n),t.recognize(n),t.session.prevInput=n}function G(t){for(var e=[],n=0;n<t.pointers.length;)e[n]={clientX:h(t.pointers[n].clientX),clientY:h(t.pointers[n].clientY)},n++;return{timeStamp:p(),pointers:e,center:V(e),deltaX:t.deltaX,deltaY:t.deltaY}}function V(t){var e=t.length;if(1===e)return{x:h(t[0].clientX),y:h(t[0].clientY)};for(var n=0,r=0,i=0;i<e;)n+=t[i].clientX,r+=t[i].clientY,i++;return{x:h(n/e),y:h(r/e)}}function H(t,e,n){return{x:e/t||0,y:n/t||0}}function W(t,e){return t===e?1:f(t)>=f(e)?t<0?2:4:e<0?8:16}function q(t,e,n){n||(n=F);var r=e[n[0]]-t[n[0]],i=e[n[1]]-t[n[1]];return Math.sqrt(r*r+i*i)}function X(t,e,n){n||(n=F);var r=e[n[0]]-t[n[0]],i=e[n[1]]-t[n[1]];return 180*Math.atan2(i,r)/Math.PI}U.prototype={handler:function(){},init:function(){this.evEl&&E(this.element,this.evEl,this.domHandler),this.evTarget&&E(this.target,this.evTarget,this.domHandler),this.evWin&&E(k(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&O(this.element,this.evEl,this.domHandler),this.evTarget&&O(this.target,this.evTarget,this.domHandler),this.evWin&&O(k(this.element),this.evWin,this.domHandler)}};var J={mousedown:1,mousemove:2,mouseup:4};function Z(){this.evEl="mousedown",this.evWin="mousemove mouseup",this.pressed=!1,U.apply(this,arguments)}_(Z,U,{handler:function(t){var e=J[t.type];1&e&&0===t.button&&(this.pressed=!0),2&e&&1!==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 Q={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},K={2:"touch",3:"pen",4:"mouse",5:"kinect"},Y="pointerdown",$="pointermove pointerup pointercancel";function tt(){this.evEl=Y,this.evWin=$,U.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}i.MSPointerEvent&&!i.PointerEvent&&(Y="MSPointerDown",$="MSPointerMove MSPointerUp MSPointerCancel"),_(tt,U,{handler:function(t){var e=this.store,n=!1,r=t.type.toLowerCase().replace("ms",""),i=Q[r],o=K[t.pointerType]||t.pointerType,a="touch"==o,s=P(e,t.pointerId,"pointerId");1&i&&(0===t.button||a)?s<0&&(e.push(t),s=e.length-1):12&i&&(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 et={touchstart:1,touchmove:2,touchend:4,touchcancel:8};function nt(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,U.apply(this,arguments)}function rt(t,e){var n=M(t.touches),r=M(t.changedTouches);return 12&e&&(n=I(n.concat(r),"identifier",!0)),[n,r]}_(nt,U,{handler:function(t){var e=et[t.type];if(1===e&&(this.started=!0),this.started){var n=rt.call(this,t,e);12&e&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,e,{pointers:n[0],changedPointers:n[1],pointerType:"touch",srcEvent:t})}}});var it={touchstart:1,touchmove:2,touchend:4,touchcancel:8};function ot(){this.evTarget="touchstart touchmove touchend touchcancel",this.targetIds={},U.apply(this,arguments)}function at(t,e){var n=M(t.touches),r=this.targetIds;if(3&e&&1===n.length)return r[n[0].identifier]=!0,[n,n];var i,o,a=M(t.changedTouches),s=[],u=this.target;if(o=n.filter((function(t){return S(t.target,u)})),1===e)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]),12&e&&delete r[a[i].identifier],i++;return s.length?[I(o.concat(s),"identifier",!0),s]:void 0}_(ot,U,{handler:function(t){var e=it[t.type],n=at.call(this,t,e);n&&this.callback(this.manager,e,{pointers:n[0],changedPointers:n[1],pointerType:"touch",srcEvent:t})}});function st(){U.apply(this,arguments);var t=b(this.handler,this);this.touch=new ot(this.manager,t),this.mouse=new Z(this.manager,t),this.primaryTouch=null,this.lastTouches=[]}function ut(t,e){1&t?(this.primaryTouch=e.changedPointers[0].identifier,ct.call(this,e)):12&t&&ct.call(this,e)}function ct(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)}),2500)}}function lt(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}_(st,U,{handler:function(t,e,n){var r="touch"==n.pointerType,i="mouse"==n.pointerType;if(!(i&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(r)ut.call(this,e,n);else if(i&&lt.call(this,n))return;this.callback(t,e,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var ht=B(l.style,"touchAction"),ft=void 0!==ht,pt=function(){if(!ft)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 dt(t,e){this.manager=t,this.set(e)}dt.prototype={set:function(t){"compute"==t&&(t=this.compute()),ft&&this.manager.element.style&&pt[t]&&(this.manager.element.style[ht]=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){x(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))})),function(t){if(T(t,"none"))return"none";var e=T(t,"pan-x"),n=T(t,"pan-y");if(e&&n)return"none";if(e||n)return e?"pan-x":"pan-y";if(T(t,"manipulation"))return"manipulation";return"auto"}(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=T(r,"none")&&!pt.none,o=T(r,"pan-y")&&!pt["pan-y"],a=T(r,"pan-x")&&!pt["pan-x"];if(i){var s=1===t.pointers.length,u=t.distance<2,c=t.deltaTime<250;if(s&&u&&c)return}if(!a||!o)return i||o&&6&n||a&&24&n?this.preventSrc(e):void 0}},preventSrc:function(t){this.manager.session.prevented=!0,t.preventDefault()}};function At(t){this.options=u({},this.defaults,t||{}),this.id=R++,this.manager=null,this.options.enable=w(this.options.enable,!0),this.state=1,this.simultaneous={},this.requireFail=[]}function gt(t){return 16&t?"cancel":8&t?"end":4&t?"move":2&t?"start":""}function mt(t){return 16==t?"down":8==t?"up":2==t?"left":4==t?"right":""}function yt(t,e){var n=e.manager;return n?n.get(t):t}function vt(){At.apply(this,arguments)}function _t(){vt.apply(this,arguments),this.pX=null,this.pY=null}function bt(){vt.apply(this,arguments)}function xt(){At.apply(this,arguments),this._timer=null,this._input=null}function wt(){vt.apply(this,arguments)}function Et(){vt.apply(this,arguments)}function Ot(){At.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function St(t,e){return(e=e||{}).recognizers=w(e.recognizers,St.defaults.preset),new Tt(t,e)}At.prototype={defaults:{},set:function(t){return u(this.options,t),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(t){if(A(t,"recognizeWith",this))return this;var e=this.simultaneous;return e[(t=yt(t,this)).id]||(e[t.id]=t,t.recognizeWith(this)),this},dropRecognizeWith:function(t){return A(t,"dropRecognizeWith",this)||(t=yt(t,this),delete this.simultaneous[t.id]),this},requireFailure:function(t){if(A(t,"requireFailure",this))return this;var e=this.requireFail;return-1===P(e,t=yt(t,this))&&(e.push(t),t.requireFailure(this)),this},dropRequireFailure:function(t){if(A(t,"dropRequireFailure",this))return this;t=yt(t,this);var e=P(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+gt(n)),r(e.options.event),t.additionalEvent&&r(t.additionalEvent),n>=8&&r(e.options.event+gt(n))},tryEmit:function(t){if(this.canEmit())return this.emit(t);this.state=32},canEmit:function(){for(var t=0;t<this.requireFail.length;){if(!(33&this.requireFail[t].state))return!1;t++}return!0},recognize:function(t){var e=u({},t);if(!x(this.options.enable,[this,e]))return this.reset(),void(this.state=32);56&this.state&&(this.state=1),this.state=this.process(e),30&this.state&&this.tryEmit(e)},process:function(t){},getTouchAction:function(){},reset:function(){}},_(vt,At,{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&&(8&n||!i)?16|e:r||i?4&n?8|e:2&e?4|e:2:32}}),_(_t,vt,{defaults:{event:"pan",threshold:10,pointers:1,direction:30},getTouchAction:function(){var t=this.options.direction,e=[];return 6&t&&e.push("pan-y"),24&t&&e.push("pan-x"),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||(6&e.direction?(i=0===o?1:o<0?2:4,n=o!=this.pX,r=Math.abs(t.deltaX)):(i=0===a?1:a<0?8:16,n=a!=this.pY,r=Math.abs(t.deltaY))),t.direction=i,n&&r>e.threshold&&i&e.direction},attrTest:function(t){return vt.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=mt(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),_(bt,vt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return["none"]},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)}}),_(xt,At,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},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||12&t.eventType&&!i)this.reset();else if(1&t.eventType)this.reset(),this._timer=d((function(){this.state=8,this.tryEmit()}),e.time,this);else if(4&t.eventType)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(t){8===this.state&&(t&&4&t.eventType?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=p(),this.manager.emit(this.options.event,this._input)))}}),_(wt,vt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return["none"]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||2&this.state)}}),_(Et,vt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return _t.prototype.getTouchAction.call(this)},attrTest:function(t){var e,n=this.options.direction;return 30&n?e=t.overallVelocity:6&n?e=t.overallVelocityX:24&n&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&n&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&f(e)>this.options.velocity&&4&t.eventType},emit:function(t){var e=mt(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),_(Ot,At,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return["manipulation"]},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(),1&t.eventType&&0===this.count)return this.failTimeout();if(r&&i&&n){if(4!=t.eventType)return this.failTimeout();var o=!this.pTime||t.timeStamp-this.pTime<e.interval,a=!this.pCenter||q(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=d((function(){this.state=8,this.tryEmit()}),e.interval,this),2):8}return 32},failTimeout:function(){return this._timer=d((function(){this.state=32}),this.options.interval,this),32},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),St.VERSION="2.0.7",St.defaults={domEvents:!1,touchAction:"compute",enable:!0,inputTarget:null,inputClass:null,preset:[[wt,{enable:!1}],[bt,{enable:!1},["rotate"]],[Et,{direction:6}],[_t,{direction:6},["swipe"]],[Ot],[Ot,{event:"doubletap",taps:2},["tap"]],[xt]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};function Tt(t,e){var n;this.options=u({},St.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||(D?tt:j?ot:L?st:Z))(n,N),this.touchAction=new dt(this,this.options.touchAction),Ct(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 Ct(t,e){var n,r=t.element;r.style&&(g(t.options.cssProps,(function(i,o){n=B(r.style,o),e?(t.oldCssProps[n]=r.style[n],r.style[n]=i):r.style[n]=t.oldCssProps[n]||""})),e||(t.oldCssProps={}))}Tt.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 At)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(A(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(A(t,"remove",this))return this;if(t=this.get(t)){var e=this.recognizers,n=P(e,t);-1!==n&&(e.splice(n,1),this.touchAction.update())}return this},on:function(t,e){if(void 0!==t&&void 0!==e){var n=this.handlers;return g(C(t),(function(t){n[t]=n[t]||[],n[t].push(e)})),this}},off:function(t,e){if(void 0!==t){var n=this.handlers;return g(C(t),(function(t){e?n[t]&&n[t].splice(P(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&&Ct(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},u(St,{INPUT_START:1,INPUT_MOVE:2,INPUT_END:4,INPUT_CANCEL:8,STATE_POSSIBLE:1,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:32,DIRECTION_NONE:1,DIRECTION_LEFT:2,DIRECTION_RIGHT:4,DIRECTION_UP:8,DIRECTION_DOWN:16,DIRECTION_HORIZONTAL:6,DIRECTION_VERTICAL:24,DIRECTION_ALL:30,Manager:Tt,Input:U,TouchAction:dt,TouchInput:ot,MouseInput:Z,PointerEventInput:tt,TouchMouseInput:st,SingleTouchInput:nt,Recognizer:At,AttrRecognizer:vt,Tap:Ot,Pan:_t,Swipe:Et,Pinch:bt,Rotate:wt,Press:xt,on:E,off:O,each:g,merge:v,extend:y,assign:u,inherit:_,bindFn:b,prefixed:B}),(void 0!==i?i:"undefined"!=typeof self?self:{}).Hammer=St,void 0===(r=function(){return St}.call(e,n,e,t))||(t.exports=r)}(window,document)},,,function(t,e){},function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"a",(function(){return o}));var r=n(101);function i(t,e){return Object(r.a)(t>=0),Object(r.a)(e>0),t+(e-1)&~(e-1)}function o(t,e,n){let r;if(t instanceof ArrayBuffer)r=new Uint8Array(t);else{const e=t.byteOffset,n=t.byteLength;r=new Uint8Array(t.buffer||t.arrayBuffer,e,n)}return e.set(r,n),n+i(r.byteLength,4)}},function(t,e,n){"use strict";n.r(e);var r=n(219);n.d(e,"SimpleMeshLayer",(function(){return r.a}));var i=n(214);n.d(e,"ScenegraphLayer",(function(){return i.a}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var r=n(3),i=n.n(r),o=n(0),a=n.n(o),s=[255,255,255],u=0,c=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i()(this,t),a()(this,"type","ambient");var n=e.color,r=void 0===n?s:n,o=e.intensity,c=void 0===o?1:o;this.id=e.id||"ambient-".concat(u++),this.color=r,this.intensity=c}},function(t,e,n){"use strict";n.d(e,"a",(function(){return v}));var r=n(3),i=n.n(r),o=n(4),a=n.n(o),s=n(5),u=n.n(s),c=n(6),l=n.n(c),h=n(2),f=n.n(h),p=n(0),d=n.n(p),A=n(57),g=n(84),m=n(108);function y(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=f()(t);if(e){var i=f()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return l()(this,n)}}var v=function(t){u()(n,t);var e=y(n);function n(){return i()(this,n),e.apply(this,arguments)}return a()(n,[{key:"ViewportType",get:function(){return g.a}},{key:"ControllerType",get:function(){return m.b}}]),n}(A.a);d()(v,"displayName","MapView")},function(t,e,n){"use strict";n.d(e,"a",(function(){return p})),n.d(e,"b",(function(){return g}));var r=n(3),i=n.n(r),o=n(4),a=n.n(o),s=n(0),u=n.n(s),c=n(72);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 h(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){u()(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}var f=function(){},p={BREAK:1,SNAP_TO_END:2,IGNORE:3},d=function(t){return t},A=p.BREAK,g=function(){function t(e){var n=this;i()(this,t),u()(this,"_onTransitionUpdate",(function(t){var e=t.time,r=t.settings,i=r.interpolator,o=r.startProps,a=r.endProps,s=r.duration,u=(0,r.easing)(e/s),c=i.interpolateProps(o,a,u);n.propsInTransition=n.getControllerState(h(h({},n.props),c)).getViewportProps(),n.onViewStateChange({viewState:n.propsInTransition,oldViewState:n.props})})),this.getControllerState=e.getControllerState,this.propsInTransition=null,this.transition=new c.a(e.timeline),this.onViewStateChange=e.onViewStateChange||f,this.onStateChange=e.onStateChange||f}return a()(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 i=this.transition.settings,o=i.interruption,a=i.endProps;r=h(h({},n),o===p.SNAP_TO_END?a: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===p.IGNORE||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||d,interpolator:i,interruption:e.transitionInterruption||A,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||t(n)}}}]),t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));const r="3.2.10"},function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"a",(function(){return o}));var r=n(83);async function i(t,e){for(;;){const{done:n,value:r}=await t.next();if(n)return void t.return();if(e(r))return}}async function o(t){const e=[];for await(const n of t)e.push(n);return Object(r.b)(...e)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(195);function i(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return o(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 o(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 a,s=!0,u=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){u=!0,a=t},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw a}}}}function o(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 a=[n(99).a],s=["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 u(t){var e,n=r.a.getDefaultProgramManager(t),o=i(a);try{for(o.s();!(e=o.n()).done;){var u=e.value;n.addDefaultModule(u)}}catch(t){o.e(t)}finally{o.f()}var c,l=i(s);try{for(l.s();!(c=l.n()).done;){var h=c.value;n.addShaderHook(h)}}catch(t){l.e(t)}finally{l.f()}return n}},function(t,e,n){"use strict";n.d(e,"a",(function(){return v}));var r=n(3),i=n.n(r),o=n(4),a=n.n(o),s=n(5),u=n.n(s),c=n(6),l=n.n(c),h=n(2),f=n.n(h),p=n(0),d=n.n(p),A=n(57),g=n(152),m=n(153);function y(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=f()(t);if(e){var i=f()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return l()(this,n)}}var v=function(t){u()(n,t);var e=y(n);function n(){return i()(this,n),e.apply(this,arguments)}return a()(n,[{key:"ViewportType",get:function(){return g.a}},{key:"ControllerType",get:function(){return m.a}}]),n}(A.a);d()(v,"displayName","OrthographicView")},function(t,e,n){"use strict";n.d(e,"a",(function(){return T}));var r=n(9),i=n.n(r),o=n(0),a=n.n(o),s=n(3),u=n.n(s),c=n(4),l=n.n(c),h=n(5),f=n.n(h),p=n(6),d=n.n(p),A=n(2),g=n.n(A),m=n(41),y=n(75),v=n(13),_=n(18),b=n(88);function x(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 w(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?x(Object(n),!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):x(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function E(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=g()(t);if(e){var i=g()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return d()(this,n)}}var O=(new y.a).lookAt({eye:[0,0,1]});function S(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,c=n/2;if(o){var l=o.left,h=void 0===l?0:l,f=o.right,p=void 0===f?0:f,d=o.top,A=void 0===d?0:d,g=o.bottom,m=void 0===g?0:g,_=Object(v.a)((h+e-p)/2,0,e)-e/2,b=Object(v.a)((A+n-m)/2,0,n)-n/2;a-=_,s-=_,u+=b,c+=b}return(new y.a).ortho({left:a,right:s,bottom:u,top:c,near:r,far:i})}var T=function(t){f()(n,t);var e=E(n);function n(t){u()(this,n);var r,i=t.width,o=t.height,a=t.near,s=void 0===a?.1:a,c=t.far,l=void 0===c?1e3:c,h=t.zoom,f=void 0===h?0:h,p=t.target,d=void 0===p?[0,0,0]:p,A=t.padding,g=void 0===A?null:A,m=t.flipY,y=void 0===m||m,v=Array.isArray(f)?f[0]:f,_=Array.isArray(f)?f[1]:f,b=Math.min(v,_),x=Math.pow(2,b);if(v!==_){var E=Math.pow(2,v),T=Math.pow(2,_);r={unitsPerMeter:[E/x,T/x,1],metersPerUnit:[x/E,x/T,1]}}return e.call(this,w(w({},t),{},{longitude:void 0,position:d,viewMatrix:O.clone().scale([x,x*(y?-1:1),x]),projectionMatrix:S({width:i||1,height:o||1,padding:g,near:s,far:l}),zoom:b,distanceScales:r}))}return l()(n,[{key:"projectFlat",value:function(t){var e=i()(t,2),n=e[0],r=e[1],o=this.distanceScales.unitsPerMeter;return[n*o[0],r*o[1]]}},{key:"unprojectFlat",value:function(t){var e=i()(t,2),n=e[0],r=e[1],o=this.distanceScales.metersPerUnit;return[n*o[0],r*o[1]]}},{key:"panByPosition",value:function(t,e){var n=Object(_.n)(e,this.pixelUnprojectionMatrix),r=this.projectFlat(t),i=b.a([],r,b.b([],n)),o=b.a([],this.center,i);return{target:this.unprojectFlat(o)}}}]),n}(m.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return O}));var r=n(26),i=n.n(r),o=n(0),a=n.n(o),s=n(9),u=n.n(s),c=n(3),l=n.n(c),h=n(4),f=n.n(h),p=n(5),d=n.n(p),A=n(6),g=n.n(A),m=n(2),y=n.n(m),v=n(13),_=n(56),b=n(110),x=n(48);function w(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=y()(t);if(e){var i=y()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return g()(this,n)}}var E=function(t){d()(n,t);var e=w(n);function n(t){var r;return l()(this,n),(r=e.call(this,t)).zoomAxis=t.zoomAxis||"all",r}return f()(n,[{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=Math.log2(e);if(Array.isArray(n)){var s=n,c=u()(s,2),l=c[0],h=c[1];switch(this.zoomAxis){case"X":l=Object(v.a)(l+a,o,i);break;case"Y":h=Object(v.a)(h+a,o,i);break;default:var f=Math.min(l+a,h+a);f<o&&(a+=o-f),(f=Math.max(l+a,h+a))>i&&(a+=i-f),l+=a,h+=a}return[l,h]}return Object(v.a)(n+a,o,i)}}]),n}(b.a),O=function(t){d()(n,t);var e=w(n);function n(){var t;l()(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)),a()(i()(t),"ControllerState",E),a()(i()(t),"transition",{transitionDuration:300,transitionInterpolator:new x.a(["target","zoom"])}),a()(i()(t),"dragMode","pan"),t}return f()(n,[{key:"_onPanRotate",value:function(){return!1}}]),n}(_.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(27),i=n.n(r);function o(t){if(null===(e=t)||"object"!==i()(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"===i()(t)&&t.constructor===Object}(t))return Object.keys(t).length;throw new Error("count(): argument not a container")}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(0),i=n.n(r);function o(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 a(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?o(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function s(t,e){if(!e)return t;var n=a(a({},t),e);if("defines"in e&&(n.defines=a(a({},t.defines),e.defines)),"modules"in e&&(n.modules=(t.modules||[]).concat(e.modules),e.modules.some((function(t){return"project64"===t.name})))){var r=n.modules.findIndex((function(t){return"project32"===t.name}));r>=0&&n.modules.splice(r,1)}if("inject"in e)if(t.inject){var i=a({},t.inject);for(var o in e.inject)i[o]=(i[o]||"")+e.inject[o];n.inject=i}else n.inject=e.inject;return n}},function(t,e,n){"use strict";n.d(e,"a",(function(){return C}));var r=n(9),i=n.n(r),o=n(0),a=n.n(o),s=n(3),u=n.n(s),c=n(4),l=n.n(c),h=n(5),f=n.n(h),p=n(6),d=n.n(p),A=n(2),g=n.n(A),m=n(75),y=n(41),v=n(12),_=n(80),b=n(86);function x(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 w(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?x(Object(n),!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):x(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function E(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=g()(t);if(e){var i=g()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return d()(this,n)}}var O=Math.PI/180,S=180/Math.PI;function T(){var t=Math.PI/180*256;return{unitsPerMeter:[256/6370972,256/6370972,256/6370972],unitsPerMeter2:[0,0,0],metersPerUnit:[24886.609375,24886.609375,24886.609375],unitsPerDegree:[t,t,256/6370972],unitsPerDegree2:[0,0,0],degreesPerUnit:[1/t,1/t,24886.609375]}}var C=function(t){f()(n,t);var e=E(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};u()(this,n);var i=r.latitude,o=void 0===i?0:i,a=r.longitude,s=void 0===a?0:a,c=r.zoom,l=void 0===c?0:c,h=r.nearZMultiplier,f=void 0===h?.1:h,p=r.farZMultiplier,d=void 0===p?2:p,A=r.resolution,g=void 0===A?10:A,y=r.height,v=r.altitude,_=void 0===v?1.5:v;y=y||1,_=Math.max(.75,_);var b=(new m.a).lookAt({eye:[0,-_,0],up:[0,0,1]}),x=Math.pow(2,l);b.rotateX(o*O),b.rotateZ(-s*O),b.scale(x/y);var E=Math.atan(.5/_),S=512*x/y;return(t=e.call(this,w(w({},r),{},{height:y,viewMatrix:b,longitude:s,latitude:o,zoom:l,distanceScales:T(),fovyRadians:2*E,focalDistance:_,near:f,far:Math.min(2,1/S+1)*_*d}))).latitude=o,t.longitude=s,t.resolution=g,t}return l()(n,[{key:"projectionMode",get:function(){return v.d.GLOBE}},{key:"getDistanceScales",value:function(){return this.distanceScales}},{key:"getBounds",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e={targetZ:t.z||0},n=this.unproject([0,this.height/2],e),r=this.unproject([this.width/2,0],e),i=this.unproject([this.width,this.height/2],e),o=this.unproject([this.width/2,this.height],e);return i[0]<this.longitude&&(i[0]+=360),n[0]>this.longitude&&(n[0]-=360),[Math.min(n[0],i[0],r[0],o[0]),Math.min(n[1],i[1],r[1],o[1]),Math.max(n[0],i[0],r[0],o[0]),Math.max(n[1],i[1],r[1],o[1])]}},{key:"unproject",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.topLeft,o=void 0===r||r,a=n.targetZ,s=i()(t,3),u=s[0],c=s[1],l=s[2],h=o?c:this.height-c,f=this.pixelUnprojectionMatrix;if(Number.isFinite(l))e=P(f,[u,h,l,1]);else{var p=P(f,[u,h,-1,1]),d=P(f,[u,h,1,1]),A=256*((a||0)/6370972+1),g=_.c(_.d([],p,d)),m=_.c(p),y=_.c(d),v=(4*m*y-Math.pow(g-m-y,2))/16,b=4*v/g,x=Math.sqrt(m-b),w=Math.sqrt(Math.max(0,A*A-b)),E=(x-w)/Math.sqrt(g);e=_.b([],p,d,E)}var O=this.unprojectPosition(e),S=i()(O,3),T=S[0],C=S[1],M=S[2];return Number.isFinite(l)?[T,C,M]:Number.isFinite(a)?[T,C,a]:[T,C]}},{key:"projectPosition",value:function(t){var e=i()(t,3),n=e[0],r=e[1],o=e[2],a=void 0===o?0:o,s=n*O,u=r*O,c=Math.cos(u),l=256*(a/6370972+1);return[Math.sin(s)*c*l,-Math.cos(s)*c*l,Math.sin(u)*l]}},{key:"unprojectPosition",value:function(t){var e=i()(t,3),n=e[0],r=e[1],o=e[2],a=_.a(t),s=Math.asin(o/a);return[Math.atan2(n,-r)*S,s*S,6370972*(a/256-1)]}},{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}(y.a);function P(t,e){var n=b.b([],e,t);return b.a(n,n,1/n[3]),n}},function(t,e,n){"use strict";var r=n(9),i=n.n(r),o=n(3),a=n.n(o),s=n(4),u=n.n(s),c=n(26),l=n.n(c),h=n(5),f=n.n(h),p=n(6),d=n.n(p),A=n(2),g=n.n(A),m=n(0),y=n.n(m),v=n(12),_=n(158),b=n(42),x=n(13),w=n(72);function E(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=g()(t);if(e){var i=g()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return d()(this,n)}}var O=function(t){f()(n,t);var e=E(n);function n(){return a()(this,n),e.apply(this,arguments)}return u()(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=Object(x.g)(n,r,o)}}]),n}(w.a);function S(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=g()(t);if(e){var i=g()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return d()(this,n)}}function T(t,e,n,r,i){var o=e-t;return(n-e)*i+-o*r+o+e}function C(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 P=function(t){f()(n,t);var e=S(n);function n(){return a()(this,n),e.apply(this,arguments)}return u()(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,c=function(t,e,n,r,i){if(Array.isArray(n)){for(var o=[],a=0;a<n.length;a++)o[a]=T(t[a],e[a],n[a],r,i);return o}return T(t,e,n,r,i)}(a,u,n,r,i),l=C(c,n),h=C(c,u);l<1e-5&&h<1e-5&&(c=n,this.end()),this._prevValue=u,this._currValue=c}}]),n}(w.a),M=n(20);function I(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return B(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 B(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=n.call(t)},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 B(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 R(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 k(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?R(Object(n),!0).forEach((function(e){y()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):R(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var L,D={interpolation:O,spring:P},j=function(){function t(e){a()(this,t),this.transitions=new Map,this.timeline=e}return u()(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=Object(b.e)(r)){var s=D[r.type];if(s){var u=new s(this.timeline);u.start(k(k({},r),{},{fromValue:e,toValue:n})),i.set(t,u)}else M.a.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=I(this.transitions);try{for(n.s();!(t=n.n()).done;){var r=i()(t.value,2),o=r[0],a=r[1];a.update(),e[o]=a.value,a.inProgress||this.remove(o)}}catch(t){n.e(t)}finally{n.f()}return e}},{key:"clear",value:function(){var t,e=I(this.transitions.keys());try{for(e.s();!(t=e.n()).done;){var n=t.value;this.remove(n)}}catch(t){e.e(t)}finally{e.f()}}}]),t}(),F=n(131),z=n(23),U=n(154),N=n(31),G=n(8),V=n(28),H=n(77),W=n(155),q=n(137),X=n(66),J=n(50),Z=n(27),Q=n.n(Z),K=n(102);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){y()(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=(L={},y()(L,10241,9987),y()(L,10240,9729),y()(L,10242,33071),y()(L,10243,33071),L),et={};var nt=n(59);function rt(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 it(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?rt(Object(n),!0).forEach((function(e){y()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):rt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var ot={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||ct(t)&&(3===t.length||4===t.length)},equal:function(t,e,n){return at(t,e)}},accessor:{validate:function(t,e){var n=lt(t);return"function"===n||n===lt(e.value)},equal:function(t,e,n){return"function"==typeof e||at(t,e)}},array:{validate:function(t,e){return e.optional&&!t||ct(t)},equal:function(t,e,n){return n.compare?at(t,e):t===e}},object:{equal:function(t,e,n){return n.compare?Object(nt.a)(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 K.a)return e;e.constructor&&"Object"!==e.constructor.name&&(e={data:e});var r=null;e.compressed&&(r=y()({},10241,e.data.length>1?9985:9729));var i=new K.a(n,$($({},e),{},{parameters:$($($({},tt),r),t.props.textureParameters)}));return et[i.id]=!0,i}(n,t)},release:function(t){var e;(e=t)&&e instanceof K.a&&et[e.id]&&(e.delete(),delete et[e.id])}}};function at(t,e){if(t===e)return!0;if(!ct(t)||!ct(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 st(t,e){switch(lt(e)){case"object":return ut(t,e);case"array":return ut(t,{type:"array",value:e,compare:!1});case"boolean":return ut(t,{type:"boolean",value:e});case"number":return ut(t,{type:"number",value:e});case"function":return ut(t,{type:"function",value:e,compare:!0});default:return{name:t,type:"unknown",value:e}}}function ut(t,e){return"type"in e?it(it({name:t},ot[e.type]),e):"value"in e?it({name:t,type:lt(e.value)},e):{name:t,type:"object",value:e}}function ct(t){return Array.isArray(t)||ArrayBuffer.isView(t)}function lt(t){return ct(t)?"array":null===t?"null":Q()(t)}function ht(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return ft(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 ft(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=n.call(t)},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 ft(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 pt(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 dt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?pt(Object(n),!0).forEach((function(e){y()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):pt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function At(t,e){var n=gt(t.constructor),r=Object.create(n);r[z.d]=t,r[z.b]={},r[z.c]={};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}function gt(t){var e=vt(t,"_mergedDefaultProps");return e||(function(t){if(!t.prototype)return;var e=Object.getPrototypeOf(t),n=gt(e),r=function(t){for(var e={},n={},r={},o=0,a=Object.entries(t);o<a.length;o++){var s=i()(a[o],2),u=s[0],c=s[1],l=null==c?void 0:c.deprecatedFor;if(l)r[u]=Array.isArray(l)?l:[l];else{var h=st(u,c);e[u]=h,n[u]=h.value}}return{propTypes:e,defaultProps:n,deprecatedProps:r}}(vt(t,"defaultProps")||{}),o=function(t,e,n){var r=Object.create(null);Object.assign(r,e,t);var i=function(t){var e=vt(t,"layerName")||vt(t,"componentName");e||M.a.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}(r.defaultProps,n,t),a=dt(dt({},e._propTypes),r.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]=mt(a))}t[z.a]=n,t[z.b]={},Object.defineProperties(t,r)}(o,a);var s=dt(dt({},e._deprecatedProps),r.deprecatedProps);(function(t,e){var n=function(n){Object.defineProperty(t,n,{enumerable:!1,set:function(t){var r,i="".concat(this.id,": ").concat(n),o=ht(e[n]);try{for(o.s();!(r=o.n()).done;){var a=r.value;yt(this,a)||(this[a]=t)}}catch(t){o.e(t)}finally{o.f()}M.a.deprecated(i,e[n].join("/"))()}})};for(var r in e)n(r)})(o,s),t._mergedDefaultProps=o,t._propTypes=a,t._deprecatedProps=s}(t),t._mergedDefaultProps)}function mt(t){return{enumerable:!0,set:function(e){"string"==typeof e||e instanceof Promise||Object(J.c)(e)?this[z.b][t]=e:this[z.c][t]=e},get:function(){if(this[z.c]){if(t in this[z.c])return this[z.c][t]||this[z.a][t];if(t in this[z.b]){var e=this[z.d]&&this[z.d].internalState;if(e&&e.hasAsyncProp(t))return e.getAsyncProp(t)||this[z.a][t]}}return this[z.a][t]}}}function yt(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function vt(t,e){return yt(t,e)&&t[e]}function _t(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 bt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?_t(Object(n),!0).forEach((function(e){y()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):_t(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var xt=0,wt=function(){function t(){a()(this,t);for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.props=At(this,n),this.id=this.props.id,this.count=xt++}return u()(t,[{key:"clone",value:function(t){var e=this.props,n={};for(var r in e[z.a])r in e[z.c]?n[r]=e[z.c][r]:r in e[z.b]&&(n[r]=e[z.b][r]);return new this.constructor(bt(bt(bt({},e),n),t))}}]),t}();y()(wt,"componentName","Component"),y()(wt,"defaultProps",{});var Et=n(7),Ot=n.n(Et),St=n(67),Tt=n.n(St),Ct=n(227),Pt=n.n(Ct),Mt=n(39),It=n.n(Mt),Bt=Object.freeze({});function Rt(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=g()(t);if(e){var i=g()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return d()(this,n)}}var kt=function(t){f()(n,t);var e=Rt(n);function n(t){var r,i=t.attributeManager,o=t.layer;return a()(this,n),(r=e.call(this,o)).attributeManager=i,r.needsRedraw=!0,r.needsUpdate=!0,r.subLayers=null,r.usesPickingColorCache=!1,r}return u()(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}):Ot()(g()(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}(function(){function t(e){a()(this,t),this.component=e,this.asyncProps={},this.onAsyncPropUpdated=function(){},this.oldProps=null,this.oldAsyncProps=null}var e;return u()(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||Bt}},{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[z.c]||{},n=t[z.b]||t,r=t[z.a]||{};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):Object(J.c)(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:(e=Tt()(It.a.mark((function t(e,n){var r,i,o,a,s,u,c,l,h,f,p;return It.a.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");case 6:r.pendingLoadCount++,i=r.pendingLoadCount,o=[],a=0,s=!1,u=!1,t.prev=12,l=Pt()(n);case 14:return t.next=16,l.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,c=t.t0;case 32:if(t.prev=32,t.prev=33,!s||null==l.return){t.next=37;break}return t.next=37,l.return();case 37:if(t.prev=37,!u){t.next=40;break}throw c;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]])}))),function(t,n){return e.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}()),Lt=n(18),Dt=n(202);function jt(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Ft(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 Ft(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=n.call(t)},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 Ft(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=g()(t);if(e){var i=g()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return d()(this,n)}}function Ut(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 Nt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ut(Object(n),!0).forEach((function(e){y()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ut(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}n.d(e,"a",(function(){return Xt}));var Gt=Math.pow(2,24)-1,Vt=Object.freeze([]),Ht=Object(H.a)((function(t){var e=t.oldViewport,n=t.viewport;return e.equals(n)})),Wt=new Uint8ClampedArray(0),qt={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=Nt(Nt({},a),{},{fetch:Nt(Nt({},null===(n=a)||void 0===n?void 0:n.fetch),{},{signal:s})}));var c=u.contains(t);return c||a||(u.add({resourceId:t,data:Object(Dt.a)(t,o),persistent:!1}),c=!0),c?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}):Object(Dt.a)(t,o,a)},compare:!1},updateTriggers:{},visible:!0,pickable:!1,opacity:{type:"number",min:0,max:1,value:1},operation:v.c.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:v.a.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]}},Xt=function(t){f()(n,t);var e=zt(n);function n(){var t;a()(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)),y()(l()(t),"internalState",null),y()(l()(t),"lifecycle",z.e.NO_STATE),y()(l()(t),"parent",null),t}return u()(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){Object(V.a)(this.internalState);var e=this.internalState.viewport||this.context.viewport,n=Object(q.a)(t,{viewport:e,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),r=Object(Lt.q)(n,e.pixelProjectionMatrix),o=i()(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 Object(V.a)(this.internalState),(this.internalState.viewport||this.context.viewport).unproject(t)}},{key:"projectPosition",value:function(t,e){Object(V.a)(this.internalState);var n=this.internalState.viewport||this.context.viewport;return Object(q.b)(t,Nt({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=jt(this.getModels());try{for(n.s();!(e=n.n()).done;){e.value.updateModuleSettings(t)}}catch(t){n.e(t)}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===v.a.DEFAULT||t===v.a.LNGLAT||t===v.a.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){Object(V.a)(t instanceof Uint8Array);var e=i()(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:Object(U.a)(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=jt(this.props.extensions);try{for(n.s();!(e=n.n()).done;){var r=e.value;t=Object(W.a)(t,r.getShaders.call(this,r))}}catch(t){n.e(t)}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 r,i=jt(n);try{for(i.s();!(r=i.n()).done;){var o=r.value;e.invalidateAll(o)}}catch(t){i.e(t)}finally{i.f()}}else e.invalidateAll();var a=t.props,s=t.oldProps,u=Number.isInteger(s.highlightedObjectIndex)||s.pickable,c=Number.isInteger(a.highlightedObjectIndex)||a.pickable;if(u!==c&&e){var l=e.attributes,h=l.pickingColors,f=l.instancePickingColors,p=h||f;p&&(c&&p.constant&&(p.constant=!1,e.invalidate(p.id)),p.value||c||(p.constant=!0,p.value=[0,0,0]))}}},{key:"finalizeState",value:function(t){var e,n=jt(this.getModels());try{for(n.s();!(e=n.n()).done;){e.value.delete()}}catch(t){n.e(t)}finally{n.f()}var r=this.getAttributeManager();r&&r.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=jt(this.getModels());try{for(n.s();!(e=n.n()).done;){e.value.draw(t)}}catch(t){n.e(t)}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&&Ht({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=jt(this.getModels());try{for(n.s();!(e=n.n()).done;){var r=e.value;this._setModelAttributes(r,t)}}catch(t){n.e(t)}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(Wt.length/3);if(this.internalState.usesPickingColorCache=!0,r<n){n>Gt&&M.a.warn("Layer has too many data objects. Picking might not be able to distinguish all objects.")(),Wt=X.a.allocate(Wt,n,{size:3,copy:!0,maxCount:Math.max(n,Gt)});for(var i=Math.floor(Wt.length/3),o=[],a=r;a<i;a++)this.encodePickingColor(a,o),Wt[3*a+0]=o[0],Wt[3*a+1]=o[1],Wt[3*a+2]=o[2]}t.value=Wt.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!==Wt.buffer&&(r.value=Wt.subarray(0,r.value.length)),r.updateSubBuffer({startOffset:0}))}},{key:"_initialize",value:function(){Object(V.a)(!this.internalState),Object(V.a)(Number.isFinite(this.props.coordinateSystem)),Object(N.a)("layer.initialize",this);var t=this._getAttributeManager();t&&t.addInstanced({instancePickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateInstancePickingColors}}),this.internalState=new kt({attributeManager:t,layer:this}),this._clearChangeFlags(),this.state={},Object.defineProperty(this.state,"attributeManager",{get:function(){return M.a.deprecated("layer.state.attributeManager","layer.getAttributeManager()")(),t}}),this.internalState.layer=this,this.internalState.uniformTransitions=new j(this.context.timeline),this.internalState.onAsyncPropUpdated=this._onAsyncPropUpdated.bind(this),this.internalState.setAsyncProps(this.props),this.initializeState(this.context);var e,n=jt(this.props.extensions);try{for(n.s();!(e=n.n()).done;){var r=e.value;r.initializeState.call(this,this.context,r)}}catch(t){n.e(t)}finally{n.f()}this.setChangeFlags({dataChanged:"init",propsChanged:"init",viewportChanged:!0,extensionsChanged:!0}),this._update()}},{key:"_transferState",value:function(t){Object(N.a)("layer.matched",this,this===t);var 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(Object(N.a)("layer.update",this,t),t){var e=this.props,n=this.context,r=this.internalState,i=n.viewport,o=this._updateUniformTransition();r.propsInTransition=o,n.viewport=r.viewport||i,this.props=o;try{var a=this._getUpdateParams(),s=this.getModels();if(n.gl)this.updateState(a);else try{this.updateState(a)}catch(t){}var u,c=jt(this.props.extensions);try{for(c.s();!(u=c.n()).done;){var l=u.value;l.updateState.call(this,a,l)}}catch(t){c.e(t)}finally{c.f()}var h=this.getModels()[0]!==s[0];this._postUpdate(a,h)}finally{n.viewport=i,this.props=e,this._clearChangeFlags(),r.needsUpdate=!1,r.resetOldProps()}}}},{key:"_finalize",value:function(){Object(N.a)("layer.finalize",this),this.finalizeState(this.context);var t,e=jt(this.props.extensions);try{for(e.s();!(t=e.n()).done;){var n=t.value;n.finalizeState.call(this,n)}}catch(t){e.e(t)}finally{e.f()}}},{key:"_drawLayer",value:function(t){var e=this,n=t.moduleParameters,r=void 0===n?null:n,i=t.uniforms,o=void 0===i?{}:i,a=t.parameters,s=void 0===a?{}:a;this._updateAttributeTransition();var u=this.props,c=this.context;this.props=this.internalState.propsInTransition||u;var l=this.props.opacity;o.opacity=Math.pow(l,1/2.2);try{r&&this.setModuleParameters(r);var h=this.props.getPolygonOffset,f=h&&h(o)||[0,0];Object(G.n)(c.gl,{polygonOffset:f}),Object(G.o)(c.gl,s,(function(){var t,n={moduleParameters:r,uniforms:o,parameters:s,context:c},i=jt(e.props.extensions);try{for(i.s();!(t=i.n()).done;){var a=t.value;a.draw.call(e,n,a)}}catch(t){i.e(t)}finally{i.f()}e.draw(n)}))}finally{this.props=u}}},{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;switch(n){case"dataChanged":var i=t[n],o=e[n];i&&Array.isArray(o)&&(e.dataChanged=Array.isArray(i)?o.concat(i):i,r=!0);default:e[n]||(e[n]=t[n],r=!0)}r&&Object(N.a)("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=Object(F.b)(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(){Object(F.c)(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 _.a(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||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),Number.isInteger(a)&&(u.pickingSelectedColor=Number.isFinite(a)&&a>=0?this.encodePickingColor(a):null),this.setModuleParameters(u)}}},{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}(wt);y()(Xt,"defaultProps",qt),y()(Xt,"layerName","Layer")},function(t,e,n){"use strict";var r=n(0),i=n.n(r),o=n(3),a=n.n(o),s=n(4),u=n.n(s),c=n(9),l=n.n(c),h=n(26),f=n.n(h),p=n(7),d=n.n(p),A=n(5),g=n.n(A),m=n(6),y=n.n(m),v=n(2),_=n.n(v),b=n(234),x=n(181),w=n(32);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}function O(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){i()(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}var S=function(){function t(e,n){a()(this,t),this.opts=n,this.source=e}return u()(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 O(O({},this.source.getAccessor()),this.opts)}}]),t}();var T=n(66),C=n(34),P=n(20);function M(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 I(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?M(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):M(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function B(t){return t.stride||t.size*t.bytesPerElement}function R(t,e){e.offset&&P.a.removed("shaderAttribute.offset","vertexOffset, elementOffset")();var n=B(t),r=(void 0!==e.vertexOffset?e.vertexOffset:t.vertexOffset||0)*n+(e.elementOffset||0)*t.bytesPerElement+(t.offset||0);return I(I({},e),{},{offset:r,stride:n})}var k=function(){function t(e,n,r){a()(this,t),this.gl=e,this.id=n.id||"",this.size=n.size||1;var i,o=n.logicalType||n.type,s=5130===o,u=n.defaultValue;u=Number.isFinite(u)?[u]:u||new Array(this.size).fill(0),i=s?5126:!o&&n.isIndexed?e&&Object(b.b)(e,x.a.ELEMENT_INDEX_UINT32)?5125:5123:o||5126;var c=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")}}(o||i||5126);this.doublePrecision=s,s&&!1===n.fp64&&(c=Float32Array),this.value=null,this.settings=I(I({},n),{},{defaultType:c,defaultValue:u,logicalType:o,type:i,size:this.size,bytesPerElement:c.BYTES_PER_ELEMENT}),this.state=I(I({},r),{},{externalBuffer:null,bufferAccessor:this.settings,allocatedValue:null,numInstances:0,bounds:null,constant:!1}),this._buffer=null}return u()(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 w.a(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),T.a.release(this.state.allocatedValue)}},{key:"getShaderAttributes",value:function(t,e){if(this.doublePrecision){var n={},r=this.value instanceof Float64Array,o=(a=this.getAccessor(),{high:s=R(a,e||{}),low:I(I({},s),{},{offset:s.offset+4*a.size})});return n[t]=new S(this,o.high),n["".concat(t,"64Low")]=r?new S(this,o.low):new Float32Array(this.size),n}var a,s;if(e){var u=R(this.getAccessor(),e);return i()({},t,new S(this,u))}return i()({},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 c=0;c<i;c++){var l=n[u++];l<a[c]&&(a[c]=l),l>s[c]&&(s[c]=l)}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 w.a?{buffer:t}:t;var r=I(I({},this.settings),e);if(n.bufferAccessor=r,n.bounds=null,e.constant){var i=e.value;if(i=this._normalizeValue(i,[],0),this.settings.normalized&&(i=this.normalizeConstant(i)),!(!n.constant||!this._areValuesEqual(i,this.value)))return!1;n.externalBuffer=null,n.constant=!0,this.value=i}else if(e.buffer){var o=e.buffer;n.externalBuffer=o,n.constant=!1,this.value=e.value||null;var a=e.value instanceof Float64Array;r.type=e.type||o.accessor.type,r.bytesPerElement=o.accessor.BYTES_PER_ELEMENT*(a?2:1),r.stride=B(r)}else if(e.value){this._checkExternalBuffer(e);var s=e.value;n.externalBuffer=null,n.constant=!1,this.value=s,r.bytesPerElement=s.BYTES_PER_ELEMENT,r.stride=B(r);var u=this.buffer,c=this.byteOffset;this.doublePrecision&&s instanceof Float64Array&&(s=Object(C.f)(s,r));var l=s.byteLength+c+2*r.stride;u.byteLength<l&&u.reallocate(l),u.setAccessor(null),u.subData({data:s,offset:c}),r.type=e.type||u.accessor.type}return!0}},{key:"updateSubBuffer",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.state.bounds=null;var e=this.value,n=t.startOffset,r=void 0===n?0:n,i=t.endOffset;this.buffer.subData({data:this.doublePrecision&&e instanceof Float64Array?Object(C.f)(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=T.a.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?Object(C.f)(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||P.a.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}(),L=n(28),D=n(50),j=n(65),F=[],z=[[0,1/0]];function U(t,e){if(t===z)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}var N=n(42);function G(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return V(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 V(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=n.call(t)},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 V(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 H(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=_()(t);if(e){var i=_()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return y()(this,n)}}var W=function(t){g()(n,t);var e=H(n);function n(t,r){var o;return a()(this,n),o=e.call(this,t,r,{startIndices:null,lastExternalBuffer:null,binaryValue:null,binaryAccessor:null,needsUpdate:!0,needsRedraw:!1,updateRanges:z}),i()(f()(o),"constant",!1),o.settings.update=r.update||(r.accessor?o._autoUpdater:void 0),Object.seal(o.settings),Object.seal(o.state),o._validateAttributeUpdaters(),o}return u()(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]:{},e=t.clearChangedFlags,n=void 0!==e&&e,r=this.state.needsRedraw;return this.state.needsRedraw=r&&!n,r}},{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 Object(N.e)(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=U(this.state.updateRanges,[r,o])}else this.state.updateRanges=z}},{key:"clearNeedsUpdate",value:function(){this.state.needsUpdate=!1,this.state.updateRanges=F}},{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&&(d()(_()(n.prototype),"allocate",this).call(this,t,e.updateRanges!==z),!0))}},{key:"updateBuffer",value:function(t){var e=t.numInstances,r=t.data,i=t.props,o=t.context;if(!this.needsUpdate())return!1;var a=this.state.updateRanges,s=this.settings,u=s.update,c=s.noAlloc,h=!0;if(u){var f,p=G(a);try{for(p.s();!(f=p.n()).done;){var A=l()(f.value,2),g=A[0],m=A[1];u.call(o,this,{data:r,startRow:g,endRow:m,props:i,numInstances:e})}}catch(t){p.e(t)}finally{p.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 y,v=G(a);try{for(v.s();!(y=v.n()).done;){var b=l()(y.value,2),x=b[0],w=b[1],E=Number.isFinite(x)?this.getVertexOffset(x):0,O=Number.isFinite(w)?this.getVertexOffset(w):c||!Number.isFinite(e)?this.value.length:e*this.size;d()(_()(n.prototype),"updateSubBuffer",this).call(this,{startOffset:E,endOffset:O})}}catch(t){v.e(t)}finally{v.f()}}else;this._checkAttributeArray()}else h=!1;return this.clearNeedsUpdate(),this.setNeedsRedraw(),h}},{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;return 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;n.binaryValue=t,this.setNeedsRedraw();var i=r.transform||e!==this.startIndices;if(i){ArrayBuffer.isView(t)&&(t={value:t});var o=t;Object(L.a)(ArrayBuffer.isView(o.value),"invalid ".concat(r.accessor));var a=Boolean(o.size)&&o.size!==this.size;return n.binaryAccessor=Object(D.b)(o.value,{size:o.size||this.size,stride:o.stride,offset:o.offset,startIndices:e,nested:a}),!1}return this.clearNeedsUpdate(),this.setData(t),!0}},{key:"getVertexOffset",value:function(t){var e=this.startIndices;return(e?e[t]:t)*this.size}},{key:"getShaderAttributes",value:function(){var t=this.settings.shaderAttributes||i()({},this.id,null),e={};for(var r in t)Object.assign(e,d()(_()(n.prototype),"getShaderAttributes",this).call(this,r,t[r]));return e}},{key:"_autoUpdater",value:function(t,e){var n=e.data,r=e.startRow,i=e.endRow,o=e.props,a=e.numInstances;if(!t.constant){var s=t.settings,u=t.state,c=t.value,l=t.size,h=t.startIndices,f=s.accessor,p=s.transform,d=u.binaryAccessor||("function"==typeof f?f:o[f]);Object(L.a)("function"==typeof d,'accessor "'.concat(f,'" is not a function'));var A,g=t.getVertexOffset(r),m=Object(D.a)(n,r,i),y=m.iterable,v=m.objectInfo,_=G(y);try{for(_.s();!(A=_.n()).done;){var b=A.value;v.index++;var x=d(b,v);if(p&&(x=p.call(this,x)),h){var w=(v.index<h.length-1?h[v.index+1]:a)-h[v.index];if(x&&Array.isArray(x[0])){var E,O=g,S=G(x);try{for(S.s();!(E=S.n()).done;){var T=E.value;t._normalizeValue(T,c,O),O+=l}}catch(t){S.e(t)}finally{S.f()}}else x&&x.length>l?c.set(x,g):(t._normalizeValue(x,v.target,0),Object(j.a)({target:c,source:v.target,start:g,count:w}));g+=w*l}else t._normalizeValue(x,c,g),g+=l}}catch(t){_.e(t)}finally{_.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}(k),q=n(31),X=n(293),J=n(72);function Z(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 Q(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Z(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Z(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function K(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Y(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 Y(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=n.call(t)},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 Y(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 $=function(){function t(e){var n=e.gl,r=e.attribute,o=e.timeline;a()(this,t),i()(this,"type","interpolation"),this.gl=n,this.transition=new J.a(o),this.attribute=r,this.attributeInTransition=new W(n,r.settings),this.currentStartIndices=r.startIndices,this.currentLength=0,this.transform=function(t,e){var n=Object(N.c)(e.size);return new X.a(t,{vs:"\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",defines:{ATTRIBUTE_TYPE:n},varyings:["vCurrent"]})}(n,r);var s={byteLength:0,usage:35050};this.buffers=[new w.a(n,s),new w.a(n,s)]}return u()(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,r=this.buffers,i=this.attribute;Object(N.a)(r);var o,a={numInstances:e,attribute:i,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:t.enter},s=K(r);try{for(s.s();!(o=s.n()).done;){var u=o.value;Object(N.f)(Q({buffer:u},a))}}catch(t){s.e(t)}finally{s.f()}this.currentStartIndices=i.startIndices,this.currentLength=Object(N.b)(i,e),this.attributeInTransition.setData({buffer:r[1],value:i.value}),this.transition.start(t),this.transform.update({elementCount:Math.floor(this.currentLength/i.size),sourceBuffers:{aFrom:r[0],aTo:Object(N.d)(n,i)},feedbackBuffers:{vCurrent:r[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=K(this.buffers);try{for(e.s();!(t=e.n()).done;){t.value.delete()}}catch(t){e.e(t)}finally{e.f()}this.buffers.length=0}}]),t}();var tt=n(197),et=n(102),nt=n(71);function rt(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return it(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 it(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=n.call(t)},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 it(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 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){i()(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={interpolation:$,spring:function(){function t(e){var n=e.gl,r=e.attribute,o=e.timeline;a()(this,t),i()(this,"type","spring"),this.gl=n,this.type="spring",this.transition=new J.a(o),this.attribute=r,this.attributeInTransition=new W(n,at(at({},r.settings),{},{normalized:!1})),this.currentStartIndices=r.startIndices,this.currentLength=0,this.texture=function(t){return new et.a(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 nt.a(t,{id:"spring-transition-is-transitioning-framebuffer",width:1,height:1,attachments:i()({},36064,e)})}(n,this.texture),this.transform=function(t,e,n){var r=Object(N.c)(e.size);return new X.a(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,r,this.framebuffer);var s={byteLength:0,usage:35050};this.buffers=[new w.a(n,s),new w.a(n,s),new w.a(n,s)]}return u()(t,[{key:"inProgress",get:function(){return this.transition.inProgress}},{key:"start",value:function(t,e){var n,r=this.gl,i=this.buffers,o=this.attribute,a={numInstances:e,attribute:o,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:t.enter},s=rt(i);try{for(s.s();!(n=s.n()).done;){var u=n.value;Object(N.f)(at({buffer:u},a))}}catch(t){s.e(t)}finally{s.f()}this.settings=t,this.currentStartIndices=o.startIndices,this.currentLength=Object(N.b)(o,e),this.attributeInTransition.setData({buffer:i[1],value:o.value}),this.transition.start(at(at({},t),{},{duration:1/0})),this.transform.update({elementCount:Math.floor(this.currentLength/o.size),sourceBuffers:{aTo:Object(N.d)(r,o)}})}},{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]}}),Object(N.a)(t),this.attributeInTransition.setData({buffer:t[1],value:this.attribute.value}),Object(tt.c)(n)[0]>0||r.end(),!0}},{key:"cancel",value:function(){this.transition.cancel(),this.transform.delete();var t,e=rt(this.buffers);try{for(e.s();!(t=e.n()).done;){t.value.delete()}}catch(t){e.e(t)}finally{e.f()}this.buffers.length=0,this.texture.delete(),this.framebuffer.delete()}}]),t}()},ut=function(){function t(e,n){var r=n.id,i=n.timeline;a()(this,t),this.id=r,this.gl=e,this.timeline=i,this.transitions={},this.needsRedraw=!1,this.numInstances=1,this.isSupported=X.a.isSupported(e)}return u()(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 P.a.warn("WebGL2 not supported by this browser. Transition for ".concat(t," is disabled."))();r&&this._removeTransition(t);var o=st[n.type];o?this.transitions[t]=new o({attribute:e,timeline:this.timeline,gl:this.gl}):(P.a.error("unsupported transition type '".concat(n.type,"'"))(),i=!1)}(i||e.needsRedraw())&&(this.needsRedraw=!0,this.transitions[t].start(n,this.numInstances))}}]),t}();function ct(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 lt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ct(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ct(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function ht(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return ft(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 ft(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=n.call(t)},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 ft(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}n.d(e,"a",(function(){return pt}));var pt=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.id,i=void 0===r?"attribute-manager":r,o=n.stats,s=n.timeline;a()(this,t),this.id=i,this.gl=e,this.attributes={},this.updateTriggers={},this.needsRedraw=!0,this.userData={},this.stats=o,this.attributeTransitionManager=new ut(e,{id:"".concat(i,"-transitions"),timeline:s}),Object.seal(this)}return u()(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=ht(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(t){n.e(t)}finally{n.f()}}},{key:"invalidate",value:function(t,e){var n=this._invalidateTrigger(t,e);Object(q.a)("attributeManager.invalidate",this,t,n)}},{key:"invalidateAll",value:function(t){for(var e in this.attributes)this.attributes[e].setNeedsUpdate(e,t);Object(q.a)("attributeManager.invalidate",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,c=void 0===u?{}:u,l=t.context,h=void 0===l?{}:l,f=!1;for(var p in Object(q.a)("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]&&P.a.removed("props.".concat(p),"data.attributes.".concat(p))(),d.setExternalBuffer(c[p])||d.setBinaryValue("string"==typeof A?c[A]:void 0,e.startIndices)||"string"==typeof A&&!c[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&&Object(q.a)("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,r=lt({},n.getAttributes());for(var i in e){var o=e[i];o.needsRedraw(t)&&!n.hasAttribute(i)&&(r[i]=o)}return r}},{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 r=lt(lt({},e),{},{id:t,size:(e.isIndexed?1:e.size)||1,divisor:n.instanced?1:e.divisor||0});return new W(this.gl,r)}},{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;(Object(q.a)("attribute.updateStart",e),e.constant)?e.setConstantValue(e.value):(e.allocate(n)&&Object(q.a)("attribute.allocate",e,n),e.updateBuffer(t)&&(this.needsRedraw=!0,Object(q.a)("attribute.updateEnd",e,n)))}}]),t}()},function(t,e,n){"use strict";var r=n(9),i=n.n(r),o=n(3),a=n.n(o),s=n(4),u=n.n(s),c=n(26),l=n.n(c),h=n(5),f=n.n(h),p=n(6),d=n.n(p),A=n(2),g=n.n(A),m=n(0),y=n.n(m),v=n(50),_=n(189),b=n(164);const x=1e20;class w{constructor({fontSize:t=24,buffer:e=3,radius:n=8,cutoff:r=.25,fontFamily:i="sans-serif",fontWeight:o="normal",fontStyle:a="normal"}={}){this.buffer=e,this.cutoff=r,this.radius=n;const s=this.size=t+4*e,u=this._createCanvas(s),c=this.ctx=u.getContext("2d",{willReadFrequently:!0});c.font=`${a} ${o} ${t}px ${i}`,c.textBaseline="alphabetic",c.textAlign="left",c.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)}_createCanvas(t){const e=document.createElement("canvas");return e.width=e.height=t,e}draw(t){const{width:e,actualBoundingBoxAscent:n,actualBoundingBoxDescent:r,actualBoundingBoxLeft:i,actualBoundingBoxRight:o}=this.ctx.measureText(t),a=Math.ceil(n),s=Math.min(this.size-this.buffer,Math.ceil(o-i)),u=Math.min(this.size-this.buffer,a+Math.ceil(r)),c=s+2*this.buffer,l=u+2*this.buffer,h=Math.max(c*l,0),f=new Uint8ClampedArray(h),p={data:f,width:c,height:l,glyphWidth:s,glyphHeight:u,glyphTop:a,glyphLeft:0,glyphAdvance:e};if(0===s||0===u)return p;const{ctx:d,buffer:A,gridInner:g,gridOuter:m}=this;d.clearRect(A,A,s,u),d.fillText(t,A,A+a);const y=d.getImageData(A,A,s,u);m.fill(x,0,h),g.fill(0,0,h);for(let t=0;t<u;t++)for(let e=0;e<s;e++){const n=y.data[4*(t*s+e)+3]/255;if(0===n)continue;const r=(t+A)*c+e+A;if(1===n)m[r]=0,g[r]=x;else{const t=.5-n;m[r]=t>0?t*t:0,g[r]=t<0?t*t:0}}E(m,0,0,c,l,c,this.f,this.v,this.z),E(g,A,A,s,u,c,this.f,this.v,this.z);for(let t=0;t<h;t++){const e=Math.sqrt(m[t])-Math.sqrt(g[t]);f[t]=Math.round(255-255*(e/this.radius+this.cutoff))}return p}}function E(t,e,n,r,i,o,a,s,u){for(let c=e;c<e+r;c++)O(t,n*o+c,o,i,a,s,u);for(let c=n;c<n+i;c++)O(t,c*o+e,1,r,a,s,u)}function O(t,e,n,r,i,o,a){o[0]=0,a[0]=-x,a[1]=x,i[0]=t[e];for(let s=1,u=0,c=0;s<r;s++){i[s]=t[e+s*n];const r=s*s;do{const t=o[u];c=(i[s]-i[t]+r-t*t)/(s-t)/2}while(c<=a[u]&&--u>-1);u++,o[u]=s,a[u]=c,a[u+1]=x}for(let s=0,u=0;s<r;s++){for(;a[u+1]<s;)u++;const r=o[u],c=s-r;t[e+s*n]=i[r]+c*c}}var S=n(20);function T(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return C(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 C(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=n.call(t)},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 C(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 P=[];function M(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.layoutWidth)||0}return i}function I(t,e,n,r,i,o){for(var a=e,s=0,u=e;u<n;u++){var c=M(t,u,u+1,i);s+c>r&&(a<u&&o.push(u),a=u,s=0),s+=c}return s}function B(t,e,n,r,i,o){for(var a=e,s=e,u=e,c=0,l=e;l<n;l++)if(" "===t[l]?u=l+1:" "!==t[l+1]&&l+1!==n||(u=l+1),u>s){var h=M(t,s,u,i);c+h>r&&(a<s&&(o.push(s),a=s,c=0),h>r&&(h=I(t,s,u,r,i,o),a=o[o.length-1])),s=u,c+=h}return c}function R(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?I(t,i,o,n,r,a):B(t,i,o,n,r,a),a}function k(t,e,n,r,i,o){for(var a=0,s=0,u=e;u<n;u++){var c=t[u],l=r[c];l?(s||(s=l.layoutHeight),i[u]=a+l.layoutWidth/2,a+=l.layoutWidth):(S.a.warn("Missing character: ".concat(c," (").concat(c.codePointAt(0),")"))(),i[u]=a,a+=32)}o[0]=a,o[1]=s}function L(t,e,n,r,i){for(var o=Array.from(t),a=o.length,s=new Array(a),u=new Array(a),c=new Array(a),l=("break-word"===n||"break-all"===n)&&isFinite(r)&&r>0,h=[0,0],f=[0,0],p=0,d=0,A=0,g=0;g<=a;g++){var m=o[g];if("\n"!==m&&g!==a||(A=g),A>d){for(var y=l?R(o,n,r,i,d,A):P,v=0;v<=y.length;v++){var _=0===v?d:y[v-1],b=v<y.length?y[v]:A;k(o,_,b,i,s,f);for(var x=_;x<b;x++){var w,E=(null===(w=i[o[x]])||void 0===w?void 0:w.layoutOffsetY)||0;u[x]=p+f[1]/2+E,c[x]=f[0]}p+=f[1]*e,h[0]=Math.max(h[0],f[0])}d=A}"\n"===m&&(s[d]=0,u[d]=0,c[d]=0,d++)}return h[1]=p,{x:s,y:u,rowWidth:c,size:h}}var D=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5;a()(this,t),y()(this,"_cache",{}),y()(this,"_order",[]),this.limit=e}return u()(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}();function j(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return F(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 F(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=n.call(t)},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 F(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 z(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 U(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?z(Object(n),!0).forEach((function(e){y()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):z(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var N={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},G=new D(3);function V(t,e){var n;n="string"==typeof e?new Set(Array.from(e)):new Set(e);var r=G.get(t);if(!r)return n;for(var i in r.mapping)n.has(i)&&n.delete(i);return n}function H(t,e){for(var n=0;n<t.length;n++)e.data[4*n+3]=t[n]}function W(t,e,n,r){t.font="".concat(r," ").concat(n,"px ").concat(e),t.fillStyle="#000",t.textBaseline="alphabetic",t.textAlign="left"}var q=function(){function t(){a()(this,t),y()(this,"props",U({},N))}return u()(t,[{key:"texture",get:function(){return this._atlas}},{key:"mapping",get:function(){return this._atlas&&this._atlas.mapping}},{key:"scale",get:function(){var t=this.props,e=t.fontSize;return(1.2*e+2*t.buffer)/e}},{key:"setProps",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.assign(this.props,t),this._key=this._getKey();var e=V(this._key,this.props.characterSet),n=G.get(this._key);if(n&&0===e.size)this._atlas!==n&&(this._atlas=n);else{var r=this._generateFontAtlas(e,n);this._atlas=r,G.set(this._key,r)}}},{key:"_generateFontAtlas",value:function(t,e){var n=this.props,r=n.fontFamily,i=n.fontWeight,o=n.fontSize,a=n.buffer,s=n.sdf,u=n.radius,c=n.cutoff,l=e&&e.data;l||((l=document.createElement("canvas")).width=1024);var h=l.getContext("2d");W(h,r,o,i);var f=function(t){var e,n,r=t.characterSet,i=t.getFontWidth,o=t.fontHeight,a=t.buffer,s=t.maxCanvasWidth,u=t.mapping,c=void 0===u?{}:u,l=t.xOffset,h=void 0===l?0:l,f=t.yOffset,p=void 0===f?0:f,d=0,A=h,g=o+2*a,m=T(r);try{for(m.s();!(e=m.n()).done;){var y=e.value;if(!c[y]){var v=i(y);A+v+2*a>s&&(A=0,d++),c[y]={x:A+a,y:p+d*g+a,width:v,height:g,layoutWidth:v,layoutHeight:o},A+=v+2*a}}}catch(t){m.e(t)}finally{m.f()}return{mapping:c,xOffset:A,yOffset:p+d*g,canvasHeight:(n=p+(d+1)*g,Math.pow(2,Math.ceil(Math.log2(n))))}}(U({getFontWidth:function(t){return h.measureText(t).width},fontHeight:1.2*o,buffer:a,characterSet:t,maxCanvasWidth:1024},e&&{mapping:e.mapping,xOffset:e.xOffset,yOffset:e.yOffset})),p=f.mapping,d=f.canvasHeight,A=f.xOffset,g=f.yOffset;if(l.height!==d){var m=h.getImageData(0,0,l.width,l.height);l.height=d,h.putImageData(m,0,0)}if(W(h,r,o,i),s){var y,v=new w({fontSize:o,buffer:a,radius:u,cutoff:c,fontFamily:r,fontWeight:"".concat(i)}),_=j(t);try{for(_.s();!(y=_.n()).done;){var b=y.value,x=v.draw(b),E=x.data,O=x.width,S=x.height,C=x.glyphTop;p[b].width=O,p[b].layoutOffsetY=.9*o-C;var P=h.createImageData(O,S);H(E,P),h.putImageData(P,p[b].x,p[b].y)}}catch(t){_.e(t)}finally{_.f()}}else{var M,I=j(t);try{for(I.s();!(M=I.n()).done;){var B=M.value;h.fillText(B,p[B].x,p[B].y+a+.9*o)}}catch(t){I.e(t)}finally{I.f()}}return{xOffset:A,yOffset:g,mapping:p,data:l,width:l.width,height:l.height}}},{key:"_getKey",value:function(){var t=this.props,e=t.fontFamily,n=t.fontWeight,r=t.fontSize,i=t.buffer,o=t.sdf,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}(),X=n(162);function J(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Z(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 Z(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=n.call(t)},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 Z(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 Q(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 K(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Q(Object(n),!0).forEach((function(e){y()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Q(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Y(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=g()(t);if(e){var i=g()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return d()(this,n)}}n.d(e,"a",(function(){return rt}));var $={start:1,middle:0,end:-1},tt={top:1,center:0,bottom:-1},et=[0,0,0,255],nt={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:et},getBorderWidth:{type:"accessor",value:0},backgroundPadding:{type:"array",value:[0,0,0,0]},characterSet:{type:"object",value:N.characterSet},fontFamily:N.fontFamily,fontWeight:N.fontWeight,lineHeight:1,outlineWidth:{type:"number",value:0,min:0},outlineColor:{type:"color",value:et},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:et},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"]}},rt=function(t){f()(n,t);var e=Y(n);function n(){var t;a()(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)),y()(l()(t),"getBoundingRect",(function(e,n){var r=t.state.fontAtlasManager.mapping,o=t.state.getText,a=t.props,s=a.wordBreak,u=a.maxWidth,c=a.lineHeight,l=a.getTextAnchor,h=a.getAlignmentBaseline,f=L(o(e,n)||"",c,s,u,r),p=i()(f.size,2),d=p[0],A=p[1];return[($["function"==typeof l?l(e,n):l]-1)*d/2,(tt["function"==typeof h?h(e,n):h]-1)*A/2,d,A]})),y()(l()(t),"getIconOffsets",(function(e,n){for(var r=t.state.fontAtlasManager.mapping,o=t.state.getText,a=t.props,s=a.wordBreak,u=a.maxWidth,c=a.lineHeight,l=a.getTextAnchor,h=a.getAlignmentBaseline,f=L(o(e,n)||"",c,s,u,r),p=f.x,d=f.y,A=f.rowWidth,g=i()(f.size,2),m=g[0],y=g[1],v=$["function"==typeof l?l(e,n):l],_=tt["function"==typeof h?h(e,n):h],b=p.length,x=new Array(2*b),w=0,E=0;E<b;E++){var O=(1-v)*(m-A[E])/2;x[w++]=(v-1)*m/2+O+p[E],x[w++]=(_-1)*y/2+d[E]}return x})),t}return u()(n,[{key:"initializeState",value:function(){this.state={styleVersion:0,fontAtlasManager:new q}}},{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,i=this.state,o=i.fontAtlasManager,a=i.characterSet,s=K(K({},e),{},{characterSet:a,fontFamily:n,fontWeight:r});if(!o.mapping)return o.setProps(s),!0;for(var u in s)if(s[u]!==o.props[u])return o.setProps(s),!0;return!1}},{key:"_updateText",value:function(){var t,e,n=this.props,r=n.data,i=n.characterSet,o=null===(t=r.attributes)||void 0===t?void 0:t.getText,a=this.props.getText,s=r.startIndices,u="auto"===i&&new Set;if(o&&s){var c=function(t){var e=t.value,n=t.length,r=t.stride,i=t.offset,o=t.startIndices,a=t.characterSet,s=e.BYTES_PER_ELEMENT,u=r?r/s:1,c=i?i/s:0,l=o[n]||Math.ceil((e.length-c)/u),h=a&&new Set,f=new Array(n),p=e;if(u>1||c>0){p=new(0,e.constructor)(l);for(var d=0;d<l;d++)p[d]=e[d*u+c]}for(var A=0;A<n;A++){var g=o[A],m=o[A+1]||l,y=p.subarray(g,m);f[A]=String.fromCodePoint.apply(null,y),h&&y.forEach(h.add,h)}if(h){var v,_=T(h);try{for(_.s();!(v=_.n()).done;){var b=v.value;a.add(String.fromCodePoint(b))}}catch(t){_.e(t)}finally{_.f()}}return{texts:f,characterCount:l}}(K(K({},ArrayBuffer.isView(o)?{value:o}:o),{},{length:r.length,startIndices:s,characterSet:u})),l=c.texts;e=c.characterCount,a=function(t,e){var n=e.index;return l[n]}}else{var h=Object(v.a)(r),f=h.iterable,p=h.objectInfo;s=[0],e=0;var d,A=J(f);try{for(A.s();!(d=A.n()).done;){var g=d.value;p.index++;var m=Array.from(a(g,p)||"");u&&m.forEach(u.add,u),e+=m.length,s.push(e)}}catch(t){A.e(t)}finally{A.f()}}this.setState({getText:a,startIndices:s,numInstances:e,characterSet:u||i})}},{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,c=this.props,l=c.data,h=c._dataDiff,f=c.getPosition,p=c.getColor,d=c.getSize,A=c.getAngle,g=c.getPixelOffset,m=c.getBackgroundColor,y=c.getBorderColor,v=c.getBorderWidth,_=c.backgroundPadding,x=c.background,w=c.billboard,E=c.fontSettings,O=c.outlineWidth,S=c.outlineColor,T=c.sizeScale,C=c.sizeUnits,P=c.sizeMinPixels,M=c.sizeMaxPixels,I=c.transitions,B=c.updateTriggers,R=this.getSubLayerClass("characters",b.a),k=this.getSubLayerClass("background",X.a);return[x&&new k({getFillColor:m,getLineColor:y,getLineWidth:v,padding:_,getPosition:f,getSize:d,getAngle:A,getPixelOffset:g,billboard:w,sizeScale:T/this.state.fontAtlasManager.props.fontSize,sizeUnits:C,sizeMinPixels:P,sizeMaxPixels:M,transitions:I&&{getPosition:I.getPosition,getAngle:I.getAngle,getSize:I.getSize,getFillColor:I.getBackgroundColor,getLineColor:I.getBorderColor,getLineWidth:I.getBorderWidth,getPixelOffset:I.getPixelOffset}},this.getSubLayerProps({id:"background",updateTriggers:{getPosition:B.getPosition,getAngle:B.getAngle,getSize:B.getSize,getFillColor:B.getBackgroundColor,getLineColor:B.getBorderColor,getLineWidth:B.getBorderWidth,getPixelOffset:B.getPixelOffset,getBoundingRect:{getText:B.getText,getTextAnchor:B.getTextAnchor,getAlignmentBaseline:B.getAlignmentBaseline,styleVersion:u}}}),{data:l.attributes&&l.attributes.background?{length:l.length,attributes:l.attributes.background}:l,_dataDiff:h,autoHighlight:!1,getBoundingRect:this.getBoundingRect}),new R({sdf:E.sdf,smoothing:Number.isFinite(E.smoothing)?E.smoothing:N.smoothing,outlineWidth:O/(E.radius||N.radius),outlineColor:S,iconAtlas:a,iconMapping:s,getPosition:f,getColor:p,getSize:d,getAngle:A,getPixelOffset:g,billboard:w,sizeScale:T*o,sizeUnits:C,sizeMinPixels:P*o,sizeMaxPixels:M*o,transitions:I&&{getPosition:I.getPosition,getAngle:I.getAngle,getColor:I.getColor,getSize:I.getSize,getPixelOffset:I.getPixelOffset}},this.getSubLayerProps({id:"characters",updateTriggers:{getIcon:B.getText,getPosition:B.getPosition,getAngle:B.getAngle,getColor:B.getColor,getSize:B.getSize,getPixelOffset:B.getPixelOffset,getIconOffsets:{getText:B.getText,getTextAnchor:B.getTextAnchor,getAlignmentBaseline:B.getAlignmentBaseline,styleVersion:u}}}),{data:l,_dataDiff:h,startIndices:e,numInstances:n,getIconOffsets:this.getIconOffsets,getIcon:r})]}}],[{key:"fontAtlasCacheLimit",set:function(t){!function(t){S.a.assert(Number.isFinite(t)&&t>=3,"Invalid cache limit"),G=new D(t)}(t)}}]),n}(_.a);y()(rt,"defaultProps",nt),y()(rt,"layerName","TextLayer")},function(t,e,n){"use strict";var r=n(3),i=n.n(r),o=n(4),a=n.n(o),s=n(7),u=n.n(s),c=n(5),l=n.n(c),h=n(6),f=n.n(h),p=n(2),d=n.n(p),A=n(0),g=n.n(A),m=n(204),y=n(221),v=n(220),_=n(12),b=n(157),x=n(8),w=n(234),E=n(181),O=n(178),S=n(20),T=n(45),C=n(58),P=n(36);function M(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 I(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?M(Object(n),!0).forEach((function(e){g()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):M(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function B(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=d()(t);if(e){var i=d()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return f()(this,n)}}var R=function(t){l()(n,t);var e=B(n);function n(t){i()(this,n);var r=t.id,o=void 0===r?Object(T.c)("column-geometry"):r,a=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&&(S.a.assert(a.length>=o),a=a.flatMap((function(t){return[t[0],t[1]]})),Object(P.h)(a,P.a.COUNTER_CLOCKWISE));var s=r>0,u=o+1,c=s?3*u+1:o,l=2*Math.PI/o,h=new Uint16Array(s?3*o*2:0),f=new Float32Array(3*c),p=new Float32Array(3*c),d=0;if(s){for(var A=0;A<u;A++)for(var g=A*l,m=A%o,y=Math.sin(g),v=Math.cos(g),_=0;_<2;_++)f[d+0]=a?a[2*m]:v*e,f[d+1]=a?a[2*m+1]:y*e,f[d+2]=(.5-_)*r,p[d+0]=a?a[2*m]:v,p[d+1]=a?a[2*m+1]:y,d+=3;f[d+0]=f[d-3],f[d+1]=f[d-2],f[d+2]=f[d-1],d+=3}for(var b=s?0:1;b<u;b++){var x=Math.floor(b/2)*Math.sign(.5-b%2),w=x*l,E=(x+o)%o,O=Math.sin(w),T=Math.cos(w);f[d+0]=a?a[2*E]:T*e,f[d+1]=a?a[2*E+1]:O*e,f[d+2]=r/2,p[d+2]=1,d+=3}if(s)for(var C=0,M=0;M<o;M++)h[C++]=2*M+0,h[C++]=2*M+2,h[C++]=2*M+0,h[C++]=2*M+1,h[C++]=2*M+1,h[C++]=2*M+3;return{indices:h,attributes:{POSITION:{size:3,value:f},NORMAL:{size:3,value:p}}}}(t),s=a.indices,u=a.attributes;return e.call(this,I(I({},t),{},{id:o,indices:s,attributes:u}))}return n}(C.a);function k(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 L(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?k(Object(n),!0).forEach((function(e){g()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):k(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function D(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=d()(t);if(e){var i=d()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return f()(this,n)}}n.d(e,"a",(function(){return z}));var j=[0,0,0,255],F={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:j},getLineColor:{type:"accessor",value:j},getLineWidth:{type:"accessor",value:1},getElevation:{type:"accessor",value:1e3},material:!0,getColor:{deprecatedFor:["getFillColor","getLineColor"]}},z=function(t){l()(n,t);var e=D(n);function n(){return i()(this,n),e.apply(this,arguments)}return a()(n,[{key:"getShaders",value:function(){var t=this.context.gl,e=!Object(x.j)(t),r={},i=this.props.flatShading&&Object(w.b)(t,E.a.GLSL_DERIVATIVES);return i&&(r.FLAT_SHADING=1),u()(d()(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);\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:[m.a,i?y.b:y.a,v.a]})}},{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:j},instanceLineColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getLineColor",defaultValue:j},instanceStrokeWidths:{size:1,accessor:"getLineWidth",transition:!0}})}},{key:"updateState",value:function(t){u()(d()(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,a=this.context.gl;null===(o=this.state.model)||void 0===o||o.delete(),this.state.model=this._getModel(a),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 R({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 O.a(t,L(L({},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,c=n.extruded,l=n.filled,h=n.stroked,f=n.wireframe,p=n.offset,d=n.coverage,A=n.radius,g=n.angle,m=this.state,y=m.model,v=m.fillVertexCount,b=m.wireframeVertexCount,x=m.edgeDistance;y.setUniforms(e).setUniforms({radius:A,angle:g/180*Math.PI,offset:p,extruded:c,stroked:h,coverage:d,elevationScale:u,edgeDistance:x,radiusUnits:_.e[s],widthUnits:_.e[r],widthScale:i,widthMinPixels:o,widthMaxPixels:a}),c&&f&&(y.setProps({isIndexed:!0}),y.setVertexCount(b).setDrawMode(1).setUniforms({isStroke:!0}).draw()),l&&(y.setProps({isIndexed:!1}),y.setVertexCount(v).setDrawMode(5).setUniforms({isStroke:!1}).draw()),!c&&h&&(y.setProps({isIndexed:!1}),y.setVertexCount(2*v/3).setDrawMode(5).setUniforms({isStroke:!0}).draw())}}]),n}(b.a);g()(z,"layerName","ColumnLayer"),g()(z,"defaultProps",F)},function(t,e,n){"use strict";var r=n(3),i=n.n(r),o=n(4),a=n.n(o),s=n(7),u=n.n(s),c=n(5),l=n.n(c),h=n(6),f=n.n(h),p=n(2),d=n.n(p),A=n(0),g=n.n(A),m=n(204),y=n(220),v=n(12),_=n(157),b=n(178),x=n(58);function w(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 E(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?w(Object(n),!0).forEach((function(e){g()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function O(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=d()(t);if(e){var i=d()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return f()(this,n)}}n.d(e,"a",(function(){return C}));var S=[0,0,0,255],T={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:S},getLineColor:{type:"accessor",value:S},getLineWidth:{type:"accessor",value:1},strokeWidth:{deprecatedFor:"getLineWidth"},outline:{deprecatedFor:"stroked"},getColor:{deprecatedFor:["getFillColor","getLineColor"]}},C=function(t){l()(n,t);var e=O(n);function n(){return i()(this,n),e.apply(this,arguments)}return a()(n,[{key:"getShaders",value:function(){return u()(d()(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;\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:[m.a,y.a]})}},{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(u()(d()(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,c=n.billboard,l=n.antialiasing,h=n.lineWidthUnits,f=n.lineWidthScale,p=n.lineWidthMinPixels,d=n.lineWidthMaxPixels;this.state.model.setUniforms(e).setUniforms({stroked:s?1:0,filled:u,billboard:c,antialiasing:l,radiusUnits:v.e[r],radiusScale:i,radiusMinPixels:o,radiusMaxPixels:a,lineWidthUnits:v.e[h],lineWidthScale:f,lineWidthMinPixels:p,lineWidthMaxPixels:d}).draw()}},{key:"_getModel",value:function(t){return new b.a(t,E(E({},this.getShaders()),{},{id:this.props.id,geometry:new x.a({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}(_.a);g()(C,"defaultProps",T),g()(C,"layerName","ScatterplotLayer")},function(t,e,n){"use strict";var r=n(3),i=n.n(r),o=n(4),a=n.n(o),s=n(7),u=n.n(s),c=n(5),l=n.n(c),h=n(6),f=n.n(h),p=n(2),d=n.n(p),A=n(0),g=n.n(A),m=n(204),y=n(220),v=n(12),_=n(157),b=n(178),x=n(58);function w(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 E(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?w(Object(n),!0).forEach((function(e){g()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function O(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=d()(t);if(e){var i=d()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return f()(this,n)}}n.d(e,"a",(function(){return T}));var S={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,padding:{type:"array",value:[0,0,0,0]},getPosition:{type:"accessor",value: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}},T=function(t){l()(n,t);var e=O(n);function n(){return i()(this,n),e.apply(this,arguments)}return a()(n,[{key:"getShaders",value:function(){return u()(d()(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;\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:[m.a,y.a]})}},{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(u()(d()(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.sizeMinPixels,s=n.sizeMaxPixels,u=n.getLineWidth,c=this.props.padding;c.length<4&&(c=[c[0],c[1],c[0],c[1]]),this.state.model.setUniforms(e).setUniforms({billboard:r,stroked:Boolean(u),padding:c,sizeUnits:v.e[o],sizeScale:i,sizeMinPixels:a,sizeMaxPixels:s}).draw()}},{key:"_getModel",value:function(t){return new b.a(t,E(E({},this.getShaders()),{},{id:this.props.id,geometry:new x.a({drawMode:6,vertexCount:4,attributes:{positions:{size:2,value:new Float32Array([0,0,1,0,1,1,0,1])}}}),isInstanced:!0}))}}]),n}(_.a);g()(T,"defaultProps",S),g()(T,"layerName","TextBackgroundLayer")},function(t,e,n){"use strict";var r=n(3),i=n.n(r),o=n(4),a=n.n(o),s=n(0),u=n.n(s),c=n(287),l=n(23),h=n(20),f=n(31),p=n(65),d=n(73),A=n(202);function g(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return m(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 m(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=n.call(t)},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 m(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 y=function(){function t(e,n,r){i()(this,t),u()(this,"_loadCount",0),u()(this,"_subscribers",new Set),this.id=e,this.context=r,this.setData(n)}return a()(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=Object(A.a)(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)})).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=g(this._subscribers);try{for(a.s();!(o=a.n()).done;){o.value.onChange(this.getData())}}catch(t){a.e(t)}finally{a.f()}}}}]),t}(),v=function(){function t(e){var n=e.gl,r=e.protocol;i()(this,t),this.protocol=r||"resource://",this._context={gl:n,resourceManager:this},this._resources={},this._consumers={},this._pruneRequest=null}return a()(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}(),_=n(41),b=n(150);function x(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return w(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 w(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=n.call(t)},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 w(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}n.d(e,"a",(function(){return E}));var E=function(){function t(e){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=r.deck,a=r.stats,s=r.viewport,l=r.timeline;i()(this,t),u()(this,"_lastRenderedLayers",[]),u()(this,"_needsRedraw",!1),u()(this,"_needsUpdate",!1),u()(this,"_nextLayers",null),u()(this,"_debug",!1),u()(this,"activateViewport",(function(t){Object(f.a)("layerManager.activateViewport",n,t),t&&(n.context.viewport=t)})),this.layers=[],this.resourceManager=new v({gl:e,protocol:"deck://"}),this.context={mousePosition:null,userData:{},layerManager:this,gl:e,deck:o,programManager:e&&Object(b.a)(e),stats:a||new d.a({id:"deck.gl"}),viewport:s||new _.a({id:"DEFAULT-INITIAL-VIEWPORT"}),timeline:l||new c.a,resourceManager:this.resourceManager,onError:void 0},Object.seal(this)}return a()(t,[{key:"finalize",value:function(){this.resourceManager.finalize();var t,e=x(this.layers);try{for(e.s();!(t=e.n()).done;){var n=t.value;this._finalizeLayer(n)}}catch(t){e.e(t)}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=x(this.layers);try{for(r.s();!(n=r.n()).done;){var i=n.value,o=i.getNeedsRedraw(t);e=e||o}}catch(t){r.e(t)}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]:{},e=t.layerIds;return e?this.layers.filter((function(t){return e.find((function(e){return 0===t.id.indexOf(e)}))})):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){Object(f.a)("layerManager.setLayers",this,e,t),this._lastRenderedLayers=t;var n,r=Object(p.b)(t,Boolean),i=x(r);try{for(i.s();!(n=i.n()).done;){n.value.context=this.context}}catch(t){i.e(t)}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=x(t);try{for(i.s();!(n=i.n()).done;){var o=n.value;r[o.id]?h.a.warn("Multiple old layers with same id ".concat(o.id))():r[o.id]=o}}catch(t){i.e(t)}finally{i.f()}var a=[];this._updateSublayersRecursively(e,r,a),this._finalizeOldLayers(r);for(var s=!1,u=0,c=a;u<c.length;u++){var l=c[u];if(l.hasUniformTransition()){s="Uniform transition in ".concat(l);break}}this._needsUpdate=s,this.layers=a}},{key:"_updateSublayersRecursively",value:function(t,e,n){var r,i=x(t);try{for(i.s();!(r=i.n()).done;){var o=r.value;o.context=this.context;var a=e[o.id];null===a&&h.a.warn("Multiple new layers with same id ".concat(o.id))(),e[o.id]=null;var s=null;try{this._debug&&a!==o&&o.validateProps(),a?(this._transferLayerState(a,o),this._updateLayer(o)):this._initializeLayer(o),n.push(o),s=o.isComposite?o.getSubLayers():null}catch(t){this._handleError("matching",t,o)}s&&this._updateSublayersRecursively(s,e,n)}}catch(t){i.e(t)}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=l.e.INITIALIZED}catch(e){this._handleError("initialization",e,t)}}},{key:"_transferLayerState",value:function(t,e){e._transferState(t),e.lifecycle=l.e.MATCHED,e!==t&&(t.lifecycle=l.e.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=l.e.AWAITING_FINALIZATION;try{t._finalize(),t.lifecycle=l.e.FINALIZED}catch(e){this._handleError("finalization",e,t)}}}]),t}()},function(t,e,n){"use strict";var r=n(3),i=n.n(r),o=n(4),a=n.n(o),s=n(7),u=n.n(s),c=n(5),l=n.n(c),h=n(6),f=n.n(h),p=n(2),d=n.n(p),A=n(0),g=n.n(A),m=n(20),y=n(113);function v(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?v(Object(n),!0).forEach((function(e){g()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function b(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=d()(t);if(e){var i=d()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return f()(this,n)}}n.d(e,"a",(function(){return w}));var x=[],w=function(t){l()(n,t);var e=b(n);function n(){return i()(this,n),e.apply(this,arguments)}return a()(n,[{key:"getShaders",value:function(){return _(_({},u()(d()(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;u()(d()(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){u()(d()(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&&m.a.warn("".concat(this.id,": fontSettings.sdf is required to render outline"))()}},{key:"draw",value:function(t){var e=this.props,r=e.sdf,i=e.smoothing,o=e.outlineWidth,a=this.state.outlineColor,s=o?Math.max(i,.75*(1-o)):-1;(t.uniforms=_(_({},t.uniforms),{},{buffer:.75,outlineBuffer:s,gamma:i,sdf:Boolean(r),outlineColor:a}),u()(d()(n.prototype),"draw",this).call(this,t),r&&o)&&(this.state.iconManager.getTexture()&&this.state.model.draw({uniforms:{outlineBuffer:.75}}))}},{key:"getInstanceOffset",value:function(t){var e=this;return t?Array.from(t).flatMap((function(t){return u()(d()(n.prototype),"getInstanceOffset",e).call(e,t)})):x}},{key:"getInstanceColorMode",value:function(t){return 1}},{key:"getInstanceIconFrame",value:function(t){var e=this;return t?Array.from(t).flatMap((function(t){return u()(d()(n.prototype),"getInstanceIconFrame",e).call(e,t)})):x}}]),n}(y.a);g()(w,"defaultProps",{getIconOffsets:{type:"accessor",value:function(t){return t.offsets}},alphaCutoff:.001,smoothing:.1,outlineWidth:0,outlineColor:{type:"color",value:[0,0,0,255]}}),g()(w,"layerName","MultiIconLayer")},function(t,e,n){"use strict";var r=n(0),i=n.n(r),o=n(3),a=n.n(o),s=n(4),u=n.n(s),c=n(31),l=n(5),h=n.n(l),f=n(6),p=n.n(f),d=n(2),A=n.n(d),g=n(12);function m(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=A()(t);if(e){var i=A()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return p()(this,n)}}var y=function(t){h()(n,t);var e=m(n);function n(){return a()(this,n),e.apply(this,arguments)}return u()(n,[{key:"shouldDrawLayer",value:function(t){return t.props.operation===g.c.DRAW}}]),n}(n(70).a),v=n(172),_=n(71);function b(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return x(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 x(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=n.call(t)},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 x(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 w(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 E(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?w(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}n.d(e,"a",(function(){return O}));var O=function(){function t(e){a()(this,t),this.gl=e,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new y(e),this.pickLayersPass=new v.a(e),this.renderCount=0,this._needsRedraw="Initial render",this.renderBuffers=[],this.lastPostProcessEffect=null}return u()(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||_.a.getDefaultFramebuffer(this.gl),this._preRender(t.effects,t);var n=this.lastPostProcessEffect?this.renderBuffers[0]:t.target,r=e.render(E(E({},t),{},{target:n}));this._postRender(t.effects,t),this.renderCount++,Object(c.a)("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=b(e);try{for(n.s();!(t=n.n()).done;){t.value.delete()}}catch(t){n.e(t)}finally{n.f()}e.length=0}},{key:"_preRender",value:function(t,e){var n,r=null,i=b(t);try{for(i.s();!(n=i.n()).done;){var o=n.value;o.preRender(this.gl,e),o.postRender&&(r=o)}}catch(t){i.e(t)}finally{i.f()}r&&this._resizeRenderBuffers(),this.lastPostProcessEffect=r}},{key:"_resizeRenderBuffers",value:function(){var t=this.renderBuffers;0===t.length&&t.push(new _.a(this.gl),new _.a(this.gl));var e,n=b(t);try{for(n.s();!(e=n.n()).done;){e.value.resize()}}catch(t){n.e(t)}finally{n.f()}}},{key:"_postRender",value:function(t,e){var n,r=this.renderBuffers,i={inputBuffer:r[0],swapBuffer:r[1],target:null},o=b(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 s=a.postRender(this.gl,i);i.inputBuffer=s,i.swapBuffer=s===r[0]?r[1]:r[0]}}}catch(t){o.e(t)}finally{o.f()}}}]),t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var r=n(27),i=n.n(r),o=n(0),a=n.n(o),s=n(3),u=n.n(s),c=n(4),l=n.n(c);function h(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 f(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?h(Object(n),!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var p={onIninitialize:function(t){return t},onFinalize:function(t){return t},onMessage:null},d=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Transport";u()(this,t),this.name=e,this._messageQueue=[],this.userData={}}return l()(t,[{key:"getRootDOMElement",value:function(){return"undefined"!=typeof document?document.body:null}},{key:"sendJSONMessage",value:function(){console.error("Back-channel not implemented for this transport")}},{key:"sendBinaryMessage",value:function(){console.error("Back-channel not implemented for this transport")}},{key:"_initialize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=f({transport:this},t);p.onInitialize(e)}},{key:"_finalize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=f({transport:this},t);p.onFinalize(e),this._destroyed=!0}},{key:"_messageReceived",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t=f({transport:this},t),console.debug("Delivering transport message",t),p.onMessage(t)}}],[{key:"setCallbacks",value:function(t){var e=t.onInitialize,n=t.onFinalize,r=t.onMessage;e&&(p.onInitialize=e),n&&(p.onFinalize=n),r&&(p.onMessage=r)}},{key:"_stringifyJSONSafe",value:function(t){var e=new Set;return JSON.stringify(t,(function(t,n){if("object"===i()(n)&&null!==n){if(e.has(n))try{return JSON.parse(JSON.stringify(n))}catch(t){return}e.add(n)}return n}))}}]),t}()},function(t,e,n){"use strict";(function(t){function r(e){if("undefined"!=typeof window&&"object"==typeof window.process&&"renderer"===window.process.type)return!0;if(void 0!==t&&"object"==typeof t.versions&&Boolean(t.versions.electron))return!0;const n="object"==typeof navigator&&"string"==typeof navigator.userAgent&&navigator.userAgent,r=e||n;return!!(r&&r.indexOf("Electron")>=0)}n.d(e,"a",(function(){return r}))}).call(this,n(63))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(8);function i(t,e,n,i){const o="See luma.gl ".concat(n," Upgrade Guide at https://luma.gl/docs/upgrade-guide"),a=Object.getPrototypeOf(t);i.forEach(t=>{a.methodName||(a[t]=()=>{throw r.k.removed("Calling removed method ".concat(e,".").concat(t,": "),o)(),new Error(t)})})}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(115),i=n(22),o=n(13);class a extends r.a{toString(){let t="[";if(o.b.printRowMajor){t+="row-major:";for(let e=0;e<this.RANK;++e)for(let n=0;n<this.RANK;++n)t+=" ".concat(this[n*this.RANK+e])}else{t+="column-major:";for(let e=0;e<this.ELEMENTS;++e)t+=" ".concat(this[e])}return t+="]",t}getElementIndex(t,e){return e*this.RANK+t}getElement(t,e){return this[e*this.RANK+t]}setElement(t,e,n){return this[e*this.RANK+t]=Object(i.a)(n),this}getColumn(t,e=new Array(this.RANK).fill(-0)){const n=t*this.RANK;for(let t=0;t<this.RANK;++t)e[t]=this[n+t];return e}setColumn(t,e){const n=t*this.RANK;for(let t=0;t<this.RANK;++t)this[n+t]=e[t];return this}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var r=n(0),i=n.n(r),o=n(3),a=n.n(o),s=n(4),u=n.n(s);function c(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 l(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?c(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var h=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{id:"pass"};a()(this,t);var r=n.id;this.id=r,this.gl=e,this.props=l({},n)}return u()(t,[{key:"setProps",value:function(t){Object.assign(this.props,t)}},{key:"render",value:function(t){}},{key:"cleanup",value:function(){}}]),t}()},function(t,e,n){"use strict";function r(t,e=!0,n){const o=n||new Set;if(t){if(i(t))o.add(t);else if(i(t.buffer))o.add(t.buffer);else if(ArrayBuffer.isView(t));else if(e&&"object"==typeof t)for(const n in t)r(t[n],e,o)}else;return void 0===n?Array.from(o):[]}function i(t){return!!t&&(t instanceof ArrayBuffer||("undefined"!=typeof MessagePort&&t instanceof MessagePort||("undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas)))}function o(t){if(null===t)return{};const e=Object.assign({},t);return Object.keys(e).forEach(n=>{"object"!=typeof t[n]||ArrayBuffer.isView(t[n])?"function"==typeof e[n]||e[n]instanceof RegExp?e[n]={}:e[n]=t[n]:e[n]=o(t[n])}),e}n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return o}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return T}));var r=n(3),i=n.n(r),o=n(4),a=n.n(o),s=n(26),u=n.n(s),c=n(7),l=n.n(c),h=n(5),f=n.n(h),p=n(6),d=n.n(p),A=n(2),g=n.n(A),m=n(0),y=n.n(m),v=n(70),_=n(8),b=n(12),x=n(20);function w(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 E(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?w(Object(n),!0).forEach((function(e){y()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function O(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=g()(t);if(e){var i=g()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return d()(this,n)}}var S={blendFunc:[1,0,32771,0],blendEquation:32774},T=function(t){f()(n,t);var e=O(n);function n(){var t;i()(this,n);for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];return t=e.call.apply(e,[this].concat(o)),y()(u()(t),"_colors",null),t}return a()(n,[{key:"render",value:function(t){return t.pickingFBO?this._drawPickingBuffer(t):l()(g()(n.prototype),"render",this).call(this,t)}},{key:"_drawPickingBuffer",value:function(t){var e=this,r=t.layers,i=t.layerFilter,o=t.views,a=t.viewports,s=t.onViewportActive,u=t.pickingFBO,c=t.deviceRect,h=c.x,f=c.y,p=c.width,d=c.height,A=t.cullRect,m=t.effects,y=t.pass,v=void 0===y?"picking":y,b=t.pickZ,x=this.gl;this.pickZ=b;var w=b?null:{byLayer:new Map,byAlpha:[]};this._colors=w;var O=Object(_.o)(x,E(E({scissorTest:!0,scissor:[h,f,p,d],clearColor:[0,0,0,0],depthMask:!0,depthTest:!0,depthRange:[0,1],colorMask:[!0,!0,!0,!0]},S),{},{blend:!b}),(function(){return l()(g()(n.prototype),"render",e).call(e,{target:u,layers:r,layerFilter:i,views:o,viewports:a,onViewportActive:s,cullRect:A,effects:null==m?void 0:m.filter((function(t){return t.useInPicking})),pass:v})}));return this._colors=null,{decodePickingColor:w&&C.bind(null,w),stats:O}}},{key:"shouldDrawLayer",value:function(t){return t.props.pickable&&t.props.operation===b.c.DRAW}},{key:"getModuleParameters",value:function(){return{pickingActive:1,pickingAttribute:this.pickZ,lightSources:{}}}},{key:"getLayerParameters",value:function(t,e,n){var r=E({},t.props.parameters);return this._colors?(Object.assign(r,S),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):(x.a.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}(v.a);function C(t,e){var n=t.byAlpha[e[3]];return n&&{pickedLayer:n.layer,pickedViewports:n.viewports,pickedObjectIndex:n.layer.decodePickingColor(e)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));function r(t){const e=i(t);return function(t){const e=i(t);if(!(e.byteLength>=24&&2303741511===e.getUint32(0,!1)))return null;return{mimeType:"image/png",width:e.getUint32(16,!1),height:e.getUint32(20,!1)}}(e)||function(t){const e=i(t);if(!(e.byteLength>=3&&65496===e.getUint16(0,!1)&&255===e.getUint8(2)))return null;const{tableMarkers:n,sofMarkers:r}=function(){const t=new Set([65499,65476,65484,65501,65534]);for(let e=65504;e<65520;++e)t.add(e);const e=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:t,sofMarkers:e}}();let o=2;for(;o+9<e.byteLength;){const t=e.getUint16(o,!1);if(r.has(t))return{mimeType:"image/jpeg",height:e.getUint16(o+5,!1),width:e.getUint16(o+7,!1)};if(!n.has(t))return null;o+=2,o+=e.getUint16(o,!1)}return null}(e)||function(t){const e=i(t);if(!(e.byteLength>=10&&1195984440===e.getUint32(0,!1)))return null;return{mimeType:"image/gif",width:e.getUint16(6,!0),height:e.getUint16(8,!0)}}(e)||function(t){const e=i(t);if(!(e.byteLength>=14&&16973===e.getUint16(0,!1)&&e.getUint32(2,!0)===e.byteLength))return null;return{mimeType:"image/bmp",width:e.getUint32(18,!0),height:e.getUint32(22,!0)}}(e)}function i(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(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,c=e.length,l=c,h=c,f=0;f<c;f++){var p=n(e[f]);if(l>f&&p>=a&&(l=f),p>=u){h=f;break}}for(var d=l,A=h-l!==i.length?e.slice(h):void 0,g=0;g<i.length;g++)e[d++]=i[g];if(A){for(var m=0;m<A.length;m++)e[d++]=A[m];e.length=d}return{startRow:l,endRow:l+i.length}}n.d(e,"a",(function(){return r}))},function(t,e,n){var r=n(260);t.exports=function(t,e){if(null==t)return{};var n,i,o=r(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)n=a[i],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}},function(t,e,n){"use strict";function r(t){var e=document.createElement("link");e.type="text/css",e.rel="stylesheet",e.href=t,document.getElementsByTagName("head")[0].appendChild(e)}function i(t,e){var n=document.createElement("div");return n.style.width=Number.isFinite(t)?"".concat(t,"px"):t,n.style.height="".concat(e,"px"),n.style.position="relative",n}n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return i}))},function(t,e,n){"use strict";const r={name:"Draco",id:"draco",module:"draco",shapes:["mesh"],version:"3.2.10",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 i=n(1);class o{constructor(t,e){Object(i.a)(this,"fields",void 0),Object(i.a)(this,"metadata",void 0),function(t,e){if(!t)throw new Error(e||"loader assertion failed.")}(Array.isArray(t)),function(t){const e={};for(const n of t)e[n.name]&&console.warn("Schema: duplicated field name",n.name,n),e[n.name]=!0}(t),this.fields=t,this.metadata=e||new Map}compareTo(t){if(this.metadata!==t.metadata)return!1;if(this.fields.length!==t.fields.length)return!1;for(let e=0;e<this.fields.length;++e)if(!this.fields[e].compareTo(t.fields[e]))return!1;return!0}select(...t){const e=Object.create(null);for(const n of t)e[n]=!0;const n=this.fields.filter(t=>e[t.name]);return new o(n,this.metadata)}selectAt(...t){const e=t.map(t=>this.fields[t]).filter(Boolean);return new o(e,this.metadata)}assign(t){let e,n=this.metadata;if(t instanceof o){const r=t;e=r.fields,n=a(a(new Map,this.metadata),r.metadata)}else e=t;const r=Object.create(null);for(const t of this.fields)r[t.name]=t;for(const t of e)r[t.name]=t;const i=Object.values(r);return new o(i,n)}}function a(t,e){return new Map([...t||new Map,...e||new Map])}class s{constructor(t,e,n=!1,r=new Map){Object(i.a)(this,"name",void 0),Object(i.a)(this,"type",void 0),Object(i.a)(this,"nullable",void 0),Object(i.a)(this,"metadata",void 0),this.name=t,this.type=e,this.nullable=n,this.metadata=r}get typeId(){return this.type&&this.type.typeId}clone(){return new s(this.name,this.type,this.nullable,this.metadata)}compareTo(t){return this.name===t.name&&this.type===t.type&&this.nullable===t.nullable&&this.metadata===t.metadata}toString(){return"".concat(this.type).concat(this.nullable?", nullable":"").concat(this.metadata?", metadata: ".concat(this.metadata):"")}}let u,c,l,h,f,p,d,A,g;!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"}(u||(u={}));class m{static isNull(t){return t&&t.typeId===u.Null}static isInt(t){return t&&t.typeId===u.Int}static isFloat(t){return t&&t.typeId===u.Float}static isBinary(t){return t&&t.typeId===u.Binary}static isUtf8(t){return t&&t.typeId===u.Utf8}static isBool(t){return t&&t.typeId===u.Bool}static isDecimal(t){return t&&t.typeId===u.Decimal}static isDate(t){return t&&t.typeId===u.Date}static isTime(t){return t&&t.typeId===u.Time}static isTimestamp(t){return t&&t.typeId===u.Timestamp}static isInterval(t){return t&&t.typeId===u.Interval}static isList(t){return t&&t.typeId===u.List}static isStruct(t){return t&&t.typeId===u.Struct}static isUnion(t){return t&&t.typeId===u.Union}static isFixedSizeBinary(t){return t&&t.typeId===u.FixedSizeBinary}static isFixedSizeList(t){return t&&t.typeId===u.FixedSizeList}static isMap(t){return t&&t.typeId===u.Map}static isDictionary(t){return t&&t.typeId===u.Dictionary}get typeId(){return u.NONE}compareTo(t){return this===t}}Symbol.toStringTag;Symbol.toStringTag;c=Symbol.toStringTag;class y extends m{constructor(t,e){super(),Object(i.a)(this,"isSigned",void 0),Object(i.a)(this,"bitWidth",void 0),this.isSigned=t,this.bitWidth=e}get typeId(){return u.Int}get[c](){return"Int"}toString(){return"".concat(this.isSigned?"I":"Ui","nt").concat(this.bitWidth)}}class v extends y{constructor(){super(!0,8)}}class _ extends y{constructor(){super(!0,16)}}class b extends y{constructor(){super(!0,32)}}class x extends y{constructor(){super(!1,8)}}class w extends y{constructor(){super(!1,16)}}class E extends y{constructor(){super(!1,32)}}const O=32,S=64;l=Symbol.toStringTag;class T extends m{constructor(t){super(),Object(i.a)(this,"precision",void 0),this.precision=t}get typeId(){return u.Float}get[l](){return"Float"}toString(){return"Float".concat(this.precision)}}class C extends T{constructor(){super(O)}}class P extends T{constructor(){super(S)}}Symbol.toStringTag;Symbol.toStringTag;h=Symbol.toStringTag;f=Symbol.toStringTag;p=Symbol.toStringTag;d=Symbol.toStringTag;A=Symbol.toStringTag;class M extends m{constructor(t,e){super(),Object(i.a)(this,"listSize",void 0),Object(i.a)(this,"children",void 0),this.listSize=t,this.children=[e]}get typeId(){return u.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get[A](){return"FixedSizeList"}toString(){return"FixedSizeList[".concat(this.listSize,"]<").concat(this.valueType,">")}}g=Symbol.toStringTag;function I(t,e,n){const r=function(t){switch(t.constructor){case Int8Array:return new v;case Uint8Array:return new x;case Int16Array:return new _;case Uint16Array:return new w;case Int32Array:return new b;case Uint32Array:return new E;case Float32Array:return new C;case Float64Array:return new P;default:throw new Error("array type not supported")}}(e.value),i=n||function(t){const e=new Map;"byteOffset"in t&&e.set("byteOffset",t.byteOffset.toString(10));"byteStride"in t&&e.set("byteStride",t.byteStride.toString(10));"normalized"in t&&e.set("normalized",t.normalized.toString());return e}(e);return new s(t,new M(e.size,new s("value",r)),!1,i)}function B(t,e,n){return I(t,e,n?R(n.metadata):void 0)}function R(t){const e=new Map;for(const n in t)e.set("".concat(n,".string"),JSON.stringify(t[n]));return e}const k={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},L={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array};class D{constructor(t){Object(i.a)(this,"draco",void 0),Object(i.a)(this,"decoder",void 0),Object(i.a)(this,"metadataQuerier",void 0),this.draco=t,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(t,e={}){const n=new this.draco.DecoderBuffer;n.Init(new Int8Array(t),t.byteLength),this._disableAttributeTransforms(e);const r=this.decoder.GetEncodedGeometryType(n),i=r===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let t;switch(r){case this.draco.TRIANGULAR_MESH:t=this.decoder.DecodeBufferToMesh(n,i);break;case this.draco.POINT_CLOUD:t=this.decoder.DecodeBufferToPointCloud(n,i);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!t.ok()||!i.ptr){const e="DRACO decompression failed: ".concat(t.error_msg());throw new Error(e)}const a=this._getDracoLoaderData(i,r,e),s=this._getMeshData(i,a,e),u=function(t){let e=1/0,n=1/0,r=1/0,i=-1/0,o=-1/0,a=-1/0;const s=t.POSITION?t.POSITION.value:[],u=s&&s.length;for(let t=0;t<u;t+=3){const u=s[t],c=s[t+1],l=s[t+2];e=u<e?u:e,n=c<n?c:n,r=l<r?l:r,i=u>i?u:i,o=c>o?c:o,a=l>a?l:a}return[[e,n,r],[i,o,a]]}(s.attributes),c=function(t,e,n){const r=R(e.metadata),i=[],a=function(t){const e={};for(const n in t){const r=t[n];e[r.name||"undefined"]=r}return e}(e.attributes);for(const e in t){const n=B(e,t[e],a[e]);i.push(n)}if(n){const t=B("indices",n);i.push(t)}return new o(i,r)}(s.attributes,a,s.indices);return{loader:"draco",loaderData:a,header:{vertexCount:i.num_points(),boundingBox:u},...s,schema:c}}finally{this.draco.destroy(n),i&&this.draco.destroy(i)}}_getDracoLoaderData(t,e,n){const 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}}_getDracoAttributes(t,e){const n={};for(let r=0;r<t.num_attributes();r++){const 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};const a=this._getQuantizationTransform(i,e);a&&(n[i.unique_id()].quantization_transform=a);const s=this._getOctahedronTransform(i,e);s&&(n[i.unique_id()].octahedron_transform=s)}return n}_getMeshData(t,e,n){const r=this._getMeshAttributes(e,t,n);if(!r.POSITION)throw new Error("DRACO: No position attribute found.");if(t instanceof this.draco.Mesh)switch(n.topology){case"triangle-strip":return{topology:"triangle-strip",mode:4,attributes:r,indices:{value:this._getTriangleStripIndices(t),size:1}};case"triangle-list":default:return{topology:"triangle-list",mode:5,attributes:r,indices:{value:this._getTriangleListIndices(t),size:1}}}return{topology:"point-list",mode:0,attributes:r}}_getMeshAttributes(t,e,n){const r={};for(const i of Object.values(t.attributes)){const t=this._deduceAttributeName(i,n);i.name=t;const{value:o,size:a}=this._getAttributeValues(e,i);r[t]={value:o,size:a,byteOffset:i.byte_offset,byteStride:i.byte_stride,normalized:i.normalized}}return r}_getTriangleListIndices(t){const 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)}}_getTriangleStripIndices(t){const e=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(t,e),function(t){const e=t.size(),n=new Int32Array(e);for(let r=0;r<e;r++)n[r]=t.GetValue(r);return n}(e)}finally{this.draco.destroy(e)}}_getAttributeValues(t,e){const n=L[e.data_type],r=e.num_components,i=t.num_points()*r,o=i*n.BYTES_PER_ELEMENT,a=function(t,e){switch(e){case Float32Array:return t.DT_FLOAT32;case Int8Array:return t.DT_INT8;case Int16Array:return t.DT_INT16;case Int32Array:return t.DT_INT32;case Uint8Array:return t.DT_UINT8;case Uint16Array:return t.DT_UINT16;case Uint32Array:return t.DT_UINT32;default:return t.DT_INVALID}}(this.draco,n);let s;const u=this.draco._malloc(o);try{const r=this.decoder.GetAttribute(t,e.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(t,r,a,o,u),s=new n(this.draco.HEAPF32.buffer,u,i).slice()}finally{this.draco._free(u)}return{value:s,size:r}}_deduceAttributeName(t,e){const n=t.unique_id;for(const[t,r]of Object.entries(e.extraAttributes||{}))if(r===n)return t;const r=t.attribute_type;for(const t in k){if(this.draco[t]===r)return k[t]}const i=e.attributeNameEntry||"name";return t.metadata[i]?t.metadata[i].string:"CUSTOM_ATTRIBUTE_".concat(n)}_getTopLevelMetadata(t){const e=this.decoder.GetMetadata(t);return this._getDracoMetadata(e)}_getAttributeMetadata(t,e){const n=this.decoder.GetAttributeMetadata(t,e);return this._getDracoMetadata(n)}_getDracoMetadata(t){if(!t||!t.ptr)return{};const e={},n=this.metadataQuerier.NumEntries(t);for(let r=0;r<n;r++){const n=this.metadataQuerier.GetEntryName(t,r);e[n]=this._getDracoMetadataField(t,n)}return e}_getDracoMetadataField(t,e){const n=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(t,e,n);const r=function(t){const e=t.size(),n=new Int32Array(e);for(let 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)}}_disableAttributeTransforms(t){const{quantizedAttributes:e=[],octahedronAttributes:n=[]}=t,r=[...e,...n];for(const t of r)this.decoder.SkipAttributeTransform(this.draco[t])}_getQuantizationTransform(t,e){const{quantizedAttributes:n=[]}=e,r=t.attribute_type();if(n.map(t=>this.decoder[t]).includes(r)){const e=new this.draco.AttributeQuantizationTransform;try{if(e.InitFromAttribute(t))return{quantization_bits:e.quantization_bits(),range:e.range(),min_values:new Float32Array([1,2,3]).map(t=>e.min_value(t))}}finally{this.draco.destroy(e)}}return null}_getOctahedronTransform(t,e){const{octahedronAttributes:n=[]}=e,r=t.attribute_type();if(n.map(t=>this.decoder[t]).includes(r)){const e=new this.draco.AttributeQuantizationTransform;try{if(e.InitFromAttribute(t))return{quantization_bits:e.quantization_bits()}}finally{this.draco.destroy(e)}}return null}}var j=n(289);const F="https://www.gstatic.com/draco/versioned/decoders/".concat("1.4.1","/draco_decoder.js"),z="https://www.gstatic.com/draco/versioned/decoders/".concat("1.4.1","/draco_wasm_wrapper.js"),U="https://www.gstatic.com/draco/versioned/decoders/".concat("1.4.1","/draco_decoder.wasm");"https://raw.githubusercontent.com/google/draco/".concat("1.4.1","/javascript/draco_encoder.js");let N;async function G(t){const e=t.modules||{};return N=e.draco3d?N||e.draco3d.createDecoderModule({}).then(t=>({draco:t})):N||async function(t){let e,n;switch(t.draco&&t.draco.decoderType){case"js":e=await Object(j.a)(F,"draco",t);break;case"wasm":default:[e,n]=await Promise.all([await Object(j.a)(z,"draco",t),await Object(j.a)(U,"draco",t)])}return e=e||globalThis.DracoDecoderModule,await function(t,e){const n={};e&&(n.wasmBinary=e);return new Promise(e=>{t({...n,onModuleLoaded:t=>e({draco:t})})})}(e,n)}(t),await N}var V=n(47);n.d(e,"a",(function(){return H}));V.b;const H={...r,parse:async function(t,e){const{draco:n}=await G(e),r=new D(n);try{return r.parseSync(t,null==e?void 0:e.draco)}finally{r.destroy()}}}},function(t,e,n){"use strict";var r=n(8),i=n(195),o=n(45),a=n(10),s=n(180),u=n(292),c=n(61),l=n(32),h=n(38);let f=null;function p(t,e){var n;return new t((n=t.BYTES_PER_ELEMENT*e,(!f||f.byteLength<n)&&(f=new ArrayBuffer(n)),f),0,e)}var d=n(285);class A extends h.a{get[Symbol.toStringTag](){return"VertexArrayObject"}static isSupported(t){return!(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).constantAttributeZero||(Object(r.j)(t)||"Chrome"===Object(d.a)())}static getDefaultArray(t){return t.luma=t.luma||{},t.luma.defaultVertexArray||(t.luma.defaultVertexArray=new A(t,{handle:null,isDefaultArray:!0})),t.luma.defaultVertexArray}static getMaxAttributes(t){return A.MAX_ATTRIBUTES=A.MAX_ATTRIBUTES||t.getParameter(34921),A.MAX_ATTRIBUTES}static setConstant(t,e,n){switch(n.constructor){case Float32Array:A._setConstantFloatArray(t,e,n);break;case Int32Array:A._setConstantIntArray(t,e,n);break;case Uint32Array:A._setConstantUintArray(t,e,n);break;default:Object(a.a)(!1)}}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=e.id||e.program&&e.program.id;super(t,Object.assign({},e,{id:n})),this.buffer=null,this.bufferValue=null,this.isDefaultArray=e.isDefaultArray||!1,this.gl2=t,this.initialize(e),Object.seal(this)}delete(){return super.delete(),this.buffer&&this.buffer.delete(),this}get MAX_ATTRIBUTES(){return A.getMaxAttributes(this.gl)}initialize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.setProps(t)}setProps(t){return this}setElementBuffer(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return Object(a.a)(!t||34963===t.target,"elements must be GL.ELEMENT_ARRAY_BUFFER"),this.bind(()=>{this.gl.bindBuffer(34963,t?t.handle:null)}),this}setBuffer(t,e,n){if(34963===e.target)return this.setElementBuffer(e,n);const{size:i,type:o,stride:s,offset:u,normalized:c,integer:l,divisor:h}=n,{gl:f,gl2:p}=this;return t=Number(t),this.bind(()=>{f.bindBuffer(34962,e.handle),l?(Object(a.a)(Object(r.j)(f)),p.vertexAttribIPointer(t,i,o,s,u)):f.vertexAttribPointer(t,i,o,c,s,u),f.enableVertexAttribArray(t),p.vertexAttribDivisor(t,h||0)}),this}enable(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return!e&&0===t&&!A.isSupported(this.gl,{constantAttributeZero:!0})||(t=Number(t),this.bind(()=>e?this.gl.enableVertexAttribArray(t):this.gl.disableVertexAttribArray(t))),this}getConstantBuffer(t,e){const n=this._normalizeConstantArrayValue(e),r=n.byteLength*t,i=n.length*t;let o=!this.buffer;if(this.buffer=this.buffer||new l.a(this.gl,r),o=o||this.buffer.reallocate(r),o=o||!this._compareConstantArrayValues(n,this.bufferValue),o){const t=p(e.constructor,i);!function(t){let{target:e,source:n,start:r=0,count:i=1}=t;const o=n.length,a=i*o;let s=0;for(let t=r;s<o;s++)e[t++]=n[s];for(;s<a;)s<a-s?(e.copyWithin(r+s,r,r+s),s*=2):(e.copyWithin(r+s,r,r+a-s),s=a)}({target:t,source:n,start:0,count:i}),this.buffer.subData(t),this.bufferValue=e}return this.buffer}_normalizeConstantArrayValue(t){return Array.isArray(t)?new Float32Array(t):t}_compareConstantArrayValues(t,e){if(!t||!e||t.length!==e.length||t.constructor!==e.constructor)return!1;for(let n=0;n<t.length;++n)if(t[n]!==e[n])return!1;return!0}static _setConstantFloatArray(t,e,n){switch(n.length){case 1:t.vertexAttrib1fv(e,n);break;case 2:t.vertexAttrib2fv(e,n);break;case 3:t.vertexAttrib3fv(e,n);break;case 4:t.vertexAttrib4fv(e,n);break;default:Object(a.a)(!1)}}static _setConstantIntArray(t,e,n){switch(Object(a.a)(Object(r.j)(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:Object(a.a)(!1)}}static _setConstantUintArray(t,e,n){switch(Object(a.a)(Object(r.j)(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:Object(a.a)(!1)}}_createHandle(){return this.gl.createVertexArray()}_deleteHandle(t){return this.gl2.deleteVertexArray(t),[this.elements]}_bindHandle(t){this.gl2.bindVertexArray(t)}_getParameter(t,e){let{location:n}=e;return Object(a.a)(Number.isFinite(n)),this.bind(()=>{switch(t){case 34373:return this.gl.getVertexAttribOffset(n,t);default:return this.gl.getVertexAttrib(n,t)}})}}var g=n(168);const m=/^(.+)__LOCATION_([0-9]+)$/,y=["setBuffers","setGeneric","clearBindings","setLocations","setGenericValues","setDivisor","enable","disable"];class v{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=e.id||e.program&&e.program.id;this.id=n,this.gl=t,this.configuration=null,this.elements=null,this.elementsAccessor=null,this.values=null,this.accessors=null,this.unused=null,this.drawParams=null,this.buffer=null,this.attributes={},this.vertexArrayObject=new A(t),Object(g.a)(this,"VertexArray","v6.0",y),this.initialize(e),Object.seal(this)}delete(){this.buffer&&this.buffer.delete(),this.vertexArrayObject.delete()}initialize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.reset(),this.configuration=null,this.bindOnUse=!1,this.setProps(t)}reset(){this.elements=null,this.elementsAccessor=null;const{MAX_ATTRIBUTES:t}=this.vertexArrayObject;return this.values=new Array(t).fill(null),this.accessors=new Array(t).fill(null),this.unused={},this.drawParams=null,this}setProps(t){return"program"in t&&(this.configuration=t.program&&t.program.configuration),"configuration"in t&&(this.configuration=t.configuration),"attributes"in t&&this.setAttributes(t.attributes),"elements"in t&&this.setElementBuffer(t.elements),"bindOnUse"in t&&(t=t.bindOnUse),this}clearDrawParams(){this.drawParams=null}getDrawParams(){return this.drawParams=this.drawParams||this._updateDrawParams(),this.drawParams}setAttributes(t){return Object.assign(this.attributes,t),this.vertexArrayObject.bind(()=>{for(const e in t){const n=t[e];this._setAttribute(e,n)}this.gl.bindBuffer(34962,null)}),this}setElementBuffer(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.elements=t,this.elementsAccessor=e,this.clearDrawParams(),this.vertexArrayObject.setElementBuffer(t,e),this}setBuffer(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(34963===e.target)return this.setElementBuffer(e,n);const{location:r,accessor:i}=this._resolveLocationAndAccessor(t,e,e.accessor,n);return r>=0&&(this.values[r]=e,this.accessors[r]=i,this.clearDrawParams(),this.vertexArrayObject.setBuffer(r,e,i)),this}setConstant(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{location:r,accessor:i}=this._resolveLocationAndAccessor(t,e,Object.assign({size:e.length},n));return r>=0&&(e=this.vertexArrayObject._normalizeConstantArrayValue(e),this.values[r]=e,this.accessors[r]=i,this.clearDrawParams(),this.vertexArrayObject.enable(r,!1)),this}unbindBuffers(){return this.vertexArrayObject.bind(()=>{this.elements&&this.vertexArrayObject.setElementBuffer(null),this.buffer=this.buffer||new l.a(this.gl,{accessor:{size:4}});for(let t=0;t<this.vertexArrayObject.MAX_ATTRIBUTES;t++)this.values[t]instanceof l.a&&(this.gl.disableVertexAttribArray(t),this.gl.bindBuffer(34962,this.buffer.handle),this.gl.vertexAttribPointer(t,1,5126,!1,0,0))}),this}bindBuffers(){return this.vertexArrayObject.bind(()=>{this.elements&&this.setElementBuffer(this.elements);for(let t=0;t<this.vertexArrayObject.MAX_ATTRIBUTES;t++){const e=this.values[t];e instanceof l.a&&this.setBuffer(t,e)}}),this}bindForDraw(t,e,n){let r;return this.vertexArrayObject.bind(()=>{this._setConstantAttributes(t,e),r=n()}),r}_resolveLocationAndAccessor(t,e,n,i){const o={location:-1,accessor:null},{location:s,name:u}=this._getAttributeIndex(t);if(!Number.isFinite(s)||s<0)return this.unused[t]=e,r.k.once(3,()=>"unused value ".concat(t," in ").concat(this.id))(),o;const l=this._getAttributeInfo(u||s);if(!l)return o;const h=this.accessors[s]||{},f=c.a.resolve(l.accessor,h,n,i),{size:p,type:d}=f;return Object(a.a)(Number.isFinite(p)&&Number.isFinite(d)),{location:s,accessor:f}}_getAttributeInfo(t){return this.configuration&&this.configuration.getAttributeInfo(t)}_getAttributeIndex(t){const e=Number(t);if(Number.isFinite(e))return{location:e};const n=m.exec(t),r=n?n[1]:t,i=n?Number(n[2]):0;return this.configuration?{location:this.configuration.getAttributeLocation(r)+i,name:r}:{location:-1}}_setAttribute(t,e){if(e instanceof l.a)this.setBuffer(t,e);else if(Array.isArray(e)&&e.length&&e[0]instanceof l.a){const n=e[0],r=e[1];this.setBuffer(t,n,r)}else if(ArrayBuffer.isView(e)||Array.isArray(e)){const n=e;this.setConstant(t,n)}else{if(!(e.buffer instanceof l.a))throw new Error("VertexArray: attributes must be Buffers or constants (i.e. typed array)");{const n=e;this.setBuffer(t,n.buffer,n)}}}_setConstantAttributes(t,e){const n=Math.max(0|t,0|e);let r=this.values[0];ArrayBuffer.isView(r)&&this._setConstantAttributeZero(r,n);for(let t=1;t<this.vertexArrayObject.MAX_ATTRIBUTES;t++)r=this.values[t],ArrayBuffer.isView(r)&&this._setConstantAttribute(t,r)}_setConstantAttributeZero(t,e){if(A.isSupported(this.gl,{constantAttributeZero:!0}))return void this._setConstantAttribute(0,t);const n=this.vertexArrayObject.getConstantBuffer(e,t);this.vertexArrayObject.setBuffer(0,n,this.accessors[0])}_setConstantAttribute(t,e){A.setConstant(this.gl,t,e)}_updateDrawParams(){const t={isIndexed:!1,isInstanced:!1,indexCount:1/0,vertexCount:1/0,instanceCount:1/0};for(let e=0;e<this.vertexArrayObject.MAX_ATTRIBUTES;e++)this._updateDrawParamsForLocation(t,e);return this.elements&&(t.elementCount=this.elements.getElementCount(this.elements.accessor),t.isIndexed=!0,t.indexType=this.elementsAccessor.type||this.elements.accessor.type,t.indexOffset=this.elementsAccessor.offset||0),t.indexCount===1/0&&(t.indexCount=0),t.vertexCount===1/0&&(t.vertexCount=0),t.instanceCount===1/0&&(t.instanceCount=0),t}_updateDrawParamsForLocation(t,e){const n=this.values[e],r=this.accessors[e];if(!n)return;const{divisor:i}=r,o=i>0;if(t.isInstanced=t.isInstanced||o,n instanceof l.a){const e=n;if(o){const n=e.getVertexCount(r);t.instanceCount=Math.min(t.instanceCount,n)}else{const n=e.getVertexCount(r);t.vertexCount=Math.min(t.vertexCount,n)}}}setElements(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r.k.deprecated("setElements","setElementBuffer")(),this.setElementBuffer(t,e)}}var _=n(286),b=n(46),x=n(78);function w(t,e){const{maxElts:n=16,size:r=1}=e;let i="[";for(let o=0;o<t.length&&o<n;++o)o>0&&(i+=",".concat(o%r==0?" ":"")),i+=E(t[o],e);const o=t.length>n?"...":"]";return"".concat(i).concat(o)}function E(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=1e-16,{isInteger:r=!1}=e;if(Array.isArray(t)||ArrayBuffer.isView(t))return w(t,e);if(!Number.isFinite(t))return String(t);if(Math.abs(t)<n)return r?"0":"0.";if(r)return t.toFixed(0);if(Math.abs(t)>100&&Math.abs(t)<1e4)return t.toFixed(0);const i=t.toPrecision(2),o=i.indexOf(".0");return o===i.length-2?i.slice(0,-1):i}function O(t,e,n,r){const{gl:i}=t;if(!e)return{[r]:"null","Format ":"N/A"};let o,a,s,u="NOT PROVIDED",c=1,h=0,f=0;if(n&&(u=n.type,c=n.size,u=String(u).replace("Array",""),o=-1!==u.indexOf("nt")),e instanceof l.a){const t=e,{data:l,changed:p}=t.getDebugData();let d;if(a=p?"*":"",s=l,f=t.byteLength,h=f/l.BYTES_PER_ELEMENT/c,n){const t=n.divisor>0;d="".concat(t?"I ":"P "," ").concat(h," (x").concat(c,"=").concat(f," bytes ").concat(Object(b.a)(i,u),")")}else o=!0,d="".concat(f," bytes");return{[r]:"".concat(a).concat(E(s,{size:c,isInteger:o})),"Format ":d}}return s=e,c=e.length,u=String(e.constructor.name).replace("Array",""),o=-1!==u.indexOf("nt"),{[r]:"".concat(E(s,{size:c,isInteger:o})," (constant)"),"Format ":"".concat(c,"x").concat(u," (constant)")}}function S(t,e){const{type:n,size:r}=e,i=Object(x.b)(n,r);return i?"".concat(t," (").concat(i.name,")"):t}function T(t){let{header:e="Uniforms",program:n,uniforms:r,undefinedOnly:i=!1}=t;Object(a.a)(n);const o=n._uniformSetters,s={},u=Object.keys(o).sort();let c=0;for(const t of u)t.match(".*_.*")||t.match(".*Matrix")||C({table:s,header:e,uniforms:r,uniformName:t,undefinedOnly:i})&&c++;for(const t of u)t.match(".*Matrix")&&C({table:s,header:e,uniforms:r,uniformName:t,undefinedOnly:i})&&c++;for(const t of u)s[t]||C({table:s,header:e,uniforms:r,uniformName:t,undefinedOnly:i})&&c++;let l=0;const h={};if(!i)for(const t in r){const n=r[t];s[t]||(l++,h[t]={Type:"NOT USED: ".concat(n),[e]:E(n)})}return{table:s,count:c,unusedTable:h,unusedCount:l}}function C(t){let{table:e,header:n,uniforms:r,uniformName:i,undefinedOnly:o}=t;const a=r[i],s=function(t){return null!=t}(a);return(!o||!s)&&(e[i]={[n]:s?E(a):"N/A","Uniform Type":s?a:"NOT PROVIDED"},!0)}function P(t){const{type:e,size:n}=t.accessor,r=Object(x.b)(e,n);return r?"".concat(r.name," ").concat(t.name):t.name}const M={POSITION:"positions",NORMAL:"normals",COLOR_0:"colors",TEXCOORD_0:"texCoords",TEXCOORD_1:"texCoords1",TEXCOORD_2:"texCoords2"};function I(t,e){const{attributeMap:n=M}=e||{};return n&&n[t]||t}function B(t,e){let n;switch(t){case"texCoords":case"texCoord1":case"texCoord2":case"texCoord3":n="uvs";break;case"vertices":case"positions":case"normals":case"pickingColors":n="vectors"}switch(n){case"vectors":e.size=e.size||3;break;case"uvs":e.size=e.size||2}Object(a.a)(Number.isFinite(e.size),"attribute ".concat(t," needs size"))}n.d(e,"a",(function(){return L}));const R=()=>{},k={};class L{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{id:n=Object(o.c)("model")}=e;Object(a.a)(Object(r.i)(t)),this.id=n,this.gl=t,this.id=e.id||Object(o.c)("Model"),this.lastLogTime=0,this.animated=!1,this.initialize(e)}initialize(t){this.props={},this.programManager=t.programManager||i.a.getDefaultProgramManager(this.gl),this._programManagerState=-1,this._managedProgram=!1;const{program:e=null,vs:n,fs:r,modules:o,defines:s,inject:u,varyings:c,bufferMode:l,transpileToGLSL100:h}=t;this.programProps={program:e,vs:n,fs:r,modules:o,defines:s,inject:u,varyings:c,bufferMode:l,transpileToGLSL100:h},this.program=null,this.vertexArray=null,this._programDirty=!0,this.userData={},this.needsRedraw=!0,this._attributes={},this.attributes={},this.uniforms={},this.pickable=!0,this._checkProgram(),this.setUniforms(Object.assign({},this.getModuleUniforms(t.moduleSettings))),this.drawMode=void 0!==t.drawMode?t.drawMode:4,this.vertexCount=t.vertexCount||0,this.geometryBuffers={},this.isInstanced=t.isInstanced||t.instanced||t.instanceCount>0,this._setModelProps(t),this.geometry={},Object(a.a)(void 0!==this.drawMode&&Number.isFinite(this.vertexCount),"Model needs drawMode and vertexCount")}setProps(t){this._setModelProps(t)}delete(){for(const t in this._attributes)this._attributes[t]!==this.attributes[t]&&this._attributes[t].delete();this._managedProgram&&(this.programManager.release(this.program),this._managedProgram=!1),this.vertexArray.delete(),this._deleteGeometryBuffers()}getDrawMode(){return this.drawMode}getVertexCount(){return this.vertexCount}getInstanceCount(){return this.instanceCount}getAttributes(){return this.attributes}getProgram(){return this.program}setProgram(t){const{program:e,vs:n,fs:r,modules:i,defines:o,inject:a,varyings:s,bufferMode:u,transpileToGLSL100:c}=t;this.programProps={program:e,vs:n,fs:r,modules:i,defines:o,inject:a,varyings:s,bufferMode:u,transpileToGLSL100:c},this._programDirty=!0}getUniforms(){return this.uniforms}setDrawMode(t){return this.drawMode=t,this}setVertexCount(t){return Object(a.a)(Number.isFinite(t)),this.vertexCount=t,this}setInstanceCount(t){return Object(a.a)(Number.isFinite(t)),this.instanceCount=t,this}setGeometry(t){return this.drawMode=t.drawMode,this.vertexCount=t.getVertexCount(),this._deleteGeometryBuffers(),this.geometryBuffers=function(t,e,n){const r={};let i=e.indices;for(const o in e.attributes){const a=e.attributes[o],s=I(o,n);if("indices"===o)i=a;else if(a.constant)r[s]=a.value;else{const e=a.value,n={...a};delete n.value,r[s]=[new l.a(t,e),n],B(o,n)}}if(i){const e=i.value||i;Object(a.a)(e instanceof Uint16Array||e instanceof Uint32Array,'attribute array for "indices" must be of integer type');const n={size:1,isIndexed:void 0===i.isIndexed||i.isIndexed};r.indices=[new l.a(t,{data:e,target:34963}),n]}return r}(this.gl,t),this.vertexArray.setAttributes(this.geometryBuffers),this}setAttributes(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Object(o.a)(t))return this;const e={};for(const n in t){const r=t[n];e[n]=r.getValue?r.getValue():r}return this.vertexArray.setAttributes(e),this}setUniforms(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.assign(this.uniforms,t),this}getModuleUniforms(t){this._checkProgram();const e=this.programManager.getUniforms(this.program);return e?e(t):{}}updateModuleSettings(t){const e=this.getModuleUniforms(t||{});return this.setUniforms(e)}clear(t){return Object(s.a)(this.program.gl,t),this}draw(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._checkProgram();const{moduleSettings:e=null,framebuffer:n,uniforms:i={},attributes:o={},transformFeedback:a=this.transformFeedback,parameters:s={},vertexArray:u=this.vertexArray}=t;let c;this.setAttributes(o),this.updateModuleSettings(e),this.setUniforms(i),r.k.priority>=2&&(c=this._logDrawCallStart(2));const l=this.vertexArray.getDrawParams(),{isIndexed:h=l.isIndexed,indexType:f=l.indexType,indexOffset:p=l.indexOffset,vertexArrayInstanced:d=l.isInstanced}=this.props;d&&!this.isInstanced&&r.k.warn("Found instanced attributes on non-instanced model",this.id)();const{isInstanced:A,instanceCount:g}=this,{onBeforeRender:m=R,onAfterRender:y=R}=this.props;m(),this.program.setUniforms(this.uniforms);const v=this.program.draw(Object.assign(k,t,{logPriority:c,uniforms:null,framebuffer:n,parameters:s,drawMode:this.getDrawMode(),vertexCount:this.getVertexCount(),vertexArray:u,transformFeedback:a,isIndexed:h,indexType:f,isInstanced:A,instanceCount:g,offset:h?p:0}));return y(),r.k.priority>=2&&this._logDrawCallEnd(c,u,n),v}transform(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{discard:e=!0,feedbackBuffers:n,unbindModels:r=[]}=t;let{parameters:i}=t;n&&this._setFeedbackBuffers(n),e&&(i=Object.assign({},i,{35977:e})),r.forEach(t=>t.vertexArray.unbindBuffers());try{this.draw(Object.assign({},t,{parameters:i}))}finally{r.forEach(t=>t.vertexArray.bindBuffers())}return this}render(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r.k.warn("Model.render() is deprecated. Use Model.setUniforms() and Model.draw()")(),this.setUniforms(t).draw()}_setModelProps(t){Object.assign(this.props,t),"uniforms"in t&&this.setUniforms(t.uniforms),"pickable"in t&&(this.pickable=t.pickable),"instanceCount"in t&&(this.instanceCount=t.instanceCount),"geometry"in t&&this.setGeometry(t.geometry),"attributes"in t&&this.setAttributes(t.attributes),"_feedbackBuffers"in t&&this._setFeedbackBuffers(t._feedbackBuffers)}_checkProgram(){if(!(this._programDirty||this.programManager.stateHash!==this._programManagerState))return;let{program:t}=this.programProps;if(t)this._managedProgram=!1;else{const{vs:e,fs:n,modules:r,inject:i,defines:o,varyings:a,bufferMode:s,transpileToGLSL100:u}=this.programProps;t=this.programManager.get({vs:e,fs:n,modules:r,inject:i,defines:o,varyings:a,bufferMode:s,transpileToGLSL100:u}),this.program&&this._managedProgram&&this.programManager.release(this.program),this._programManagerState=this.programManager.stateHash,this._managedProgram=!0}Object(a.a)(t instanceof u.a,"Model needs a program"),this._programDirty=!1,t!==this.program&&(this.program=t,this.vertexArray?this.vertexArray.setProps({program:this.program,attributes:this.vertexArray.attributes}):this.vertexArray=new v(this.gl,{program:this.program}),this.setUniforms(Object.assign({},this.getModuleUniforms())))}_deleteGeometryBuffers(){for(const t in this.geometryBuffers){const e=this.geometryBuffers[t][0]||this.geometryBuffers[t];e instanceof l.a&&e.delete()}}_setAnimationProps(t){this.animated&&Object(a.a)(t,"Model.draw(): animated uniforms but no animationProps")}_setFeedbackBuffers(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Object(o.a)(t))return this;const{gl:e}=this.program;return this.transformFeedback=this.transformFeedback||new _.a(e,{program:this.program}),this.transformFeedback.setBuffers(t),this}_logDrawCallStart(t){const e=t>3?0:1e4;if(!(Date.now()-this.lastLogTime<e))return this.lastLogTime=Date.now(),r.k.group(2,">>> DRAWING MODEL ".concat(this.id),{collapsed:r.k.level<=2})(),t}_logDrawCallEnd(t,e,n,i){if(void 0===t)return;const o=function(t){let{vertexArray:e,header:n="Attributes"}=t;if(!e.configuration)return{};const r={};e.elements&&(r.ELEMENT_ARRAY_BUFFER=O(e,e.elements,null,n));const i=e.values;for(const t in i){const o=e._getAttributeInfo(t);if(o){let a="".concat(t,": ").concat(o.name);const s=e.accessors[o.location];s&&(a="".concat(t,": ").concat(S(o.name,s))),r[a]=O(e,i[t],s,n)}}return r}({vertexArray:e,header:"".concat(this.id," attributes"),attributes:this._attributes}),{table:a,unusedTable:s,unusedCount:u}=T({header:"".concat(this.id," uniforms"),program:this.program,uniforms:Object.assign({},this.program.uniforms,n)}),{table:c,count:l}=T({header:"".concat(this.id," uniforms"),program:this.program,uniforms:Object.assign({},this.program.uniforms,n),undefinedOnly:!0});l>0&&r.k.log("MISSING UNIFORMS",Object.keys(c))(),u>0&&r.k.log("UNUSED UNIFORMS",Object.keys(s))();const h=function(t){const e={},n="Accessors for ".concat(t.id);for(const r of t.attributeInfos)if(r){const t=P(r);e["in ".concat(t)]={[n]:JSON.stringify(r.accessor)}}for(const r of t.varyingInfos)if(r){const t=P(r);e["out ".concat(t)]={[n]:JSON.stringify(r.accessor)}}return e}(this.vertexArray.configuration);r.k.table(t,o)(),r.k.table(t,a)(),r.k.table(t+1,h)(),i&&i.log({logLevel:2,message:"Rendered to ".concat(i.id)}),r.k.groupEnd(2)()}}},function(t,e,n){"use strict";function r(t,e){if(!t)throw new Error(e||"shadertools: assertion failed.")}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return a})),n.d(e,"b",(function(){return s}));var r=n(8),i=n(10);const o=6144;function a(t){let{framebuffer:e=null,color:n=null,depth:o=null,stencil:a=null}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const s={};e&&(s.framebuffer=e);let u=0;n&&(u|=16384,!0!==n&&(s.clearColor=n)),o&&(u|=256,!0!==o&&(s.clearDepth=o)),a&&(u|=1024,!0!==o&&(s.clearStencil=o)),Object(i.a)(0!==u,"clear: bad arguments"),Object(r.o)(t,s,()=>{t.clear(u)})}function s(t){let{framebuffer:e=null,buffer:n=o,drawBuffer:a=0,value:s=[0,0,0,0]}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(r.a)(t),Object(r.o)(t,{framebuffer:e},()=>{switch(n){case o:switch(s.constructor){case Int32Array:t.clearBufferiv(n,a,s);break;case Uint32Array:t.clearBufferuiv(n,a,s);break;case Float32Array:default:t.clearBufferfv(n,a,s)}break;case 6145:t.clearBufferfv(6145,0,[s]);break;case 6146:t.clearBufferiv(6146,0,[s]);break;case 34041:const[e,r]=s;t.clearBufferfi(34041,0,e,r);break;default:Object(i.a)(!1,"clear: bad arguments")}})}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(71),i=n(102);const o={WEBGL2:"WEBGL2",VERTEX_ARRAY_OBJECT:"VERTEX_ARRAY_OBJECT",TIMER_QUERY:"TIMER_QUERY",INSTANCED_RENDERING:"INSTANCED_RENDERING",MULTIPLE_RENDER_TARGETS:"MULTIPLE_RENDER_TARGETS",ELEMENT_INDEX_UINT32:"ELEMENT_INDEX_UINT32",BLEND_EQUATION_MINMAX:"BLEND_EQUATION_MINMAX",FLOAT_BLEND:"FLOAT_BLEND",COLOR_ENCODING_SRGB:"COLOR_ENCODING_SRGB",TEXTURE_DEPTH:"TEXTURE_DEPTH",TEXTURE_FLOAT:"TEXTURE_FLOAT",TEXTURE_HALF_FLOAT:"TEXTURE_HALF_FLOAT",TEXTURE_FILTER_LINEAR_FLOAT:"TEXTURE_FILTER_LINEAR_FLOAT",TEXTURE_FILTER_LINEAR_HALF_FLOAT:"TEXTURE_FILTER_LINEAR_HALF_FLOAT",TEXTURE_FILTER_ANISOTROPIC:"TEXTURE_FILTER_ANISOTROPIC",COLOR_ATTACHMENT_RGBA32F:"COLOR_ATTACHMENT_RGBA32F",COLOR_ATTACHMENT_FLOAT:"COLOR_ATTACHMENT_FLOAT",COLOR_ATTACHMENT_HALF_FLOAT:"COLOR_ATTACHMENT_HALF_FLOAT",GLSL_FRAG_DATA:"GLSL_FRAG_DATA",GLSL_FRAG_DEPTH:"GLSL_FRAG_DEPTH",GLSL_DERIVATIVES:"GLSL_DERIVATIVES",GLSL_TEXTURE_LOD:"GLSL_TEXTURE_LOD"};e.b={[o.WEBGL2]:[!1,!0],[o.VERTEX_ARRAY_OBJECT]:["OES_vertex_array_object",!0],[o.TIMER_QUERY]:["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"],[o.INSTANCED_RENDERING]:["ANGLE_instanced_arrays",!0],[o.MULTIPLE_RENDER_TARGETS]:["WEBGL_draw_buffers",!0],[o.ELEMENT_INDEX_UINT32]:["OES_element_index_uint",!0],[o.BLEND_EQUATION_MINMAX]:["EXT_blend_minmax",!0],[o.FLOAT_BLEND]:["EXT_float_blend"],[o.COLOR_ENCODING_SRGB]:["EXT_sRGB",!0],[o.TEXTURE_DEPTH]:["WEBGL_depth_texture",!0],[o.TEXTURE_FLOAT]:["OES_texture_float",!0],[o.TEXTURE_HALF_FLOAT]:["OES_texture_half_float",!0],[o.TEXTURE_FILTER_LINEAR_FLOAT]:["OES_texture_float_linear"],[o.TEXTURE_FILTER_LINEAR_HALF_FLOAT]:["OES_texture_half_float_linear"],[o.TEXTURE_FILTER_ANISOTROPIC]:["EXT_texture_filter_anisotropic"],[o.COLOR_ATTACHMENT_RGBA32F]:[function(t){const e=new i.a(t,{format:6408,type:5126,dataFormat:6408}),n=new r.a(t,{id:"test-framebuffer",check:!1,attachments:{36064:e}}),o=n.getStatus();return e.delete(),n.delete(),36053===o},"EXT_color_buffer_float"],[o.COLOR_ATTACHMENT_FLOAT]:[!1,"EXT_color_buffer_float"],[o.COLOR_ATTACHMENT_HALF_FLOAT]:["EXT_color_buffer_half_float"],[o.GLSL_FRAG_DATA]:["WEBGL_draw_buffers",!0],[o.GLSL_FRAG_DEPTH]:["EXT_frag_depth",!0],[o.GLSL_DERIVATIVES]:["OES_standard_derivatives",!0],[o.GLSL_TEXTURE_LOD]:["EXT_shader_texture_lod",!0]}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return o}));var r=n(49);function i(t){const e="3.2.10"!==t.version?" (worker-utils@".concat("3.2.10",")"):"";return"".concat(t.name,"@").concat(t.version).concat(e)}function o(t,e={}){const n=e[t.id]||{},i="".concat(t.id,"-worker.js");let o=n.workerUrl;if(o||"compression"!==t.id||(o=e.workerUrl),"test"===e._workerType&&(o="modules/".concat(t.module,"/dist/").concat(i)),!o){let e=t.version;"latest"===e&&(e="latest");const n=e?"@".concat(e):"";o="https://unpkg.com/@loaders.gl/".concat(t.module).concat(n,"/dist/").concat(i)}return Object(r.a)(o),o}},function(t,e,n){"use strict";var r=n(74),i=n(179);n.d(e,"a",(function(){return a})),n.d(e,"c",(function(){return l})),n.d(e,"b",(function(){return h}));const o={[r.b]:"#ifdef MODULE_LOGDEPTH\n logdepth_adjustPosition(gl_Position);\n#endif\n",[r.a]:"#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"},a="__LUMA_INJECT_DECLARATIONS__",s=/void\s+main\s*\([^)]*\)\s*\{\n?/,u=/}\n?[^{}]*$/,c=[];function l(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const l=e===r.b;for(const e in n){const r=n[e];r.sort((t,e)=>t.order-e.order),c.length=r.length;for(let t=0,e=r.length;t<e;++t)c[t]=r[t].injection;const i="".concat(c.join("\n"),"\n");switch(e){case"vs:#decl":l&&(t=t.replace(a,i));break;case"vs:#main-start":l&&(t=t.replace(s,t=>t+i));break;case"vs:#main-end":l&&(t=t.replace(u,t=>i+t));break;case"fs:#decl":l||(t=t.replace(a,i));break;case"fs:#main-start":l||(t=t.replace(s,t=>t+i));break;case"fs:#main-end":l||(t=t.replace(u,t=>i+t));break;default:t=t.replace(e,t=>t+i)}}return t=t.replace(a,""),i&&(t=t.replace(/\}\s*$/,t=>t+o[e])),t}function h(t){const e={};return Object(i.a)(Array.isArray(t)&&t.length>1),t.forEach(t=>{for(const n in t)e[n]=e[n]?"".concat(e[n],"\n").concat(t[n]):t[n]}),e}},,,function(t,e,n){"use strict";n.d(e,"a",(function(){return a})),n.d(e,"b",(function(){return s}));var r=n(47),i=n(127),o=n(182);function a(t,e){return!!i.a.isSupported()&&(!!(r.b||null!=e&&e._nodeWorkers)&&(t.worker&&(null==e?void 0:e.worker)))}async function s(t,e,n,r,a){const s=t.id,c=Object(o.b)(t,n),l=i.a.getWorkerFarm(n).getWorkerPool({name:s,url:c});n=JSON.parse(JSON.stringify(n)),r=JSON.parse(JSON.stringify(r||{}));const h=await l.startJob("process-on-worker",u.bind(null,a));h.postMessage("process",{input:e,options:n,context:r});const f=await h.result;return await f.result}async function u(t,e,n,r){switch(n){case"done":e.done(r);break;case"error":e.error(new Error(r.error));break;case"process":const{id:i,input:o,options:a}=r;try{const n=await t(o,a);e.postMessage("done",{id:i,result:n})}catch(t){const n=t instanceof Error?t.message:"unknown error";e.postMessage("error",{id:i,error:n})}break;default:console.warn("parse-with-worker unknown message ".concat(n))}}},function(t,e,n){"use strict";n.r(e);var r=n(9),i=n.n(r),o=n(0),a=n.n(o),s=n(3),u=n.n(s),c=n(4),l=n.n(c),h=n(27),f=n.n(h);function p(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(!t)throw new Error("JSON conversion error ".concat(e))}function d(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return A(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 A(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=n.call(t)},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 A(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 g(t,e){var n,r=t,i=d(function(t){if("string"==typeof t){var e=y[t];return e||(e=t.split("."),y[t]=e),e}return Array.isArray(t)?t:[t]}(e));try{for(i.s();!(n=i.n()).done;){var o=n.value;r=m(r)?r[o]:void 0}}catch(t){i.e(t)}finally{i.f()}return r}function m(t){return null!==t&&"object"===f()(t)}var y={};var v=n(194),_=n.n(v),b={"-":function(t){return t}};function x(t,e){if(t in b)return b[t];var n,r=_.a.parse(t);return r.right||r.left||"Identifier"!==r.type?(!function t(e,n){if(Array.isArray(e))e.forEach((function(e){return t(e,n)}));else if(e&&"object"===f()(e))for(var r in e.type&&n(e),e)t(e[r],n)}(r,(function(t){if("CallExpression"===t.type)throw new Error("Function calls not allowed in JSON expressions")})),n=function(t){return _.a.eval(r,t)}):n=function(e){return g(e,t)},b[t]=n,n}var w=function(t){return t&&"object"===f()(t)},E=function(){function t(){u()(this,t),this.typeKey="@@type",this.functionKey="@@function",this.log=console,this.classes={},this.reactComponents={},this.enumerations={},this.constants={},this.functions={},this.convertFunction=x,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,o=n;i<o.length;i++){var a=o[i];this.merge(a)}}return l()(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]=w(this[e])?Object.assign(this[e],n):n}}}},{key:"validate",value:function(t){return p(!this.typeKey||"string"==typeof this.typeKey),p(w(this.classes)),!0}}]),t}();function O(t){return t.replace("@@=","")}function S(t,e){var n,r={};for(var i in t){var o=t[i];"string"==typeof(n=o)&&n.startsWith("@@=")&&(o=x(o=O(o))),r[i]=o}return r}function T(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=S(e),new t(e)}(r,e,n):function(t,e,n){var r=n.React,i=e.children,o=void 0===i?[]:i;delete e.children,n.preProcessClassProps&&(e=n.preProcessClassProps(t,e,n));return e=S(e),r.createElement(t,e,o)}(i,e,n)}function C(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 P(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?C(Object(n),!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):C(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var M=function(t){return t&&"object"===f()(t)},I=function(){function t(e){u()(this,t),this.log=console,this.configuration={},this.onJSONChange=function(){},this.json=null,this.convertedJson=null,this.setProps(e)}return l()(t,[{key:"finalize",value:function(){}},{key:"setProps",value:function(t){"configuration"in t&&(this.configuration=t.configuration instanceof E?t.configuration:new E(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,e){return e=new E(e),B(t,"",e)}(function(t){return"string"==typeof t?JSON.parse(t):t}(t),this.configuration);return e=this.configuration.postProcessConvertedJson(e),this.convertedJson=e,e}},{key:"convertJson",value:function(t){return this.convert(t)}}]),t}();function B(t,e,n){return Array.isArray(t)?t.map((function(t,e){return B(t,String(e),n)})):function(t,e){var n=e.typeKey;return M(t)&&Boolean(t[n])}(t,n)?function(t,e){var n=e.typeKey,r=t[n],i=P({},t);return delete i[n],i=R(i,e),T(r,i,e)}(t,n):M(t)?"@@function"in t?function(t,e){var n=e.functionKey,r=t[n],i=P({},t);return delete i[n],i=R(i,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,i,e)}(t,n):R(t,n):"string"==typeof t?function(t,e,n){if(t.startsWith("@@=")&&n.convertFunction)return t=t.replace("@@=",""),n.convertFunction(t,n);if(t.startsWith("@@#")){if(t=t.replace("@@#",""),n.constants[t])return n.constants[t];var r=t.split("."),o=i()(r,2),a=o[0],s=o[1];return n.enumerations[a][s]}return t}(t,0,n):t}function R(t,e){p(M(t));var n={};for(var r in t){var i=t[r];n[r]=B(i,0,e)}return n}var k=n(166);function L(t,e){if(t===e)return!0;if("object"!==f()(t)||null===t||"object"!==f()(e)||null===e)return!1;if(Object.keys(t).length!==Object.keys(e).length)return!1;for(var n in t)if(!(n in e)||t[n]!==e[n])return!1;for(var r in e)if(!(r in t))return!1;return!0}n.d(e,"JSONConverter",(function(){return I})),n.d(e,"JSONConfiguration",(function(){return E})),n.d(e,"Transport",(function(){return k.a})),n.d(e,"_convertFunctions",(function(){return S})),n.d(e,"_parseExpressionString",(function(){return x})),n.d(e,"_shallowEqualObjects",(function(){return L}))},function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return A}));var r=n(3),i=n.n(r),o=n(4),a=n.n(o),s=n(5),u=n.n(s),c=n(6),l=n.n(c),h=n(2),f=n.n(h),p=n(166);function d(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=f()(t);if(e){var i=f()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return l()(this,n)}}var A=function(t){u()(n,t);var e=d(n);function n(){var t;return i()(this,n),(t=e.call(this,"Jupyter Transport (JavaScript <=> Jupyter Kernel)")).jupyterModel=null,t.jupyterView=null,t}return a()(n,[{key:"getRootDOMElement",value:function(){return this.jupyterView.el}},{key:"sendJSONMessage",value:function(t,e){var n=p.a._stringifyJSONSafe({type:t,data:e});this.jupyterModel.send(n)}}]),n}(p.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return O}));var r=n(3),i=n.n(r),o=n(4),a=n.n(o),s=n(7),u=n.n(s),c=n(5),l=n.n(c),h=n(6),f=n.n(h),p=n(2),d=n.n(p),A=n(0),g=n.n(A),m=n(157),y=n(31),v=n(65);function _(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return b(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 b(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=n.call(t)},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 b(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 x(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 w(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?x(Object(n),!0).forEach((function(e){g()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):x(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function E(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=d()(t);if(e){var i=d()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return f()(this,n)}}var O=function(t){l()(n,t);var e=E(n);function n(){return i()(this,n),e.apply(this,arguments)}return a()(n,[{key:"isComposite",get:function(){return!0}},{key:"isLoaded",get:function(){return u()(d()(n.prototype),"isLoaded",this)&&this.getSubLayers().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){u()(d()(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,r=n.opacity,i=n.pickable,o=n.visible,a=n.parameters,s=n.getPolygonOffset,u=n.highlightedObjectIndex,c=n.autoHighlight,l=n.highlightColor,h=n.coordinateSystem,f=n.coordinateOrigin,p=n.wrapLongitude,d=n.positionFormat,A=n.modelMatrix,g=n.extensions,m=n.fetch,y=n.operation,v=n._subLayerProps,b={id:"",updateTriggers:{},opacity:r,pickable:i,visible:o,parameters:a,getPolygonOffset:s,highlightedObjectIndex:u,autoHighlight:c,highlightColor:l,coordinateSystem:h,coordinateOrigin:f,wrapLongitude:p,positionFormat:d,modelMatrix:A,extensions:g,fetch:m,operation:y},x=v&&e.id&&v[e.id],E=x&&x.updateTriggers,O=e.id||"sublayer";if(x){var S=this.constructor._propTypes,T=e.type?e.type._propTypes:{};for(var C in x){var P=T[C]||S[C];P&&"accessor"===P.type&&(x[C]=this.getSubLayerAccessor(x[C]))}}Object.assign(b,e,x),b.id="".concat(this.props.id,"-").concat(O),b.updateTriggers=w(w({all:null===(t=this.props.updateTriggers)||void 0===t?void 0:t.all},e.updateTriggers),E);var M,I=_(g);try{for(I.s();!(M=I.n()).done;){var B=M.value,R=B.getSubLayerProps.call(this,B);R&&Object.assign(b,R,{updateTriggers:Object.assign(b.updateTriggers,R.updateTriggers)})}}catch(t){I.e(t)}finally{I.f()}return b}},{key:"_updateAutoHighlight",value:function(t){var e,n=_(this.getSubLayers());try{for(n.s();!(e=n.n()).done;){e.value.updateAutoHighlight(t)}}catch(t){n.e(t)}finally{n.f()}}},{key:"_getAttributeManager",value:function(){return null}},{key:"_postUpdate",value:function(t,e){var n=this.internalState.subLayers,r=!n||this.needsUpdate();if(r){var i=this.renderLayers();n=Object(v.b)(i,Boolean),this.internalState.subLayers=n}Object(y.a)("compositeLayer.renderLayers",this,r,n);var o,a=_(n);try{for(a.s();!(o=a.n()).done;){o.value.parent=this}}catch(t){a.e(t)}finally{a.f()}}}]),n}(m.a);g()(O,"layerName","CompositeLayer")},function(t,e,n){"use strict";var r=n(3),i=n.n(r),o=n(4),a=n.n(o),s=n(0),u=n.n(s),c=n(163),l=n(59),h=n(20),f=n(65);function p(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 d(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?p(Object(n),!0).forEach((function(e){u()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var A=function(){function t(e){i()(this,t),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 a()(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}},{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=Object(f.b)(t,Boolean),this._diffViews(t,this.views)&&this.setNeedsUpdate("views changed"),this.views=t}},{key:"_setViewState",value:function(t){t?(!Object(l.a)(t,this.viewState)&&this.setNeedsUpdate("viewState changed"),this.viewState=t):h.a.warn("missing `viewState` or `initialViewState`")()}},{key:"_onViewStateChange",value:function(t,e){this._eventCallbacks.onViewStateChange&&this._eventCallbacks.onViewStateChange(d(d({},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 i=t.controller;if(i){var o=d(d(d({},e),i),{},{id:t.id,x:n.x,y:n.y,width:n.width,height:n.height});return r||(r=this._createController(t,o)),r&&r.setProps(o),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 c in e){var l=e[c];l&&!this.controllers[c]&&l.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}(),g=n(146),m=n(132),y=n(102),v=n(13),_=n(7),b=n.n(_),x=n(5),w=n.n(x),E=n(6),O=n.n(E),S=n(2),T=n.n(S),C=n(71),P=n(8),M=n(12);function I(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 B(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?I(Object(n),!0).forEach((function(e){u()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):I(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function R(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=T()(t);if(e){var i=T()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return O()(this,n)}}var k=function(t){w()(n,t);var e=R(n);function n(t,r){var o,a;i()(this,n),a=e.call(this,t,r);var s=r.mapSize,c=void 0===s?2048:s;return a.maskMap=new y.a(t,{width:c,height:c,parameters:(o={},u()(o,10241,9729),u()(o,10240,9729),u()(o,10242,33071),u()(o,10243,33071),o)}),a.fbo=new C.a(t,{id:"maskmap",width:c,height:c,attachments:u()({},36064,a.maskMap)}),a}return a()(n,[{key:"render",value:function(t){var e=this,r=this.gl,i=[!1,!1,!1,!1];return i[t.channel]=!0,Object(P.o)(r,{clearColor:[255,255,255,255],blend:!0,blendFunc:[0,1],blendEquation:32778,colorMask:i,depthTest:!1},(function(){return b()(T()(n.prototype),"render",e).call(e,B(B({},t),{},{target:e.fbo,pass:"mask"}))}))}},{key:"shouldDrawLayer",value:function(t){return t.props.operation===M.c.MASK}},{key:"delete",value:function(){this.fbo.delete(),this.maskMap.delete()}}]),n}(n(70).a),L=n(151),D=n(84),j=n(18);function F(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return z(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 z(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=n.call(t)},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 z(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 U(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return N(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 N(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=n.call(t)},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 N(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 G=function(){function t(){i()(this,t),u()(this,"id","mask-effect"),u()(this,"props",null),u()(this,"useInPicking",!0),u()(this,"channels",[]),u()(this,"masks",null)}return a()(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 y.a(t,{width:1,height:1}));var s=n.filter((function(t){return t.props.visible&&t.props.operation===M.c.MASK}));if(0===s.length)return this.masks=null,void(this.channels.length=0);this.masks={},this.maskPass||(this.maskPass=new k(t,{id:"default-mask"}),this.maskMap=this.maskPass.maskMap);var u=this._sortMaskChannels(s),c=i[0],l=!this.lastViewport||!this.lastViewport.equals(c);for(var h in u)this._renderChannel(u[h],{layerFilter:r,onViewportActive:o,views:a,viewport:c,viewportChanged:l})}},{key:"_renderChannel",value:function(t,e){var n=e.layerFilter,r=e.onViewportActive,i=e.views,o=e.viewport,a=e.viewportChanged,s=this.channels[t.index];if(s){var u=t===s||s.layers.length!==t.layers.length||t.layerBounds.some((function(t,e){return t!==s.layerBounds[e]}));if(t.bounds=s.bounds,t.maskBounds=s.maskBounds,this.channels[t.index]=t,(u||a)&&(this.lastViewport=o,t.bounds=function(t){var e,n=t.layers,r=t.viewport,i=null,o=F(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(t){o.e(t)}finally{o.f()}var s=r.getBounds();if(!i)return s;var u=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]}(s);return i[2]-i[0]<u[2]-u[0]||i[3]-i[1]<u[3]-u[1]||(i[0]=Math.max(i[0],u[0]),i[1]=Math.max(i[1],u[1]),i[2]=Math.min(i[2],u[2]),i[3]=Math.min(i[3],u[3])),i}({layers:t.layers,viewport:o}),u||!Object(v.d)(t.bounds,s.bounds))){var c=this.maskPass,l=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(void 0!==n.resolution)return h.a.warn("MaskExtension is not supported in GlobeView")(),null;if(r-=2,i-=2,n.isGeospatial){var o=Object(j.c)({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 D.a({longitude:a,latitude:s,zoom:u,x:1,y:1,width:r,height:i})}var c=[(e[0]+e[2])/2,(e[1]+e[3])/2,0],l=Math.min(1048576,r/(e[2]-e[0]),i/(e[3]-e[1]));return new L.a({x:1,y:1}).makeViewport({width:r,height:i,viewState:{target:c,zoom:Math.log2(l)}})}({bounds:t.bounds,viewport:o,width:l.width,height:l.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=U(t);try{var a=function(){var t=e.value,o=t.root.id,a=r[o];if(!a){if(++i>4)return h.a.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.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(t){o.e(t)}finally{o.f()}for(var s=0;s<4;s++){var u=this.channels[s];u&&u.id in r||(this.channels[s]=null)}for(var c in r){var l=r[c];l.index<0&&(l.index=this.channels.findIndex((function(t){return!t})),this.channels[l.index]=l)}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}();function V(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return H(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 H(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=n.call(t)},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 H(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 W=new m.a,q=function(){function t(){i()(this,t),this.effects=[],this._internalEffects=[],this._needsRedraw="Initial render",this.setEffects()}return a()(t,[{key:"setProps",value:function(t){"effects"in t&&(t.effects.length===this.effects.length&&Object(l.a)(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 G),t.some((function(t){return t instanceof m.a}))||this._internalEffects.push(W)}},{key:"cleanup",value:function(){var t,e=V(this.effects);try{for(e.s();!(t=e.n()).done;){t.value.cleanup()}}catch(t){e.e(t)}finally{e.f()}var n,r=V(this._internalEffects);try{for(r.s();!(n=r.n()).done;){n.value.cleanup()}}catch(t){r.e(t)}finally{r.f()}this.effects.length=0,this._internalEffects.length=0}}]),t}(),X=n(165),J=n(197),Z=n(172);function Q(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 K(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Q(Object(n),!0).forEach((function(e){u()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Q(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Y={pickedColor:null,pickedObjectIndex:-1};function $(t){for(var e=t.pickedColors,n=t.decodePickingColor,r=t.deviceX,i=t.deviceY,o=t.deviceRadius,a=t.deviceRect,s=a.x,u=a.y,c=a.width,l=a.height,f=o*o,p=-1,d=0,A=0;A<l;A++){var g=A+u-i,m=g*g;if(m>f)d+=4*c;else for(var y=0;y<c;y++){if(e[d+3]-1>=0){var v=y+s-r,_=v*v+m;_<=f&&(f=_,p=d)}d+=4}}if(p>=0){var b=e.slice(p,p+4),x=n(b);if(x){var w=Math.floor(p/4/c),E=p/4-w*c;return K(K({},x),{},{pickedColor:b,pickedX:s+E,pickedY:u+w})}h.a.error("Picked non-existent layer. Is picking buffer corrupt?")()}return Y}function tt(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 et(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.pickedViewports)||r,{x:o,y:a})),u){var c=[o-u.x,a-u.y];void 0!==s&&(c[2]=s),e=u.unproject(c)}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 nt(t){var e=t.pickInfo,n=t.lastPickedInfo,r=t.mode,i=t.layers,o=e.pickedColor,a=e.pickedLayer,s=e.pickedObjectIndex,c=a?[a]:[];if("hover"===r){var l=n.index,h=n.layerId,f=a?a.props.id:null;if(f!==h||s!==l){if(f!==h){var p=i.find((function(t){return t.props.id===h}));p&&c.unshift(p)}n.layerId=f,n.index=s,n.info=null}}var d=et(t),A=new Map;return A.set(null,d),c.forEach((function(t){var e=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?tt(Object(n),!0).forEach((function(e){u()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):tt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},d);t===a&&(e.color=o,e.index=s,e.picked=!0);var i=(e=rt({layer:t,info:e,mode:r})).layer;t===a&&"hover"===r&&(n.info=e),A.set(i.id,e),"hover"===r&&i.updateAutoHighlight(e)})),A}function rt(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}function it(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return ot(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 ot(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=n.call(t)},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 ot(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 at(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 st(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?at(Object(n),!0).forEach((function(e){u()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):at(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var ut=function(){function t(e){i()(this,t),u()(this,"_pickable",!0),this.gl=e,this.pickLayersPass=new Z.a(e),this.lastPickedInfo={index:-1,layerId:null,info:null}}return a()(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())}},{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,i=t.viewports,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.lastPickedInfo.info,a=o&&o.layer&&o.layer.id,s=o&&o.viewport&&o.viewport.id,u=a?r.find((function(t){return t.id===a})):null,c=s&&i.find((function(t){return t.id===s}))||i[0],l=c&&c.unproject([e-c.x,n-c.y]),h={x:e,y:n,viewport:c,coordinate:l,layer:u};return st(st({},o),h)}},{key:"_resizeBuffer",value:function(){var t,e,n=this.gl;if(!this.pickingFBO&&(this.pickingFBO=new C.a(n),C.a.isSupported(n,{colorBufferFloat:!0}))){var r=new C.a(n);r.attach(u()({},36064,new y.a(n,{format:Object(P.j)(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,i=t.x,o=t.y,a=t.radius,s=void 0===a?0:a,u=t.depth,c=void 0===u?1:u,l=t.mode,h=void 0===l?"query":l,f=t.unproject3D,p=t.onViewportActive,d=t.effects,A=this._getPickable(e),g=Object(P.e)(this.gl);if(!A)return{result:[],emptyInfo:et({viewports:r,x:i,y:o,pixelRatio:g})};this._resizeBuffer();for(var m,y=Object(P.d)(this.gl,[i,o],!0),v=[y.x+Math.floor(y.width/2),y.y+Math.floor(y.height/2)],_=Math.round(s*g),b=this.pickingFBO,x=b.width,w=b.height,E=this._getPickingRect({deviceX:v[0],deviceY:v[1],deviceRadius:_,deviceWidth:x,deviceHeight:w}),O={x:i-s,y:o-s,width:2*s+1,height:2*s+1},S=[],T=new Set,C=0;C<c;C++){var M=void 0;if(E)M=$(st(st({},this._drawAndSample({layers:A,views:n,viewports:r,onViewportActive:p,deviceRect:E,cullRect:O,effects:d,pass:"picking:".concat(h)})),{},{deviceX:v[0],deviceY:v[1],deviceRadius:_,deviceRect:E}));else M={pickedColor:null,pickedObjectIndex:-1};var I=void 0;if(M.pickedLayer&&f&&this.depthFBO)I=this._drawAndSample({layers:[M.pickedLayer],views:n,viewports:r,onViewportActive:p,deviceRect:{x:M.pickedX,y:M.pickedY,width:1,height:1},cullRect:O,effects:d,pass:"picking:".concat(h,":z")},!0).pickedColors[0];M.pickedLayer&&C+1<c&&(T.add(M.pickedLayer),M.pickedLayer.disablePickingIndex(M.pickedObjectIndex));var B,R=it((m=nt({pickInfo:M,lastPickedInfo:this.lastPickedInfo,mode:h,layers:A,viewports:r,x:i,y:o,z:I,pixelRatio:g})).values());try{for(R.s();!(B=R.n()).done;){var k=B.value;k.layer&&S.push(k)}}catch(t){R.e(t)}finally{R.f()}if(!M.pickedColor)break}var L,D=it(T);try{for(D.s();!(L=D.n()).done;){L.value.restorePickingColors()}}catch(t){D.e(t)}finally{D.f()}return{result:S,emptyInfo:m.get(null)}}},{key:"_pickVisibleObjects",value:function(t){var e=t.layers,n=t.views,r=t.viewports,i=t.x,o=t.y,a=t.width,s=void 0===a?1:a,u=t.height,c=void 0===u?1:u,l=t.mode,f=void 0===l?"query":l,p=t.maxObjects,d=void 0===p?null:p,A=t.onViewportActive,g=t.effects,m=this._getPickable(e);if(!m)return[];this._resizeBuffer();for(var y=Object(P.e)(this.gl),v=Object(P.d)(this.gl,[i,o],!0),_=v.x,b=v.y+v.height,x=Object(P.d)(this.gl,[i+s,o+c],!0),w=x.x+x.width,E=x.y,O={x:_,y:E,width:w-_,height:b-E},S=function(t){var e=t.pickedColors,n=t.decodePickingColor,r=new Map;if(e)for(var i=0;i<e.length;i+=4){if(e[i+3]-1>=0){var o=e.slice(i,i+4),a=o.join(",");if(!r.has(a)){var s=n(o);s?r.set(a,K(K({},s),{},{color:o})):h.a.error("Picked non-existent layer. Is picking buffer corrupt?")()}}}return Array.from(r.values())}(this._drawAndSample({layers:m,views:n,viewports:r,onViewportActive:A,deviceRect:O,cullRect:{x:i,y:o,width:s,height:c},effects:g,pass:"picking:".concat(f)})),T=new Map,C=Number.isFinite(d),M=0;M<S.length&&!(C&&d&&T.size>=d);M++){var I=S[M],B={color:I.pickedColor,layer:null,index:I.pickedObjectIndex,picked:!0,x:i,y:o,pixelRatio:y};B=rt({layer:I.pickedLayer,info:B,mode:f}),T.has(B.object)||T.set(B.object,B)}return Array.from(T.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,c=arguments.length>1&&void 0!==arguments[1]&&arguments[1],l=c?this.depthFBO:this.pickingFBO,h=this.pickLayersPass.render({layers:e,layerFilter:this.layerFilter,views:n,viewports:r,onViewportActive:i,pickingFBO:l,deviceRect:o,cullRect:a,effects:s,pass:u,pickZ:c}),f=h.decodePickingColor,p=o.x,d=o.y,A=o.width,g=o.height,m=new(c?Float32Array:Uint8Array)(A*g*4);return Object(J.c)(l,{sourceX:p,sourceY:d,sourceWidth:A,sourceHeight:g,target:m}),{pickedColors:m,decodePickingColor:f}}},{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,c=Math.min(o,n+r+1)-s;return u<=0||c<=0?null:{x:a,y:s,width:u,height:c}}}]),t}(),ct={zIndex:"1",position:"absolute",pointerEvents:"none",color:"#a0a7b4",backgroundColor:"#29323c",padding:"10px",top:"0",left:"0",display:"none"},lt=function(){function t(e){i()(this,t),u()(this,"el",null),u()(this,"isVisible",!1);var n=e.parentElement;n&&(this.el=document.createElement("div"),this.el.className="deck-tooltip",Object.assign(this.el.style,ct),n.appendChild(this.el))}return a()(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)}this.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}(),ht=n(66),ft=n(191),pt=n(285),dt=n(125),At=n(10),gt=n(38),mt=n(234),yt=n(181);class vt extends gt.a{get[Symbol.toStringTag](){return"Query"}static isSupported(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const n=Object(P.j)(t),r=Object(mt.c)(t,yt.a.TIMER_QUERY);let i=n||r;for(const t of e)switch(t){case"queries":i=i&&n;break;case"timers":i=i&&r;break;default:Object(At.a)(!1)}return i}constructor(t){super(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),this.target=null,this._queryPending=!1,this._pollingPromise=null,Object.seal(this)}beginTimeElapsedQuery(){return this.begin(35007)}beginOcclusionQuery(){let{conservative:t=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.begin(t?36202:35887)}beginTransformFeedbackQuery(){return this.begin(35976)}begin(t){return this._queryPending||(this.target=t,this.gl2.beginQuery(this.target,this.handle)),this}end(){return this._queryPending||this.target&&(this.gl2.endQuery(this.target),this.target=null,this._queryPending=!0),this}isResultAvailable(){if(!this._queryPending)return!1;const t=this.gl2.getQueryParameter(this.handle,34919);return t&&(this._queryPending=!1),t}isTimerDisjoint(){return this.gl2.getParameter(36795)}getResult(){return this.gl2.getQueryParameter(this.handle,34918)}getTimerMilliseconds(){return this.getResult()/1e6}createPoll(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Number.POSITIVE_INFINITY;if(this._pollingPromise)return this._pollingPromise;let e=0;return this._pollingPromise=new Promise((n,r)=>{const i=()=>{this.isResultAvailable()?(n(this.getResult()),this._pollingPromise=null):e++>t?(r("Timed out"),this._pollingPromise=null):requestAnimationFrame(i)};requestAnimationFrame(i)}),this._pollingPromise}_createHandle(){return vt.isSupported(this.gl)?this.gl2.createQuery():null}_deleteHandle(){this.gl2.deleteQuery(this.handle)}}var _t=n(134);const bt=Object(_t.a)()&&"undefined"!=typeof document;let xt=0;class wt{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{onCreateContext:e=(t=>Object(P.c)(t)),onAddHTML:n=null,onInitialize:r=(()=>{}),onRender:i=(()=>{}),onFinalize:o=(()=>{}),onError:a,gl:s=null,glOptions:u={},debug:c=!1,createFramebuffer:l=!1,autoResizeViewport:h=!0,autoResizeDrawingBuffer:f=!0,stats:p=dt.b.get("animation-loop-".concat(xt++))}=t;let{useDevicePixels:d=!0}=t;"useDevicePixelRatio"in t&&(P.k.deprecated("useDevicePixelRatio","useDevicePixels")(),d=t.useDevicePixelRatio),this.props={onCreateContext:e,onAddHTML:n,onInitialize:r,onRender:i,onFinalize:o,onError:a,gl:s,glOptions:u,debug:c,createFramebuffer:l},this.gl=s,this.needsRedraw=null,this.timeline=null,this.stats=p,this.cpuTime=this.stats.get("CPU Time"),this.gpuTime=this.stats.get("GPU Time"),this.frameRate=this.stats.get("Frame Rate"),this._initialized=!1,this._running=!1,this._animationFrameId=null,this._nextFramePromise=null,this._resolveNextFrame=null,this._cpuStartTime=0,this.setProps({autoResizeViewport:h,autoResizeDrawingBuffer:f,useDevicePixels:d}),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this._pageLoadPromise=null,this._onMousemove=this._onMousemove.bind(this),this._onMouseleave=this._onMouseleave.bind(this)}delete(){this.stop(),this._setDisplay(null)}setNeedsRedraw(t){return Object(At.a)("string"==typeof t),this.needsRedraw=this.needsRedraw||t,this}setProps(t){return"autoResizeViewport"in t&&(this.autoResizeViewport=t.autoResizeViewport),"autoResizeDrawingBuffer"in t&&(this.autoResizeDrawingBuffer=t.autoResizeDrawingBuffer),"useDevicePixels"in t&&(this.useDevicePixels=t.useDevicePixels),this}start(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this._running)return this;this._running=!0;const e=this._getPageLoadPromise().then(()=>!this._running||this._initialized?null:(this._createWebGLContext(t),this._createFramebuffer(),this._startEventHandling(),this._initializeCallbackData(),this._updateCallbackData(),this._resizeCanvasDrawingBuffer(),this._resizeViewport(),this._gpuTimeQuery=vt.isSupported(this.gl,["timers"])?new vt(this.gl):null,this._initialized=!0,this.onInitialize(this.animationProps))).then(t=>{this._running&&(this._addCallbackData(t||{}),!1!==t&&this._startLoop())});return this.props.onError&&e.catch(this.props.onError),this}redraw(){return this.isContextLost()||(this._beginTimers(),this._setupFrame(),this._updateCallbackData(),this._renderFrame(this.animationProps),this._clearNeedsRedraw(),this.offScreen&&this.gl.commit&&this.gl.commit(),this._resolveNextFrame&&(this._resolveNextFrame(this),this._nextFramePromise=null,this._resolveNextFrame=null),this._endTimers()),this}stop(){return this._running&&(this._finalizeCallbackData(),this._cancelAnimationFrame(this._animationFrameId),this._nextFramePromise=null,this._resolveNextFrame=null,this._animationFrameId=null,this._running=!1),this}attachTimeline(t){return this.timeline=t,this.timeline}detachTimeline(){this.timeline=null}waitForRender(){return this.setNeedsRedraw("waitForRender"),this._nextFramePromise||(this._nextFramePromise=new Promise(t=>{this._resolveNextFrame=t})),this._nextFramePromise}async toDataURL(){return this.setNeedsRedraw("toDataURL"),await this.waitForRender(),this.gl.canvas.toDataURL()}isContextLost(){return this.gl.isContextLost()}onCreateContext(){return this.props.onCreateContext(...arguments)}onInitialize(){return this.props.onInitialize(...arguments)}onRender(){return this.props.onRender(...arguments)}onFinalize(){return this.props.onFinalize(...arguments)}getHTMLControlValue(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;const n=document.getElementById(t);return n?Number(n.value):e}setViewParameters(){return P.k.removed("AnimationLoop.setViewParameters","AnimationLoop.setProps")(),this}_startLoop(){const t=()=>{this._running&&(this.redraw(),this._animationFrameId=this._requestAnimationFrame(t))};this._cancelAnimationFrame(this._animationFrameId),this._animationFrameId=this._requestAnimationFrame(t)}_getPageLoadPromise(){return this._pageLoadPromise||(this._pageLoadPromise=bt?new Promise((t,e)=>{bt&&"complete"===document.readyState?t(document):window.addEventListener("load",()=>{t(document)})}):Promise.resolve({})),this._pageLoadPromise}_setDisplay(t){this.display&&(this.display.delete(),this.display.animationLoop=null),t&&(t.animationLoop=this),this.display=t}_cancelAnimationFrame(t){return this.display&&this.display.cancelAnimationFrame?this.display.cancelAnimationFrame(t):(e=t,"undefined"!=typeof window&&window.cancelAnimationFrame?window.cancelAnimationFrame(e):clearTimeout(e));var e}_requestAnimationFrame(t){if(this._running)return this.display&&this.display.requestAnimationFrame?this.display.requestAnimationFrame(t):(e=t,"undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame(e):setTimeout(e,1e3/60));var e}_renderFrame(){this.display?this.display._renderFrame(...arguments):this.onRender(...arguments)}_clearNeedsRedraw(){this.needsRedraw=null}_setupFrame(){this._resizeCanvasDrawingBuffer(),this._resizeViewport(),this._resizeFramebuffer()}_initializeCallbackData(){this.animationProps={gl:this.gl,stop:this.stop,canvas:this.gl.canvas,framebuffer:this.framebuffer,useDevicePixels:this.useDevicePixels,needsRedraw:null,startTime:Date.now(),engineTime:0,tick:0,tock:0,time:0,_timeline:this.timeline,_loop:this,_animationLoop:this,_mousePosition:null}}_updateCallbackData(){const{width:t,height:e,aspect:n}=this._getSizeAndAspect();t===this.animationProps.width&&e===this.animationProps.height||this.setNeedsRedraw("drawing buffer resized"),n!==this.animationProps.aspect&&this.setNeedsRedraw("drawing buffer aspect changed"),this.animationProps.width=t,this.animationProps.height=e,this.animationProps.aspect=n,this.animationProps.needsRedraw=this.needsRedraw,this.animationProps.engineTime=Date.now()-this.animationProps.startTime,this.timeline&&this.timeline.update(this.animationProps.engineTime),this.animationProps.tick=Math.floor(this.animationProps.time/1e3*60),this.animationProps.tock++,this.animationProps.time=this.timeline?this.timeline.getTime():this.animationProps.engineTime,this.animationProps._offScreen=this.offScreen}_finalizeCallbackData(){this.onFinalize(this.animationProps)}_addCallbackData(t){"object"==typeof t&&null!==t&&(this.animationProps=Object.assign({},this.animationProps,t))}_createWebGLContext(t){if(this.offScreen=t.canvas&&"undefined"!=typeof OffscreenCanvas&&t.canvas instanceof OffscreenCanvas,t=Object.assign({},t,this.props.glOptions),this.gl=this.props.gl?Object(P.h)(this.props.gl,t):this.onCreateContext(t),!Object(P.i)(this.gl))throw new Error("AnimationLoop.onCreateContext - illegal context returned");Object(P.l)(this.gl),this._createInfoDiv()}_createInfoDiv(){if(this.gl.canvas&&this.props.onAddHTML){const t=document.createElement("div");document.body.appendChild(t),t.style.position="relative";const e=document.createElement("div");e.style.position="absolute",e.style.left="10px",e.style.bottom="10px",e.style.width="300px",e.style.background="white",t.appendChild(this.gl.canvas),t.appendChild(e);const n=this.props.onAddHTML(e);n&&(e.innerHTML=n)}}_getSizeAndAspect(){const t=this.gl.drawingBufferWidth,e=this.gl.drawingBufferHeight;let n=1;const{canvas:r}=this.gl;return r&&r.clientHeight?n=r.clientWidth/r.clientHeight:t>0&&e>0&&(n=t/e),{width:t,height:e,aspect:n}}_resizeViewport(){this.autoResizeViewport&&this.gl.viewport(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight)}_resizeCanvasDrawingBuffer(){this.autoResizeDrawingBuffer&&Object(P.m)(this.gl,{useDevicePixels:this.useDevicePixels})}_createFramebuffer(){this.props.createFramebuffer&&(this.framebuffer=new C.a(this.gl))}_resizeFramebuffer(){this.framebuffer&&this.framebuffer.resize({width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight})}_beginTimers(){this.frameRate.timeEnd(),this.frameRate.timeStart(),this._gpuTimeQuery&&this._gpuTimeQuery.isResultAvailable()&&!this._gpuTimeQuery.isTimerDisjoint()&&this.stats.get("GPU Time").addTime(this._gpuTimeQuery.getTimerMilliseconds()),this._gpuTimeQuery&&this._gpuTimeQuery.beginTimeElapsedQuery(),this.cpuTime.timeStart()}_endTimers(){this.cpuTime.timeEnd(),this._gpuTimeQuery&&this._gpuTimeQuery.end()}_startEventHandling(){const{canvas:t}=this.gl;t&&(t.addEventListener("mousemove",this._onMousemove),t.addEventListener("mouseleave",this._onMouseleave))}_onMousemove(t){this.animationProps._mousePosition=[t.offsetX,t.offsetY]}_onMouseleave(t){this.animationProps._mousePosition=null}}var Et=n(287),Ot=n(73),St=n(139),Tt=n.n(St);const Ct={mousedown:1,mousemove:2,mouseup:4};!function(t){const e=t.prototype.handler;t.prototype.handler=function(t){const n=this.store;t.button>0&&"pointerdown"===t.type&&(function(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return!0;return!1}(n,e=>e.pointerId===t.pointerId)||n.push(t)),e.call(this,t)}}(Tt.a.PointerEventInput),Tt.a.MouseInput.prototype.handler=function(t){let e=Ct[t.type];1&e&&t.button>=0&&(this.pressed=!0),2&e&&0===t.which&&(e=4),this.pressed&&(4&e&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:"mouse",srcEvent:t}))};const Pt=Tt.a.Manager;var Mt=Tt.a;class It{constructor(t,e,n){this.element=t,this.callback=e,this.options={enable:!0,...n}}}const Bt=Mt?[[Mt.Pan,{event:"tripan",pointers:3,threshold:0,enable:!1}],[Mt.Rotate,{enable:!1}],[Mt.Pinch,{enable:!1}],[Mt.Swipe,{enable:!1}],[Mt.Pan,{threshold:0,enable:!1}],[Mt.Press,{enable:!1}],[Mt.Tap,{event:"doubletap",taps:2,enable:!1}],[Mt.Tap,{event:"anytap",enable:!1}],[Mt.Tap,{enable:!1}]]:null,Rt={tripan:["rotate","pinch","pan"],rotate:["pinch"],pinch:["pan"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},kt={doubletap:["tap"]},Lt={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},Dt={KEY_EVENTS:["keydown","keyup"],MOUSE_EVENTS:["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],WHEEL_EVENTS:["wheel","mousewheel"]},jt={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"},Ft={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"};var zt=n(105);const Ut=-1!==zt.b.indexOf("firefox"),{WHEEL_EVENTS:Nt}=Dt;class Gt extends It{constructor(t,e,n){super(t,e,n),this.handleEvent=t=>{if(!this.options.enable)return;let e=t.deltaY;zt.c.WheelEvent&&(Ut&&t.deltaMode===zt.c.WheelEvent.DOM_DELTA_PIXEL&&(e/=zt.c.devicePixelRatio),t.deltaMode===zt.c.WheelEvent.DOM_DELTA_LINE&&(e*=40)),0!==e&&e%4.000244140625==0&&(e=Math.floor(e/4.000244140625)),t.shiftKey&&e&&(e*=.25),this.callback({type:"wheel",center:{x:t.clientX,y:t.clientY},delta:-e,srcEvent:t,pointerType:"mouse",target:t.target})},this.events=(this.options.events||[]).concat(Nt),this.events.forEach(e=>t.addEventListener(e,this.handleEvent,!!zt.a&&{passive:!1}))}destroy(){this.events.forEach(t=>this.element.removeEventListener(t,this.handleEvent))}enableEventType(t,e){"wheel"===t&&(this.options.enable=e)}}const{MOUSE_EVENTS:Vt}=Dt;class Ht extends It{constructor(t,e,n){super(t,e,n),this.handleEvent=t=>{this.handleOverEvent(t),this.handleOutEvent(t),this.handleEnterEvent(t),this.handleLeaveEvent(t),this.handleMoveEvent(t)},this.pressed=!1;const{enable:r}=this.options;this.enableMoveEvent=r,this.enableLeaveEvent=r,this.enableEnterEvent=r,this.enableOutEvent=r,this.enableOverEvent=r,this.events=(this.options.events||[]).concat(Vt),this.events.forEach(e=>t.addEventListener(e,this.handleEvent))}destroy(){this.events.forEach(t=>this.element.removeEventListener(t,this.handleEvent))}enableEventType(t,e){"pointermove"===t&&(this.enableMoveEvent=e),"pointerover"===t&&(this.enableOverEvent=e),"pointerout"===t&&(this.enableOutEvent=e),"pointerenter"===t&&(this.enableEnterEvent=e),"pointerleave"===t&&(this.enableLeaveEvent=e)}handleOverEvent(t){this.enableOverEvent&&"mouseover"===t.type&&this._emit("pointerover",t)}handleOutEvent(t){this.enableOutEvent&&"mouseout"===t.type&&this._emit("pointerout",t)}handleEnterEvent(t){this.enableEnterEvent&&"mouseenter"===t.type&&this._emit("pointerenter",t)}handleLeaveEvent(t){this.enableLeaveEvent&&"mouseleave"===t.type&&this._emit("pointerleave",t)}handleMoveEvent(t){if(this.enableMoveEvent)switch(t.type){case"mousedown":t.button>=0&&(this.pressed=!0);break;case"mousemove":0===t.which&&(this.pressed=!1),this.pressed||this._emit("pointermove",t);break;case"mouseup":this.pressed=!1}}_emit(t,e){this.callback({type:t,center:{x:e.clientX,y:e.clientY},srcEvent:e,pointerType:"mouse",target:e.target})}}const{KEY_EVENTS:Wt}=Dt;class qt extends It{constructor(t,e,n){super(t,e,n),this.handleEvent=t=>{const e=t.target||t.srcElement;"INPUT"===e.tagName&&"text"===e.type||"TEXTAREA"===e.tagName||(this.enableDownEvent&&"keydown"===t.type&&this.callback({type:"keydown",srcEvent:t,key:t.key,target:t.target}),this.enableUpEvent&&"keyup"===t.type&&this.callback({type:"keyup",srcEvent:t,key:t.key,target:t.target}))},this.enableDownEvent=this.options.enable,this.enableUpEvent=this.options.enable,this.events=(this.options.events||[]).concat(Wt),t.tabIndex=this.options.tabIndex||0,t.style.outline="none",this.events.forEach(e=>t.addEventListener(e,this.handleEvent))}destroy(){this.events.forEach(t=>this.element.removeEventListener(t,this.handleEvent))}enableEventType(t,e){"keydown"===t&&(this.enableDownEvent=e),"keyup"===t&&(this.enableUpEvent=e)}}class Xt extends It{constructor(t,e,n){super(t,e,n),this.handleEvent=t=>{this.options.enable&&this.callback({type:"contextmenu",center:{x:t.clientX,y:t.clientY},srcEvent:t,pointerType:"mouse",target:t.target})},t.addEventListener("contextmenu",this.handleEvent)}destroy(){this.element.removeEventListener("contextmenu",this.handleEvent)}enableEventType(t,e){"contextmenu"===t&&(this.options.enable=e)}}const Jt={pointerdown:1,pointermove:2,pointerup:4,mousedown:1,mousemove:2,mouseup:4};function Zt(t){const e=Jt[t.srcEvent.type];if(!e)return null;const{buttons:n,button:r,which:i}=t.srcEvent;let o=!1,a=!1,s=!1;return 4===e||2===e&&!Number.isFinite(n)?(o=1===i,a=2===i,s=3===i):2===e?(o=Boolean(1&n),a=Boolean(4&n),s=Boolean(2&n)):1===e&&(o=0===r,a=1===r,s=2===r),{leftButton:o,middleButton:a,rightButton:s}}function Qt(t,e){const n=t.center;if(!n)return null;const 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}}}const Kt={srcElement:"root",priority:0};class Yt{constructor(t){this.handleEvent=t=>{if(this.isEmpty())return;const e=this._normalizeEvent(t);let n=t.srcEvent.target;for(;n&&n!==e.rootElement;){if(this._emit(e,n),e.handled)return;n=n.parentNode}this._emit(e,"root")},this.eventManager=t,this.handlers=[],this.handlersByElement=new Map,this._active=!1}isEmpty(){return!this._active}add(t,e,n,r=!1,i=!1){const{handlers:o,handlersByElement:a}=this;let s=Kt;"string"==typeof n||n&&n.addEventListener?s={...Kt,srcElement:n}:n&&(s={...Kt,...n});let u=a.get(s.srcElement);u||(u=[],a.set(s.srcElement,u));const c={type:t,handler:e,srcElement:s.srcElement,priority:s.priority};r&&(c.once=!0),i&&(c.passive=!0),o.push(c),this._active=this._active||!c.passive;let l=u.length-1;for(;l>=0&&!(u[l].priority>=c.priority);)l--;u.splice(l+1,0,c)}remove(t,e){const{handlers:n,handlersByElement:r}=this;for(let i=n.length-1;i>=0;i--){const o=n[i];if(o.type===t&&o.handler===e){n.splice(i,1);const t=r.get(o.srcElement);t.splice(t.indexOf(o),1),0===t.length&&r.delete(o.srcElement)}}this._active=n.some(t=>!t.passive)}_emit(t,e){const n=this.handlersByElement.get(e);if(n){let e=!1;const r=()=>{t.handled=!0},i=()=>{t.handled=!0,e=!0},o=[];for(let a=0;a<n.length;a++){const{type:s,handler:u,once:c}=n[a];if(u({...t,type:s,stopPropagation:r,stopImmediatePropagation:i}),c&&o.push(n[a]),e)break}for(let t=0;t<o.length;t++){const{type:e,handler:n}=o[t];this.remove(e,n)}}}_normalizeEvent(t){const e=this.eventManager.getElement();return{...t,...Zt(t),...Qt(t,e),preventDefault:()=>{t.srcEvent.preventDefault()},stopImmediatePropagation:null,stopPropagation:null,handled:!1,rootElement:e}}}const $t={events:null,recognizers:null,recognizerOptions:{},Manager:Pt,touchAction:"none",tabIndex:0};class te{constructor(t=null,e){this._onBasicInput=t=>{const{srcEvent:e}=t,n=Lt[e.type];n&&this.manager.emit(n,t)},this._onOtherEvent=t=>{this.manager.emit(t.type,t)},this.options={...$t,...e},this.events=new Map,this.setElement(t);const{events:n}=this.options;n&&this.on(n)}getElement(){return this.element}setElement(t){if(this.element&&this.destroy(),this.element=t,!t)return;const{options:e}=this,n=e.Manager;this.manager=new n(t,{touchAction:e.touchAction,recognizers:e.recognizers||Bt}).on("hammer.input",this._onBasicInput),e.recognizers||Object.keys(Rt).forEach(t=>{const e=this.manager.get(t);e&&Rt[t].forEach(t=>{e.recognizeWith(t)})});for(const t in e.recognizerOptions){const n=this.manager.get(t);if(n){const r=e.recognizerOptions[t];delete r.enable,n.set(r)}}this.wheelInput=new Gt(t,this._onOtherEvent,{enable:!1}),this.moveInput=new Ht(t,this._onOtherEvent,{enable:!1}),this.keyInput=new qt(t,this._onOtherEvent,{enable:!1,tabIndex:e.tabIndex}),this.contextmenuInput=new Xt(t,this._onOtherEvent,{enable:!1});for(const[t,e]of this.events)e.isEmpty()||(this._toggleRecognizer(e.recognizerName,!0),this.manager.on(t,e.handleEvent))}destroy(){this.element&&(this.wheelInput.destroy(),this.moveInput.destroy(),this.keyInput.destroy(),this.contextmenuInput.destroy(),this.manager.destroy(),this.wheelInput=null,this.moveInput=null,this.keyInput=null,this.contextmenuInput=null,this.manager=null,this.element=null)}on(t,e,n){this._addEventHandler(t,e,n,!1)}once(t,e,n){this._addEventHandler(t,e,n,!0)}watch(t,e,n){this._addEventHandler(t,e,n,!1,!0)}off(t,e){this._removeEventHandler(t,e)}_toggleRecognizer(t,e){const{manager:n}=this;if(!n)return;const r=n.get(t);if(r&&r.options.enable!==e){r.set({enable:e});const i=kt[t];i&&!this.options.recognizers&&i.forEach(i=>{const 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)}_addEventHandler(t,e,n,r,i){if("string"!=typeof t){n=e;for(const e in t)this._addEventHandler(e,t[e],n,r,i);return}const{manager:o,events:a}=this,s=Ft[t]||t;let u=a.get(s);u||(u=new Yt(this),a.set(s,u),u.recognizerName=jt[s]||s,o&&o.on(s,u.handleEvent)),u.add(t,e,n,r,i),u.isEmpty()||this._toggleRecognizer(u.recognizerName,!0)}_removeEventHandler(t,e){if("string"!=typeof t){for(const e in t)this._removeEventHandler(e,t[e]);return}const{events:n}=this,r=Ft[t]||t,i=n.get(r);if(i&&(i.remove(t,e),i.isEmpty())){const{recognizerName:t}=i;let e=!1;for(const r of n.values())if(r.recognizerName===t&&!r.isEmpty()){e=!0;break}e||this._toggleRecognizer(t,!1)}}}var ee=n(28);function ne(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return re(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 re(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=n.call(t)},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 re(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 ie(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 oe(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ie(Object(n),!0).forEach((function(e){u()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ie(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function ae(){}n.d(e,"a",(function(){return ue}));var se={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:ae,onResize:ae,onViewStateChange:ae,onInteractionStateChange:ae,onBeforeRender:ae,onAfterRender:ae,onLoad:ae,onError:function(t){return h.a.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},ue=function(){function t(e){var n=this;i()(this,t),u()(this,"width",0),u()(this,"height",0),u()(this,"userData",{}),u()(this,"canvas",null),u()(this,"viewManager",null),u()(this,"layerManager",null),u()(this,"effectManager",null),u()(this,"deckRenderer",null),u()(this,"deckPicker",null),u()(this,"eventManager",null),u()(this,"tooltip",null),u()(this,"_lastPointerDownInfo",null),u()(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})),u()(this,"_onEvent",(function(t){var e=M.b[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],c=!1;s&&(c=s.call(a,o,t)),!c&&u&&u(o,t)}})),u()(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=oe(oe({},se),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&&h.a.warn("View state tracking is disabled. Use either `initialViewState` for auto update or `viewState` for manual update.")(),"IE"===Object(pt.a)()&&h.a.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 Ot.a({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&&ht.a.setOptions(e._typedArrayManagerProps),this.animationLoop.start()}return a()(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&&h.a.removed("onLayerHover","onHover")(),"onLayerClick"in t&&h.a.removed("onLayerClick","onClick")(),t.initialViewState&&!Object(l.a)(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 Object(ee.a)(this.viewManager),this.viewManager.views}},{key:"getViewports",value:function(t){return Object(ee.a)(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],forceUpdate:e})}},{key:"_removeResources",value:function(t){var e,n=ne(t);try{for(n.s();!(e=n.n()).done;){var r=e.value;this.layerManager.resourceManager.remove(r)}}catch(t){n.e(t)}finally{n.f()}}},{key:"_pick",value:function(t,e,n){Object(ee.a)(this.deckPicker);var r=this.stats;r.get("Pick Count").incrementCount(),r.get(e).timeStart();var i=this.deckPicker[t](oe({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(),i}},{key:"_createCanvas",value:function(t){var e=t.canvas;("string"==typeof e&&(e=document.getElementById(e),Object(ee.a)(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,i=t.gl,o=t.glOptions,a=t.debug,s=t.onError,u=t.onBeforeRender,c=t.onAfterRender,l=t.useDevicePixels;return new wt({width:n,height:r,useDevicePixels:l,autoResizeViewport:!1,gl:i,onCreateContext:function(t){return Object(P.c)(oe(oe(oe({},o),t),{},{canvas:e.canvas,debug:a,onContextLost:function(){return e._onContextLost()}}))},onInitialize:function(t){return e._setGLContext(t.gl)},onRender:this._onRenderFrame.bind(this),onBeforeRender:u,onAfterRender:c,onError:s})}},{key:"_getViewState",value:function(){return this.props.viewState||this.viewState}},{key:"_getViews",value:function(){var t=this.props.views||[new g.a({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,s=ne(n);try{for(s.s();!(i=s.n()).done;){var u,c=i.value;o=c,a=(null===(u=c.layer)||void 0===u?void 0:u.onHover(c,t.event))||a}}catch(t){s.e(t)}finally{s.f()}if(!a&&this.props.onHover&&this.props.onHover(o,t.event),this.props.getTooltip&&this.tooltip){var l=this.props.getTooltip(o);this.tooltip.setTooltip(l,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,Object(P.h)(t,{enable:!0,copyState:!0})),this.tooltip=new lt(this.canvas),Object(P.n)(t,{blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onWebGLInitialized(t);var e=new Et.a;for(var n in e.play(),this.animationLoop.attachTimeline(e),this.eventManager=new te(this.props.parent||t.canvas,{touchAction:this.props.touchAction,recognizerOptions:this.props.eventRecognizerOptions,events:{pointerdown:this._onPointerDown,pointermove:this._onPointerMove,pointerleave:this._onPointerMove}}),M.b)this.eventManager.on(n,this._onEvent);this.viewManager=new A({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 c.a(t,{deck:this,stats:this.stats,viewport:r,timeline:e}),this.effectManager=new q,this.deckRenderer=new X.a(t),this.deckPicker=new ut(t),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}}},{key:"_drawLayers",value:function(t,e){var n=this.layerManager.context.gl;Object(P.n)(n,this.props.parameters),this.props.onBeforeRender({gl:n}),this.deckRenderer.renderLayers(oe({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(),h.a.table(4,this.metrics)(),this.props._onMetrics&&this.props._onMetrics(this.metrics)),this._updateCanvasSize(),this._updateCursor(),this.tooltip.isVisible&&this.viewManager.needsRedraw()&&this.tooltip.setTooltip(null),this.layerManager.updateLayers(),this._pickAndCallback(),this.redraw(),this.viewManager&&this.viewManager.updateViewStates()}},{key:"_onViewStateChange",value:function(t){var e=this.props.onViewStateChange(t)||t.viewState;this.viewState&&(this.viewState=oe(oe({},this.viewState),{},u()({},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=dt.b.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}();u()(ue,"defaultProps",se),u()(ue,"VERSION",ft.a.VERSION)},function(t,e,n){"use strict";var r=n(0),i=n.n(r),o=n(107),a=n(291),s=n(20),u=n(31);var c={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};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 h(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){i()(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}var f="8.9.0-alpha.5",p=globalThis.deck&&globalThis.deck.VERSION;if(p&&p!==f)throw new Error("deck.gl - multiple versions detected: ".concat(p," vs ").concat(f));p||(s.a.log(1,"deck.gl ".concat(f))(),globalThis.deck=h(h({},globalThis.deck),{},{VERSION:f,version:f,log:s.a,_registerLoggers:u.b}),Object(o.c)([c,[a.a,{imagebitmap:{premultiplyAlpha:"none"}}]]));e.a=globalThis.deck},function(t,e){},function(t,e,n){"use strict";t.exports=i;var r=n(213);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="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function a(t){return t.type===i.Bytes?t.readVarint()+t.pos:t.pos+1}function s(t,e,n){return n?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function u(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 c(t,e){for(var n=0;n<t.length;n++)e.writeVarint(t[n])}function l(t,e){for(var n=0;n<t.length;n++)e.writeSVarint(t[n])}function h(t,e){for(var n=0;n<t.length;n++)e.writeFloat(t[n])}function f(t,e){for(var n=0;n<t.length;n++)e.writeDouble(t[n])}function p(t,e){for(var n=0;n<t.length;n++)e.writeBoolean(t[n])}function d(t,e){for(var n=0;n<t.length;n++)e.writeFixed32(t[n])}function A(t,e){for(var n=0;n<t.length;n++)e.writeSFixed32(t[n])}function g(t,e){for(var n=0;n<t.length;n++)e.writeFixed64(t[n])}function m(t,e){for(var n=0;n<t.length;n++)e.writeSFixed64(t[n])}function y(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function v(t,e,n){t[n]=e,t[n+1]=e>>>8,t[n+2]=e>>>16,t[n+3]=e>>>24}function _(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=y(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=_(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=y(this.buf,this.pos)+4294967296*y(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=y(this.buf,this.pos)+4294967296*_(this.buf,this.pos+4);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 s(t,r,e);if(i=o[n.pos++],r|=(127&i)<<3,i<128)return s(t,r,e);if(i=o[n.pos++],r|=(127&i)<<10,i<128)return s(t,r,e);if(i=o[n.pos++],r|=(127&i)<<17,i<128)return s(t,r,e);if(i=o[n.pos++],r|=(127&i)<<24,i<128)return s(t,r,e);if(i=o[n.pos++],r|=(1&i)<<31,i<128)return s(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&&o?function(t,e,n){return o.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],c=null,l=u>239?4:u>223?3:u>191?2:1;if(i+l>n)break;1===l?u<128&&(c=u):2===l?128==(192&(o=t[i+1]))&&(c=(31&u)<<6|63&o)<=127&&(c=null):3===l?(o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&((c=(15&u)<<12|(63&o)<<6|63&a)<=2047||c>=55296&&c<=57343)&&(c=null)):4===l&&(o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&((c=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,l=1):c>65535&&(c-=65536,r+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),r+=String.fromCharCode(c),i+=l}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=a(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=a(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=a(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=a(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=a(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=a(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=a(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=a(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=a(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),v(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),v(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),v(this.buf,-1&t,this.pos),v(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),v(this.buf,-1&t,this.pos),v(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;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&&u(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&&u(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,c,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,l,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,p,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,h,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,f,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,d,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,A,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,g,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,m,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))}}},function(t,e,n){const r=n(264),i={"||":function(t,e){return t||e},"&&":function(t,e){return t&&e},"|":function(t,e){return t|e},"^":function(t,e){return t^e},"&":function(t,e){return t&e},"==":function(t,e){return t==e},"!=":function(t,e){return t!=e},"===":function(t,e){return t===e},"!==":function(t,e){return t!==e},"<":function(t,e){return t<e},">":function(t,e){return t>e},"<=":function(t,e){return t<=e},">=":function(t,e){return t>=e},"<<":function(t,e){return t<<e},">>":function(t,e){return t>>e},">>>":function(t,e){return t>>>e},"+":function(t,e){return t+e},"-":function(t,e){return t-e},"*":function(t,e){return t*e},"/":function(t,e){return t/e},"%":function(t,e){return t%e}},o={"-":function(t){return-t},"+":function(t){return+t},"~":function(t){return~t},"!":function(t){return!t}};function a(t,e){return t.map((function(t){return l(t,e)}))}async function s(t,e){return await Promise.all(t.map(t=>h(t,e)))}function u(t,e){const n=l(t.object,e);return t.computed?[n,n[l(t.property,e)]]:[n,n[t.property.name]]}async function c(t,e){const n=await h(t.object,e);return t.computed?[n,n[await h(t.property,e)]]:[n,n[t.property.name]]}function l(t,e){switch(t.type){case"ArrayExpression":return a(t.elements,e);case"BinaryExpression":return i[t.operator](l(t.left,e),l(t.right,e));case"CallExpression":let n,r,s;if("MemberExpression"===t.callee.type?(s=u(t.callee,e),n=s[0],r=s[1]):r=l(t.callee,e),"function"!=typeof r)return;return r.apply(n,a(t.arguments,e));case"ConditionalExpression":return l(t.test,e)?l(t.consequent,e):l(t.alternate,e);case"Identifier":return e[t.name];case"Literal":return t.value;case"LogicalExpression":return"||"===t.operator?l(t.left,e)||l(t.right,e):"&&"===t.operator?l(t.left,e)&&l(t.right,e):i[t.operator](l(t.left,e),l(t.right,e));case"MemberExpression":return u(t,e)[1];case"ThisExpression":return e;case"UnaryExpression":return o[t.operator](l(t.argument,e));default:return}}async function h(t,e){switch(t.type){case"ArrayExpression":return await s(t.elements,e);case"BinaryExpression":{const[n,r]=await Promise.all([h(t.left,e),h(t.right,e)]);return i[t.operator](n,r)}case"CallExpression":let n,r,a;if("MemberExpression"===t.callee.type?(a=await c(t.callee,e),n=a[0],r=a[1]):r=await h(t.callee,e),"function"!=typeof r)return;return await r.apply(n,await s(t.arguments,e));case"ConditionalExpression":return await h(t.test,e)?await h(t.consequent,e):await h(t.alternate,e);case"Identifier":return e[t.name];case"Literal":return t.value;case"LogicalExpression":{if("||"===t.operator)return await h(t.left,e)||await h(t.right,e);if("&&"===t.operator)return await h(t.left,e)&&await h(t.right,e);const[n,r]=await Promise.all([h(t.left,e),h(t.right,e)]);return i[t.operator](n,r)}case"MemberExpression":return(await c(t,e))[1];case"ThisExpression":return e;case"UnaryExpression":return o[t.operator](await h(t.argument,e));default:return}}t.exports={parse:r,eval:l,evalAsync:h,compile:function(t){return l.bind(null,r(t))},compileAsync:function(t){return h.bind(null,r(t))}}},function(t,e,n){"use strict";var r=n(74),i=n(196),o=n(179);function a(t){return s(function t(e,n){return e.map(e=>(e instanceof i.a||(Object(o.a)("string"!=typeof e,"Shader module use by name is deprecated. Import shader module '".concat(e,"' and use it directly.")),Object(o.a)(e.name,"shader module has no name"),(e=new i.a(e)).dependencies=t(e.dependencies)),e))}(t))}function s(t){const e={},n={};return u({modules:t,level:0,moduleMap:e,moduleDepth:n}),Object.keys(n).sort((t,e)=>n[e]-n[t]).map(t=>e[t])}function u(t){let{modules:e,level:n,moduleMap:r,moduleDepth:i}=t;if(n>=5)throw new Error("Possible loop in shader dependency graph");for(const t of e)r[t.name]=t,(void 0===i[t.name]||i[t.name]<n)&&(i[t.name]=n);for(const t of e)t.dependencies&&u({modules:t.dependencies,level:n+1,moduleMap:r,moduleDepth:i})}function c(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e="undefined"!=typeof window&&window.navigator||{},n=t.userAgent||e.userAgent||"",r=-1!==n.indexOf("MSIE "),i=-1!==n.indexOf("Trident/");return r||i}const l={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]},h={};Object.keys(l).forEach(t=>{h[t]=t});const f={};function p(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=l[e];if(Object(o.a)(r,e),!c(n))return!0;if(e in f)return f[e];const i=r[0],a=n.behavior||"enable",s="#extension GL_".concat(i," : ").concat(a,"\nvoid main(void) {}"),u=t.createShader(35633);t.shaderSource(u,s),t.compileShader(u);const h=t.getShaderParameter(u,35713);return t.deleteShader(u),f[e]=h,h}function d(t,e){const n=l[e];Object(o.a)(n,e);const 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 Object(o.a)(!1===i||!0===i),i}function A(t,e){return(e=Array.isArray(e)?e:[e]).every(e=>d(t,e))}var g=n(183);function m(t){return new RegExp("\\b".concat(t,"[ \\t]+(\\w+[ \\t]+\\w+(\\[\\w+\\])?;)"),"g")}const y=[[/^(#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("]],v=[...y,[m("attribute"),"in $1"],[m("varying"),"out $1"]],_=[...y,[m("varying"),"in $1"]],b=[[/^#version[ \t]+300[ \t]+es/,"#version 100"],[/\btexture(2D|2DProj|Cube)Lod\(/g,"texture$1LodEXT("],[/\btexture\(/g,"texture2D("],[/\btextureLod\(/g,"texture2DLodEXT("]],x=[...b,[m("in"),"attribute $1"],[m("out"),"varying $1"]],w=[...b,[m("in"),"varying $1"]],E=/\bout[ \t]+vec4[ \t]+(\w+)[ \t]*;\n?/,O=/void\s+main\s*\([^)]*\)\s*\{\n?/;function S(t,e,n){switch(e){case 300:return n?T(t,v):function(t){const e=(t=T(t,_)).match(E);if(e){const n=e[1];t=t.replace(new RegExp("\\b".concat("gl_FragColor","\\b"),"g"),n)}else{const e="fragmentColor";t=t.replace(O,t=>"out vec4 ".concat(e,";\n").concat(t)).replace(new RegExp("\\b".concat("gl_FragColor","\\b"),"g"),e)}return t}(t);case 100:return n?T(t,x):function(t){const e=(t=T(t,w)).match(E);if(e){const n=e[1];t=t.replace(E,"").replace(new RegExp("\\b".concat(n,"\\b"),"g"),"gl_FragColor")}return t}(t);default:throw new Error("unknown GLSL version ".concat(e))}}function T(t,e){for(const[n,r]of e)t=t.replace(n,r);return t}const C="\n\n".concat(g.a,"\n\n"),P={[r.b]:"vertex",[r.a]:"fragment"};function M(t,e){let{id:n,source:i,type:a,modules:s,defines:u={},hookFunctions:c=[],inject:l={},transpileToGLSL100:f=!1,prologue:d=!0,log:m}=e;Object(o.a)("string"==typeof i,"shader source must be a string");const y=a===r.b,v=i.split("\n");let _=100,b="",x=i;0===v[0].indexOf("#version ")?(_=300,b=v[0],x=v.slice(1).join("\n")):b="#version ".concat(_);const w={};s.forEach(t=>{Object.assign(w,t.getDefines())}),Object.assign(w,u);let E=d?"".concat(b,"\n").concat(function(t){let{id:e,source:n,type:r}=t;return e&&"string"==typeof e&&-1===n.indexOf("SHADER_NAME")?"\n#define SHADER_NAME ".concat(e,"_").concat(P[r],"\n\n"):""}({id:n,source:i,type:a}),"\n").concat(function(t){let{type:e}=t;return"\n#define SHADER_TYPE_".concat(P[e].toUpperCase(),"\n")}({type:a}),"\n").concat(function(t){switch(function(t){const e=t.getExtension("WEBGL_debug_renderer_info"),n=t.getParameter(e&&e.UNMASKED_VENDOR_WEBGL||7936),r=t.getParameter(e&&e.UNMASKED_RENDERER_WEBGL||7937);return{gpuVendor:function(t,e){if(t.match(/NVIDIA/i)||e.match(/NVIDIA/i))return"NVIDIA";if(t.match(/INTEL/i)||e.match(/INTEL/i))return"INTEL";if(t.match(/AMD/i)||e.match(/AMD/i)||t.match(/ATI/i)||e.match(/ATI/i))return"AMD";return"UNKNOWN GPU"}(n,r),vendor:n,renderer:r,version:t.getParameter(7938),shadingLanguageVersion:t.getParameter(35724)}}(t).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"}}(t),"\n").concat(function(t,e,n){let 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 A(t,h.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"),A(t,h.GLSL_DERIVATIVES)&&p(t,h.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"),A(t,h.GLSL_FRAG_DATA)&&p(t,h.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"),A(t,h.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(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=0,n="";for(const r in t){0===e&&(n+="\n// APPLICATION DEFINES\n"),e++;const i=t[r];(i||Number.isFinite(i))&&(n+="#define ".concat(r.toUpperCase()," ").concat(t[r],"\n"))}0===e&&(n+="\n");return n}(w),"\n").concat(y?"":"precision highp float;\n\n","\n"):"".concat(b,"\n");const O=function(t){const e={vs:{},fs:{}};return t.forEach(t=>{let n;"string"!=typeof t?(n=t,t=n.hook):n={},t=t.trim();const[r,i]=t.split(":"),o=t.replace(/\(.+/,"");e[r][o]=Object.assign(n,{signature:i})}),e}(c),T={},M={},I={};for(const t in l){const e="string"==typeof l[t]?{injection:l[t],order:0}:l[t],n=t.match(/^(v|f)s:(#)?([\w-]+)$/);if(n){const r=n[2],i=n[3];r?"decl"===i?M[t]=[e]:I[t]=[e]:T[t]=[e]}else I[t]=[e]}for(const t of s){m&&t.checkDeprecations(x,m);E+=t.getModuleSource(a,_);const e=t.injections[a];for(const t in e){const n=t.match(/^(v|f)s:#([\w-]+)$/);if(n){const r="decl"===n[2]?M:I;r[t]=r[t]||[],r[t].push(e[t])}else T[t]=T[t]||[],T[t].push(e[t])}}return E+=C,E=Object(g.c)(E,a,M),E+=function(t,e){let n="";for(const r in t){const i=t[r];if(n+="void ".concat(i.signature," {\n"),i.header&&(n+=" ".concat(i.header)),e[r]){const t=e[r];t.sort((t,e)=>t.order-e.order);for(const e of t)n+=" ".concat(e.injection,"\n")}i.footer&&(n+=" ".concat(i.footer)),n+="}\n"}return n}(O[a],T),E+=x,E=Object(g.c)(E,a,I),E=S(E,f?100:_,y),E}function I(t){return function(e){const n={};for(const r of t){const t=r.getUniforms(e,n);Object.assign(n,t)}return n}}var B=n(292);n.d(e,"a",(function(){return R}));class R{static getDefaultProgramManager(t){return t.luma=t.luma||{},t.luma.defaultProgramManager=t.luma.defaultProgramManager||new R(t),t.luma.defaultProgramManager}constructor(t){this.gl=t,this._programCache={},this._getUniforms={},this._registeredModules={},this._hookFunctions=[],this._defaultModules=[],this._hashes={},this._hashCounter=0,this.stateHash=0,this._useCounts={}}addDefaultModule(t){this._defaultModules.find(e=>e.name===t.name)||this._defaultModules.push(t),this.stateHash++}removeDefaultModule(t){const e="string"==typeof t?t:t.name;this._defaultModules=this._defaultModules.filter(t=>t.name!==e),this.stateHash++}addShaderHook(t,e){e&&(t=Object.assign(e,{hook:t})),this._hookFunctions.push(t),this.stateHash++}get(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{vs:e="",fs:n="",defines:i={},inject:o={},varyings:s=[],bufferMode:u=35981,transpileToGLSL100:c=!1}=t,l=this._getModuleList(t.modules),h=this._getHash(e),f=this._getHash(n),p=l.map(t=>this._getHash(t.name)).sort(),d=s.map(t=>this._getHash(t)),A=Object.keys(i).sort(),g=Object.keys(o).sort(),m=[],y=[];for(const t of A)m.push(this._getHash(t)),m.push(this._getHash(i[t]));for(const t of g)y.push(this._getHash(t)),y.push(this._getHash(o[t]));const v="".concat(h,"/").concat(f,"D").concat(m.join("/"),"M").concat(p.join("/"),"I").concat(y.join("/"),"V").concat(d.join("/"),"H").concat(this.stateHash,"B").concat(u).concat(c?"T":"");if(!this._programCache[v]){const t=function(t,e){const{vs:n,fs:i}=e,o=a(e.modules||[]);return{gl:t,vs:M(t,Object.assign({},e,{source:n,type:r.b,modules:o})),fs:M(t,Object.assign({},e,{source:i,type:r.a,modules:o})),getUniforms:I(o)}}(this.gl,{vs:e,fs:n,modules:l,inject:o,defines:i,hookFunctions:this._hookFunctions,transpileToGLSL100:c});this._programCache[v]=new B.a(this.gl,{hash:v,vs:t.vs,fs:t.fs,varyings:s,bufferMode:u}),this._getUniforms[v]=t.getUniforms||(t=>{}),this._useCounts[v]=0}return this._useCounts[v]++,this._programCache[v]}getUniforms(t){return this._getUniforms[t.hash]||null}release(t){const e=t.hash;this._useCounts[e]--,0===this._useCounts[e]&&(this._programCache[e].delete(),delete this._programCache[e],delete this._getUniforms[e],delete this._useCounts[e])}_getHash(t){return void 0===this._hashes[t]&&(this._hashes[t]=this._hashCounter++),this._hashes[t]}_getModuleList(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const e=new Array(this._defaultModules.length+t.length),n={};let r=0;for(let t=0,i=this._defaultModules.length;t<i;++t){const i=this._defaultModules[t],o=i.name;e[r++]=i,n[o]=!0}for(let i=0,o=t.length;i<o;++i){const o=t[i],a=o.name;n[a]||(e[r++]=o,n[a]=!0)}return e.length=r,e}}},function(t,e,n){"use strict";var r=n(179);const i={number:{validate:(t,e)=>Number.isFinite(t)&&(!("max"in e)||t<=e.max)&&(!("min"in e)||t>=e.min)},array:{validate:(t,e)=>Array.isArray(t)||ArrayBuffer.isView(t)}};function o(t){let e=a(t);return"object"===e?t?"type"in t?Object.assign({},t,i[t.type]):"value"in t?(e=a(t.value),Object.assign({type:e},t,i[e])):{type:"object",value:t}:{type:"object",value:null}:Object.assign({type:e,value:t},i[e])}function a(t){return Array.isArray(t)||ArrayBuffer.isView(t)?"array":typeof t}n.d(e,"a",(function(){return s})),n.d(e,"b",(function(){return u}));class s{constructor(t){let{name:e,vs:n,fs:i,dependencies:a=[],uniforms:s,getUniforms:u,deprecations:c=[],defines:l={},inject:h={},vertexShader:f,fragmentShader:p}=t;Object(r.a)("string"==typeof e),this.name=e,this.vs=n||f,this.fs=i||p,this.getModuleUniforms=u,this.dependencies=a,this.deprecations=this._parseDeprecationDefinitions(c),this.defines=l,this.injections=function(t){const e={vs:{},fs:{}};for(const n in t){let r=t[n];const i=n.slice(0,2);"string"==typeof r&&(r={order:0,injection:r}),e[i][n]=r}return e}(h),s&&(this.uniforms=function(t){const e={};for(const n in t){const r=o(t[n]);e[n]=r}return e}(s))}getModuleSource(t){let e;switch(t){case"vs":e=this.vs||"";break;case"fs":e=this.fs||"";break;default:Object(r.a)(!1)}return"#define MODULE_".concat(this.name.toUpperCase().replace(/[^0-9a-z]/gi,"_"),"\n").concat(e,"// END MODULE_").concat(this.name,"\n\n")}getUniforms(t,e){return this.getModuleUniforms?this.getModuleUniforms(t,e):this.uniforms?this._defaultGetUniforms(t):{}}getDefines(){return this.defines}checkDeprecations(t,e){this.deprecations.forEach(n=>{n.regex.test(t)&&(n.deprecated?e.deprecated(n.old,n.new)():e.removed(n.old,n.new)())})}_parseDeprecationDefinitions(t){return t.forEach(t=>{switch(t.type){case"function":t.regex=new RegExp("\\b".concat(t.old,"\\("));break;default:t.regex=new RegExp("".concat(t.type," ").concat(t.old,";"))}}),t}_defaultGetUniforms(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e={},n=this.uniforms;for(const i in n){const o=n[i];i in t&&!o.private?(o.validate&&Object(r.a)(o.validate(t[i],o),"".concat(this.name,": invalid ").concat(i)),e[i]=t[i]):e[i]=o.value}return e}}function u(t){if(!t.normalized&&(t.normalized=!0,t.uniforms&&!t.getUniforms)){const e=new s(t);t.getUniforms=e.getUniforms.bind(e)}return t}},function(t,e,n){"use strict";var r=n(32),i=n(71),o=n(52),a=n(8),s=n(51),u=n(10);function c(t){switch(t){case 6406:case 33326:case 6403:return 1;case 33328:case 33319:return 2;case 6407:case 34837:return 3;case 6408:case 34836:return 4;default:return Object(u.a)(!1),0}}var l=n(222);function h(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{sourceX:n=0,sourceY:r=0,sourceFormat:i=6408}=e;let{sourceAttachment:o=36064,target:a=null,sourceWidth:c,sourceHeight:l,sourceType:h}=e;const{framebuffer:f,deleteFramebuffer:p}=A(t);Object(u.a)(f);const{gl:d,handle:m,attachments:y}=f;c=c||f.width,l=l||f.height,36064===o&&null===m&&(o=1028),Object(u.a)(y[o]),h=h||y[o].type,a=g(a,h,i,c,l),h=h||Object(s.b)(a);const v=d.bindFramebuffer(36160,m);return d.readPixels(n,r,c,l,i,h,a),d.bindFramebuffer(36160,v||null),p&&f.delete(),a}function f(t,e){let{sourceX:n=0,sourceY:i=0,sourceFormat:o=6408,target:s=null,targetByteOffset:l=0,sourceWidth:h,sourceHeight:f,sourceType:p}=e;const{framebuffer:d,deleteFramebuffer:g}=A(t);Object(u.a)(d),h=h||d.width,f=f||d.height;const m=Object(a.a)(d.gl);if(p=p||(s?s.type:5121),!s){const t=c(o),e=function(t){switch(t){case 5121:return 1;case 33635:case 32819:case 32820:return 2;case 5126:return 4;default:return Object(u.a)(!1),0}}(p),n=l+h*f*t*e;s=new r.a(m,{byteLength:n,accessor:{type:p,size:t}})}return s.bind({target:35051}),Object(a.o)(m,{framebuffer:d},()=>{m.readPixels(n,i,h,f,o,p,l)}),s.unbind({target:35051}),g&&d.delete(),s}function p(t){let{sourceAttachment:e=36064,targetMaxHeight:n=Number.MAX_SAFE_INTEGER}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=h(t,{sourceAttachment:e}),{width:i,height:o}=t;for(;o>n;)({data:r,width:i,height:o}=Object(s.d)({data:r,width:i,height:o}));Object(s.a)({data:r,width:i,height:o});const a=document.createElement("canvas");a.width=i,a.height=o;const u=a.getContext("2d"),c=u.createImageData(i,o);return c.data.set(r),u.putImageData(c,0,0),a.toDataURL()}function d(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{sourceX:r=0,sourceY:i=0,targetMipmaplevel:s=0,targetInternalFormat:c=6408}=n;let{targetX:l,targetY:h,targetZ:f,width:p,height:d}=n;const{framebuffer:g,deleteFramebuffer:m}=A(t);Object(u.a)(g);const{gl:y,handle:v}=g,_=void 0!==l||void 0!==h||void 0!==f;l=l||0,h=h||0,f=f||0;const b=y.bindFramebuffer(36160,v);Object(u.a)(e);let x=null;if(e instanceof o.a&&(x=e,p=Number.isFinite(p)?p:x.width,d=Number.isFinite(d)?d:x.height,x.bind(0),e=x.target),_)switch(e){case 3553:case 34067:y.copyTexSubImage2D(e,s,l,h,r,i,p,d);break;case 35866:case 32879:Object(a.a)(y).copyTexSubImage3D(e,s,l,h,f,r,i,p,d)}else y.copyTexImage2D(e,s,c,r,i,p,d,0);return x&&x.unbind(),y.bindFramebuffer(36160,b||null),m&&g.delete(),x}function A(t){return t instanceof i.a?{framebuffer:t,deleteFramebuffer:!1}:{framebuffer:Object(l.b)(t),deleteFramebuffer:!0}}function g(t,e,n,r,i){if(t)return t;e=e||5121;return new(Object(s.c)(e,{clamped:!1}))(r*i*c(n))}n.d(e,"c",(function(){return h})),n.d(e,"d",(function(){return f})),n.d(e,"a",(function(){return p})),n.d(e,"b",(function(){return d}))},,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(21),i=n(43),o=n(44),a=n(100);async function s(t,e,n,s){Array.isArray(e)||Object(i.a)(e)||(void 0,n=e,e=void 0);const u=Object(o.a)(n);let c=t;return"string"==typeof t&&(c=await u(t)),Object(r.b)(t)&&(c=await u(t)),await Object(a.a)(c,e,n)}},function(t,e){},function(t,e,n){"use strict";var r=n(99);e.a={name:"project32",dependencies:[r.a],vs:"\nvec4 project_position_to_clipspace(\n vec3 position, vec3 position64Low, vec3 offset, out vec4 commonPosition\n) {\n vec3 projectedPosition = project_position(position, position64Low);\n mat3 rotation;\n if (project_needs_rotation(projectedPosition, rotation)) {\n // offset is specified as ENU\n // when in globe projection, rotate offset so that the ground alighs with the surface of the globe\n offset = rotation * offset;\n }\n commonPosition = vec4(projectedPosition + offset, 1.0);\n return project_common_position_to_clipspace(commonPosition);\n}\n\nvec4 project_position_to_clipspace(\n vec3 position, vec3 position64Low, vec3 offset\n) {\n vec4 commonPosition;\n return project_position_to_clipspace(position, position64Low, offset, commonPosition);\n}\n"}},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var r=n(3),i=n.n(r),o=n(4),a=n.n(o),s=n(0),u=n.n(s),c=n(59),l=function(){function t(e){i()(this,t),e&&(this.opts=e)}return a()(t,[{key:"equals",value:function(t){return this===t||this.constructor===t.constructor&&Object(c.a)(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}();u()(l,"defaultProps",{})},function(t,e,n){"use strict";n.d(e,"a",(function(){return A}));var r=n(3),i=n.n(r),o=n(4),a=n.n(o),s=n(0),u=n.n(s),c=n(50),l=n(66),h=n(28),f=n(32);function p(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return d(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 d(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=n.call(t)},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 d(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 A=function(){function t(e){i()(this,t),u()(this,"indexStarts",[0]),u()(this,"vertexStarts",[0]),u()(this,"vertexCount",0),u()(this,"instanceCount",0);var n=e.attributes,r=void 0===n?{}:n;this.typedArrayManager=l.a,this.attributes={},this._attributeDefs=r,this.opts=e,this.updateGeometry(e)}return a()(t,[{key:"updateGeometry",value:function(t){Object.assign(this.opts,t);var e=this.opts,n=e.data,r=e.buffers,i=void 0===r?{}:r,o=e.getGeometry,a=e.geometryBuffer,s=e.positionFormat,u=e.dataChanged,c=e.normalize,l=void 0===c||c;if(this.data=n,this.getGeometry=o,this.positionSize=a&&a.size||("XY"===s?2:3),this.buffers=i,this.normalize=l,a&&(Object(h.a)(n.startIndices),this.getGeometry=this.getGeometryFromBuffer(a),l||(i.positions=a)),this.geometryBuffer=i.positions,Array.isArray(u)){var f,d=p(u);try{for(d.s();!(f=d.n()).done;){var A=f.value;this._rebuildGeometry(A)}}catch(t){d.e(t)}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)?Object(c.b)(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 r,i=this.data,o=this.getGeometry,a=Object(c.a)(i,e,n),s=a.iterable,u=a.objectInfo,l=p(s);try{for(l.s();!(r=l.n()).done;){var h=r.value;u.index++,t(o?o(h,u):null,u.index)}}catch(t){l.e(t)}finally{l.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,c=void 0===u?0:u,l=s.endRow,h=void 0===l?1/0:l,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)}),c,h),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 f.a){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 g=a.value,m=a.stride/g.BYTES_PER_ELEMENT||this.positionSize;i=i||g.length/m}this._allocate(i,Boolean(t)),this.indexStarts=n,this.vertexStarts=r,this.instanceCount=i;var y={};this._forEachGeometry((function(t,o){var a=p[o]||t;y.vertexStart=r[o],y.indexStart=n[o];var s=o<r.length-1?r[o+1]:i;y.geometrySize=s-r[o],y.geometryIndex=o,e.updateGeometryAttributes(a,y)}),c,h),this.vertexCount=n[n.length-1]}}}]),t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(127),i=n(69);function o(t,e){return!!r.a.isSupported()&&(!!(i.c||null!=e&&e._nodeWorkers)&&(t.worker&&(null==e?void 0:e.worker)))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(1),i=n(73);const o={id:"request-scheduler",throttleRequests:!0,maxRequests:6};class a{constructor(t={}){Object(r.a)(this,"props",void 0),Object(r.a)(this,"stats",void 0),Object(r.a)(this,"activeRequestCount",0),Object(r.a)(this,"requestQueue",[]),Object(r.a)(this,"requestMap",new Map),Object(r.a)(this,"deferredUpdate",null),this.props={...o,...t},this.stats=new i.a({id:this.props.id}),this.stats.get("Queued Requests"),this.stats.get("Active Requests"),this.stats.get("Cancelled Requests"),this.stats.get("Queued Requests Ever"),this.stats.get("Active Requests Ever")}scheduleRequest(t,e=(()=>0)){if(!this.props.throttleRequests)return Promise.resolve({done:()=>{}});if(this.requestMap.has(t))return this.requestMap.get(t);const n={handle:t,priority:0,getPriority:e},r=new Promise(t=>(n.resolve=t,n));return this.requestQueue.push(n),this.requestMap.set(t,r),this._issueNewRequests(),r}_issueRequest(t){const{handle:e,resolve:n}=t;let r=!1;const i=()=>{r||(r=!0,this.requestMap.delete(e),this.activeRequestCount--,this._issueNewRequests())};return this.activeRequestCount++,n?n({done:i}):Promise.resolve({done:i})}_issueNewRequests(){this.deferredUpdate||(this.deferredUpdate=setTimeout(()=>this._issueNewRequestsAsync(),0))}_issueNewRequestsAsync(){this.deferredUpdate=null;const t=Math.max(this.props.maxRequests-this.activeRequestCount,0);if(0!==t){this._updateAllRequests();for(let e=0;e<t;++e){const t=this.requestQueue.shift();t&&this._issueRequest(t)}}}_updateAllRequests(){const t=this.requestQueue;for(let e=0;e<t.length;++e){const n=t[e];this._updateRequest(n)||(t.splice(e,1),this.requestMap.delete(n.handle),e--)}t.sort((t,e)=>t.priority-e.priority)}_updateRequest(t){return t.priority=t.getPriority(t.handle),!(t.priority<0)||(t.resolve(null),!1)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));const r={name:"JSON",id:"json",module:"json",version:"3.2.10",extensions:["json","geojson"],mimeTypes:["application/json"],category:"json",text:!0,parseTextSync:i,parse:async t=>i((new TextDecoder).decode(t)),options:{}};function i(t){return JSON.parse(t)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return y}));var r=n(3),i=n.n(r),o=n(4),a=n.n(o),s=n(5),u=n.n(s),c=n(6),l=n.n(c),h=n(2),f=n.n(h),p=n(0),d=n.n(p),A=n(272),g=n(12);function m(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=f()(t);if(e){var i=f()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return l()(this,n)}}var y=function(t){u()(n,t);var e=m(n);function n(){return i()(this,n),e.apply(this,arguments)}return a()(n,[{key:"getGeometry",value:function(t){return new A.a}},{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:g.e[c],angle:u,offset:o,extruded:i,coverage:a,elevationScale:r,edgeDistance:1,isWireframe:!1}).draw()}}]),n}(n(160).a);d()(y,"layerName","GridCellLayer"),d()(y,"defaultProps",{cellSize:{type:"number",min:0,value:1e3},offset:{type:"array",value:[1,1]}})},function(t,e,n){"use strict";n.d(e,"a",(function(){return T}));var r=n(3),i=n.n(r),o=n(4),a=n.n(o),s=n(5),u=n.n(s),c=n(6),l=n.n(c),h=n(2),f=n.n(h),p=n(0),d=n.n(p),A=n(20),g=n(50),m=n(189),y=n(111),v=n(112),_=n(62),b=n(174);function x(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return w(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 w(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=n.call(t)},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 w(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 E(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=f()(t);if(e){var i=f()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return l()(this,n)}}var O=[0,0,0,255],S={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:O},getLineWidth:{type:"accessor",value:1},getElevation:{type:"accessor",value:1e3},material:!0},T=function(t){u()(n,t);var e=E(n);function n(){return i()(this,n),e.apply(this,arguments)}return a()(n,[{key:"initializeState",value:function(){this.state={paths:[]},this.props.getLineDashArray&&A.a.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 Object(b.a)({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,r=n.data,i=n.getPolygon,o=n.positionFormat,a=n._normalize,s=[],u="XY"===o?2:3,c=e.startRow,l=e.endRow,h=Object(g.a)(r,c,l),f=h.iterable,p=h.objectInfo,d=x(f);try{for(d.s();!(t=d.n()).done;){var A=t.value;p.index++;var m=i(A,p);a&&(m=_.d(m,u));var y=m,v=y.holeIndices,b=m.positions||m;if(v)for(var w=0;w<=v.length;w++){var E=b.slice(v[w-1]||0,v[w]||b.length);s.push(this.getSubLayerRow({path:E},A,p.index))}else s.push(this.getSubLayerRow({path:b},A,p.index))}}catch(t){d.e(t)}finally{d.f()}return s}},{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,c=t.elevationScale,l=t.transitions,h=t.positionFormat,f=this.props,p=f.lineWidthUnits,d=f.lineWidthScale,A=f.lineWidthMinPixels,g=f.lineWidthMaxPixels,m=f.lineJointRounded,_=f.lineMiterLimit,b=f.lineDashJustified,x=this.props,w=x.getFillColor,E=x.getLineColor,S=x.getLineWidth,T=x.getLineDashArray,C=x.getElevation,P=x.getPolygon,M=x.updateTriggers,I=x.material,B=this.state,R=B.paths,k=B.pathsDiff,L=this.getSubLayerClass("fill",y.a),D=this.getSubLayerClass("stroke",v.a),j=this.shouldRenderSubLayer("fill",R)&&new L({_dataDiff:n,extruded:o,elevationScale:c,filled:i,wireframe:a,_normalize:s,_windingOrder:u,getElevation:C,getFillColor:w,getLineColor:o&&a?E:O,material:I,transitions:l},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:P});return[!o&&j,!o&&r&&this.shouldRenderSubLayer("stroke",R)&&new D({_dataDiff:k&&function(){return k},widthUnits:p,widthScale:d,widthMinPixels:A,widthMaxPixels:g,jointRounded:m,miterLimit:_,dashJustified:b,_pathType:"loop",transitions:l&&{getWidth:l.getLineWidth,getColor:l.getLineColor,getPath:l.getPolygon},getColor:this.getSubLayerAccessor(E),getWidth:this.getSubLayerAccessor(S),getDashArray:this.getSubLayerAccessor(T)},this.getSubLayerProps({id:"stroke",updateTriggers:M&&{getWidth:M.getLineWidth,getColor:M.getLineColor,getDashArray:M.getLineDashArray}}),{data:R,positionFormat:h,getPath:function(t){return t.path}}),o&&j]}}]),n}(m.a);d()(T,"layerName","PolygonLayer"),d()(T,"defaultProps",S)},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(129);function i(t){try{return JSON.parse(t)}catch(e){throw new Error('Failed to parse JSON from data starting with "'.concat(Object(r.a)(t),'"'))}}},function(t,e){e.read=function(t,e,n,r,i){var o,a,s=8*i-r-1,u=(1<<s)-1,c=u>>1,l=-7,h=n?i-1:0,f=n?-1:1,p=t[e+h];for(h+=f,o=p&(1<<-l)-1,p>>=-l,l+=s;l>0;o=256*o+t[e+h],h+=f,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=r;l>0;a=256*a+t[e+h],h+=f,l-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),o-=c}return(p?-1:1)*a*Math.pow(2,o-r)},e.write=function(t,e,n,r,i,o){var a,s,u,c=8*o-i-1,l=(1<<c)-1,h=l>>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=l):(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>=l?(s=0,a=l):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,c+=i;c>0;t[n+p]=255&a,p+=d,a/=256,c-=8);t[n+p-d]|=128*A}},function(t,e,n){"use strict";var r=n(3),i=n.n(r),o=n(4),a=n.n(o),s=n(7),u=n.n(s),c=n(5),l=n.n(c),h=n(6),f=n.n(h),p=n(2),d=n.n(p),A=n(0),g=n.n(A),m=n(27),y=n.n(m),v=n(204),_=n(220),b=n(20),x=n(157),w=n(8),E=n(295),O=n(81),S=n(75),T=n(45),C=n(10);class P{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{id:e}=t;this.id=e||Object(T.c)(this.constructor.name),this.display=!0,this.position=new O.a,this.rotation=new O.a,this.scale=new O.a(1,1,1),this.matrix=new S.a,this.userData={},this.props={},this._setScenegraphNodeProps(t)}delete(){}setProps(t){return this._setScenegraphNodeProps(t),this}toString(){return"{type: ScenegraphNode, id: ".concat(this.id,")}")}setPosition(t){return Object(C.a)(3===t.length,"setPosition requires vector argument"),this.position=t,this}setRotation(t){return Object(C.a)(3===t.length,"setRotation requires vector argument"),this.rotation=t,this}setScale(t){return Object(C.a)(3===t.length,"setScale requires vector argument"),this.scale=t,this}setMatrix(t){!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?this.matrix.copy(t):this.matrix=t}setMatrixComponents(t){let{position:e,rotation:n,scale:r,update:i=!0}=t;return e&&this.setPosition(e),n&&this.setRotation(n),r&&this.setScale(r),i&&this.updateMatrix(),this}updateMatrix(){const t=this.position,e=this.rotation,n=this.scale;return this.matrix.identity(),this.matrix.translate(t),this.matrix.rotateXYZ(e),this.matrix.scale(n),this}update(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{position:e,rotation:n,scale:r}=t;return e&&this.setPosition(e),n&&this.setRotation(n),r&&this.setScale(r),this.updateMatrix(),this}getCoordinateUniforms(t,e){Object(C.a)(t),e=e||this.matrix;const n=new S.a(t).multiplyRight(e),r=n.invert(),i=r.transpose();return{viewMatrix:t,modelMatrix:e,objectMatrix:e,worldMatrix:n,worldInverseMatrix:r,worldInverseTransposeMatrix:i}}_setScenegraphNodeProps(t){"display"in t&&(this.display=t.display),"position"in t&&this.setPosition(t.position),"rotation"in t&&this.setRotation(t.rotation),"scale"in t&&this.setScale(t.scale),"matrix"in t&&this.setMatrix(t.matrix),Object.assign(this.props,t)}}var M=n(32),I=n(61);class B extends P{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t=Array.isArray(t)?{children:t}:t;const{children:e=[]}=t;w.k.assert(e.every(t=>t instanceof P),"every child must an instance of ScenegraphNode"),super(t),this.children=e}add(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];for(const t of e)Array.isArray(t)?this.add(...t):this.children.push(t);return this}remove(t){const e=this.children,n=e.indexOf(t);return n>-1&&e.splice(n,1),this}removeAll(){return this.children=[],this}delete(){this.children.forEach(t=>t.delete()),this.removeAll(),super.delete()}traverse(t){let{worldMatrix:e=new S.a}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=new S.a(e).multiplyRight(this.matrix);for(const e of this.children)e instanceof B?e.traverse(t,{worldMatrix:n}):t(e,{worldMatrix:n})}}var R=n(294);const k={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},L={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function D(t){if(!t._animation){const e=L[t.componentType],n=k[t.type],r=n*t.count,{buffer:i,byteOffset:o}=t.bufferView.data,a=new e(i,o+(t.byteOffset||0),r);if(1===n)t._animation=Array.from(a);else{const e=[];for(let t=0;t<a.length;t+=n)e.push(Array.from(a.slice(t,t+n)));t._animation=e}}return t._animation}const j=new S.a;const F=new R.a;function z(t,e,n,r){let{input:i,interpolation:o,output:a}=e;const s=t%i[i.length-1],u=i.findIndex(t=>t>=s),c=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:w.k.warn("Bad animation path ".concat(r))()}Object(C.a)(n[r].length===a[c].length);const l=i[c],h=i[u];switch(o){case"STEP":!function(t,e,n){for(let r=0;r<n.length;r++)t[e][r]=n[r]}(n,r,a[c]);break;case"LINEAR":if(h>l){const t=(s-l)/(h-l);!function(t,e,n,r,i){if("rotation"===e){F.slerp({start:n,target:r,ratio:i});for(let n=0;n<F.length;n++)t[e][n]=F[n]}else for(let o=0;o<n.length;o++)t[e][o]=i*r[o]+(1-i)*n[o]}(n,r,a[c],a[u],t)}break;case"CUBICSPLINE":if(h>l){const t=(s-l)/(h-l),e=h-l;!function(t,e,n){let{p0:r,outTangent0:i,inTangent1:o,p1:a,tDiff:s,ratio:u}=n;for(let n=0;n<t[e].length;n++){const c=i[n]*s,l=o[n]*s;t[e][n]=(2*Math.pow(u,3)-3*Math.pow(u,2)+1)*r[n]+(Math.pow(u,3)-2*Math.pow(u,2)+u)*c+(-2*Math.pow(u,3)+3*Math.pow(u,2))*a[n]+(Math.pow(u,3)-Math.pow(u,2))*l}}(n,r,{p0:a[3*c+1],outTangent0:a[3*c+2],inTangent1:a[3*u+0],p1:a[3*u+1],tDiff:e,ratio:t})}break;default:w.k.warn("Interpolation ".concat(o," not supported"))()}}class U{constructor(t){this.startTime=0,this.playing=!0,this.speed=1,this.channels=[],Object.assign(this,t)}animate(t){if(!this.playing)return;const e=(t/1e3-this.startTime)*this.speed;this.channels.forEach(t=>{let{sampler:n,target:r,path:i}=t;z(e,n,r,i),function(t,e){if(e.matrix.identity(),t.translation&&e.matrix.translate(t.translation),t.rotation){const n=j.fromQuaternion(t.rotation);e.matrix.multiplyRight(n)}t.scale&&e.matrix.scale(t.scale)}(r,r._node)})}}class N{constructor(t){this.animations=t.animations.map((e,n)=>{const r=e.name||"Animation-".concat(n),i=e.samplers.map(e=>{let{input:n,interpolation:r="LINEAR",output:i}=e;return{input:D(t.accessors[n]),interpolation:r,output:D(t.accessors[i])}}),o=e.channels.map(e=>{let{sampler:n,target:r}=e;return{sampler:i[n],target:t.nodes[r.node],path:r.path}});return new U({name:r,channels:o})})}animate(t){this.setTime(t)}setTime(t){this.animations.forEach(e=>e.animate(t))}getAnimations(){return this.animations}}var G=n(178);class V extends P{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(e),this.onBeforeRender=null,this.AfterRender=null,t instanceof G.a?(this.model=t,this._setModelNodeProps(e)):this.model=new G.a(t,e),this.managedResources=e.managedResources||[]}setProps(t){return super.setProps(t),this._setModelNodeProps(t),this}delete(){this.model&&(this.model.delete(),this.model=null),this.managedResources.forEach(t=>t.delete()),this.managedResources=[]}draw(){return this.model.draw(...arguments)}setUniforms(){return this.model.setUniforms(...arguments),this}setAttributes(){return this.model.setAttributes(...arguments),this}updateModuleSettings(){return this.model.updateModuleSettings(...arguments),this}_setModelNodeProps(t){this.model.setProps(t)}}var H=n(233);function W(t,e){return Object(w.j)(t)?"#version 300 es\n".concat(e):e}const q={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},X={modelOptions:{},pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1};class J{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.gl=t,this.options=Object.assign({},X,e)}instantiate(t){this.gltf=t;return(t.scenes||[]).map(t=>this.createScene(t))}createAnimator(){return Array.isArray(this.gltf.animations)?new N(this.gltf):null}createScene(t){const e=(t.nodes||[]).map(t=>this.createNode(t));return new B({id:t.name||t.id,children:e})}createNode(t){if(!t._node){const e=(t.children||[]).map(t=>this.createNode(t));t.mesh&&e.push(this.createMesh(t.mesh));const n=new B({id:t.name||t.id,children:e});if(t.matrix)n.setMatrix(t.matrix);else{if(n.matrix.identity(),t.translation&&n.matrix.translate(t.translation),t.rotation){const e=(new S.a).fromQuaternion(t.rotation);n.matrix.multiplyRight(e)}t.scale&&n.matrix.scale(t.scale)}t._node=n}return t._node}createMesh(t){if(!t._mesh){const e=(t.primitives||[]).map((e,n)=>this.createPrimitive(e,n,t)),n=new B({id:t.name||t.id,children:e});t._mesh=n}return t._mesh}getVertexCount(t){w.k.warn("getVertexCount() not found")()}createPrimitive(t,e,n){return function(t,e){const{id:n,drawMode:r,vertexCount:i,attributes:o,modelOptions:a}=e,s=new H.a(t,e);w.k.info(4,"createGLTFModel defines: ",s.defines)();const u=[];u.push(...s.generatedTextures),u.push(...Object.values(o).map(t=>t.buffer));const c=new V(t,Object.assign({id:n,drawMode:r,vertexCount:i,modules:[E.a],defines:s.defines,parameters:s.parameters,vs:W(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:W(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 c.setProps({attributes:o}),c.setUniforms(s.uniforms),c}(this.gl,Object.assign({id:t.name||"".concat(n.name||n.id,"-primitive-").concat(e),drawMode:t.mode||4,vertexCount:t.indices?t.indices.count:this.getVertexCount(t.attributes),attributes:this.createAttributes(t.attributes,t.indices),material:t.material},this.options))}createAttributes(t,e){const n={};return Object.keys(t).forEach(e=>{n[e]=this.createAccessor(t[e],this.createBuffer(t[e],this.gl.ARRAY_BUFFER))}),e&&(n.indices=this.createAccessor(e,this.createBuffer(e,this.gl.ELEMENT_ARRAY_BUFFER))),w.k.info(4,"glTF Attributes",{attributes:t,indices:e,generated:n})(),n}createBuffer(t,e){t.bufferView||(t.bufferView={});const{bufferView:n}=t;return n.lumaBuffers||(n.lumaBuffers={}),n.lumaBuffers[e]||(n.lumaBuffers[e]=new M.a(this.gl,{id:"from-".concat(n.id),data:n.data||t.value,target:e})),n.lumaBuffers[e]}createAccessor(t,e){return new I.a({buffer:e,offset:t.byteOffset||0,stride:t.bufferView.byteStride||0,type:t.componentType,size:q[t.type]})}createSampler(t){return t}needsPOT(){return!1}}var Z=n(290),Q=n(67),K=n.n(Q),Y=n(39),$=n.n(Y);function tt(){return(tt=K()($.a.mark((function t(e){var n;return $.a.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,et((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)})))).apply(this,arguments)}function et(t){return nt.apply(this,arguments)}function nt(){return(nt=K()($.a.mark((function t(e){return $.a.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 rt=n(123);function it(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 ot(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?it(Object(n),!0).forEach((function(e){g()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):it(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function at(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=d()(t);if(e){var i=d()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return f()(this,n)}}n.d(e,"a",(function(){return ct}));var st=[255,255,255,255],ut={scenegraph:{type:"object",value:null,async:!0},getScene:function(t){return t&&t.scenes?"object"===y()(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},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:st},_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:[Z.a]},ct=function(t){l()(n,t);var e=at(n);function n(){return i()(this,n),e.apply(this,arguments)}return a()(n,[{key:"getShaders",value:function(){var t=[v.a,_.a];return"pbr"===this.props._lighting&&t.push(E.a),{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);\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:st,transition:!0},instanceModelMatrix:rt.a})}},{key:"updateState",value:function(t){u()(d()(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){u()(d()(n.prototype),"finalizeState",this).call(this,t),this._deleteScenegraph()}},{key:"_updateScenegraph",value:function(){var t=this,e=this.props,n=this.context.gl,r=null;if(e.scenegraph instanceof P)r={scenes:[e.scenegraph]};else if(e.scenegraph&&!e.scenegraph.gltf){var i=e.scenegraph,o=function(t,e,n){const r=new J(t,n);return{scenes:r.instantiate(e),animator:r.createAnimator()}}(n,i,this._getModelOptions());r=ot({gltf:i},o),function(t){return tt.apply(this,arguments)}(o).then((function(){return t.setNeedsRedraw()}))}else e.scenegraph&&(b.a.deprecated("ScenegraphLayer.props.scenegraph","Use GLTFLoader instead of GLTFScenegraphLoader")(),r=e.scenegraph);var a={layer:this,gl:n},s=e.getScene(r,a),u=e.getAnimator(r,a);s instanceof P?(this._deleteScenegraph(),this._applyAllAttributes(s),this._applyAnimationsProp(s,u,e._animations),this.setState({scenegraph:s,animator:u})):null!==s&&b.a.warn("invalid scenegraph:",s)()}},{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();Object.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):b.a.warn("animation ".concat(t," not found"))()}else{var o=r.find((function(e){return e.name===t}));o?Object.assign(o,e):b.a.warn("animation ".concat(t," not found"))()}}))}}},{key:"_deleteScenegraph",value:function(){var t=this.state.scenegraph;t instanceof P&&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:ot({isInstanced:!0,transpileToGLSL100:!Object(w.j)(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,c=s.sizeMinPixels,l=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:c,sizeMaxPixels:l,composeModelMatrix:Object(rt.b)(a,f),sceneModelMatrix:r,u_Camera:t.model.getUniforms().project_uCameraPosition}})}))}}}]),n}(x.a);g()(ct,"defaultProps",ut),g()(ct,"layerName","ScenegraphLayer")},function(t,e,n){"use strict";var r=n(175),i=n.n(r),o=n(3),a=n.n(o),s=n(4),u=n.n(s),c=n(7),l=n.n(c),h=n(5),f=n.n(h),p=n(6),d=n.n(p),A=n(2),g=n.n(A),m=n(0),y=n.n(m),v=n(189),_=n(174);function b(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 x(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?b(Object(n),!0).forEach((function(e){y()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):b(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function w(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:x({},t.properties[e])};for(var i in t.numericProps)r.properties[i]=t.numericProps[i].value[n];return r}(t,r,n):null}var E=n(113),O=n(161),S=n(159),T=n(112),C=n(111),P={circle:{type:O.a,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:E.a,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:S.a,props:{textSizeMaxPixels:"sizeMaxPixels",textSizeMinPixels:"sizeMinPixels",textSizeScale:"sizeScale",textSizeUnits:"sizeUnits",textBackground:"background",textBackgroundPadding:"backgroundPadding",textFontFamily:"fontFamily",textFontWeight:"fontWeight",textLineHeight:"lineHeight",textMaxWidth:"maxWidth",textOutlineColor:"outlineColor",textOutlineWidth:"outlineWidth",textWordBreak:"wordBreak",textCharacterSet:"characterSet",textBillboard:"billboard",textFontSettings:"fontSettings",getText:"getText",getTextAngle:"getAngle",getTextColor:"getColor",getTextPixelOffset:"getPixelOffset",getTextSize:"getSize",getTextAnchor:"getTextAnchor",getTextAlignmentBaseline:"getAlignmentBaseline",getTextBackgroundColor:"getBackgroundColor",getTextBorderColor:"getBorderColor",getTextBorderWidth:"getBorderWidth"}}},M={type:T.a,props:{lineWidthUnits:"widthUnits",lineWidthScale:"widthScale",lineWidthMinPixels:"widthMinPixels",lineWidthMaxPixels:"widthMaxPixels",lineJointRounded:"jointRounded",lineCapRounded:"capRounded",lineMiterLimit:"miterLimit",lineBillboard:"billboard",getLineColor:"getColor",getLineWidth:"getWidth"}},I={type:C.a,props:{extruded:"extruded",filled:"filled",wireframe:"wireframe",elevationScale:"elevationScale",material:"material",_full3d:"_full3d",getElevation:"getElevation",getFillColor:"getFillColor",getLineColor:"getLineColor"}};function B(t){var e=t.type,n=t.props,r={};for(var i in n)r[i]=e.defaultProps[n[i]];return r}function R(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(20);function L(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 c=t[u],l=c.geometry;if(l)if("GeometryCollection"===l.type){k.a.assert(Array.isArray(l.geometries),"GeoJSON does not have geometries array");for(var h=l.geometries,f=0;f<h.length;f++){var p=h[f];D(p,r,e,c,u)}}else D(l,r,e,c,u)}return r}function D(t,e,n,r,i){var o=t.type,a=t.coordinates,s=e.pointFeatures,u=e.lineFeatures,c=e.polygonFeatures,l=e.polygonOutlineFeatures;if(function(t,e){var n=j[t];k.a.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":c.push(n({geometry:t},r,i)),a.forEach((function(t){l.push(n({geometry:{type:"LineString",coordinates:t}},r,i))}));break;case"MultiPolygon":a.forEach((function(t){c.push(n({geometry:{type:"Polygon",coordinates:t}},r,i)),t.forEach((function(t){l.push(n({geometry:{type:"LineString",coordinates:t}},r,i))}))}))}else k.a.warn("".concat(o," coordinates are malformed"))()}var j={Point:1,MultiPoint:2,LineString:2,MultiLineString:3,Polygon:3,MultiPolygon:4};function F(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 z(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?F(Object(n),!0).forEach((function(e){y()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):F(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function U(t){return t.geometry.coordinates}function N(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:z(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:z(z({},i.attributes),{},{getPath:i.positions,instancePickingColors:{size:3,value:a.lines}}),properties:i.properties,numericProps:i.numericProps,featureIds:i.featureIds},n.lines._pathType="open",n.polygons.data={length:o.polygonIndices.value.length-1,startIndices:o.polygonIndices.value,attributes:z(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:z(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}n.d(e,"a",(function(){return Q}));var G=["instancePickingColors"];function V(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return H(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 H(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=n.call(t)},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 H(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 W(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=g()(t);if(e){var i=g()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return d()(this,n)}}function q(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 X(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?q(Object(n),!0).forEach((function(e){y()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):q(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var J=["points","linestrings","polygons"],Z=X(X(X(X(X(X({},B(P.circle)),B(P.icon)),B(P.text)),B(M)),B(I)),{},{stroked:!0,filled:!0,extruded:!1,wireframe:!1,_full3d:!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"}}),Q=function(t){f()(n,t);var e=W(n);function n(){return a()(this,n),e.apply(this,arguments)}return u()(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,N(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.a.assert(t.type,"GeoJSON does not have type"),t.type){case"Feature":return[t];case"FeatureCollection":return k.a.assert(Array.isArray(t.features),"GeoJSON does not have features array"),t.features;default:return[{geometry:t}]}}(e.data),i=this.getSubLayerRow.bind(this),o={},a={};if(Array.isArray(n.dataChanged)){var s=this.state.features;for(var u in s)o[u]=s[u].slice(),a[u]=[];var c,l=V(n.dataChanged);try{for(l.s();!(c=l.n()).done;){var h=c.value,f=L(r,i,h);for(var p in s)a[p].push(Object(_.a)({data:o[p],getIndex:function(t){return t.__source.index},dataRange:h,replace:f[p]}))}}catch(t){l.e(t)}finally{l.f()}}else o=L(r,i);var d=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=U,n.lines.data=i,n.lines._dataDiff=e.lineFeatures&&function(){return e.lineFeatures},n.lines.getPath=U,n.polygons.data=o,n.polygons._dataDiff=e.polygonFeatures&&function(){return e.polygonFeatures},n.polygons.getPolygon=U,n.polygonsOutline.data=a,n.polygonsOutline._dataDiff=e.polygonOutlineFeatures&&function(){return e.polygonOutlineFeatures},n.polygonsOutline.getPath=U,n}(o,a);this.setState({features:o,featuresDiff:a,layerProps:d})}},{key:"getPickingInfo",value:function(t){var e=this,r=l()(g()(n.prototype),"getPickingInfo",this).call(this,t),i=r.index,o=r.sourceLayer;return r.featureType=J.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,i=V(this.getSubLayers());try{for(i.s();!(e=i.n()).done;){var o=e.value;o.id.startsWith(n)===r&&o.updateAutoHighlight(t)}}catch(t){i.e(t)}finally{i.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.getSubLayerClass(i,I.type);if(o){var a=R(this,I.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=!e&&n&&this.shouldRenderSubLayer("polygons-stroke",r.polygonsOutline.data)&&this.getSubLayerClass("polygons-stroke",M.type),o=this.shouldRenderSubLayer("linestrings",r.lines.data)&&this.getSubLayerClass("linestrings",M.type);if(i||o){var a=R(this,M.props);return[i&&new i(a,this.getSubLayerProps({id:"polygons-stroke",updateTriggers:a.updateTriggers}),r.polygonsOutline),o&&new o(a,this.getSubLayerProps({id:"linestrings",updateTriggers:a.updateTriggers}),r.lines)]}return null}},{key:"_renderPointLayers",value:function(){var t=this.props.pointType,e=this.state,n=e.layerProps,r=e.binary,o=this.props.highlightedObjectIndex;!r&&Number.isFinite(o)&&(o=n.points.data.findIndex((function(t){return t.__source.index===o})));var a,s=[],u=V(new Set(t.split("+")));try{for(u.s();!(a=u.n()).done;){var c=a.value,l="points-".concat(c),h=P[c],f=h&&this.shouldRenderSubLayer(l,n.points.data)&&this.getSubLayerClass(l,h.type);if(f){var p=R(this,h.props),d=n.points;if("text"===c&&r){var A=d.data.attributes,g=(A.instancePickingColors,i()(A,G));d=X(X({},d),{},{data:X(X({},d.data),{},{attributes:g})})}s.push(new f(p,this.getSubLayerProps({id:l,updateTriggers:p.updateTriggers,highlightedObjectIndex:o}),d))}}}catch(t){u.e(t)}finally{u.f()}return s}},{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=w(n.data,n.index);return t(r,n)}:l()(g()(n.prototype),"getSubLayerAccessor",this).call(this,t)}}]),n}(v.a);y()(Q,"layerName","GeoJsonLayer"),y()(Q,"defaultProps",Z)},function(t,e,n){"use strict";var r=n(3),i=n.n(r),o=n(4),a=n.n(o),s=n(7),u=n.n(s),c=n(5),l=n.n(c),h=n(6),f=n.n(h),p=n(2),d=n.n(p),A=n(0),g=n.n(A),m=n(204),y=n(220),v=n(12),_=n(157),b=n(178),x=n(58);function w(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 E(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?w(Object(n),!0).forEach((function(e){g()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function O(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=d()(t);if(e){var i=d()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return f()(this,n)}}n.d(e,"a",(function(){return C}));var S=[0,0,0,255],T={getSourcePosition:{type:"accessor",value:function(t){return t.sourcePosition}},getTargetPosition:{type:"accessor",value:function(t){return t.targetPosition}},getSourceColor:{type:"accessor",value:S},getTargetColor:{type:"accessor",value:S},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}},C=function(t){l()(n,t);var e=O(n);function n(){return i()(this,n),e.apply(this,arguments)}return a()(n,[{key:"getShaders",value:function(){return u()(d()(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;\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;\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.0) - 180.;\n target_world.x = mod(target_world.x + 180., 360.0) - 180.;\n\n float deltaLng = target_world.x - source_world.x;\n if (deltaLng > 180.) target_world.x -= 360.;\n if (deltaLng < -180.) source_world.x -= 360.;\n }\n source = project_position(source_world, instanceSourcePositions64Low);\n target = project_position(target_world, instanceTargetPositions64Low);\n\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:[m.a,y.a]})}},{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:S},instanceTargetColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getTargetColor",defaultValue:S},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(u()(d()(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:v.e[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 r=new b.a(t,E(E({},this.getShaders()),{},{id:this.props.id,geometry:new x.a({drawMode:5,attributes:{positions:new Float32Array(e)}}),isInstanced:!0}));return r.setUniforms({numSegments:50}),r}}]),n}(_.a);g()(C,"layerName","ArcLayer"),g()(C,"defaultProps",T)},function(t,e,n){"use strict";var r=n(3),i=n.n(r),o=n(4),a=n.n(o),s=n(7),u=n.n(s),c=n(5),l=n.n(c),h=n(6),f=n.n(h),p=n(2),d=n.n(p),A=n(0),g=n.n(A),m=n(204),y=n(220),v=n(12),_=n(157),b=n(178),x=n(58);function w(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 E(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?w(Object(n),!0).forEach((function(e){g()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function O(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=d()(t);if(e){var i=d()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return f()(this,n)}}n.d(e,"a",(function(){return T}));var S={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}},T=function(t){l()(n,t);var e=O(n);function n(){return i()(this,n),e.apply(this,arguments)}return a()(n,[{key:"getShaders",value:function(){return u()(d()(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.0) - 180.;\n target_world.x = mod(target_world.x + 180., 360.0) - 180.;\n float deltaLng = target_world.x - source_world.x;\n\n if (deltaLng * useShortestPath > 180.) {\n source_world.x += 360. * useShortestPath;\n source_world = splitLine(source_world, target_world, 180. * useShortestPath);\n source_world_64low = vec3(0.0);\n } else if (deltaLng * useShortestPath < -180.) {\n target_world.x += 360. * useShortestPath;\n target_world = splitLine(source_world, target_world, 180. * useShortestPath);\n target_world_64low = vec3(0.0);\n } else if (useShortestPath < 0.) {\n // 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:[m.a,y.a]})}},{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(u()(d()(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:v.e[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 b.a(t,E(E({},this.getShaders()),{},{id:this.props.id,geometry:new x.a({drawMode:5,attributes:{positions:new Float32Array([0,-1,0,0,1,0,1,-1,0,1,1,0])}}),isInstanced:!0}))}}]),n}(_.a);g()(T,"layerName","LineLayer"),g()(T,"defaultProps",S)},function(t,e,n){"use strict";var r=n(3),i=n.n(r),o=n(4),a=n.n(o),s=n(7),u=n.n(s),c=n(5),l=n.n(c),h=n(6),f=n.n(h),p=n(2),d=n.n(p),A=n(0),g=n.n(A),m=n(204),y=n(221),v=n(220),_=n(12),b=n(157),x=n(178),w=n(58);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}function O(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){g()(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}function S(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=d()(t);if(e){var i=d()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return f()(this,n)}}n.d(e,"a",(function(){return M}));var T=[0,0,0,255],C=[0,0,1],P={sizeUnits:"pixels",pointSize:{type:"number",min:0,value:10},getPosition:{type:"accessor",value:function(t){return t.position}},getNormal:{type:"accessor",value:C},getColor:{type:"accessor",value:T},material:!0,radiusPixels:{deprecatedFor:"pointSize"}};var M=function(t){l()(n,t);var e=S(n);function n(){return i()(this,n),e.apply(this,arguments)}return a()(n,[{key:"getShaders",value:function(){return u()(d()(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:[m.a,y.a,v.a]})}},{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:C},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getColor",defaultValue:T}})}},{key:"updateState",value:function(t){var e,r,i,o=t.changeFlags,a=t.props;if(u()(d()(n.prototype),"updateState",this).call(this,t),o.extensionsChanged){var s,c=this.context.gl;null===(s=this.state.model)||void 0===s||s.delete(),this.state.model=this._getModel(c),this.getAttributeManager().invalidateAll()}o.dataChanged&&(e=a.data,r=e.header,i=e.attributes,r&&i&&(e.length=r.vertexCount,i.POSITION&&(i.instancePositions=i.POSITION),i.NORMAL&&(i.instanceNormals=i.NORMAL),i.COLOR_0&&(i.instanceColors=i.COLOR_0)))}},{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:_.e[i],radiusPixels:r}).draw()}},{key:"_getModel",value:function(t){for(var e=[],n=0;n<3;n++){var r=n/3*Math.PI*2;e.push(2*Math.cos(r),2*Math.sin(r),0)}return new x.a(t,O(O({},this.getShaders()),{},{id:this.props.id,geometry:new w.a({drawMode:4,attributes:{positions:new Float32Array(e)}}),isInstanced:!0}))}}]),n}(b.a);g()(M,"layerName","PointCloudLayer"),g()(M,"defaultProps",P)},function(t,e,n){"use strict";var r=n(3),i=n.n(r),o=n(4),a=n.n(o),s=n(7),u=n.n(s),c=n(5),l=n.n(c),h=n(6),f=n.n(h),p=n(2),d=n.n(p),A=n(0),g=n.n(A),m=n(20),y=n(204),v=n(221),_=n(220),b=n(157),x=n(58),w=n(8),E=n(102),O=n(178),S=n(234),T=n(181),C=n(123);function P(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 M(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?P(Object(n),!0).forEach((function(e){g()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):P(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function I(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=d()(t);if(e){var i=d()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return f()(this,n)}}function B(t,e){(t.COLOR_0||t.colors)&&e||(t.colors={constant:!0,value:new Float32Array([1,1,1])}),m.a.assert(t.positions||t.POSITION,'no "postions" or "POSITION" attribute in mesh')}function R(t,e){if(t.attributes)return B(t.attributes,e),t instanceof x.a?t:new x.a(t);if(t.positions||t.POSITION)return B(t,e),new x.a({attributes:t});throw Error("Invalid mesh")}n.d(e,"a",(function(){return L}));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:[]}},L=function(t){l()(n,t);var e=I(n);function n(){return i()(this,n),e.apply(this,arguments)}return a()(n,[{key:"getShaders",value:function(){var t=!Object(w.j)(this.context.gl),e={};return Object(S.b)(this.context.gl,T.a.GLSL_DERIVATIVES)&&(e.DERIVATIVES_AVAILABLE=1),u()(d()(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:[y.a,v.b,_.a],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:C.a}),this.setState({emptyTexture:new E.a(this.context.gl,{data:new Uint8Array(4),width:1,height:1})})}},{key:"updateState",value:function(t){u()(d()(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){u()(d()(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||Object(C.b)(n,o),flatShading:!this.state.hasNormals}).draw()}}},{key:"getModel",value:function(t){var e=new O.a(this.context.gl,M(M({},this.getShaders()),{},{id:this.props.id,geometry:R(t,this.props._useMeshColors),isInstanced:!0})),n=this.props.texture,r=this.state.emptyTexture;return e.setUniforms({sampler:n||r,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}(b.a);g()(L,"defaultProps",k),g()(L,"layerName","SimpleMeshLayer")},function(t,e,n){"use strict";var r=n(0),i=n.n(r);const o={pickingSelectedColor:null,pickingHighlightColor:new Uint8Array([0,255,255,255]),pickingActive:!1,pickingAttribute:!1};const a={name:"picking",vs:"uniform bool picking_uActive;\nuniform bool picking_uAttribute;\nuniform vec3 picking_uSelectedColor;\nuniform bool picking_uSelectedColorValid;\n\nout vec4 picking_vRGBcolor_Avalid;\n\nconst float COLOR_SCALE = 1. / 255.;\n\nbool picking_isColorValid(vec3 color) {\n return dot(color, vec3(1.0)) > 0.001;\n}\n\nbool isVertexPicked(vec3 vertexColor) {\n return\n picking_uSelectedColorValid &&\n !picking_isColorValid(abs(vertexColor - picking_uSelectedColor));\n}\n\nvoid picking_setPickingColor(vec3 pickingColor) {\n if (picking_uActive) {\n picking_vRGBcolor_Avalid.a = float(picking_isColorValid(pickingColor));\n\n if (!picking_uAttribute) {\n picking_vRGBcolor_Avalid.rgb = pickingColor * COLOR_SCALE;\n }\n } else {\n picking_vRGBcolor_Avalid.a = float(isVertexPicked(pickingColor));\n }\n}\n\nvoid picking_setPickingAttribute(float value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.r = value;\n }\n}\nvoid picking_setPickingAttribute(vec2 value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.rg = value;\n }\n}\nvoid picking_setPickingAttribute(vec3 value) {\n if (picking_uAttribute) {\n picking_vRGBcolor_Avalid.rgb = value;\n }\n}\n",fs:"uniform bool picking_uActive;\nuniform vec3 picking_uSelectedColor;\nuniform vec4 picking_uHighlightColor;\n\nin vec4 picking_vRGBcolor_Avalid;\nvec4 picking_filterHighlightColor(vec4 color) {\n if (picking_uActive) {\n return color;\n }\n bool selected = bool(picking_vRGBcolor_Avalid.a);\n\n if (selected) {\n float highLightAlpha = picking_uHighlightColor.a;\n float blendedAlpha = highLightAlpha + color.a * (1.0 - highLightAlpha);\n float highLightRatio = highLightAlpha / blendedAlpha;\n\n vec3 blendedRGB = mix(color.rgb, picking_uHighlightColor.rgb, highLightRatio);\n return vec4(blendedRGB, blendedAlpha);\n } else {\n return color;\n }\n}\nvec4 picking_filterPickingColor(vec4 color) {\n if (picking_uActive) {\n if (picking_vRGBcolor_Avalid.a == 0.0) {\n discard;\n }\n return picking_vRGBcolor_Avalid;\n }\n return color;\n}\nvec4 picking_filterColor(vec4 color) {\n vec4 highightColor = picking_filterHighlightColor(color);\n return picking_filterPickingColor(highightColor);\n}\n\n",getUniforms:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o;const e={};if(void 0!==t.pickingSelectedColor)if(t.pickingSelectedColor){const n=t.pickingSelectedColor.slice(0,3);e.picking_uSelectedColorValid=1,e.picking_uSelectedColor=n}else e.picking_uSelectedColorValid=0;if(t.pickingHighlightColor){const n=Array.from(t.pickingHighlightColor,t=>t/255);Number.isFinite(n[3])||(n[3]=1),e.picking_uHighlightColor=n}return void 0!==t.pickingActive&&(e.picking_uActive=Boolean(t.pickingActive),e.picking_uAttribute=Boolean(t.pickingAttribute)),e}};function s(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}e.a=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?s(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({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 "}}},a)},function(t,e,n){"use strict";var r=n(138),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; 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";n.d(e,"a",(function(){return u})),n.d(e,"b",(function(){return c}));const o={};function a(t){const{ambient:e=.35,diffuse:n=.6,shininess:r=32,specularColor:i=[30,30,30]}=t;return{lighting_uAmbient:e,lighting_uDiffuse:n,lighting_uShininess:r,lighting_uSpecularColor:i.map(t=>t/255)}}function s(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o;if(!("material"in t))return{};const{material:e}=t;return e?a(e):{lighting_uEnabled:!1}}const u={name:"gouraud-lighting",dependencies:[r.a],vs:i,defines:{LIGHTING_VERTEX:1},getUniforms:s},c={name:"phong-lighting",dependencies:[r.a],fs:i,defines:{LIGHTING_FRAGMENT:1},getUniforms:s}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u})),n.d(e,"b",(function(){return c}));var r=n(102),i=n(223),o=n(224),a=n(71),s=n(10);function u(t,e){Object(s.a)(t instanceof r.a||t instanceof i.a||t instanceof o.a);const n=t.constructor,{gl:a,width:u,height:c,format:l,type:h,dataFormat:f,border:p,mipmaps:d}=t;return new n(a,Object.assign({width:u,height:c,format:l,type:h,dataFormat:f,border:p,mipmaps:d},e))}function c(t,e){const{gl:n,width:r,height:i,id:o}=t;return new a.a(n,Object.assign({},e,{id:"framebuffer-for-".concat(o),width:r,height:i,attachments:{36064:t}}))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(8),i=n(52);const o=[34069,34070,34071,34072,34073,34074];class a extends i.a{get[Symbol.toStringTag](){return"TextureCube"}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(r.b)(t),super(t,Object.assign({},e,{target:34067})),this.initialize(e),Object.seal(this)}initialize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{mipmaps:e=!0,parameters:n={}}=t;return this.opts=t,this.setCubeMapImageData(t).then(()=>{this.loaded=!0,e&&this.generateMipmap(t),this.setParameters(n)}),this}subImage(t){let{face:e,data:n,x:r=0,y:i=0,mipmapLevel:o=0}=t;return this._subImage({target:e,data:n,x:r,y:i,mipmapLevel:o})}async setCubeMapImageData(t){let{width:e,height:n,pixels:i,data:a,border:s=0,format:u=6408,type:c=5121}=t;const{gl:l}=this,h=i||a,f=await Promise.all(o.map(t=>{const e=h[t];return Promise.all(Array.isArray(e)?e:[e])}));this.bind(),o.forEach((t,i)=>{f[i].length>1&&!1!==this.opts.mipmaps&&r.k.warn("".concat(this.id," has mipmap and multiple LODs."))(),f[i].forEach((r,i)=>{e&&n?l.texImage2D(t,i,u,e,n,s,u,c,r):l.texImage2D(t,i,u,u,c,r)})}),this.unbind()}setImageDataForFace(t){const{face:e,width:n,height:r,pixels:i,data:o,border:a=0,format:s=6408,type:u=5121}=t,{gl:c}=this,l=i||o;return this.bind(),l instanceof Promise?l.then(n=>this.setImageDataForFace(Object.assign({},t,{face:e,data:n,pixels:n}))):this.width||this.height?c.texImage2D(e,0,s,n,r,a,s,u,l):c.texImage2D(e,0,s,s,u,l),this}}a.FACES=o},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(8),i=n(52),o=n(79),a=n(32);class s extends i.a{get[Symbol.toStringTag](){return"Texture3D"}static isSupported(t){return Object(r.j)(t)}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(r.a)(t),e=Object.assign({depth:1},e,{target:32879,unpackFlipY:!1}),super(t,e),this.initialize(e),Object.seal(this)}setImageData(t){let{level:e=0,dataFormat:n=6408,width:i,height:s,depth:u=1,border:c=0,format:l,type:h=5121,offset:f=0,data:p,parameters:d={}}=t;if(this._trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle),Object(r.o)(this.gl,d,()=>{ArrayBuffer.isView(p)&&this.gl.texImage3D(this.target,e,n,i,s,u,c,l,h,p),p instanceof a.a&&(this.gl.bindBuffer(35052,p.handle),this.gl.texImage3D(this.target,e,n,i,s,u,c,l,h,f))}),p&&p.byteLength)this._trackAllocatedMemory(p.byteLength,"Texture");else{const t=o.a[this.dataFormat]||4,e=o.c[this.type]||1;this._trackAllocatedMemory(this.width*this.height*this.depth*t*e,"Texture")}return this.loaded=!0,this}}},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return i}));var r=n(226);function i(){return!("object"==typeof t&&"[object process]"===String(t)&&!t.browser)||Object(r.a)()}}).call(this,n(63))},function(t,e,n){"use strict";(function(t){function r(e){if("undefined"!=typeof window&&"object"==typeof window.process&&"renderer"===window.process.type)return!0;if(void 0!==t&&"object"==typeof t.versions&&Boolean(t.versions.electron))return!0;const n="object"==typeof navigator&&"string"==typeof navigator.userAgent&&navigator.userAgent,r=e||n;return!!(r&&r.indexOf("Electron")>=0)}n.d(e,"a",(function(){return r}))}).call(this,n(63))},function(t,e){t.exports=function(t){var e;if("undefined"!=typeof Symbol){if(Symbol.asyncIterator&&null!=(e=t[Symbol.asyncIterator]))return e.call(t);if(Symbol.iterator&&null!=(e=t[Symbol.iterator]))return e.call(t)}throw new TypeError("Object is not async iterable")}},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return f}));var r=n(229),i=n(230),o=n(1),a=n(29),s=n.n(a),u=n(106);var c={container:s.a.object,gl:s.a.object,mapboxApiAccessToken:s.a.string,mapboxApiUrl:s.a.string,attributionControl:s.a.bool,preserveDrawingBuffer:s.a.bool,reuseMaps:s.a.bool,transformRequest:s.a.func,mapOptions:s.a.object,mapStyle:s.a.oneOfType([s.a.string,s.a.object]),visible:s.a.bool,asyncRender:s.a.bool,onLoad:s.a.func,onError:s.a.func,width:s.a.number,height:s.a.number,viewState:s.a.object,longitude:s.a.number,latitude:s.a.number,zoom:s.a.number,bearing:s.a.number,pitch:s.a.number,altitude:s.a.number},l={container:u.a.body,mapboxApiAccessToken:function(){var e=null;if("undefined"!=typeof window&&window.location){var n=window.location.search.match(/access_token=([^&\/]*)/);e=n&&n[1]}e||void 0===t||(e=e||t.env.MapboxAccessToken||t.env.REACT_APP_MAPBOX_ACCESS_TOKEN);return e||"no-token"}(),mapboxApiUrl:"https://api.mapbox.com",preserveDrawingBuffer:!1,attributionControl:!0,reuseMaps:!1,mapOptions:{},mapStyle:"mapbox://styles/mapbox/light-v8",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 h(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"component";t.debug&&s.a.checkPropTypes(c,t,"prop",e)}var f=function(){function t(e){var n=this;if(Object(r.a)(this,t),Object(o.a)(this,"mapboxgl",void 0),Object(o.a)(this,"props",l),Object(o.a)(this,"_map",null),Object(o.a)(this,"width",0),Object(o.a)(this,"height",0),Object(o.a)(this,"_fireLoadEvent",(function(){n.props.onLoad({type:"load",target:n._map})})),!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 Object(i.a)(t,[{key:"finalize",value:function(){return this._destroy(),this}},{key:"setProps",value:function(t){return this._update(this.props,t),this}},{key:"resize",value:function(){return this._map.resize(),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(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: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",e.onLoad),this._map.on("error",e.onError)}return this}},{key:"_destroy",value:function(){this._map&&(t.savedMap?this._map.remove():(t.savedMap=this._map,this._map.off("load",this.props.onLoad),this._map.off("error",this.props.onError),this._map.off("styledata",this._fireLoadEvent)),this._map=null)}},{key:"_initialize",value:function(t){var e=this;h(t=Object.assign({},l,t),"Mapbox"),this.mapboxgl.accessToken=t.mapboxApiAccessToken||l.mapboxApiAccessToken,this.mapboxgl.baseApiUrl=t.mapboxApiUrl,this._create(t);var n=t.container;Object.defineProperty(n,"offsetWidth",{get:function(){return e.width}}),Object.defineProperty(n,"clientWidth",{get:function(){return e.width}}),Object.defineProperty(n,"offsetHeight",{get:function(){return e.height}}),Object.defineProperty(n,"clientHeight",{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){h(e=Object.assign({},this.props,e),"Mapbox");var n=this._updateMapViewport(t,e),r=this._updateMapSize(t,e);e.asyncRender||!n&&!r||this.redraw(),this.props=e}}},{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.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,c=e.altitude;return{longitude:n,latitude:r,zoom:i,pitch:a,bearing:u,altitude:void 0===c?1.5:c}}},{key:"_checkStyleSheet",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"0.47.0";if(void 0!==u.a)try{var e=u.a.createElement("div");e.className="mapboxgl-map",e.style.display="none",u.a.body.append(e);var n="static"!==window.getComputedStyle(e).position;if(!n){var r=u.a.createElement("link");r.setAttribute("rel","stylesheet"),r.setAttribute("type","text/css"),r.setAttribute("href","https://api.tiles.mapbox.com/mapbox-gl-js/v".concat(t,"/mapbox-gl.css")),u.a.head.append(r)}}catch(t){}}},{key:"_viewStateToMapboxProps",value:function(t){return{center:[t.longitude,t.latitude],zoom:t.zoom,bearing:t.bearing,pitch:t.pitch}}}]),t}();Object(o.a)(f,"initialized",!1),Object(o.a)(f,"propTypes",c),Object(o.a)(f,"defaultProps",l),Object(o.a)(f,"savedMap",null)}).call(this,n(63))},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function i(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}n.d(e,"a",(function(){return i}))},function(t,e,n){"use strict";function r(t,e,n){n=n||2;var r,o,s,u,c,l,p,d=e&&e.length,g=d?e[0]*n:t.length,m=i(t,0,g,n,!0),y=[];if(!m||m.next===m.prev)return y;if(d&&(m=function(t,e,n,r){var o,a,s,u,c,l=[];for(o=0,a=e.length;o<a;o++)s=e[o]*r,u=o<a-1?e[o+1]*r:t.length,(c=i(t,s,u,r,!1))===c.next&&(c.steiner=!0),l.push(A(c));for(l.sort(h),o=0;o<l.length;o++)n=f(l[o],n);return n}(t,e,m,n)),t.length>80*n){r=s=t[0],o=u=t[1];for(var v=n;v<g;v+=n)(c=t[v])<r&&(r=c),(l=t[v+1])<o&&(o=l),c>s&&(s=c),l>u&&(u=l);p=0!==(p=Math.max(s-r,u-o))?32767/p:0}return a(m,y,n,r,o,p,0),y}function i(t,e,n,r,i){var o,a;if(i===C(t,e,n,r)>0)for(o=e;o<n;o+=r)a=O(o,t[o],t[o+1],a);else for(o=n-r;o>=e;o-=r)a=O(o,t[o],t[o+1],a);return a&&v(a,a.next)&&(S(a),a=a.next),a}function o(t,e){if(!t)return t;e||(e=t);var n,r=t;do{if(n=!1,r.steiner||!v(r,r.next)&&0!==y(r.prev,r,r.next))r=r.next;else{if(S(r),(r=e=r.prev)===r.next)break;n=!0}}while(n||r!==e);return e}function a(t,e,n,r,i,h,f){if(t){!f&&h&&function(t,e,n,r){var i=t;do{0===i.z&&(i.z=d(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,c=1;do{for(n=t,t=null,o=null,a=0;n;){for(a++,r=n,s=0,e=0;e<c&&(s++,r=r.nextZ);e++);for(u=c;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,c*=2}while(a>1)}(i)}(t,r,i,h);for(var p,A,g=t;t.prev!==t.next;)if(p=t.prev,A=t.next,h?u(t,r,i,h):s(t))e.push(p.i/n|0),e.push(t.i/n|0),e.push(A.i/n|0),S(t),t=A.next,g=A.next;else if((t=A)===g){f?1===f?a(t=c(o(t),e,n),e,n,r,i,h,2):2===f&&l(t,e,n,r,i,h):a(o(t),e,n,r,i,h,1);break}}}function s(t){var e=t.prev,n=t,r=t.next;if(y(e,n,r)>=0)return!1;for(var i=e.x,o=n.x,a=r.x,s=e.y,u=n.y,c=r.y,l=i<o?i<a?i:a:o<a?o:a,h=s<u?s<c?s:c:u<c?u:c,f=i>o?i>a?i:a:o>a?o:a,p=s>u?s>c?s:c:u>c?u:c,d=r.next;d!==e;){if(d.x>=l&&d.x<=f&&d.y>=h&&d.y<=p&&g(i,s,o,u,a,c,d.x,d.y)&&y(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}function u(t,e,n,r){var i=t.prev,o=t,a=t.next;if(y(i,o,a)>=0)return!1;for(var s=i.x,u=o.x,c=a.x,l=i.y,h=o.y,f=a.y,p=s<u?s<c?s:c:u<c?u:c,A=l<h?l<f?l:f:h<f?h:f,m=s>u?s>c?s:c:u>c?u:c,v=l>h?l>f?l:f:h>f?h:f,_=d(p,A,e,n,r),b=d(m,v,e,n,r),x=t.prevZ,w=t.nextZ;x&&x.z>=_&&w&&w.z<=b;){if(x.x>=p&&x.x<=m&&x.y>=A&&x.y<=v&&x!==i&&x!==a&&g(s,l,u,h,c,f,x.x,x.y)&&y(x.prev,x,x.next)>=0)return!1;if(x=x.prevZ,w.x>=p&&w.x<=m&&w.y>=A&&w.y<=v&&w!==i&&w!==a&&g(s,l,u,h,c,f,w.x,w.y)&&y(w.prev,w,w.next)>=0)return!1;w=w.nextZ}for(;x&&x.z>=_;){if(x.x>=p&&x.x<=m&&x.y>=A&&x.y<=v&&x!==i&&x!==a&&g(s,l,u,h,c,f,x.x,x.y)&&y(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;w&&w.z<=b;){if(w.x>=p&&w.x<=m&&w.y>=A&&w.y<=v&&w!==i&&w!==a&&g(s,l,u,h,c,f,w.x,w.y)&&y(w.prev,w,w.next)>=0)return!1;w=w.nextZ}return!0}function c(t,e,n){var r=t;do{var i=r.prev,a=r.next.next;!v(i,a)&&_(i,r,r.next,a)&&w(i,a)&&w(a,i)&&(e.push(i.i/n|0),e.push(r.i/n|0),e.push(a.i/n|0),S(r),S(r.next),r=t=a),r=r.next}while(r!==t);return o(r)}function l(t,e,n,r,i,s){var u=t;do{for(var c=u.next.next;c!==u.prev;){if(u.i!==c.i&&m(u,c)){var l=E(u,c);return u=o(u,u.next),l=o(l,l.next),a(u,e,n,r,i,s,0),void a(l,e,n,r,i,s,0)}c=c.next}u=u.next}while(u!==t)}function h(t,e){return t.x-e.x}function f(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);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,c=n,l=n.x,h=n.y,f=1/0;r=n;do{i>=r.x&&r.x>=l&&i!==r.x&&g(o<h?i:a,o,l,h,o<h?a:i,o,r.x,r.y)&&(u=Math.abs(o-r.y)/(i-r.x),w(r,t)&&(u<f||u===f&&(r.x>n.x||r.x===n.x&&p(n,r)))&&(n=r,f=u)),r=r.next}while(r!==c);return n}(t,e);if(!n)return e;var r=E(n,t);return o(r,r.next),o(n,n.next)}function p(t,e){return y(t.prev,t,e.prev)<0&&y(e.next,t,t.next)<0}function d(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 A(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 g(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 m(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&&_(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(w(t,e)&&w(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)&&(y(t.prev,t,e.prev)||y(t,e.prev,e))||v(t,e)&&y(t.prev,t,t.next)>0&&y(e.prev,e,e.next)>0)}function y(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function v(t,e){return t.x===e.x&&t.y===e.y}function _(t,e,n,r){var i=x(y(t,e,n)),o=x(y(t,e,r)),a=x(y(n,r,t)),s=x(y(n,r,e));return i!==o&&a!==s||(!(0!==i||!b(t,n,e))||(!(0!==o||!b(t,r,e))||(!(0!==a||!b(n,t,r))||!(0!==s||!b(n,e,r)))))}function b(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 x(t){return t>0?1:t<0?-1:0}function w(t,e){return y(t.prev,t,t.next)<0?y(t,e,t.next)>=0&&y(t,t.prev,e)>=0:y(t,e,t.prev)<0||y(t,t.next,e)<0}function E(t,e){var n=new T(t.i,t.x,t.y),r=new T(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 O(t,e,n,r){var i=new T(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 S(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 T(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 C(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=r,t.exports.default=r,r.deviation=function(t,e,n,r){var i=e&&e.length,o=i?e[0]*n:t.length,a=Math.abs(C(t,0,o,n));if(i)for(var s=0,u=e.length;s<u;s++){var c=e[s]*n,l=s<u-1?e[s+1]*n:t.length;a-=Math.abs(C(t,c,l,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)},r.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}},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return A}));new Uint8Array([0]);const r=[171,75,84,88,32,50,48,187,13,10,26,10];var i,o,a,s,u,c,l,h;!function(t){t[t.NONE=0]="NONE",t[t.BASISLZ=1]="BASISLZ",t[t.ZSTD=2]="ZSTD",t[t.ZLIB=3]="ZLIB"}(i||(i={})),function(t){t[t.BASICFORMAT=0]="BASICFORMAT"}(o||(o={})),function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.ETC1S=163]="ETC1S",t[t.UASTC=166]="UASTC"}(a||(a={})),function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.SRGB=1]="SRGB"}(s||(s={})),function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.LINEAR=1]="LINEAR",t[t.SRGB=2]="SRGB",t[t.ITU=3]="ITU",t[t.NTSC=4]="NTSC",t[t.SLOG=5]="SLOG",t[t.SLOG2=6]="SLOG2"}(u||(u={})),function(t){t[t.ALPHA_STRAIGHT=0]="ALPHA_STRAIGHT",t[t.ALPHA_PREMULTIPLIED=1]="ALPHA_PREMULTIPLIED"}(c||(c={})),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"}(h||(h={}));class f{constructor(){this.vkFormat=0,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=i.NONE,this.levels=[],this.dataFormatDescriptor=[{vendorId:0,descriptorType:o.BASICFORMAT,versionNumber:2,descriptorBlockSize:40,colorModel:a.UNSPECIFIED,colorPrimaries:s.SRGB,transferFunction:s.SRGB,flags:c.ALPHA_STRAIGHT,texelBlockDimension:{x:4,y:4,z:1,w:1},bytesPlane:[],samples:[]}],this.keyValue={},this.globalData=null}}class p{constructor(t,e,n,r){this._dataView=new DataView(t.buffer,t.byteOffset+e,n),this._littleEndian=r,this._offset=0}_nextUint8(){const t=this._dataView.getUint8(this._offset);return this._offset+=1,t}_nextUint16(){const t=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,t}_nextUint32(){const t=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,t}_nextUint64(){const t=this._dataView.getUint32(this._offset,this._littleEndian)+2**32*this._dataView.getUint32(this._offset+4,this._littleEndian);return this._offset+=8,t}_skip(t){return this._offset+=t,this}_scan(t,e=0){const n=this._offset;let r=0;for(;this._dataView.getUint8(this._offset)!==e&&r<t;)r++,this._offset++;return r<t&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+n,r)}}function d(e){return"undefined"!=typeof TextDecoder?(new TextDecoder).decode(e):t.from(e).toString("utf8")}function A(t){const e=new Uint8Array(t.buffer,t.byteOffset,r.length);if(e[0]!==r[0]||e[1]!==r[1]||e[2]!==r[2]||e[3]!==r[3]||e[4]!==r[4]||e[5]!==r[5]||e[6]!==r[6]||e[7]!==r[7]||e[8]!==r[8]||e[9]!==r[9]||e[10]!==r[10]||e[11]!==r[11])throw new Error("Missing KTX 2.0 identifier.");const n=new f,i=17*Uint32Array.BYTES_PER_ELEMENT,o=new p(t,r.length,i,!0);n.vkFormat=o._nextUint32(),n.typeSize=o._nextUint32(),n.pixelWidth=o._nextUint32(),n.pixelHeight=o._nextUint32(),n.pixelDepth=o._nextUint32(),n.layerCount=o._nextUint32(),n.faceCount=o._nextUint32();const a=o._nextUint32();n.supercompressionScheme=o._nextUint32();const s=o._nextUint32(),u=o._nextUint32(),c=o._nextUint32(),l=o._nextUint32(),h=o._nextUint64(),A=o._nextUint64(),g=new p(t,r.length+i,3*a*8,!0);for(let e=0;e<a;e++)n.levels.push({levelData:new Uint8Array(t.buffer,t.byteOffset+g._nextUint64(),g._nextUint64()),uncompressedByteLength:g._nextUint64()});const m=new p(t,s,u,!0),y={vendorId:m._skip(4)._nextUint16(),descriptorType:m._nextUint16(),versionNumber:m._nextUint16(),descriptorBlockSize:m._nextUint16(),colorModel:m._nextUint8(),colorPrimaries:m._nextUint8(),transferFunction:m._nextUint8(),flags:m._nextUint8(),texelBlockDimension:{x:m._nextUint8()+1,y:m._nextUint8()+1,z:m._nextUint8()+1,w:m._nextUint8()+1},bytesPlane:[m._nextUint8(),m._nextUint8(),m._nextUint8(),m._nextUint8(),m._nextUint8(),m._nextUint8(),m._nextUint8(),m._nextUint8()],samples:[]},v=(y.descriptorBlockSize/4-6)/4;for(let t=0;t<v;t++)y.samples[t]={bitOffset:m._nextUint16(),bitLength:m._nextUint8(),channelID:m._nextUint8(),samplePosition:[m._nextUint8(),m._nextUint8(),m._nextUint8(),m._nextUint8()],sampleLower:m._nextUint32(),sampleUpper:m._nextUint32()};n.dataFormatDescriptor.length=0,n.dataFormatDescriptor.push(y);const _=new p(t,c,l,!0);for(;_._offset<l;){const t=_._nextUint32(),e=_._scan(t),r=d(e),i=_._scan(t-e.byteLength);n.keyValue[r]=r.match(/^ktx/i)?d(i):i,t%4&&_._skip(4-t%4)}if(A<=0)return n;const b=new p(t,h,A,!0),x=b._nextUint16(),w=b._nextUint16(),E=b._nextUint32(),O=b._nextUint32(),S=b._nextUint32(),T=b._nextUint32(),C=[];for(let t=0;t<a;t++)C.push({imageFlags:b._nextUint32(),rgbSliceByteOffset:b._nextUint32(),rgbSliceByteLength:b._nextUint32(),alphaSliceByteOffset:b._nextUint32(),alphaSliceByteLength:b._nextUint32()});const P=h+b._offset,M=P+E,I=M+O,B=I+S,R=new Uint8Array(t.buffer,t.byteOffset+P,E),k=new Uint8Array(t.buffer,t.byteOffset+M,O),L=new Uint8Array(t.buffer,t.byteOffset+I,S),D=new Uint8Array(t.buffer,t.byteOffset+B,T);return n.globalData={endpointCount:x,selectorCount:w,imageDescs:C,endpointsData:R,selectorsData:k,tablesData:L,extendedData:D},n}}).call(this,n(261).Buffer)},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(234),i=n(181),o=n(102),a=n(8);class s{constructor(t,e){let{attributes:n,material:o,pbrDebug:a,imageBasedLightingEnvironment:s,lights:u,useTangents:c}=e;this.gl=t,this.defines={MANUAL_SRGB:1,SRGB_FAST_APPROXIMATION:1},Object(r.b)(t,i.a.GLSL_TEXTURE_LOD)&&(this.defines.USE_TEX_LOD=1),this.uniforms={u_Camera:[0,0,0],u_MetallicRoughnessValues:[1,1]},this.parameters={},this.generatedTextures=[],s&&(this.uniforms.u_DiffuseEnvSampler=s.getDiffuseEnvSampler(),this.uniforms.u_SpecularEnvSampler=s.getSpecularEnvSampler(),this.uniforms.u_brdfLUT=s.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(n.NORMAL,"HAS_NORMALS"),this.defineIfPresent(n.TANGENT&&c,"HAS_TANGENTS"),this.defineIfPresent(n.TEXCOORD_0,"HAS_UV"),this.defineIfPresent(s,"USE_IBL"),this.defineIfPresent(u,"USE_LIGHTS"),this.defineIfPresent(a,"PBR_DEBUG"),o&&this.parseMaterial(o)}defineIfPresent(t,e){t&&(this.defines[e]=1)}parseTexture(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const r=t.texture&&t.texture.sampler&&t.texture.sampler.parameters||{},i=t.texture.source.image;let a,s={};i.compressed?(a=i,s={[this.gl.TEXTURE_MIN_FILTER]:i.data.length>1?this.gl.LINEAR_MIPMAP_NEAREST:this.gl.LINEAR}):a={data:i};const u=new o.a(this.gl,{id:t.name||t.id,parameters:{...r,...s},pixelStore:{[this.gl.UNPACK_FLIP_Y_WEBGL]:!1},...a});this.uniforms[e]=u,this.defineIfPresent(n,n),this.generatedTextures.push(u)}parsePbrMetallicRoughness(t){t.baseColorTexture&&this.parseTexture(t.baseColorTexture,"u_BaseColorSampler","HAS_BASECOLORMAP"),this.uniforms.u_BaseColorFactor=t.baseColorFactor||[1,1,1,1],t.metallicRoughnessTexture&&this.parseTexture(t.metallicRoughnessTexture,"u_MetallicRoughnessSampler","HAS_METALROUGHNESSMAP");const{metallicFactor:e=1,roughnessFactor:n=1}=t;this.uniforms.u_MetallicRoughnessValues=[e,n]}parseMaterial(t){if(this.uniforms.pbr_uUnlit=Boolean(t.unlit),t.pbrMetallicRoughness&&this.parsePbrMetallicRoughness(t.pbrMetallicRoughness),t.normalTexture){this.parseTexture(t.normalTexture,"u_NormalSampler","HAS_NORMALMAP");const{scale:e=1}=t.normalTexture;this.uniforms.u_NormalScale=e}if(t.occlusionTexture){this.parseTexture(t.occlusionTexture,"u_OcclusionSampler","HAS_OCCLUSIONMAP");const{strength:e=1}=t.occlusionTexture;this.uniforms.u_OcclusionStrength=e}if(t.emissiveTexture&&(this.parseTexture(t.emissiveTexture,"u_EmissiveSampler","HAS_EMISSIVEMAP"),this.uniforms.u_EmissiveFactor=t.emissiveFactor||[0,0,0]),"MASK"===t.alphaMode){const{alphaCutoff:e=.5}=t;this.defines.ALPHA_CUTOFF=1,this.uniforms.u_AlphaCutoff=e}else"BLEND"===t.alphaMode&&(a.k.warn("BLEND alphaMode might not work well because it requires mesh sorting")(),Object.assign(this.parameters,{blend:!0,blendEquation:this.gl.FUNC_ADD,blendFunc:[this.gl.SRC_ALPHA,this.gl.ONE_MINUS_SRC_ALPHA,this.gl.ONE,this.gl.ONE_MINUS_SRC_ALPHA]}))}delete(){this.generatedTextures.forEach(t=>t.delete())}}},function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return s})),n.d(e,"a",(function(){return u}));var r=n(181),i=n(8),o=n(10);function a(t,e){return s(t,e)}function s(t,e){return(e=Array.isArray(e)?e:[e]).every(e=>c(t,e))}function u(t){t.luma=t.luma||{},t.luma.caps=t.luma.caps||{};for(const e in r.b)void 0===t.luma.caps[e]&&(t.luma.caps[e]=c(t,e));return t.luma.caps}function c(t,e){return t.luma=t.luma||{},t.luma.caps=t.luma.caps||{},void 0===t.luma.caps[e]&&(t.luma.caps[e]=function(t,e){const n=r.b[e];let a;Object(o.a)(n,e);const s=Object(i.j)(t)&&n[1]||n[0];if("function"==typeof s)a=s(t);else if(Array.isArray(s)){a=!0;for(const e of s)a=a&&Boolean(t.getExtension(e))}else"string"==typeof s?a=Boolean(t.getExtension(s)):"boolean"==typeof s?a=s:Object(o.a)(!1);return a}(t,e)),t.luma.caps[e]||i.k.log(2,"Feature: ".concat(e," not supported"))(),t.luma.caps[e]}},,,,,,,,,function(t,e,n){var r=document.body&&document.body.getAttribute("data-base-url");r&&(window.__webpack_public_path__="".concat(r,"nbextensions/pydeck/nb_extension"));var i=n(188).default.jupyterTransport,o=null,a=null;try{o=n(270).default,a=n(246).default}catch(t){}var s=n(121),u=s.MODULE_VERSION,c=s.MODULE_NAME,l=n(85),h=l.createDeck,f=l.updateDeck,p=n(271).initPlayground;p(),t.exports={jupyterTransport:i,MODULE_VERSION:u,MODULE_NAME:c,JupyterTransportModel:o,JupyterTransportView:a,initPlayground:p,createDeck:h,updateDeck:f}},function(t,e){function n(e,r){return t.exports=n=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},n(e,r)}t.exports=n},function(t,e,n){var r=n(2);t.exports=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=r(t)););return t}},function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return y}));var r=n(3),i=n.n(r),o=n(4),a=n.n(o),s=n(7),u=n.n(s),c=n(5),l=n.n(c),h=n(6),f=n.n(h),p=n(2),d=n.n(p),A=n(133),g=n(188);function m(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=d()(t);if(e){var i=d()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return f()(this,n)}}var y=function(t){l()(n,t);var e=m(n);function n(){return i()(this,n),e.apply(this,arguments)}return a()(n,[{key:"initialize",value:function(){this.listenTo(this.model,"destroy",this.remove),this.transport=new g.default,this.transport.jupyterModel=this.model,this.transport.jupyterView=this,this.transport._initialize(),u()(d()(n.prototype),"initialize",this).apply(this,arguments)}},{key:"remove",value:function(){this.transport&&(this.transport._finalize(),this.transport.jupyterModel=null,this.transport.jupyterView=null,this.transport=null)}},{key:"render",value:function(){u()(d()(n.prototype),"render",this).call(this),this.model.on("change:json_input",this.onJsonChanged.bind(this)),this.model.on("change:data_buffer",this.onDataBufferChanged.bind(this)),this.onDataBufferChanged()}},{key:"onJsonChanged",value:function(){var t=JSON.parse(this.model.get("json_input"));this.transport._messageReceived({type:"json",json:t})}},{key:"onDataBufferChanged",value:function(){var t=this.model.get("json_input"),e=this.model.get("data_buffer");t&&e?this.transport._messageReceived({type:"json-with-binary",json:t,binary:e}):this.transport._messageReceived({type:"json",json:t})}}]),n}(A.DOMWidgetView)},function(t,e,n){(function(e){const r=n(268),i=n(16),o=n(257).default,{registerLoaders:a,load:s,parse:u,fetchFile:c}=n(55),l="undefined"==typeof window?e:window;l.deck=l.deck||{},l.luma=l.luma||{},l.loaders=l.loaders||{},Object.assign(l.deck,i,{DeckGL:o}),Object.assign(l.luma,r),Object.assign(l.loaders,{registerLoaders:a,load:s,parse:u,fetchFile:c}),t.exports=l.deck}).call(this,n(82))},function(t,e){},function(t,e){t.exports=function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}},function(t,e){t.exports=function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}},function(t,e){t.exports=function(t){if(Array.isArray(t))return t}},function(t,e){t.exports=function(t,e){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}}},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(t,e){},function(t,e,n){var r=function(t){"use strict";var e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function s(t,e,n,r){var i=e&&e.prototype instanceof l?e:l,o=Object.create(i.prototype),a=new x(r||[]);return o._invoke=function(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 E()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=v(a,n);if(s){if(s===c)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 l=u(t,e,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===c)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}(t,n,a),o}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var c={};function l(){}function h(){}function f(){}var p={};p[i]=function(){return this};var d=Object.getPrototypeOf,A=d&&d(d(w([])));A&&A!==e&&n.call(A,i)&&(p=A);var g=f.prototype=l.prototype=Object.create(p);function m(t){["next","throw","return"].forEach((function(e){t[e]=function(t){return this._invoke(e,t)}}))}function y(t){var e;this._invoke=function(r,i){function o(){return new Promise((function(e,o){!function e(r,i,o,a){var s=u(t[r],t,i);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"==typeof l&&n.call(l,"__await")?Promise.resolve(l.__await).then((function(t){e("next",t,o,a)}),(function(t){e("throw",t,o,a)})):Promise.resolve(l).then((function(t){c.value=t,o(c)}),(function(t){return e("throw",t,o,a)}))}a(s.arg)}(r,i,e,o)}))}return e=e?e.then(o,o):o()}}function v(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,v(t,e),"throw"===e.method))return c;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}var r=u(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,c;var i=r.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,c):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,c)}function _(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 b(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function w(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:E}}function E(){return{value:void 0,done:!0}}return h.prototype=g.constructor=f,f.constructor=h,f[a]=h.displayName="GeneratorFunction",t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,a in t||(t[a]="GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(y.prototype),y.prototype[o]=function(){return this},t.AsyncIterator=y,t.async=function(e,n,r,i){var o=new y(s(e,n,r,i));return t.isGeneratorFunction(n)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},m(g),g[a]="Generator",g[i]=function(){return this},g.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=w,x.prototype={constructor:x,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.forEach(b),!t)for(var e in this)"t"===e.charAt(0)&&n.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 r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),u=n.call(o,"finallyLoc");if(s&&u){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,c):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),c},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),b(n),c}},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;b(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:w(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),c}},t}(t.exports);try{regeneratorRuntime=r}catch(t){Function("r","regeneratorRuntime = r")(r)}},function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return a}));var r=n(228),i=n(190);const o={position:"absolute",left:0,top:0,width:"100%",height:"100%"};class a extends i.a{constructor(t={}){if("undefined"==typeof document)throw Error("Deck can only be used in the browser");const{mapCanvas:e,deckCanvas:n}=function(t){let{container:e=document.body}=t;if("string"==typeof e&&(e=document.getElementById(e)),!e)throw Error("Deck: container not found");"static"===window.getComputedStyle(e).position&&(e.style.position="relative");const n=document.createElement("div");e.appendChild(n),Object.assign(n.style,o);const r=document.createElement("canvas");return e.appendChild(r),Object.assign(r.style,o),{container:e,mapCanvas:n,deckCanvas:r}}(t),i=t.viewState||t.initialViewState,a=Number.isFinite(i&&i.latitude),{map:s=window.mapboxgl}=t;super({canvas:n,...t}),s&&s.Map?this._map=a&&new r.a({...t,viewState:i,container:e,mapboxgl:s}):this._map=s,this._onBeforeRender=t=>{if(this.onBeforeRender(t),this._map){const t=this.getViewports()[0];this._map.setProps({width:t.width,height:t.height,viewState:t})}}}getMapboxMap(){return this._map&&this._map.getMap()}finalize(){this._map&&this._map.finalize(),super.finalize()}setProps(t){"onBeforeRender"in t&&this._onBeforeRender&&t.onBeforeRender!==this._onBeforeRender&&(this.onBeforeRender=t.onBeforeRender,t.onBeforeRender=this._onBeforeRender),"mapStyle"in t&&this._map&&this._map._map.setStyle(t.mapStyle),super.setProps(t)}}},function(t,e,n){"use strict";var r=n(259);function i(){}function o(){}o.resetWarningCache=i,t.exports=function(){function t(t,e,n,i,o,a){if(a!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function e(){return t}t.isRequired=t;var n={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:o,resetWarningCache:i};return n.PropTypes=n,n}},function(t,e,n){"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(t,e){t.exports=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}},function(t,e,n){"use strict";(function(t){
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <http://feross.org>
* @license MIT
*/
var r=n(262),i=n(213),o=n(263);function a(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(t,e){if(a()<e)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=u.prototype:(null===t&&(t=new u(e)),t.length=e),t}function u(t,e,n){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(t,e,n);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return h(this,t)}return c(this,t,e,n)}function c(t,e,n,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,n,r){if(e.byteLength,n<0||e.byteLength<n)throw new RangeError("'offset' is out of bounds");if(e.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");e=void 0===n&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,n):new Uint8Array(e,n,r);u.TYPED_ARRAY_SUPPORT?(t=e).__proto__=u.prototype:t=f(t,e);return t}(t,e,n,r):"string"==typeof e?function(t,e,n){"string"==typeof n&&""!==n||(n="utf8");if(!u.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|d(e,n),i=(t=s(t,r)).write(e,n);i!==r&&(t=t.slice(0,i));return t}(t,e,n):function(t,e){if(u.isBuffer(e)){var n=0|p(e.length);return 0===(t=s(t,n)).length||e.copy(t,0,0,n),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(r=e.length)!=r?s(t,0):f(t,e);if("Buffer"===e.type&&o(e.data))return f(t,e.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function l(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function h(t,e){if(l(e),t=s(t,e<0?0:0|p(e)),!u.TYPED_ARRAY_SUPPORT)for(var n=0;n<e;++n)t[n]=0;return t}function f(t,e){var n=e.length<0?0:0|p(e.length);t=s(t,n);for(var r=0;r<n;r+=1)t[r]=255&e[r];return t}function p(t){if(t>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function d(t,e){if(u.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return U(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return N(t).length;default:if(r)return U(t).length;e=(""+e).toLowerCase(),r=!0}}function A(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return P(this,e,n);case"utf8":case"utf-8":return S(this,e,n);case"ascii":return T(this,e,n);case"latin1":case"binary":return C(this,e,n);case"base64":return O(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function g(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function m(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=u.from(e,r)),u.isBuffer(e))return 0===e.length?-1:y(t,e,n,r,i);if("number"==typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):y(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function y(t,e,n,r,i){var o,a=1,s=t.length,u=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;a=2,s/=2,u/=2,n/=2}function c(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var l=-1;for(o=n;o<s;o++)if(c(t,o)===c(e,-1===l?0:o-l)){if(-1===l&&(l=o),o-l+1===u)return l*a}else-1!==l&&(o-=o-l),l=-1}else for(n+u>s&&(n=s-u),o=n;o>=0;o--){for(var h=!0,f=0;f<u;f++)if(c(t,o+f)!==c(e,f)){h=!1;break}if(h)return o}return-1}function v(t,e,n,r){n=Number(n)||0;var i=t.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a<r;++a){var s=parseInt(e.substr(2*a,2),16);if(isNaN(s))return a;t[n+a]=s}return a}function _(t,e,n,r){return G(U(e,t.length-n),t,n,r)}function b(t,e,n,r){return G(function(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function x(t,e,n,r){return b(t,e,n,r)}function w(t,e,n,r){return G(N(e),t,n,r)}function E(t,e,n,r){return G(function(t,e){for(var n,r,i,o=[],a=0;a<t.length&&!((e-=2)<0);++a)n=t.charCodeAt(a),r=n>>8,i=n%256,o.push(i),o.push(r);return o}(e,t.length-n),t,n,r)}function O(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function S(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i<n;){var o,a,s,u,c=t[i],l=null,h=c>239?4:c>223?3:c>191?2:1;if(i+h<=n)switch(h){case 1:c<128&&(l=c);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&c)<<6|63&o)>127&&(l=u);break;case 3:o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&(u=(15&c)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,h=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),i+=h}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var n="",r=0;for(;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=4096));return n}(r)}e.Buffer=u,e.SlowBuffer=function(t){+t!=t&&(t=0);return u.alloc(+t)},e.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=a(),u.poolSize=8192,u._augment=function(t){return t.__proto__=u.prototype,t},u.from=function(t,e,n){return c(null,t,e,n)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(t,e,n){return function(t,e,n,r){return l(e),e<=0?s(t,e):void 0!==n?"string"==typeof r?s(t,e).fill(n,r):s(t,e).fill(n):s(t,e)}(null,t,e,n)},u.allocUnsafe=function(t){return h(null,t)},u.allocUnsafeSlow=function(t){return h(null,t)},u.isBuffer=function(t){return!(null==t||!t._isBuffer)},u.compare=function(t,e){if(!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,i=0,o=Math.min(n,r);i<o;++i)if(t[i]!==e[i]){n=t[i],r=e[i];break}return n<r?-1:r<n?1:0},u.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(t,e){if(!o(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var r=u.allocUnsafe(e),i=0;for(n=0;n<t.length;++n){var a=t[n];if(!u.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,i),i+=a.length}return r},u.byteLength=d,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)g(this,e,e+1);return this},u.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)g(this,e,e+3),g(this,e+1,e+2);return this},u.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)g(this,e,e+7),g(this,e+1,e+6),g(this,e+2,e+5),g(this,e+3,e+4);return this},u.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?S(this,0,t):A.apply(this,arguments)},u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){var t="",n=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),"<Buffer "+t+">"},u.prototype.compare=function(t,e,n,r,i){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(e>>>=0),s=Math.min(o,a),c=this.slice(r,i),l=t.slice(e,n),h=0;h<s;++h)if(c[h]!==l[h]){o=c[h],a=l[h];break}return o<a?-1:a<o?1:0},u.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},u.prototype.indexOf=function(t,e,n){return m(this,t,e,n,!0)},u.prototype.lastIndexOf=function(t,e,n){return m(this,t,e,n,!1)},u.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-e;if((void 0===n||n>i)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return v(this,t,e,n);case"utf8":case"utf-8":return _(this,t,e,n);case"ascii":return b(this,t,e,n);case"latin1":case"binary":return x(this,t,e,n);case"base64":return w(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function T(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(127&t[i]);return r}function C(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(t[i]);return r}function P(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=e;o<n;++o)i+=z(t[o]);return i}function M(t,e,n){for(var r=t.slice(e,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function I(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function B(t,e,n,r,i,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function R(t,e,n,r){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-n,2);i<o;++i)t[n+i]=(e&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function k(t,e,n,r){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-n,4);i<o;++i)t[n+i]=e>>>8*(r?i:3-i)&255}function L(t,e,n,r,i,o){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function D(t,e,n,r,o){return o||L(t,0,n,4),i.write(t,e,n,r,23,4),n+4}function j(t,e,n,r,o){return o||L(t,0,n,8),i.write(t,e,n,r,52,8),n+8}u.prototype.slice=function(t,e){var n,r=this.length;if((t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t),u.TYPED_ARRAY_SUPPORT)(n=this.subarray(t,e)).__proto__=u.prototype;else{var i=e-t;n=new u(i,void 0);for(var o=0;o<i;++o)n[o]=this[o+t]}return n},u.prototype.readUIntLE=function(t,e,n){t|=0,e|=0,n||I(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r},u.prototype.readUIntBE=function(t,e,n){t|=0,e|=0,n||I(t,e,this.length);for(var r=this[t+--e],i=1;e>0&&(i*=256);)r+=this[t+--e]*i;return r},u.prototype.readUInt8=function(t,e){return e||I(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||I(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||I(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||I(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return e||I(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||I(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*e)),r},u.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||I(t,e,this.length);for(var r=e,i=1,o=this[t+--r];r>0&&(i*=256);)o+=this[t+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},u.prototype.readInt8=function(t,e){return e||I(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){e||I(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(t,e){e||I(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(t,e){return e||I(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return e||I(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return e||I(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||I(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||I(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||I(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||B(this,t,e,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[e]=255&t;++o<n&&(i*=256);)this[e+o]=t/i&255;return e+n},u.prototype.writeUIntBE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||B(this,t,e,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+n},u.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||B(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||B(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):R(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||B(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):R(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||B(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):k(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||B(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):k(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);B(this,t,e,n,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o<n&&(a*=256);)t<0&&0===s&&0!==this[e+o-1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+n},u.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);B(this,t,e,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+n},u.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||B(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||B(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):R(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||B(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):R(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||B(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):k(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||B(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):k(this,t,e,!1),e+4},u.prototype.writeFloatLE=function(t,e,n){return D(this,t,e,!0,n)},u.prototype.writeFloatBE=function(t,e,n){return D(this,t,e,!1,n)},u.prototype.writeDoubleLE=function(t,e,n){return j(this,t,e,!0,n)},u.prototype.writeDoubleBE=function(t,e,n){return j(this,t,e,!1,n)},u.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);var i,o=r-n;if(this===t&&n<e&&e<r)for(i=o-1;i>=0;--i)t[i+e]=this[i+n];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+e]=this[i+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+o),e);return o},u.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!u.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;var o;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(o=e;o<n;++o)this[o]=t;else{var a=u.isBuffer(t)?t:U(new u(t,r).toString()),s=a.length;for(o=0;o<n-e;++o)this[o+e]=a[o%s]}return this};var F=/[^+\/0-9A-Za-z-_]/g;function z(t){return t<16?"0"+t.toString(16):t.toString(16)}function U(t,e){var n;e=e||1/0;for(var r=t.length,i=null,o=[],a=0;a<r;++a){if((n=t.charCodeAt(a))>55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(e-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function N(t){return r.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(F,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function G(t,e,n,r){for(var i=0;i<r&&!(i+n>=e.length||i>=t.length);++i)e[i+n]=t[i];return i}}).call(this,n(82))},function(t,e,n){"use strict";e.byteLength=function(t){var e=c(t),n=e[0],r=e[1];return 3*(n+r)/4-r},e.toByteArray=function(t){var e,n,r=c(t),a=r[0],s=r[1],u=new o(function(t,e,n){return 3*(e+n)/4-n}(0,a,s)),l=0,h=s>0?a-4:a;for(n=0;n<h;n+=4)e=i[t.charCodeAt(n)]<<18|i[t.charCodeAt(n+1)]<<12|i[t.charCodeAt(n+2)]<<6|i[t.charCodeAt(n+3)],u[l++]=e>>16&255,u[l++]=e>>8&255,u[l++]=255&e;2===s&&(e=i[t.charCodeAt(n)]<<2|i[t.charCodeAt(n+1)]>>4,u[l++]=255&e);1===s&&(e=i[t.charCodeAt(n)]<<10|i[t.charCodeAt(n+1)]<<4|i[t.charCodeAt(n+2)]>>2,u[l++]=e>>8&255,u[l++]=255&e);return u},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],a=0,s=n-i;a<s;a+=16383)o.push(l(t,a,a+16383>s?s:a+16383));1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return o.join("")};for(var r=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s<u;++s)r[s]=a[s],i[a.charCodeAt(s)]=s;function c(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function l(t,e,n){for(var i,o,a=[],s=e;s<n;s+=3)i=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),a.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e,n){!function(n){"use strict";var r=function(t,e){var n=new Error(t+" at character "+e);throw n.index=e,n.description=t,n},i={"-":!0,"!":!0,"~":!0,"+":!0},o={"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},a=function(t){var e,n=0;for(var r in t)(e=r.length)>n&&t.hasOwnProperty(r)&&(n=e);return n},s=a(i),u=a(o),c={true:!0,false:!1,null:null},l=function(t){return o[t]||0},h=function(t,e,n){return{type:"||"===t||"&&"===t?"LogicalExpression":"BinaryExpression",operator:t,left:e,right:n}},f=function(t){return t>=48&&t<=57},p=function(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||t>=128&&!o[String.fromCharCode(t)]},d=function(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||t>=128&&!o[String.fromCharCode(t)]},A=function(t){for(var e,n,a=0,A=t.charAt,g=t.charCodeAt,m=function(e){return A.call(t,e)},y=function(e){return g.call(t,e)},v=t.length,_=function(){for(var t=y(a);32===t||9===t||10===t||13===t;)t=y(++a)},b=function(){var t,e,n=w();return _(),63!==y(a)?n:(a++,(t=b())||r("Expected expression",a),_(),58===y(a)?(a++,(e=b())||r("Expected expression",a),{type:"ConditionalExpression",test:n,consequent:t,alternate:e}):void r("Expected :",a))},x=function(){_();for(var e=t.substr(a,u),n=e.length;n>0;){if(o.hasOwnProperty(e)&&(!p(y(a))||a+e.length<t.length&&!d(y(a+e.length))))return a+=n,e;e=e.substr(0,--n)}return!1},w=function(){var t,e,n,i,o,s,u,c;if(s=E(),!(e=x()))return s;for(o={value:e,prec:l(e)},(u=E())||r("Expected expression after "+e,a),i=[s,o,u];(e=x())&&0!==(n=l(e));){for(o={value:e,prec:n};i.length>2&&n<=i[i.length-2].prec;)u=i.pop(),e=i.pop().value,s=i.pop(),t=h(e,s,u),i.push(t);(t=E())||r("Expected expression after "+e,a),i.push(o,t)}for(t=i[c=i.length-1];c>1;)t=h(i[c-1].value,i[c-2],t),c-=2;return t},E=function(){var e,n,r;if(_(),e=y(a),f(e)||46===e)return O();if(39===e||34===e)return S();if(91===e)return I();for(r=(n=t.substr(a,s)).length;r>0;){if(i.hasOwnProperty(n)&&(!p(y(a))||a+n.length<t.length&&!d(y(a+n.length))))return a+=r,{type:"UnaryExpression",operator:n,argument:E(),prefix:!0};n=n.substr(0,--r)}return!(!p(e)&&40!==e)&&P()},O=function(){for(var t,e,n="";f(y(a));)n+=m(a++);if(46===y(a))for(n+=m(a++);f(y(a));)n+=m(a++);if("e"===(t=m(a))||"E"===t){for(n+=m(a++),"+"!==(t=m(a))&&"-"!==t||(n+=m(a++));f(y(a));)n+=m(a++);f(y(a-1))||r("Expected exponent ("+n+m(a)+")",a)}return e=y(a),p(e)?r("Variable names cannot start with a number ("+n+m(a)+")",a):46===e&&r("Unexpected period",a),{type:"Literal",value:parseFloat(n),raw:n}},S=function(){for(var t,e="",n=m(a++),i=!1;a<v;){if((t=m(a++))===n){i=!0;break}if("\\"===t)switch(t=m(a++)){case"n":e+="\n";break;case"r":e+="\r";break;case"t":e+="\t";break;case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:e+=t}else e+=t}return i||r('Unclosed quote after "'+e+'"',a),{type:"Literal",value:e,raw:n+e+n}},T=function(){var e,n=y(a),i=a;for(p(n)?a++:r("Unexpected "+m(a),a);a<v&&(n=y(a),d(n));)a++;return e=t.slice(i,a),c.hasOwnProperty(e)?{type:"Literal",value:c[e],raw:e}:"this"===e?{type:"ThisExpression"}:{type:"Identifier",name:e}},C=function(t){for(var e,n,i=[],o=!1;a<v;){if(_(),(e=y(a))===t){o=!0,a++;break}44===e?a++:((n=b())&&"Compound"!==n.type||r("Expected comma",a),i.push(n))}return o||r("Expected "+String.fromCharCode(t),a),i},P=function(){var t,e;for(e=40===(t=y(a))?M():T(),_(),t=y(a);46===t||91===t||40===t;)a++,46===t?(_(),e={type:"MemberExpression",computed:!1,object:e,property:T()}):91===t?(e={type:"MemberExpression",computed:!0,object:e,property:b()},_(),93!==(t=y(a))&&r("Unclosed [",a),a++):40===t&&(e={type:"CallExpression",arguments:C(41),callee:e}),_(),t=y(a);return e},M=function(){a++;var t=b();if(_(),41===y(a))return a++,t;r("Unclosed (",a)},I=function(){return a++,{type:"ArrayExpression",elements:C(93)}},B=[];a<v;)59===(e=y(a))||44===e?a++:(n=b())?B.push(n):a<v&&r('Unexpected "'+m(a)+'"',a);return 1===B.length?B[0]:{type:"Compound",body:B}};A.version="0.3.4",A.toString=function(){return"JavaScript Expression Parser (JSEP) v"+A.version},A.addUnaryOp=function(t){return s=Math.max(t.length,s),i[t]=!0,this},A.addBinaryOp=function(t,e){return u=Math.max(t.length,u),o[t]=e,this},A.addLiteral=function(t,e){return c[t]=e,this},A.removeUnaryOp=function(t){return delete i[t],t.length===s&&(s=a(i)),this},A.removeAllUnaryOps=function(){return i={},s=0,this},A.removeBinaryOp=function(t){return delete o[t],t.length===u&&(u=a(o)),this},A.removeAllBinaryOps=function(){return o={},u=0,this},A.removeLiteral=function(t){return delete c[t],this},A.removeAllLiterals=function(){return c={},this},t.exports?e=t.exports=A:e.parse=A}()},function(t,e,n){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)).workerUrl=window.URL.createObjectURL(new Blob([o],{type:"text/javascript"}))}else e=i;else t=i}return r(0,(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}function a(t,e){if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!a(t[n],e[n]))return!1;return!0}if("object"==typeof t&&null!==t&&null!==e){if("object"!=typeof e)return!1;if(Object.keys(t).length!==Object.keys(e).length)return!1;for(var r in t)if(!a(t[r],e[r]))return!1;return!0}return t===e}function s(t,e,r,i){var o=new n(t,e,r,i);return function(t){return o.solve(t)}}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[0]*this.x+t[1]*this.y,n=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=n,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=e*this.x-n*this.y,i=n*this.x+e*this.y;return this.x=r,this.y=i,this},_rotateAround:function(t,e){var n=Math.cos(t),r=Math.sin(t),i=e.x+n*(this.x-e.x)-r*(this.y-e.y),o=e.y+r*(this.x-e.x)+n*(this.y-e.y);return this.x=i,this.y=o,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 u=s(.25,.1,.25,1);function c(t,e,n){return Math.min(n,Math.max(e,t))}function l(t,e,n){var r=n-e,i=((t-e)%r+r)%r+e;return i===e?n:i}function h(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 f=1;function p(){return f++}function d(){return function t(e){return e?(e^16*Math.random()>>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function A(t){return!!t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)}function 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 v(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 _(t){return Array.isArray(t)?t.map(_):"object"==typeof t&&t?y(t,_):t}var b={};function x(t){b[t]||("undefined"!=typeof console&&console.warn(t),b[t]=!0)}function w(t,e,n){return(n.y-t.y)*(e.x-t.x)>(e.y-t.y)*(n.x-t.x)}function E(t){for(var e=0,n=0,r=t.length,i=r-1,o=void 0,a=void 0;n<r;i=n++)o=t[n],e+=((a=t[i]).x-o.x)*(o.y+a.y);return e}function O(){return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}function S(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 T=null;function C(t){if(null==T){var e=t.navigator?t.navigator.userAgent:null;T=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return T}function P(t){try{var e=self[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return!1}}var M,I,B,R,k=self.performance&&self.performance.now?self.performance.now.bind(self.performance):Date.now.bind(Date),L=self.requestAnimationFrame||self.mozRequestAnimationFrame||self.webkitRequestAnimationFrame||self.msRequestAnimationFrame,D=self.cancelAnimationFrame||self.mozCancelAnimationFrame||self.webkitCancelAnimationFrame||self.msCancelAnimationFrame,j={now:k,frame:function(t){var e=L(t);return{cancel:function(){return D(e)}}},getImageData:function(t,e){void 0===e&&(e=0);var n=self.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 M||(M=self.document.createElement("a")),M.href=t,M.href},hardwareConcurrency:self.navigator.hardwareConcurrency||4,get devicePixelRatio(){return self.devicePixelRatio},get prefersReducedMotion(){return!!self.matchMedia&&(null==I&&(I=self.matchMedia("(prefers-reduced-motion: reduce)")),I.matches)}},F={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},z={supported:!1,testSupport:function(t){!U&&R&&(N?G(t):B=t)}},U=!1,N=!1;function G(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,R),t.isContextLost())return;z.supported=!0}catch(t){}t.deleteTexture(e),U=!0}self.document&&((R=self.document.createElement("img")).onload=function(){B&&G(B),B=null,N=!0},R.onerror=function(){U=!0,B=null},R.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 W(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(!W(t))return t;var n=Z(t);return n.path="/styles/v1"+n.path,this._makeAPIURL(n,this._customAccessToken||e)},H.prototype.normalizeGlyphsURL=function(t,e){if(!W(t))return t;var n=Z(t);return n.path="/fonts/v1"+n.path,this._makeAPIURL(n,this._customAccessToken||e)},H.prototype.normalizeSourceURL=function(t,e){if(!W(t))return t;var n=Z(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=Z(t);return W(t)?(i.path="/styles/v1"+i.path+"/sprite"+e+n,this._makeAPIURL(i,this._customAccessToken||r)):(i.path+=""+e+n,Q(i))},H.prototype.normalizeTileURL=function(t,e,n){if(this._isSkuTokenExpired()&&this._createSkuToken(),!e||!W(e))return t;var r=Z(t),i=j.devicePixelRatio>=2||512===n?"@2x":"",o=z.supported?".webp":"$1";return r.path=r.path.replace(/(\.(png|jpg)\d*)(?=$)/,""+i+o),r.path=r.path.replace(/^.+\/v4\//,"/"),r.path="/v4"+r.path,F.REQUIRE_ACCESS_TOKEN&&(F.ACCESS_TOKEN||this._customAccessToken)&&this._skuToken&&r.params.push("sku="+this._skuToken),this._makeAPIURL(r,this._customAccessToken)},H.prototype.canonicalizeTileURL=function(t){var e=Z(t);if(!e.path.match(/(^\/v4\/)/)||!e.path.match(/\.[\w]+$/))return t;var n="mapbox://tiles/";n+=e.path.replace("/v4/","");var r=e.params.filter((function(t){return!t.match(/^access_token=/)}));return r.length&&(n+="?"+r.join("&")),n},H.prototype.canonicalizeTileset=function(t,e){if(!W(e))return t.tiles||[];for(var n=[],r=0,i=t.tiles;r<i.length;r+=1){var o=i[r],a=this.canonicalizeTileURL(o);n.push(a)}return n},H.prototype._makeAPIURL=function(t,e){var n="See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes",r=Z(F.API_URL);if(t.protocol=r.protocol,t.authority=r.authority,"/"!==r.path&&(t.path=""+r.path+t.path),!F.REQUIRE_ACCESS_TOKEN)return Q(t);if(!(e=e||F.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),Q(t)};var q=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function X(t){return q.test(t)}var J=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function Z(t){var e=t.match(J);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 Q(t){var e=t.params.length?"?"+t.params.join("&"):"";return t.protocol+"://"+t.authority+t.path+e}function K(t){if(!t)return null;var e,n=t.split(".");if(!n||3!==n.length)return null;try{return JSON.parse((e=n[1],decodeURIComponent(self.atob(e).split("").map((function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)})).join(""))))}catch(t){return null}}var Y=function(t){this.type=t,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};Y.prototype.getStorageKey=function(t){var e,n=K(F.ACCESS_TOKEN),r="";return n&&n.u?(e=n.u,r=self.btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(function(t,e){return String.fromCharCode(Number("0x"+e))})))):r=F.ACCESS_TOKEN||"",t?"mapbox.eventData."+t+":"+r:"mapbox.eventData:"+r},Y.prototype.fetchEventData=function(){var t=P("localStorage"),e=this.getStorageKey(),n=this.getStorageKey("uuid");if(t)try{var r=self.localStorage.getItem(e);r&&(this.eventData=JSON.parse(r));var i=self.localStorage.getItem(n);i&&(this.anonId=i)}catch(t){x("Unable to read from LocalStorage")}},Y.prototype.saveEventData=function(){var t=P("localStorage"),e=this.getStorageKey(),n=this.getStorageKey("uuid");if(t)try{self.localStorage.setItem(n,this.anonId),Object.keys(this.eventData).length>=1&&self.localStorage.setItem(e,JSON.stringify(this.eventData))}catch(t){x("Unable to write to LocalStorage")}},Y.prototype.processRequests=function(t){},Y.prototype.postEvent=function(t,e,n,r){var i=this;if(F.EVENTS_URL){var o=Z(F.EVENTS_URL);o.params.push("access_token="+(r||F.ACCESS_TOKEN||""));var a={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.6.1",skuId:V,userId:this.anonId},s=e?h(a,e):a,u={url:Q(o),headers:{"Content-Type":"text/plain"},body:JSON.stringify([s])};this.pendingRequest=_t(u,(function(t){i.pendingRequest=null,n(t),i.saveEventData(),i.processRequests(r)}))}},Y.prototype.queueRequest=function(t,e){this.queue.push(t),this.processRequests(e)};var $,tt,et=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),e.prototype.constructor=e,e.prototype.postMapLoadEvent=function(t,e,n,r){this.skuToken=n,(F.EVENTS_URL&&r||F.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return W(t)||X(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(),A(this.anonId)||(this.anonId=d()),this.postEvent(i,{skuToken:this.skuToken},(function(t){t||r&&(e.success[r]=!0)}),t))}},e}(Y),nt=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),e.prototype.constructor=e,e.prototype.postTurnstileEvent=function(t,e){F.EVENTS_URL&&F.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return W(t)||X(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=K(F.ACCESS_TOKEN),r=n?n.u:F.ACCESS_TOKEN,i=r!==this.eventData.tokenU;A(this.anonId)||(this.anonId=d(),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}(Y)),rt=nt.postTurnstileEvent.bind(nt),it=new et,ot=it.postMapLoadEvent.bind(it),at="mapbox-tiles",st=500,ut=50;function ct(){self.caches&&!$&&($=self.caches.open(at))}function lt(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}var ht=1/0,ft={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(ft);var pt=function(t){function e(e,n,r){401===n&&X(r)&&(e+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),t.call(this,e),this.status=n,this.url=r,this.name=this.constructor.name,this.message=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},e}(Error),dt=O()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===self.location.protocol?self.parent:self).location.href};function At(t,e){var n,r=new self.AbortController,i=new self.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:dt(),signal:r.signal}),o=!1,a=!1,s=(n=i.url).indexOf("sku=")>0&&X(n);"json"===t.type&&i.headers.set("Accept","application/json");var u=function(n,r,o){if(!a){if(n&&"SecurityError"!==n.message&&x(n),r&&o)return c(r);var u=Date.now();self.fetch(i).then((function(n){if(n.ok){var r=s?n.clone():null;return c(n,r,u)}return e(new pt(n.statusText,n.status,t.url))})).catch((function(t){20!==t.code&&e(new Error(t.message))}))}},c=function(n,r,s){("arrayBuffer"===t.type?n.arrayBuffer():"json"===t.type?n.json():n.text()).then((function(t){a||(r&&s&&function(t,e,n){if(ct(),$){var r={status:e.status,statusText:e.statusText,headers:new self.Headers};e.headers.forEach((function(t,e){return r.headers.set(e,t)}));var i=S(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===tt)try{new Response(new ReadableStream),tt=!0}catch(t){tt=!1}tt?e(t.body):t.blob().then(e)}(e,(function(e){var n=new self.Response(e,r);ct(),$&&$.then((function(e){return e.put(lt(t.url),n)})).catch((function(t){return x(t.message)}))})))}}(i,r,s),o=!0,e(null,t,n.headers.get("Cache-Control"),n.headers.get("Expires")))})).catch((function(t){a||e(new Error(t.message))}))};return s?function(t,e){if(ct(),!$)return e(null);var n=lt(t.url);$.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=S(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,u):u(null,null),{cancel:function(){a=!0,o||r.abort()}}}var gt,mt,yt=function(t,e){if(n=t.url,!(/^file:/.test(n)||/^file:/.test(dt())&&!/^\w+:/.test(n))){if(self.fetch&&self.Request&&self.AbortController&&self.Request.prototype.hasOwnProperty("signal"))return At(t,e);if(O()&&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 self.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 pt(n.statusText,n.status,t.url))},n.send(t.body),{cancel:function(){return n.abort()}}}(t,e)},vt=function(t,e){return yt(h(t,{type:"arrayBuffer"}),e)},_t=function(t,e){return yt(h(t,{method:"POST"}),e)};gt=[],mt=0;var bt=function(t,e){if(z.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),mt>=F.MAX_PARALLEL_IMAGE_REQUESTS){var n={requestParameters:t,callback:e,cancelled:!1,cancel:function(){this.cancelled=!0}};return gt.push(n),n}mt++;var r=!1,i=function(){if(!r)for(r=!0,mt--;gt.length&&mt<F.MAX_PARALLEL_IMAGE_REQUESTS;){var t=gt.shift(),e=t.requestParameters,n=t.callback;t.cancelled||(t.cancel=bt(e,n).cancel)}},o=vt(t,(function(t,n,r,o){if(i(),t)e(t);else if(n){var a=new self.Image;a.onload=function(){e(null,a),self.URL.revokeObjectURL(a.src)},a.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 self.Blob([new Uint8Array(n)],{type:"image/png"});a.cacheControl=r,a.expires=o,a.src=n.byteLength?self.URL.createObjectURL(s):"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII="}}));return{cancel:function(){o.cancel(),i()}}};function xt(t,e,n){n[t]&&-1!==n[t].indexOf(e)||(n[t]=n[t]||[],n[t].push(e))}function wt(t,e,n){if(n&&n[t]){var r=n[t].indexOf(e);-1!==r&&n[t].splice(r,1)}}var Et=function(t,e){void 0===e&&(e={}),h(this,e),this.type=t},Ot=function(t){function e(e,n){void 0===n&&(n={}),t.call(this,"error",h({error:e},n))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Et),St=function(){};St.prototype.on=function(t,e){return this._listeners=this._listeners||{},xt(t,e,this._listeners),this},St.prototype.off=function(t,e){return wt(t,e,this._listeners),wt(t,e,this._oneTimeListeners),this},St.prototype.once=function(t,e){return this._oneTimeListeners=this._oneTimeListeners||{},xt(t,e,this._oneTimeListeners),this},St.prototype.fire=function(t,e){"string"==typeof t&&(t=new Et(t,e||{}));var n=t.type;if(this.listens(n)){t.target=this;for(var 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];wt(n,s,this._oneTimeListeners),s.call(this,t)}var u=this._eventedParent;u&&(h(t,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),u.fire(t))}else t instanceof Ot&&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 Tt={$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"},"*":{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"},"*":{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"},"*":{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},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1}},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":{}}},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},expression_name:{type:"enum",values:{let:{group:"Variable binding"},var:{group:"Variable binding"},literal:{group:"Types"},array:{group:"Types"},at:{group:"Lookup"},in:{group:"Lookup"},case:{group:"Decision"},match:{group:"Decision"},coalesce:{group:"Decision"},step:{group:"Ramps, scales, curves"},interpolate:{group:"Ramps, scales, curves"},"interpolate-hcl":{group:"Ramps, scales, curves"},"interpolate-lab":{group:"Ramps, scales, curves"},ln2:{group:"Math"},pi:{group:"Math"},e:{group:"Math"},typeof:{group:"Types"},string:{group:"Types"},number:{group:"Types"},boolean:{group:"Types"},object:{group:"Types"},collator:{group:"Types"},format:{group:"Types"},image:{group:"Types"},"number-format":{group:"Types"},"to-string":{group:"Types"},"to-number":{group:"Types"},"to-boolean":{group:"Types"},"to-rgba":{group:"Color"},"to-color":{group:"Types"},rgb:{group:"Color"},rgba:{group:"Color"},get:{group:"Lookup"},has:{group:"Lookup"},length:{group:"Lookup"},properties:{group:"Feature data"},"feature-state":{group:"Feature data"},"geometry-type":{group:"Feature data"},id:{group:"Feature data"},zoom:{group:"Zoom"},"heatmap-density":{group:"Heatmap"},"line-progress":{group:"Feature data"},accumulated:{group:"Feature data"},"+":{group:"Math"},"*":{group:"Math"},"-":{group:"Math"},"/":{group:"Math"},"%":{group:"Math"},"^":{group:"Math"},sqrt:{group:"Math"},log10:{group:"Math"},ln:{group:"Math"},log2:{group:"Math"},sin:{group:"Math"},cos:{group:"Math"},tan:{group:"Math"},asin:{group:"Math"},acos:{group:"Math"},atan:{group:"Math"},min:{group:"Math"},max:{group:"Math"},round:{group:"Math"},abs:{group:"Math"},ceil:{group:"Math"},floor:{group:"Math"},"==":{group:"Decision"},"!=":{group:"Decision"},">":{group:"Decision"},"<":{group:"Decision"},">=":{group:"Decision"},"<=":{group:"Decision"},all:{group:"Decision"},any:{group:"Decision"},"!":{group:"Decision"},"is-supported-script":{group:"String"},upcase:{group:"String"},downcase:{group:"String"},concat:{group:"String"},"resolved-locale":{group:"String"}}},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}}},Ct=function(t,e,n,r){this.message=(t?t+": ":"")+n,r&&(this.identifier=r),null!=e&&e.__line__&&(this.line=e.__line__)};function Pt(t){var e=t.key,n=t.value;return n?[new Ct(e,n,"constants have been deprecated as of v8")]:[]}function Mt(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 It(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function Bt(t){if(Array.isArray(t))return t.map(Bt);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){var e={};for(var n in t)e[n]=Bt(t[n]);return e}return It(t)}var Rt=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),e.prototype.constructor=e,e}(Error),kt=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],o=i[0],a=i[1];this.bindings[o]=a}};kt.prototype.concat=function(t){return new kt(this,t)},kt.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.")},kt.prototype.has=function(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)};var Lt={kind:"null"},Dt={kind:"number"},jt={kind:"string"},Ft={kind:"boolean"},zt={kind:"color"},Ut={kind:"object"},Nt={kind:"value"},Gt={kind:"collator"},Vt={kind:"formatted"},Ht={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 Xt=[Lt,Dt,jt,Ft,zt,Vt,Ut,Wt(Nt),Ht];function Jt(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!Jt(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=Xt;n<r.length;n+=1)if(!Jt(r[n],e))return null}return"Expected "+qt(t)+" but found "+qt(e)+" instead."}var Zt=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 t<0?0:t>1?1:t}function o(t){return"%"===t[t.length-1]?r(parseFloat(t)/100*255):r(parseInt(t))}function a(t){return"%"===t[t.length-1]?i(parseFloat(t)/100):i(parseFloat(t))}function s(t,e,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?t+(e-t)*n*6:2*n<1?e:3*n<2?t+(e-t)*(2/3-n)*6:t}try{e.parseCSSColor=function(t){var e,i=t.replace(/ /g,"").toLowerCase();if(i in n)return n[i].slice();if("#"===i[0])return 4===i.length?(e=parseInt(i.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===i.length&&(e=parseInt(i.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var u=i.indexOf("("),c=i.indexOf(")");if(-1!==u&&c+1===i.length){var l=i.substr(0,u),h=i.substr(u+1,c-(u+1)).split(","),f=1;switch(l){case"rgba":if(4!==h.length)return null;f=a(h.pop());case"rgb":return 3!==h.length?null:[o(h[0]),o(h[1]),o(h[2]),f];case"hsla":if(4!==h.length)return null;f=a(h.pop());case"hsl":if(3!==h.length)return null;var p=(parseFloat(h[0])%360+360)%360/360,d=a(h[1]),A=a(h[2]),g=A<=.5?A*(d+1):A+d-A*d,m=2*A-g;return[r(255*s(m,g,p+1/3)),r(255*s(m,g,p)),r(255*s(m,g,p-1/3)),f];default:return null}}return null}}catch(t){}})).parseCSSColor,Qt=function(t,e,n,r){void 0===r&&(r=1),this.r=t,this.g=e,this.b=n,this.a=r};Qt.parse=function(t){if(t){if(t instanceof Qt)return t;if("string"==typeof t){var e=Zt(t);if(e)return new Qt(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},Qt.prototype.toString=function(){var t=this.toArray(),e=t[0],n=t[1],r=t[2],i=t[3];return"rgba("+Math.round(e)+","+Math.round(n)+","+Math.round(r)+","+i+")"},Qt.prototype.toArray=function(){var t=this.r,e=this.g,n=this.b,r=this.a;return 0===r?[0,0,0,0]:[255*t/r,255*e/r,255*n/r,r]},Qt.black=new Qt(0,0,0,1),Qt.white=new Qt(1,1,1,1),Qt.transparent=new Qt(0,0,0,0),Qt.red=new Qt(1,0,0,1);var Kt=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"})};Kt.prototype.compare=function(t,e){return this.collator.compare(t,e)},Kt.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var Yt=function(t,e,n,r,i){this.text=t,this.image=e,this.scale=n,this.fontStack=r,this.textColor=i},$t=function(t){this.sections=t};$t.fromString=function(t){return new $t([new Yt(t,null,null,null,null)])},$t.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}))},$t.factory=function(t){return t instanceof $t?t:$t.fromString(t)},$t.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(t){return t.text})).join("")},$t.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 te=function(t){this.name=t.name,this.available=t.available};function ee(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 ne(t){if(null===t)return Lt;if("string"==typeof t)return jt;if("boolean"==typeof t)return Ft;if("number"==typeof t)return Dt;if(t instanceof Qt)return zt;if(t instanceof Kt)return Gt;if(t instanceof $t)return Vt;if(t instanceof te)return Ht;if(Array.isArray(t)){for(var e,n=t.length,r=0,i=t;r<i.length;r+=1){var o=ne(i[r]);if(e){if(e===o)continue;e=Nt;break}e=o}return Wt(e||Nt,n)}return Ut}function re(t){var e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof Qt||t instanceof $t||t instanceof te?t.toString():JSON.stringify(t)}te.prototype.toString=function(){return this.name},te.fromString=function(t){return new te({name:t,available:!1})},te.prototype.serialize=function(){return["image",this.name]};var ie=function(t,e){this.type=t,this.value=e};ie.parse=function(t,e){if(2!==t.length)return e.error("'literal' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(!function t(e){if(null===e)return!0;if("string"==typeof e)return!0;if("boolean"==typeof e)return!0;if("number"==typeof e)return!0;if(e instanceof Qt)return!0;if(e instanceof Kt)return!0;if(e instanceof $t)return!0;if(e instanceof te)return!0;if(Array.isArray(e)){for(var n=0,r=e;n<r.length;n+=1)if(!t(r[n]))return!1;return!0}if("object"==typeof e){for(var i in e)if(!t(e[i]))return!1;return!0}return!1}(t[1]))return e.error("invalid value");var n=t[1],r=ne(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 ie(r,n)},ie.prototype.evaluate=function(){return this.value},ie.prototype.eachChild=function(){},ie.prototype.possibleOutputs=function(){return[this.value]},ie.prototype.serialize=function(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof Qt?["rgba"].concat(this.value.toArray()):this.value instanceof $t?this.value.serialize():this.value};var oe=function(t){this.name="ExpressionEvaluationError",this.message=t};oe.prototype.toJSON=function(){return this.message};var ae={string:jt,number:Dt,boolean:Ft,object:Ut},se=function(t,e){this.type=t,this.args=e};se.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 ae)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);o=ae[s],r++}else o=Nt;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=ae[i];for(var u=[];r<t.length;r++){var c=e.parse(t[r],r,Nt);if(!c)return null;u.push(c)}return new se(n,u)},se.prototype.evaluate=function(t){for(var e=0;e<this.args.length;e++){var n=this.args[e].evaluate(t);if(!Jt(this.type,ne(n)))return n;if(e===this.args.length-1)throw new oe("Expected value to be of type "+qt(this.type)+", but found "+qt(ne(n))+" instead.")}return null},se.prototype.eachChild=function(t){this.args.forEach(t)},se.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.args.map((function(t){return t.possibleOutputs()})))},se.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 ue=function(t){this.type=Vt,this.sections=t};ue.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,Dt)))return null;var u=null;if(a["text-font"]&&!(u=e.parse(a["text-font"],1,Wt(jt))))return null;var c=null;if(a["text-color"]&&!(c=e.parse(a["text-color"],1,zt)))return null;var l=r[r.length-1];l.scale=s,l.font=u,l.textColor=c}else{var h=e.parse(t[o],1,Nt);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 ue(r)},ue.prototype.evaluate=function(t){return new $t(this.sections.map((function(e){var n=e.content.evaluate(t);return ne(n)===Ht?new Yt("",n,null,null,null):new Yt(re(n),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},ue.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)}},ue.prototype.possibleOutputs=function(){return[void 0]},ue.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 ce=function(t){this.type=Ht,this.input=t};ce.parse=function(t,e){if(2!==t.length)return e.error("Expected two arguments.");var n=e.parse(t[1],1,jt);return n?new ce(n):e.error("No image name provided.")},ce.prototype.evaluate=function(t){var e=this.input.evaluate(t),n=!1;return t.availableImages&&t.availableImages.indexOf(e)>-1&&(n=!0),new te({name:e,available:n})},ce.prototype.eachChild=function(t){t(this.input)},ce.prototype.possibleOutputs=function(){return[void 0]},ce.prototype.serialize=function(){return["image",this.input.serialize()]};var le={"to-boolean":Ft,"to-color":zt,"to-number":Dt,"to-string":jt},he=function(t,e){this.type=t,this.args=e};he.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=le[n],i=[],o=1;o<t.length;o++){var a=e.parse(t[o],o,Nt);if(!a)return null;i.push(a)}return new he(r,i)},he.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 Qt)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.":ee(e[0],e[1],e[2],e[3])))return new Qt(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new oe(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 c=Number(a);if(!isNaN(c))return c}throw new oe("Could not convert "+JSON.stringify(a)+" to number.")}return"formatted"===this.type.kind?$t.fromString(re(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?te.fromString(re(this.args[0].evaluate(t))):re(this.args[0].evaluate(t))},he.prototype.eachChild=function(t){this.args.forEach(t)},he.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.args.map((function(t){return t.possibleOutputs()})))},he.prototype.serialize=function(){if("formatted"===this.type.kind)return new ue([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new ce(this.args[0]).serialize();var t=["to-"+this.type.kind];return this.eachChild((function(e){t.push(e.serialize())})),t};var fe=["Unknown","Point","LineString","Polygon"],pe=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null};pe.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},pe.prototype.geometryType=function(){return this.feature?"number"==typeof this.feature.type?fe[this.feature.type]:this.feature.type:null},pe.prototype.properties=function(){return this.feature&&this.feature.properties||{}},pe.prototype.parseColor=function(t){var e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=Qt.parse(t)),e};var de=function(t,e,n,r){this.name=t,this.type=e,this._evaluate=n,this.args=r};de.prototype.evaluate=function(t){return this._evaluate(t,this.args)},de.prototype.eachChild=function(t){this.args.forEach(t)},de.prototype.possibleOutputs=function(){return[void 0]},de.prototype.serialize=function(){return[this.name].concat(this.args.map((function(t){return t.serialize()})))},de.parse=function(t,e){var n,r=t[0],i=de.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,c=0,l=s;c<l.length;c+=1){var h=l[c],f=h[0],p=h[1];u=new _e(e.registry,e.path,null,e.scope);for(var d=[],A=!1,g=1;g<t.length;g++){var m=t[g],y=Array.isArray(f)?f[g-1]:f.type,v=u.parse(m,1+d.length,y);if(!v){A=!0;break}d.push(v)}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 de(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(" | "),E=[],O=1;O<t.length;O++){var S=e.parse(t[O],1+E.length);if(!S)return null;E.push(qt(S.type))}e.error("Expected arguments of type "+w+", but found ("+E.join(", ")+") instead.")}return null},de.register=function(t,e){for(var n in de.definitions=e,e)t[n]=de};var Ae=function(t,e,n){this.type=Gt,this.locale=n,this.caseSensitive=t,this.diacriticSensitive=e};function ge(t){if(t instanceof de){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}var e=!0;return t.eachChild((function(t){e&&!ge(t)&&(e=!1)})),e}function me(t){if(t instanceof de&&"feature-state"===t.name)return!1;var e=!0;return t.eachChild((function(t){e&&!me(t)&&(e=!1)})),e}function ye(t,e){if(t instanceof de&&e.indexOf(t.name)>=0)return!1;var n=!0;return t.eachChild((function(t){n&&!ye(t,e)&&(n=!1)})),n}Ae.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,Ft);if(!r)return null;var i=e.parse(void 0!==n["diacritic-sensitive"]&&n["diacritic-sensitive"],1,Ft);if(!i)return null;var o=null;return n.locale&&!(o=e.parse(n.locale,1,jt))?null:new Ae(r,i,o)},Ae.prototype.evaluate=function(t){return new Kt(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)},Ae.prototype.eachChild=function(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)},Ae.prototype.possibleOutputs=function(){return[void 0]},Ae.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 ve=function(t,e){this.type=e.type,this.name=t,this.boundExpression=e};ve.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 ve(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)},ve.prototype.evaluate=function(t){return this.boundExpression.evaluate(t)},ve.prototype.eachChild=function(){},ve.prototype.possibleOutputs=function(){return[void 0]},ve.prototype.serialize=function(){return["var",this.name]};var _e=function(t,e,n,r,i){void 0===e&&(e=[]),void 0===r&&(r=new kt),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 be(t,e){for(var n,r,i=t.length-1,o=0,a=i,s=0;o<=a;)if(n=t[s=Math.floor((o+a)/2)],r=t[s+1],n<=e){if(s===i||e<r)return s;o=s+1}else{if(!(n>e))throw new oe("Input is not a number.");a=s-1}return 0}_e.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)},_e.prototype._parse=function(t,e){function n(t,e,n){return"assert"===n?new se(e,[t]):"coerce"===n?new he(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 ie)&&"resolvedImage"!==o.type.kind&&function t(e){if(e instanceof ve)return t(e.boundExpression);if(e instanceof de&&"error"===e.name)return!1;if(e instanceof Ae)return!1;var n=e instanceof he||e instanceof se,r=!0;return e.eachChild((function(e){r=n?r&&t(e):r&&e instanceof ie})),!!r&&ge(e)&&ye(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(o)){var u=new pe;try{o=new ie(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 void 0===t?this.error("'undefined' value invalid. Use null instead."):"object"==typeof t?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof t+" instead.")},_e.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 _e(this.registry,r,e||null,i,this.errors)},_e.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 Rt(r,t))},_e.prototype.checkSubtype=function(t,e){var n=Jt(t,e);return n&&this.error(n),n};var xe=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[0],s=o[1];this.labels.push(a),this.outputs.push(s)}};function we(t,e,n){return t*(1-n)+e*n}xe.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,Dt);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,c=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 l=e.parse(s,c,i);if(!l)return null;i=i||l.type,r.push([a,l])}return new xe(i,n,r)},xe.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[be(e,r)].evaluate(t)},xe.prototype.eachChild=function(t){t(this.input);for(var e=0,n=this.outputs;e<n.length;e+=1)t(n[e])},xe.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.outputs.map((function(t){return t.possibleOutputs()})))},xe.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 Ee=Object.freeze({__proto__:null,number:we,color:function(t,e,n){return new Qt(we(t.r,e.r,n),we(t.g,e.g,n),we(t.b,e.b,n),we(t.a,e.a,n))},array:function(t,e,n){return t.map((function(t,r){return we(t,e[r],n)}))}}),Oe=6/29,Se=3*Oe*Oe,Te=Math.PI/180,Ce=180/Math.PI;function Pe(t){return t>.008856451679035631?Math.pow(t,1/3):t/Se+4/29}function Me(t){return t>Oe?t*t*t:Se*(t-4/29)}function Ie(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Be(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Re(t){var e=Be(t.r),n=Be(t.g),r=Be(t.b),i=Pe((.4124564*e+.3575761*n+.1804375*r)/.95047),o=Pe((.2126729*e+.7151522*n+.072175*r)/1);return{l:116*o-16,a:500*(i-o),b:200*(o-Pe((.0193339*e+.119192*n+.9503041*r)/1.08883)),alpha:t.a}}function ke(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*Me(e),n=.95047*Me(n),r=1.08883*Me(r),new Qt(Ie(3.2404542*n-1.5371385*e-.4985314*r),Ie(-.969266*n+1.8760108*e+.041556*r),Ie(.0556434*n-.2040259*e+1.0572252*r),t.alpha)}function Le(t,e,n){var r=e-t;return t+n*(r>180||r<-180?r-360*Math.round(r/360):r)}var De={forward:Re,reverse:ke,interpolate:function(t,e,n){return{l:we(t.l,e.l,n),a:we(t.a,e.a,n),b:we(t.b,e.b,n),alpha:we(t.alpha,e.alpha,n)}}},je={forward:function(t){var e=Re(t),n=e.l,r=e.a,i=e.b,o=Math.atan2(i,r)*Ce;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*Te,n=t.c;return ke({l:t.l,a:Math.cos(e)*n,b:Math.sin(e)*n,alpha:t.alpha})},interpolate:function(t,e,n){return{h:Le(t.h,e.h,n),c:we(t.c,e.c,n),l:we(t.l,e.l,n),alpha:we(t.alpha,e.alpha,n)}}},Fe=Object.freeze({__proto__:null,lab:De,hcl:je}),ze=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[0],c=s[1];this.labels.push(u),this.outputs.push(c)}};function Ue(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)}ze.interpolationFactor=function(t,e,r,i){var o=0;if("exponential"===t.name)o=Ue(e,t.base,r,i);else if("linear"===t.name)o=Ue(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(Ue(e,1,r,i))}return o},ze.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,Dt)))return null;var u=[],c=null;"interpolate-hcl"===n||"interpolate-lab"===n?c=zt:e.expectedType&&"value"!==e.expectedType.kind&&(c=e.expectedType);for(var l=0;l<o.length;l+=2){var h=o[l],f=o[l+1],p=l+3,d=l+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,c);if(!A)return null;c=c||A.type,u.push([h,A])}return"number"===c.kind||"color"===c.kind||"array"===c.kind&&"number"===c.itemType.kind&&"number"==typeof c.N?new ze(c,n,r,i,u):e.error("Type "+qt(c)+" is not interpolatable.")},ze.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=be(e,r),a=e[o],s=e[o+1],u=ze.interpolationFactor(this.interpolation,r,a,s),c=n[o].evaluate(t),l=n[o+1].evaluate(t);return"interpolate"===this.operator?Ee[this.type.kind.toLowerCase()](c,l,u):"interpolate-hcl"===this.operator?je.reverse(je.interpolate(je.forward(c),je.forward(l),u)):De.reverse(De.interpolate(De.forward(c),De.forward(l),u))},ze.prototype.eachChild=function(t){t(this.input);for(var e=0,n=this.outputs;e<n.length;e+=1)t(n[e])},ze.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.outputs.map((function(t){return t.possibleOutputs()})))},ze.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 Ne=function(t,e){this.type=t,this.args=e};Ne.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=a[o],u=e.parse(s,1+i.length,n,void 0,{typeAnnotation:"omit"});if(!u)return null;n=n||u.type,i.push(u)}var c=r&&i.some((function(t){return Jt(r,t.type)}));return new Ne(c?Nt:n,i)},Ne.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 te&&!n.available&&(e||(e=n.name),n=null,r===this.args.length&&(n=e)),null===n);i+=1);return n},Ne.prototype.eachChild=function(t){this.args.forEach(t)},Ne.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.args.map((function(t){return t.possibleOutputs()})))},Ne.prototype.serialize=function(){var t=["coalesce"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Ge=function(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e};Ge.prototype.evaluate=function(t){return this.result.evaluate(t)},Ge.prototype.eachChild=function(t){for(var e=0,n=this.bindings;e<n.length;e+=1)t(n[e][1]);t(this.result)},Ge.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 Ge(n,a):null},Ge.prototype.possibleOutputs=function(){return this.result.possibleOutputs()},Ge.prototype.serialize=function(){for(var t=["let"],e=0,n=this.bindings;e<n.length;e+=1){var r=n[e],i=r[0],o=r[1];t.push(i,o.serialize())}return t.push(this.result.serialize()),t};var Ve=function(t,e,n){this.type=t,this.index=e,this.input=n};Ve.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,Dt),r=e.parse(t[2],2,Wt(e.expectedType||Nt));if(!n||!r)return null;var i=r.type;return new Ve(i.itemType,n,r)},Ve.prototype.evaluate=function(t){var e=this.index.evaluate(t),n=this.input.evaluate(t);if(e<0)throw new oe("Array index out of bounds: "+e+" < 0.");if(e>=n.length)throw new oe("Array index out of bounds: "+e+" > "+(n.length-1)+".");if(e!==Math.floor(e))throw new oe("Array index must be an integer, but found "+e+" instead.");return n[e]},Ve.prototype.eachChild=function(t){t(this.index),t(this.input)},Ve.prototype.possibleOutputs=function(){return[void 0]},Ve.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var He=function(t,e){this.type=Ft,this.needle=t,this.haystack=e};He.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var n,r=e.parse(t[1],1,Nt),i=e.parse(t[2],2,Nt);return r&&i?"boolean"!==(n=r.type).kind&&"string"!==n.kind&&"number"!==n.kind&&"null"!==n.kind&&"value"!==n.kind?e.error("Expected first argument to be of type boolean, string, number or null, but found "+qt(r.type)+" instead"):new He(r,i):null},He.prototype.evaluate=function(t){var e=this.needle.evaluate(t),n=this.haystack.evaluate(t);if(!e||!n)return!1;if(!function(t){return"boolean"==typeof t||"string"==typeof t||"number"==typeof t}(e))throw new oe("Expected first argument to be of type boolean, string or number, but found "+qt(ne(e))+" instead.");if(!function(t){return Array.isArray(t)||"string"==typeof t}(n))throw new oe("Expected second argument to be of type array or string, but found "+qt(ne(n))+" instead.");return n.indexOf(e)>=0},He.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},He.prototype.possibleOutputs=function(){return[!0,!1]},He.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var We=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};We.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 c=e.concat(a);if(0===s.length)return c.error("Expected at least one branch label.");for(var l=0,h=s;l<h.length;l+=1){var f=h[l];if("number"!=typeof f&&"string"!=typeof f)return c.error("Branch labels must be numbers or strings.");if("number"==typeof f&&Math.abs(f)>Number.MAX_SAFE_INTEGER)return c.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof f&&Math.floor(f)!==f)return c.error("Numeric branch labels must be integer values.");if(n){if(c.checkSubtype(n,ne(f)))return null}else n=ne(f);if(void 0!==i[String(f)])return c.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,Nt);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 We(n,r,d,i,o,A):null},We.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(ne(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},We.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},We.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.outputs.map((function(t){return t.possibleOutputs()}))).concat(this.otherwise.possibleOutputs())},We.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,c=n;u<c.length;u+=1){var l=c[u],h=l[0],f=l[1];1===f.length?e.push(s(f[0])):e.push(f.map(s)),e.push(this.outputs[outputIndex$1].serialize())}return e.push(this.otherwise.serialize()),e};var qe=function(t,e,n){this.type=t,this.branches=e,this.otherwise=n};function Xe(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 Je(t,e,n,r){return 0===r.compare(e,n)}function Ze(t,e,n){var r="=="!==t&&"!="!==t;return function(){function i(t,e,n){this.type=Ft,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,Nt);if(!o)return null;if(!Xe(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,Nt);if(!a)return null;if(!Xe(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 se(a.type,[o]):"value"!==o.type.kind&&"value"===a.type.kind&&(a=new se(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,Gt)))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=ne(o),u=ne(a);if(s.kind!==u.kind||"string"!==s.kind&&"number"!==s.kind)throw new oe('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 c=ne(o),l=ne(a);if("string"!==c.kind||"string"!==l.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.possibleOutputs=function(){return[!0,!1]},i.prototype.serialize=function(){var e=[t];return this.eachChild((function(t){e.push(t.serialize())})),e},i}()}qe.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,Ft);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 qe(n,r,s):null},qe.prototype.evaluate=function(t){for(var e=0,n=this.branches;e<n.length;e+=1){var r=n[e],i=r[0],o=r[1];if(i.evaluate(t))return o.evaluate(t)}return this.otherwise.evaluate(t)},qe.prototype.eachChild=function(t){for(var e=0,n=this.branches;e<n.length;e+=1){var r=n[e],i=r[0],o=r[1];t(i),t(o)}t(this.otherwise)},qe.prototype.possibleOutputs=function(){var t;return(t=[]).concat.apply(t,this.branches.map((function(t){return t[0],t[1].possibleOutputs()}))).concat(this.otherwise.possibleOutputs())},qe.prototype.serialize=function(){var t=["case"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Qe=Ze("==",(function(t,e,n){return e===n}),Je),Ke=Ze("!=",(function(t,e,n){return e!==n}),(function(t,e,n,r){return!Je(0,e,n,r)})),Ye=Ze("<",(function(t,e,n){return e<n}),(function(t,e,n,r){return r.compare(e,n)<0})),$e=Ze(">",(function(t,e,n){return e>n}),(function(t,e,n,r){return r.compare(e,n)>0})),tn=Ze("<=",(function(t,e,n){return e<=n}),(function(t,e,n,r){return r.compare(e,n)<=0})),en=Ze(">=",(function(t,e,n){return e>=n}),(function(t,e,n,r){return r.compare(e,n)>=0})),nn=function(t,e,n,r,i){this.type=jt,this.number=t,this.locale=e,this.currency=n,this.minFractionDigits=r,this.maxFractionDigits=i};nn.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var n=e.parse(t[1],1,Dt);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,jt)))return null;var o=null;if(r.currency&&!(o=e.parse(r.currency,1,jt)))return null;var a=null;if(r["min-fraction-digits"]&&!(a=e.parse(r["min-fraction-digits"],1,Dt)))return null;var s=null;return r["max-fraction-digits"]&&!(s=e.parse(r["max-fraction-digits"],1,Dt))?null:new nn(n,i,o,a,s)},nn.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))},nn.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)},nn.prototype.possibleOutputs=function(){return[void 0]},nn.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 rn=function(t){this.type=Dt,this.input=t};rn.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 rn(n):null},rn.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 oe("Expected value to be of type string or array, but found "+qt(ne(e))+" instead.")},rn.prototype.eachChild=function(t){t(this.input)},rn.prototype.possibleOutputs=function(){return[void 0]},rn.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var on={"==":Qe,"!=":Ke,">":$e,"<":Ye,">=":en,"<=":tn,array:se,at:Ve,boolean:se,case:qe,coalesce:Ne,collator:Ae,format:ue,image:ce,in:He,interpolate:ze,"interpolate-hcl":ze,"interpolate-lab":ze,length:rn,let:Ge,literal:ie,match:We,number:se,"number-format":nn,object:se,step:xe,string:se,"to-boolean":he,"to-color":he,"to-number":he,"to-string":he,var:ve};function an(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=ee(n,r,i,a);if(s)throw new oe(s);return new Qt(n/255*a,r/255*a,i/255*a,a)}function sn(t,e){return t in e}function un(t,e){var n=e[t];return void 0===n?null:n}function cn(t){return{type:t}}function ln(t){return{result:"success",value:t}}function hn(t){return{result:"error",value:t}}function fn(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function pn(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function dn(t){return!!t.expression&&t.expression.interpolated}function An(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function gn(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function mn(t){return t}function yn(t,e,n){return void 0!==t?t:void 0!==e?e:void 0!==n?n:void 0}function vn(t,e,n,r,i){return yn(typeof n===i?r[n]:void 0,t.default,e.default)}function _n(t,e,n){if("number"!==An(n))return yn(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=be(t.stops.map((function(t){return t[0]})),n);return t.stops[i][1]}function bn(t,e,n){var r=void 0!==t.base?t.base:1;if("number"!==An(n))return yn(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=be(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],c=Ee[e.type]||mn;if(t.colorSpace&&"rgb"!==t.colorSpace){var l=Fe[t.colorSpace];c=function(t,e){return l.reverse(l.interpolate(l.forward(t),l.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 c(n,r,a)}}:c(s,u,a)}function xn(t,e,n){return"color"===e.type?n=Qt.parse(n):"formatted"===e.type?n=$t.fromString(n.toString()):"resolvedImage"===e.type?n=te.fromString(n.toString()):An(n)===e.type||"enum"===e.type&&e.values[n]||(n=void 0),yn(n,t.default,e.default)}de.register(on,{error:[{kind:"error"},[jt],function(t,e){var n=e[0];throw new oe(n.evaluate(t))}],typeof:[jt,[Nt],function(t,e){return qt(ne(e[0].evaluate(t)))}],"to-rgba":[Wt(Dt,4),[zt],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[zt,[Dt,Dt,Dt],an],rgba:[zt,[Dt,Dt,Dt,Dt],an],has:{type:Ft,overloads:[[[jt],function(t,e){return sn(e[0].evaluate(t),t.properties())}],[[jt,Ut],function(t,e){var n=e[0],r=e[1];return sn(n.evaluate(t),r.evaluate(t))}]]},get:{type:Nt,overloads:[[[jt],function(t,e){return un(e[0].evaluate(t),t.properties())}],[[jt,Ut],function(t,e){var n=e[0],r=e[1];return un(n.evaluate(t),r.evaluate(t))}]]},"feature-state":[Nt,[jt],function(t,e){return un(e[0].evaluate(t),t.featureState||{})}],properties:[Ut,[],function(t){return t.properties()}],"geometry-type":[jt,[],function(t){return t.geometryType()}],id:[Nt,[],function(t){return t.id()}],zoom:[Dt,[],function(t){return t.globals.zoom}],"heatmap-density":[Dt,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[Dt,[],function(t){return t.globals.lineProgress||0}],accumulated:[Nt,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[Dt,cn(Dt),function(t,e){for(var n=0,r=0,i=e;r<i.length;r+=1)n+=i[r].evaluate(t);return n}],"*":[Dt,cn(Dt),function(t,e){for(var n=1,r=0,i=e;r<i.length;r+=1)n*=i[r].evaluate(t);return n}],"-":{type:Dt,overloads:[[[Dt,Dt],function(t,e){var n=e[0],r=e[1];return n.evaluate(t)-r.evaluate(t)}],[[Dt],function(t,e){return-e[0].evaluate(t)}]]},"/":[Dt,[Dt,Dt],function(t,e){var n=e[0],r=e[1];return n.evaluate(t)/r.evaluate(t)}],"%":[Dt,[Dt,Dt],function(t,e){var n=e[0],r=e[1];return n.evaluate(t)%r.evaluate(t)}],ln2:[Dt,[],function(){return Math.LN2}],pi:[Dt,[],function(){return Math.PI}],e:[Dt,[],function(){return Math.E}],"^":[Dt,[Dt,Dt],function(t,e){var n=e[0],r=e[1];return Math.pow(n.evaluate(t),r.evaluate(t))}],sqrt:[Dt,[Dt],function(t,e){var n=e[0];return Math.sqrt(n.evaluate(t))}],log10:[Dt,[Dt],function(t,e){var n=e[0];return Math.log(n.evaluate(t))/Math.LN10}],ln:[Dt,[Dt],function(t,e){var n=e[0];return Math.log(n.evaluate(t))}],log2:[Dt,[Dt],function(t,e){var n=e[0];return Math.log(n.evaluate(t))/Math.LN2}],sin:[Dt,[Dt],function(t,e){var n=e[0];return Math.sin(n.evaluate(t))}],cos:[Dt,[Dt],function(t,e){var n=e[0];return Math.cos(n.evaluate(t))}],tan:[Dt,[Dt],function(t,e){var n=e[0];return Math.tan(n.evaluate(t))}],asin:[Dt,[Dt],function(t,e){var n=e[0];return Math.asin(n.evaluate(t))}],acos:[Dt,[Dt],function(t,e){var n=e[0];return Math.acos(n.evaluate(t))}],atan:[Dt,[Dt],function(t,e){var n=e[0];return Math.atan(n.evaluate(t))}],min:[Dt,cn(Dt),function(t,e){return Math.min.apply(Math,e.map((function(e){return e.evaluate(t)})))}],max:[Dt,cn(Dt),function(t,e){return Math.max.apply(Math,e.map((function(e){return e.evaluate(t)})))}],abs:[Dt,[Dt],function(t,e){var n=e[0];return Math.abs(n.evaluate(t))}],round:[Dt,[Dt],function(t,e){var n=e[0].evaluate(t);return n<0?-Math.round(-n):Math.round(n)}],floor:[Dt,[Dt],function(t,e){var n=e[0];return Math.floor(n.evaluate(t))}],ceil:[Dt,[Dt],function(t,e){var n=e[0];return Math.ceil(n.evaluate(t))}],"filter-==":[Ft,[jt,Nt],function(t,e){var n=e[0],r=e[1];return t.properties()[n.value]===r.value}],"filter-id-==":[Ft,[Nt],function(t,e){var n=e[0];return t.id()===n.value}],"filter-type-==":[Ft,[jt],function(t,e){var n=e[0];return t.geometryType()===n.value}],"filter-<":[Ft,[jt,Nt],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-<":[Ft,[Nt],function(t,e){var n=e[0],r=t.id(),i=n.value;return typeof r==typeof i&&r<i}],"filter->":[Ft,[jt,Nt],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->":[Ft,[Nt],function(t,e){var n=e[0],r=t.id(),i=n.value;return typeof r==typeof i&&r>i}],"filter-<=":[Ft,[jt,Nt],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-<=":[Ft,[Nt],function(t,e){var n=e[0],r=t.id(),i=n.value;return typeof r==typeof i&&r<=i}],"filter->=":[Ft,[jt,Nt],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->=":[Ft,[Nt],function(t,e){var n=e[0],r=t.id(),i=n.value;return typeof r==typeof i&&r>=i}],"filter-has":[Ft,[Nt],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[Ft,[],function(t){return null!==t.id()}],"filter-type-in":[Ft,[Wt(jt)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[Ft,[Wt(Nt)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[Ft,[jt,Wt(Nt)],function(t,e){var n=e[0];return e[1].value.indexOf(t.properties()[n.value])>=0}],"filter-in-large":[Ft,[jt,Wt(Nt)],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:Ft,overloads:[[[Ft,Ft],function(t,e){var n=e[0],r=e[1];return n.evaluate(t)&&r.evaluate(t)}],[cn(Ft),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:Ft,overloads:[[[Ft,Ft],function(t,e){var n=e[0],r=e[1];return n.evaluate(t)||r.evaluate(t)}],[cn(Ft),function(t,e){for(var n=0,r=e;n<r.length;n+=1)if(r[n].evaluate(t))return!0;return!1}]]},"!":[Ft,[Ft],function(t,e){return!e[0].evaluate(t)}],"is-supported-script":[Ft,[jt],function(t,e){var n=e[0],r=t.globals&&t.globals.isSupportedScript;return!r||r(n.evaluate(t))}],upcase:[jt,[jt],function(t,e){return e[0].evaluate(t).toUpperCase()}],downcase:[jt,[jt],function(t,e){return e[0].evaluate(t).toLowerCase()}],concat:[jt,cn(Nt),function(t,e){return e.map((function(e){return re(e.evaluate(t))})).join("")}],"resolved-locale":[jt,[Gt],function(t,e){return e[0].evaluate(t).resolvedLocale()}]});var wn=function(t,e){this.expression=t,this._warningHistory={},this._evaluator=new pe,this._defaultValue=e?function(t){return"color"===t.type&&gn(t.default)?new Qt(0,0,0,0):"color"===t.type?Qt.parse(t.default)||null:void 0===t.default?null:t.default}(e):null,this._enumValues=e&&"enum"===e.type?e.values:null};function En(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in on}function On(t,e){var n=new _e(on,[],e?function(t){var e={color:zt,string:jt,number:Dt,enum:jt,boolean:Ft,formatted:Vt,resolvedImage:Ht};return"array"===t.type?Wt(e[t.value]||Nt,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?ln(new wn(r,e)):hn(n.errors)}wn.prototype.evaluateWithoutErrorHandling=function(t,e,n,r,i){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=n,this._evaluator.availableImages=r||null,this._evaluator.formattedSection=i,this.expression.evaluate(this._evaluator)},wn.prototype.evaluate=function(t,e,n,r,i){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=n||null,this._evaluator.availableImages=r||null,this._evaluator.formattedSection=i||null;try{var o=this.expression.evaluate(this._evaluator);if(null==o||"number"==typeof o&&o!=o)return this._defaultValue;if(this._enumValues&&!(o in this._enumValues))throw new oe("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(o)+" instead.");return o}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var Sn=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!me(e.expression)};Sn.prototype.evaluateWithoutErrorHandling=function(t,e,n,r,i){return this._styleExpression.evaluateWithoutErrorHandling(t,e,n,r,i)},Sn.prototype.evaluate=function(t,e,n,r,i){return this._styleExpression.evaluate(t,e,n,r,i)};var Tn=function(t,e,n,r){this.kind=t,this.zoomStops=n,this._styleExpression=e,this.isStateDependent="camera"!==t&&!me(e.expression),this.interpolationType=r};function Cn(t,e){if("error"===(t=On(t,e)).result)return t;var n=t.value.expression,r=ge(n);if(!r&&!fn(e))return hn([new Rt("","data expressions not supported")]);var i=ye(n,["zoom"]);if(!i&&!pn(e))return hn([new Rt("","zoom expressions not supported")]);var o=function t(e){var n=null;if(e instanceof Ge)n=t(e.result);else if(e instanceof Ne)for(var r=0,i=e.args;r<i.length;r+=1){var o=i[r];if(n=t(o))break}else(e instanceof xe||e instanceof ze)&&e.input instanceof de&&"zoom"===e.input.name&&(n=e);return n instanceof Rt||e.eachChild((function(e){var r=t(e);r instanceof Rt?n=r:!n&&r?n=new Rt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):n&&r&&n!==r&&(n=new Rt("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),n}(n);if(!o&&!i)return hn([new Rt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(o instanceof Rt)return hn([o]);if(o instanceof ze&&!dn(e))return hn([new Rt("",'"interpolate" expressions cannot be used with this property')]);if(!o)return ln(new Sn(r?"constant":"source",t.value));var a=o instanceof ze?o.interpolation:void 0;return ln(new Tn(r?"camera":"composite",t.value,o.labels,a))}Tn.prototype.evaluateWithoutErrorHandling=function(t,e,n,r,i){return this._styleExpression.evaluateWithoutErrorHandling(t,e,n,r,i)},Tn.prototype.evaluate=function(t,e,n,r,i){return this._styleExpression.evaluate(t,e,n,r,i)},Tn.prototype.interpolationFactor=function(t,e,n){return this.interpolationType?ze.interpolationFactor(this.interpolationType,t,e,n):0};var Pn=function(t,e){this._parameters=t,this._specification=e,Mt(this,function t(e,n){var r,i,o,a="color"===n.type,s=e.stops&&"object"==typeof e.stops[0][0],u=s||void 0!==e.property,c=s||!u,l=e.type||(dn(n)?"exponential":"interval");if(a&&((e=Mt({},e)).stops&&(e.stops=e.stops.map((function(t){return[t[0],Qt.parse(t[1])]}))),e.default?e.default=Qt.parse(e.default):e.default=Qt.parse(n.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!Fe[e.colorSpace])throw new Error("Unknown color space: "+e.colorSpace);if("exponential"===l)r=bn;else if("interval"===l)r=_n;else if("categorical"===l){r=vn,i=Object.create(null);for(var h=0,f=e.stops;h<f.length;h+=1){var p=f[h];i[p[0]]=p[1]}o=typeof e.stops[0][0]}else{if("identity"!==l)throw new Error('Unknown function type "'+l+'"');r=xn}if(s){for(var d={},A=[],g=0;g<e.stops.length;g++){var m=e.stops[g],y=m[0].zoom;void 0===d[y]&&(d[y]={zoom:y,type:e.type,property:e.property,default:e.default,stops:[]},A.push(y)),d[y].stops.push([m[0].value,m[1]])}for(var v=[],_=0,b=A;_<b.length;_+=1){var x=b[_];v.push([d[x].zoom,t(d[x],n)])}var w={name:"linear"};return{kind:"composite",interpolationType:w,interpolationFactor:ze.interpolationFactor.bind(void 0,w),zoomStops:v.map((function(t){return t[0]})),evaluate:function(t,r){var i=t.zoom;return bn({stops:v,base:e.base},n,i).evaluate(i,r)}}}if(c){var E="exponential"===l?{name:"exponential",base:void 0!==e.base?e.base:1}:null;return{kind:"camera",interpolationType:E,interpolationFactor:ze.interpolationFactor.bind(void 0,E),zoomStops:e.stops.map((function(t){return t[0]})),evaluate:function(t){var a=t.zoom;return r(e,n,a,i,o)}}}return{kind:"source",evaluate:function(t,a){var s=a&&a.properties?a.properties[e.property]:void 0;return void 0===s?yn(e.default,n.default):r(e,n,s,i,o)}}}(this._parameters,this._specification))};function Mn(t){var e=t.key,n=t.value,r=t.valueSpec||{},i=t.objectElementValidators||{},o=t.style,a=t.styleSpec,s=[],u=An(n);if("object"!==u)return[new Ct(e,n,"object expected, "+u+" found")];for(var c in n){var l=c.split(".")[0],h=r[l]||r["*"],f=void 0;if(i[l])f=i[l];else if(r[l])f=tr;else if(i["*"])f=i["*"];else{if(!r["*"]){s.push(new Ct(e,n[c],'unknown property "'+c+'"'));continue}f=tr}s=s.concat(f({key:(e?e+".":e)+c,value:n[c],valueSpec:h,style:o,styleSpec:a,object:n,objectKey:c},n))}for(var p in r)i[p]||r[p].required&&void 0===r[p].default&&void 0===n[p]&&s.push(new Ct(e,n,'missing required property "'+p+'"'));return s}function In(t){var e=t.value,n=t.valueSpec,r=t.style,i=t.styleSpec,o=t.key,a=t.arrayElementValidator||tr;if("array"!==An(e))return[new Ct(o,e,"array expected, "+An(e)+" found")];if(n.length&&e.length!==n.length)return[new Ct(o,e,"array length "+n.length+" expected, length "+e.length+" found")];if(n["min-length"]&&e.length<n["min-length"])return[new Ct(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"===An(n.value)&&(s=n.value);for(var u=[],c=0;c<e.length;c++)u=u.concat(a({array:e,arrayIndex:c,value:e[c],valueSpec:s,style:r,styleSpec:i,key:o+"["+c+"]"}));return u}function Bn(t){var e=t.key,n=t.value,r=t.valueSpec,i=An(n);return"number"===i&&n!=n&&(i="NaN"),"number"!==i?[new Ct(e,n,"number expected, "+i+" found")]:"minimum"in r&&n<r.minimum?[new Ct(e,n,n+" is less than the minimum value "+r.minimum)]:"maximum"in r&&n>r.maximum?[new Ct(e,n,n+" is greater than the maximum value "+r.maximum)]:[]}function Rn(t){var e,n,r,i=t.valueSpec,o=It(t.value.type),a={},s="categorical"!==o&&void 0===t.value.property,u=!s,c="array"===An(t.value.stops)&&"array"===An(t.value.stops[0])&&"object"===An(t.value.stops[0][0]),l=Mn({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 Ct(t.key,t.value,'identity function may not have a "stops" property')];var e=[],n=t.value;return e=e.concat(In({key:t.key,value:n,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:h})),"array"===An(n)&&0===n.length&&e.push(new Ct(t.key,n,"array must have at least one stop")),e},default:function(t){return tr({key:t.key,value:t.value,valueSpec:i,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===o&&s&&l.push(new Ct(t.key,t.value,'missing required property "property"')),"identity"===o||t.value.stops||l.push(new Ct(t.key,t.value,'missing required property "stops"')),"exponential"===o&&t.valueSpec.expression&&!dn(t.valueSpec)&&l.push(new Ct(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(u&&!fn(t.valueSpec)?l.push(new Ct(t.key,t.value,"property functions not supported")):s&&!pn(t.valueSpec)&&l.push(new Ct(t.key,t.value,"zoom functions not supported"))),"categorical"!==o&&!c||void 0!==t.value.property||l.push(new Ct(t.key,t.value,'"property" property is required')),l;function h(t){var e=[],o=t.value,s=t.key;if("array"!==An(o))return[new Ct(s,o,"array expected, "+An(o)+" found")];if(2!==o.length)return[new Ct(s,o,"array length 2 expected, length "+o.length+" found")];if(c){if("object"!==An(o[0]))return[new Ct(s,o,"object expected, "+An(o[0])+" found")];if(void 0===o[0].zoom)return[new Ct(s,o,"object stop key must have zoom")];if(void 0===o[0].value)return[new Ct(s,o,"object stop key must have value")];if(r&&r>It(o[0].zoom))return[new Ct(s,o[0].zoom,"stop zoom values must appear in ascending order")];It(o[0].zoom)!==r&&(r=It(o[0].zoom),n=void 0,a={}),e=e.concat(Mn({key:s+"[0]",value:o[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:Bn,value:f}}))}else e=e.concat(f({key:s+"[0]",value:o[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},o));return En(Bt(o[1]))?e.concat([new Ct(s+"[1]",o[1],"expressions are not allowed in function stops.")]):e.concat(tr({key:s+"[1]",value:o[1],valueSpec:i,style:t.style,styleSpec:t.styleSpec}))}function f(t,r){var s=An(t.value),u=It(t.value),c=null!==t.value?t.value:r;if(e){if(s!==e)return[new Ct(t.key,c,s+" stop domain type must match previous stop domain type "+e)]}else e=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new Ct(t.key,c,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==o){var l="number expected, "+s+" found";return fn(i)&&void 0===o&&(l+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Ct(t.key,c,l)]}return"categorical"!==o||"number"!==s||isFinite(u)&&Math.floor(u)===u?"categorical"!==o&&"number"===s&&void 0!==n&&u<n?[new Ct(t.key,c,"stop domain values must appear in ascending order")]:(n=u,"categorical"===o&&u in a?[new Ct(t.key,c,"stop domain values must be unique")]:(a[u]=!0,[])):[new Ct(t.key,c,"integer expected, found "+u)]}}function kn(t){var e=("property"===t.expressionContext?Cn:On)(Bt(t.value),t.valueSpec);if("error"===e.result)return e.value.map((function(e){return new Ct(""+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&&-1!==n.possibleOutputs().indexOf(void 0))return[new Ct(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&&!me(n))return[new Ct(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext&&!me(n))return[new Ct(t.key,t.value,'"feature-state" data expressions are not supported with filters.')];if(t.expressionContext&&0===t.expressionContext.indexOf("cluster")){if(!ye(n,["zoom","feature-state"]))return[new Ct(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!ge(n))return[new Ct(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Ln(t){var e=t.key,n=t.value,r=t.valueSpec,i=[];return Array.isArray(r.values)?-1===r.values.indexOf(It(n))&&i.push(new Ct(e,n,"expected one of ["+r.values.join(", ")+"], "+JSON.stringify(n)+" found")):-1===Object.keys(r.values).indexOf(It(n))&&i.push(new Ct(e,n,"expected one of ["+Object.keys(r.values).join(", ")+"], "+JSON.stringify(n)+" found")),i}function Dn(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&&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(!Dn(r)&&"boolean"!=typeof r)return!1}return!0;default:return!0}}Pn.deserialize=function(t){return new Pn(t._parameters,t._specification)},Pn.serialize=function(t){return{_parameters:t._parameters,_specification:t._specification}};var jn={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Fn(t){if(null==t)return function(){return!0};Dn(t)||(t=Un(t));var e=On(t,jn);if("error"===e.result)throw new Error(e.value.map((function(t){return t.key+": "+t.message})).join(", "));return function(t,n){return e.value.evaluate(t,n)}}function zn(t,e){return t<e?-1:t>e?1:0}function Un(t){if(!t)return!0;var e,n=t[0];return t.length<=1?"any"!==n:"=="===n?Nn(t[1],t[2],"=="):"!="===n?Hn(Nn(t[1],t[2],"==")):"<"===n||">"===n||"<="===n||">="===n?Nn(t[1],t[2],n):"any"===n?(e=t.slice(1),["any"].concat(e.map(Un))):"all"===n?["all"].concat(t.slice(1).map(Un)):"none"===n?["all"].concat(t.slice(1).map(Un).map(Hn)):"in"===n?Gn(t[1],t.slice(2)):"!in"===n?Hn(Gn(t[1],t.slice(2))):"has"===n?Vn(t[1]):"!has"!==n||Hn(Vn(t[1]))}function Nn(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 Gn(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(zn)]]:["filter-in-small",t,["literal",e]]}}function Vn(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function Hn(t){return["!",t]}function Wn(t){return Dn(Bt(t.value))?kn(Mt({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var n=e.value,r=e.key;if("array"!==An(n))return[new Ct(r,n,"array expected, "+An(n)+" found")];var i,o=e.styleSpec,a=[];if(n.length<1)return[new Ct(r,n,"filter array must have at least 1 element")];switch(a=a.concat(Ln({key:r+"[0]",value:n[0],valueSpec:o.filter_operator,style:e.style,styleSpec:e.styleSpec})),It(n[0])){case"<":case"<=":case">":case">=":n.length>=2&&"$type"===It(n[1])&&a.push(new Ct(r,n,'"$type" cannot be use with operator "'+n[0]+'"'));case"==":case"!=":3!==n.length&&a.push(new Ct(r,n,'filter array for operator "'+n[0]+'" must have 3 elements'));case"in":case"!in":n.length>=2&&"string"!==(i=An(n[1]))&&a.push(new Ct(r+"[1]",n[1],"string expected, "+i+" found"));for(var s=2;s<n.length;s++)i=An(n[s]),"$type"===It(n[1])?a=a.concat(Ln({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 Ct(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=An(n[1]),2!==n.length?a.push(new Ct(r,n,'filter array for "'+n[0]+'" operator must have 2 elements')):"string"!==i&&a.push(new Ct(r+"[1]",n[1],"string expected, "+i+" found"))}return a}(t)}function qn(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 tr({key:n,value:o,valueSpec:i.transition,style:r,styleSpec:i});var c,l=t.valueSpec||s[a];if(!l)return[new Ct(n,o,'unknown property "'+a+'"')];if("string"===An(o)&&fn(l)&&!l.tokens&&(c=/^{([^}]+)}$/.exec(o)))return[new Ct(n,o,'"'+a+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(c[1])+" }`.")];var h=[];return"symbol"===t.layerType&&("text-field"===a&&r&&!r.glyphs&&h.push(new Ct(n,o,'use of "text-field" requires a style "glyphs" property')),"text-font"===a&&gn(Bt(o))&&"identity"===It(o.type)&&h.push(new Ct(n,o,'"text-font" does not support identity functions'))),h.concat(tr({key:t.key,value:o,valueSpec:l,style:r,styleSpec:i,expressionContext:"property",propertyType:e,propertyKey:a}))}function Xn(t){return qn(t,"paint")}function Jn(t){return qn(t,"layout")}function Zn(t){var e=[],n=t.value,r=t.key,i=t.style,o=t.styleSpec;n.type||n.ref||e.push(new Ct(r,n,'either "type" or "ref" is required'));var a,s=It(n.type),u=It(n.ref);if(n.id)for(var c=It(n.id),l=0;l<t.arrayIndex;l++){var h=i.layers[l];It(h.id)===c&&e.push(new Ct(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 Ct(r,n[t],'"'+t+'" is prohibited for ref layers'))})),i.layers.forEach((function(t){It(t.id)===u&&(a=t)})),a?a.ref?e.push(new Ct(r,n.ref,"ref cannot reference another ref layer")):s=It(a.type):e.push(new Ct(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&&It(f.type);f?"vector"===p&&"raster"===s?e.push(new Ct(r,n.source,'layer "'+n.id+'" requires a raster source')):"raster"===p&&"raster"!==s?e.push(new Ct(r,n.source,'layer "'+n.id+'" requires a vector source')):"vector"!==p||n["source-layer"]?"raster-dem"===p&&"hillshade"!==s?e.push(new Ct(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 Ct(r,n,'layer "'+n.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):e.push(new Ct(r,n,'layer "'+n.id+'" must specify a "source-layer"')):e.push(new Ct(r,n.source,'source "'+n.source+'" not found'))}else e.push(new Ct(r,n,'missing required property "source"'));return e=e.concat(Mn({key:r,value:n,valueSpec:o.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return tr({key:r+".type",value:n.type,valueSpec:o.layer.type,style:t.style,styleSpec:t.styleSpec,object:n,objectKey:"type"})},filter:Wn,layout:function(t){return Mn({layer:n,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return Jn(Mt({layerType:s},t))}}})},paint:function(t){return Mn({layer:n,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return Xn(Mt({layerType:s},t))}}})}}}))}function Qn(t){var e=t.value,n=t.key,r=t.styleSpec,i=t.style;if(!e.type)return[new Ct(n,e,'"type" is required')];var o,a=It(e.type);switch(a){case"vector":case"raster":case"raster-dem":return Mn({key:n,value:e,valueSpec:r["source_"+a.replace("-","_")],style:t.style,styleSpec:r});case"geojson":if(o=Mn({key:n,value:e,valueSpec:r.source_geojson,style:i,styleSpec:r}),e.cluster)for(var s in e.clusterProperties){var u=e.clusterProperties[s],c=u[0],l=u[1],h="string"==typeof c?[c,["accumulated"],["get",s]]:c;o.push.apply(o,kn({key:n+"."+s+".map",value:l,expressionContext:"cluster-map"})),o.push.apply(o,kn({key:n+"."+s+".reduce",value:h,expressionContext:"cluster-reduce"}))}return o;case"video":return Mn({key:n,value:e,valueSpec:r.source_video,style:i,styleSpec:r});case"image":return Mn({key:n,value:e,valueSpec:r.source_image,style:i,styleSpec:r});case"canvas":return[new Ct(n,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Ln({key:n+".type",value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:i,styleSpec:r})}}function Kn(t){var e=t.value,n=t.styleSpec,r=n.light,i=t.style,o=[],a=An(e);if(void 0===e)return o;if("object"!==a)return o.concat([new Ct("light",e,"object expected, "+a+" found")]);for(var s in e){var u=s.match(/^(.*)-transition$/);o=u&&r[u[1]]&&r[u[1]].transition?o.concat(tr({key:s,value:e[s],valueSpec:n.transition,style:i,styleSpec:n})):r[s]?o.concat(tr({key:s,value:e[s],valueSpec:r[s],style:i,styleSpec:n})):o.concat([new Ct(s,e[s],'unknown property "'+s+'"')])}return o}function Yn(t){var e=t.value,n=t.key,r=An(e);return"string"!==r?[new Ct(n,e,"string expected, "+r+" found")]:[]}var $n={"*":function(){return[]},array:In,boolean:function(t){var e=t.value,n=t.key,r=An(e);return"boolean"!==r?[new Ct(n,e,"boolean expected, "+r+" found")]:[]},number:Bn,color:function(t){var e=t.key,n=t.value,r=An(n);return"string"!==r?[new Ct(e,n,"color expected, "+r+" found")]:null===Zt(n)?[new Ct(e,n,'color expected, "'+n+'" found')]:[]},constants:Pt,enum:Ln,filter:Wn,function:Rn,layer:Zn,object:Mn,source:Qn,light:Kn,string:Yn,formatted:function(t){return 0===Yn(t).length?[]:kn(t)},resolvedImage:function(t){return 0===Yn(t).length?[]:kn(t)}};function tr(t){var e=t.value,n=t.valueSpec,r=t.styleSpec;return n.expression&&gn(It(e))?Rn(t):n.expression&&En(Bt(e))?kn(t):n.type&&$n[n.type]?$n[n.type](t):Mn(Mt({},t,{valueSpec:n.type?r[n.type]:n}))}function er(t){var e=t.value,n=t.key,r=Yn(t);return r.length||(-1===e.indexOf("{fontstack}")&&r.push(new Ct(n,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&r.push(new Ct(n,e,'"glyphs" url must include a "{range}" token'))),r}function nr(t,e){void 0===e&&(e=Tt);var n=[];return n=n.concat(tr({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:er,"*":function(){return[]}}})),t.constants&&(n=n.concat(Pt({key:"constants",value:t.constants,style:t,styleSpec:e}))),rr(n)}function rr(t){return[].concat(t).sort((function(t,e){return t.line-e.line}))}function ir(t){return function(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];return rr(t.apply(this,e))}}nr.source=ir(Qn),nr.light=ir(Kn),nr.layer=ir(Zn),nr.filter=ir(Wn),nr.paintProperty=ir(Xn),nr.layoutProperty=ir(Jn);var or=nr,ar=or.light,sr=or.paintProperty,ur=or.layoutProperty;function cr(t,e){var n=!1;if(e&&e.length)for(var r=0,i=e;r<i.length;r+=1){var o=i[r];t.fire(new Ot(new Error(o.message))),n=!0}return n}var lr=hr;function hr(t,e,n){var r=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var i=new Int32Array(this.arrayBuffer);t=i[0],e=i[1],n=i[2],this.d=e+2*n;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],c=i[3+r.length+1];this.keys=i.subarray(u,c),this.bboxes=i.subarray(c),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 h=n/e*t;this.min=-h,this.max=t+h}hr.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)},hr.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},hr.prototype._insertCell=function(t,e,n,r,i,o){this.cells[i].push(o)},hr.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},hr.prototype._queryCell=function(t,e,n,r,i,o,a,s){var u=this.cells[i];if(null!==u)for(var c=this.keys,l=this.bboxes,h=0;h<u.length;h++){var f=u[h];if(void 0===a[f]){var p=4*f;(s?s(l[p+0],l[p+1],l[p+2],l[p+3]):t<=l[p+2]&&e<=l[p+3]&&n>=l[p+0]&&r>=l[p+1])?(a[f]=!0,o.push(c[f])):a[f]=!1}}},hr.prototype._forEachCell=function(t,e,n,r,i,o,a,s){for(var u=this._convertToCellCoord(t),c=this._convertToCellCoord(e),l=this._convertToCellCoord(n),h=this._convertToCellCoord(r),f=u;f<=l;f++)for(var p=c;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}},hr.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},hr.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},hr.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),o+=this.keys.length,i[3+t.length+1]=o,i.set(this.bboxes,o),o+=this.bboxes.length,i.buffer};var fr=self.ImageData,pr={};function dr(t,e,n){void 0===n&&(n={}),Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),pr[t]={klass:e,omit:n.omit||[],shallow:n.shallow||[]}}for(var Ar in dr("Object",Object),lr.serialize=function(t,e){var n=t.toArrayBuffer();return e&&e.push(n),{buffer:n}},lr.deserialize=function(t){return new lr(t.buffer)},dr("Grid",lr),dr("Color",Qt),dr("Error",Error),dr("ResolvedImage",te),dr("StylePropertyFunction",Pn),dr("StyleExpression",wn,{omit:["_evaluator"]}),dr("ZoomDependentExpression",Tn),dr("ZoomConstantExpression",Sn),dr("CompoundExpression",de,{omit:["_evaluate"]}),on)on[Ar]._classRegistryKey||dr("Expression_"+Ar,on[Ar]);function gr(t){return t&&"undefined"!=typeof ArrayBuffer&&(t instanceof ArrayBuffer||t.constructor&&"ArrayBuffer"===t.constructor.name)}function mr(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(gr(t))return e&&e.push(t),t;if(ArrayBuffer.isView(t)){var n=t;return e&&e.push(n.buffer),n}if(t instanceof fr)return e&&e.push(t.data.buffer),t;if(Array.isArray(t)){for(var r=[],i=0,o=t;i<o.length;i+=1){var a=o[i];r.push(mr(a,e))}return r}if("object"==typeof t){var s=t.constructor,u=s._classRegistryKey;if(!u)throw new Error("can't serialize object of unregistered class");var c=s.serialize?s.serialize(t,e):{};if(!s.serialize){for(var l in t)if(t.hasOwnProperty(l)&&!(pr[u].omit.indexOf(l)>=0)){var h=t[l];c[l]=pr[u].shallow.indexOf(l)>=0?h:mr(h,e)}t instanceof Error&&(c.message=t.message)}if(c.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==u&&(c.$name=u),c}throw new Error("can't serialize object of type "+typeof t)}function yr(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||gr(t)||ArrayBuffer.isView(t)||t instanceof fr)return t;if(Array.isArray(t))return t.map(yr);if("object"==typeof t){var e=t.$name||"Object",n=pr[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]=pr[e].shallow.indexOf(a)>=0?s:yr(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 _r={"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 br(t){for(var e=0,n=t;e<n.length;e+=1)if(wr(n[e].charCodeAt(0)))return!0;return!1}function xr(t){return!(_r.Arabic(t)||_r["Arabic Supplement"](t)||_r["Arabic Extended-A"](t)||_r["Arabic Presentation Forms-A"](t)||_r["Arabic Presentation Forms-B"](t))}function wr(t){return!(746!==t&&747!==t&&(t<4352||!(_r["Bopomofo Extended"](t)||_r.Bopomofo(t)||_r["CJK Compatibility Forms"](t)&&!(t>=65097&&t<=65103)||_r["CJK Compatibility Ideographs"](t)||_r["CJK Compatibility"](t)||_r["CJK Radicals Supplement"](t)||_r["CJK Strokes"](t)||!(!_r["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||_r["CJK Unified Ideographs Extension A"](t)||_r["CJK Unified Ideographs"](t)||_r["Enclosed CJK Letters and Months"](t)||_r["Hangul Compatibility Jamo"](t)||_r["Hangul Jamo Extended-A"](t)||_r["Hangul Jamo Extended-B"](t)||_r["Hangul Jamo"](t)||_r["Hangul Syllables"](t)||_r.Hiragana(t)||_r["Ideographic Description Characters"](t)||_r.Kanbun(t)||_r["Kangxi Radicals"](t)||_r["Katakana Phonetic Extensions"](t)||_r.Katakana(t)&&12540!==t||!(!_r["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)||!(!_r["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||_r["Unified Canadian Aboriginal Syllabics"](t)||_r["Unified Canadian Aboriginal Syllabics Extended"](t)||_r["Vertical Forms"](t)||_r["Yijing Hexagram Symbols"](t)||_r["Yi Syllables"](t)||_r["Yi Radicals"](t))))}function Er(t){return!(wr(t)||function(t){return!!(_r["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||_r["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)||_r["Letterlike Symbols"](t)||_r["Number Forms"](t)||_r["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)||_r["Control Pictures"](t)&&9251!==t||_r["Optical Character Recognition"](t)||_r["Enclosed Alphanumerics"](t)||_r["Geometric Shapes"](t)||_r["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||_r["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||_r["CJK Symbols and Punctuation"](t)||_r.Katakana(t)||_r["Private Use Area"](t)||_r["CJK Compatibility Forms"](t)||_r["Small Form Variants"](t)||_r["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 Or(t){return t>=1424&&t<=2303||_r["Arabic Presentation Forms-A"](t)||_r["Arabic Presentation Forms-B"](t)}function Sr(t,e){return!(!e&&Or(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||_r.Khmer(t))}function Tr(t){for(var e=0,n=t;e<n.length;e+=1)if(Or(n[e].charCodeAt(0)))return!0;return!1}var Cr="deferred",Pr="loading",Mr="loaded",Ir=null,Br="unavailable",Rr=null,kr=function(t){Ir&&Ir(t)};function Lr(){Dr.fire(new Et("pluginStateChange",{pluginStatus:Br,pluginURL:Rr}))}var Dr=new St,jr=function(){return Br},Fr=function(){if(Br!==Cr||!Rr)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Br=Pr,Lr(),Rr&&vt({url:Rr},(function(t){t?kr(t):(Br=Mr,Lr())}))},zr={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return Br===Mr||null!=zr.applyArabicShaping},isLoading:function(){return Br===Pr},setState:function(t){Br=t.pluginStatus,Rr=t.pluginURL},isParsed:function(){return null!=zr.applyArabicShaping&&null!=zr.processBidirectionalText&&null!=zr.processStyledBidirectionalText},getPluginURL:function(){return Rr}},Ur=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={})};Ur.prototype.isSupportedScript=function(t){return function(t,e){for(var n=0,r=t;n<r.length;n+=1)if(!Sr(r[n].charCodeAt(0),e))return!1;return!0}(t,zr.isLoaded())},Ur.prototype.crossFadingFactor=function(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},Ur.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 Nr=function(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(gn(t))return new Pn(t,e);if(En(t)){var n=Cn(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=Qt.parse(t)),{kind:"constant",evaluate:function(){return r}}}(void 0===e?t.specification.default:e,t.specification)};Nr.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},Nr.prototype.possiblyEvaluate=function(t,e){return this.property.possiblyEvaluate(this,t,e)};var Gr=function(t){this.property=t,this.value=new Nr(t,void 0)};Gr.prototype.transitioned=function(t,e){return new Hr(this.property,this.value,e,h({},t.transition,this.transition),t.now)},Gr.prototype.untransitioned=function(){return new Hr(this.property,this.value,null,{},0)};var Vr=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};Vr.prototype.getValue=function(t){return _(this._values[t].value.value)},Vr.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new Gr(this._values[t].property)),this._values[t].value=new Nr(this._values[t].property,null===e?void 0:_(e))},Vr.prototype.getTransition=function(t){return _(this._values[t].transition)},Vr.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new Gr(this._values[t].property)),this._values[t].transition=_(e)||void 0},Vr.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},Vr.prototype.transitioned=function(t,e){for(var n=new Wr(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},Vr.prototype.untransitioned=function(){for(var t=new Wr(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 Hr=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)};Hr.prototype.possiblyEvaluate=function(t,e){var n=t.now||0,r=this.value.possiblyEvaluate(t,e),i=this.prior;if(i){if(n>this.end)return this.prior=null,r;if(this.value.isDataDriven())return this.prior=null,r;if(n<this.begin)return i.possiblyEvaluate(t,e);var o=(n-this.begin)/(this.end-this.begin);return this.property.interpolate(i.possiblyEvaluate(t,e),r,function(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,n=e*t;return 4*(t<.5?n:3*(t-e)+n-.75)}(o))}return r};var Wr=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};Wr.prototype.possiblyEvaluate=function(t,e){for(var n=new Jr(this._properties),r=0,i=Object.keys(this._values);r<i.length;r+=1){var o=i[r];n._values[o]=this._values[o].possiblyEvaluate(t,e)}return n},Wr.prototype.hasTransition=function(){for(var t=0,e=Object.keys(this._values);t<e.length;t+=1){var n=e[t];if(this._values[n].prior)return!0}return!1};var qr=function(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues)};qr.prototype.getValue=function(t){return _(this._values[t].value)},qr.prototype.setValue=function(t,e){this._values[t]=new Nr(this._values[t].property,null===e?void 0:_(e))},qr.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},qr.prototype.possiblyEvaluate=function(t,e){for(var n=new Jr(this._properties),r=0,i=Object.keys(this._values);r<i.length;r+=1){var o=i[r];n._values[o]=this._values[o].possiblyEvaluate(t,e)}return n};var Xr=function(t,e,n){this.property=t,this.value=e,this.parameters=n};Xr.prototype.isConstant=function(){return"constant"===this.value.kind},Xr.prototype.constantOr=function(t){return"constant"===this.value.kind?this.value.value:t},Xr.prototype.evaluate=function(t,e,n){return this.property.evaluate(this.value,this.parameters,t,e,n)};var Jr=function(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)};Jr.prototype.get=function(t){return this._values[t]};var Zr=function(t){this.specification=t};Zr.prototype.possiblyEvaluate=function(t,e){return t.expression.evaluate(e)},Zr.prototype.interpolate=function(t,e,n){var r=Ee[this.specification.type];return r?r(t,e,n):t};var Qr=function(t,e){this.specification=t,this.overrides=e};Qr.prototype.possiblyEvaluate=function(t,e,n){return"constant"===t.expression.kind||"camera"===t.expression.kind?new Xr(this,{kind:"constant",value:t.expression.evaluate(e,null,{},n)},e):new Xr(this,t.expression,e)},Qr.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 Xr(this,{kind:"constant",value:void 0},t.parameters);var r=Ee[this.specification.type];return r?new Xr(this,{kind:"constant",value:r(t.value.value,e.value.value,n)},t.parameters):t},Qr.prototype.evaluate=function(t,e,n,r,i){return"constant"===t.kind?t.value:t.evaluate(e,n,r,i)};var Kr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.possiblyEvaluate=function(t,e,n){if(void 0===t.value)return new Xr(this,{kind:"constant",value:void 0},e);if("constant"===t.expression.kind){var r=t.expression.evaluate(e,null,{},n),i="resolvedImage"===t.property.specification.type&&"string"!=typeof r?r.name:r,o=this._calculate(i,i,i,e);return new Xr(this,{kind:"constant",value:o},e)}if("camera"===t.expression.kind){var a=this._calculate(t.expression.evaluate({zoom:e.zoom-1}),t.expression.evaluate({zoom:e.zoom}),t.expression.evaluate({zoom:e.zoom+1}),e);return new Xr(this,{kind:"constant",value:a},e)}return new Xr(this,t.expression,e)},e.prototype.evaluate=function(t,e,n,r,i){if("source"===t.kind){var o=t.evaluate(e,n,r,i);return this._calculate(o,o,o,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}(Qr),Yr=function(t){this.specification=t};Yr.prototype.possiblyEvaluate=function(t,e,n){if(void 0!==t.value){if("constant"===t.expression.kind){var r=t.expression.evaluate(e,null,{},n);return this._calculate(r,r,r,e)}return this._calculate(t.expression.evaluate(new Ur(Math.floor(e.zoom-1),e)),t.expression.evaluate(new Ur(Math.floor(e.zoom),e)),t.expression.evaluate(new Ur(Math.floor(e.zoom+1),e)),e)}},Yr.prototype._calculate=function(t,e,n,r){return r.zoom>r.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:n,to:e}},Yr.prototype.interpolate=function(t){return t};var $r=function(t){this.specification=t};$r.prototype.possiblyEvaluate=function(t,e,n){return!!t.expression.evaluate(e,null,{},n)},$r.prototype.interpolate=function(){return!1};var ti=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 Nr(n,void 0),i=this.defaultTransitionablePropertyValues[e]=new Gr(n);this.defaultTransitioningPropertyValues[e]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=r.possiblyEvaluate({})}};dr("DataDrivenProperty",Qr),dr("DataConstantProperty",Zr),dr("CrossFadedDataDrivenProperty",Kr),dr("CrossFadedProperty",Yr),dr("ColorRampProperty",$r);var ei=function(t){function e(e,n){if(t.call(this),this.id=e.id,this.type=e.type,this._featureFilter=function(){return!0},"custom"!==e.type&&(e=e,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 qr(n.layout)),n.paint)){for(var r in this._transitionablePaint=new Vr(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()}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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){if(void 0===n&&(n={}),null!=e){var r="layers."+this.id+".layout."+t;if(this._validate(ur,r,t,e,n))return}"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,-"-transition".length)):this._transitionablePaint.getValue(t)},e.prototype.setPaintProperty=function(t,e,n){if(void 0===n&&(n={}),null!=e){var r="layers."+this.id+".paint."+t;if(this._validate(sr,r,t,e,n))return!1}if(m(t,"-transition"))return this._transitionablePaint.setTransition(t.slice(0,-"-transition".length),e||void 0),!1;var i=this._transitionablePaint._values[t],o="cross-faded-data-driven"===i.property.specification["property-type"],a=i.value.isDataDriven(),s=i.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);var u=this._transitionablePaint._values[t].value;return u.isDataDriven()||a||o||this._handleOverridablePaintPropertyUpdate(t,s,u)},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,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,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),v(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)&&cr(this,t.call(or,{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 Xr&&fn(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1},e}(St),ni={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},ri=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},ii=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function oi(t,e){void 0===e&&(e=1);var n=0,r=0;return{members:t.map((function(t){var i,o=(i=t.type,ni[i].BYTES_PER_ELEMENT),a=n=ai(n,Math.max(e,o)),s=t.components||1;return r=Math.max(r,o),n+=o*s,{name:t.name,type:t.type,components:s,offset:a}})),size:ai(n,Math.max(r,e)),alignment:e}}function ai(t,e){return Math.ceil(t/e)*e}ii.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},ii.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},ii.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},ii.prototype.clear=function(){this.length=0},ii.prototype.resize=function(t){this.reserve(t),this.length=t},ii.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)}},ii.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),e.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}(ii);si.prototype.bytesPerElement=4,dr("StructArrayLayout2i4",si);var ui=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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}(ii);ui.prototype.bytesPerElement=8,dr("StructArrayLayout4i8",ui);var ci=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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}(ii);ci.prototype.bytesPerElement=12,dr("StructArrayLayout2i4i12",ci);var li=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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}(ii);li.prototype.bytesPerElement=8,dr("StructArrayLayout2i4ub8",li);var hi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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){var u=this.length;return this.resize(u+1),this.emplace(u,t,e,n,r,i,o,a,s)},e.prototype.emplace=function(t,e,n,r,i,o,a,s,u){var c=8*t;return this.uint16[c+0]=e,this.uint16[c+1]=n,this.uint16[c+2]=r,this.uint16[c+3]=i,this.uint16[c+4]=o,this.uint16[c+5]=a,this.uint16[c+6]=s,this.uint16[c+7]=u,t},e}(ii);hi.prototype.bytesPerElement=16,dr("StructArrayLayout8ui16",hi);var fi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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,c,l,h){var f=this.length;return this.resize(f+1),this.emplace(f,t,e,n,r,i,o,a,s,u,c,l,h)},e.prototype.emplace=function(t,e,n,r,i,o,a,s,u,c,l,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]=c,this.int16[p+9]=l,this.int16[p+10]=h,this.int16[p+11]=f,t},e}(ii);fi.prototype.bytesPerElement=24,dr("StructArrayLayout4i4ui4i24",fi);var pi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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}(ii);pi.prototype.bytesPerElement=12,dr("StructArrayLayout3f12",pi);var di=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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){var n=1*t;return this.uint32[n+0]=e,t},e}(ii);di.prototype.bytesPerElement=4,dr("StructArrayLayout1ul4",di);var Ai=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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,c,l){var h=this.length;return this.resize(h+1),this.emplace(h,t,e,n,r,i,o,a,s,u,c,l)},e.prototype.emplace=function(t,e,n,r,i,o,a,s,u,c,l,h){var f=12*t,p=6*t;return this.int16[f+0]=e,this.int16[f+1]=n,this.int16[f+2]=r,this.int16[f+3]=i,this.int16[f+4]=o,this.int16[f+5]=a,this.uint32[p+3]=s,this.uint16[f+8]=u,this.uint16[f+9]=c,this.int16[f+10]=l,this.int16[f+11]=h,t},e}(ii);Ai.prototype.bytesPerElement=24,dr("StructArrayLayout6i1ul2ui2i24",Ai);var gi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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}(ii);gi.prototype.bytesPerElement=12,dr("StructArrayLayout2i2i2i12",gi);var mi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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}(ii);mi.prototype.bytesPerElement=12,dr("StructArrayLayout2ub2f12",mi);var yi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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,c,l,h,f,p,d,A,g){var m=this.length;return this.resize(m+1),this.emplace(m,t,e,n,r,i,o,a,s,u,c,l,h,f,p,d,A,g)},e.prototype.emplace=function(t,e,n,r,i,o,a,s,u,c,l,h,f,p,d,A,g,m){var y=24*t,v=12*t,_=48*t;return this.int16[y+0]=e,this.int16[y+1]=n,this.uint16[y+2]=r,this.uint16[y+3]=i,this.uint32[v+2]=o,this.uint32[v+3]=a,this.uint32[v+4]=s,this.uint16[y+10]=u,this.uint16[y+11]=c,this.uint16[y+12]=l,this.float32[v+7]=h,this.float32[v+8]=f,this.uint8[_+36]=p,this.uint8[_+37]=d,this.uint8[_+38]=A,this.uint32[v+10]=g,this.int16[y+22]=m,t},e}(ii);yi.prototype.bytesPerElement=48,dr("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",yi);var vi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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,c,l,h,f,p,d,A,g,m,y,v,_,b,x,w,E,O){var S=this.length;return this.resize(S+1),this.emplace(S,t,e,n,r,i,o,a,s,u,c,l,h,f,p,d,A,g,m,y,v,_,b,x,w,E,O)},e.prototype.emplace=function(t,e,n,r,i,o,a,s,u,c,l,h,f,p,d,A,g,m,y,v,_,b,x,w,E,O,S){var T=30*t,C=15*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]=c,this.uint16[T+9]=l,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]=g,this.uint16[T+16]=m,this.uint16[T+17]=y,this.uint16[T+18]=v,this.uint16[T+19]=_,this.uint16[T+20]=b,this.uint16[T+21]=x,this.uint32[C+11]=w,this.float32[C+12]=E,this.float32[C+13]=O,this.float32[C+14]=S,t},e}(ii);vi.prototype.bytesPerElement=60,dr("StructArrayLayout8i14ui1ul3f60",vi);var _i=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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){var n=1*t;return this.float32[n+0]=e,t},e}(ii);_i.prototype.bytesPerElement=4,dr("StructArrayLayout1f4",_i);var bi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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}(ii);bi.prototype.bytesPerElement=6,dr("StructArrayLayout3i6",bi);var xi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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=2*t,o=4*t;return this.uint32[i+0]=e,this.uint16[o+2]=n,this.uint16[o+3]=r,t},e}(ii);xi.prototype.bytesPerElement=8,dr("StructArrayLayout1ul2ui8",xi);var wi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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}(ii);wi.prototype.bytesPerElement=6,dr("StructArrayLayout3ui6",wi);var Ei=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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}(ii);Ei.prototype.bytesPerElement=4,dr("StructArrayLayout2ui4",Ei);var Oi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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){var n=1*t;return this.uint16[n+0]=e,t},e}(ii);Oi.prototype.bytesPerElement=2,dr("StructArrayLayout1ui2",Oi);var Si=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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}(ii);Si.prototype.bytesPerElement=8,dr("StructArrayLayout2f8",Si);var Ti=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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}(ii);Ti.prototype.bytesPerElement=16,dr("StructArrayLayout4f16",Ti);var Ci=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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},radius:{configurable:!0},signedDistanceFromAnchor:{configurable:!0},anchorPoint:{configurable:!0}};return n.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},n.anchorPointX.set=function(t){this._structArray.int16[this._pos2+0]=t},n.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},n.anchorPointY.set=function(t){this._structArray.int16[this._pos2+1]=t},n.x1.get=function(){return this._structArray.int16[this._pos2+2]},n.x1.set=function(t){this._structArray.int16[this._pos2+2]=t},n.y1.get=function(){return this._structArray.int16[this._pos2+3]},n.y1.set=function(t){this._structArray.int16[this._pos2+3]=t},n.x2.get=function(){return this._structArray.int16[this._pos2+4]},n.x2.set=function(t){this._structArray.int16[this._pos2+4]=t},n.y2.get=function(){return this._structArray.int16[this._pos2+5]},n.y2.set=function(t){this._structArray.int16[this._pos2+5]=t},n.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},n.featureIndex.set=function(t){this._structArray.uint32[this._pos4+3]=t},n.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},n.sourceLayerIndex.set=function(t){this._structArray.uint16[this._pos2+8]=t},n.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},n.bucketIndex.set=function(t){this._structArray.uint16[this._pos2+9]=t},n.radius.get=function(){return this._structArray.int16[this._pos2+10]},n.radius.set=function(t){this._structArray.int16[this._pos2+10]=t},n.signedDistanceFromAnchor.get=function(){return this._structArray.int16[this._pos2+11]},n.signedDistanceFromAnchor.set=function(t){this._structArray.int16[this._pos2+11]=t},n.anchorPoint.get=function(){return new i(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,n),e}(ri);Ci.prototype.size=24;var Pi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new Ci(this,t)},e}(Ai);dr("CollisionBoxArray",Pi);var Mi=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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.anchorX.set=function(t){this._structArray.int16[this._pos2+0]=t},n.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},n.anchorY.set=function(t){this._structArray.int16[this._pos2+1]=t},n.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},n.glyphStartIndex.set=function(t){this._structArray.uint16[this._pos2+2]=t},n.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},n.numGlyphs.set=function(t){this._structArray.uint16[this._pos2+3]=t},n.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},n.vertexStartIndex.set=function(t){this._structArray.uint32[this._pos4+2]=t},n.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},n.lineStartIndex.set=function(t){this._structArray.uint32[this._pos4+3]=t},n.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},n.lineLength.set=function(t){this._structArray.uint32[this._pos4+4]=t},n.segment.get=function(){return this._structArray.uint16[this._pos2+10]},n.segment.set=function(t){this._structArray.uint16[this._pos2+10]=t},n.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},n.lowerSize.set=function(t){this._structArray.uint16[this._pos2+11]=t},n.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},n.upperSize.set=function(t){this._structArray.uint16[this._pos2+12]=t},n.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},n.lineOffsetX.set=function(t){this._structArray.float32[this._pos4+7]=t},n.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},n.lineOffsetY.set=function(t){this._structArray.float32[this._pos4+8]=t},n.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},n.writingMode.set=function(t){this._structArray.uint8[this._pos1+36]=t},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]},n.associatedIconIndex.set=function(t){this._structArray.int16[this._pos2+22]=t},Object.defineProperties(e.prototype,n),e}(ri);Mi.prototype.size=48;var Ii=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new Mi(this,t)},e}(yi);dr("PlacedSymbolArray",Ii);var Bi=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0}};return n.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},n.anchorX.set=function(t){this._structArray.int16[this._pos2+0]=t},n.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},n.anchorY.set=function(t){this._structArray.int16[this._pos2+1]=t},n.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},n.rightJustifiedTextSymbolIndex.set=function(t){this._structArray.int16[this._pos2+2]=t},n.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},n.centerJustifiedTextSymbolIndex.set=function(t){this._structArray.int16[this._pos2+3]=t},n.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},n.leftJustifiedTextSymbolIndex.set=function(t){this._structArray.int16[this._pos2+4]=t},n.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},n.verticalPlacedTextSymbolIndex.set=function(t){this._structArray.int16[this._pos2+5]=t},n.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},n.placedIconSymbolIndex.set=function(t){this._structArray.int16[this._pos2+6]=t},n.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},n.verticalPlacedIconSymbolIndex.set=function(t){this._structArray.int16[this._pos2+7]=t},n.key.get=function(){return this._structArray.uint16[this._pos2+8]},n.key.set=function(t){this._structArray.uint16[this._pos2+8]=t},n.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},n.textBoxStartIndex.set=function(t){this._structArray.uint16[this._pos2+9]=t},n.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},n.textBoxEndIndex.set=function(t){this._structArray.uint16[this._pos2+10]=t},n.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},n.verticalTextBoxStartIndex.set=function(t){this._structArray.uint16[this._pos2+11]=t},n.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},n.verticalTextBoxEndIndex.set=function(t){this._structArray.uint16[this._pos2+12]=t},n.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},n.iconBoxStartIndex.set=function(t){this._structArray.uint16[this._pos2+13]=t},n.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},n.iconBoxEndIndex.set=function(t){this._structArray.uint16[this._pos2+14]=t},n.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},n.verticalIconBoxStartIndex.set=function(t){this._structArray.uint16[this._pos2+15]=t},n.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},n.verticalIconBoxEndIndex.set=function(t){this._structArray.uint16[this._pos2+16]=t},n.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},n.featureIndex.set=function(t){this._structArray.uint16[this._pos2+17]=t},n.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},n.numHorizontalGlyphVertices.set=function(t){this._structArray.uint16[this._pos2+18]=t},n.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},n.numVerticalGlyphVertices.set=function(t){this._structArray.uint16[this._pos2+19]=t},n.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},n.numIconVertices.set=function(t){this._structArray.uint16[this._pos2+20]=t},n.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},n.numVerticalIconVertices.set=function(t){this._structArray.uint16[this._pos2+21]=t},n.crossTileID.get=function(){return this._structArray.uint32[this._pos4+11]},n.crossTileID.set=function(t){this._structArray.uint32[this._pos4+11]=t},n.textBoxScale.get=function(){return this._structArray.float32[this._pos4+12]},n.textBoxScale.set=function(t){this._structArray.float32[this._pos4+12]=t},n.textOffset0.get=function(){return this._structArray.float32[this._pos4+13]},n.textOffset0.set=function(t){this._structArray.float32[this._pos4+13]=t},n.textOffset1.get=function(){return this._structArray.float32[this._pos4+14]},n.textOffset1.set=function(t){this._structArray.float32[this._pos4+14]=t},Object.defineProperties(e.prototype,n),e}(ri);Bi.prototype.size=60;var Ri=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new Bi(this,t)},e}(vi);dr("SymbolInstanceArray",Ri);var ki=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={offsetX:{configurable:!0}};return n.offsetX.get=function(){return this._structArray.float32[this._pos4+0]},n.offsetX.set=function(t){this._structArray.float32[this._pos4+0]=t},Object.defineProperties(e.prototype,n),e}(ri);ki.prototype.size=4;var Li=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getoffsetX=function(t){return this.float32[1*t+0]},e.prototype.get=function(t){return new ki(this,t)},e}(_i);dr("GlyphOffsetArray",Li);var Di=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={x:{configurable:!0},y:{configurable:!0},tileUnitDistanceFromAnchor:{configurable:!0}};return n.x.get=function(){return this._structArray.int16[this._pos2+0]},n.x.set=function(t){this._structArray.int16[this._pos2+0]=t},n.y.get=function(){return this._structArray.int16[this._pos2+1]},n.y.set=function(t){this._structArray.int16[this._pos2+1]=t},n.tileUnitDistanceFromAnchor.get=function(){return this._structArray.int16[this._pos2+2]},n.tileUnitDistanceFromAnchor.set=function(t){this._structArray.int16[this._pos2+2]=t},Object.defineProperties(e.prototype,n),e}(ri);Di.prototype.size=6;var ji=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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.prototype.get=function(t){return new Di(this,t)},e}(bi);dr("SymbolLineVertexArray",ji);var Fi=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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.featureIndex.set=function(t){this._structArray.uint32[this._pos4+0]=t},n.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},n.sourceLayerIndex.set=function(t){this._structArray.uint16[this._pos2+2]=t},n.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},n.bucketIndex.set=function(t){this._structArray.uint16[this._pos2+3]=t},Object.defineProperties(e.prototype,n),e}(ri);Fi.prototype.size=8;var zi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){return new Fi(this,t)},e}(xi);dr("FeatureIndexArray",zi);var Ui=oi([{name:"a_pos",components:2,type:"Int16"}],4).members,Ni=function(t){void 0===t&&(t=[]),this.segments=t};function Gi(t,e){return 256*(t=c(Math.floor(t),0,255))+c(Math.floor(e),0,255)}Ni.prototype.prepareSegment=function(t,e,n,r){var i=this.segments[this.segments.length-1];return t>Ni.MAX_VERTEX_ARRAY_LENGTH&&x("Max vertices per segment is "+Ni.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!i||i.vertexLength+t>Ni.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},Ni.prototype.get=function(){return this.segments},Ni.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()}},Ni.simpleSegment=function(t,e,n,r){return new Ni([{vertexOffset:t,primitiveOffset:e,vertexLength:n,primitiveLength:r,vaos:{},sortKey:0}])},Ni.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,dr("SegmentVector",Ni);var Vi=function(){this.ids=[],this.positions=[],this.indexed=!1};function Hi(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}Vi.prototype.add=function(t,e,n,r){this.ids.push(t),this.positions.push(e,n,r)},Vi.prototype.getPositions=function(t){for(var e=0,n=this.ids.length-1;e<n;){var r=e+n>>1;this.ids[r]>=t?n=r:e=r+1}for(var i=[];this.ids[e]===t;){var o=this.positions[3*e],a=this.positions[3*e+1],s=this.positions[3*e+2];i.push({index:o,start:a,end:s}),e++}return i},Vi.serialize=function(t,e){var n=new Float64Array(t.ids),r=new Uint32Array(t.positions);return function t(e,n,r,i){if(!(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;Hi(e,a,s),Hi(n,3*a,3*s),Hi(n,3*a+1,3*s+1),Hi(n,3*a+2,3*s+2)}t(e,n,r,s),t(e,n,s+1,i)}}(n,r,0,n.length-1),e&&e.push(n.buffer,r.buffer),{ids:n,positions:r}},Vi.deserialize=function(t){var e=new Vi;return e.ids=t.ids,e.positions=t.positions,e.indexed=!0,e},dr("FeaturePositionMap",Vi);var Wi=function(t,e){this.gl=t.gl,this.location=e},qi=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),e.prototype.constructor=e,e.prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1i(this.location,t))},e}(Wi),Xi=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),e.prototype.constructor=e,e.prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1f(this.location,t))},e}(Wi),Ji=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),e.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}(Wi),Zi=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),e.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}(Wi),Qi=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),e.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}(Wi),Ki=function(t){function e(e,n){t.call(this,e,n),this.current=Qt.transparent}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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}(Wi),Yi=new Float32Array(16),$i=function(t){function e(e,n){t.call(this,e,n),this.current=Yi}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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}(Wi);function to(t){return[Gi(255*t.r,255*t.g),Gi(255*t.b,255*t.a)]}var eo=function(t,e,n){this.value=t,this.names=e,this.uniformNames=this.names.map((function(t){return"u_"+t})),this.type=n,this.maxValue=-1/0};eo.prototype.defines=function(){return this.names.map((function(t){return"#define HAS_UNIFORM_u_"+t}))},eo.prototype.setConstantPatternPositions=function(){},eo.prototype.populatePaintArray=function(){},eo.prototype.updatePaintArray=function(){},eo.prototype.upload=function(){},eo.prototype.destroy=function(){},eo.prototype.setUniforms=function(t,e,n,r){e.set(r.constantOr(this.value))},eo.prototype.getBinding=function(t,e){return"color"===this.type?new Ki(t,e):new Xi(t,e)},eo.serialize=function(t){var e=t.value,n=t.names,r=t.type;return{value:mr(e),names:n,type:r}},eo.deserialize=function(t){var e=t.value,n=t.names,r=t.type;return new eo(yr(e),n,r)};var no=function(t,e,n){this.value=t,this.names=e,this.uniformNames=this.names.map((function(t){return"u_"+t})),this.type=n,this.maxValue=-1/0,this.patternPositions={patternTo:null,patternFrom:null}};no.prototype.defines=function(){return this.names.map((function(t){return"#define HAS_UNIFORM_u_"+t}))},no.prototype.populatePaintArray=function(){},no.prototype.updatePaintArray=function(){},no.prototype.upload=function(){},no.prototype.destroy=function(){},no.prototype.setConstantPatternPositions=function(t,e){this.patternPositions.patternTo=t.tlbr,this.patternPositions.patternFrom=e.tlbr},no.prototype.setUniforms=function(t,e,n,r,i){var o=this.patternPositions;"u_pattern_to"===i&&o.patternTo&&e.set(o.patternTo),"u_pattern_from"===i&&o.patternFrom&&e.set(o.patternFrom)},no.prototype.getBinding=function(t,e){return new Qi(t,e)};var ro=function(t,e,n,r){this.expression=t,this.names=e,this.type=n,this.uniformNames=this.names.map((function(t){return"a_"+t})),this.maxValue=-1/0,this.paintVertexAttributes=e.map((function(t){return{name:"a_"+t,type:"Float32",components:"color"===n?2:1,offset:0}})),this.paintVertexArray=new r};ro.prototype.defines=function(){return[]},ro.prototype.setConstantPatternPositions=function(){},ro.prototype.populatePaintArray=function(t,e,n,r){var i=this.paintVertexArray,o=i.length;i.reserve(t);var a=this.expression.evaluate(new Ur(0),e,{},[],r);if("color"===this.type)for(var s=to(a),u=o;u<t;u++)i.emplaceBack(s[0],s[1]);else{for(var c=o;c<t;c++)i.emplaceBack(a);this.maxValue=Math.max(this.maxValue,a)}},ro.prototype.updatePaintArray=function(t,e,n,r){var i=this.paintVertexArray,o=this.expression.evaluate({zoom:0},n,r);if("color"===this.type)for(var a=to(o),s=t;s<e;s++)i.emplace(s,a[0],a[1]);else{for(var u=t;u<e;u++)i.emplace(u,o);this.maxValue=Math.max(this.maxValue,o)}},ro.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))},ro.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},ro.prototype.setUniforms=function(t,e){e.set(0)},ro.prototype.getBinding=function(t,e){return new Xi(t,e)};var io=function(t,e,n,r,i,o){this.expression=t,this.names=e,this.uniformNames=this.names.map((function(t){return"u_"+t+"_t"})),this.type=n,this.useIntegerZoom=r,this.zoom=i,this.maxValue=-1/0;var a=o;this.paintVertexAttributes=e.map((function(t){return{name:"a_"+t,type:"Float32",components:"color"===n?4:2,offset:0}})),this.paintVertexArray=new a};io.prototype.defines=function(){return[]},io.prototype.setConstantPatternPositions=function(){},io.prototype.populatePaintArray=function(t,e,n,r){var i=this.paintVertexArray,o=i.length;i.reserve(t);var a=this.expression.evaluate(new Ur(this.zoom),e,{},[],r),s=this.expression.evaluate(new Ur(this.zoom+1),e,{},[],r);if("color"===this.type)for(var u=to(a),c=to(s),l=o;l<t;l++)i.emplaceBack(u[0],u[1],c[0],c[1]);else{for(var h=o;h<t;h++)i.emplaceBack(a,s);this.maxValue=Math.max(this.maxValue,a,s)}},io.prototype.updatePaintArray=function(t,e,n,r){var i=this.paintVertexArray,o=this.expression.evaluate({zoom:this.zoom},n,r),a=this.expression.evaluate({zoom:this.zoom+1},n,r);if("color"===this.type)for(var s=to(o),u=to(a),c=t;c<e;c++)i.emplace(c,s[0],s[1],u[0],u[1]);else{for(var l=t;l<e;l++)i.emplace(l,o,a);this.maxValue=Math.max(this.maxValue,o,a)}},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()},io.prototype.interpolationFactor=function(t){return this.useIntegerZoom&&(t=Math.floor(t)),c(this.expression.interpolationFactor(t,this.zoom,this.zoom+1),0,1)},io.prototype.setUniforms=function(t,e,n){e.set(this.interpolationFactor(n.zoom))},io.prototype.getBinding=function(t,e){return new Xi(t,e)};var oo=function(t,e,n,r,i,o,a){this.expression=t,this.names=e,this.type=n,this.uniformNames=this.names.map((function(t){return"u_"+t+"_t"})),this.useIntegerZoom=r,this.zoom=i,this.maxValue=-1/0,this.layerId=a,this.paintVertexAttributes=e.map((function(t){return{name:"a_"+t,type:"Uint16",components:4,offset:0}})),this.zoomInPaintVertexArray=new o,this.zoomOutPaintVertexArray=new o};oo.prototype.defines=function(){return[]},oo.prototype.setConstantPatternPositions=function(){},oo.prototype.populatePaintArray=function(t,e,n){var r=this.zoomInPaintVertexArray,i=this.zoomOutPaintVertexArray,o=this.layerId,a=r.length;if(r.reserve(t),i.reserve(t),n&&e.patterns&&e.patterns[o]){var s=e.patterns[o],u=s.min,c=s.mid,l=s.max,h=n[u],f=n[c],p=n[l];if(!h||!f||!p)return;for(var d=a;d<t;d++)r.emplaceBack(f.tl[0],f.tl[1],f.br[0],f.br[1],h.tl[0],h.tl[1],h.br[0],h.br[1]),i.emplaceBack(f.tl[0],f.tl[1],f.br[0],f.br[1],p.tl[0],p.tl[1],p.br[0],p.br[1])}},oo.prototype.updatePaintArray=function(t,e,n,r,i){var o=this.zoomInPaintVertexArray,a=this.zoomOutPaintVertexArray,s=this.layerId;if(i&&n.patterns&&n.patterns[s]){var u=n.patterns[s],c=u.min,l=u.mid,h=u.max,f=i[c],p=i[l],d=i[h];if(!f||!p||!d)return;for(var A=t;A<e;A++)o.emplace(A,p.tl[0],p.tl[1],p.br[0],p.br[1],f.tl[0],f.tl[1],f.br[0],f.br[1]),a.emplace(A,p.tl[0],p.tl[1],p.br[0],p.br[1],d.tl[0],d.tl[1],d.br[0],d.br[1])}},oo.prototype.upload=function(t){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=t.createVertexBuffer(this.zoomInPaintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},oo.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()},oo.prototype.setUniforms=function(t,e){e.set(0)},oo.prototype.getBinding=function(t,e){return new Xi(t,e)};var ao=function(){this.binders={},this.cacheKey="",this._buffers=[]};ao.createDynamic=function(t,e,n){var r=new ao,i=[];for(var o in t.paint._values)if(n(o)){var a=t.paint.get(o);if(a instanceof Xr&&fn(a.property.specification)){var s=uo(o,t.type),u=a.property.specification.type,c=a.property.useIntegerZoom;if("cross-faded"===a.property.specification["property-type"]||"cross-faded-data-driven"===a.property.specification["property-type"])if("constant"===a.value.kind)r.binders[o]=new no(a.value.value,s,u),i.push("/u_"+o);else{var l=co(o,u,"source");r.binders[o]=new oo(a.value,s,u,c,e,l,t.id),i.push("/a_"+o)}else if("constant"===a.value.kind)r.binders[o]=new eo(a.value.value,s,u),i.push("/u_"+o);else if("source"===a.value.kind){var h=co(o,u,"source");r.binders[o]=new ro(a.value,s,u,h),i.push("/a_"+o)}else{var f=co(o,u,"composite");r.binders[o]=new io(a.value,s,u,c,e,f),i.push("/z_"+o)}}}return r.cacheKey=i.sort().join(""),r},ao.prototype.populatePaintArrays=function(t,e,n,r,i){for(var o in this.binders)this.binders[o].populatePaintArray(t,e,r,i)},ao.prototype.setConstantPatternPositions=function(t,e){for(var n in this.binders)this.binders[n].setConstantPatternPositions(t,e)},ao.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 c=u[s],l=n.feature(c.index);for(var h in this.binders){var f=this.binders[h];if(!(f instanceof eo||f instanceof no)&&!0===f.expression.isStateDependent){var p=r.paint.get(h);f.expression=p.value,f.updatePaintArray(c.start,c.end,l,t[a],i),o=!0}}}return o},ao.prototype.defines=function(){var t=[];for(var e in this.binders)t.push.apply(t,this.binders[e].defines());return t},ao.prototype.getPaintVertexBuffers=function(){return this._buffers},ao.prototype.getUniforms=function(t,e){var n=[];for(var r in this.binders)for(var i=this.binders[r],o=0,a=i.uniformNames;o<a.length;o+=1){var s=a[o];if(e[s]){var u=i.getBinding(t,e[s]);n.push({name:s,property:r,binding:u})}}return n},ao.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,c=a.binding;this.binders[u].setUniforms(t,c,r,n.get(u),s)}},ao.prototype.updatePatternPaintBuffers=function(t){var e=[];for(var n in this.binders){var r=this.binders[n];if(r instanceof oo){var i=2===t.fromScale?r.zoomInPaintVertexBuffer:r.zoomOutPaintVertexBuffer;i&&e.push(i)}else(r instanceof ro||r instanceof io)&&r.paintVertexBuffer&&e.push(r.paintVertexBuffer)}this._buffers=e},ao.prototype.upload=function(t){for(var e in this.binders)this.binders[e].upload(t);var n=[];for(var r in this.binders){var i=this.binders[r];(i instanceof ro||i instanceof io)&&i.paintVertexBuffer&&n.push(i.paintVertexBuffer)}this._buffers=n},ao.prototype.destroy=function(){for(var t in this.binders)this.binders[t].destroy()};var so=function(t,e,n,r){void 0===r&&(r=function(){return!0}),this.programConfigurations={};for(var i=0,o=e;i<o.length;i+=1){var a=o[i];this.programConfigurations[a.id]=ao.createDynamic(a,n,r),this.programConfigurations[a.id].layoutAttributes=t}this.needsUpload=!1,this._featureMap=new Vi,this._bufferOffset=0};function uo(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"],"fill-pattern":["pattern_to","pattern_from"],"fill-extrusion-pattern":["pattern_to","pattern_from"]}[t]||[t.replace(e+"-","").replace(/-/g,"_")]}function co(t,e,n){var r={color:{source:Si,composite:Ti},number:{source:_i,composite:Si}},i=function(t){return{"line-pattern":{source:hi,composite:hi},"fill-pattern":{source:hi,composite:hi},"fill-extrusion-pattern":{source:hi,composite:hi}}[t]}(t);return i&&i[n]||r[e][n]}so.prototype.populatePaintArrays=function(t,e,n,r,i){for(var o in this.programConfigurations)this.programConfigurations[o].populatePaintArrays(t,e,n,r,i);void 0!==e.id&&this._featureMap.add(+e.id,n,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0},so.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}},so.prototype.get=function(t){return this.programConfigurations[t]},so.prototype.upload=function(t){if(this.needsUpload){for(var e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1}},so.prototype.destroy=function(){for(var t in this.programConfigurations)this.programConfigurations[t].destroy()},dr("ConstantBinder",eo),dr("CrossFadedConstantBinder",no),dr("SourceExpressionBinder",ro),dr("CrossFadedCompositeBinder",oo),dr("CompositeExpressionBinder",io),dr("ProgramConfiguration",ao,{omit:["_buffers"]}),dr("ProgramConfigurationSet",so);var lo=8192,ho={min:-1*Math.pow(2,14),max:Math.pow(2,14)-1};function fo(t){for(var e=lo/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];a.x=Math.round(a.x*e),a.y=Math.round(a.y*e),(a.x<ho.min||a.x>ho.max||a.y<ho.min||a.y>ho.max)&&(x("Geometry exceeds allowed extent, reduce your vector tile buffer size"),a.x=c(a.x,ho.min,ho.max),a.y=c(a.y,ho.min,ho.max))}return n}function po(t,e,n,r,i){t.emplaceBack(2*e+(r+1)/2,2*n+(i+1)/2)}var Ao=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 wi,this.segments=new Ni,this.programConfigurations=new so(Ui,t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function go(t,e){for(var n=0;n<t.length;n++)if(Oo(e,t[n]))return!0;for(var r=0;r<e.length;r++)if(Oo(t,e[r]))return!0;return!!_o(t,e)}function mo(t,e,n){return!!Oo(t,e)||!!xo(e,t,n)}function yo(t,e){if(1===t.length)return Eo(e,t[0]);for(var n=0;n<e.length;n++)for(var r=e[n],i=0;i<r.length;i++)if(Oo(t,r[i]))return!0;for(var o=0;o<t.length;o++)if(Eo(e,t[o]))return!0;for(var a=0;a<e.length;a++)if(_o(t,e[a]))return!0;return!1}function vo(t,e,n){if(t.length>1){if(_o(t,e))return!0;for(var r=0;r<e.length;r++)if(xo(e[r],t,n))return!0}for(var i=0;i<t.length;i++)if(xo(t[i],e,n))return!0;return!1}function _o(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(bo(r,i,e[o],e[o+1]))return!0;return!1}function bo(t,e,n,r){return w(t,n,r)!==w(e,n,r)&&w(t,e,n)!==w(t,e,r)}function xo(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(wo(t,e[i-1],e[i])<r)return!0;return!1}function wo(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 i<0?t.distSqr(e):i>1?t.distSqr(n):t.distSqr(n.sub(e)._mult(i)._add(e))}function Eo(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],i=n[u],r.y>e.y!=i.y>e.y&&e.x<(i.x-r.x)*(e.y-r.y)/(i.y-r.y)+r.x&&(o=!o);return o}function Oo(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 So(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=w(t,e,n[0]);return o!==w(t,e,n[1])||o!==w(t,e,n[2])||o!==w(t,e,n[3])}function To(t,e,n){var r=e.paint.get(t).value;return"constant"===r.kind?r.value:n.programConfigurations.get(e.id).binders[t].maxValue}function Co(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Po(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++){var c=t[u];s.push(c.sub(a))}return s}Ao.prototype.populate=function(t,e){var n=this.layers[0],r=[],i=null;"circle"===n.type&&(i=n.layout.get("circle-sort-key"));for(var o=0,a=t;o<a.length;o+=1){var s=a[o],u=s.feature,c=s.index,l=s.sourceLayerIndex;if(this.layers[0]._featureFilter(new Ur(this.zoom),u)){var h=fo(u),f=i?i.evaluate(u,{}):void 0,p={id:u.id,properties:u.properties,type:u.type,sourceLayerIndex:l,index:c,geometry:h,patterns:{},sortKey:f};r.push(p)}}i&&r.sort((function(t,e){return t.sortKey-e.sortKey}));for(var d=0,A=r;d<A.length;d+=1){var g=A[d],m=g,y=m.geometry,v=m.index,_=m.sourceLayerIndex,b=t[v].feature;this.addFeature(g,y,v),e.featureIndex.insert(b,y,v,_,this.index)}},Ao.prototype.update=function(t,e,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,n)},Ao.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Ao.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Ao.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Ui),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},Ao.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Ao.prototype.addFeature=function(t,e,n){for(var r=0,i=e;r<i.length;r+=1)for(var o=0,a=i[r];o<a.length;o+=1){var s=a[o],u=s.x,c=s.y;if(!(u<0||u>=lo||c<0||c>=lo)){var l=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),h=l.vertexLength;po(this.layoutVertexArray,u,c,-1,-1),po(this.layoutVertexArray,u,c,1,-1),po(this.layoutVertexArray,u,c,1,1),po(this.layoutVertexArray,u,c,-1,1),this.indexArray.emplaceBack(h,h+1,h+2),this.indexArray.emplaceBack(h,h+3,h+2),l.vertexLength+=4,l.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,n,{})},dr("CircleBucket",Ao,{omit:["layers"]});var Mo,Io=new ti({"circle-sort-key":new Qr(Tt.layout_circle["circle-sort-key"])}),Bo={paint:new ti({"circle-radius":new Qr(Tt.paint_circle["circle-radius"]),"circle-color":new Qr(Tt.paint_circle["circle-color"]),"circle-blur":new Qr(Tt.paint_circle["circle-blur"]),"circle-opacity":new Qr(Tt.paint_circle["circle-opacity"]),"circle-translate":new Zr(Tt.paint_circle["circle-translate"]),"circle-translate-anchor":new Zr(Tt.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Zr(Tt.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Zr(Tt.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Qr(Tt.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Qr(Tt.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Qr(Tt.paint_circle["circle-stroke-opacity"])}),layout:Io},Ro="undefined"!=typeof Float32Array?Float32Array:Array;function ko(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}Math.hypot||(Math.hypot=function(){for(var t=arguments,e=0,n=arguments.length;n--;)e+=t[n]*t[n];return Math.sqrt(e)}),Mo=new Ro(3),Ro!=Float32Array&&(Mo[0]=0,Mo[1]=0,Mo[2]=0),function(){var t=new Ro(4);Ro!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0)}();var Lo=function(t){function e(e){t.call(this,e,Bo)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createBucket=function(t){return new Ao(t)},e.prototype.queryRadius=function(t){var e=t;return To("circle-radius",this,e)+To("circle-stroke-width",this,e)+Co(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,n,r,i,o,a,s){for(var u=Po(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),o.angle,a),c=this.paint.get("circle-radius").evaluate(e,n)+this.paint.get("circle-stroke-width").evaluate(e,n),l="map"===this.paint.get("circle-pitch-alignment"),h=l?u:function(t,e){return t.map((function(t){return Do(t,e)}))}(u,s),f=l?c*a:c,p=0,d=r;p<d.length;p+=1)for(var A=0,g=d[p];A<g.length;A+=1){var m=g[A],y=l?m:Do(m,s),v=f,_=ko([],[m.x,m.y,0,1],s);if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?v*=_[3]/o.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(v*=o.cameraToCenterDistance/_[3]),mo(h,y,v))return!0}return!1},e}(ei);function Do(t,e){var n=ko([],[t.x,t.y,0,1],e);return new i(n[0]/n[3],n[1]/n[3])}var jo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Ao);function Fo(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 zo(t,e,n){var r=e.width,i=e.height;if(r!==t.width||i!==t.height){var o=Fo({},{width:r,height:i},n);Uo(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 Uo(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 c=((n.y+u)*t.width+n.x)*o,l=((r.y+u)*e.width+r.x)*o,h=0;h<i.width*o;h++)s[l+h]=a[c+h];return e}dr("HeatmapBucket",jo,{omit:["layers"]});var No=function(t,e){Fo(this,t,1,e)};No.prototype.resize=function(t){zo(this,t,1)},No.prototype.clone=function(){return new No({width:this.width,height:this.height},new Uint8Array(this.data))},No.copy=function(t,e,n,r,i){Uo(t,e,n,r,i,1)};var Go=function(t,e){Fo(this,t,4,e)};Go.prototype.resize=function(t){zo(this,t,4)},Go.prototype.replace=function(t,e){e?this.data.set(t):t instanceof Uint8ClampedArray?this.data=new Uint8Array(t.buffer):this.data=t},Go.prototype.clone=function(){return new Go({width:this.width,height:this.height},new Uint8Array(this.data))},Go.copy=function(t,e,n,r,i){Uo(t,e,n,r,i,4)},dr("AlphaImage",No),dr("RGBAImage",Go);var Vo={paint:new ti({"heatmap-radius":new Qr(Tt.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Qr(Tt.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Zr(Tt.paint_heatmap["heatmap-intensity"]),"heatmap-color":new $r(Tt.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Zr(Tt.paint_heatmap["heatmap-opacity"])})};function Ho(t,e){for(var n=new Uint8Array(1024),r={},i=0,o=0;i<256;i++,o+=4){r[e]=i/255;var a=t.evaluate(r);n[o+0]=Math.floor(255*a.r/a.a),n[o+1]=Math.floor(255*a.g/a.a),n[o+2]=Math.floor(255*a.b/a.a),n[o+3]=Math.floor(255*a.a)}return new Go({width:256,height:1},n)}var Wo=function(t){function e(e){t.call(this,e,Vo),this._updateColorRamp()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createBucket=function(t){return new jo(t)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){"heatmap-color"===t&&this._updateColorRamp()},e.prototype._updateColorRamp=function(){var t=this._transitionablePaint._values["heatmap-color"].value.expression;this.colorRamp=Ho(t,"heatmapDensity"),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}(ei),qo={paint:new ti({"hillshade-illumination-direction":new Zr(Tt.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new Zr(Tt.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Zr(Tt.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Zr(Tt.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Zr(Tt.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Zr(Tt.paint_hillshade["hillshade-accent-color"])})},Xo=function(t){function e(e){t.call(this,e,qo)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility},e}(ei),Jo=oi([{name:"a_pos",components:2,type:"Int16"}],4).members,Zo=Ko,Qo=Ko;function Ko(t,e,n){n=n||2;var r,i,o,a,s,u,c,l=e&&e.length,h=l?e[0]*n:t.length,f=Yo(t,0,h,n,!0),p=[];if(!f||f.next===f.prev)return p;if(l&&(f=function(t,e,n,r){var i,o,a,s=[];for(i=0,o=e.length;i<o;i++)(a=Yo(t,e[i]*r,i<o-1?e[i+1]*r:t.length,r,!1))===a.next&&(a.steiner=!0),s.push(ca(a));for(s.sort(oa),i=0;i<s.length;i++)aa(s[i],n),n=$o(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);c=0!==(c=Math.max(o-r,a-i))?1/c:0}return ta(f,p,n,r,i,c),p}function Yo(t,e,n,r,i){var o,a;if(i===xa(t,e,n,r)>0)for(o=e;o<n;o+=r)a=va(o,t[o],t[o+1],a);else for(o=n-r;o>=e;o-=r)a=va(o,t[o],t[o+1],a);return a&&pa(a,a.next)&&(_a(a),a=a.next),a}function $o(t,e){if(!t)return t;e||(e=t);var n,r=t;do{if(n=!1,r.steiner||!pa(r,r.next)&&0!==fa(r.prev,r,r.next))r=r.next;else{if(_a(r),(r=e=r.prev)===r.next)break;n=!0}}while(n||r!==e);return e}function ta(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=ua(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,c=1;do{for(n=t,t=null,o=null,a=0;n;){for(a++,r=n,s=0,e=0;e<c&&(s++,r=r.nextZ);e++);for(u=c;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,c*=2}while(a>1)}(i)}(t,r,i,o);for(var s,u,c=t;t.prev!==t.next;)if(s=t.prev,u=t.next,o?na(t,r,i,o):ea(t))e.push(s.i/n),e.push(t.i/n),e.push(u.i/n),_a(t),t=u.next,c=u.next;else if((t=u)===c){a?1===a?ta(t=ra($o(t),e,n),e,n,r,i,o,2):2===a&&ia(t,e,n,r,i,o):ta($o(t),e,n,r,i,o,1);break}}}function ea(t){var e=t.prev,n=t,r=t.next;if(fa(e,n,r)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(la(e.x,e.y,n.x,n.y,r.x,r.y,i.x,i.y)&&fa(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function na(t,e,n,r){var i=t.prev,o=t,a=t.next;if(fa(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,c=i.x>o.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,l=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,h=ua(s,u,e,n,r),f=ua(c,l,e,n,r),p=t.prevZ,d=t.nextZ;p&&p.z>=h&&d&&d.z<=f;){if(p!==t.prev&&p!==t.next&&la(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&fa(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,d!==t.prev&&d!==t.next&&la(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&fa(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(;p&&p.z>=h;){if(p!==t.prev&&p!==t.next&&la(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&fa(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;d&&d.z<=f;){if(d!==t.prev&&d!==t.next&&la(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&fa(d.prev,d,d.next)>=0)return!1;d=d.nextZ}return!0}function ra(t,e,n){var r=t;do{var i=r.prev,o=r.next.next;!pa(i,o)&&da(i,r,r.next,o)&&ma(i,o)&&ma(o,i)&&(e.push(i.i/n),e.push(r.i/n),e.push(o.i/n),_a(r),_a(r.next),r=t=o),r=r.next}while(r!==t);return $o(r)}function ia(t,e,n,r,i,o){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&ha(a,s)){var u=ya(a,s);return a=$o(a,a.next),u=$o(u,u.next),ta(a,e,n,r,i,o),void ta(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 aa(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,c=n,l=n.x,h=n.y,f=1/0;r=n;do{i>=r.x&&r.x>=l&&i!==r.x&&la(o<h?i:a,o,l,h,o<h?a:i,o,r.x,r.y)&&(u=Math.abs(o-r.y)/(i-r.x),ma(r,t)&&(u<f||u===f&&(r.x>n.x||r.x===n.x&&sa(n,r)))&&(n=r,f=u)),r=r.next}while(r!==c);return n}(t,e)){var n=ya(e,t);$o(n,n.next)}}function sa(t,e){return fa(t.prev,t,e.prev)<0&&fa(e.next,t,t.next)<0}function ua(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 ca(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 la(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 ha(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&&da(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(ma(t,e)&&ma(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)&&(fa(t.prev,t,e.prev)||fa(t,e.prev,e))||pa(t,e)&&fa(t.prev,t,t.next)>0&&fa(e.prev,e,e.next)>0)}function fa(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function pa(t,e){return t.x===e.x&&t.y===e.y}function da(t,e,n,r){var i=ga(fa(t,e,n)),o=ga(fa(t,e,r)),a=ga(fa(n,r,t)),s=ga(fa(n,r,e));return i!==o&&a!==s||!(0!==i||!Aa(t,n,e))||!(0!==o||!Aa(t,r,e))||!(0!==a||!Aa(n,t,r))||!(0!==s||!Aa(n,e,r))}function Aa(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 ga(t){return t>0?1:t<0?-1:0}function ma(t,e){return fa(t.prev,t,t.next)<0?fa(t,e,t.next)>=0&&fa(t,t.prev,e)>=0:fa(t,e,t.prev)<0||fa(t,t.next,e)<0}function ya(t,e){var n=new ba(t.i,t.x,t.y),r=new ba(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 va(t,e,n,r){var i=new ba(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 _a(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 ba(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 xa(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 wa(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),c=.5*Math.exp(2*u/3),l=.5*Math.sqrt(u*c*(a-c)/a)*(s-a/2<0?-1:1);t(e,n,Math.max(r,Math.floor(n-s*c/a+l)),Math.min(i,Math.floor(n+(a-s)*c/a+l)),o)}var h=e[n],f=r,p=i;for(Ea(e,r,n),o(e[i],h)>0&&Ea(e,r,i);f<p;){for(Ea(e,f,p),f++,p--;o(e[f],h)<0;)f++;for(;o(e[p],h)>0;)p--}0===o(e[r],h)?Ea(e,r,p):Ea(e,++p,i),p<=n&&(r=p+1),n<=p&&(i=p-1)}}(t,e,n||0,r||t.length-1,i||Oa)}function Ea(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function Oa(t,e){return t<e?-1:t>e?1:0}function Sa(t,e){var n=t.length;if(n<=1)return[t];for(var r,i,o=[],a=0;a<n;a++){var s=E(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||(wa(o[u],e,1,o[u].length-1,Ta),o[u]=o[u].slice(0,e));return o}function Ta(t,e){return e.area-t.area}function Ca(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 Pa(t,e,n,r,i){for(var o=i.patternDependencies,a=0,s=e;a<s.length;a+=1){var u=s[a],c=u.paint.get(t+"-pattern").value;if("constant"!==c.kind){var l=c.evaluate({zoom:r-1},n,{},i.availableImages),h=c.evaluate({zoom:r},n,{},i.availableImages),f=c.evaluate({zoom:r+1},n,{},i.availableImages);l=l&&l.name?l.name:l,h=h&&h.name?h.name:h,f=f&&f.name?f.name:f,o[l]=!0,o[h]=!0,o[f]=!0,n.patterns[u.id]={min:l,mid:h,max:f}}}return n}Ko.deviation=function(t,e,n,r){var i=e&&e.length,o=i?e[0]*n:t.length,a=Math.abs(xa(t,0,o,n));if(i)for(var s=0,u=e.length;s<u;s++){var c=e[s]*n,l=s<u-1?e[s+1]*n:t.length;a-=Math.abs(xa(t,c,l,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)},Ko.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},Zo.default=Qo;var Ma=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 wi,this.indexArray2=new Ei,this.programConfigurations=new so(Jo,t.layers,t.zoom),this.segments=new Ni,this.segments2=new Ni,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};Ma.prototype.populate=function(t,e){this.hasPattern=Ca("fill",this.layers,e);for(var n=this.layers[0].layout.get("fill-sort-key"),r=[],i=0,o=t;i<o.length;i+=1){var a=o[i],s=a.feature,u=a.index,c=a.sourceLayerIndex;if(this.layers[0]._featureFilter(new Ur(this.zoom),s)){var l=fo(s),h=n?n.evaluate(s,{},e.availableImages):void 0,f={id:s.id,properties:s.properties,type:s.type,sourceLayerIndex:c,index:u,geometry:l,patterns:{},sortKey:h};r.push(f)}}n&&r.sort((function(t,e){return t.sortKey-e.sortKey}));for(var p=0,d=r;p<d.length;p+=1){var A=d[p],g=A,m=g.geometry,y=g.index,v=g.sourceLayerIndex;if(this.hasPattern){var _=Pa("fill",this.layers,A,this.zoom,e);this.patternFeatures.push(_)}else this.addFeature(A,m,y,{});var b=t[y].feature;e.featureIndex.insert(b,m,y,v,this.index)}},Ma.prototype.update=function(t,e,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,n)},Ma.prototype.addFeatures=function(t,e){for(var n=0,r=this.patternFeatures;n<r.length;n+=1){var i=r[n];this.addFeature(i,i.geometry,i.index,e)}},Ma.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Ma.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Ma.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Jo),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0},Ma.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},Ma.prototype.addFeature=function(t,e,n,r){for(var i=0,o=Sa(e,500);i<o.length;i+=1){for(var a=o[i],s=0,u=0,c=a;u<c.length;u+=1)s+=c[u].length;for(var l=this.segments.prepareSegment(s,this.layoutVertexArray,this.indexArray),h=l.vertexLength,f=[],p=[],d=0,A=a;d<A.length;d+=1){var g=A[d];if(0!==g.length){g!==a[0]&&p.push(f.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),f.push(g[0].x),f.push(g[0].y);for(var v=1;v<g.length;v++)this.layoutVertexArray.emplaceBack(g[v].x,g[v].y),this.indexArray2.emplaceBack(y+v-1,y+v),f.push(g[v].x),f.push(g[v].y);m.vertexLength+=g.length,m.primitiveLength+=g.length}}for(var _=Zo(f,p),b=0;b<_.length;b+=3)this.indexArray.emplaceBack(h+_[b],h+_[b+1],h+_[b+2]);l.vertexLength+=s,l.primitiveLength+=_.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,n,r)},dr("FillBucket",Ma,{omit:["layers","patternFeatures"]});var Ia=new ti({"fill-sort-key":new Qr(Tt.layout_fill["fill-sort-key"])}),Ba={paint:new ti({"fill-antialias":new Zr(Tt.paint_fill["fill-antialias"]),"fill-opacity":new Qr(Tt.paint_fill["fill-opacity"]),"fill-color":new Qr(Tt.paint_fill["fill-color"]),"fill-outline-color":new Qr(Tt.paint_fill["fill-outline-color"]),"fill-translate":new Zr(Tt.paint_fill["fill-translate"]),"fill-translate-anchor":new Zr(Tt.paint_fill["fill-translate-anchor"]),"fill-pattern":new Kr(Tt.paint_fill["fill-pattern"])}),layout:Ia},Ra=function(t){function e(e){t.call(this,e,Ba)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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 Ma(t)},e.prototype.queryRadius=function(){return Co(this.paint.get("fill-translate"))},e.prototype.queryIntersectsFeature=function(t,e,n,r,i,o,a){return yo(Po(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),o.angle,a),r)},e.prototype.isTileClipped=function(){return!0},e}(ei),ka=oi([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4).members,La=Da;function Da(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(ja,this,e)}function ja(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 Fa(t){for(var e,n,r=0,i=0,o=t.length,a=o-1;i<o;a=i++)e=t[i],r+=((n=t[a]).x-e.x)*(e.y+n.y);return r}Da.types=["Unknown","Point","LineString","Polygon"],Da.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 c=t.readVarint();r=7&c,o=c>>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},Da.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,c=-1/0;t.pos<e;){if(r<=0){var l=t.readVarint();n=7&l,r=l>>3}if(r--,1===n||2===n)(i+=t.readSVarint())<a&&(a=i),i>s&&(s=i),(o+=t.readSVarint())<u&&(u=o),o>c&&(c=o);else if(7!==n)throw new Error("unknown command "+n)}return[a,u,s,c]},Da.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(),c=Da.types[this.type];function l(t){for(var e=0;e<t.length;e++){var n=t[e],r=180-360*(n.y+s)/o;t[e]=[360*(n.x+a)/o-180,360/Math.PI*Math.atan(Math.exp(r*Math.PI/180))-90]}}switch(this.type){case 1:var h=[];for(r=0;r<u.length;r++)h[r]=u[r][0];l(u=h);break;case 2:for(r=0;r<u.length;r++)l(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=Fa(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++)l(u[r][i])}1===u.length?u=u[0]:c="Multi"+c;var f={type:"Feature",geometry:{type:c,coordinates:u},properties:this.properties};return"id"in this&&(f.id=this.id),f};var za=Ua;function Ua(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(Na,this,e),this.length=this._features.length}function Na(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 Ga(t,e,n){if(3===t){var r=new za(n,n.readVarint()+n.pos);r.length&&(e[r.name]=r)}}Ua.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 La(this._pbf,e,this.extent,this._keys,this._values)};var Va={VectorTile:function(t,e){this.layers=t.readFields(Ga,{},e)},VectorTileFeature:La,VectorTileLayer:za},Ha=Va.VectorTileFeature.types,Wa=Math.pow(2,13);function qa(t,e,n,r,i,o,a,s){t.emplaceBack(e,n,2*Math.floor(r*Wa)+a,i*Wa*2,o*Wa*2,Math.round(s))}var Xa=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 ci,this.indexArray=new wi,this.programConfigurations=new so(ka,t.layers,t.zoom),this.segments=new Ni,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function Ja(t,e){return t.x===e.x&&(t.x<0||t.x>lo)||t.y===e.y&&(t.y<0||t.y>lo)}function Za(t){return t.every((function(t){return t.x<0}))||t.every((function(t){return t.x>lo}))||t.every((function(t){return t.y<0}))||t.every((function(t){return t.y>lo}))}Xa.prototype.populate=function(t,e){this.features=[],this.hasPattern=Ca("fill-extrusion",this.layers,e);for(var n=0,r=t;n<r.length;n+=1){var i=r[n],o=i.feature,a=i.index,s=i.sourceLayerIndex;if(this.layers[0]._featureFilter(new Ur(this.zoom),o)){var u=fo(o),c={sourceLayerIndex:s,index:a,geometry:u,properties:o.properties,type:o.type,patterns:{}};void 0!==o.id&&(c.id=o.id),this.hasPattern?this.features.push(Pa("fill-extrusion",this.layers,c,this.zoom,e)):this.addFeature(c,u,a,{}),e.featureIndex.insert(o,u,a,s,this.index,!0)}}},Xa.prototype.addFeatures=function(t,e){for(var n=0,r=this.features;n<r.length;n+=1){var i=r[n],o=i.geometry;this.addFeature(i,o,i.index,e)}},Xa.prototype.update=function(t,e,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,n)},Xa.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Xa.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Xa.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,ka),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},Xa.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Xa.prototype.addFeature=function(t,e,n,r){for(var i=0,o=Sa(e,500);i<o.length;i+=1){for(var a=o[i],s=0,u=0,c=a;u<c.length;u+=1)s+=c[u].length;for(var l=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),h=0,f=a;h<f.length;h+=1){var p=f[h];if(0!==p.length&&!Za(p))for(var d=0,A=0;A<p.length;A++){var g=p[A];if(A>=1){var m=p[A-1];if(!Ja(g,m)){l.vertexLength+4>Ni.MAX_VERTEX_ARRAY_LENGTH&&(l=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var y=g.sub(m)._perp()._unit(),v=m.dist(g);d+v>32768&&(d=0),qa(this.layoutVertexArray,g.x,g.y,y.x,y.y,0,0,d),qa(this.layoutVertexArray,g.x,g.y,y.x,y.y,0,1,d),d+=v,qa(this.layoutVertexArray,m.x,m.y,y.x,y.y,0,0,d),qa(this.layoutVertexArray,m.x,m.y,y.x,y.y,0,1,d);var _=l.vertexLength;this.indexArray.emplaceBack(_,_+2,_+1),this.indexArray.emplaceBack(_+1,_+2,_+3),l.vertexLength+=4,l.primitiveLength+=2}}}}if(l.vertexLength+s>Ni.MAX_VERTEX_ARRAY_LENGTH&&(l=this.segments.prepareSegment(s,this.layoutVertexArray,this.indexArray)),"Polygon"===Ha[t.type]){for(var b=[],x=[],w=l.vertexLength,E=0,O=a;E<O.length;E+=1){var S=O[E];if(0!==S.length){S!==a[0]&&x.push(b.length/2);for(var T=0;T<S.length;T++){var C=S[T];qa(this.layoutVertexArray,C.x,C.y,0,0,1,1,0),b.push(C.x),b.push(C.y)}}}for(var P=Zo(b,x),M=0;M<P.length;M+=3)this.indexArray.emplaceBack(w+P[M],w+P[M+2],w+P[M+1]);l.primitiveLength+=P.length/3,l.vertexLength+=s}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,n,r)},dr("FillExtrusionBucket",Xa,{omit:["layers","features"]});var Qa={paint:new ti({"fill-extrusion-opacity":new Zr(Tt["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Qr(Tt["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Zr(Tt["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Zr(Tt["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Kr(Tt["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Qr(Tt["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Qr(Tt["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Zr(Tt["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})},Ka=function(t){function e(e){t.call(this,e,Qa)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createBucket=function(t){return new Xa(t)},e.prototype.queryRadius=function(){return Co(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 c=Po(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),a.angle,s),l=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],c=[u.x,u.y,0,1];ko(c,c,e),o.push(new i(c[0]/c[3],c[1]/c[3]))}return o}(c,u),p=function(t,e,n,r){for(var o=[],a=[],s=r[8]*e,u=r[9]*e,c=r[10]*e,l=r[11]*e,h=r[8]*n,f=r[9]*n,p=r[10]*n,d=r[11]*n,A=0,g=t;A<g.length;A+=1){for(var m=[],y=[],v=0,_=g[A];v<_.length;v+=1){var b=_[v],x=b.x,w=b.y,E=r[0]*x+r[4]*w+r[12],O=r[1]*x+r[5]*w+r[13],S=r[2]*x+r[6]*w+r[14],T=r[3]*x+r[7]*w+r[15],C=S+c,P=T+l,M=E+h,I=O+f,B=S+p,R=T+d,k=new i((E+s)/P,(O+u)/P);k.z=C/P,m.push(k);var L=new i(M/R,I/R);L.z=B/R,y.push(L)}o.push(m),a.push(y)}return[o,a]}(r,h,l,u);return function(t,e,n){var r=1/0;yo(n,e)&&(r=$a(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],c=o[s+1],l=a[s],h=[u,c,a[s+1],l,u];go(n,h)&&(r=Math.min(r,$a(n,h)))}return r!==1/0&&r}(p[0],p[1],f)},e}(ei);function Ya(t,e){return t.x*e.x+t.y*e.y}function $a(t,e){if(1===t.length){var n=e[0],r=e[1],i=e[3],o=t[0],a=r.sub(n),s=i.sub(n),u=o.sub(n),c=Ya(a,a),l=Ya(a,s),h=Ya(s,s),f=Ya(u,a),p=Ya(u,s),d=c*h-l*l,A=(h*f-l*p)/d,g=(c*p-l*f)/d,m=1-A-g;return n.z*m+r.z*A+i.z*g}for(var y=1/0,v=0,_=e;v<_.length;v+=1){var b=_[v];y=Math.min(y,b.z)}return y}var ts=oi([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4).members,es=Va.VectorTileFeature.types,ns=Math.cos(Math.PI/180*37.5),rs=Math.pow(2,14)/.5,is=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 li,this.indexArray=new wi,this.programConfigurations=new so(ts,t.layers,t.zoom),this.segments=new Ni,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};is.prototype.populate=function(t,e){this.hasPattern=Ca("line",this.layers,e);for(var n=this.layers[0].layout.get("line-sort-key"),r=[],i=0,o=t;i<o.length;i+=1){var a=o[i],s=a.feature,u=a.index,c=a.sourceLayerIndex;if(this.layers[0]._featureFilter(new Ur(this.zoom),s)){var l=fo(s),h=n?n.evaluate(s,{}):void 0,f={id:s.id,properties:s.properties,type:s.type,sourceLayerIndex:c,index:u,geometry:l,patterns:{},sortKey:h};r.push(f)}}n&&r.sort((function(t,e){return t.sortKey-e.sortKey}));for(var p=0,d=r;p<d.length;p+=1){var A=d[p],g=A,m=g.geometry,y=g.index,v=g.sourceLayerIndex;if(this.hasPattern){var _=Pa("line",this.layers,A,this.zoom,e);this.patternFeatures.push(_)}else this.addFeature(A,m,y,{});var b=t[y].feature;e.featureIndex.insert(b,m,y,v,this.index)}},is.prototype.update=function(t,e,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,n)},is.prototype.addFeatures=function(t,e){for(var n=0,r=this.patternFeatures;n<r.length;n+=1){var i=r[n];this.addFeature(i,i.geometry,i.index,e)}},is.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},is.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},is.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,ts),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},is.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},is.prototype.addFeature=function(t,e,n,r){for(var i=this.layers[0].layout,o=i.get("line-join").evaluate(t,{}),a=i.get("line-cap"),s=i.get("line-miter-limit"),u=i.get("line-round-limit"),c=0,l=e;c<l.length;c+=1){var h=l[c];this.addLine(h,t,o,a,s,u,n,r)}},is.prototype.addLine=function(t,e,n,r,i,o,a,s){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,e.properties&&e.properties.hasOwnProperty("mapbox_clip_start")&&e.properties.hasOwnProperty("mapbox_clip_end")){this.clipStart=+e.properties.mapbox_clip_start,this.clipEnd=+e.properties.mapbox_clip_end;for(var u=0;u<t.length-1;u++)this.totalDistance+=t[u].dist(t[u+1])}for(var c="Polygon"===es[e.type],l=t.length;l>=2&&t[l-1].equals(t[l-2]);)l--;for(var h=0;h<l-1&&t[h].equals(t[h+1]);)h++;if(!(l<(c?3:2))){"bevel"===n&&(i=1.05);var f,p=this.overscaling<=16?15*lo/(512*this.overscaling):0,d=this.segments.prepareSegment(10*l,this.layoutVertexArray,this.indexArray),A=void 0,g=void 0,m=void 0,y=void 0;this.e1=this.e2=-1,c&&(f=t[l-2],y=t[h].sub(f)._unit()._perp());for(var v=h;v<l;v++)if(!(g=c&&v===l-1?t[h+1]:t[v+1])||!t[v].equals(g)){y&&(m=y),f&&(A=f),f=t[v],y=g?g.sub(f)._unit()._perp():m;var _=(m=m||y).add(y);0===_.x&&0===_.y||_._unit();var b=m.x*y.x+m.y*y.y,x=_.x*y.x+_.y*y.y,w=0!==x?1/x:1/0,E=2*Math.sqrt(2-2*x),O=x<ns&&A&&g,S=m.x*y.y-m.y*y.x>0;if(O&&v>h){var T=f.dist(A);if(T>2*p){var C=f.sub(f.sub(A)._mult(p/T)._round());this.updateDistance(A,C),this.addCurrentVertex(C,m,0,0,d),A=C}}var P=A&&g,M=P?n:c?"butt":r;if(P&&"round"===M&&(w<o?M="miter":w<=2&&(M="fakeround")),"miter"===M&&w>i&&(M="bevel"),"bevel"===M&&(w>2&&(M="flipbevel"),w<i&&(M="miter")),A&&this.updateDistance(A,f),"miter"===M)_._mult(w),this.addCurrentVertex(f,_,0,0,d);else if("flipbevel"===M){if(w>100)_=y.mult(-1);else{var I=w*m.add(y).mag()/m.sub(y).mag();_._perp()._mult(I*(S?-1:1))}this.addCurrentVertex(f,_,0,0,d),this.addCurrentVertex(f,_.mult(-1),0,0,d)}else if("bevel"===M||"fakeround"===M){var B=-Math.sqrt(w*w-1),R=S?B:0,k=S?0:B;if(A&&this.addCurrentVertex(f,m,R,k,d),"fakeround"===M)for(var L=Math.round(180*E/Math.PI/20),D=1;D<L;D++){var j=D/L;if(.5!==j){var F=j-.5;j+=j*F*(j-1)*((1.0904+b*(b*(3.55645-1.43519*b)-3.2452))*F*F+(.848013+b*(.215638*b-1.06021)))}var z=y.sub(m)._mult(j)._add(m)._unit()._mult(S?-1:1);this.addHalfVertex(f,z.x,z.y,!1,S,0,d)}g&&this.addCurrentVertex(f,y,-R,-k,d)}else if("butt"===M)this.addCurrentVertex(f,_,0,0,d);else if("square"===M){var U=A?1:-1;this.addCurrentVertex(f,_,U,U,d)}else"round"===M&&(A&&(this.addCurrentVertex(f,m,0,0,d),this.addCurrentVertex(f,m,1,1,d,!0)),g&&(this.addCurrentVertex(f,y,-1,-1,d,!0),this.addCurrentVertex(f,y,0,0,d)));if(O&&v<l-1){var N=f.dist(g);if(N>2*p){var G=f.add(g.sub(f)._mult(p/N)._round());this.updateDistance(f,G),this.addCurrentVertex(G,y,0,0,d),f=G}}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,a,s)}},is.prototype.addCurrentVertex=function(t,e,n,r,i,o){void 0===o&&(o=!1);var a=e.x+e.y*n,s=e.y-e.x*n,u=-e.x+e.y*r,c=-e.y-e.x*r;this.addHalfVertex(t,a,s,o,!1,n,i),this.addHalfVertex(t,u,c,o,!0,-r,i),this.distance>rs/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,n,r,i,o))},is.prototype.addHalfVertex=function(t,e,n,r,i,o,a){var s=t.x,u=t.y,c=.5*this.scaledDistance;this.layoutVertexArray.emplaceBack((s<<1)+(r?1:0),(u<<1)+(i?1:0),Math.round(63*e)+128,Math.round(63*n)+128,1+(0===o?0:o<0?-1:1)|(63&c)<<2,c>>6);var l=a.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,l),a.primitiveLength++),i?this.e2=l:this.e1=l},is.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.scaledDistance=this.totalDistance>0?(this.clipStart+(this.clipEnd-this.clipStart)*this.distance/this.totalDistance)*(rs-1):this.distance},dr("LineBucket",is,{omit:["layers","patternFeatures"]});var os=new ti({"line-cap":new Zr(Tt.layout_line["line-cap"]),"line-join":new Qr(Tt.layout_line["line-join"]),"line-miter-limit":new Zr(Tt.layout_line["line-miter-limit"]),"line-round-limit":new Zr(Tt.layout_line["line-round-limit"]),"line-sort-key":new Qr(Tt.layout_line["line-sort-key"])}),as={paint:new ti({"line-opacity":new Qr(Tt.paint_line["line-opacity"]),"line-color":new Qr(Tt.paint_line["line-color"]),"line-translate":new Zr(Tt.paint_line["line-translate"]),"line-translate-anchor":new Zr(Tt.paint_line["line-translate-anchor"]),"line-width":new Qr(Tt.paint_line["line-width"]),"line-gap-width":new Qr(Tt.paint_line["line-gap-width"]),"line-offset":new Qr(Tt.paint_line["line-offset"]),"line-blur":new Qr(Tt.paint_line["line-blur"]),"line-dasharray":new Yr(Tt.paint_line["line-dasharray"]),"line-pattern":new Kr(Tt.paint_line["line-pattern"]),"line-gradient":new $r(Tt.paint_line["line-gradient"])}),layout:os},ss=new(function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.possiblyEvaluate=function(e,n){return n=new Ur(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=h({},n,{zoom:Math.floor(n.zoom)}),t.prototype.evaluate.call(this,e,n,r,i)},e}(Qr))(as.paint.properties["line-width"].specification);ss.useIntegerZoom=!0;var us=function(t){function e(e){t.call(this,e,as)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype._handleSpecialPaintPropertyUpdate=function(t){"line-gradient"===t&&this._updateGradient()},e.prototype._updateGradient=function(){var t=this._transitionablePaint._values["line-gradient"].value.expression;this.gradient=Ho(t,"lineProgress"),this.gradientTexture=null},e.prototype.recalculate=function(e,n){t.prototype.recalculate.call(this,e,n),this.paint._values["line-floorwidth"]=ss.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)},e.prototype.createBucket=function(t){return new is(t)},e.prototype.queryRadius=function(t){var e=t,n=cs(To("line-width",this,e),To("line-gap-width",this,e)),r=To("line-offset",this,e);return n/2+Math.abs(r)+Co(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,n,r,o,a,s){var u=Po(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),a.angle,s),c=s/2*cs(this.paint.get("line-width").evaluate(e,n),this.paint.get("line-gap-width").evaluate(e,n)),l=this.paint.get("line-offset").evaluate(e,n);return l&&(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 c=a[u-1],l=a[u],h=a[u+1],f=0===u?r:l.sub(c)._unit()._perp(),p=u===a.length-1?r:h.sub(l)._unit()._perp(),d=f._add(p)._unit(),A=d.x*p.x+d.y*p.y;d._mult(1/A),s.push(d._mult(e)._add(l))}n.push(s)}return n}(r,l*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(Oo(t,i[o]))return!0;if(vo(t,i,n))return!0}return!1}(u,r,c)},e.prototype.isTileClipped=function(){return!0},e}(ei);function cs(t,e){return e>0?e+2*t:t}var ls=oi([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),hs=oi([{name:"a_projected_pos",components:3,type:"Float32"}],4),fs=(oi([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),oi([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),ps=(oi([{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"},{type:"Int16",name:"radius"},{type:"Int16",name:"signedDistanceFromAnchor"}]),oi([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),ds=oi([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4);function As(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()),zr.applyArabicShaping&&(t=zr.applyArabicShaping(t)),t}(t.text,e,n)})),t}oi([{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"}]),oi([{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:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"}]),oi([{type:"Float32",name:"offsetX"}]),oi([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var gs={"!":"︕","#":"",$:"","%":"","&":"","(":"︵",")":"︶","*":"","+":"",",":"︐","-":"︲",".":"・","/":"",":":"︓",";":"︔","<":"︿","=":"",">":"﹀","?":"︖","@":"","[":"﹇","\\":"","]":"﹈","^":"",_:"︳","`":"","{":"︷","|":"―","}":"︸","~":"","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","":"︲","—":"︱","":"﹃","":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","":"︹","":"︺","〖":"︗","〗":"︘","":"︕","":"︵","":"︶","":"︐","":"︲","":"・","":"︓","":"︔","":"︿","":"﹀","":"︖","":"﹇","":"﹈","_":"︳","":"︷","":"―","":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},ms=function(t,e,n,r,i){var o,a,s=8*i-r-1,u=(1<<s)-1,c=u>>1,l=-7,h=n?i-1:0,f=n?-1:1,p=t[e+h];for(h+=f,o=p&(1<<-l)-1,p>>=-l,l+=s;l>0;o=256*o+t[e+h],h+=f,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=r;l>0;a=256*a+t[e+h],h+=f,l-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),o-=c}return(p?-1:1)*a*Math.pow(2,o-r)},ys=function(t,e,n,r,i,o){var a,s,u,c=8*o-i-1,l=(1<<c)-1,h=l>>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=l):(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>=l?(s=0,a=l):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,c+=i;c>0;t[n+p]=255&a,p+=d,a/=256,c-=8);t[n+p-d]|=128*A},vs=_s;function _s(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}_s.Varint=0,_s.Fixed64=1,_s.Bytes=2,_s.Fixed32=5;var bs="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function xs(t){return t.type===_s.Bytes?t.readVarint()+t.pos:t.pos+1}function ws(t,e,n){return n?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function Es(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 Os(t,e){for(var n=0;n<t.length;n++)e.writeVarint(t[n])}function Ss(t,e){for(var n=0;n<t.length;n++)e.writeSVarint(t[n])}function Ts(t,e){for(var n=0;n<t.length;n++)e.writeFloat(t[n])}function Cs(t,e){for(var n=0;n<t.length;n++)e.writeDouble(t[n])}function Ps(t,e){for(var n=0;n<t.length;n++)e.writeBoolean(t[n])}function Ms(t,e){for(var n=0;n<t.length;n++)e.writeFixed32(t[n])}function Is(t,e){for(var n=0;n<t.length;n++)e.writeSFixed32(t[n])}function Bs(t,e){for(var n=0;n<t.length;n++)e.writeFixed64(t[n])}function Rs(t,e){for(var n=0;n<t.length;n++)e.writeSFixed64(t[n])}function ks(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function Ls(t,e,n){t[n]=e,t[n+1]=e>>>8,t[n+2]=e>>>16,t[n+3]=e>>>24}function Ds(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function js(t,e,n){1===t&&n.readMessage(Fs,e)}function Fs(t,e,n){if(3===t){var r=n.readMessage(zs,{}),i=r.id,o=r.bitmap,a=r.width,s=r.height,u=r.left,c=r.top,l=r.advance;e.push({id:i,bitmap:new No({width:a+6,height:s+6},o),metrics:{width:a,height:s,left:u,top:c,advance:l}})}}function zs(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 Us(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,c=0,l=t;c<l.length;c+=1)for(var h=l[c],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}}_s.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=ks(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Ds(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=ks(this.buf,this.pos)+4294967296*ks(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=ks(this.buf,this.pos)+4294967296*Ds(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=ms(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=ms(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 ws(t,r,e);if(r|=(127&(i=o[n.pos++]))<<3,i<128)return ws(t,r,e);if(r|=(127&(i=o[n.pos++]))<<10,i<128)return ws(t,r,e);if(r|=(127&(i=o[n.pos++]))<<17,i<128)return ws(t,r,e);if(r|=(127&(i=o[n.pos++]))<<24,i<128)return ws(t,r,e);if(r|=(1&(i=o[n.pos++]))<<31,i<128)return ws(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&&bs?function(t,e,n){return bs.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],c=null,l=u>239?4:u>223?3:u>191?2:1;if(i+l>n)break;1===l?u<128&&(c=u):2===l?128==(192&(o=t[i+1]))&&(c=(31&u)<<6|63&o)<=127&&(c=null):3===l?(o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&((c=(15&u)<<12|(63&o)<<6|63&a)<=2047||c>=55296&&c<=57343)&&(c=null)):4===l&&(o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&((c=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,l=1):c>65535&&(c-=65536,r+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),r+=String.fromCharCode(c),i+=l}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!==_s.Bytes)return t.push(this.readVarint(e));var n=xs(this);for(t=t||[];this.pos<n;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==_s.Bytes)return t.push(this.readSVarint());var e=xs(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==_s.Bytes)return t.push(this.readBoolean());var e=xs(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==_s.Bytes)return t.push(this.readFloat());var e=xs(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==_s.Bytes)return t.push(this.readDouble());var e=xs(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==_s.Bytes)return t.push(this.readFixed32());var e=xs(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==_s.Bytes)return t.push(this.readSFixed32());var e=xs(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==_s.Bytes)return t.push(this.readFixed64());var e=xs(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==_s.Bytes)return t.push(this.readSFixed64());var e=xs(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===_s.Varint)for(;this.buf[this.pos++]>127;);else if(e===_s.Bytes)this.pos=this.readVarint()+this.pos;else if(e===_s.Fixed32)this.pos+=4;else{if(e!==_s.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),Ls(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),Ls(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),Ls(this.buf,-1&t,this.pos),Ls(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),Ls(this.buf,-1&t,this.pos),Ls(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,t>>>=7,n.buf[n.pos]=127&t}(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&&Es(e,n,this),this.pos=e-1,this.writeVarint(n),this.pos+=n},writeFloat:function(t){this.realloc(4),ys(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),ys(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&&Es(n,r,this),this.pos=n-1,this.writeVarint(r),this.pos+=r},writeMessage:function(t,e,n){this.writeTag(t,_s.Bytes),this.writeRawMessage(e,n)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,Os,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Ss,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,Ps,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,Ts,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,Cs,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,Ms,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,Is,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Bs,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Rs,e)},writeBytesField:function(t,e){this.writeTag(t,_s.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,_s.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,_s.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,_s.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,_s.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,_s.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,_s.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,_s.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,_s.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,_s.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var Ns=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},Gs={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};Gs.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},Gs.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},Gs.tlbr.get=function(){return this.tl.concat(this.br)},Gs.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(Ns.prototype,Gs);var Vs=function(t,e){var n={},r={};this.haveRenderCallbacks=[];var i=[];this.addImages(t,n,i),this.addImages(e,r,i);var o=Us(i),a=o.w,s=o.h,u=new Go({width:a||1,height:s||1});for(var c in t){var l=t[c],h=n[c].paddedRect;Go.copy(l.data,u,{x:0,y:0},{x:h.x+1,y:h.y+1},l.data)}for(var f in e){var p=e[f],d=r[f].paddedRect,A=d.x+1,g=d.y+1,m=p.data.width,y=p.data.height;Go.copy(p.data,u,{x:0,y:0},{x:A,y:g},p.data),Go.copy(p.data,u,{x:0,y:y-1},{x:A,y:g-1},{width:m,height:1}),Go.copy(p.data,u,{x:0,y:0},{x:A,y:g+y},{width:m,height:1}),Go.copy(p.data,u,{x:m-1,y:0},{x:A-1,y:g},{width:1,height:y}),Go.copy(p.data,u,{x:0,y:0},{x:A+m,y:g},{width:1,height:y})}this.image=u,this.iconPositions=n,this.patternPositions=r};Vs.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 Ns(o,i),i.hasRenderCallback&&this.haveRenderCallbacks.push(r)}},Vs.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)},Vs.prototype.patchUpdatedImage=function(t,e,n){if(t&&e&&t.version!==e.version){t.version=e.version;var r=t.tl,i=r[0],o=r[1];n.update(e.data,void 0,{x:i,y:o})}},dr("ImagePosition",Ns),dr("ImageAtlas",Vs);var Hs={horizontal:1,vertical:2,horizontalOnly:3},Ws=function(){this.scale=1,this.fontStack="",this.imageName=null};Ws.forText=function(t,e){var n=new Ws;return n.scale=t||1,n.fontStack=e,n},Ws.forImage=function(t){var e=new Ws;return e.imageName=t,e};var qs=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};function Xs(t,e,n,r,i,o,a,s,u,c,l,h,f,p,d,A){var g,m=qs.fromFeature(t,i);h===Hs.vertical&&m.verticalizePunctuation();var y=zr.processBidirectionalText,v=zr.processStyledBidirectionalText;if(y&&1===m.sections.length){g=[];for(var _=0,b=y(m.toString(),tu(m,c,o,e,r,p,d));_<b.length;_+=1){var x=b[_],w=new qs;w.text=x,w.sections=m.sections;for(var E=0;E<x.length;E++)w.sectionIndex.push(0);g.push(w)}}else if(v){g=[];for(var O=0,S=v(m.text,m.sectionIndex,tu(m,c,o,e,r,p,d));O<S.length;O+=1){var T=S[O],C=new qs;C.text=T[0],C.sectionIndex=T[1],C.sections=m.sections,g.push(C)}}else g=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}(m,tu(m,c,o,e,r,p,d));var P=[],M={positionedLines:P,text:m.toString(),top:l[1],bottom:l[1],left:l[0],right:l[0],writingMode:h,iconsInText:!1,verticalizable:!1};return function(t,e,n,r,i,o,a,s,u,c,l,h){for(var f=0,p=-17,d=0,A=0,g="right"===s?1:"left"===s?0:.5,m=0,y=0,v=i;y<v.length;y+=1){var _=v[y];_.trim();var b=_.getMaxScale(),x=24*(b-1),w={positionedGlyphs:[],lineOffset:0};t.positionedLines[m]=w;var E=w.positionedGlyphs,O=0;if(_.length()){for(var S=0;S<_.length();S++){var T=_.getSection(S),C=_.getSectionIndex(S),P=_.getCharCode(S),M=0,I=null,B=null,R=null,k=24,L=!(u===Hs.horizontal||!l&&!wr(P)||l&&(Js[P]||(W=P,_r.Arabic(W)||_r["Arabic Supplement"](W)||_r["Arabic Extended-A"](W)||_r["Arabic Presentation Forms-A"](W)||_r["Arabic Presentation Forms-B"](W))));if(T.imageName){var D=r[T.imageName];if(!D)continue;R=T.imageName,t.iconsInText=t.iconsInText||!0,B=D.paddedRect;var j=D.displaySize;T.scale=24*T.scale/h,I={width:j[0],height:j[1],left:1,top:-3,advance:L?j[1]:j[0]},M=x+(24-j[1]*T.scale),k=I.advance;var F=L?j[0]*T.scale-24*b:j[1]*T.scale-24*b;F>0&&F>O&&(O=F)}else{var z=n[T.fontStack],U=z&&z[P];if(U&&U.rect)B=U.rect,I=U.metrics;else{var N=e[T.fontStack],G=N&&N[P];if(!G)continue;I=G.metrics}M=24*(b-T.scale)}L?(t.verticalizable=!0,E.push({glyph:P,imageName:R,x:f,y:p+M,vertical:L,scale:T.scale,fontStack:T.fontStack,sectionIndex:C,metrics:I,rect:B}),f+=k*T.scale+c):(E.push({glyph:P,imageName:R,x:f,y:p+M,vertical:L,scale:T.scale,fontStack:T.fontStack,sectionIndex:C,metrics:I,rect:B}),f+=I.advance*T.scale+c)}if(0!==E.length){var V=f-c;d=Math.max(V,d),nu(E,0,E.length-1,g,O)}f=0;var H=o*b+O;w.lineOffset=Math.max(O,x),p+=H,A=Math.max(H,A),++m}else p+=o,++m}var W,q=p- -17,X=eu(a),J=X.horizontalAlign,Z=X.verticalAlign;(function(t,e,n,r,i,o,a,s,u){var c,l=(e-n)*i;c=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+=l,A.y+=c}})(t.positionedLines,g,J,Z,d,A,o,q,i.length),t.top+=-Z*q,t.bottom=t.top+q,t.left+=-J*d,t.right=t.left+d}(M,e,n,r,g,a,s,u,h,c,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}(P)&&M}qs.fromFeature=function(t,e){for(var n=new qs,r=0;r<t.sections.length;r++){var i=t.sections[r];i.image?n.addImageSection(i):n.addTextSection(i,e)}return n},qs.prototype.length=function(){return this.text.length},qs.prototype.getSection=function(t){return this.sections[this.sectionIndex[t]]},qs.prototype.getSectionIndex=function(t){return this.sectionIndex[t]},qs.prototype.getCharCode=function(t){return this.text.charCodeAt(t)},qs.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;r&&Er(r)&&!gs[t[n+1]]||i&&Er(i)&&!gs[t[n-1]]||!gs[t[n]]?e+=t[n]:e+=gs[t[n]]}return e}(this.text)},qs.prototype.trim=function(){for(var t=0,e=0;e<this.text.length&&Js[this.text.charCodeAt(e)];e++)t++;for(var n=this.text.length,r=this.text.length-1;r>=0&&r>=t&&Js[this.text.charCodeAt(r)];r--)n--;this.text=this.text.substring(t,n),this.sectionIndex=this.sectionIndex.slice(t,n)},qs.prototype.substring=function(t,e){var n=new qs;return n.text=this.text.substring(t,e),n.sectionIndex=this.sectionIndex.slice(t,e),n.sections=this.sections,n},qs.prototype.toString=function(){return this.text},qs.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce((function(e,n){return Math.max(e,t.sections[n].scale)}),0)},qs.prototype.addTextSection=function(t,e){this.text+=t.text,this.sections.push(Ws.forText(t.scale,t.fontStack||e));for(var n=this.sections.length-1,r=0;r<t.text.length;++r)this.sectionIndex.push(n)},qs.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(Ws.forImage(e)),this.sectionIndex.push(this.sections.length-1)):x("Reached maximum number of images 6401")}else x("Can't add FormattedSection with an empty image.")},qs.prototype.getNextImageSectionCharCode=function(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var Js={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Zs={};function Qs(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 Ks(t,e,n,r){var i=Math.pow(t-e,2);return r?t<e?i/2:2*i:i+Math.abs(n)*n}function Ys(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 $s(t,e,n,r,i,o){for(var a=null,s=Ks(e,n,i,o),u=0,c=r;u<c.length;u+=1){var l=c[u],h=Ks(e-l.x,n,i,o)+l.badness;h<=s&&(a=l,s=h)}return{index:t,x:e,priorBreak:a,badness:s}}function tu(t,e,n,r,i,o,a){if("point"!==o)return[];if(!t)return[];for(var s,u=[],c=function(t,e,n,r,i,o){for(var a=0,s=0;s<t.length();s++){var u=t.getSection(s);a+=Qs(t.getCharCode(s),u,r,i,e,o)}return a/Math.max(1,Math.ceil(a/n))}(t,e,n,r,i,a),l=t.text.indexOf("")>=0,h=0,f=0;f<t.length();f++){var p=t.getSection(f),d=t.getCharCode(f);if(Js[d]||(h+=Qs(d,p,r,i,e,a)),f<t.length()-1){var A=!((s=d)<11904||!(_r["Bopomofo Extended"](s)||_r.Bopomofo(s)||_r["CJK Compatibility Forms"](s)||_r["CJK Compatibility Ideographs"](s)||_r["CJK Compatibility"](s)||_r["CJK Radicals Supplement"](s)||_r["CJK Strokes"](s)||_r["CJK Symbols and Punctuation"](s)||_r["CJK Unified Ideographs Extension A"](s)||_r["CJK Unified Ideographs"](s)||_r["Enclosed CJK Letters and Months"](s)||_r["Halfwidth and Fullwidth Forms"](s)||_r.Hiragana(s)||_r["Ideographic Description Characters"](s)||_r["Kangxi Radicals"](s)||_r["Katakana Phonetic Extensions"](s)||_r.Katakana(s)||_r["Vertical Forms"](s)||_r["Yi Radicals"](s)||_r["Yi Syllables"](s)));(Zs[d]||A||p.imageName)&&u.push($s(f+1,h,c,u,Ys(d,t.getCharCode(f+1),A&&l),!1))}}return function t(e){return e?t(e.priorBreak).concat(e.index):[]}($s(t.length(),h,c,u,0,!0))}function eu(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 nu(t,e,n,r,i){if(r||i)for(var o=t[n],a=o.metrics.advance*o.scale,s=(t[n].x+a)*r,u=e;u<=n;u++)t[u].x-=s,t[u].y+=i}function ru(t,e,n,r,i,o){var a,s=t.image;if(s.content){var u=s.content,c=s.pixelRatio||1;a=[u[0]/c,u[1]/c,s.displaySize[0]-u[2]/c,s.displaySize[1]-u[3]/c]}var l,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 g=e.top*o,m=e.bottom*o;return"height"===n||"both"===n?(l=i[1]+g-r[0],f=i[1]+m+r[2]):f=(l=i[1]+(g+m-s.displaySize[1])/2)+s.displaySize[1],{image:s,top:l,right:h,bottom:f,left:p,collisionPadding:a}}Zs[10]=!0,Zs[32]=!0,Zs[38]=!0,Zs[40]=!0,Zs[41]=!0,Zs[43]=!0,Zs[45]=!0,Zs[47]=!0,Zs[173]=!0,Zs[183]=!0,Zs[8203]=!0,Zs[8208]=!0,Zs[8211]=!0,Zs[8231]=!0;var iu=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),e.prototype.constructor=e,e.prototype.clone=function(){return new e(this.x,this.y,this.angle,this.segment)},e}(i);dr("Anchor",iu);var ou=128;function au(t,e){var n=e.expression;if("constant"===n.kind)return{kind:"constant",layoutSize:n.evaluate(new Ur(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 Ur(s)),maxSize:n.evaluate(new Ur(u)),interpolationType:i}}function su(t,e,n){var r=e.uSize,i=e.uSizeT,o=n.lowerSize,a=n.upperSize;return"source"===t.kind?o/ou:"composite"===t.kind?we(o/ou,a/ou,i):r}function uu(t,e){var n=0,r=0;if("constant"===t.kind)r=t.layoutSize;else if("source"!==t.kind){var i=t.interpolationType,o=t.minZoom,a=t.maxZoom,s=i?c(ze.interpolationFactor(i,e,o,a),0,1):0;"camera"===t.kind?r=we(t.minSize,t.maxSize,s):n=s}return{uSizeT:n,uSize:r}}var cu=Object.freeze({__proto__:null,getSizeData:au,evaluateSizeForFeature:su,evaluateSizeForZoom:uu,SIZE_PACK_FACTOR:ou});function lu(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=[],c=0;s<n/2;){var l=t[a-1],h=t[a],f=t[a+1];if(!f)return!1;var p=l.angleTo(h)-h.angleTo(f);for(p=Math.abs((p+3*Math.PI)%(2*Math.PI)-Math.PI),u.push({distance:s,angleDelta:p}),c+=p;s-u[0].distance>r;)c-=u.shift().angleDelta;if(c>i)return!1;a++,s+=h.dist(f)}return!0}function hu(t){for(var e=0,n=0;n<t.length-1;n++)e+=t[n].dist(t[n+1]);return e}function fu(t,e,n){return t?.6*e*n:0}function pu(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}function du(t,e,n,r,i,o){for(var a=fu(n,i,o),s=pu(n,r)*o,u=0,c=hu(t)/2,l=0;l<t.length-1;l++){var h=t[l],f=t[l+1],p=h.dist(f);if(u+p>c){var d=(c-u)/p,A=we(h.x,f.x,d),g=we(h.y,f.y,d),m=new iu(A,g,f.angleTo(h),l);return m._round(),!a||lu(t,m,s,a,e)?m:void 0}u+=p}}function Au(t,e,n,r,i,o,a,s,u){var c=fu(r,o,a),l=pu(r,i),h=l*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,c){for(var l=a/2,h=hu(e),f=0,p=n-r,d=[],A=0;A<e.length-1;A++){for(var g=e[A],m=e[A+1],y=g.dist(m),v=m.angleTo(g);p+r<f+y;){var _=((p+=r)-f)/y,b=we(g.x,m.x,_),x=we(g.y,m.y,_);if(b>=0&&b<c&&x>=0&&x<c&&p-l>=0&&p+l<=h){var w=new iu(b,x,v,A);w._round(),i&&!lu(e,w,a,i,o)||d.push(w)}}f+=y}return u||d.length||s||(d=t(e,f/2,r,i,o,a,s,!0,c)),d}(t,f?e/2*s%e:(l/2+2*o)*a*s%e,e,c,n,h,f,!1,u)}function gu(t,e,n,r){var o=[],a=t.image,s=a.pixelRatio,u=a.paddedRect.w-2,c=a.paddedRect.h-2,l=t.right-t.left,h=t.bottom-t.top,f=a.stretchX||[[0,u]],p=a.stretchY||[[0,c]],d=function(t,e){return t+e[1]-e[0]},A=f.reduce(d,0),g=p.reduce(d,0),m=u-A,y=c-g,v=0,_=A,b=0,x=g,w=0,E=m,O=0,S=y;if(a.content&&r){var T=a.content;v=mu(f,0,T[0]),b=mu(p,0,T[1]),_=mu(f,T[0],T[2]),x=mu(p,T[1],T[3]),w=T[0]-v,O=T[1]-b,E=T[2]-T[0]-_,S=T[3]-T[1]-x}var C=function(r,o,u,c){var f=vu(r.stretch-v,_,l,t.left),p=_u(r.fixed-w,E,r.stretch,A),d=vu(o.stretch-b,x,h,t.top),m=_u(o.fixed-O,S,o.stretch,g),y=vu(u.stretch-v,_,l,t.left),T=_u(u.fixed-w,E,u.stretch,A),C=vu(c.stretch-b,x,h,t.top),P=_u(c.fixed-O,S,c.stretch,g),M=new i(f,d),I=new i(y,d),B=new i(y,C),R=new i(f,C),k=new i(p/s,m/s),L=new i(T/s,P/s),D=e*Math.PI/180;if(D){var j=Math.sin(D),F=Math.cos(D),z=[F,-j,j,F];M._matMult(z),I._matMult(z),R._matMult(z),B._matMult(z)}var U=r.stretch+r.fixed,N=u.stretch+u.fixed,G=o.stretch+o.fixed,V=c.stretch+c.fixed;return{tl:M,tr:I,bl:R,br:B,tex:{x:a.paddedRect.x+1+U,y:a.paddedRect.y+1+G,w:N-U,h:V-G},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:k,pixelOffsetBR:L,minFontScaleX:E/s/l,minFontScaleY:S/s/h,isSDF:n}};if(r&&(a.stretchX||a.stretchY))for(var P=yu(f,m,A),M=yu(p,y,g),I=0;I<P.length-1;I++)for(var B=P[I],R=P[I+1],k=0;k<M.length-1;k++){var L=M[k],D=M[k+1];o.push(C(B,L,R,D))}else o.push(C({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:u+1},{fixed:0,stretch:c+1}));return o}function mu(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 yu(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],c=r[r.length-1];r.push({fixed:s-c.stretch,stretch:c.stretch}),r.push({fixed:s-c.stretch,stretch:c.stretch+(u-s)})}return r.push({fixed:e+1,stretch:n}),r}function vu(t,e,n,r){return t/e*n+r}function _u(t,e,n,r){return t-e*n/r}var bu=function(t,e,n,r,o,a,s,u,c,l,h,f){var p=s.top*u-c,d=s.bottom*u+c,A=s.left*u-c,g=s.right*u+c,m=s.collisionPadding;if(m&&(A-=m[0]*u,p-=m[1]*u,g+=m[2]*u,d+=m[3]*u),this.boxStartIndex=t.length,l){var y=d-p,v=g-A;y>0&&(y=Math.max(10*u,y),this._addLineCollisionCircles(t,e,n,n.segment,v,y,r,o,a,h))}else{if(f){var _=new i(A,p),b=new i(g,p),x=new i(A,d),w=new i(g,d),E=f*Math.PI/180;_._rotate(E),b._rotate(E),x._rotate(E),w._rotate(E),A=Math.min(_.x,b.x,x.x,w.x),g=Math.max(_.x,b.x,x.x,w.x),p=Math.min(_.y,b.y,x.y,w.y),d=Math.max(_.y,b.y,x.y,w.y)}t.emplaceBack(n.x,n.y,A,p,g,d,r,o,a,0,0)}this.boxEndIndex=t.length};bu.prototype._addLineCollisionCircles=function(t,e,n,r,i,o,a,s,u,c){var l=o/2,h=Math.floor(i/l)||1,f=1+.4*Math.log(c)/Math.LN2,p=Math.floor(h*f/2),d=-o/2,A=n,g=r+1,m=d,y=-i/2,v=y-i/4;do{if(--g<0){if(m>y)return;g=0;break}m-=e[g].dist(A),A=e[g]}while(m>v);for(var _=e[g].dist(e[g+1]),b=-p;b<h+p;b++){var x=b*l,w=y+x;if(x<0&&(w+=x),x>i&&(w+=x-i),!(w<m)){for(;m+_<w;){if(m+=_,1+ ++g>=e.length)return;_=e[g].dist(e[g+1])}var E=w-m,O=e[g],S=e[g+1].sub(O)._unit()._mult(E)._add(O)._round(),T=Math.abs(w-d)<l?0:.8*(w-d);t.emplaceBack(S.x,S.y,-o/2,-o/2,o/2,o/2,a,s,u,o/2,T)}}};var xu=function(t,e){if(void 0===t&&(t=[]),void 0===e&&(e=wu),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 wu(t,e){return t<e?-1:t>e?1:0}function Eu(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],c=0;c<u.length;c++){var l=u[c];(!c||l.x<r)&&(r=l.x),(!c||l.y<o)&&(o=l.y),(!c||l.x>a)&&(a=l.x),(!c||l.y>s)&&(s=l.y)}var h=a-r,f=s-o,p=Math.min(h,f),d=p/2,A=new xu([],Ou);if(0===p)return new i(r,o);for(var g=r;g<a;g+=p)for(var m=o;m<s;m+=p)A.push(new Su(g+d,m+d,d,t));for(var y=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],c=i[s],l=u.x*c.y-c.x*u.y;n+=(u.x+c.x)*l,r+=(u.y+c.y)*l,e+=3*l}return new Su(n/e,r/e,0,t)}(t),v=A.length;A.length;){var _=A.pop();(_.d>y.d||!y.d)&&(y=_,n&&console.log("found best %d after %d probes",Math.round(1e4*_.d)/1e4,v)),_.max-y.d<=e||(d=_.h/2,A.push(new Su(_.p.x-d,_.p.y-d,d,t)),A.push(new Su(_.p.x+d,_.p.y-d,d,t)),A.push(new Su(_.p.x-d,_.p.y+d,d,t)),A.push(new Su(_.p.x+d,_.p.y+d,d,t)),v+=4)}return n&&(console.log("num probes: "+v),console.log("best distance: "+y.d)),y.p}function Ou(t,e){return e.max-t.max}function Su(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 c=o[a],l=o[u];c.y>t.y!=l.y>t.y&&t.x<(l.x-c.x)*(t.y-c.y)/(l.y-c.y)+c.x&&(n=!n),r=Math.min(r,wo(t,c,l))}return(n?1:-1)*Math.sqrt(r)}(this.p,r),this.max=this.d+this.h*Math.SQRT2}xu.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1)},xu.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}},xu.prototype.peek=function(){return this.data[0]},xu.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},xu.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 Tu=e((function(t){t.exports=function(t,e){var n,r,i,o,a,s,u,c;for(n=3&t.length,r=t.length-n,i=e,a=3432918353,s=461845907,c=0;c<r;)u=255&t.charCodeAt(c)|(255&t.charCodeAt(++c))<<8|(255&t.charCodeAt(++c))<<16|(255&t.charCodeAt(++c))<<24,++c,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(c+2))<<16;case 2:u^=(255&t.charCodeAt(c+1))<<8;case 1:i^=u=(65535&(u=(u=(65535&(u^=255&t.charCodeAt(c)))*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}})),Cu=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}})),Pu=Tu,Mu=Tu,Iu=Cu;Pu.murmur3=Mu,Pu.murmur2=Iu;var Bu=Number.POSITIVE_INFINITY;function Ru(t,e){return e[1]!==Bu?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 ku(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"}var Lu=32640;function Du(t,e,n,r,o,a,s,u,c,l,h,f,p,d){var A=function(t,e,n,r,o,a,s,u){for(var c=r.layout.get("text-rotate").evaluate(a,{})*Math.PI/180,l=[],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 g=A[d];if(g.rect){var m=g.rect||{},y=4,v=!0,_=1,b=0,x=(o||u)&&g.vertical,w=g.metrics.advance*g.scale/2;if(u&&e.verticalizable){var E=24*(g.scale-1),O=(24-g.metrics.width*g.scale)/2;b=p.lineOffset/2-(g.imageName?-O:E)}if(g.imageName){var S=s[g.imageName];v=S.sdf,y=1/(_=S.pixelRatio)}var T=o?[g.x+w,g.y]:[0,0],C=o?[0,0]:[g.x+w+n[0],g.y+n[1]-b],P=[0,0];x&&(P=C,C=[0,0]);var M=(g.metrics.left-y)*g.scale-w+C[0],I=(-g.metrics.top-y)*g.scale+C[1],B=M+m.w*g.scale/_,R=I+m.h*g.scale/_,k=new i(M,I),L=new i(B,I),D=new i(M,R),j=new i(B,R);if(x){var F=new i(-w,w- -17),z=-Math.PI/2,U=12-w,N=g.imageName?U:0,G=new i(22-U,-N),V=new(Function.prototype.bind.apply(i,[null].concat(P)));k._rotateAround(z,F)._add(G)._add(V),L._rotateAround(z,F)._add(G)._add(V),D._rotateAround(z,F)._add(G)._add(V),j._rotateAround(z,F)._add(G)._add(V)}if(c){var H=Math.sin(c),W=Math.cos(c),q=[W,-H,H,W];k._matMult(q),L._matMult(q),D._matMult(q),j._matMult(q)}var X=new i(0,0),J=new i(0,0);l.push({tl:k,tr:L,bl:D,br:j,tex:m,writingMode:e.writingMode,glyphOffset:T,sectionIndex:g.sectionIndex,isSDF:v,pixelOffsetTL:X,pixelOffsetBR:J,minFontScaleX:0,minFontScaleY:0})}}return l}(0,n,u,o,a,s,r,t.allowVerticalPlacement),g=t.textSizeData,m=null;"source"===g.kind?(m=[ou*o.layout.get("text-size").evaluate(s,{})])[0]>Lu&&x(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):"composite"===g.kind&&((m=[ou*d.compositeTextSizes[0].evaluate(s,{}),ou*d.compositeTextSizes[1].evaluate(s,{})])[0]>Lu||m[1]>Lu)&&x(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),t.addSymbols(t.text,A,m,u,a,s,l,e,c.lineStartIndex,c.lineLength,p);for(var y=0,v=h;y<v.length;y+=1)f[v[y]]=t.text.placedSymbolArray.length-1;return 4*A.length}function ju(t){for(var e in t)return t[e];return null}function Fu(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 zu=Va.VectorTileFeature.types,Uu=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Nu(t,e,n,r,i,o,a,s,u,c,l,h,f){var p=s?Math.min(Lu,Math.round(s[0])):0,d=s?Math.min(Lu,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*c,16*l,256*h,256*f)}function Gu(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 Vu(t){for(var e=0,n=t.sections;e<n.length;e+=1)if(Tr(n[e].text))return!0;return!1}var Hu=function(t){this.layoutVertexArray=new fi,this.indexArray=new wi,this.programConfigurations=t,this.segments=new Ni,this.dynamicLayoutVertexArray=new pi,this.opacityVertexArray=new di,this.placedSymbolArray=new Ii};Hu.prototype.upload=function(t,e,n,r){n&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,ls.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,e),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,hs.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,Uu,!0),this.opacityVertexBuffer.itemSize=1),(n||r)&&this.programConfigurations.upload(t)},Hu.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())},dr("SymbolBuffers",Hu);var Wu=function(t,e,n){this.layoutVertexArray=new t,this.layoutAttributes=e,this.indexArray=new n,this.segments=new Ni,this.collisionVertexArray=new mi};Wu.prototype.upload=function(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,fs.members,!0)},Wu.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},dr("CollisionBuffers",Wu);var qu=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.hasPaintOverrides=!1,this.hasRTLText=!1;var e=this.layers[0]._unevaluatedLayout._values;this.textSizeData=au(this.zoom,e["text-size"]),this.iconSizeData=au(this.zoom,e["icon-size"]);var n=this.layers[0].layout,r=n.get("symbol-sort-key"),i=n.get("symbol-z-order");this.sortFeaturesByKey="viewport-y"!==i&&void 0!==r.constantOr(1);var o="viewport-y"===i||"auto"===i&&!this.sortFeaturesByKey;this.sortFeaturesByY=o&&(n.get("text-allow-overlap")||n.get("icon-allow-overlap")||n.get("text-ignore-placement")||n.get("icon-ignore-placement")),"point"===n.get("symbol-placement")&&(this.writingModes=n.get("text-writing-mode").map((function(t){return Hs[t]}))),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id})),this.sourceID=t.sourceID};qu.prototype.createArrays=function(){var t=this.layers[0].layout;this.hasPaintOverrides=Qu.hasPaintOverrides(t),this.text=new Hu(new so(ls.members,this.layers,this.zoom,(function(t){return/^text/.test(t)}))),this.icon=new Hu(new so(ls.members,this.layers,this.zoom,(function(t){return/^icon/.test(t)}))),this.textCollisionBox=new Wu(gi,ps.members,Ei),this.iconCollisionBox=new Wu(gi,ps.members,Ei),this.textCollisionCircle=new Wu(gi,ds.members,wi),this.iconCollisionCircle=new Wu(gi,ds.members,wi),this.glyphOffsetArray=new Li,this.lineVertexArray=new ji,this.symbolInstances=new Ri},qu.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=gs[t.charAt(o)];a&&(e[a.charCodeAt(0)]=!0)}},qu.prototype.populate=function(t,e){var n=this.layers[0],r=n.layout,i=r.get("text-font"),o=r.get("text-field"),a=r.get("icon-image"),s=("constant"!==o.value.kind||o.value.value instanceof $t&&!o.value.value.isEmpty()||o.value.value.toString().length>0)&&("constant"!==i.value.kind||i.value.value.length>0),u=("constant"!==a.value.kind||!!a.value.value)&&Object.keys(a.parameters).length>0,c=r.get("symbol-sort-key");if(this.features=[],s||u){for(var l=e.iconDependencies,h=e.glyphDependencies,f=e.availableImages,p=new Ur(this.zoom),d=0,A=t;d<A.length;d+=1){var g=A[d],m=g.feature,y=g.index,v=g.sourceLayerIndex;if(n._featureFilter(p,m)){var _=void 0;if(s){var b=n.getValueAndResolveTokens("text-field",m,f),x=$t.factory(b);Vu(x)&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===jr()||this.hasRTLText&&zr.isParsed())&&(_=As(x,n,m))}var w=void 0;if(u){var E=n.getValueAndResolveTokens("icon-image",m,f);w=E instanceof te?E:te.fromString(E)}if(_||w){var O=this.sortFeaturesByKey?c.evaluate(m,{}):void 0,S={text:_,icon:w,index:y,sourceLayerIndex:v,geometry:fo(m),properties:m.properties,type:zu[m.type],sortKey:O};if(void 0!==m.id&&(S.id=m.id),this.features.push(S),w&&(l[w.name]=!0),_){var T=i.evaluate(m,{}).join(","),C="map"===r.get("text-rotation-alignment")&&"point"!==r.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(Hs.vertical)>=0;for(var P=0,M=_.sections;P<M.length;P+=1){var I=M[P];if(I.image)l[I.image.name]=!0;else{var B=br(_.toString()),R=I.fontStack||T,k=h[R]=h[R]||{};this.calculateGlyphDependencies(I.text,k,C,this.allowVerticalPlacement,B)}}}}}}"line"===r.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 c=0;c<t.length;c++){var l=t[c],h=l.geometry,f=l.text?l.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),g=a(p,d,r[A].geometry);delete e[p],delete n[d],n[u(f,r[g].geometry,!0)]=g,r[A].geometry=null}else p in n?a(p,d,h):d in e?s(p,d,h):(o(c),e[p]=i-1,n[d]=i-1)}else o(c)}return r.filter((function(t){return t.geometry}))}(this.features)),this.sortFeaturesByKey&&this.features.sort((function(t,e){return t.sortKey-e.sortKey}))}},qu.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))},qu.prototype.isEmpty=function(){return 0===this.symbolInstances.length&&!this.hasRTLText},qu.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},qu.prototype.upload=function(t){this.uploaded||(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t),this.textCollisionCircle.upload(t),this.iconCollisionCircle.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},qu.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.textCollisionBox.destroy(),this.iconCollisionBox.destroy(),this.textCollisionCircle.destroy(),this.iconCollisionCircle.destroy()},qu.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 c=o[u];this.lineVertexArray.emplaceBack(c.x,c.y,c.tileUnitDistanceFromAnchor)}}return{lineStartIndex:n,lineLength:this.lineVertexArray.length-n}},qu.prototype.addSymbols=function(t,e,n,r,i,o,a,s,u,c,l){var h=this,f=t.indexArray,p=t.layoutVertexArray,d=t.dynamicLayoutVertexArray,A=t.segments.prepareSegment(4*e.length,t.layoutVertexArray,t.indexArray,o.sortKey),g=this.glyphOffsetArray.length,m=A.vertexLength,y=this.allowVerticalPlacement&&a===Hs.vertical?Math.PI/2:0,v=function(t){var e=t.tl,r=t.tr,i=t.bl,o=t.br,a=t.tex,u=t.pixelOffsetTL,c=t.pixelOffsetBR,l=t.minFontScaleX,g=t.minFontScaleY,m=A.vertexLength,v=t.glyphOffset[1];Nu(p,s.x,s.y,e.x,v+e.y,a.x,a.y,n,t.isSDF,u.x,u.y,l,g),Nu(p,s.x,s.y,r.x,v+r.y,a.x+a.w,a.y,n,t.isSDF,c.x,u.y,l,g),Nu(p,s.x,s.y,i.x,v+i.y,a.x,a.y+a.h,n,t.isSDF,u.x,c.y,l,g),Nu(p,s.x,s.y,o.x,v+o.y,a.x+a.w,a.y+a.h,n,t.isSDF,c.x,c.y,l,g),Gu(d,s,y),f.emplaceBack(m,m+1,m+2),f.emplaceBack(m+1,m+2,m+3),A.vertexLength+=4,A.primitiveLength+=2,h.glyphOffsetArray.emplaceBack(t.glyphOffset[0])};if(o.text&&o.text.sections){var _=o.text.sections;if(this.hasPaintOverrides){for(var b,x=function(e,n){void 0===b||b===e&&!n||t.programConfigurations.populatePaintArrays(t.layoutVertexArray.length,o,o.index,{},_[b]),b=e},w=0,E=e;w<E.length;w+=1){var O=E[w];x(O.sectionIndex,!1),v(O)}x(b,!0)}else{for(var S=0,T=e;S<T.length;S+=1)v(T[S]);t.programConfigurations.populatePaintArrays(t.layoutVertexArray.length,o,o.index,{},_[0])}}else{for(var C=0,P=e;C<P.length;C+=1)v(P[C]);t.programConfigurations.populatePaintArrays(t.layoutVertexArray.length,o,o.index,{})}t.placedSymbolArray.emplaceBack(s.x,s.y,g,this.glyphOffsetArray.length-g,m,u,c,s.segment,n?n[0]:0,n?n[1]:0,r[0],r[1],a,0,!1,0,l)},qu.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))},qu.prototype.addCollisionDebugVertices=function(t,e,n,r,o,a,s,u){var c=o.segments.prepareSegment(4,o.layoutVertexArray,o.indexArray),l=c.vertexLength,h=o.layoutVertexArray,f=o.collisionVertexArray,p=s.anchorX,d=s.anchorY;if(this._addCollisionDebugVertex(h,f,a,p,d,new i(t,e)),this._addCollisionDebugVertex(h,f,a,p,d,new i(n,e)),this._addCollisionDebugVertex(h,f,a,p,d,new i(n,r)),this._addCollisionDebugVertex(h,f,a,p,d,new i(t,r)),c.vertexLength+=4,u){var A=o.indexArray;A.emplaceBack(l,l+1,l+2),A.emplaceBack(l,l+2,l+3),c.primitiveLength+=2}else{var g=o.indexArray;g.emplaceBack(l,l+1),g.emplaceBack(l+1,l+2),g.emplaceBack(l+2,l+3),g.emplaceBack(l+3,l),c.primitiveLength+=4}},qu.prototype.addDebugCollisionBoxes=function(t,e,n,r){for(var i=t;i<e;i++){var o=this.collisionBoxArray.get(i),a=o.x1,s=o.y1,u=o.x2,c=o.y2,l=o.radius>0;this.addCollisionDebugVertices(a,s,u,c,l?r?this.textCollisionCircle:this.iconCollisionCircle:r?this.textCollisionBox:this.iconCollisionBox,o.anchorPoint,n,l)}},qu.prototype.generateCollisionDebugBuffers=function(){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)}},qu.prototype._deserializeCollisionBoxesForSymbol=function(t,e,n,r,i,o,a,s,u){for(var c={},l=e;l<n;l++){var h=t.get(l);if(0===h.radius){c.textBox={x1:h.x1,y1:h.y1,x2:h.x2,y2:h.y2,anchorPointX:h.anchorPointX,anchorPointY:h.anchorPointY},c.textFeatureIndex=h.featureIndex;break}c.textCircles||(c.textCircles=[],c.textFeatureIndex=h.featureIndex),c.textCircles.push(h.anchorPointX,h.anchorPointY,h.radius,h.signedDistanceFromAnchor,1)}for(var f=r;f<i;f++){var p=t.get(f);if(0===p.radius){c.verticalTextBox={x1:p.x1,y1:p.y1,x2:p.x2,y2:p.y2,anchorPointX:p.anchorPointX,anchorPointY:p.anchorPointY},c.verticalTextFeatureIndex=p.featureIndex;break}}for(var d=o;d<a;d++){var A=t.get(d);if(0===A.radius){c.iconBox={x1:A.x1,y1:A.y1,x2:A.x2,y2:A.y2,anchorPointX:A.anchorPointX,anchorPointY:A.anchorPointY},c.iconFeatureIndex=A.featureIndex;break}}for(var g=s;g<u;g++){var m=t.get(g);if(0===m.radius){c.verticalIconBox={x1:m.x1,y1:m.y1,x2:m.x2,y2:m.y2,anchorPointX:m.anchorPointX,anchorPointY:m.anchorPointY},c.verticalIconFeatureIndex=m.featureIndex;break}}return c},qu.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))}},qu.prototype.hasTextData=function(){return this.text.segments.get().length>0},qu.prototype.hasIconData=function(){return this.icon.segments.get().length>0},qu.prototype.hasTextCollisionBoxData=function(){return this.textCollisionBox.segments.get().length>0},qu.prototype.hasIconCollisionBoxData=function(){return this.iconCollisionBox.segments.get().length>0},qu.prototype.hasTextCollisionCircleData=function(){return this.textCollisionCircle.segments.get().length>0},qu.prototype.hasIconCollisionCircleData=function(){return this.iconCollisionCircle.segments.get().length>0},qu.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)},qu.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},qu.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=r[n],o=this.symbolInstances.get(i);this.featureSortOrder.push(o.featureIndex),[o.rightJustifiedTextSymbolIndex,o.centerJustifiedTextSymbolIndex,o.leftJustifiedTextSymbolIndex].forEach((function(t,n,r){t>=0&&r.indexOf(t)===n&&e.addIndicesForPlacedSymbol(e.text,t)})),o.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,o.verticalPlacedTextSymbolIndex),o.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,o.placedIconSymbolIndex),o.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,o.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},dr("SymbolBucket",qu,{omit:["layers","collisionBoxArray","features","compareText"]}),qu.MAX_GLYPHS=65535,qu.addDynamicAttributes=Gu;var Xu=new ti({"symbol-placement":new Zr(Tt.layout_symbol["symbol-placement"]),"symbol-spacing":new Zr(Tt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Zr(Tt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Qr(Tt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Zr(Tt.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Zr(Tt.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new Zr(Tt.layout_symbol["icon-ignore-placement"]),"icon-optional":new Zr(Tt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Zr(Tt.layout_symbol["icon-rotation-alignment"]),"icon-size":new Qr(Tt.layout_symbol["icon-size"]),"icon-text-fit":new Zr(Tt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Zr(Tt.layout_symbol["icon-text-fit-padding"]),"icon-image":new Qr(Tt.layout_symbol["icon-image"]),"icon-rotate":new Qr(Tt.layout_symbol["icon-rotate"]),"icon-padding":new Zr(Tt.layout_symbol["icon-padding"]),"icon-keep-upright":new Zr(Tt.layout_symbol["icon-keep-upright"]),"icon-offset":new Qr(Tt.layout_symbol["icon-offset"]),"icon-anchor":new Qr(Tt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Zr(Tt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Zr(Tt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Zr(Tt.layout_symbol["text-rotation-alignment"]),"text-field":new Qr(Tt.layout_symbol["text-field"]),"text-font":new Qr(Tt.layout_symbol["text-font"]),"text-size":new Qr(Tt.layout_symbol["text-size"]),"text-max-width":new Qr(Tt.layout_symbol["text-max-width"]),"text-line-height":new Zr(Tt.layout_symbol["text-line-height"]),"text-letter-spacing":new Qr(Tt.layout_symbol["text-letter-spacing"]),"text-justify":new Qr(Tt.layout_symbol["text-justify"]),"text-radial-offset":new Qr(Tt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Zr(Tt.layout_symbol["text-variable-anchor"]),"text-anchor":new Qr(Tt.layout_symbol["text-anchor"]),"text-max-angle":new Zr(Tt.layout_symbol["text-max-angle"]),"text-writing-mode":new Zr(Tt.layout_symbol["text-writing-mode"]),"text-rotate":new Qr(Tt.layout_symbol["text-rotate"]),"text-padding":new Zr(Tt.layout_symbol["text-padding"]),"text-keep-upright":new Zr(Tt.layout_symbol["text-keep-upright"]),"text-transform":new Qr(Tt.layout_symbol["text-transform"]),"text-offset":new Qr(Tt.layout_symbol["text-offset"]),"text-allow-overlap":new Zr(Tt.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new Zr(Tt.layout_symbol["text-ignore-placement"]),"text-optional":new Zr(Tt.layout_symbol["text-optional"])}),Ju={paint:new ti({"icon-opacity":new Qr(Tt.paint_symbol["icon-opacity"]),"icon-color":new Qr(Tt.paint_symbol["icon-color"]),"icon-halo-color":new Qr(Tt.paint_symbol["icon-halo-color"]),"icon-halo-width":new Qr(Tt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Qr(Tt.paint_symbol["icon-halo-blur"]),"icon-translate":new Zr(Tt.paint_symbol["icon-translate"]),"icon-translate-anchor":new Zr(Tt.paint_symbol["icon-translate-anchor"]),"text-opacity":new Qr(Tt.paint_symbol["text-opacity"]),"text-color":new Qr(Tt.paint_symbol["text-color"],{runtimeType:zt,getOverride:function(t){return t.textColor},hasOverride:function(t){return!!t.textColor}}),"text-halo-color":new Qr(Tt.paint_symbol["text-halo-color"]),"text-halo-width":new Qr(Tt.paint_symbol["text-halo-width"]),"text-halo-blur":new Qr(Tt.paint_symbol["text-halo-blur"]),"text-translate":new Zr(Tt.paint_symbol["text-translate"]),"text-translate-anchor":new Zr(Tt.paint_symbol["text-translate-anchor"])}),layout:Xu},Zu=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:Lt,this.defaultValue=t};Zu.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},Zu.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)},Zu.prototype.possibleOutputs=function(){return[void 0]},Zu.prototype.serialize=function(){return null},dr("FormatSectionOverride",Zu,{omit:["defaultValue"]});var Qu=function(t){function e(e){t.call(this,e,Ju)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.recalculate=function(e,n){if(t.prototype.recalculate.call(this,e,n),"auto"===this.layout.get("icon-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="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){var r=this.layout.get(t).evaluate(e,{},n),i=this._unevaluatedLayout._values[t];return i.isDataDriven()||En(i.value)||!r?r:function(t,e){return e.replace(/{([^{}]+)}/g,(function(e,n){return n in t?String(t[n]):""}))}(e.properties,r)},e.prototype.createBucket=function(t){return new qu(t)},e.prototype.queryRadius=function(){return 0},e.prototype.queryIntersectsFeature=function(){return!1},e.prototype._setPaintOverrides=function(){for(var t=0,n=Ju.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 Zu(o),s=new wn(a,o.property.specification);i="constant"===o.value.kind||"source"===o.value.kind?new Sn("source",s):new Tn("composite",s,o.value.zoomStops,o.value._interpolationType),this.paint._values[r]=new Xr(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=Ju.paint.properties[e],i=!1,o=function(t){for(var e=0,n=t;e<n.length;e+=1){var o=n[e];if(r.overrides&&r.overrides.hasOverride(o))return void(i=!0)}};if("constant"===n.value.kind&&n.value.value instanceof $t)o(n.value.value.sections);else if("source"===n.value.kind){var a=function(t){if(!i)if(t instanceof ie&&ne(t.value)===Vt){var e=t.value;o(e.sections)}else t instanceof ue?o(t.sections):t.eachChild(a)},s=n.value;s._styleExpression&&a(s._styleExpression.expression)}return i},e.hasPaintOverrides=function(t){for(var n=0,r=Ju.paint.overridableProperties;n<r.length;n+=1){var i=r[n];if(e.hasPaintOverride(t,i))return!0}return!1},e}(ei),Ku={paint:new ti({"background-color":new Zr(Tt.paint_background["background-color"]),"background-pattern":new Yr(Tt.paint_background["background-pattern"]),"background-opacity":new Zr(Tt.paint_background["background-opacity"])})},Yu=function(t){function e(e){t.call(this,e,Ku)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(ei),$u={paint:new ti({"raster-opacity":new Zr(Tt.paint_raster["raster-opacity"]),"raster-hue-rotate":new Zr(Tt.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Zr(Tt.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Zr(Tt.paint_raster["raster-brightness-max"]),"raster-saturation":new Zr(Tt.paint_raster["raster-saturation"]),"raster-contrast":new Zr(Tt.paint_raster["raster-contrast"]),"raster-resampling":new Zr(Tt.paint_raster["raster-resampling"]),"raster-fade-duration":new Zr(Tt.paint_raster["raster-fade-duration"])})},tc=function(t){function e(e){t.call(this,e,$u)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(ei),ec=function(t){function e(e){t.call(this,e,{}),this.implementation=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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}(ei),nc={circle:Lo,heatmap:Wo,hillshade:Xo,fill:Ra,"fill-extrusion":Ka,line:us,symbol:Qu,background:Yu,raster:tc},rc=self.HTMLImageElement,ic=self.HTMLCanvasElement,oc=self.HTMLVideoElement,ac=self.ImageData,sc=function(t,e,n,r){this.context=t,this.format=n,this.texture=t.gl.createTexture(),this.update(e,r)};sc.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 rc||t instanceof ic||t instanceof oc||t instanceof ac?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},c=u.x,l=u.y;t instanceof rc||t instanceof ic||t instanceof oc||t instanceof ac?s.texSubImage2D(s.TEXTURE_2D,0,c,l,s.RGBA,s.UNSIGNED_BYTE,t):s.texSubImage2D(s.TEXTURE_2D,0,c,l,r,i,s.RGBA,s.UNSIGNED_BYTE,t.data)}this.useMipmap&&this.isSizePowerOfTwo()&&s.generateMipmap(s.TEXTURE_2D)},sc.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)},sc.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0},sc.prototype.destroy=function(){this.context.gl.deleteTexture(this.texture),this.texture=null};var uc=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()})};uc.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))},uc.prototype.remove=function(){delete this._channel,this._callback=function(){}};var cc=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 uc(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=O()?t:self};function lc(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]}cc.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=C(this.globalScope)?void 0:[];return this.target.postMessage({id:a,type:t,hasCallback:!!n,targetMapId:r,mustQueue:i,sourceMapId:this.mapId,data:mr(e,s)},s),{cancel:function(){n&&delete o.callbacks[a],o.target.postMessage({id:a,type:"<cancel>",targetMapId:r,sourceMapId:o.mapId})}}},cc.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 O()||e.mustQueue?(this.tasks[n]=e,this.taskQueue.push(n),this.invoker.trigger()):this.processTask(n,e)},cc.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)}},cc.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(yr(e.error)):r(null,yr(e.data)))}else{var i=!1,o=C(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?mr(e):null,data:mr(r,o)},o)}:function(t){i=!0},s=null,u=yr(e.data);if(this.parent[e.type])s=this.parent[e.type](e.sourceMapId,u,a);else if(this.parent.getWorkerSource){var c=e.type.split(".");s=this.parent.getWorkerSource(e.sourceMapId,c[0],u.source)[c[1]](u,a)}else a(new Error("Could not find function "+e.type));!i&&s&&s.cancel&&(this.cancelCallbacks[t]=s.cancel)}},cc.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var hc=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]))};hc.prototype.setNorthEast=function(t){return this._ne=t instanceof fc?new fc(t.lng,t.lat):fc.convert(t),this},hc.prototype.setSouthWest=function(t){return this._sw=t instanceof fc?new fc(t.lng,t.lat):fc.convert(t),this},hc.prototype.extend=function(t){var e,n,r=this._sw,i=this._ne;if(t instanceof fc)e=t,n=t;else{if(!(t instanceof hc))return Array.isArray(t)?t.every(Array.isArray)?this.extend(hc.convert(t)):this.extend(fc.convert(t)):this;if(e=t._sw,n=t._ne,!e||!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 fc(e.lng,e.lat),this._ne=new fc(n.lng,n.lat)),this},hc.prototype.getCenter=function(){return new fc((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},hc.prototype.getSouthWest=function(){return this._sw},hc.prototype.getNorthEast=function(){return this._ne},hc.prototype.getNorthWest=function(){return new fc(this.getWest(),this.getNorth())},hc.prototype.getSouthEast=function(){return new fc(this.getEast(),this.getSouth())},hc.prototype.getWest=function(){return this._sw.lng},hc.prototype.getSouth=function(){return this._sw.lat},hc.prototype.getEast=function(){return this._ne.lng},hc.prototype.getNorth=function(){return this._ne.lat},hc.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},hc.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},hc.prototype.isEmpty=function(){return!(this._sw&&this._ne)},hc.prototype.contains=function(t){var e=fc.convert(t),n=e.lng,r=e.lat,i=this._sw.lat<=r&&r<=this._ne.lat,o=this._sw.lng<=n&&n<=this._ne.lng;return this._sw.lng>this._ne.lng&&(o=this._sw.lng>=n&&n>=this._ne.lng),i&&o},hc.convert=function(t){return!t||t instanceof hc?t:new hc(t)};var fc=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")};fc.prototype.wrap=function(){return new fc(l(this.lng,-180,180),this.lat)},fc.prototype.toArray=function(){return[this.lng,this.lat]},fc.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},fc.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 hc(new fc(this.lng-n,this.lat-e),new fc(this.lng+n,this.lat+e))},fc.convert=function(t){if(t instanceof fc)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new fc(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new fc(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 pc=2*Math.PI*6378137;function dc(t){return pc*Math.cos(t*Math.PI/180)}function Ac(t){return(180+t)/360}function gc(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function mc(t,e){return t/dc(e)}function yc(t){var e=180-360*t;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}var vc=function(t,e,n){void 0===n&&(n=0),this.x=+t,this.y=+e,this.z=+n};vc.fromLngLat=function(t,e){void 0===e&&(e=0);var n=fc.convert(t);return new vc(Ac(n.lng),gc(n.lat),mc(e,n.lat))},vc.prototype.toLngLat=function(){return new fc(360*this.x-180,yc(this.y))},vc.prototype.toAltitude=function(){return this.z*dc(yc(this.y))},vc.prototype.meterInMercatorCoordinateUnits=function(){return 1/pc*(t=yc(this.y),1/Math.cos(t*Math.PI/180));var t};var _c=function(t,e,n){this.z=t,this.x=e,this.y=n,this.key=wc(0,t,e,n)};_c.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},_c.prototype.url=function(t,e){var n,r,i,o,a,s=(n=this.x,r=this.y,i=this.z,o=lc(256*n,256*(r=Math.pow(2,i)-r-1),i),a=lc(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)},_c.prototype.getTilePoint=function(t){var e=Math.pow(2,this.z);return new i((t.x*e-this.x)*lo,(t.y*e-this.y)*lo)},_c.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var bc=function(t,e){this.wrap=t,this.canonical=e,this.key=wc(t,e.z,e.x,e.y)},xc=function(t,e,n,r,i){this.overscaledZ=t,this.wrap=e,this.canonical=new _c(n,+r,+i),this.key=wc(e,t,r,i)};function wc(t,e,n,r){(t*=2)<0&&(t=-1*t-1);var i=1<<e;return 32*(i*i*t+i*r+n)+e}xc.prototype.equals=function(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)},xc.prototype.scaledTo=function(t){var e=this.canonical.z-t;return t>this.canonical.z?new xc(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new xc(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},xc.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},xc.prototype.children=function(t){if(this.overscaledZ>=t)return[new xc(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 xc(e,this.wrap,e,n,r),new xc(e,this.wrap,e,n+1,r),new xc(e,this.wrap,e,n,r+1),new xc(e,this.wrap,e,n+1,r+1)]},xc.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))},xc.prototype.wrapped=function(){return new xc(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},xc.prototype.unwrapTo=function(t){return new xc(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)},xc.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},xc.prototype.toUnwrapped=function(){return new bc(this.wrap,this.canonical)},xc.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},xc.prototype.getTilePoint=function(t){return this.canonical.getTilePoint(new vc(t.x-this.wrap,t.y))},dr("CanonicalTileID",_c),dr("OverscaledTileID",xc,{omit:["posMatrix"]});var Ec=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 x('"'+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)]};Ec.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])},Ec.prototype.getUnpackVector=function(){return"terrarium"===this.encoding?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]},Ec.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)},Ec.prototype._unpackMapbox=function(t,e,n){return(256*t*256+256*e+n)/10-1e4},Ec.prototype._unpackTerrarium=function(t,e,n){return 256*t+e+n/256-32768},Ec.prototype.getPixels=function(){return new Go({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Ec.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,c=o;c<a;c++)for(var l=r;l<i;l++)this.data[this._idx(l,c)]=t.data[this._idx(l+s,c+u)]},dr("DEMData",Ec);var Oc=oi([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),Sc=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}};Sc.prototype.encode=function(t){return this._stringToNumber[t]},Sc.prototype.decode=function(t){return this._numberToString[t]};var Tc=function(t,e,n,r){this.type="Feature",this._vectorTileFeature=t,t._z=e,t._x=n,t._y=r,this.properties=t.properties,null!=t.id&&(this.id=t.id)},Cc={geometry:{configurable:!0}};Cc.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},Cc.geometry.set=function(t){this._geometry=t},Tc.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(Tc.prototype,Cc);var Pc=function(){this.state={},this.stateChanges={},this.deletedStates={}};Pc.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]||{},h(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]},Pc.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&&e>=0)null!==this.deletedStates[t][r]&&(this.deletedStates[t][r]=this.deletedStates[t][r]||{},this.deletedStates[t][r][n]=null);else if(void 0!==e&&e>=0)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}},Pc.prototype.getState=function(t,e){var n=String(e),r=this.state[t]||{},i=this.stateChanges[t]||{},o=h({},r[n],i[n]);if(null===this.deletedStates[t])return{};if(this.deletedStates[t]){var a=this.deletedStates[t][e];if(null===a)return{};for(var s in a)delete o[s]}return o},Pc.prototype.initializeTileState=function(t,e){t.setFeatureState(this.state,e)},Pc.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]={}),h(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 c in this.deletedStates[a]){if(null===this.deletedStates[a][c])this.state[a][c]={};else for(var l=0,f=Object.keys(this.deletedStates[a][c]);l<f.length;l+=1){var p=f[l];delete this.state[a][c][p]}s[c]=this.state[a][c]}n[a]=n[a]||{},h(n[a],s)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(n).length)for(var d in t)t[d].setFeatureState(n,e)};var Mc=function(t,e,n){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=e||new lr(lo,16,0),this.grid3D=new lr(lo,16,0),this.featureIndexArray=n||new zi};function Ic(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 Bc(t,e){return e-t}Mc.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 c=e[u],l=[1/0,1/0,-1/0,-1/0],h=0;h<c.length;h++){var f=c[h];l[0]=Math.min(l[0],f.x),l[1]=Math.min(l[1],f.y),l[2]=Math.max(l[2],f.x),l[3]=Math.max(l[3],f.y)}l[0]<lo&&l[1]<lo&&l[2]>=0&&l[3]>=0&&s.insert(a,l[0],l[1],l[2],l[3])}},Mc.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new Va.VectorTile(new vs(this.rawTileData)).layers,this.sourceLayerCoder=new Sc(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Mc.prototype.query=function(t,e,n){var r=this;this.loadVTLayers();for(var o=t.params||{},a=lo/t.tileSize/t.scale,s=Fn(o.filter),u=t.queryGeometry,c=t.queryPadding*a,l=Ic(u),h=this.grid.query(l.minX-c,l.minY-c,l.maxX+c,l.maxY+c),f=Ic(t.cameraQueryGeometry),p=0,d=this.grid3D.query(f.minX-c,f.minY-c,f.maxX+c,f.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 c=[new i(e,n),new i(e,o),new i(r,o),new i(r,n)];if(t.length>2)for(var l=0,h=c;l<h.length;l+=1)if(Oo(t,h[l]))return!0;for(var f=0;f<t.length-1;f++)if(So(t[f],t[f+1],c))return!0;return!1}(t.cameraQueryGeometry,e-c,n-c,r+c,o+c)}));p<d.length;p+=1){var A=d[p];h.push(A)}h.sort(Bc);for(var g,m={},y=function(i){var c=h[i];if(c!==g){g=c;var l=r.featureIndexArray.get(c),f=null;r.loadMatchingFeature(m,l.bucketIndex,l.sourceLayerIndex,l.featureIndex,s,o.layers,e,(function(e,i){f||(f=fo(e));var o={};return e.id&&(o=n.getState(i.sourceLayer||"_geojsonTileLayer",e.id)),i.queryIntersectsFeature(u,e,o,f,r.z,t.transform,a,t.pixelPosMatrix)}))}},v=0;v<h.length;v++)y(v);return m},Mc.prototype.loadMatchingFeature=function(t,e,n,r,i,o,a,s){var u=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,u)){var c=this.sourceLayerCoder.decode(n),l=this.vtLayers[c].feature(r);if(i(new Ur(this.tileID.overscaledZ),l))for(var h=0;h<u.length;h++){var f=u[h];if(!(o&&o.indexOf(f)<0)){var p=a[f];if(p){var d=!s||s(l,p);if(d){var A=new Tc(l,this.z,this.x,this.y);A.layer=p.serialize();var g=t[f];void 0===g&&(g=t[f]=[]),g.push({featureIndex:r,feature:A,intersectionZ:d})}}}}}},Mc.prototype.lookupSymbolFeatures=function(t,e,n,r,i,o){var a={};this.loadVTLayers();for(var s=Fn(r),u=0,c=t;u<c.length;u+=1){var l=c[u];this.loadMatchingFeature(a,e,n,l,s,i,o)}return a},Mc.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},dr("FeatureIndex",Mc,{omit:["rawTileData","sourceLayerCoder"]});var Rc=function(t,e){this.tileID=t,this.uid=p(),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"};Rc.prototype.registerFadeDuration=function(t){var e=t+this.timeAdded;e<j.now()||this.fadeEndTime&&e<this.fadeEndTime||(this.fadeEndTime=e)},Rc.prototype.wasRequested=function(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state},Rc.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){var u=s[a];n[u.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 qu){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 qu&&a.hasRTLText){this.hasRTLText=!0,zr.isLoading()||zr.isLoaded()||"deferred"!==jr()||Fr();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 Pi},Rc.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"},Rc.prototype.getBucket=function(t){return this.buckets[t.id]},Rc.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 sc(t,this.imageAtlas.image,r.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new sc(t,this.glyphAtlasImage,r.ALPHA),this.glyphAtlasImage=null)},Rc.prototype.prepare=function(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)},Rc.prototype.queryRenderedFeatures=function(t,e,n,r,i,o,a,s,u){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:n,cameraQueryGeometry:r,scale:i,tileSize:this.tileSize,pixelPosMatrix:u,transform:a,params:o,queryPadding:this.queryPadding*s},t,e):{}},Rc.prototype.querySourceFeatures=function(t,e){if(this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData){var n=this.latestFeatureIndex.loadVTLayers(),r=e?e.sourceLayer:"",i=n._geojsonTileLayer||n[r];if(i)for(var o=Fn(e&&e.filter),a=this.tileID.canonical,s=a.z,u=a.x,c=a.y,l={z:s,x:u,y:c},h=0;h<i.length;h++){var f=i.feature(h);if(o(new Ur(this.tileID.overscaledZ),f)){var p=new Tc(f,s,u,c);p.tile=l,t.push(p)}}}},Rc.prototype.clearMask=function(){this.segments&&(this.segments.destroy(),delete this.segments),this.maskedBoundsBuffer&&(this.maskedBoundsBuffer.destroy(),delete this.maskedBoundsBuffer),this.maskedIndexBuffer&&(this.maskedIndexBuffer.destroy(),delete this.maskedIndexBuffer),delete this.mask},Rc.prototype.setMask=function(t,e){if(!a(this.mask,t)&&(this.clearMask(),this.mask=t,!a(t,{0:!0}))){var n=new ui,r=new wi;this.segments=new Ni,this.segments.prepareSegment(0,n,r);for(var o=Object.keys(t),s=0;s<o.length;s++){var u=t[+o[s]],c=lo>>u.z,l=new i(u.x*c,u.y*c),h=new i(l.x+c,l.y+c),f=this.segments.prepareSegment(4,n,r);n.emplaceBack(l.x,l.y,l.x,l.y),n.emplaceBack(h.x,l.y,h.x,l.y),n.emplaceBack(l.x,h.y,l.x,h.y),n.emplaceBack(h.x,h.y,h.x,h.y);var p=f.vertexLength;r.emplaceBack(p,p+1,p+2),r.emplaceBack(p+1,p+2,p+3),f.vertexLength+=4,f.primitiveLength+=2}this.maskedBoundsBuffer=e.createVertexBuffer(n,Oc.members),this.maskedIndexBuffer=e.createIndexBuffer(r)}},Rc.prototype.hasData=function(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state},Rc.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},Rc.prototype.setExpiryData=function(t){var e=this.expirationTime;if(t.cacheControl){var n=S(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}},Rc.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)},Rc.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){var i=this.buckets[r],o=i.layers[0].sourceLayer||"_geojsonTileLayer",a=n[o],s=t[o];a&&s&&0!==Object.keys(s).length&&(i.update(s,a,this.imageAtlas&&this.imageAtlas.patternPositions||{}),e&&e.style&&(this.queryPadding=Math.max(this.queryPadding,e.style.getLayer(r).queryRadius(i))))}}},Rc.prototype.holdingForFade=function(){return void 0!==this.symbolFadeHoldUntil},Rc.prototype.symbolFadeFinished=function(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<j.now()},Rc.prototype.clearFadeHold=function(){this.symbolFadeHoldUntil=void 0},Rc.prototype.setHoldDuration=function(t){this.symbolFadeHoldUntil=j.now()+t},Rc.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},Rc.prototype.hasDependency=function(t,e){for(var n=0,r=t;n<r.length;n+=1){var i=r[n],o=this.dependencies[i];if(o)for(var a=0,s=e;a<s.length;a+=1)if(o[s[a]])return!0}return!1},t.Actor=cc,t.AlphaImage=No,t.CanonicalTileID=_c,t.CollisionBoxArray=Pi,t.Color=Qt,t.DEMData=Ec,t.DataConstantProperty=Zr,t.DictionaryCoder=Sc,t.EXTENT=lo,t.ErrorEvent=Ot,t.EvaluationParameters=Ur,t.Event=Et,t.Evented=St,t.FeatureIndex=Mc,t.FillBucket=Ma,t.FillExtrusionBucket=Xa,t.ImageAtlas=Vs,t.ImagePosition=Ns,t.LineBucket=is,t.LngLat=fc,t.LngLatBounds=hc,t.MercatorCoordinate=vc,t.ONE_EM=24,t.OverscaledTileID=xc,t.Point=i,t.Point$1=i,t.ProgramConfiguration=ao,t.Properties=ti,t.Protobuf=vs,t.RGBAImage=Go,t.RequestManager=H,t.ResourceType=ft,t.SegmentVector=Ni,t.SourceFeatureState=Pc,t.StructArrayLayout1ui2=Oi,t.StructArrayLayout2i4=si,t.StructArrayLayout2ui4=Ei,t.StructArrayLayout3ui6=wi,t.StructArrayLayout4i8=ui,t.SymbolBucket=qu,t.Texture=sc,t.Tile=Rc,t.Transitionable=Vr,t.Uniform1f=Xi,t.Uniform1i=qi,t.Uniform2f=Ji,t.Uniform3f=Zi,t.Uniform4f=Qi,t.UniformColor=Ki,t.UniformMatrix4f=$i,t.UnwrappedTileID=bc,t.ValidationError=Ct,t.WritingMode=Hs,t.ZoomHistory=vr,t.addDynamicAttributes=Gu,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=s,t.bindAll=g,t.browser=j,t.cacheEntryPossiblyAdded=function(t){++ht>ut&&(t.getActor().send("enforceCacheSizeLimit",st),ht=0)},t.clamp=c,t.clearTileCache=function(t){var e=self.caches.delete(at);t&&e.catch(t).then((function(){return t()}))},t.clone=function(t){var e=new Ro(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},t.clone$1=_,t.config=F,t.create=function(){var t=new Ro(16);return Ro!=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 Ro(9);return Ro!=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 Ro(4);return Ro!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},t.createCommonjsModule=e,t.createExpression=On,t.createLayout=oi,t.createStyleLayer=function(t){return"custom"===t.type?new ec(t):new nc[t.type](t)},t.deepEqual=a,t.ease=u,t.emitValidationErrors=cr,t.endsWith=m,t.enforceCacheSizeLimit=function(t){ct(),$&&$.then((function(e){e.keys().then((function(n){for(var r=0;r<n.length-t;r++)e.delete(n[r])}))}))},t.evaluateSizeForFeature=su,t.evaluateSizeForZoom=uu,t.evaluateVariableOffset=Ru,t.evented=Dr,t.extend=h,t.featureFilter=Fn,t.filterObject=v,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=eu,t.getAnchorJustification=ku,t.getArrayBuffer=vt,t.getImage=bt,t.getJSON=function(t,e){return yt(h(t,{type:"json"}),e)},t.getRTLTextPluginStatus=jr,t.getReferrer=dt,t.getVideo=function(t,e){var n,r,i=self.document.createElement("video");i.muted=!0,i.onloadstart=function(){e(null,i)};for(var o=0;o<t.length;o++){var a=self.document.createElement("source");n=t[o],r=void 0,(r=self.document.createElement("a")).href=n,(r.protocol!==self.document.location.protocol||r.host!==self.document.location.host)&&(i.crossOrigin="Anonymous"),a.src=t[o],i.appendChild(a)}return{cancel:function(){}}},t.identity=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.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],c=e[7],l=e[8],h=e[9],f=e[10],p=e[11],d=e[12],A=e[13],g=e[14],m=e[15],y=n*s-r*a,v=n*u-i*a,_=n*c-o*a,b=r*u-i*s,x=r*c-o*s,w=i*c-o*u,E=l*A-h*d,O=l*g-f*d,S=l*m-p*d,T=h*g-f*A,C=h*m-p*A,P=f*m-p*g,M=y*P-v*C+_*T+b*S-x*O+w*E;return M?(M=1/M,t[0]=(s*P-u*C+c*T)*M,t[1]=(i*C-r*P-o*T)*M,t[2]=(A*w-g*x+m*b)*M,t[3]=(f*x-h*w-p*b)*M,t[4]=(u*S-a*P-c*O)*M,t[5]=(n*P-i*S+o*O)*M,t[6]=(g*_-d*w-m*v)*M,t[7]=(l*w-f*_+p*v)*M,t[8]=(a*C-s*S+c*E)*M,t[9]=(r*S-n*C-o*E)*M,t[10]=(d*x-A*_+m*y)*M,t[11]=(h*_-l*x-p*y)*M,t[12]=(s*O-a*T-u*E)*M,t[13]=(n*T-r*O+i*E)*M,t[14]=(A*v-d*b-g*y)*M,t[15]=(l*b-h*v+f*y)*M,t):null},t.isChar=_r,t.isMapboxURL=W,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=Ac,t.mercatorYfromLat=gc,t.mercatorZfromAltitude=mc,t.multiply=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=e[8],f=e[9],p=e[10],d=e[11],A=e[12],g=e[13],m=e[14],y=e[15],v=n[0],_=n[1],b=n[2],x=n[3];return t[0]=v*r+_*s+b*h+x*A,t[1]=v*i+_*u+b*f+x*g,t[2]=v*o+_*c+b*p+x*m,t[3]=v*a+_*l+b*d+x*y,v=n[4],_=n[5],b=n[6],x=n[7],t[4]=v*r+_*s+b*h+x*A,t[5]=v*i+_*u+b*f+x*g,t[6]=v*o+_*c+b*p+x*m,t[7]=v*a+_*l+b*d+x*y,v=n[8],_=n[9],b=n[10],x=n[11],t[8]=v*r+_*s+b*h+x*A,t[9]=v*i+_*u+b*f+x*g,t[10]=v*o+_*c+b*p+x*m,t[11]=v*a+_*l+b*d+x*y,v=n[12],_=n[13],b=n[14],x=n[15],t[12]=v*r+_*s+b*h+x*A,t[13]=v*i+_*u+b*f+x*g,t[14]=v*o+_*c+b*p+x*m,t[15]=v*a+_*l+b*d+x*y,t},t.mvt=Va,t.number=we,t.ortho=function(t,e,n,r,i,o,a){var s=1/(e-n),u=1/(r-i),c=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*c,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*u,t[14]=(a+o)*c,t[15]=1,t},t.parseGlyphPBF=function(t){return new vs(t).readFields(js,[])},t.pbf=vs,t.performSymbolLayout=function(t,e,n,r,o,a){t.createArrays();var s=512*t.overscaling;t.tilePixelRatio=lo/s,t.compareText={},t.iconsNeedLinear=!1;var u=t.layers[0].layout,c=t.layers[0]._unevaluatedLayout._values,l={};if("composite"===t.textSizeData.kind){var h=t.textSizeData,f=h.minZoom,p=h.maxZoom;l.compositeTextSizes=[c["text-size"].possiblyEvaluate(new Ur(f)),c["text-size"].possiblyEvaluate(new Ur(p))]}if("composite"===t.iconSizeData.kind){var d=t.iconSizeData,A=d.minZoom,g=d.maxZoom;l.compositeIconSizes=[c["icon-size"].possiblyEvaluate(new Ur(A)),c["icon-size"].possiblyEvaluate(new Ur(g))]}l.layoutTextSize=c["text-size"].possiblyEvaluate(new Ur(t.zoom+1)),l.layoutIconSize=c["icon-size"].possiblyEvaluate(new Ur(t.zoom+1)),l.textMaxSize=c["text-size"].possiblyEvaluate(new Ur(18));for(var m=24*u.get("text-line-height"),y="map"===u.get("text-rotation-alignment")&&"point"!==u.get("symbol-placement"),v=u.get("text-keep-upright"),_=u.get("text-size"),b=function(){var a=E[w],s=u.get("text-font").evaluate(a,{}).join(","),c=_.evaluate(a,{}),h=l.layoutTextSize.evaluate(a,{}),f=l.layoutIconSize.evaluate(a,{}),p={horizontal:{},vertical:void 0},d=a.text,A=[0,0];if(d){var g=d.toString(),b=24*u.get("text-letter-spacing").evaluate(a,{}),O=function(t){for(var e=0,n=t;e<n.length;e+=1)if(!xr(n[e].charCodeAt(0)))return!1;return!0}(g)?b:0,S=u.get("text-anchor").evaluate(a,{}),T=u.get("text-variable-anchor");if(!T){var C=u.get("text-radial-offset").evaluate(a,{});A=C?Ru(S,[24*C,Bu]):u.get("text-offset").evaluate(a,{}).map((function(t){return 24*t}))}var P=y?"center":u.get("text-justify").evaluate(a,{}),M=u.get("symbol-placement"),I="point"===M?24*u.get("text-max-width").evaluate(a,{}):0,B=function(){t.allowVerticalPlacement&&br(g)&&(p.vertical=Xs(d,e,n,o,s,I,m,S,"left",O,A,Hs.vertical,!0,M,h,c))};if(!y&&T){for(var R="auto"===P?T.map((function(t){return ku(t)})):[P],k=!1,L=0;L<R.length;L++){var D=R[L];if(!p.horizontal[D])if(k)p.horizontal[D]=p.horizontal[0];else{var j=Xs(d,e,n,o,s,I,m,"center",D,O,A,Hs.horizontal,!1,M,h,c);j&&(p.horizontal[D]=j,k=1===j.positionedLines.length)}}B()}else{"auto"===P&&(P=ku(S));var F=Xs(d,e,n,o,s,I,m,S,P,O,A,Hs.horizontal,!1,M,h,c);F&&(p.horizontal[P]=F),B(),br(g)&&y&&v&&(p.vertical=Xs(d,e,n,o,s,I,m,S,P,O,A,Hs.vertical,!1,M,h,c))}}var z=void 0,U=!1;if(a.icon&&a.icon.name){var N=r[a.icon.name];N&&(z=function(t,e,n){var r=eu(n),i=r.horizontalAlign,o=r.verticalAlign,a=e[0],s=e[1],u=a-t.displaySize[0]*i,c=u+t.displaySize[0],l=s-t.displaySize[1]*o;return{image:t,top:l,bottom:l+t.displaySize[1],left:u,right:c}}(o[a.icon.name],u.get("icon-offset").evaluate(a,{}),u.get("icon-anchor").evaluate(a,{})),U=N.sdf,void 0===t.sdfIcons?t.sdfIcons=N.sdf:t.sdfIcons!==N.sdf&&x("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(N.pixelRatio!==t.pixelRatio||0!==u.get("icon-rotate").constantOr(1))&&(t.iconsNeedLinear=!0))}var G=ju(p.horizontal)||p.vertical;t.iconsInText=!!G&&G.iconsInText,(G||z)&&function(t,e,n,r,o,a,s,u,c,l){var h=a.textMaxSize.evaluate(e,{});void 0===h&&(h=s);var f,p=t.layers[0].layout,d=p.get("icon-offset").evaluate(e,{}),A=ju(n.horizontal),g=s/24,m=t.tilePixelRatio*g,y=t.tilePixelRatio*h/24,v=t.tilePixelRatio*u,_=t.tilePixelRatio*p.get("symbol-spacing"),b=p.get("text-padding")*t.tilePixelRatio,w=p.get("icon-padding")*t.tilePixelRatio,E=p.get("text-max-angle")/180*Math.PI,O="map"===p.get("text-rotation-alignment")&&"point"!==p.get("symbol-placement"),S="map"===p.get("icon-rotation-alignment")&&"point"!==p.get("symbol-placement"),T=p.get("symbol-placement"),C=_/2,P=p.get("icon-text-fit");r&&"none"!==P&&(t.allowVerticalPlacement&&n.vertical&&(f=ru(r,n.vertical,P,p.get("icon-text-fit-padding"),d,g)),A&&(r=ru(r,A,P,p.get("icon-text-fit-padding"),d,g)));var M=function(i,s){s.x<0||s.x>=lo||s.y<0||s.y>=lo||function(t,e,n,r,i,o,a,s,u,c,l,h,f,p,d,A,g,m,y,v,_,b,w){var E,O,S,T,C,P=t.addToLineVertexArray(e,n),M=0,I=0,B=0,R=0,k=-1,L=-1,D={},j=Pu(""),F=0,z=0;if(void 0===s._unevaluatedLayout.getValue("text-radial-offset")?(F=(E=s.layout.get("text-offset").evaluate(_,{}).map((function(t){return 24*t})))[0],z=E[1]):(F=24*s.layout.get("text-radial-offset").evaluate(_,{}),z=Bu),t.allowVerticalPlacement&&r.vertical){var U=s.layout.get("text-rotate").evaluate(_,{})+90,N=r.vertical;T=new bu(u,n,e,c,l,h,N,f,p,d,t.overscaling,U),a&&(C=new bu(u,n,e,c,l,h,a,g,m,d,t.overscaling,U))}if(i){var G=s.layout.get("icon-rotate").evaluate(_,{}),V="none"!==s.layout.get("icon-text-fit"),H=gu(i,G,w,V),W=a?gu(a,G,w,V):void 0;S=new bu(u,n,e,c,l,h,i,g,m,!1,t.overscaling,G),M=4*H.length;var q=t.iconSizeData,X=null;"source"===q.kind?(X=[ou*s.layout.get("icon-size").evaluate(_,{})])[0]>Lu&&x(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):"composite"===q.kind&&((X=[ou*b.compositeIconSizes[0].evaluate(_,{}),ou*b.compositeIconSizes[1].evaluate(_,{})])[0]>Lu||X[1]>Lu)&&x(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),t.addSymbols(t.icon,H,X,v,y,_,!1,e,P.lineStartIndex,P.lineLength,-1),k=t.icon.placedSymbolArray.length-1,W&&(I=4*W.length,t.addSymbols(t.icon,W,X,v,y,_,Hs.vertical,e,P.lineStartIndex,P.lineLength,-1),L=t.icon.placedSymbolArray.length-1)}for(var J in r.horizontal){var Z=r.horizontal[J];if(!O){j=Pu(Z.text);var Q=s.layout.get("text-rotate").evaluate(_,{});O=new bu(u,n,e,c,l,h,Z,f,p,d,t.overscaling,Q)}var K=1===Z.positionedLines.length;if(B+=Du(t,e,Z,o,s,d,_,A,P,r.vertical?Hs.horizontal:Hs.horizontalOnly,K?Object.keys(r.horizontal):[J],D,k,b),K)break}r.vertical&&(R+=Du(t,e,r.vertical,o,s,d,_,A,P,Hs.vertical,["vertical"],D,L,b));var Y=O?O.boxStartIndex:t.collisionBoxArray.length,$=O?O.boxEndIndex:t.collisionBoxArray.length,tt=T?T.boxStartIndex:t.collisionBoxArray.length,et=T?T.boxEndIndex:t.collisionBoxArray.length,nt=S?S.boxStartIndex:t.collisionBoxArray.length,rt=S?S.boxEndIndex:t.collisionBoxArray.length,it=C?C.boxStartIndex:t.collisionBoxArray.length,ot=C?C.boxEndIndex:t.collisionBoxArray.length;t.glyphOffsetArray.length>=qu.MAX_GLYPHS&&x("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),t.symbolInstances.emplaceBack(e.x,e.y,D.right>=0?D.right:-1,D.center>=0?D.center:-1,D.left>=0?D.left:-1,D.vertical||-1,k,L,j,Y,$,tt,et,nt,rt,it,ot,c,B,R,M,I,0,f,F,z)}(t,s,i,n,r,o,f,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,m,b,O,c,v,w,S,d,e,a,l)};if("line"===T)for(var I=0,B=function(t,e,n,r,o){for(var a=[],s=0;s<t.length;s++)for(var u=t[s],c=void 0,l=0;l<u.length-1;l++){var h=u[l],f=u[l+1];h.x<0&&f.x<0||(h.x<0?h=new i(0,h.y+(f.y-h.y)*((0-h.x)/(f.x-h.x)))._round():f.x<0&&(f=new i(0,h.y+(f.y-h.y)*((0-h.x)/(f.x-h.x)))._round()),h.y<0&&f.y<0||(h.y<0?h=new i(h.x+(f.x-h.x)*((0-h.y)/(f.y-h.y)),0)._round():f.y<0&&(f=new i(h.x+(f.x-h.x)*((0-h.y)/(f.y-h.y)),0)._round()),h.x>=r&&f.x>=r||(h.x>=r?h=new i(r,h.y+(f.y-h.y)*((r-h.x)/(f.x-h.x)))._round():f.x>=r&&(f=new i(r,h.y+(f.y-h.y)*((r-h.x)/(f.x-h.x)))._round()),h.y>=o&&f.y>=o||(h.y>=o?h=new i(h.x+(f.x-h.x)*((o-h.y)/(f.y-h.y)),o)._round():f.y>=o&&(f=new i(h.x+(f.x-h.x)*((o-h.y)/(f.y-h.y)),o)._round()),c&&h.equals(c[c.length-1])||(c=[h],a.push(c)),c.push(f)))))}return a}(e.geometry,0,0,lo,lo);I<B.length;I+=1)for(var R=B[I],k=0,L=Au(R,_,E,n.vertical||A,r,24,y,t.overscaling,lo);k<L.length;k+=1){var D=L[k];A&&Fu(t,A.text,C,D)||M(R,D)}else if("line-center"===T)for(var j=0,F=e.geometry;j<F.length;j+=1){var z=F[j];if(z.length>1){var U=du(z,E,n.vertical||A,r,24,y);U&&M(z,U)}}else if("Polygon"===e.type)for(var N=0,G=Sa(e.geometry,0);N<G.length;N+=1){var V=G[N],H=Eu(V,16);M(V[0],new iu(H.x,H.y,0))}else if("LineString"===e.type)for(var W=0,q=e.geometry;W<q.length;W+=1){var X=q[W];M(X,new iu(X[0].x,X[0].y,0))}else if("Point"===e.type)for(var J=0,Z=e.geometry;J<Z.length;J+=1)for(var Q=0,K=Z[J];Q<K.length;Q+=1){var Y=K[Q];M([Y],new iu(Y.x,Y.y,0))}}(t,a,p,z,r,l,h,f,A,U)},w=0,E=t.features;w<E.length;w+=1)b();a&&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?(o=1/(r-i),t[10]=(i+r)*o,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=zr,t.polygonIntersectsPolygon=go,t.postMapLoadEvent=ot,t.postTurnstileEvent=rt,t.potpack=Us,t.rasterBoundsAttributes=Oc,t.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],t.register=dr,t.registerForPluginStateChange=function(t){return t({pluginStatus:Br,pluginURL:Rr}),Dr.on("pluginStateChange",t),t},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],c=e[8],l=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+c*r,t[5]=a*i+l*r,t[6]=s*i+h*r,t[7]=u*i+f*r,t[8]=c*i-o*r,t[9]=l*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],c=e[4],l=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+c*r,t[1]=a*i+l*r,t[2]=s*i+h*r,t[3]=u*i+f*r,t[4]=c*i-o*r,t[5]=l*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.setCacheLimits=function(t,e){st=t,ut=e},t.setRTLTextPlugin=function(t,e,n){if(void 0===n&&(n=!1),Br===Cr||Br===Pr||Br===Mr)throw new Error("setRTLTextPlugin cannot be called multiple times.");Rr=j.resolveURL(t),Br=Cr,Ir=e,Lr(),n||Fr()},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.styleSpec=Tt,t.symbolSize=cu,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=ko,t.translate=function(t,e,n){var r,i,o,a,s,u,c,l,h,f,p,d,A=n[0],g=n[1],m=n[2];return e===t?(t[12]=e[0]*A+e[4]*g+e[8]*m+e[12],t[13]=e[1]*A+e[5]*g+e[9]*m+e[13],t[14]=e[2]*A+e[6]*g+e[10]*m+e[14],t[15]=e[3]*A+e[7]*g+e[11]*m+e[15]):(r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=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]=c,t[7]=l,t[8]=h,t[9]=f,t[10]=p,t[11]=d,t[12]=r*A+s*g+h*m+e[12],t[13]=i*A+u*g+f*m+e[13],t[14]=o*A+c*g+p*m+e[14],t[15]=a*A+l*g+d*m+e[15]),t},t.triggerPluginCompletionEvent=kr,t.uniqueId=p,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=ar,t.validateStyle=or,t.values=function(t){var e=[];for(var n in t)e.push(t[n]);return e},t.vectorTile=Va,t.version="1.6.1",t.warnOnce=x,t.webpSupported=z,t.window=self,t.wrap=l})),r(0,(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 c=0,l=r;c<l.length;c+=1){var h=l[c];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 g=A.source||"",m=this.familiesBySource[g];m||(m=this.familiesBySource[g]={});var y=A.sourceLayer||"_geojsonTileLayer",v=m[y];v||(v=m[y]=[]),v.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 c={x:0,y:0,w:u.bitmap.width+2,h:u.bitmap.height+2};r.push(c),a[s]={rect:c,metrics:u.metrics}}}}var l=t.potpack(r),h=l.w,f=l.h,p=new t.AlphaImage({width:h||1,height:f||1});for(var d in e){var A=e[d];for(var g in A){var m=A[+g];if(m&&0!==m.bitmap.width&&0!==m.bitmap.height){var y=n[d][g].rect;t.AlphaImage.copy(m.bitmap,p,{x:0,y:0},{x:y.x+1,y:y.y+1},m.bitmap)}}}this.image=p,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};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)}o.prototype.parse=function(e,n,r,o,s){var u=this;this.status="parsing",this.data=e,this.collisionBoxArray=new t.CollisionBoxArray;var c=new t.DictionaryCoder(Object.keys(e.layers).sort()),l=new t.FeatureIndex(this.tileID);l.bucketLayerIDs=[];var h,f,p,d,A={},g={featureIndex:l,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:r},m=n.familiesBySource[this.source];for(var y in m){var v=e.layers[y];if(v){1===v.version&&t.warnOnce('Vector tile source "'+this.source+'" layer "'+y+'" does not use vector tile spec v2 and therefore may have some rendering errors.');for(var _=c.encode(y),b=[],x=0;x<v.length;x++){var w=v.feature(x);b.push({feature:w,index:x,sourceLayerIndex:_})}for(var E=0,O=m[y];E<O.length;E+=1){var S=O[E],T=S[0];T.minzoom&&this.zoom<Math.floor(T.minzoom)||T.maxzoom&&this.zoom>=T.maxzoom||"none"!==T.visibility&&(a(S,this.zoom,r),(A[T.id]=T.createBucket({index:l.bucketLayerIDs.length,layers:S,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:_,sourceID:this.source})).populate(b,g),l.bucketLayerIDs.push(S.map((function(t){return t.id}))))}}}var C=t.mapObject(g.glyphDependencies,(function(t){return Object.keys(t).map(Number)}));Object.keys(C).length?o.send("getGlyphs",{uid:this.uid,stacks:C},(function(t,e){h||(h=t,f=e,I.call(u))})):f={};var P=Object.keys(g.iconDependencies);P.length?o.send("getImages",{icons:P,source:this.source,tileID:this.tileID,type:"icons"},(function(t,e){h||(h=t,p=e,I.call(u))})):p={};var M=Object.keys(g.patternDependencies);function I(){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)):u.hasPattern&&(u instanceof t.LineBucket||u instanceof t.FillBucket||u instanceof t.FillExtrusionBucket)&&(a(u.layers,this.zoom,r),u.addFeatures(g,n.patternPositions))}this.status="done",s(null,{buckets:t.values(A).filter((function(t){return!t.isEmpty()})),featureIndex:l,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:e.image,imageAtlas:n,glyphMap:this.returnDependencies?f:null,iconMap:this.returnDependencies?p:null,glyphPositions:this.returnDependencies?e.positions:null})}}M.length?o.send("getImages",{icons:M,source:this.source,tileID:this.tileID,type:"patterns"},(function(t,e){h||(h=t,d=e,I.call(u))})):d={},I.call(this)};var s="undefined"!=typeof performance,u={getEntriesByName:function(t){return!!(s&&performance&&performance.getEntriesByName)&&performance.getEntriesByName(t)},mark:function(t){return!!(s&&performance&&performance.mark)&&performance.mark(t)},measure:function(t,e,n){return!!(s&&performance&&performance.measure)&&performance.measure(t,e,n)},clearMarks:function(t){return!!(s&&performance&&performance.clearMarks)&&performance.clearMarks(t)},clearMeasures:function(t){return!!(s&&performance&&performance.clearMeasures)&&performance.clearMeasures(t)}},c=function(t){this._marks={start:[t.url,"start"].join("#"),end:[t.url,"end"].join("#"),measure:t.url.toString()},u.mark(this._marks.start)};function l(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()}}c.prototype.finish=function(){u.mark(this._marks.end);var t=u.getEntriesByName(this._marks.measure);return 0===t.length&&(u.measure(this._marks.measure,this._marks.start,this._marks.end),t=u.getEntriesByName(this._marks.measure),u.clearMarks(this._marks.start),u.clearMarks(this._marks.end),u.clearMeasures(this._marks.measure)),t},u.Performance=c;var h=function(t,e,n,r){this.actor=t,this.layerIndex=e,this.availableImages=n,this.loadVectorData=r||l,this.loading={},this.loaded={}};h.prototype.loadTile=function(e,n){var r=this,i=e.uid;this.loading||(this.loading={});var a=!!(e&&e.request&&e.request.collectResourceTiming)&&new u.Performance(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,c={};o.expires&&(c.expires=o.expires),o.cacheControl&&(c.cacheControl=o.cacheControl);var l={};if(a){var h=a.finish();h&&(l.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,c,l))})),r.loaded=r.loaded||{},r.loaded[i]=s}))},h.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())}},h.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()},h.prototype.removeTile=function(t,e){var n=this.loaded,r=t.uid;n&&n[r]&&delete n[r],e()};var f=function(){this.loaded={}};f.prototype.loadTile=function(e,n){var r=e.uid,i=e.encoding,o=e.rawImageData,a=new t.DEMData(r,o,i);this.loaded=this.loaded||{},this.loaded[r]=a,n(null,a)},f.prototype.removeTile=function(t){var e=this.loaded,n=t.uid;e&&e[n]&&delete e[n]};var p=6378137;function d(t){var e=0;if(t&&t.length>0){e+=Math.abs(A(t[0]));for(var n=1;n<t.length;n++)e-=Math.abs(A(t[n]))}return e}function A(t){var e,n,r,i,o,a,s=0,u=t.length;if(u>2){for(a=0;a<u;a++)a===u-2?(r=u-2,i=u-1,o=0):a===u-1?(r=u-1,i=0,o=1):(r=a,i=a+1,o=a+2),e=t[r],n=t[i],s+=(g(t[o][0])-g(e[0]))*Math.sin(g(n[1]));s=s*p*p/2}return s}function g(t){return t*Math.PI/180}var m={geometry:function t(e){var n,r=0;switch(e.type){case"Polygon":return d(e.coordinates);case"MultiPolygon":for(n=0;n<e.coordinates.length;n++)r+=d(e.coordinates[n]);return r;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0;case"GeometryCollection":for(n=0;n<e.geometries.length;n++)r+=t(e.geometries[n]);return r}},ring:A};function y(t,e){return function(n){return t(n,e)}}function v(t,e){e=!!e,t[0]=_(t[0],e);for(var n=1;n<t.length;n++)t[n]=_(t[n],!e);return t}function _(t,e){return function(t){return m.ring(t)>=0}(t)===e?t:t.reverse()}var b=t.vectorTile.VectorTileFeature.prototype.toGeoJSON,x=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))};x.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=[],c=0,l=s[a];c<l.length;c+=1){var h=l[c];u.push(new t.Point$1(h[0],h[1]))}o.push(u)}return o},x.prototype.toGeoJSON=function(t,e,n){return b.call(this,t,e,n)};var w=function(e){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=t.EXTENT,this.length=e.length,this._features=e};w.prototype.feature=function(t){return new x(this._features[t])};var E=t.vectorTile.VectorTileFeature,O=S;function S(t,e){this.options=e||{},this.features=t,this.length=t.length}function T(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}S.prototype.feature=function(t){return new T(this.features[t],this.options.extent)},T.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},T.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]},T.prototype.toGeoJSON=E.prototype.toGeoJSON;var C=I,P=I,M=O;function I(e){var n=new t.pbf;return function(t,e){for(var n in t.layers)e.writeMessage(3,B,t.layers[n])}(e,n),n.finish()}function B(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,R,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,F,o[n])}function R(t,e){var n=t.feature;void 0!==n.id&&e.writeVarintField(1,n.id),e.writeMessage(2,k,t),e.writeVarintField(3,n.type),e.writeMessage(4,j,n)}function k(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),u=r.length-1,o[s]=u),e.writeVarint(u);var c=n.properties[s],l=typeof c;"string"!==l&&"boolean"!==l&&"number"!==l&&(c=JSON.stringify(c));var h=l+":"+c,f=a[h];void 0===f&&(i.push(c),f=i.length-1,a[h]=f),e.writeVarint(f)}}function L(t,e){return(e<<3)+(7&t)}function D(t){return t<<1^t>>31}function j(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],c=1;1===r&&(c=u.length),e.writeVarint(L(1,c));for(var l=3===r?u.length-1:u.length,h=0;h<l;h++){1===h&&1!==r&&e.writeVarint(L(2,l-1));var f=u[h].x-i,p=u[h].y-o;e.writeVarint(D(f)),e.writeVarint(D(p)),i+=f,o+=p}3===r&&e.writeVarint(L(7,1))}}function F(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 z(t,e,n,r){U(t,n,r),U(e,2*n,2*r),U(e,2*n+1,2*r+1)}function U(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function N(t,e,n,r){var i=t-n,o=e-r;return i*i+o*o}C.fromVectorTileJs=P,C.fromGeojsonVt=function(t,e){e=e||{};var n={};for(var r in t)n[r]=new O(t[r].features,e),n[r].name=r,n[r].version=e.version,n[r].extent=e.extent;return I({layers:n})},C.GeoJSONWrapper=M;var G=function(t){return t[0]},V=function(t){return t[1]},H=function(t,e,n,r,i){void 0===e&&(e=G),void 0===n&&(n=V),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,c=Math.log(s),l=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*l*(s-l)/s)*(u-s/2<0?-1:1);t(e,n,r,Math.max(i,Math.floor(r-u*l/s+h)),Math.min(o,Math.floor(r+(s-u)*l/s+h)),a)}var f=n[2*r+a],p=i,d=o;for(z(e,n,i,r),n[2*o+a]>f&&z(e,n,i,o);p<d;){for(z(e,n,p,d),p++,d--;n[2*p+a]<f;)p++;for(;n[2*d+a]>f;)d--}n[2*i+a]===f?z(e,n,i,d):z(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)};H.prototype.range=function(t,e,n,r){return function(t,e,n,r,i,o,a){for(var s,u,c=[0,t.length-1,0],l=[];c.length;){var h=c.pop(),f=c.pop(),p=c.pop();if(f-p<=a)for(var d=p;d<=f;d++)s=e[2*d],u=e[2*d+1],s>=n&&s<=i&&u>=r&&u<=o&&l.push(t[d]);else{var A=Math.floor((p+f)/2);s=e[2*A],u=e[2*A+1],s>=n&&s<=i&&u>=r&&u<=o&&l.push(t[A]);var g=(h+1)%2;(0===h?n<=s:r<=u)&&(c.push(p),c.push(A-1),c.push(g)),(0===h?i>=s:o>=u)&&(c.push(A+1),c.push(f),c.push(g))}}return l}(this.ids,this.coords,t,e,n,r,this.nodeSize)},H.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 c=a.pop(),l=a.pop(),h=a.pop();if(l-h<=o)for(var f=h;f<=l;f++)N(e[2*f],e[2*f+1],n,r)<=u&&s.push(t[f]);else{var p=Math.floor((h+l)/2),d=e[2*p],A=e[2*p+1];N(d,A,n,r)<=u&&s.push(t[p]);var g=(c+1)%2;(0===c?n-i<=d:r-i<=A)&&(a.push(h),a.push(p-1),a.push(g)),(0===c?n+i>=d:r+i>=A)&&(a.push(p+1),a.push(l),a.push(g))}}return s}(this.ids,this.coords,t,e,n,this.nodeSize)};var W={minZoom:0,maxZoom:16,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(t){return t}},q=function(t){this.options=$(Object.create(W),t),this.trees=new Array(this.options.maxZoom+1)};function X(t,e,n,r,i){return{x:t,y:e,zoom:1/0,id:n,parentId:-1,numPoints:r,properties:i}}function J(t,e){var n=t.geometry.coordinates,r=n[0],i=n[1];return{x:K(r),y:Y(i),zoom:1/0,index:e,parentId:-1}}function Z(t){return{type:"Feature",id:t.id,properties:Q(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 Q(t){var e=t.numPoints,n=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return $($({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:n})}function K(t){return t/360+.5}function Y(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 $(t,e){for(var n in e)t[n]=e[n];return t}function tt(t){return t.x}function et(t){return t.y}function nt(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 rt(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)it(t,e);else if("Polygon"===n||"MultiLineString"===n)for(var r=0;r<e.length;r++)it(t,e[r]);else if("MultiPolygon"===n)for(r=0;r<e.length;r++)for(var i=0;i<e[r].length;i++)it(t,e[r][i])}(i),i}function it(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 ot(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)at(i,s);else if("MultiPoint"===o)for(var c=0;c<i.length;c++)at(i[c],s);else if("LineString"===o)st(i,s,a,!1);else if("MultiLineString"===o){if(n.lineMetrics){for(c=0;c<i.length;c++)s=[],st(i[c],s,a,!1),t.push(rt(u,"LineString",s,e.properties));return}ut(i,s,a,!1)}else if("Polygon"===o)ut(i,s,a,!0);else{if("MultiPolygon"!==o){if("GeometryCollection"===o){for(c=0;c<e.geometry.geometries.length;c++)ot(t,{id:u,geometry:e.geometry.geometries[c],properties:e.properties},n,r);return}throw new Error("Input data is not a valid GeoJSON object.")}for(c=0;c<i.length;c++){var l=[];ut(i[c],l,a,!0),s.push(l)}}t.push(rt(u,o,s,e.properties))}}function at(t,e){e.push(ct(t[0])),e.push(lt(t[1])),e.push(0)}function st(t,e,n,r){for(var i,o,a=0,s=0;s<t.length;s++){var u=ct(t[s][0]),c=lt(t[s][1]);e.push(u),e.push(c),e.push(0),s>0&&(a+=r?(i*c-u*o)/2:Math.sqrt(Math.pow(u-i,2)+Math.pow(c-o,2))),i=u,o=c}var l=e.length-3;e[2]=1,function t(e,n,r,i){for(var o,a=i,s=r-n>>1,u=r-n,c=e[n],l=e[n+1],h=e[r],f=e[r+1],p=n+3;p<r;p+=3){var d=nt(e[p],e[p+1],c,l,h,f);if(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,l,n),e[l+2]=1,e.size=Math.abs(a),e.start=0,e.end=e.size}function ut(t,e,n,r){for(var i=0;i<t.length;i++){var o=[];st(t[i],o,n,r),e.push(o)}}function ct(t){return t/360+.5}function lt(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 ht(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=[],c=0;c<t.length;c++){var l=t[c],h=l.geometry,f=l.type,p=0===i?l.minX:l.minY,d=0===i?l.maxX:l.maxY;if(p>=n&&d<r)u.push(l);else if(!(d<n||p>=r)){var A=[];if("Point"===f||"MultiPoint"===f)ft(h,A,n,r,i);else if("LineString"===f)pt(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 g=0;g<h.length;g++){var m=[];At(h[g],m,n,r,i,!0),m.length&&A.push(m)}if(A.length){if(s.lineMetrics&&"LineString"===f){for(g=0;g<A.length;g++)u.push(rt(l.id,f,A[g],l.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(rt(l.id,f,A,l.tags))}}}return u.length?u:null}function ft(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 pt(t,e,n,r,i,o,a){for(var s,u,c=dt(t),l=0===i?mt:yt,h=t.start,f=0;f<t.length-3;f+=3){var p=t[f],d=t[f+1],A=t[f+2],g=t[f+3],m=t[f+4],y=0===i?p:d,v=0===i?g:m,_=!1;a&&(s=Math.sqrt(Math.pow(p-g,2)+Math.pow(d-m,2))),y<n?v>n&&(u=l(c,p,d,g,m,n),a&&(c.start=h+s*u)):y>r?v<r&&(u=l(c,p,d,g,m,r),a&&(c.start=h+s*u)):gt(c,p,d,A),v<n&&y>=n&&(u=l(c,p,d,g,m,n),_=!0),v>r&&y<=r&&(u=l(c,p,d,g,m,r),_=!0),!o&&_&&(a&&(c.end=h+s*u),e.push(c),c=dt(t)),a&&(h+=s)}var b=t.length-3;p=t[b],d=t[b+1],A=t[b+2],(y=0===i?p:d)>=n&&y<=r&&gt(c,p,d,A),b=c.length-3,o&&b>=3&&(c[b]!==c[0]||c[b+1]!==c[1])&&gt(c,c[0],c[1],c[2]),c.length&&e.push(c)}function dt(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++)pt(t[a],e,n,r,i,o,!1)}function gt(t,e,n,r){t.push(e),t.push(n),t.push(r)}function mt(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 yt(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 vt(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=_t(o.geometry,e);else if("MultiLineString"===a||"Polygon"===a){i=[];for(var s=0;s<o.geometry.length;s++)i.push(_t(o.geometry[s],e))}else if("MultiPolygon"===a)for(i=[],s=0;s<o.geometry.length;s++){for(var u=[],c=0;c<o.geometry[s].length;c++)u.push(_t(o.geometry[s][c],e));i.push(u)}n.push(rt(o.id,a,i,o.tags))}return n}function _t(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 bt(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],c=u.geometry,l=u.type;if(u.geometry=[],1===l)for(r=0;r<c.length;r+=2)u.geometry.push(xt(c[r],c[r+1],e,o,a,s));else for(r=0;r<c.length;r++){var h=[];for(i=0;i<c[r].length;i+=2)h.push(xt(c[r][i],c[r][i+1],e,o,a,s));u.geometry.push(h)}}return t.transformed=!0,t}function xt(t,e,n,r,i,o){return[Math.round(n*(t*r-i)),Math.round(n*(e*r-o))]}function wt(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++,Et(a,t[s],o,i);var u=t[s].minX,c=t[s].minY,l=t[s].maxX,h=t[s].maxY;u<a.minX&&(a.minX=u),c<a.minY&&(a.minY=c),l>a.maxX&&(a.maxX=l),h>a.maxY&&(a.maxY=h)}return a}function Et(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)Ot(a,i,t,n,!1,!1);else if("MultiLineString"===o||"Polygon"===o)for(s=0;s<i.length;s++)Ot(a,i[s],t,n,"Polygon"===o,0===s);else if("MultiPolygon"===o)for(var u=0;u<i.length;u++){var c=i[u];for(s=0;s<c.length;s++)Ot(a,c[s],t,n,!0,0===s)}if(a.length){var l=e.tags||null;if("LineString"===o&&r.lineMetrics){for(var h in l={},e.tags)l[h]=e.tags[h];l.mapbox_clip_start=i.start/i.size,l.mapbox_clip_end=i.end/i.size}var f={geometry:a,type:"Polygon"===o||"MultiPolygon"===o?3:"LineString"===o||"MultiLineString"===o?2:1,tags:l};null!==e.id&&(f.id=e.id),t.features.push(f)}}function Ot(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 St(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++)ot(n,t.features[r],e,r);else"Feature"===t.type?ot(n,t,e):ot(n,{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=ht(t,1,-1-n,n,0,-1,2,e),o=ht(t,1,1-n,2+n,0,-1,2,e);return(i||o)&&(r=ht(t,1,-n,1+n,0,-1,2,e)||[],i&&(r=vt(i,1).concat(r)),o&&(r=r.concat(vt(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 Tt(t,e,n){return 32*((1<<t)*n+e)+t}function Ct(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 w(r.features),o=C(i);0===o.byteOffset&&o.byteLength===o.buffer.byteLength||(o=new Uint8Array(o)),e(null,{vectorTile:i,rawData:o.buffer})}q.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(J(t[u],u));this.trees[i+1]=new H(s,tt,et,o,Float32Array),n&&console.timeEnd(a);for(var c=i;c>=r;c--){var l=+Date.now();s=this._cluster(s,c),this.trees[c]=new H(s,tt,et,o,Float32Array),n&&console.log("z%d: %d clusters in %dms",c,s.length,+Date.now()-l)}return n&&console.timeEnd("total time"),this},q.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)],c=[],l=0,h=u.range(K(n),Y(o),K(i),Y(r));l<h.length;l+=1){var f=h[l],p=u.points[f];c.push(p.numPoints?Z(p):this.points[p.index])}return c},q.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,c=i.within(o.x,o.y,a);u<c.length;u+=1){var l=c[u],h=i.points[l];h.parentId===t&&s.push(h.numPoints?Z(h):this.points[h.index])}if(0===s.length)throw new Error(r);return s},q.prototype.getLeaves=function(t,e,n){e=e||10,n=n||0;var r=[];return this._appendLeaves(r,t,e,n,0),r},q.prototype.getTile=function(t,e,n){var r=this.trees[this._limitZoom(t)],i=Math.pow(2,t),o=this.options,a=o.extent,s=o.radius/a,u=(n-s)/i,c=(n+1+s)/i,l={features:[]};return this._addTileFeatures(r.range((e-s)/i,u,(e+1+s)/i,c),r.points,e,n,i,l),0===e&&this._addTileFeatures(r.range(1-s/i,u,1,c),r.points,i,n,i,l),e===i-1&&this._addTileFeatures(r.range(0,u,s/i,c),r.points,-1,n,i,l),l.features.length?l:null},q.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},q.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},q.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]],c=u.numPoints,l={type:1,geometry:[[Math.round(this.options.extent*(u.x*i-n)),Math.round(this.options.extent*(u.y*i-r))]],tags:c?Q(u):this.points[u.index].properties},h=void 0;c?h=u.id:this.options.generateId?h=u.index:this.points[u.index].id&&(h=this.points[u.index].id),void 0!==h&&(l.id=h),o.features.push(l)}},q.prototype._limitZoom=function(t){return Math.max(this.options.minZoom,Math.min(t,this.options.maxZoom+1))},q.prototype._cluster=function(t,e){for(var n=[],r=this.options,i=r.radius,o=r.extent,a=r.reduce,s=i/(o*Math.pow(2,e)),u=0;u<t.length;u++){var c=t[u];if(!(c.zoom<=e)){c.zoom=e;for(var l=this.trees[e+1],h=l.within(c.x,c.y,s),f=c.numPoints||1,p=c.x*f,d=c.y*f,A=a&&f>1?this._map(c,!0):null,g=(u<<5)+(e+1)+this.points.length,m=0,y=h;m<y.length;m+=1){var v=y[m],_=l.points[v];if(!(_.zoom<=e)){_.zoom=e;var b=_.numPoints||1;p+=_.x*b,d+=_.y*b,f+=b,_.parentId=g,a&&(A||(A=this._map(c,!0)),a(A,this._map(_)))}}1===f?n.push(c):(c.parentId=g,n.push(X(p/f,d/f,g,f,A)))}}return n},q.prototype._getOriginId=function(t){return t-this.points.length>>5},q.prototype._getOriginZoom=function(t){return(t-this.points.length)%32},q.prototype._map=function(t,e){if(t.numPoints)return e?$({},t.properties):t.properties;var n=this.points[t.index].properties,r=this.options.map(n);return e&&r===n?$({},r):r},St.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},St.prototype.splitTile=function(t,e,n,r,i,o,a){for(var s=[t,e,n,r],u=this.options,c=u.debug;s.length;){r=s.pop(),n=s.pop(),e=s.pop(),t=s.pop();var l=1<<e,h=Tt(e,n,r),f=this.tiles[h];if(!f&&(c>1&&console.time("creation"),f=this.tiles[h]=wt(t,e,n,r,u),this.tileCoords.push({z:e,x:n,y:r}),c)){c>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){c>1&&console.time("clipping");var A,g,m,y,v,_,b=.5*u.buffer/u.extent,x=.5-b,w=.5+b,E=1+b;A=g=m=y=null,v=ht(t,l,n-b,n+w,0,f.minX,f.maxX,u),_=ht(t,l,n+x,n+E,0,f.minX,f.maxX,u),t=null,v&&(A=ht(v,l,r-b,r+w,1,f.minY,f.maxY,u),g=ht(v,l,r+x,r+E,1,f.minY,f.maxY,u),v=null),_&&(m=ht(_,l,r-b,r+w,1,f.minY,f.maxY,u),y=ht(_,l,r+x,r+E,1,f.minY,f.maxY,u),_=null),c>1&&console.timeEnd("clipping"),s.push(A||[],e+1,2*n,2*r),s.push(g||[],e+1,2*n,2*r+1),s.push(m||[],e+1,2*n+1,2*r),s.push(y||[],e+1,2*n+1,2*r+1)}}},St.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=Tt(t,e=(e%a+a)%a,n);if(this.tiles[s])return bt(this.tiles[s],i);o>1&&console.log("drilling down to z%d-%d-%d",t,e,n);for(var u,c=t,l=e,h=n;!u&&c>0;)c--,l=Math.floor(l/2),h=Math.floor(h/2),u=this.tiles[Tt(c,l,h)];return u&&u.source?(o>1&&console.log("found parent tile z%d-%d-%d",c,l,h),o>1&&console.time("drilling down"),this.splitTile(u.source,c,l,h,t,e,n),o>1&&console.timeEnd("drilling down"),this.tiles[s]?bt(this.tiles[s],i):null):null};var Pt=function(e){function n(t,n,r,i){e.call(this,t,n,r,Ct),i&&(this.loadGeoJSON=i)}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.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 u.Performance(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){switch(e&&e.type||null){case"FeatureCollection":return e.features=e.features.map(y(t,n)),e;case"GeometryCollection":return e.geometries=e.geometries.map(y(t,n)),e;case"Feature":return e.geometry=t(e.geometry,n),e;case"Polygon":case"MultiPolygon":return function(t,e){return"Polygon"===t.type?t.coordinates=v(t.coordinates,e):"MultiPolygon"===t.type&&(t.coordinates=t.coordinates.map(y(v,e))),t}(e,n);default:return e}}(a,!0);try{e._geoJSONIndex=r.cluster?new q(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),c=0,l=u;c<l.length;c+=1){var h=l[c],f=r[h],p=f[0],d=f[1],A=t.createExpression(d),g=t.createExpression("string"==typeof p?[p,["accumulated"],["get",h]]:p);i[h]=A.value,o[h]=g.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 St(t,e)}(a,r.geojsonVtOptions)}catch(o){return n(o)}e.loaded={};var s={};if(i){var u=i.finish();u&&(s.resourceTiming={},s.resourceTiming[r.source]=JSON.parse(JSON.stringify(u)))}n(null,s)}))}},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,i=t.uid;return r&&r[i]?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){e(null,this._geoJSONIndex.getClusterExpansionZoom(t.clusterId))},n.prototype.getClusterChildren=function(t,e){e(null,this._geoJSONIndex.getChildren(t.clusterId))},n.prototype.getClusterLeaves=function(t,e){e(null,this._geoJSONIndex.getLeaves(t.clusterId,t.limit,t.offset))},n}(h),Mt=function(e){var n=this;this.self=e,this.actor=new t.Actor(e,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:h,geojson:Pt},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 Mt.prototype.setReferrer=function(t,e){this.referrer=e},Mt.prototype.setImages=function(t,e,n){this.availableImages[t]=e,n()},Mt.prototype.setLayers=function(t,e,n){this.getLayerIndex(t).replace(e),n()},Mt.prototype.updateLayers=function(t,e,n){this.getLayerIndex(t).update(e.layers,e.removedIds),n()},Mt.prototype.loadTile=function(t,e,n){this.getWorkerSource(t,e.type,e.source).loadTile(e,n)},Mt.prototype.loadDEMTile=function(t,e,n){this.getDEMWorkerSource(t,e.source).loadTile(e,n)},Mt.prototype.reloadTile=function(t,e,n){this.getWorkerSource(t,e.type,e.source).reloadTile(e,n)},Mt.prototype.abortTile=function(t,e,n){this.getWorkerSource(t,e.type,e.source).abortTile(e,n)},Mt.prototype.removeTile=function(t,e,n){this.getWorkerSource(t,e.type,e.source).removeTile(e,n)},Mt.prototype.removeDEMTile=function(t,e){this.getDEMWorkerSource(t,e.source).removeTile(e)},Mt.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()}},Mt.prototype.loadWorkerSource=function(t,e,n){try{this.self.importScripts(e.url),n()}catch(t){n(t.toString())}},Mt.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())}},Mt.prototype.getAvailableImages=function(t){var e=this.availableImages[t];return e||(e=[]),e},Mt.prototype.getLayerIndex=function(t){var e=this.layerIndexes[t];return e||(e=this.layerIndexes[t]=new r),e},Mt.prototype.getWorkerSource=function(t,e,n){var r=this;if(this.workerSources[t]||(this.workerSources[t]={}),this.workerSources[t][e]||(this.workerSources[t][e]={}),!this.workerSources[t][e][n]){var i={send:function(e,n,i){r.actor.send(e,n,i,t)}};this.workerSources[t][e][n]=new this.workerSourceTypes[e](i,this.getLayerIndex(t),this.getAvailableImages(t))}return this.workerSources[t][e][n]},Mt.prototype.getDEMWorkerSource=function(t,e){return this.demWorkerSources[t]||(this.demWorkerSources[t]={}),this.demWorkerSources[t][e]||(this.demWorkerSources[t][e]=new f),this.demWorkerSources[t][e]},Mt.prototype.enforceCacheSizeLimit=function(e,n){t.enforceCacheSizeLimit(n)},"undefined"!=typeof WorkerGlobalScope&&void 0!==t.window&&t.window instanceof WorkerGlobalScope&&(t.window.worker=new Mt(t.window)),Mt})),r(0,(function(t){var e=t.createCommonjsModule((function(t){function e(t){return!!("undefined"!=typeof window&&"undefined"!=typeof document&&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(t){return void 0===n[t]&&(n[t]=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)),n[t]}(t&&t.failIfMajorPerformanceCaveat))}t.exports?t.exports=e:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=e);var n={};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.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 c=Object.defineProperty({},"passive",{get:function(){u=!0}});t.window.addEventListener("test",c,c),t.window.removeEventListener("test",c,c)}catch(t){u=!1}n.addEventListener=function(t,e,n,r){void 0===r&&(r={}),"passive"in r&&u?t.addEventListener(e,n,r):t.addEventListener(e,n,r.capture)},n.removeEventListener=function(t,e,n,r){void 0===r&&(r={}),"passive"in r&&u?t.removeEventListener(e,n,r):t.removeEventListener(e,n,r.capture)};var l=function(e){e.preventDefault(),e.stopPropagation(),t.window.removeEventListener("click",l,!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",l,!0),t.window.setTimeout((function(){t.window.removeEventListener("click",l,!0)}),0)},n.mousePos=function(e,n){var r=e.getBoundingClientRect(),i=t.window.TouchEvent&&n instanceof t.window.TouchEvent?n.touches[0]:n;return new t.Point(i.clientX-r.left-e.clientLeft,i.clientY-r.top-e.clientTop)},n.touchPos=function(e,n){for(var r=e.getBoundingClientRect(),i=[],o="touchend"===n.type?n.changedTouches:n.touches,a=0;a<o.length;a++)i.push(new t.Point(o[a].clientX-r.left-e.clientLeft,o[a].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),n.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],i=r.ids,o=r.callback;this._notify(i,o)}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){var n=this.images[t];e.version=n.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;r+=1){var o=i[r];this.images[o]||(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,c=u.x+1,l=u.y+1,h=this.images[s].data,f=h.width,p=h.height;t.RGBAImage.copy(h,a,{x:0,y:0},{x:c,y:l},{width:f,height:p}),t.RGBAImage.copy(h,a,{x:0,y:p-1},{x:c,y:l-1},{width:f,height:1}),t.RGBAImage.copy(h,a,{x:0,y:0},{x:c,y:l+p},{width:f,height:1}),t.RGBAImage.copy(h,a,{x:f-1,y:0},{x:c-1,y:l},{width:1,height:p}),t.RGBAImage.copy(h,a,{x:0,y:0},{x:c+f,y:l},{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=g,d=g,A=1e20;function g(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 m(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(y(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(y(r,i,o,a,e),s=0;s<e;s++)t[u*e+s]=Math.sqrt(i[s])}}function y(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]]}}g.prototype.draw=function(t){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(t,this.buffer,this.middle);for(var e=this.ctx.getImageData(0,0,this.size,this.size),n=new Uint8ClampedArray(this.size*this.size),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(m(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),m(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),r=0;r<this.size*this.size;r++){var o=this.gridOuter[r]-this.gridInner[r];n[r]=Math.max(0,Math.min(255,Math.round(255-255*(o/this.radius+this.cutoff))))}return n},p.default=d;var v=function(t,e){this.requestManager=t,this.localIdeographFontFamily=e,this.entries={}};v.prototype.setURL=function(t){this.url=t},v.prototype.getGlyphs=function(e,n){var r=this,i=[];for(var o in e)for(var a=0,s=e[o];a<s.length;a+=1){var u=s[a];i.push({stack:o,id:u})}t.asyncAll(i,(function(t,e){var n=t.stack,i=t.id,o=r.entries[n];o||(o=r.entries[n]={glyphs:{},requests:{}});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{var u=o.requests[s];u||(u=o.requests[s]=[],v.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]);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,c=a.glyph;(r[s]||(r[s]={}))[u]=c&&{id:c.id,bitmap:c.bitmap.clone(),metrics:c.metrics}}n(null,r)}}))},v.prototype._doesCharSupportLocalGlyph=function(e){return!!this.localIdeographFontFamily&&(t.isChar["CJK Unified Ideographs"](e)||t.isChar["Hangul Syllables"](e)||t.isChar.Hiragana(e)||t.isChar.Katakana(e))},v.prototype._tinySDF=function(e,n,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 v.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}}}},v.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)}}))},v.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),n.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,-"-transition".length),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.bytes=4,this.data=new Uint8Array(this.width*this.height*this.bytes),this.positions={}};w.prototype.getDash=function(t,e){var n=t.join(",")+String(e);return this.positions[n]||(this.positions[n]=this.addDash(t,e)),this.positions[n]},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];for(var s=this.width/o,u=s/2,c=e.length%2==1,l=-r;l<=r;l++)for(var h=this.nextRow+r+l,f=this.width*h,p=c?-e[e.length-1]:0,d=e[0],A=1,g=0;g<this.width;g++){for(;d<g/s;)p=d,d+=e[A],c&&A===e.length-1&&(d+=e[0]),A++;var m=Math.abs(g-p*s),y=Math.abs(g-d*s),v=Math.min(m,y),_=A%2==1,b=void 0;if(n){var x=r?l/r*(u+1):0;if(_){var w=u-Math.abs(x);b=Math.sqrt(v*v+w*w)}else b=u-Math.sqrt(v*v+x*x)}else b=(_?1:-1)*v;this.data[3+4*(f+g)]=Math.max(0,Math.min(255,b+128))}var E={y:(this.nextRow+r+.5)/this.height,height:2*r/this.height,width:o};return this.nextRow+=i,this.dirty=!0,E},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.RGBA,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.RGBA,this.width,this.height,0,e.RGBA,e.UNSIGNED_BYTE,this.data))};var E=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=i[o],s=new e.Actor(a,r,this.id);s.name="Worker "+o,this.actors.push(s)}};function O(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}))),e.url&&(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)}))}E.prototype.broadcast=function(e,n,r){r=r||function(){},t.asyncAll(this.actors,(function(t,r){t.send(e,n,r)}),r)},E.prototype.getActor=function(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]},E.prototype.remove=function(){this.actors.forEach((function(t){t.remove()})),this.actors=[],this.workerPool.release(this.id)},E.Actor=t.Actor;var S=function(e,n,r){this.bounds=t.LngLatBounds.convert(this.validateBounds(e)),this.minzoom=n||0,this.maxzoom=r||24};S.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]},S.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 T=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"])),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),n.prototype.constructor=n,n.prototype.load=function(){var e=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=O(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 S(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.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),this.url,null),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};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.clearMask(),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),C=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),n.prototype.constructor=n,n.prototype.load=function(){var e=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=O(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 S(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.url,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),t.clearMask(),e()},n.prototype.hasTransition=function(){return!1},n}(t.Evented),P=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),n.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.url,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.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.clearMask(),t.state="unloaded",t.actor&&t.actor.send("removeDEMTile",{uid:t.uid,source:this.id})},n}(C),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);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,extent:t.EXTENT,radius:(r.clusterRadius||50)*a,log:!1,generateId:r.generateId||!1},clusterProperties:r.clusterProperties},r.workerOptions)}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.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;var o={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};e.request=this.actor.send(i,o,(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(),t.clearMask(),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=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),n.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 c=i-n,l=o-r,h=Math.max(c,l),f=Math.max(0,Math.floor(-Math.log(h)/Math.LN2)),p=Math.pow(2,f);return new t.CanonicalTileID(f,Math.floor((n+i)/2*p),Math.floor((r+o)/2*p))}(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,t.rasterBoundsAttributes.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),B=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),n.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){var o=i[r];this.urls.push(this.map._requestManager.transformRequest(o,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,t.rasterBoundsAttributes.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}(I),R=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),n.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,t.rasterBoundsAttributes.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}(I),k={vector:T,raster:C,"raster-dem":P,geojson:M,video:B,image:I,canvas:R};function L(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 D(t,e,n,r,i){var o=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}(r&&r.layers,e,t.id),a=i.maxPitchScaleFactor(),s=t.tilesIn(n,a,o);s.sort(j);for(var u=[],c=0,l=s;c<l.length;c+=1){var h=l[c];u.push({wrappedTileID:h.tileID.wrapped().key,queryResults:h.tile.queryRenderedFeatures(e,t._state,h.queryGeometry,h.cameraQueryGeometry,h.scale,r,i,a,L(t.transform,h.tileID))})}var f=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 c in a)for(var l=a[c],h=u[c]=u[c]||{},f=e[c]=e[c]||[],p=0,d=l;p<d.length;p+=1){var A=d[p];h[A.featureIndex]||(h[A.featureIndex]=!0,f.push(A))}}return e}(u);for(var p in f)f[p].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 f}function j(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 F=function(t,e){this.max=t,this.onRemove=e,this.reset()};F.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},F.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},F.prototype.has=function(t){return t.wrapped().key in this.data},F.prototype.getAndRemove=function(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null},F.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},F.prototype.get=function(t){return this.has(t)?this.data[t.wrapped().key][0].value:null},F.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},F.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},F.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 z=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};z.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},z.prototype.updateData=function(t){var e=this.context.gl;this.context.unbindVAO(),this.bind(),e.bufferSubData(e.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)},z.prototype.destroy=function(){var t=this.context.gl;this.buffer&&(t.deleteBuffer(this.buffer),delete this.buffer)};var U={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},N=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};N.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},N.prototype.updateData=function(t){var e=this.context.gl;this.bind(),e.bufferSubData(e.ARRAY_BUFFER,0,t.arrayBuffer)},N.prototype.enableAttributes=function(t,e){for(var n=0;n<this.attributes.length;n++){var r=this.attributes[n],i=e.attributes[r.name];void 0!==i&&t.enableVertexAttribArray(i)}},N.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[U[i.type]],!1,this.itemSize,i.offset+this.itemSize*(n||0))}},N.prototype.destroy=function(){var t=this.context.gl;this.buffer&&(t.deleteBuffer(this.buffer),delete this.buffer)};var G=function(t){this.gl=t.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1};G.prototype.get=function(){return this.current},G.prototype.set=function(t){},G.prototype.getDefault=function(){return this.default},G.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),n.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}(G),H=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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}(G),W=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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}(G),q=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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}(G),X=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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}(G),J=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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}(G),Z=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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}(G),Q=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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}(G),K=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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}(G),Y=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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}(G),$=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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}(G),tt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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}(G),et=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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}(G),nt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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}(G),rt=function(e){function n(){e.apply(this,arguments)}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.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}(G),it=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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}(G),ot=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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}(G),at=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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}(G),st=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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}(G),ut=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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}(G),ct=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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}(G),lt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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}(G),ht=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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}(G),ft=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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}(G),pt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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}(G),dt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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}(G),At=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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}(G),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),e.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}(G),mt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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}(G),yt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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}(G),vt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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}(G),_t=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),e.prototype.constructor=e,e.prototype.getDefault=function(){return null},e}(G),bt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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}(_t),xt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.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}(_t),wt=function(t,e,n){this.context=t,this.width=e,this.height=n;var r=t.gl,i=this.framebuffer=r.createFramebuffer();this.colorAttachment=new bt(t,i),this.depthAttachment=new xt(t,i)};wt.prototype.destroy=function(){var t=this.context.gl,e=this.colorAttachment.get();e&&t.deleteTexture(e);var n=this.depthAttachment.get();n&&t.deleteRenderbuffer(n),t.deleteFramebuffer(this.framebuffer)};var Et=function(t,e,n){this.func=t,this.mask=e,this.range=n};Et.ReadOnly=!1,Et.ReadWrite=!0,Et.disabled=new Et(519,Et.ReadOnly,[0,1]);var Ot=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};Ot.disabled=new Ot({func:519,mask:0},0,0,7680,7680,7680);var St=function(t,e,n){this.blendFunction=t,this.blendColor=e,this.mask=n};St.disabled=new St(St.Replace=[1,0],t.Color.transparent,[!1,!1,!1,!1]),St.unblended=new St(St.Replace,t.Color.transparent,[!0,!0,!0,!0]),St.alphaBlended=new St([1,771],t.Color.transparent,[!0,!0,!0,!0]);var Tt=function(t,e,n){this.enable=t,this.mode=e,this.frontFace=n};Tt.disabled=new Tt(!1,1029,2305),Tt.backCCW=new Tt(!0,1029,2305);var Ct=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 W(this),this.colorMask=new q(this),this.depthMask=new X(this),this.stencilMask=new J(this),this.stencilFunc=new Z(this),this.stencilOp=new Q(this),this.stencilTest=new K(this),this.depthRange=new Y(this),this.depthTest=new $(this),this.depthFunc=new tt(this),this.blend=new et(this),this.blendFunc=new nt(this),this.blendColor=new rt(this),this.blendEquation=new it(this),this.cullFace=new ot(this),this.cullFaceSide=new at(this),this.frontFace=new st(this),this.program=new ut(this),this.activeTexture=new ct(this),this.viewport=new lt(this),this.bindFramebuffer=new ht(this),this.bindRenderbuffer=new ft(this),this.bindTexture=new pt(this),this.bindVertexBuffer=new dt(this),this.bindElementBuffer=new At(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new gt(this),this.pixelStoreUnpack=new mt(this),this.pixelStoreUnpackPremultiplyAlpha=new yt(this),this.pixelStoreUnpackFlipY=new vt(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.extTimerQuery=t.getExtension("EXT_disjoint_timer_query")};Ct.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()},Ct.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},Ct.prototype.createIndexBuffer=function(t,e){return new z(this,t,e)},Ct.prototype.createVertexBuffer=function(t,e,n){return new N(this,t,e,n)},Ct.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},Ct.prototype.createFramebuffer=function(t,e){return new wt(this,t,e)},Ct.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)},Ct.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))},Ct.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)},Ct.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)},Ct.prototype.setColorMode=function(e){t.deepEqual(e.blendFunction,St.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(e.blendFunction),this.blendColor.set(e.blendColor)),this.colorMask.set(e.mask)},Ct.prototype.unbindVAO=function(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)};var Pt=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 k[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 F(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._coveredTiles={},this._state=new t.SourceFeatureState}return e&&(n.__proto__=e),n.prototype=Object.create(e&&e.prototype),n.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 Object.keys(this._tiles).map(Number).sort(Mt)},n.prototype.getRenderableIds=function(e){var n=this,r=[];for(var i in this._tiles)this._isIdRenderable(+i,e)&&r.push(+i);return e?r.sort((function(e,r){var i=n._tiles[e].tileID,o=n._tiles[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})):r.sort(Mt)},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){for(var n=t.overscaledZ-1;n>=e;n--){var r=t.scaledTo(n);if(!r)return;var i=String(r.key),o=this._tiles[i];if(o&&o.hasData())return o;if(this._cache.has(r))return this._cache.get(r)}},n.prototype.updateCacheSize=function(t){var e=(Math.ceil(t.width/this._source.tileSize)+1)*(Math.ceil(t.height/this._source.tileSize)+1),n=Math.floor(5*e),r="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,n):n;this._cache.setMaxSize(r)},n.prototype.handleWrapJump=function(t){var e=(t-(void 0===this._prevLng?t:this._prevLng))/360,n=Math.round(e);if(this._prevLng=t,n){var r={};for(var i in this._tiles){var o=this._tiles[i];o.tileID=o.tileID.unwrapTo(o.tileID.wrap+n),r[o.tileID.key]=o}for(var a in this._tiles=r,this._timers)clearTimeout(this._timers[a]),delete this._timers[a];for(var s in this._tiles){var u=this._tiles[s];this._setTileReloadTimer(s,u)}}},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(It(this._source.type)){for(var c={},l={},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 g=this.findLoadedParent(d,a);g&&(this._addTile(g.tileID),c[g.tileID.key]=g.tileID),l[p]=d}}for(var m in this._retainLoadedChildren(l,o,s,u),c)u[m]||(this._coveredTiles[m]=!0,u[m]=c[m])}for(var y in u)this._tiles[y].clearFadeHold();for(var v=0,_=t.keysDifference(this._tiles,u);v<_.length;v+=1){var b=_[v],x=this._tiles[b];x.hasSymbolBuckets&&!x.holdingForFade()?x.setHoldDuration(this.map._fadeDuration):x.hasSymbolBuckets&&!x.symbolFadeFinished()||this._removeTile(b)}}},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,c=t;u<c.length;u+=1){var l=c[u],h=this._addTile(l);r[l.key]=l,h.hasData()||e<this._source.maxzoom&&(s[l.key]=l)}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 g=d.children(this._source.maxzoom)[0],m=this.getTile(g);if(m&&m.hasData()){r[g.key]=g;continue}}else{var y=d.children(this._source.maxzoom);if(r[y[0].key]&&r[y[1].key]&&r[y[2].key]&&r[y[3].key])continue}for(var v=A.wasRequested(),_=d.overscaledZ-1;_>=o;--_){var b=d.scaledTo(_);if(i[b.key])break;if(i[b.key]=!0,!(A=this.getTile(b))&&v&&(A=this._addTile(b)),A&&(r[b.key]=b,v=A.wasRequested(),A.hasData()))break}}}return r},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)})),c=s.map((function(t){return a.pointCoordinate(t)})),l=this.getIds(),h=1/0,f=1/0,p=-1/0,d=-1/0,A=0,g=c;A<g.length;A+=1){var m=g[A];h=Math.min(h,m.x),f=Math.min(f,m.y),p=Math.max(p,m.x),d=Math.max(d,m.y)}for(var y=function(e){var r=i._tiles[l[e]];if(!r.holdingForFade()){var s=r.tileID,A=Math.pow(2,a.zoom-r.tileID.overscaledZ),g=n*r.queryPadding*t.EXTENT/r.tileSize/A,m=[s.getTilePoint(new t.MercatorCoordinate(h,f)),s.getTilePoint(new t.MercatorCoordinate(p,d))];if(m[0].x-g<t.EXTENT&&m[0].y-g<t.EXTENT&&m[1].x+g>=0&&m[1].y+g>=0){var y=u.map((function(t){return s.getTilePoint(t)})),v=c.map((function(t){return s.getTilePoint(t)}));o.push({tile:r,tileID:s,queryGeometry:y,cameraQueryGeometry:v,scale:A})}}},v=0;v<l.length;v++)y(v);return o},n.prototype.getVisibleCoordinates=function(t){for(var e=this,n=this.getRenderableIds(t).map((function(t){return e._tiles[t].tileID})),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(It(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){t=t||"_geojsonTileLayer",this._state.updateState(t,e,n)},n.prototype.removeFeatureState=function(t,e,n){t=t||"_geojsonTileLayer",this._state.removeFeatureState(t,e,n)},n.prototype.getFeatureState=function(t,e){return t=t||"_geojsonTileLayer",this._state.getState(t,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 Mt(t,e){return t%32-e%32||e-t}function It(t){return"raster"===t||"image"===t||"video"===t}function Bt(){return new t.window.Worker(ni.workerUrl)}Pt.maxOverzooming=10,Pt.maxUnderzooming=3;var Rt=function(){this.active={}};Rt.prototype.acquire=function(t){if(!this.workers)for(this.workers=[];this.workers.length<Rt.workerCount;)this.workers.push(new Bt);return this.active[t]=!0,this.workers.slice()},Rt.prototype.release=function(t){delete this.active[t],0===Object.keys(this.active).length&&(this.workers.forEach((function(t){t.terminate()})),this.workers=null)};var kt,Lt=Math.floor(t.browser.hardwareConcurrency/2);function Dt(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 jt(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]=Dt(t[r],e[t[r].ref]));return t}Rt.workerCount=Math.max(Math.min(Lt,6),1);var Ft={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight"};function zt(t,e,n){n.push({command:Ft.addSource,args:[t,e[t]]})}function Ut(t,e,n){e.push({command:Ft.removeSource,args:[t]}),n[t]=!0}function Nt(t,e,n,r){Ut(t,n,r),zt(t,e,n)}function Gt(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 Vt(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 Ht(t){return t.id}function Wt(t,e){return t[e.id]=e,t}var qt=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 Jt(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 Zt(e,n){var r=[e.x,e.y,0,1];oe(r,r,n);var i=r[3];return{point:new t.Point(r[0]/i,r[1]/i),signedDistanceFromCamera:i}}function Qt(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 Kt(e,n,r,i,o,a,s,u){var c=i?e.textSizeData:e.iconSizeData,l=t.evaluateSizeForZoom(c,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,g=!1,m=0;m<d.length;m++){var y=d.get(m);if(y.hidden||y.writingMode===t.WritingMode.vertical&&!g)ie(y.numGlyphs,f);else{g=!1;var v=[y.anchorX,y.anchorY,0,1];if(t.transformMat4(v,v,n),Qt(v,h)){var _=.5+v[3]/r.transform.cameraToCenterDistance*.5,b=t.evaluateSizeForFeature(c,l,y),x=s?b*_:b/_,w=new t.Point(y.anchorX,y.anchorY),E=Zt(w,o).point,O={},S=te(y,x,!1,u,n,o,a,e.glyphOffsetArray,p,f,E,w,O,A);g=S.useVertical,(S.notEnoughRoom||g||S.needsFlipping&&te(y,x,!0,u,n,o,a,e.glyphOffsetArray,p,f,E,w,O,A).notEnoughRoom)&&ie(y.numGlyphs,f)}else ie(y.numGlyphs,f)}}i?e.text.dynamicLayoutVertexBuffer.updateData(f):e.icon.dynamicLayoutVertexBuffer.updateData(f)}function Yt(t,e,n,r,i,o,a,s,u,c,l,h){var f=s.glyphStartIndex+s.numGlyphs,p=s.lineStartIndex,d=s.lineStartIndex+s.lineLength,A=e.getoffsetX(s.glyphStartIndex),g=e.getoffsetX(f-1),m=ne(t*A,n,r,i,o,a,s.segment,p,d,u,c,l,h);if(!m)return null;var y=ne(t*g,n,r,i,o,a,s.segment,p,d,u,c,l,h);return y?{first:m,last:y}:null}function $t(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 te(e,n,r,i,o,a,s,u,c,l,h,f,p,d){var A,g=n/24,m=e.lineOffsetX*g,y=e.lineOffsetY*g;if(e.numGlyphs>1){var v=e.glyphStartIndex+e.numGlyphs,_=e.lineStartIndex,b=e.lineStartIndex+e.lineLength,x=Yt(g,u,m,y,r,h,f,e,c,a,p,!1);if(!x)return{notEnoughRoom:!0};var w=Zt(x.first.point,s).point,E=Zt(x.last.point,s).point;if(i&&!r){var O=$t(e.writingMode,w,E,d);if(O)return O}A=[x.first];for(var S=e.glyphStartIndex+1;S<v-1;S++)A.push(ne(g*u.getoffsetX(S),m,y,r,h,f,e.segment,_,b,c,a,p,!1));A.push(x.last)}else{if(i&&!r){var T=Zt(f,o).point,C=e.lineStartIndex+e.segment+1,P=new t.Point(c.getx(C),c.gety(C)),M=Zt(P,o),I=M.signedDistanceFromCamera>0?M.point:ee(f,P,T,1,o),B=$t(e.writingMode,T,I,d);if(B)return B}var R=ne(g*u.getoffsetX(e.glyphStartIndex),m,y,r,h,f,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,c,a,p,!1);if(!R)return{notEnoughRoom:!0};A=[R]}for(var k=0,L=A;k<L.length;k+=1){var D=L[k];t.addDynamicAttributes(l,D.point,D.angle)}return{}}function ee(t,e,n,r,i){var o=Zt(t.add(t.sub(e)._unit()),i).point,a=n.sub(o);return n.add(a._mult(r/a.mag()))}function ne(e,n,r,i,o,a,s,u,c,l,h,f,p){var d=i?e-n:e+n,A=d>0?1:-1,g=0;i&&(A*=-1,g=Math.PI),A<0&&(g+=Math.PI);for(var m=A>0?u+s:u+s+1,y=m,v=o,_=o,b=0,x=0,w=Math.abs(d);b+x<=w;){if((m+=A)<u||m>=c)return null;if(_=v,void 0===(v=f[m])){var E=new t.Point(l.getx(m),l.gety(m)),O=Zt(E,h);if(O.signedDistanceFromCamera>0)v=f[m]=O.point;else{var S=m-A;v=ee(0===b?a:new t.Point(l.getx(S),l.gety(S)),E,_,w-b+1,h)}}b+=x,x=_.dist(v)}var T=(w-b)/x,C=v.sub(_),P=C.mult(T)._add(_);return P._add(C._unit()._perp()._mult(r*A)),{point:P,angle:g+Math.atan2(v.y-_.y,v.x-_.x),tileDistance:p?{prevTileDistance:m-A===y?0:l.gettileUnitDistanceFromAnchor(m-A),lastSegmentViewportDistance:w-b}:null}}qt.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},qt.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)},qt.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)},qt.prototype._insertBoxCell=function(t,e,n,r,i,o){this.boxCells[i].push(o)},qt.prototype._insertCircleCell=function(t,e,n,r,i,o){this.circleCells[i].push(o)},qt.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 c=this.circles[3*u],l=this.circles[3*u+1],h=this.circles[3*u+2];a.push({key:this.circleKeys[u],x1:c-h,y1:l-h,x2:c+h,y2:l+h})}return o?a.filter(o):a}var f={hitTest:i,seenUids:{box:{},circle:{}}};return this._forEachCell(t,e,n,r,this._queryCell,a,f,o),i?a.length>0:a},qt.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 c=[],l={hitTest:r,circle:{x:t,y:e,radius:n},seenUids:{box:{},circle:{}}};return this._forEachCell(o,s,a,u,this._queryCellCircle,c,l,i),r?c.length>0:c},qt.prototype.query=function(t,e,n,r,i){return this._query(t,e,n,r,!1,i)},qt.prototype.hitTest=function(t,e,n,r,i){return this._query(t,e,n,r,!0,i)},qt.prototype.hitTestCircle=function(t,e,n,r){return this._queryCircle(t,e,n,!0,r)},qt.prototype._queryCell=function(t,e,n,r,i,o,a,s){var u=a.seenUids,c=this.boxCells[i];if(null!==c)for(var l=this.bboxes,h=0,f=c;h<f.length;h+=1){var p=f[h];if(!u.box[p]){u.box[p]=!0;var d=4*p;if(t<=l[d+2]&&e<=l[d+3]&&n>=l[d+0]&&r>=l[d+1]&&(!s||s(this.boxKeys[p]))){if(a.hitTest)return o.push(!0),!0;o.push({key:this.boxKeys[p],x1:l[d],y1:l[d+1],x2:l[d+2],y2:l[d+3]})}}}var A=this.circleCells[i];if(null!==A)for(var g=this.circles,m=0,y=A;m<y.length;m+=1){var v=y[m];if(!u.circle[v]){u.circle[v]=!0;var _=3*v;if(this._circleAndRectCollide(g[_],g[_+1],g[_+2],t,e,n,r)&&(!s||s(this.circleKeys[v]))){if(a.hitTest)return o.push(!0),!0;var b=g[_],x=g[_+1],w=g[_+2];o.push({key:this.circleKeys[v],x1:b-w,y1:x-w,x2:b+w,y2:x+w})}}}},qt.prototype._queryCellCircle=function(t,e,n,r,i,o,a,s){var u=a.circle,c=a.seenUids,l=this.boxCells[i];if(null!==l)for(var h=this.bboxes,f=0,p=l;f<p.length;f+=1){var d=p[f];if(!c.box[d]){c.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 g=this.circleCells[i];if(null!==g)for(var m=this.circles,y=0,v=g;y<v.length;y+=1){var _=v[y];if(!c.circle[_]){c.circle[_]=!0;var b=3*_;if(this._circlesCollide(m[b],m[b+1],m[b+2],u.x,u.y,u.radius)&&(!s||s(this.circleKeys[_])))return o.push(!0),!0}}},qt.prototype._forEachCell=function(t,e,n,r,i,o,a,s){for(var u=this._convertToXCellCoord(t),c=this._convertToYCellCoord(e),l=this._convertToXCellCoord(n),h=this._convertToYCellCoord(r),f=u;f<=l;f++)for(var p=c;p<=h;p++){var d=this.xCellCount*p+f;if(i.call(this,t,e,n,r,d,o,a,s))return}},qt.prototype._convertToXCellCoord=function(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))},qt.prototype._convertToYCellCoord=function(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))},qt.prototype._circlesCollide=function(t,e,n,r,i,o){var a=r-t,s=i-e,u=n+o;return u*u>a*a+s*s},qt.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 c=(a-i)/2,l=Math.abs(e-(i+c));if(l>c+n)return!1;if(u<=s||l<=c)return!0;var h=u-s,f=l-c;return h*h+f*f<=n*n};var re=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function ie(t,e){for(var n=0;n<t;n++){var r=e.length;e.resize(r+4),e.float32.set(re,3*r)}}function oe(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 ae=function(t,e,n){void 0===e&&(e=new qt(t.width+200,t.height+200,25)),void 0===n&&(n=new qt(t.width+200,t.height+200,25)),this.transform=t,this.grid=e,this.ignoredGrid=n,this.pitchfactor=Math.cos(t._pitch)*t.cameraToCenterDistance,this.screenRightBoundary=t.width+100,this.screenBottomBoundary=t.height+100,this.gridRightBoundary=t.width+200,this.gridBottomBoundary=t.height+200};function se(t,e,n){t[e+4]=n?1:0}function ue(e,n,r){return n*(t.EXTENT/(e.tileSize*Math.pow(2,r-e.tileID.overscaledZ)))}ae.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,c=t.x2*a+o.point.x,l=t.y2*a+o.point.y;return!this.isInsideGrid(s,u,c,l)||!e&&this.grid.hitTest(s,u,c,l,i)?{box:[],offscreen:!1}:{box:[s,u,c,l],offscreen:this.isOffscreen(s,u,c,l)}},ae.prototype.approximateTileDistance=function(t,e,n,r,i){var o=i?1:r/this.pitchfactor,a=t.lastSegmentViewportDistance*n;return t.prevTileDistance+a+(o-1)*a*Math.abs(Math.sin(e))},ae.prototype.placeCollisionCircles=function(e,n,r,i,o,a,s,u,c,l,h,f,p){var d=[],A=this.projectAnchor(c,o.anchorX,o.anchorY),g=u/24,m=o.lineOffsetX*u,y=o.lineOffsetY*u,v=new t.Point(o.anchorX,o.anchorY),_=Yt(g,s,m,y,!1,Zt(v,l).point,v,o,a,l,{},!0),b=!1,x=!1,w=!0,E=A.perspectiveRatio*i,O=1/(i*r),S=0,T=0;_&&(S=this.approximateTileDistance(_.first.tileDistance,_.first.angle,O,A.cameraDistance,f),T=this.approximateTileDistance(_.last.tileDistance,_.last.angle,O,A.cameraDistance,f));for(var C=0;C<e.length;C+=5){var P=e[C],M=e[C+1],I=e[C+2],B=e[C+3];if(!_||B<-S||B>T)se(e,C,!1);else{var R=this.projectPoint(c,P,M),k=I*E;if(d.length>0){var L=R.x-d[d.length-4],D=R.y-d[d.length-3];if(k*k*2>L*L+D*D&&C+8<e.length){var j=e[C+8];if(j>-S&&j<T){se(e,C,!1);continue}}}var F=C/5;d.push(R.x,R.y,k,F),se(e,C,!0);var z=R.x-k,U=R.y-k,N=R.x+k,G=R.y+k;if(w=w&&this.isOffscreen(z,U,N,G),x=x||this.isInsideGrid(z,U,N,G),!n&&this.grid.hitTestCircle(R.x,R.y,k,p)){if(!h)return{circles:[],offscreen:!1};b=!0}}}return{circles:b||!x?[]:d,offscreen:w}},ae.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 c=u[s],l=new t.Point(c.x+100,c.y+100);r=Math.min(r,l.x),i=Math.min(i,l.y),o=Math.max(o,l.x),a=Math.max(a,l.y),n.push(l)}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],g=A.key;if(void 0===h[g.bucketInstanceId]&&(h[g.bucketInstanceId]={}),!h[g.bucketInstanceId][g.featureIndex]){var m=[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,m)&&(h[g.bucketInstanceId][g.featureIndex]=!0,void 0===f[g.bucketInstanceId]&&(f[g.bucketInstanceId]=[]),f[g.bucketInstanceId].push(g.featureIndex))}}return f},ae.prototype.insertCollisionBox=function(t,e,n,r,i){var o={bucketInstanceId:n,featureIndex:r,collisionGroupID:i};(e?this.ignoredGrid:this.grid).insert(o,t[0],t[1],t[2],t[3])},ae.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])},ae.prototype.projectAnchor=function(t,e,n){var r=[e,n,0,1];return oe(r,r,t),{perspectiveRatio:.5+this.transform.cameraToCenterDistance/r[3]*.5,cameraDistance:r[3]}},ae.prototype.projectPoint=function(e,n,r){var i=[n,r,0,1];return oe(i,i,e),new t.Point((i[0]/i[3]+1)/2*this.transform.width+100,(-i[1]/i[3]+1)/2*this.transform.height+100)},ae.prototype.projectAndGetPerspectiveRatio=function(e,n,r){var i=[n,r,0,1];return oe(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}},ae.prototype.isOffscreen=function(t,e,n,r){return n<100||t>=this.screenRightBoundary||r<100||e>this.screenBottomBoundary},ae.prototype.isInsideGrid=function(t,e,n,r){return n>=0&&t<this.gridRightBoundary&&r>=0&&e<this.gridBottomBoundary};var ce=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};ce.prototype.isHidden=function(){return 0===this.opacity&&!this.placed};var le=function(t,e,n,r,i){this.text=new ce(t?t.text:null,e,n,i),this.icon=new ce(t?t.icon:null,e,r,i)};le.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var he=function(t,e,n){this.text=t,this.icon=e,this.skipFade=n},fe=function(t,e,n,r,i){this.bucketInstanceId=t,this.featureIndex=e,this.sourceLayerIndex=n,this.bucketIndex=r,this.tileID=i},pe=function(t){this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={}};function de(e,n,r,i,o){var a=t.getAnchorAlignment(e),s=-(a.horizontalAlign-.5)*n,u=-(a.verticalAlign-.5)*r,c=t.evaluateVariableOffset(e,i);return new t.Point(s+c[0]*o,u+c[1]*o)}function Ae(e,n,r,i,o,a){var s=e.x1,u=e.x2,c=e.y1,l=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:c+p.y,x2:u+p.x,y2:l+p.y,anchorPointX:h,anchorPointY:f}}pe.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 ge=function(t,e,n,r){this.transform=t.clone(),this.collisionIndex=new ae(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=e,this.retainedQueryData={},this.collisionGroups=new pe(n),this.prevPlacement=r,r&&(r.prevPlacement=void 0),this.placedOrientations={}};function me(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)}ge.prototype.placeLayerTile=function(e,n,r,i){var o=n.getBucket(e),a=n.latestFeatureIndex;if(o&&a&&e.id===o.layerIds[0]){var s=n.collisionBoxArray,u=o.layers[0].layout,c=Math.pow(2,this.transform.zoom-n.tileID.overscaledZ),l=n.tileSize/t.EXTENT,h=this.transform.calculatePosMatrix(n.tileID.toUnwrapped()),f=Xt(h,"map"===u.get("text-pitch-alignment"),"map"===u.get("text-rotation-alignment"),this.transform,ue(n,1,this.transform.zoom)),p=Xt(h,"map"===u.get("icon-pitch-alignment"),"map"===u.get("icon-rotation-alignment"),this.transform,ue(n,1,this.transform.zoom));this.retainedQueryData[o.bucketInstanceId]=new fe(o.bucketInstanceId,a,o.sourceLayerIndex,o.index,n.tileID),this.placeLayerBucket(o,h,f,p,c,l,r,n.holdingForFade(),i,s)}},ge.prototype.attemptAnchorPlacement=function(t,e,n,r,i,o,a,s,u,c,l,h,f,p,d){var A,g=[h.textOffset0,h.textOffset1],m=de(t,n,r,g,i),y=this.collisionIndex.placeCollisionBox(Ae(e,m.x,m.y,o,a,this.transform.angle),l,s,u,c.predicate);if(!d||0!==this.collisionIndex.placeCollisionBox(Ae(d,m.x,m.y,o,a,this.transform.angle),l,s,u,c.predicate).box.length)return y.box.length>0?(this.prevPlacement&&this.prevPlacement.variableOffsets[h.crossTileID]&&this.prevPlacement.placements[h.crossTileID]&&this.prevPlacement.placements[h.crossTileID].text&&(A=this.prevPlacement.variableOffsets[h.crossTileID].anchor),this.variableOffsets[h.crossTileID]={textOffset:g,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:m,placedGlyphBoxes:y}):void 0},ge.prototype.placeLayerBucket=function(e,n,r,i,o,a,s,u,c,l){var h=this,f=e.layers[0].layout,p=t.evaluateSizeForZoom(e.textSizeData,this.transform.zoom),d=f.get("text-optional"),A=f.get("icon-optional"),g=f.get("text-allow-overlap"),m=f.get("icon-allow-overlap"),y=g&&(m||!e.hasIconData()||A),v=m&&(g||!e.hasTextData()||d),_=this.collisionGroups.get(e.sourceID),b="map"===f.get("text-rotation-alignment"),x="map"===f.get("text-pitch-alignment"),w="none"!==f.get("icon-text-fit"),E="viewport-y"===f.get("symbol-z-order");!e.collisionArrays&&l&&e.deserializeCollisionBoxes(l);var O=function(i,l){if(!c[i.crossTileID])if(u)h.placements[i.crossTileID]=new he(!1,!1,!1);else{var E,O=!1,S=!1,T=!0,C=null,P={box:null,offscreen:null},M={box:null,offscreen:null},I=null,B=null,R=0,k=0,L=0;l.textFeatureIndex&&(R=l.textFeatureIndex),l.verticalTextFeatureIndex&&(k=l.verticalTextFeatureIndex);var D=l.textBox;if(D){var j=function(n){var r=t.WritingMode.horizontal;if(e.allowVerticalPlacement&&!n&&h.prevPlacement){var o=h.prevPlacement.placedOrientations[i.crossTileID];o&&(h.placedOrientations[i.crossTileID]=o,r=o,h.markUsedOrientation(e,r,i))}return r},F=function(n,r){if(e.allowVerticalPlacement&&i.numVerticalGlyphVertices>0&&l.verticalTextBox)for(var o=0,a=e.writingModes;o<a.length&&(a[o]===t.WritingMode.vertical?(P=r(),M=P):P=n(),!(P&&P.box&&P.box.length));o+=1);else P=n()};if(f.get("text-variable-anchor")){var z=f.get("text-variable-anchor");if(h.prevPlacement&&h.prevPlacement.variableOffsets[i.crossTileID]){var U=h.prevPlacement.variableOffsets[i.crossTileID];z.indexOf(U.anchor)>0&&(z=z.filter((function(t){return t!==U.anchor}))).unshift(U.anchor)}var N=function(t,r,o){for(var s=t.x2-t.x1,u=t.y2-t.y1,c=i.textBoxScale,l=w&&!m?r:null,f={box:[],offscreen:!1},p=g?2*z.length:z.length,d=0;d<p;++d){var A=z[d%z.length],y=d>=z.length,v=h.attemptAnchorPlacement(A,t,s,u,c,b,x,a,n,_,y,i,e,o,l);if(v&&(f=v.placedGlyphBoxes)&&f.box&&f.box.length){O=!0,C=v.shift;break}}return f};F((function(){return N(D,l.iconBox,t.WritingMode.horizontal)}),(function(){var n=l.verticalTextBox,r=P&&P.box&&P.box.length;return e.allowVerticalPlacement&&!r&&i.numVerticalGlyphVertices>0&&n?N(n,l.verticalIconBox,t.WritingMode.vertical):{box:null,offscreen:null}})),P&&(O=P.box,T=P.offscreen);var G=j(P&&P.box);if(!O&&h.prevPlacement){var V=h.prevPlacement.variableOffsets[i.crossTileID];V&&(h.variableOffsets[i.crossTileID]=V,h.markUsedJustification(e,V.anchor,i,G))}}else{var H=function(t,r){var o=h.collisionIndex.placeCollisionBox(t,f.get("text-allow-overlap"),a,n,_.predicate);return o&&o.box&&o.box.length&&(h.markUsedOrientation(e,r,i),h.placedOrientations[i.crossTileID]=r),o};F((function(){return H(D,t.WritingMode.horizontal)}),(function(){var n=l.verticalTextBox;return e.allowVerticalPlacement&&i.numVerticalGlyphVertices>0&&n?H(n,t.WritingMode.vertical):{box:null,offscreen:null}})),j(P&&P.box&&P.box.length)}}O=(E=P)&&E.box&&E.box.length>0,T=E&&E.offscreen;var W=l.textCircles;if(W){var q=e.text.placedSymbolArray.get(i.centerJustifiedTextSymbolIndex),X=t.evaluateSizeForFeature(e.textSizeData,p,q);I=h.collisionIndex.placeCollisionCircles(W,f.get("text-allow-overlap"),o,a,q,e.lineVertexArray,e.glyphOffsetArray,X,n,r,s,x,_.predicate),O=f.get("text-allow-overlap")||I.circles.length>0,T=T&&I.offscreen}if(l.iconFeatureIndex&&(L=l.iconFeatureIndex),l.iconBox){var J=function(t){var e=w&&C?Ae(t,C.x,C.y,b,x,h.transform.angle):t;return h.collisionIndex.placeCollisionBox(e,f.get("icon-allow-overlap"),a,n,_.predicate)};S=M&&M.box&&M.box.length&&l.verticalIconBox?(B=J(l.verticalIconBox)).box.length>0:(B=J(l.iconBox)).box.length>0,T=T&&B.offscreen}var Z=d||0===i.numHorizontalGlyphVertices&&0===i.numVerticalGlyphVertices,Q=A||0===i.numIconVertices;Z||Q?Q?Z||(S=S&&O):O=S&&O:S=O=S&&O,O&&E&&E.box&&(M&&M.box&&k?h.collisionIndex.insertCollisionBox(E.box,f.get("text-ignore-placement"),e.bucketInstanceId,k,_.ID):h.collisionIndex.insertCollisionBox(E.box,f.get("text-ignore-placement"),e.bucketInstanceId,R,_.ID)),S&&B&&h.collisionIndex.insertCollisionBox(B.box,f.get("icon-ignore-placement"),e.bucketInstanceId,L,_.ID),O&&I&&h.collisionIndex.insertCollisionCircles(I.circles,f.get("text-ignore-placement"),e.bucketInstanceId,R,_.ID),h.placements[i.crossTileID]=new he(O||y,S||v,T||e.justReloaded),c[i.crossTileID]=!0}};if(E)for(var S=e.getSortedSymbolIndexes(this.transform.angle),T=S.length-1;T>=0;--T){var C=S[T];O(e.symbolInstances.get(C),e.collisionArrays[C])}else for(var P=0;P<e.symbolInstances.length;++P)O(e.symbolInstances.get(P),e.collisionArrays[P]);e.justReloaded=!1},ge.prototype.markUsedJustification=function(e,n,r,i){var o,a={left:r.leftJustifiedTextSymbolIndex,center:r.centerJustifiedTextSymbolIndex,right:r.rightJustifiedTextSymbolIndex};o=i===t.WritingMode.vertical?r.verticalPlacedTextSymbolIndex:a[t.getAnchorJustification(n)];for(var s=0,u=[r.leftJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.rightJustifiedTextSymbolIndex,r.verticalPlacedTextSymbolIndex];s<u.length;s+=1){var c=u[s];c>=0&&(e.text.placedSymbolArray.get(c).crossTileID=o>=0&&c!==o?0:r.crossTileID)}},ge.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){var u=s[a];e.text.placedSymbolArray.get(u).placedOrientation=i}r.verticalPlacedTextSymbolIndex&&(e.text.placedSymbolArray.get(r.verticalPlacedTextSymbolIndex).placedOrientation=o)},ge.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],c=i[s];c?(this.opacities[s]=new le(c,r,u.text,u.icon),n=n||u.text!==c.text.placed||u.icon!==c.icon.placed):(this.opacities[s]=new le(null,r,u.text,u.icon,u.skipFade),n=n||u.text||u.icon)}for(var l in i){var h=i[l];if(!this.opacities[l]){var f=new le(h,r,!1,!1);f.isHidden()||(this.opacities[l]=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)},ge.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)}},ge.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(),e.hasIconCollisionCircleData()&&e.iconCollisionCircle.collisionVertexArray.clear(),e.hasTextCollisionCircleData()&&e.textCollisionCircle.collisionVertexArray.clear();var o=e.layers[0].layout,a=new le(null,0,!1,!1,!0),s=o.get("text-allow-overlap"),u=o.get("icon-allow-overlap"),c=o.get("text-variable-anchor"),l="map"===o.get("text-rotation-alignment"),h="map"===o.get("text-pitch-alignment"),f="none"!==o.get("icon-text-fit"),p=new le(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.hasIconCollisionCircleData()||e.hasTextCollisionBoxData()||e.hasTextCollisionCircleData())&&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,g=n[A],m=i.opacities[A];g?m=a:m||(m=p,i.opacities[A]=m),n[A]=!0;var y=s>0||u>0,v=o.numIconVertices>0,_=i.placedOrientations[o.crossTileID],b=_===t.WritingMode.vertical,x=_===t.WritingMode.horizontal||_===t.WritingMode.horizontalOnly;if(y){var w=Oe(m.text),E=b?Se:w;d(e.text,s,E);var O=x?Se:w;d(e.text,u,O);var S=m.text.isHidden();[o.rightJustifiedTextSymbolIndex,o.centerJustifiedTextSymbolIndex,o.leftJustifiedTextSymbolIndex].forEach((function(t){t>=0&&(e.text.placedSymbolArray.get(t).hidden=S||b?1:0)})),o.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(o.verticalPlacedTextSymbolIndex).hidden=S||x?1:0);var T=i.variableOffsets[o.crossTileID];T&&i.markUsedJustification(e,T.anchor,o,_);var C=i.placedOrientations[o.crossTileID];C&&(i.markUsedJustification(e,"left",o,C),i.markUsedOrientation(e,C,o))}if(v){var P=Oe(m.icon),M=!(f&&o.verticalPlacedIconSymbolIndex&&b);if(o.placedIconSymbolIndex>=0){var I=M?P:Se;d(e.icon,o.numIconVertices,I),e.icon.placedSymbolArray.get(o.placedIconSymbolIndex).hidden=m.icon.isHidden()}if(o.verticalPlacedIconSymbolIndex>=0){var B=M?Se:P;d(e.icon,o.numVerticalIconVertices,B),e.icon.placedSymbolArray.get(o.verticalPlacedIconSymbolIndex).hidden=m.icon.isHidden()}}if(e.hasIconCollisionBoxData()||e.hasIconCollisionCircleData()||e.hasTextCollisionBoxData()||e.hasTextCollisionCircleData()){var R=e.collisionArrays[r];if(R){var k=new t.Point(0,0);if(R.textBox||R.verticalTextBox){var L=!0;if(c){var D=i.variableOffsets[A];D?(k=de(D.anchor,D.width,D.height,D.textOffset,D.textBoxScale),l&&k._rotate(h?i.transform.angle:-i.transform.angle)):L=!1}R.textBox&&me(e.textCollisionBox.collisionVertexArray,m.text.placed,!L||b,k.x,k.y),R.verticalTextBox&&me(e.textCollisionBox.collisionVertexArray,m.text.placed,!L||x,k.x,k.y)}var j=Boolean(!x&&R.verticalIconBox);R.iconBox&&me(e.iconCollisionBox.collisionVertexArray,m.icon.placed,j,f?k.x:0,f?k.y:0),R.verticalIconBox&&me(e.iconCollisionBox.collisionVertexArray,m.icon.placed,!j,f?k.x:0,f?k.y:0);var F=R.textCircles;if(F&&e.hasTextCollisionCircleData())for(var z=0;z<F.length;z+=5){var U=g||0===F[z+4];me(e.textCollisionCircle.collisionVertexArray,m.text.placed,U)}}}},g=0;g<e.symbolInstances.length;g++)A(g);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.hasIconCollisionCircleData()&&e.iconCollisionCircle.collisionVertexBuffer&&e.iconCollisionCircle.collisionVertexBuffer.updateData(e.iconCollisionCircle.collisionVertexArray),e.hasTextCollisionCircleData()&&e.textCollisionCircle.collisionVertexBuffer&&e.textCollisionCircle.collisionVertexBuffer.updateData(e.textCollisionCircle.collisionVertexArray)},ge.prototype.symbolFadeChange=function(t){return 0===this.fadeDuration?1:(t-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment},ge.prototype.zoomAdjustment=function(t){return Math.max(0,(this.transform.zoom-t)/1.5)},ge.prototype.hasTransitions=function(t){return this.stale||t-this.lastPlacementChangeTime<this.fadeDuration},ge.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},ge.prototype.setStale=function(){this.stale=!0};var ye=Math.pow(2,25),ve=Math.pow(2,24),_e=Math.pow(2,17),be=Math.pow(2,16),xe=Math.pow(2,9),we=Math.pow(2,8),Ee=Math.pow(2,1);function Oe(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*ye+e*ve+n*_e+e*be+n*xe+e*we+n*Ee+e}var Se=0,Te=function(){this._currentTileIndex=0,this._seenCrossTileIDs={}};Te.prototype.continuePlacement=function(t,e,n,r,i){for(;this._currentTileIndex<t.length;){var o=t[this._currentTileIndex];if(e.placeLayerTile(r,o,n,this._seenCrossTileIDs),this._currentTileIndex++,i())return!0}};var Ce=function(t,e,n,r,i,o,a){this.placement=new ge(t,i,o,a),this._currentPlacementIndex=e.length-1,this._forceFullPlacement=n,this._showCollisionBoxes=r,this._done=!1};Ce.prototype.isDone=function(){return this._done},Ce.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 Te),this._inProgressLayer.continuePlacement(r[s.source],this.placement,this._showCollisionBoxes,s,a))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},Ce.prototype.commit=function(t){return this.placement.commit(t),this.placement};var Pe=512/t.EXTENT/2,Me=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)})}};Me.prototype.getScaledCoordinates=function(e,n){var r=n.canonical.z-this.tileID.canonical.z,i=Pe/Math.pow(2,r);return{x:Math.floor((n.canonical.x*t.EXTENT+e.anchorX)*i),y:Math.floor((n.canonical.y*t.EXTENT+e.anchorY)*i)}},Me.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,c=a;u<c.length;u+=1){var l=c[u];if(Math.abs(l.coord.x-s.x)<=r&&Math.abs(l.coord.y-s.y)<=r&&!n[l.crossTileID]){n[l.crossTileID]=!0,o.crossTileID=l.crossTileID;break}}}}};var Ie=function(){this.maxCrossTileID=0};Ie.prototype.generate=function(){return++this.maxCrossTileID};var Be=function(){this.indexes={},this.usedCrossTileIDs={},this.lng=0};Be.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},Be.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 c=a[t.scaledTo(Number(o)).key];c&&c.findMatches(e.symbolInstances,t,i)}}for(var l=0;l<e.symbolInstances.length;l++){var h=e.symbolInstances.get(l);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 Me(t,e.symbolInstances,e.bucketInstanceId),!0},Be.prototype.removeBucketCrossTileIDs=function(t,e){for(var n in e.indexedSymbolInstances)for(var r=0,i=e.indexedSymbolInstances[n];r<i.length;r+=1){var o=i[r];delete this.usedCrossTileIDs[t][o.crossTileID]}},Be.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 Ie,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 Be);var i=!1,o={};r.handleWrapJump(n);for(var a=0,s=e;a<s.length;a+=1){var u=s[a],c=u.getBucket(t);c&&t.id===c.layerIds[0]&&(c.bucketInstanceId||(c.bucketInstanceId=++this.maxBucketInstanceId),r.addBucket(u.tileID,c,this.crossTileIDs)&&(i=!0),o[c.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 ke=function(e,n){return t.emitValidationErrors(e,n&&n.filter((function(t){return"source.canvas"!==t.identifier})))},Le=t.pick(Ft,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),De=t.pick(Ft,["setCenter","setZoom","setBearing","setPitch"]),je=function(e){function n(r,i){var o=this;void 0===i&&(i={}),e.call(this),this.map=r,this.dispatcher=new E((kt||(kt=new Rt),kt),this),this.imageManager=new f,this.imageManager.setEventedParent(this),this.glyphManager=new v(r._requestManager,i.localIdeographFontFamily),this.lineAtlas=new w(256,512),this.crossTileSymbolIndex=new Re,this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new t.ZoomHistory,this._loaded=!1,this._resetUpdates(),this.dispatcher.broadcast("setReferrer",t.getReferrer());var a=this;this._rtlTextPluginCallback=n.registerForPluginStateChange((function(e){var n={pluginStatus:e.pluginStatus,pluginURL:e.pluginURL};a.dispatcher.broadcast("syncRTLPluginState",n,(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),n.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._load=function(e,n){var r=this;if(!n||!ke(this,t.validateStyle(e))){for(var i in this._loaded=!0,this.stylesheet=e,e.sources)this.addSource(i,e.sources[i],{validate:!1});e.sprite?this._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,l())})),c=t.getImage(n.transformRequest(n.normalizeSpriteURL(e,s,".png"),t.ResourceType.SpriteImage),(function(t,e){c=null,a||(a=t,o=e,l())}));function l(){if(a)r(a);else if(i&&o){var e=t.browser.getImageData(o),n={};for(var s in i){var u=i[s],c=u.width,l=u.height,h=u.x,f=u.y,p=u.sdf,d=u.pixelRatio,A=u.stretchX,g=u.stretchY,m=u.content,y=new t.RGBAImage({width:c,height:l});t.RGBAImage.copy(e,y,{x:h,y:f},{x:0,y:0},{width:c,height:l}),n[s]={data:y,pixelRatio:d,sdf:p,stretchX:A,stretchY:g,content:m}}r(null,n)}}return{cancel:function(){u&&(u.cancel(),u=null),c&&(c.cancel(),c=null)}}}(e.sprite,this.map._requestManager,(function(e,n){if(r._spriteRequest=null,e)r.fire(new t.ErrorEvent(e));else if(n)for(var i in n)r.imageManager.addImage(i,n[i]);r.imageManager.setLoaded(!0),r.dispatcher.broadcast("setImages",r.imageManager.listImages()),r.fire(new t.Event("data",{dataType:"style"}))})):this.imageManager.setLoaded(!0),this.glyphManager.setURL(e.glyphs);var o=jt(this.stylesheet.layers);this._order=o.map((function(t){return t.id})),this._layers={};for(var a=0,s=o;a<s.length;a+=1){var u=s[a];(u=t.createStyleLayer(u)).setEventedParent(this,{layer:{id:u.id}}),this._layers[u.id]=u}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._validateLayer=function(e){var n=this.sourceCaches[e.source];if(n){var r=e.sourceLayer;if(r){var i=n.getSource();("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=r[n],o=this._layers[i];"custom"!==o.type&&e.push(o.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()}for(var u in this.sourceCaches)this.sourceCaches[u].used=!1;for(var c=0,l=this._order;c<l.length;c+=1){var h=l[c],f=this._layers[h];f.recalculate(e,this.imageManager.listImages()),!f.isHidden(e.zoom)&&f.source&&(this.sourceCaches[f.source].used=!0)}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(),ke(this,t.validateStyle(e)))return!1;(e=t.clone$1(e)).layers=jt(e.layers);var r=function(e,n){if(!e)return[{command:Ft.setStyle,args:[n]}];var r=[];try{if(!t.deepEqual(e.version,n.version))return[{command:Ft.setStyle,args:[n]}];t.deepEqual(e.center,n.center)||r.push({command:Ft.setCenter,args:[n.center]}),t.deepEqual(e.zoom,n.zoom)||r.push({command:Ft.setZoom,args:[n.zoom]}),t.deepEqual(e.bearing,n.bearing)||r.push({command:Ft.setBearing,args:[n.bearing]}),t.deepEqual(e.pitch,n.pitch)||r.push({command:Ft.setPitch,args:[n.pitch]}),t.deepEqual(e.sprite,n.sprite)||r.push({command:Ft.setSprite,args:[n.sprite]}),t.deepEqual(e.glyphs,n.glyphs)||r.push({command:Ft.setGlyphs,args:[n.glyphs]}),t.deepEqual(e.transition,n.transition)||r.push({command:Ft.setTransition,args:[n.transition]}),t.deepEqual(e.light,n.light)||r.push({command:Ft.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)||Ut(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&&Gt(e,n,o)?r.push({command:Ft.setGeoJSONSourceData,args:[o,n[o].data]}):Nt(o,n,r,i)):zt(o,n,r))}(e.sources,n.sources,o,i);var a=[];e.layers&&e.layers.forEach((function(t){i[t.source]?r.push({command:Ft.removeLayer,args:[t.id]}):a.push(t)})),r=r.concat(o),function(e,n,r){n=n||[];var i,o,a,s,u,c,l,h=(e=e||[]).map(Ht),f=n.map(Ht),p=e.reduce(Wt,{}),d=n.reduce(Wt,{}),A=h.slice(),g=Object.create(null);for(i=0,o=0;i<h.length;i++)a=h[i],d.hasOwnProperty(a)?o++:(r.push({command:Ft.removeLayer,args:[a]}),A.splice(A.indexOf(a,o),1));for(i=0,o=0;i<f.length;i++)a=f[f.length-1-i],A[A.length-1-i]!==a&&(p.hasOwnProperty(a)?(r.push({command:Ft.removeLayer,args:[a]}),A.splice(A.lastIndexOf(a,A.length-o),1)):o++,c=A[A.length-i],r.push({command:Ft.addLayer,args:[d[a],c]}),A.splice(A.length-i,0,a),g[a]=!0);for(i=0;i<f.length;i++)if(s=p[a=f[i]],u=d[a],!g[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(l in Vt(s.layout,u.layout,r,a,null,Ft.setLayoutProperty),Vt(s.paint,u.paint,r,a,null,Ft.setPaintProperty),t.deepEqual(s.filter,u.filter)||r.push({command:Ft.setFilter,args:[a,u.filter]}),t.deepEqual(s.minzoom,u.minzoom)&&t.deepEqual(s.maxzoom,u.maxzoom)||r.push({command:Ft.setLayerZoomRange,args:[a,u.minzoom,u.maxzoom]}),s)s.hasOwnProperty(l)&&"layout"!==l&&"paint"!==l&&"filter"!==l&&"metadata"!==l&&"minzoom"!==l&&"maxzoom"!==l&&(0===l.indexOf("paint.")?Vt(s[l],u[l],r,a,l.slice(6),Ft.setPaintProperty):t.deepEqual(s[l],u[l])||r.push({command:Ft.setLayerProperty,args:[a,l,u[l]]}));for(l in u)u.hasOwnProperty(l)&&!s.hasOwnProperty(l)&&"layout"!==l&&"paint"!==l&&"filter"!==l&&"metadata"!==l&&"minzoom"!==l&&"maxzoom"!==l&&(0===l.indexOf("paint.")?Vt(s[l],u[l],r,a,l.slice(6),Ft.setPaintProperty):t.deepEqual(s[l],u[l])||r.push({command:Ft.setLayerProperty,args:[a,l,u[l]]}))}else r.push({command:Ft.removeLayer,args:[a]}),c=A[A.lastIndexOf(a)+1],r.push({command:Ft.addLayer,args:[u,c]})}(a,n.layers,r)}catch(t){console.warn("Unable to compute style diff:",t),r=[{command:Ft.setStyle,args:[n]}]}return r}(this.serialize(),e).filter((function(t){return!(t.command in De)}));if(0===r.length)return!1;var i=r.filter((function(t){return!(t.command in Le)}));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._changedImages[e]=!0,this._changed=!0,this.fire(new t.Event("data",{dataType:"style"}))},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._changedImages[e]=!0,this._changed=!0,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 the 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 Pt(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 id "'+i+'" already exists on this map')));else{var o;if("custom"===e.type){if(ke(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}})}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;n&&-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._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.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],a=parseInt(e.id,10);if(void 0!==o){var s=o.getSource().type;"geojson"===s&&i?this.fire(new t.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==s||i?isNaN(a)||a<0?this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided and non-negative."))):o.setFeatureState(i,a,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,s=parseInt(e.id,10);"vector"!==o||a?void 0!==e.id&&isNaN(s)||s<0?this.fire(new t.ErrorEvent(new Error("The feature id parameter must be non-negative."))):n&&"string"!=typeof e.id&&"number"!=typeof e.id?this.fire(new t.ErrorEvent(new Error("A feature id is requred to remove its specific state property."))):i.removeFeatureState(a,s,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],o=parseInt(e.id,10);if(void 0!==i)if("vector"!==i.getSource().type||r){if(!(isNaN(o)||o<0))return i.getFeatureState(r,o);this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided and non-negative.")))}else 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 c=u[s][a];if(c)for(var l=0,h=c;l<h.length;l+=1){var f=h[l];i.push(f)}}}}i.sort((function(t,e){return e.intersectionZ-t.intersectionZ}));for(var p=[],d=this._order.length-1;d>=0;d--){var A=this._order[d];if(n(A))for(var g=i.length-1;g>=0;g--){var m=i[g].feature;if(r[m.layer.id]<d)break;p.push(m),i.pop()}else for(var y=0,v=t;y<v.length;y+=1){var _=v[y][A];if(_)for(var b=0,x=_;b<x.length;b+=1){var w=x[b];p.push(w.feature)}}}return p},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 c=[];for(var l in this.sourceCaches)n.layers&&!i[l]||c.push(D(this.sourceCaches[l],this._layers,e,n,r));return this.placement&&c.push(function(t,e,n,r,i,o){for(var a={},s=i.queryRenderedSymbols(n),u=[],c=0,l=Object.keys(s).map(Number);c<l.length;c+=1){var h=l[c];u.push(o[h])}u.sort(j);for(var f=function(){var e=d[p],n=e.featureIndex.lookupSymbolFeatures(s[e.bucketInstanceId],e.bucketIndex,e.sourceLayerIndex,r.filter,r.layers,t);for(var i in n){var o=a[i]=a[i]||[],u=n[i];u.sort((function(t,n){var r=e.featureSortOrder;if(r){var i=r.indexOf(t.featureIndex);return r.indexOf(n.featureIndex)-i}return n.featureIndex-t.featureIndex}));for(var c=0,l=u;c<l.length;c+=1){var h=l[c];o.push(h)}}},p=0,d=u;p<d.length;p+=1)f();var A=function(n){a[n].forEach((function(r){var i=r.feature,o=t[n],a=e[o.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=a}))};for(var g in a)A(g);return a}(this._layers,this.sourceCaches,e,n,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(c)},n.prototype.querySourceFeatures=function(e,n){n&&n.filter&&this._validate(t.validateStyle.filter,"querySourceFeatures.filter",n.filter,null,n);var 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)&&ke(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){for(var o=!1,a=!1,s={},u=0,c=this._order;u<c.length;u+=1){var l=c[u],h=this._layers[l];if("symbol"===h.type){if(!s[h.source]){var f=this.sourceCaches[h.source];s[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,s[h.source],e.center.lng);o=o||p}}this.crossTileSymbolIndex.pruneUnusedLayers(this._order);var d=this._layerOrderChanged||0===r;if((d||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(t.browser.now(),e.zoom))&&(this.pauseablePlacement=new Ce(e,this._order,d,n,r,i,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,s),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(t.browser.now()),a=!0),o&&this.pauseablePlacement.placement.setStale()),a||o)for(var A=0,g=this._order;A<g.length;A+=1){var m=g[A],y=this._layers[m];"symbol"===y.type&&this.placement.updateLayerOpacities(y,s[y.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 k[t]},je.setSourceType=function(t,e){k[t]=e},je.registerForPluginStateChange=t.registerForPluginStateChange;var Fe=t.createLayout([{name:"a_pos",type:"Int16",components:2}]),ze=fn("#ifdef GL_ES\nprecision mediump float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif","#ifdef GL_ES\nprecision highp float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}"),Ue=fn("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);}"),Ne=fn("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);}"),Ge=fn("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);}"),Ve=fn("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);}"),He=fn("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;}"),We=fn("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;}"),qe=fn("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;}"),Xe=fn("uniform float u_overscale_factor;varying float v_placed;varying float v_notUsed;varying float v_radius;varying vec2 v_extrude;varying vec2 v_extrude_scale;void main() {float alpha=0.5;vec4 color=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {color=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {color*=.2;}float extrude_scale_length=length(v_extrude_scale);float extrude_length=length(v_extrude)*extrude_scale_length;float stroke_width=15.0*extrude_scale_length/u_overscale_factor;float radius=v_radius*extrude_scale_length;float distance_to_edge=abs(extrude_length-radius);float opacity_t=smoothstep(-stroke_width,0.0,-distance_to_edge);gl_FragColor=opacity_t*color;}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;varying float v_radius;varying vec2 v_extrude;varying vec2 v_extrude_scale;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);highp float padding_factor=1.2;gl_Position.xy+=a_extrude*u_extrude_scale*padding_factor*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;v_radius=abs(a_extrude.y);v_extrude=a_extrude*padding_factor;v_extrude_scale=u_extrude_scale*u_camera_to_center_distance*collision_perspective_ratio;}"),Je=fn("uniform highp vec4 u_color;void main() {gl_FragColor=u_color;}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),Ze=fn("#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);}"),Qe=fn("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;}"),Ke=fn("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 vec4 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\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;float pixelRatio=u_scale.x;float tileRatio=u_scale.y;float fromScale=u_scale.z;float toScale=u_scale.w;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=vec2((pattern_br_a.x-pattern_tl_a.x)/pixelRatio,(pattern_br_a.y-pattern_tl_a.y)/pixelRatio);vec2 display_size_b=vec2((pattern_br_b.x-pattern_tl_b.x)/pixelRatio,(pattern_br_b.y-pattern_tl_b.y)/pixelRatio);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;}"),Ye=fn("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 vec4 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\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;float pixelRatio=u_scale.x;float tileZoomRatio=u_scale.y;float fromScale=u_scale.z;float toScale=u_scale.w;vec2 display_size_a=vec2((pattern_br_a.x-pattern_tl_a.x)/pixelRatio,(pattern_br_a.y-pattern_tl_a.y)/pixelRatio);vec2 display_size_b=vec2((pattern_br_b.x-pattern_tl_b.x)/pixelRatio,(pattern_br_b.y-pattern_tl_b.y)/pixelRatio);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);}"),$e=fn("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}"),tn=fn("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\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\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 vec4 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\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\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 pixelRatio=u_scale.x;float tileRatio=u_scale.y;float fromScale=u_scale.z;float toScale=u_scale.w;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=vec2((pattern_br_a.x-pattern_tl_a.x)/pixelRatio,(pattern_br_a.y-pattern_tl_a.y)/pixelRatio);vec2 display_size_b=vec2((pattern_br_b.x-pattern_tl_b.x)/pixelRatio,(pattern_br_b.y-pattern_tl_b.y)/pixelRatio);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;}"),en=fn("#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 float u_maxzoom;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 exaggeration=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/ pow(2.0,(u_zoom-u_maxzoom)*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;}"),nn=fn("uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;\n#define PI 3.141592653589793\nvoid main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),rn=fn("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);}"),on=fn("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 float v_lineprogress;\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,vec2(v_lineprogress,0.5));gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define MAX_LINE_DISTANCE 32767.0\n#define scale 0.015873016\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_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_lineprogress;\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;v_lineprogress=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0/MAX_LINE_DISTANCE;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);}"),an=fn("uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec4 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_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 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 pixelRatio=u_scale.x;float tileZoomRatio=u_scale.y;float fromScale=u_scale.z;float toScale=u_scale.w;vec2 display_size_a=vec2((pattern_br_a.x-pattern_tl_a.x)/pixelRatio,(pattern_br_a.y-pattern_tl_a.y)/pixelRatio);vec2 display_size_b=vec2((pattern_br_b.x-pattern_tl_b.x)/pixelRatio,(pattern_br_b.y-pattern_tl_b.y)/pixelRatio);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 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,1.0);float x_b=mod(v_linesofar/pattern_size_b.x,1.0);float y_a=0.5+(v_normal.y*clamp(v_width2.s,0.0,(pattern_size_a.y+2.0)/2.0)/pattern_size_a.y);float y_b=0.5+(v_normal.y*clamp(v_width2.s,0.0,(pattern_size_b.y+2.0)/2.0)/pattern_size_b.y);vec2 pos_a=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,vec2(x_a,y_a));vec2 pos_b=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,vec2(x_b,y_b));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;\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 vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_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 mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_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);}"),sn=fn("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}"),un=fn("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;}"),cn=fn("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));}"),ln=fn("#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);}"),hn=fn("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}");function fn(t,e){var n=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,r={};return{fragmentSource:t=t.replace(n,(function(t,e,n,i,o){return r[o]=!0,"define"===e?"\n#ifndef HAS_UNIFORM_u_"+o+"\nvarying "+n+" "+i+" "+o+";\n#else\nuniform "+n+" "+i+" u_"+o+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+o+"\n "+n+" "+i+" "+o+" = u_"+o+";\n#endif\n"})),vertexSource:e=e.replace(n,(function(t,e,n,i,o){var a="float"===i?"vec2":"vec4",s=o.match(/color/)?"color":a;return r[o]?"define"===e?"\n#ifndef HAS_UNIFORM_u_"+o+"\nuniform lowp float u_"+o+"_t;\nattribute "+n+" "+a+" a_"+o+";\nvarying "+n+" "+i+" "+o+";\n#else\nuniform "+n+" "+i+" u_"+o+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+o+"\n "+o+" = a_"+o+";\n#else\n "+n+" "+i+" "+o+" = u_"+o+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+o+"\n "+o+" = unpack_mix_"+s+"(a_"+o+", u_"+o+"_t);\n#else\n "+n+" "+i+" "+o+" = u_"+o+";\n#endif\n":"define"===e?"\n#ifndef HAS_UNIFORM_u_"+o+"\nuniform lowp float u_"+o+"_t;\nattribute "+n+" "+a+" a_"+o+";\n#else\nuniform "+n+" "+i+" u_"+o+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+o+"\n "+n+" "+i+" "+o+" = a_"+o+";\n#else\n "+n+" "+i+" "+o+" = u_"+o+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+o+"\n "+n+" "+i+" "+o+" = unpack_mix_"+s+"(a_"+o+", u_"+o+"_t);\n#else\n "+n+" "+i+" "+o+" = u_"+o+";\n#endif\n"}))}}var pn=Object.freeze({__proto__:null,prelude:ze,background:Ue,backgroundPattern:Ne,circle:Ge,clippingMask:Ve,heatmap:He,heatmapTexture:We,collisionBox:qe,collisionCircle:Xe,debug:Je,fill:Ze,fillOutline:Qe,fillOutlinePattern:Ke,fillPattern:Ye,fillExtrusion:$e,fillExtrusionPattern:tn,hillshadePrepare:en,hillshade:nn,line:rn,lineGradient:on,linePattern:an,lineSDF:sn,raster:un,symbolIcon:cn,symbolSDF:ln,symbolTextAndIcon:hn}),dn=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};dn.prototype.bind=function(t,e,n,r,i,o,a,s){this.context=t;for(var u=this.boundPaintVertexBuffers.length!==r.length,c=0;!u&&c<r.length;c++)this.boundPaintVertexBuffers[c]!==r[c]&&(u=!0);var l=!this.vao||this.boundProgram!==e||this.boundLayoutVertexBuffer!==n||u||this.boundIndexBuffer!==i||this.boundVertexOffset!==o||this.boundDynamicVertexBuffer!==a||this.boundDynamicVertexBuffer2!==s;!t.extVertexArrayObject||l?this.freshBind(e,n,r,i,o,a,s):(t.bindVertexArrayOES.set(this.vao),a&&a.bind(),i&&i.dynamicDraw&&i.bind(),s&&s.bind())},dn.prototype.freshBind=function(t,e,n,r,i,o,a){var s,u=t.numAttributes,c=this.context,l=c.gl;if(c.extVertexArrayObject)this.vao&&this.destroy(),this.vao=c.extVertexArrayObject.createVertexArrayOES(),c.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=c.currentNumAttributes||0;for(var h=u;h<s;h++)l.disableVertexAttribArray(h)}e.enableAttributes(l,t);for(var f=0,p=n;f<p.length;f+=1)p[f].enableAttributes(l,t);o&&o.enableAttributes(l,t),a&&a.enableAttributes(l,t),e.bind(),e.setVertexAttribPointers(l,t,i);for(var d=0,A=n;d<A.length;d+=1){var g=A[d];g.bind(),g.setVertexAttribPointers(l,t,i)}o&&(o.bind(),o.setVertexAttribPointers(l,t,i)),r&&r.bind(),a&&(a.bind(),a.setVertexAttribPointers(l,t,i)),c.currentNumAttributes=u},dn.prototype.destroy=function(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)};var An=function(t,e,n,r,i){var o=t.gl;this.program=o.createProgram();var a=n.defines();i&&a.push("#define OVERDRAW_INSPECTOR;");var s=a.concat(ze.fragmentSource,e.fragmentSource).join("\n"),u=a.concat(ze.vertexSource,e.vertexSource).join("\n"),c=o.createShader(o.FRAGMENT_SHADER);if(o.isContextLost())this.failedToCreate=!0;else{o.shaderSource(c,s),o.compileShader(c),o.attachShader(this.program,c);var l=o.createShader(o.VERTEX_SHADER);if(o.isContextLost())this.failedToCreate=!0;else{o.shaderSource(l,u),o.compileShader(l),o.attachShader(this.program,l);for(var h=n.layoutAttributes||[],f=0;f<h.length;f++)o.bindAttribLocation(this.program,f,h[f].name);o.linkProgram(this.program),this.numAttributes=o.getProgramParameter(this.program,o.ACTIVE_ATTRIBUTES),this.attributes={};for(var p={},d=0;d<this.numAttributes;d++){var A=o.getActiveAttrib(this.program,d);A&&(this.attributes[A.name]=o.getAttribLocation(this.program,A.name))}for(var g=o.getProgramParameter(this.program,o.ACTIVE_UNIFORMS),m=0;m<g;m++){var y=o.getActiveUniform(this.program,m);y&&(p[y.name]=o.getUniformLocation(this.program,y.name))}this.fixedUniforms=r(t,p),this.binderUniforms=n.getUniforms(t,p)}}};function gn(e,n,r){var i=1/ue(r,1,n.transform.tileZoom),o=Math.pow(2,r.tileID.overscaledZ),a=r.tileSize*Math.pow(2,n.transform.tileZoom)/o,s=a*(r.tileID.canonical.x+r.tileID.wrap*o),u=a*r.tileID.canonical.y;return{u_image:0,u_texsize:r.imageAtlasTexture.size,u_scale:[t.browser.devicePixelRatio,i,e.fromScale,e.toScale],u_fade:e.t,u_pixel_coord_upper:[s>>16,u>>16],u_pixel_coord_lower:[65535&s,65535&u]}}An.prototype.draw=function(t,e,n,r,i,o,a,s,u,c,l,h,f,p,d,A){var g,m=t.gl;if(!this.failedToCreate){for(var y in t.program.set(this.program),t.setDepthMode(n),t.setStencilMode(r),t.setColorMode(i),t.setCullFace(o),this.fixedUniforms)this.fixedUniforms[y].set(a[y]);p&&p.setUniforms(t,this.binderUniforms,h,{zoom:f});for(var v=(g={},g[m.LINES]=2,g[m.TRIANGLES]=3,g[m.LINE_STRIP]=1,g)[e],_=0,b=l.get();_<b.length;_+=1){var x=b[_],w=x.vaos||(x.vaos={});(w[s]||(w[s]=new dn)).bind(t,this,u,p?p.getPaintVertexBuffers():[],c,x.vertexOffset,d,A),m.drawElements(e,x.primitiveLength*v,m.UNSIGNED_SHORT,x.primitiveOffset*v*2)}}};var mn=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 c=o.properties.get("color");return{u_matrix:e,u_lightpos:s,u_lightintensity:o.properties.get("intensity"),u_lightcolor:[c.r,c.g,c.b],u_vertical_gradient:+r,u_opacity:i}},yn=function(e,n,r,i,o,a,s){return t.extend(mn(e,n,r,i),gn(a,n,s),{u_height_factor:-Math.pow(2,o.overscaledZ)/s.tileSize/8})},vn=function(t){return{u_matrix:t}},_n=function(e,n,r,i){return t.extend(vn(e),gn(r,n,i))},bn=function(t,e){return{u_matrix:t,u_world:e}},xn=function(e,n,r,i,o){return t.extend(_n(e,n,r,i),{u_world:o})},wn=function(e,n,r,i){var o,a,s=e.transform;if("map"===i.paint.get("circle-pitch-alignment")){var u=ue(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}},En=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)}},On=function(t,e,n){var r=ue(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}},Sn=function(t,e){return{u_matrix:t,u_color:e}},Tn=function(t){return{u_matrix:t}},Cn=function(t,e,n,r){return{u_matrix:t,u_extrude_scale:ue(e,1,n),u_intensity:r}};function Pn(e,n){var r=Math.pow(2,n.canonical.z),i=n.canonical.y;return[new t.MercatorCoordinate(0,i/r).toLngLat().lat,new t.MercatorCoordinate(0,(i+1)/r).toLngLat().lat]}var Mn=function(e,n,r){var i=e.transform;return{u_matrix:Ln(e,n,r),u_ratio:1/ue(n,1,i.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_units_to_pixels:[1/i.pixelsToGLUnits[0],1/i.pixelsToGLUnits[1]]}},In=function(e,n,r){return t.extend(Mn(e,n,r),{u_image:0})},Bn=function(e,n,r,i){var o=e.transform,a=kn(n,o);return{u_matrix:Ln(e,n,r),u_texsize:n.imageAtlasTexture.size,u_ratio:1/ue(n,1,o.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_image:0,u_scale:[t.browser.devicePixelRatio,a,i.fromScale,i.toScale],u_fade:i.t,u_units_to_pixels:[1/o.pixelsToGLUnits[0],1/o.pixelsToGLUnits[1]]}},Rn=function(e,n,r,i,o){var a=e.transform,s=e.lineAtlas,u=kn(n,a),c="round"===r.layout.get("line-cap"),l=s.getDash(i.from,c),h=s.getDash(i.to,c),f=l.width*o.fromScale,p=h.width*o.toScale;return t.extend(Mn(e,n,r),{u_patternscale_a:[u/f,-l.height/2],u_patternscale_b:[u/p,-h.height/2],u_sdfgamma:s.width/(256*Math.min(f,p)*t.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:l.y,u_tex_y_b:h.y,u_mix:o.t})};function kn(t,e){return 1/ue(t,1,e.tileZoom)}function Ln(t,e,n){return t.translatePosMatrix(e.tileID.posMatrix,e,n.paint.get("line-translate"),n.paint.get("line-translate-anchor"))}var Dn=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 Fn=function(t,e,n,r,i,o,a,s,u,c){var l=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:l.cameraToCenterDistance,u_pitch:l.pitch/360*2*Math.PI,u_rotate_symbol:+n,u_aspect_ratio:l.width/l.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:c,u_texture:0}},zn=function(e,n,r,i,o,a,s,u,c,l,h){var f=o.transform;return t.extend(Fn(e,n,r,i,o,a,s,u,c,l),{u_gamma_scale:i?Math.cos(f._pitch)*f.cameraToCenterDistance:1,u_device_pixel_ratio:t.browser.devicePixelRatio,u_is_halo:+h})},Un=function(e,n,r,i,o,a,s,u,c,l){return t.extend(zn(e,n,r,i,o,a,s,u,!0,c,!0),{u_texsize_icon:l,u_texture_icon:1})},Nn=function(t,e,n){return{u_matrix:t,u_opacity:e,u_color:n}},Gn=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,c=Math.pow(2,r.tileID.overscaledZ),l=r.tileSize*Math.pow(2,n.transform.tileZoom)/c,h=l*(r.tileID.canonical.x+r.tileID.wrap*c),f=l*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/ue(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})},Vn={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.Uniform4f(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.Uniform4f(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.Uniform4f(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:En,collisionCircle:En,debug:function(e,n){return{u_color:new t.UniformColor(e,n.u_color),u_matrix:new t.UniformMatrix4f(e,n.u_matrix)}},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_maxzoom:new t.Uniform1f(e,n.u_maxzoom),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)}},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.Uniform4f(e,n.u_scale),u_fade:new t.Uniform1f(e,n.u_fade)}},lineSDF:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_ratio:new t.Uniform1f(e,n.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,n.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,n.u_units_to_pixels),u_patternscale_a:new t.Uniform2f(e,n.u_patternscale_a),u_patternscale_b:new t.Uniform2f(e,n.u_patternscale_b),u_sdfgamma:new t.Uniform1f(e,n.u_sdfgamma),u_image:new t.Uniform1i(e,n.u_image),u_tex_y_a:new t.Uniform1f(e,n.u_tex_y_a),u_tex_y_b:new t.Uniform1f(e,n.u_tex_y_b),u_mix:new t.Uniform1f(e,n.u_mix)}},raster:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_tl_parent:new t.Uniform2f(e,n.u_tl_parent),u_scale_parent:new t.Uniform1f(e,n.u_scale_parent),u_buffer_scale:new t.Uniform1f(e,n.u_buffer_scale),u_fade_t:new t.Uniform1f(e,n.u_fade_t),u_opacity:new t.Uniform1f(e,n.u_opacity),u_image0:new t.Uniform1i(e,n.u_image0),u_image1:new t.Uniform1i(e,n.u_image1),u_brightness_low:new t.Uniform1f(e,n.u_brightness_low),u_brightness_high:new t.Uniform1f(e,n.u_brightness_high),u_saturation_factor:new t.Uniform1f(e,n.u_saturation_factor),u_contrast_factor:new t.Uniform1f(e,n.u_contrast_factor),u_spin_weights:new t.Uniform3f(e,n.u_spin_weights)}},symbolIcon:function(e,n){return{u_is_size_zoom_constant:new t.Uniform1i(e,n.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,n.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,n.u_size_t),u_size:new t.Uniform1f(e,n.u_size),u_camera_to_center_distance:new t.Uniform1f(e,n.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,n.u_pitch),u_rotate_symbol:new t.Uniform1i(e,n.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,n.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,n.u_fade_change),u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,n.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,n.u_coord_matrix),u_is_text:new t.Uniform1f(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.Uniform1f(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.Uniform1f(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.Uniform1f(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.Uniform1f(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 Hn(e,n){for(var r=e.sort((function(t,e){return t.tileID.isLessThan(e.tileID)?-1:e.tileID.isLessThan(t.tileID)?1:0})),i=0;i<r.length;i++){var o={},a=r[i],s=r.slice(i+1);Wn(a.tileID.wrapped(),a.tileID,s,new t.OverscaledTileID(0,a.tileID.wrap+1,0,0,0),o),a.setMask(o,n)}}function Wn(e,n,r,i,o){for(var a=0;a<r.length;a++){var s=r[a];if(i.isLessThan(s.tileID))break;if(n.key===s.tileID.key)return;if(s.tileID.isChildOf(n)){for(var u=n.children(1/0),c=0;c<u.length;c++)Wn(e,u[c],r.slice(a),i,o);return}}var l=n.overscaledZ-e.overscaledZ,h=new t.CanonicalTileID(l,n.canonical.x-(e.canonical.x<<l),n.canonical.y-(e.canonical.y<<l));o[h.key]=o[h.key]||h}function qn(t,e,n,r,i,o,a,s){for(var u=t.context,c=u.gl,l=i?t.useProgram("collisionCircle"):t.useProgram("collisionBox"),h=0;h<r.length;h++){var f=r[h],p=e.getTile(f),d=p.getBucket(n);if(d){var A=i?s?d.textCollisionCircle:d.iconCollisionCircle:s?d.textCollisionBox:d.iconCollisionBox;if(A){var g=f.posMatrix;0===o[0]&&0===o[1]||(g=t.translatePosMatrix(f.posMatrix,p,o,a)),l.draw(u,i?c.TRIANGLES:c.LINES,Et.disabled,Ot.disabled,t.colorModeForRenderPass(),Tt.disabled,On(g,t.transform,p),n.id,A.layoutVertexBuffer,A.indexBuffer,A.segments,null,t.transform.zoom,null,null,A.collisionVertexBuffer)}}}}function Xn(t,e,n,r,i,o,a){qn(t,e,n,r,!1,i,o,a),qn(t,e,n,r,!0,i,o,a)}var Jn=t.identity(new Float32Array(16));function Zn(e,n,r,i,o,a){var s=t.getAnchorAlignment(e),u=-(s.horizontalAlign-.5)*n,c=-(s.verticalAlign-.5)*r,l=t.evaluateVariableOffset(e,i);return new t.Point((u/o+l[0])*a,(c/o+l[1])*a)}function Qn(e,n,r,i,o,a,s,u,c,l,h){var f=e.text.placedSymbolArray,p=e.text.dynamicLayoutVertexArray,d=e.icon.dynamicLayoutVertexArray,A={};p.clear();for(var g=0;g<f.length;g++){var m=f.get(g),y=e.allowVerticalPlacement&&!m.placedOrientation,v=m.hidden||!m.crossTileID||y?null:i[m.crossTileID];if(v){var _=new t.Point(m.anchorX,m.anchorY),b=Zt(_,r?u:s),x=.5+a.cameraToCenterDistance/b.signedDistanceFromCamera*.5,w=o.evaluateSizeForFeature(e.textSizeData,l,m)*x/t.ONE_EM;r&&(w*=e.tilePixelRatio/c);for(var E=v.width,O=v.height,S=Zn(v.anchor,E,O,v.textOffset,v.textBoxScale,w),T=r?Zt(_.add(S),s).point:b.point.add(n?S.rotate(-a.angle):S),C=e.allowVerticalPlacement&&m.placedOrientation===t.WritingMode.vertical?Math.PI/2:0,P=0;P<m.numGlyphs;P++)t.addDynamicAttributes(p,T,C);h&&m.associatedIconIndex>=0&&(A[m.associatedIconIndex]={shiftedAnchor:T,angle:C})}else ie(m.numGlyphs,p)}if(h){d.clear();for(var M=e.icon.placedSymbolArray,I=0;I<M.length;I++){var B=M.get(I);if(B.hidden)ie(B.numGlyphs,d);else{var R=A[I];if(R)for(var k=0;k<B.numGlyphs;k++)t.addDynamicAttributes(d,R.shiftedAnchor,R.angle);else ie(B.numGlyphs,d)}}e.icon.dynamicLayoutVertexBuffer.updateData(d)}e.text.dynamicLayoutVertexBuffer.updateData(p)}function Kn(t,e,n){return n.iconsInText&&e?"symbolTextAndIcon":t?"symbolSDF":"symbolIcon"}function Yn(e,n,r,i,o,a,s,u,c,l,h,f){for(var p,d,A=e.context,g=A.gl,m=e.transform,y="map"===u,v="map"===c,_=y&&"point"!==r.layout.get("symbol-placement"),b=y&&!v&&!_,x=void 0!==r.layout.get("symbol-sort-key").constantOr(1),w=e.depthModeForSublayer(0,Et.ReadOnly),E=r.layout.get("text-variable-anchor"),O=[],S=0,T=i;S<T.length;S+=1){var C=T[S],P=n.getTile(C),M=P.getBucket(r);if(M){var I=o?M.text:M.icon;if(I&&I.segments.get().length){var B=I.programConfigurations.get(r.id),R=o||M.sdfIcons,k=o?M.textSizeData:M.iconSizeData,L=v||0!==m.pitch;p||(p=e.useProgram(Kn(R,o,M),B),d=t.evaluateSizeForZoom(k,m.zoom));var D=void 0,j=[0,0],F=void 0,z=void 0,U=null,N=void 0;if(o){if(F=P.glyphAtlasTexture,z=g.LINEAR,D=P.glyphAtlasTexture.size,M.iconsInText){j=P.imageAtlasTexture.size,U=P.imageAtlasTexture;var G="composite"===k.kind||"camera"===k.kind;N=L||e.options.rotating||e.options.zooming||G?g.LINEAR:g.NEAREST}}else{var V=1!==r.layout.get("icon-size").constantOr(0)||M.iconsNeedLinear;F=P.imageAtlasTexture,z=R||e.options.rotating||e.options.zooming||V||L?g.LINEAR:g.NEAREST,D=P.imageAtlasTexture.size}var H=ue(P,1,e.transform.zoom),W=Xt(C.posMatrix,v,y,e.transform,H),q=Jt(C.posMatrix,v,y,e.transform,H),X=E&&M.hasTextData(),J="none"!==r.layout.get("icon-text-fit")&&X&&M.hasIconData();_&&Kt(M,C.posMatrix,e,o,W,q,v,l);var Z=e.translatePosMatrix(C.posMatrix,P,a,s),Q=_||o&&E||J?Jn:W,K=e.translatePosMatrix(q,P,a,s,!0),Y=R&&0!==r.paint.get(o?"text-halo-width":"icon-halo-width").constantOr(1),$={program:p,buffers:I,uniformValues:R?M.iconsInText?Un(k.kind,d,b,v,e,Z,Q,K,D,j):zn(k.kind,d,b,v,e,Z,Q,K,o,D,!0):Fn(k.kind,d,b,v,e,Z,Q,K,o,D),atlasTexture:F,atlasTextureIcon:U,atlasInterpolation:z,atlasInterpolationIcon:N,isSDF:R,hasHalo:Y};if(x)for(var tt=0,et=I.segments.get();tt<et.length;tt+=1){var nt=et[tt];O.push({segments:new t.SegmentVector([nt]),sortKey:nt.sortKey,state:$})}else O.push({segments:I.segments,sortKey:0,state:$})}}}x&&O.sort((function(t,e){return t.sortKey-e.sortKey}));for(var rt=0,it=O;rt<it.length;rt+=1){var ot=it[rt],at=ot.state;if(A.activeTexture.set(g.TEXTURE0),at.atlasTexture.bind(at.atlasInterpolation,g.CLAMP_TO_EDGE),at.atlasTextureIcon&&(A.activeTexture.set(g.TEXTURE1),at.atlasTextureIcon&&at.atlasTextureIcon.bind(at.atlasInterpolationIcon,g.CLAMP_TO_EDGE)),at.isSDF){var st=at.uniformValues;at.hasHalo&&(st.u_is_halo=1,$n(at.buffers,ot.segments,r,e,at.program,w,h,f,st)),st.u_is_halo=0}$n(at.buffers,ot.segments,r,e,at.program,w,h,f,at.uniformValues)}}function $n(t,e,n,r,i,o,a,s,u){var c=r.context,l=c.gl;i.draw(c,l.TRIANGLES,o,a,s,Tt.disabled,u,n.id,t.layoutVertexBuffer,t.indexBuffer,e,n.paint,r.transform.zoom,t.programConfigurations.get(n.id),t.dynamicLayoutVertexBuffer,t.opacityVertexBuffer)}function tr(t,e,n,r,i,o,a){var s,u,c,l,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 g=0,m=r;g<m.length;g+=1){var y=m[g],v=e.getTile(y);if(!d||v.patternsLoaded()){var _=v.getBucket(n);if(_){var b=_.programConfigurations.get(n.id),x=t.useProgram(u,b);d&&(t.context.activeTexture.set(f.TEXTURE0),v.imageAtlasTexture.bind(f.LINEAR,f.CLAMP_TO_EDGE),b.updatePatternPaintBuffers(A));var w=p.constantOr(null);if(w&&v.imageAtlas){var E=v.imageAtlas,O=E.patternPositions[w.to.toString()],S=E.patternPositions[w.from.toString()];O&&S&&b.setConstantPatternPositions(O,S)}var T=t.translatePosMatrix(y.posMatrix,v,n.paint.get("fill-translate"),n.paint.get("fill-translate-anchor"));if(a){l=_.indexBuffer2,h=_.segments2;var C=[f.drawingBufferWidth,f.drawingBufferHeight];c="fillOutlinePattern"===u&&d?xn(T,t,A,v,C):bn(T,C)}else l=_.indexBuffer,h=_.segments,c=d?_n(T,t,A,v):vn(T);x.draw(t.context,s,i,t.stencilModeForClipping(y),o,Tt.disabled,c,n.id,_.layoutVertexBuffer,l,h,n.paint,t.transform.zoom,b)}}}}function er(t,e,n,r,i,o,a){for(var s=t.context,u=s.gl,c=n.paint.get("fill-extrusion-pattern"),l=c.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],g=e.getTile(A),m=g.getBucket(n);if(m){var y=m.programConfigurations.get(n.id),v=t.useProgram(l?"fillExtrusionPattern":"fillExtrusion",y);l&&(t.context.activeTexture.set(u.TEXTURE0),g.imageAtlasTexture.bind(u.LINEAR,u.CLAMP_TO_EDGE),y.updatePatternPaintBuffers(h));var _=c.constantOr(null);if(_&&g.imageAtlas){var b=g.imageAtlas,x=b.patternPositions[_.to.toString()],w=b.patternPositions[_.from.toString()];x&&w&&y.setConstantPatternPositions(x,w)}var E=t.translatePosMatrix(A.posMatrix,g,n.paint.get("fill-extrusion-translate"),n.paint.get("fill-extrusion-translate-anchor")),O=n.paint.get("fill-extrusion-vertical-gradient"),S=l?yn(E,t,O,f,A,h,g):mn(E,t,O,f);v.draw(s,s.gl.TRIANGLES,i,o,a,Tt.backCCW,S,n.id,m.layoutVertexBuffer,m.indexBuffer,m.segments,n.paint,t.transform.zoom,y)}}}function nr(t,e,n,r,i,o){var a=t.context,s=a.gl,u=e.fbo;if(u){var c=t.useProgram("hillshade");a.activeTexture.set(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,u.colorAttachment.get());var l=function(t,e,n){var r=n.paint.get("hillshade-shadow-color"),i=n.paint.get("hillshade-highlight-color"),o=n.paint.get("hillshade-accent-color"),a=n.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===n.paint.get("hillshade-illumination-anchor")&&(a-=t.transform.angle);var s=!t.options.moving;return{u_matrix:t.transform.calculatePosMatrix(e.tileID.toUnwrapped(),s),u_image:0,u_latrange:Pn(0,e.tileID),u_light:[n.paint.get("hillshade-exaggeration"),a],u_shadow:r,u_highlight:i,u_accent:o}}(t,e,n);e.maskedBoundsBuffer&&e.maskedIndexBuffer&&e.segments?c.draw(a,s.TRIANGLES,r,i,o,Tt.disabled,l,n.id,e.maskedBoundsBuffer,e.maskedIndexBuffer,e.segments):c.draw(a,s.TRIANGLES,r,i,o,Tt.disabled,l,n.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments)}}function rr(e,n,r,i,o,a,s){var u=e.context,c=u.gl,l=n.dem;if(l&&l.data){var h=l.dim,f=l.stride,p=l.getPixels();if(u.activeTexture.set(c.TEXTURE1),u.pixelStoreUnpackPremultiplyAlpha.set(!1),n.demTexture=n.demTexture||e.getTileTexture(f),n.demTexture){var d=n.demTexture;d.update(p,{premultiply:!1}),d.bind(c.NEAREST,c.CLAMP_TO_EDGE)}else n.demTexture=new t.Texture(u,p,c.RGBA,{premultiply:!1}),n.demTexture.bind(c.NEAREST,c.CLAMP_TO_EDGE);u.activeTexture.set(c.TEXTURE0);var A=n.fbo;if(!A){var g=new t.Texture(u,{width:h,height:h,data:null},c.RGBA);g.bind(c.LINEAR,c.CLAMP_TO_EDGE),(A=n.fbo=u.createFramebuffer(h,h)).colorAttachment.set(g.texture)}u.bindFramebuffer.set(A.framebuffer),u.viewport.set([0,0,h,h]),e.useProgram("hillshadePrepare").draw(u,c.TRIANGLES,o,a,s,Tt.disabled,function(e,n,r){var i=n.stride,o=t.create();return t.ortho(o,0,t.EXTENT,-t.EXTENT,0,0,1),t.translate(o,o,[0,-t.EXTENT,0]),{u_matrix:o,u_image:1,u_dimension:[i,i],u_zoom:e.overscaledZ,u_maxzoom:r,u_unpack:n.getUnpackVector()}}(n.tileID,l,i),r.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments),n.needsHillshadePrepare=!1}}function ir(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,c=n?(s-n.timeAdded)/a:-1,l=r.getSource(),h=o.coveringZoomLevel({tileSize:l.tileSize,roundZoom:l.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-c,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}}function or(e,n,r){var i=e.context,o=i.gl,a=r.posMatrix,s=e.useProgram("debug"),u=Et.disabled,c=Ot.disabled,l=e.colorModeForRenderPass(),h="$debug";s.draw(i,o.LINE_STRIP,u,c,l,Tt.disabled,Sn(a,t.Color.red),h,e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments);var f=n.getTileByID(r.key).latestRawTileData,p=f&&f.byteLength||0,d=Math.floor(p/1024),A=n.getTile(r).tileSize,g=512/Math.min(A,512),m=r.canonical.toString();r.overscaledZ!==r.canonical.z&&(m+=" => "+r.overscaledZ);for(var y=function(t,e,n,r){r=r||1;var i,o,a,s,u,c,l,h,f=[];for(i=0,o=t.length;i<o;i++)if(u=ar[t[i]]){for(h=null,a=0,s=u[1].length;a<s;a+=2)-1===u[1][a]&&-1===u[1][a+1]?h=null:(c=e+u[1][a]*r,l=n-u[1][a+1]*r,h&&f.push(h.x,h.y,c,l),h={x:c,y:l});e+=u[0]*r}return f}(m+" "+d+"kb",50,200*g,5*g),v=new t.StructArrayLayout2i4,_=new t.StructArrayLayout2ui4,b=0;b<y.length;b+=2)v.emplaceBack(y[b],y[b+1]),_.emplaceBack(b,b+1);for(var x=i.createVertexBuffer(v,Fe.members),w=i.createIndexBuffer(_),E=t.SegmentVector.simpleSegment(0,0,v.length/2,v.length/2),O=t.EXTENT/(Math.pow(2,e.transform.zoom-r.overscaledZ)*A*g),S=[],T=-1;T<=1;T++)for(var C=-1;C<=1&&(0!==T||0!==C);C++)S.push([T,C]);for(var P=0;P<S.length;P++){var M=S[P];s.draw(i,o.LINES,u,c,l,Tt.disabled,Sn(t.translate([],a,[O*M[0],O*M[1],0]),t.Color.white),h,x,w,E)}s.draw(i,o.LINES,u,c,l,Tt.disabled,Sn(a,t.Color.black),h,x,w,E),x.destroy(),w.destroy(),E.destroy()}var ar={" ":[16,[]],"!":[10,[5,21,5,7,-1,-1,5,2,4,1,5,0,6,1,5,2]],'"':[16,[4,21,4,14,-1,-1,12,21,12,14]],"#":[21,[11,25,4,-7,-1,-1,17,25,10,-7,-1,-1,4,12,18,12,-1,-1,3,6,17,6]],$:[20,[8,25,8,-4,-1,-1,12,25,12,-4,-1,-1,17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],"%":[24,[21,21,3,0,-1,-1,8,21,10,19,10,17,9,15,7,14,5,14,3,16,3,18,4,20,6,21,8,21,10,20,13,19,16,19,19,20,21,21,-1,-1,17,7,15,6,14,4,14,2,16,0,18,0,20,1,21,3,21,5,19,7,17,7]],"&":[26,[23,12,23,13,22,14,21,14,20,13,19,11,17,6,15,3,13,1,11,0,7,0,5,1,4,2,3,4,3,6,4,8,5,9,12,13,13,14,14,16,14,18,13,20,11,21,9,20,8,18,8,16,9,13,11,10,16,3,18,1,20,0,22,0,23,1,23,2]],"'":[10,[5,19,4,20,5,21,6,20,6,18,5,16,4,15]],"(":[14,[11,25,9,23,7,20,5,16,4,11,4,7,5,2,7,-2,9,-5,11,-7]],")":[14,[3,25,5,23,7,20,9,16,10,11,10,7,9,2,7,-2,5,-5,3,-7]],"*":[16,[8,21,8,9,-1,-1,3,18,13,12,-1,-1,13,18,3,12]],"+":[26,[13,18,13,0,-1,-1,4,9,22,9]],",":[10,[6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4]],"-":[26,[4,9,22,9]],".":[10,[5,2,4,1,5,0,6,1,5,2]],"/":[22,[20,25,2,-7]],0:[20,[9,21,6,20,4,17,3,12,3,9,4,4,6,1,9,0,11,0,14,1,16,4,17,9,17,12,16,17,14,20,11,21,9,21]],1:[20,[6,17,8,18,11,21,11,0]],2:[20,[4,16,4,17,5,19,6,20,8,21,12,21,14,20,15,19,16,17,16,15,15,13,13,10,3,0,17,0]],3:[20,[5,21,16,21,10,13,13,13,15,12,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4]],4:[20,[13,21,3,7,18,7,-1,-1,13,21,13,0]],5:[20,[15,21,5,21,4,12,5,13,8,14,11,14,14,13,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4]],6:[20,[16,18,15,20,12,21,10,21,7,20,5,17,4,12,4,7,5,3,7,1,10,0,11,0,14,1,16,3,17,6,17,7,16,10,14,12,11,13,10,13,7,12,5,10,4,7]],7:[20,[17,21,7,0,-1,-1,3,21,17,21]],8:[20,[8,21,5,20,4,18,4,16,5,14,7,13,11,12,14,11,16,9,17,7,17,4,16,2,15,1,12,0,8,0,5,1,4,2,3,4,3,7,4,9,6,11,9,12,13,13,15,14,16,16,16,18,15,20,12,21,8,21]],9:[20,[16,14,15,11,13,9,10,8,9,8,6,9,4,11,3,14,3,15,4,18,6,20,9,21,10,21,13,20,15,18,16,14,16,9,15,4,13,1,10,0,8,0,5,1,4,3]],":":[10,[5,14,4,13,5,12,6,13,5,14,-1,-1,5,2,4,1,5,0,6,1,5,2]],";":[10,[5,14,4,13,5,12,6,13,5,14,-1,-1,6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4]],"<":[24,[20,18,4,9,20,0]],"=":[26,[4,12,22,12,-1,-1,4,6,22,6]],">":[24,[4,18,20,9,4,0]],"?":[18,[3,16,3,17,4,19,5,20,7,21,11,21,13,20,14,19,15,17,15,15,14,13,13,12,9,10,9,7,-1,-1,9,2,8,1,9,0,10,1,9,2]],"@":[27,[18,13,17,15,15,16,12,16,10,15,9,14,8,11,8,8,9,6,11,5,14,5,16,6,17,8,-1,-1,12,16,10,14,9,11,9,8,10,6,11,5,-1,-1,18,16,17,8,17,6,19,5,21,5,23,7,24,10,24,12,23,15,22,17,20,19,18,20,15,21,12,21,9,20,7,19,5,17,4,15,3,12,3,9,4,6,5,4,7,2,9,1,12,0,15,0,18,1,20,2,21,3,-1,-1,19,16,18,8,18,6,19,5]],A:[18,[9,21,1,0,-1,-1,9,21,17,0,-1,-1,4,7,14,7]],B:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,-1,-1,4,11,13,11,16,10,17,9,18,7,18,4,17,2,16,1,13,0,4,0]],C:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5]],D:[21,[4,21,4,0,-1,-1,4,21,11,21,14,20,16,18,17,16,18,13,18,8,17,5,16,3,14,1,11,0,4,0]],E:[19,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11,-1,-1,4,0,17,0]],F:[18,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11]],G:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,18,8,-1,-1,13,8,18,8]],H:[22,[4,21,4,0,-1,-1,18,21,18,0,-1,-1,4,11,18,11]],I:[8,[4,21,4,0]],J:[16,[12,21,12,5,11,2,10,1,8,0,6,0,4,1,3,2,2,5,2,7]],K:[21,[4,21,4,0,-1,-1,18,21,4,7,-1,-1,9,12,18,0]],L:[17,[4,21,4,0,-1,-1,4,0,16,0]],M:[24,[4,21,4,0,-1,-1,4,21,12,0,-1,-1,20,21,12,0,-1,-1,20,21,20,0]],N:[22,[4,21,4,0,-1,-1,4,21,18,0,-1,-1,18,21,18,0]],O:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21]],P:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,14,17,12,16,11,13,10,4,10]],Q:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21,-1,-1,12,4,18,-2]],R:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,4,11,-1,-1,11,11,18,0]],S:[20,[17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],T:[16,[8,21,8,0,-1,-1,1,21,15,21]],U:[22,[4,21,4,6,5,3,7,1,10,0,12,0,15,1,17,3,18,6,18,21]],V:[18,[1,21,9,0,-1,-1,17,21,9,0]],W:[24,[2,21,7,0,-1,-1,12,21,7,0,-1,-1,12,21,17,0,-1,-1,22,21,17,0]],X:[20,[3,21,17,0,-1,-1,17,21,3,0]],Y:[18,[1,21,9,11,9,0,-1,-1,17,21,9,11]],Z:[20,[17,21,3,0,-1,-1,3,21,17,21,-1,-1,3,0,17,0]],"[":[14,[4,25,4,-7,-1,-1,5,25,5,-7,-1,-1,4,25,11,25,-1,-1,4,-7,11,-7]],"\\":[14,[0,21,14,-3]],"]":[14,[9,25,9,-7,-1,-1,10,25,10,-7,-1,-1,3,25,10,25,-1,-1,3,-7,10,-7]],"^":[16,[6,15,8,18,10,15,-1,-1,3,12,8,17,13,12,-1,-1,8,17,8,0]],_:[16,[0,-2,16,-2]],"`":[10,[6,21,5,20,4,18,4,16,5,15,6,16,5,17]],a:[19,[15,14,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],b:[19,[4,21,4,0,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],c:[18,[15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],d:[19,[15,21,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],e:[18,[3,8,15,8,15,10,14,12,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],f:[12,[10,21,8,21,6,20,5,17,5,0,-1,-1,2,14,9,14]],g:[19,[15,14,15,-2,14,-5,13,-6,11,-7,8,-7,6,-6,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],h:[19,[4,21,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],i:[8,[3,21,4,20,5,21,4,22,3,21,-1,-1,4,14,4,0]],j:[10,[5,21,6,20,7,21,6,22,5,21,-1,-1,6,14,6,-3,5,-6,3,-7,1,-7]],k:[17,[4,21,4,0,-1,-1,14,14,4,4,-1,-1,8,8,15,0]],l:[8,[4,21,4,0]],m:[30,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0,-1,-1,15,10,18,13,20,14,23,14,25,13,26,10,26,0]],n:[19,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],o:[19,[8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3,16,6,16,8,15,11,13,13,11,14,8,14]],p:[19,[4,14,4,-7,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],q:[19,[15,14,15,-7,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],r:[13,[4,14,4,0,-1,-1,4,8,5,11,7,13,9,14,12,14]],s:[17,[14,11,13,13,10,14,7,14,4,13,3,11,4,9,6,8,11,7,13,6,14,4,14,3,13,1,10,0,7,0,4,1,3,3]],t:[12,[5,21,5,4,6,1,8,0,10,0,-1,-1,2,14,9,14]],u:[19,[4,14,4,4,5,1,7,0,10,0,12,1,15,4,-1,-1,15,14,15,0]],v:[16,[2,14,8,0,-1,-1,14,14,8,0]],w:[22,[3,14,7,0,-1,-1,11,14,7,0,-1,-1,11,14,15,0,-1,-1,19,14,15,0]],x:[17,[3,14,14,0,-1,-1,14,14,3,0]],y:[16,[2,14,8,0,-1,-1,14,14,8,0,6,-4,4,-6,2,-7,1,-7]],z:[17,[14,14,3,0,-1,-1,3,14,14,14,-1,-1,3,0,14,0]],"{":[14,[9,25,7,24,6,23,5,21,5,19,6,17,7,16,8,14,8,12,6,10,-1,-1,7,24,6,22,6,20,7,18,8,17,9,15,9,13,8,11,4,9,8,7,9,5,9,3,8,1,7,0,6,-2,6,-4,7,-6,-1,-1,6,8,8,6,8,4,7,2,6,1,5,-1,5,-3,6,-5,7,-6,9,-7]],"|":[8,[4,25,4,-7]],"}":[14,[5,25,7,24,8,23,9,21,9,19,8,17,7,16,6,14,6,12,8,10,-1,-1,7,24,8,22,8,20,7,18,6,17,5,15,5,13,6,11,10,9,6,7,5,5,5,3,6,1,7,0,8,-2,8,-4,7,-6,-1,-1,8,8,6,6,6,4,7,2,8,1,9,-1,9,-3,8,-5,7,-6,5,-7]],"~":[24,[3,6,3,8,4,11,6,12,8,12,10,11,14,8,16,7,18,7,20,8,21,10,-1,-1,3,8,4,10,6,11,8,11,10,10,14,7,16,6,18,6,20,7,21,10,21,12]]},sr={symbol:function(e,n,r,i,o){if("translucent"===e.renderPass){var a=Ot.disabled,s=e.colorModeForRenderPass();r.layout.get("text-variable-anchor")&&function(e,n,r,i,o,a,s){for(var u=n.transform,c="map"===o,l="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 g=A.textSizeData,m=t.evaluateSizeForZoom(g,u.zoom),y=ue(d,1,n.transform.zoom),v=Xt(p.posMatrix,l,c,n.transform,y),_="none"!==r.layout.get("icon-text-fit")&&A.hasIconData();if(m){var b=Math.pow(2,u.zoom-d.tileID.overscaledZ);Qn(A,c,l,s,t.symbolSize,u,v,p.posMatrix,b,m,_)}}}}(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)&&Yn(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)&&Yn(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 c=e.context,l=c.gl,h=e.depthModeForSublayer(0,Et.ReadOnly),f=Ot.disabled,p=e.colorModeForRenderPass(),d=[],A=0;A<i.length;A++){var g=i[A],m=n.getTile(g),y=m.getBucket(r);if(y){var v=y.programConfigurations.get(r.id),_={programConfiguration:v,program:e.useProgram("circle",v),layoutVertexBuffer:y.layoutVertexBuffer,indexBuffer:y.indexBuffer,uniformValues:wn(e,g,m,r)};if(u)for(var b=0,x=y.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:y.segments,sortKey:0,state:_})}}u&&d.sort((function(t,e){return t.sortKey-e.sortKey}));for(var E=0,O=d;E<O.length;E+=1){var S=O[E],T=S.state,C=T.programConfiguration,P=T.program,M=T.layoutVertexBuffer,I=T.indexBuffer,B=T.uniformValues,R=S.segments;P.draw(c,l.TRIANGLES,h,f,p,Tt.disabled,B,r.id,M,I,R,r.paint,e.transform.zoom,C)}}}},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=e.depthModeForSublayer(0,Et.ReadOnly),u=Ot.disabled,c=new St([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),function t(e,n,r,i){var o=e.gl;o.texImage2D(o.TEXTURE_2D,0,o.RGBA,n.width/4,n.height/4,0,o.RGBA,e.extTextureHalfFloat?e.extTextureHalfFloat.HALF_FLOAT_OES:o.UNSIGNED_BYTE,null),i.colorAttachment.set(r),e.extTextureHalfFloat&&o.checkFramebufferStatus(o.FRAMEBUFFER)!==o.FRAMEBUFFER_COMPLETE&&(e.extTextureHalfFloat=null,i.colorAttachment.setDirty(),t(e,n,r,i))}(t,e,o,i)}}(o,e,r),o.clear({color:t.Color.transparent});for(var l=0;l<i.length;l++){var h=i[l];if(!n.hasRenderableParent(h)){var f=n.getTile(h),p=f.getBucket(r);if(p){var d=p.programConfigurations.get(r.id),A=e.useProgram("heatmap",d),g=e.transform.zoom;A.draw(o,a.TRIANGLES,s,u,c,Tt.disabled,Cn(h.posMatrix,f,g,r.paint.get("heatmap-intensity")),r.id,p.layoutVertexBuffer,p.indexBuffer,p.segments,r.paint,e.transform.zoom,d)}}}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,Et.disabled,Ot.disabled,e.colorModeForRenderPass(),Tt.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:r,u_color_ramp:i,u_opacity:n.paint.get("heatmap-opacity")}}(e,n,0,1),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)){var s=e.depthModeForSublayer(0,Et.ReadOnly),u=e.colorModeForRenderPass(),c=r.paint.get("line-dasharray"),l=r.paint.get("line-pattern"),h=l.constantOr(1),f=r.paint.get("line-gradient"),p=r.getCrossfadeParameters(),d=c?"lineSDF":h?"linePattern":f?"lineGradient":"line",A=e.context,g=A.gl,m=!0;if(f){A.activeTexture.set(g.TEXTURE0);var y=r.gradientTexture;if(!r.gradient)return;y||(y=r.gradientTexture=new t.Texture(A,r.gradient,g.RGBA)),y.bind(g.LINEAR,g.CLAMP_TO_EDGE)}for(var v=0,_=i;v<_.length;v+=1){var b=_[v],x=n.getTile(b);if(!h||x.patternsLoaded()){var w=x.getBucket(r);if(w){var E=w.programConfigurations.get(r.id),O=e.context.program.get(),S=e.useProgram(d,E),T=m||S.program!==O,C=l.constantOr(null);if(C&&x.imageAtlas){var P=x.imageAtlas,M=P.patternPositions[C.to.toString()],I=P.patternPositions[C.from.toString()];M&&I&&E.setConstantPatternPositions(M,I)}var B=c?Rn(e,x,r,c,p):h?Bn(e,x,r,p):f?In(e,x,r):Mn(e,x,r);c&&(T||e.lineAtlas.dirty)?(A.activeTexture.set(g.TEXTURE0),e.lineAtlas.bind(A)):h&&(A.activeTexture.set(g.TEXTURE0),x.imageAtlasTexture.bind(g.LINEAR,g.CLAMP_TO_EDGE),E.updatePatternPaintBuffers(p)),S.draw(A,g.TRIANGLES,s,e.stencilModeForClipping(b),u,Tt.disabled,B,r.id,w.layoutVertexBuffer,w.indexBuffer,w.segments,r.paint,e.transform.zoom,E),m=!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"),c=e.opaquePassEnabledForLayer()&&!u.constantOr(1)&&1===o.constantOr(t.Color.transparent).a&&1===a.constantOr(0)?"opaque":"translucent";if(e.renderPass===c){var l=e.depthModeForSublayer(1,"opaque"===e.renderPass?Et.ReadWrite:Et.ReadOnly);tr(e,n,r,i,l,s,!1)}if("translucent"===e.renderPass&&r.paint.get("fill-antialias")){var h=e.depthModeForSublayer(r.getPaintProperty("fill-outline-color")?2:0,Et.ReadOnly);tr(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 Et(t.context.gl.LEQUAL,Et.ReadWrite,t.depthRangeFor3D);if(1!==i||n.paint.get("fill-extrusion-pattern").constantOr(1))er(t,e,n,r,o,Ot.disabled,St.disabled),er(t,e,n,r,o,t.stencilModeFor3D(),t.colorModeForRenderPass());else{var a=t.colorModeForRenderPass();er(t,e,n,r,o,Ot.disabled,a)}}},hillshade:function(t,e,n,r){if("offscreen"===t.renderPass||"translucent"===t.renderPass){for(var i=t.context,o=e.getSource().maxzoom,a=t.depthModeForSublayer(0,Et.ReadOnly),s=Ot.disabled,u=t.colorModeForRenderPass(),c=0,l=r;c<l.length;c+=1){var h=l[c],f=e.getTile(h);f.needsHillshadePrepare&&"offscreen"===t.renderPass?rr(t,f,n,o,a,s,u):"translucent"===t.renderPass&&nr(t,f,n,a,s,u)}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"))for(var i=t.context,o=i.gl,a=e.getSource(),s=t.useProgram("raster"),u=Ot.disabled,c=t.colorModeForRenderPass(),l=r.length&&r[0].overscaledZ,h=!t.options.moving,f=0,p=r;f<p.length;f+=1){var d=p[f],A=t.depthModeForSublayer(d.overscaledZ-l,1===n.paint.get("raster-opacity")?Et.ReadWrite:Et.ReadOnly,o.LESS),g=e.getTile(d),m=t.transform.calculatePosMatrix(d.toUnwrapped(),h);g.registerFadeDuration(n.paint.get("raster-fade-duration"));var y=e.findLoadedParent(d,0),v=ir(g,y,e,n,t.transform),_=void 0,b=void 0,x="nearest"===n.paint.get("raster-resampling")?o.NEAREST:o.LINEAR;i.activeTexture.set(o.TEXTURE0),g.texture.bind(x,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST),i.activeTexture.set(o.TEXTURE1),y?(y.texture.bind(x,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST),_=Math.pow(2,y.tileID.overscaledZ-g.tileID.overscaledZ),b=[g.tileID.canonical.x*_%1,g.tileID.canonical.y*_%1]):g.texture.bind(x,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST);var w=Dn(m,b||[0,0],_||1,v,n);a instanceof I?s.draw(i,o.TRIANGLES,A,u,c,Tt.disabled,w,n.id,a.boundsBuffer,t.quadTriangleIndexBuffer,a.boundsSegments):g.maskedBoundsBuffer&&g.maskedIndexBuffer&&g.segments?s.draw(i,o.TRIANGLES,A,u,c,Tt.disabled,w,n.id,g.maskedBoundsBuffer,g.maskedIndexBuffer,g.segments,n.paint,t.transform.zoom):s.draw(i,o.TRIANGLES,A,u,c,Tt.disabled,w,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,c=n.paint.get("background-pattern");if(!t.isPatternMissing(c)){var l=!c&&1===r.a&&1===i&&t.opaquePassEnabledForLayer()?"opaque":"translucent";if(t.renderPass===l){var h=Ot.disabled,f=t.depthModeForSublayer(0,"opaque"===l?Et.ReadWrite:Et.ReadOnly),p=t.colorModeForRenderPass(),d=t.useProgram(c?"backgroundPattern":"background"),A=s.coveringTiles({tileSize:u});c&&(o.activeTexture.set(a.TEXTURE0),t.imageManager.bind(t.context));for(var g=n.getCrossfadeParameters(),m=0,y=A;m<y.length;m+=1){var v=y[m],_=t.transform.calculatePosMatrix(v.toUnwrapped()),b=c?Gn(_,i,t,c,{tileID:v,tileSize:u},g):Nn(_,i,r);d.draw(o,a.TRIANGLES,f,h,p,Tt.disabled,b,n.id,t.tileExtentBuffer,t.quadTriangleIndexBuffer,t.tileExtentSegments)}}}}},debug:function(t,e,n){for(var r=0;r<n.length;r++)or(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(Ot.disabled);var a="3d"===i.renderingMode?new Et(t.context.gl.LEQUAL,Et.ReadWrite,t.depthRangeFor3D):t.depthModeForSublayer(0,Et.ReadOnly);r.setDepthMode(a),i.render(r.gl,t.transform.customLayerMatrix()),r.setDirty(),t.setBaseState(),r.bindFramebuffer.set(null)}}},ur=function(e,n){this.context=new Ct(e),this.transform=n,this._tileTextures={},this.setup(),this.numSublayers=Pt.maxUnderzooming+Pt.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.depthRboNeedsClear=!0,this.emptyProgramConfiguration=new t.ProgramConfiguration,this.crossTileSymbolIndex=new Re,this.gpuTimers={}};function cr(t,e){if(t.y>e.y){var n=t;t=e,e=n}return{x0:t.x,y0:t.y,x1:e.x,y1:e.y,dx:e.x-t.x,dy:e.y-t.y}}function lr(t,e,n,r,i){var o=Math.max(n,Math.floor(e.y0)),a=Math.min(r,Math.ceil(e.y1));if(t.x0===e.x0&&t.y0===e.y0?t.x0+e.dy/t.dy*t.dx<e.x1:t.x1-e.dy/t.dy*t.dx<e.x0){var s=t;t=e,e=s}for(var u=t.dx/t.dy,c=e.dx/e.dy,l=t.dx>0,h=e.dx<0,f=o;f<a;f++){var p=u*Math.max(0,Math.min(t.dy,f+l-t.y0))+t.x0,d=c*Math.max(0,Math.min(e.dy,f+h-e.y0))+e.x0;i(Math.floor(d),Math.ceil(p),f)}}function hr(t,e,n,r,i,o){var a,s=cr(t,e),u=cr(e,n),c=cr(n,t);s.dy>u.dy&&(a=s,s=u,u=a),s.dy>c.dy&&(a=s,s=c,c=a),u.dy>c.dy&&(a=u,u=c,c=a),s.dy&&lr(c,s,r,i,o),u.dy&&lr(c,u,r,i,o)}ur.prototype.resize=function(e,n){var r=this.context.gl;if(this.width=e*t.browser.devicePixelRatio,this.height=n*t.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var i=0,o=this.style._order;i<o.length;i+=1){var a=o[i];this.style._layers[a].resize()}this.depthRbo&&(r.deleteRenderbuffer(this.depthRbo),this.depthRbo=null)},ur.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,Fe.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,Fe.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,t.rasterBoundsAttributes.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,Fe.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);var u=this.context.gl;this.stencilClearMode=new Ot({func:u.ALWAYS,mask:0},0,255,u.ZERO,u.ZERO,u.ZERO)},ur.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,Et.disabled,this.stencilClearMode,St.disabled,Tt.disabled,Tn(r),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)},ur.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(St.disabled),n.setDepthMode(Et.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,Et.disabled,new Ot({func:r.ALWAYS,mask:0},u,255,r.KEEP,r.KEEP,r.REPLACE),St.disabled,Tt.disabled,Tn(s.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}},ur.prototype.stencilModeFor3D=function(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();var t=this.nextStencilID++,e=this.context.gl;return new Ot({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)},ur.prototype.stencilModeForClipping=function(t){var e=this.context.gl;return new Ot({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)},ur.prototype.colorModeForRenderPass=function(){var e=this.context.gl;return this._showOverdrawInspector?new St([e.CONSTANT_COLOR,e.ONE],new t.Color(1/8,1/8,1/8,0),[!0,!0,!0,!0]):"opaque"===this.renderPass?St.unblended:St.alphaBlended},ur.prototype.depthModeForSublayer=function(t,e,n){if(!this.opaquePassEnabledForLayer())return Et.disabled;var r=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new Et(n||this.context.gl.LEQUAL,e,[r,r])},ur.prototype.opaquePassEnabledForLayer=function(){return this.currentLayer<this.opaquePassCutoff},ur.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,c,l={},h={},f={};for(var p in o){var d=o[p];l[p]=d.getVisibleCoordinates(),h[p]=l[p].slice().reverse(),f[p]=d.getVisibleCoordinates(!0).reverse()}for(var A in o){var g=o[A],m=g.getSource();if("raster"===m.type||"raster-dem"===m.type){for(var y=[],v=0,_=l[A];v<_.length;v+=1){var b=_[v];y.push(g.getTile(b))}Hn(y,this.context)}}this.opaquePassCutoff=1/0;for(var x=0;x<i.length;x++){var w=i[x];if(this.style._layers[w].is3D()){this.opaquePassCutoff=x;break}}this.renderPass="offscreen",this.depthRboNeedsClear=!0;for(var E=0,O=i;E<O.length;E+=1){var S=O[E],T=this.style._layers[S];if(T.hasOffscreenPass()&&!T.isHidden(this.transform.zoom)){var C=h[T.source];("custom"===T.type||C.length)&&this.renderLayer(this,o[T.source],T,C)}}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 P=this.style._layers[i[this.currentLayer]],M=o[P.source],I=l[P.source];this._renderTileClippingMasks(P,I),this.renderLayer(this,M,P,I)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<i.length;this.currentLayer++){var B=this.style._layers[i[this.currentLayer]],R=o[B.source],k=("symbol"===B.type?f:h)[B.source];this._renderTileClippingMasks(B,l[B.source]),this.renderLayer(this,R,B,k)}this.options.showTileBoundaries&&(t.values(this.style._layers).forEach((function(t){t.source&&!t.isHidden(r.transform.zoom)&&(t.source!==(c&&c.id)&&(c=r.style.sourceCaches[t.source]),(!u||u.getSource().maxzoom<c.getSource().maxzoom)&&(u=c))})),u&&sr.debug(this,u,u.getVisibleCoordinates())),this.context.setDefault()},ur.prototype.setupOffscreenDepthRenderbuffer=function(){var t=this.context;this.depthRbo||(this.depthRbo=t.createRenderbuffer(t.gl.DEPTH_COMPONENT16,this.width,this.height))},ur.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),sr[n.type](t,e,n,r,this.style.placement.variableOffsets),this.gpuTimingEnd())},ur.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)}},ur.prototype.gpuTimingEnd=function(){if(this.options.gpuTiming){var t=this.context.extTimerQuery;t.endQueryEXT(t.TIME_ELAPSED_EXT)}},ur.prototype.collectGpuTimers=function(){var t=this.gpuTimers;return this.gpuTimers={},t},ur.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},ur.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 c=[o?r[0]:ue(n,r[0],this.transform.zoom),o?r[1]:ue(n,r[1],this.transform.zoom),0],l=new Float32Array(16);return t.translate(l,e,c),l},ur.prototype.saveTileTexture=function(t){var e=this._tileTextures[t.size[0]];e?e.push(t):this._tileTextures[t.size[0]]=[t]},ur.prototype.getTileTexture=function(t){var e=this._tileTextures[t];return e&&e.length>0?e.pop():null},ur.prototype.isPatternMissing=function(t){if(!t)return!1;var e=this.imageManager.getPattern(t.from.toString()),n=this.imageManager.getPattern(t.to.toString());return!e||!n},ur.prototype.useProgram=function(t,e){void 0===e&&(e=this.emptyProgramConfiguration),this.cache=this.cache||{};var n=""+t+(e.cacheKey||"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[n]||(this.cache[n]=new An(this.context,pn[t],e,Vn[t],this._showOverdrawInspector)),this.cache[n]},ur.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()},ur.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)};var fr=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._posMatrixCache={},this._alignedPosMatrixCache={}},pr={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerPoint:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};fr.prototype.clone=function(){var t=new fr(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._calcMatrices(),t},pr.minZoom.get=function(){return this._minZoom},pr.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},pr.maxZoom.get=function(){return this._maxZoom},pr.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},pr.minPitch.get=function(){return this._minPitch},pr.minPitch.set=function(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))},pr.maxPitch.get=function(){return this._maxPitch},pr.maxPitch.set=function(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))},pr.renderWorldCopies.get=function(){return this._renderWorldCopies},pr.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t},pr.worldSize.get=function(){return this.tileSize*this.scale},pr.centerPoint.get=function(){return this.size._div(2)},pr.size.get=function(){return new t.Point(this.width,this.height)},pr.bearing.get=function(){return-this.angle/Math.PI*180},pr.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))},pr.pitch.get=function(){return this._pitch/Math.PI*180},pr.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())},pr.fov.get=function(){return this._fov/Math.PI*180},pr.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())},pr.zoom.get=function(){return this._zoom},pr.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())},pr.center.get=function(){return this._center},pr.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},fr.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)},fr.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)),c=s-1;c<=u+1;c++)0!==c&&n.push(new t.UnwrappedTileID(c,e));return n},fr.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=new t.Point(o*i.x-.5,o*i.y-.5);return function(e,n,r,i){void 0===i&&(i=!0);var o=1<<e,a={};function s(n,s,u){var c,l,h,f;if(u>=0&&u<=o)for(c=n;c<s;c++)l=Math.floor(c/o),h=(c%o+o)%o,0!==l&&!0!==i||(f=new t.OverscaledTileID(r,l,e,h,u),a[f.key]=f)}var u=n.map((function(e){return new t.Point(e.x,e.y)._mult(o)}));return hr(u[0],u[1],u[2],0,o,s),hr(u[2],u[3],u[0],0,o,s),Object.keys(a).map((function(t){return a[t]}))}(n,[this.pointCoordinate(new t.Point(0,0)),this.pointCoordinate(new t.Point(this.width,0)),this.pointCoordinate(new t.Point(this.width,this.height)),this.pointCoordinate(new t.Point(0,this.height))],e.reparseOverscaled?r:n,this._renderWorldCopies).sort((function(t,e){return a.dist(t.canonical)-a.dist(e.canonical)}))},fr.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()},pr.unmodified.get=function(){return this._unmodified},fr.prototype.zoomScale=function(t){return Math.pow(2,t)},fr.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},fr.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)},fr.prototype.unproject=function(e){return new t.MercatorCoordinate(e.x/this.worldSize,e.y/this.worldSize).toLngLat()},pr.point.get=function(){return this.project(this.center)},fr.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())},fr.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},fr.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},fr.prototype.locationCoordinate=function(e){return t.MercatorCoordinate.fromLngLat(e)},fr.prototype.coordinateLocation=function(t){return t.toLngLat()},fr.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[0]/i,s=r[0]/o,u=n[1]/i,c=r[1]/o,l=n[2]/i,h=r[2]/o,f=l===h?0:(0-l)/(h-l);return new t.MercatorCoordinate(t.number(a,s,f)/this.worldSize,t.number(u,c,f)/this.worldSize)},fr.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])},fr.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)))},fr.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},fr.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])},fr.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]},fr.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},fr.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,c=this.size,l=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<c.y?c.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<c.x?c.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=l,void(this._constraining=!1);if(this.latRange){var A=p.y,g=c.y/2;A-g<o&&(i=o+g),A+g>a&&(i=a-g)}if(this.lngRange){var m=p.x,y=c.x/2;m-y<s&&(r=s+y),m+y>u&&(r=u-y)}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=l,this._constraining=!1}},fr.prototype._calcMatrices=function(){if(this.height){this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var e=this._fov/2,n=Math.PI/2+this._pitch,r=Math.sin(e)*this.cameraToCenterDistance/Math.sin(Math.PI-n-e),i=this.point,o=i.x,a=i.y,s=1.01*(Math.cos(Math.PI/2-this._pitch)*r+this.cameraToCenterDistance),u=this.height/50,c=new Float64Array(16);t.perspective(c,this._fov,this.width/this.height,u,s),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,[-o,-a,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;var l=this.width%2/2,h=this.height%2/2,f=Math.cos(this.angle),p=Math.sin(this.angle),d=o-Math.round(o)+f*l+p*h,A=a-Math.round(a)+f*h+p*l,g=new Float64Array(c);if(t.translate(g,g,[d>.5?d-1:d,A>.5?A-1:A,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={}}},fr.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},fr.prototype.getCameraPoint=function(){var e=this._pitch,n=Math.tan(e)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.Point(0,n))},fr.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 c=u[s];r=Math.min(r,c.x),i=Math.min(i,c.y),o=Math.max(o,c.x),a=Math.max(a,c.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(fr.prototype,pr);var dr=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})};dr.prototype.addTo=function(e){return this._map=e,t.window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},dr.prototype.remove=function(){return t.window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},dr.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(),c=this._map.getPitch(),l="";if(l+=e?"/"+a+"/"+s+"/"+r:r+"/"+s+"/"+a,(u||c)&&(l+="/"+Math.round(10*u)/10),c&&(l+="/"+Math.round(c)),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+"="+l):t})).filter((function(t){return t}));return f||p.push(h+"="+l),"#"+p.join("&")}return"#"+l},dr.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("/")},dr.prototype._onHashChange=function(){var t=this._getCurrentHash();return t.length>=3&&!t.some((function(t){return isNaN(t)}))&&(this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:+(t[3]||0),pitch:+(t[4]||0)}),!0)},dr.prototype._updateHashUnthrottled=function(){var e=this.getHashString();try{t.window.history.replaceState(t.window.history.state,"",e)}catch(t){}};var Ar=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),r.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),gr=function(e){function r(r,i,o){var a=n.touchPos(i.getCanvasContainer(),o),s=a.map((function(t){return i.unproject(t)})),u=a.reduce((function(t,e,n,r){return t.add(e.div(r.length))}),new t.Point(0,0)),c=i.unproject(u);e.call(this,r,{points:a,point:u,lngLats:s,lngLat:c,originalEvent:o}),this._defaultPrevented=!1}e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.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),mr=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),e.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),yr=function(e){this._map=e,this._el=e.getCanvasContainer(),this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,t.bindAll(["_onWheel","_onTimeout","_onScrollFrame","_onScrollFinished"],this)};yr.prototype.setZoomRate=function(t){this._defaultZoomRate=t},yr.prototype.setWheelZoomRate=function(t){this._wheelZoomRate=t},yr.prototype.isEnabled=function(){return!!this._enabled},yr.prototype.isActive=function(){return!!this._active},yr.prototype.isZooming=function(){return!!this._zooming},yr.prototype.enable=function(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},yr.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},yr.prototype.onWheel=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.isActive()||this._start(e)),e.preventDefault()}},yr.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this.isActive()||this._start(t)},yr.prototype._start=function(e){if(this._delta){this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0,this._map.fire(new t.Event("movestart",{originalEvent:e})),this._map.fire(new t.Event("zoomstart",{originalEvent:e}))),this._finishTimeout&&clearTimeout(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=this._map._requestRenderFrame(this._onScrollFrame))}},yr.prototype._onScrollFrame=function(){var e=this;if(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="number"==typeof this._targetZoom?this._targetZoom:n.zoom,s=this._startZoom,u=this._easing,c=!1;if("wheel"===this._type&&s&&u){var l=Math.min((t.browser.now()-this._lastWheelEventTime)/200,1),h=u(l);n.zoom=t.number(s,a,h),l<1?this._frameId||(this._frameId=this._map._requestRenderFrame(this._onScrollFrame)):c=!0}else n.zoom=a,c=!0;n.setLocationAtPoint(this._around,this._aroundPoint),this._map.fire(new t.Event("move",{originalEvent:this._lastWheelEvent})),this._map.fire(new t.Event("zoom",{originalEvent:this._lastWheelEvent})),c&&(this._active=!1,this._finishTimeout=setTimeout((function(){e._zooming=!1,e._map.fire(new t.Event("zoomend",{originalEvent:e._lastWheelEvent})),e._map.fire(new t.Event("moveend",{originalEvent:e._lastWheelEvent})),delete e._targetZoom}),200))}},yr.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};var vr=function(e,n){this._map=e,this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=n.clickTolerance||1,t.bindAll(["_onMouseMove","_onMouseUp","_onKeyDown"],this)};vr.prototype.isEnabled=function(){return!!this._enabled},vr.prototype.isActive=function(){return!!this._active},vr.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},vr.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},vr.prototype.onMouseDown=function(e){this.isEnabled()&&e.shiftKey&&0===e.button&&(t.window.document.addEventListener("mousemove",this._onMouseMove,!1),t.window.document.addEventListener("keydown",this._onKeyDown,!1),t.window.document.addEventListener("mouseup",this._onMouseUp,!1),n.disableDrag(),this._startPos=this._lastPos=n.mousePos(this._el,e),this._active=!0)},vr.prototype._onMouseMove=function(t){var e=n.mousePos(this._el,t);if(!(this._lastPos.equals(e)||!this._box&&e.dist(this._startPos)<this._clickTolerance)){var r=this._startPos;this._lastPos=e,this._box||(this._box=n.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",t));var i=Math.min(r.x,e.x),o=Math.max(r.x,e.x),a=Math.min(r.y,e.y),s=Math.max(r.y,e.y);n.setTransform(this._box,"translate("+i+"px,"+a+"px)"),this._box.style.width=o-i+"px",this._box.style.height=s-a+"px"}},vr.prototype._onMouseUp=function(e){if(0===e.button){var r=this._startPos,i=n.mousePos(this._el,e);this._finish(),n.suppressClick(),r.x===i.x&&r.y===i.y?this._fireEvent("boxzoomcancel",e):this._map.fitScreenCoordinates(r,i,this._map.getBearing(),{linear:!0}).fire(new t.Event("boxzoomend",{originalEvent:e}))}},vr.prototype._onKeyDown=function(t){27===t.keyCode&&(this._finish(),this._fireEvent("boxzoomcancel",t))},vr.prototype._finish=function(){this._active=!1,t.window.document.removeEventListener("mousemove",this._onMouseMove,!1),t.window.document.removeEventListener("keydown",this._onKeyDown,!1),t.window.document.removeEventListener("mouseup",this._onMouseUp,!1),this._container.classList.remove("mapboxgl-crosshair"),this._box&&(n.remove(this._box),this._box=null),n.enableDrag(),delete this._startPos,delete this._lastPos},vr.prototype._fireEvent=function(e,n){return this._map.fire(new t.Event(e,{originalEvent:n}))};var _r=t.bezier(0,0,.25,1),br=function(e,n){this._map=e,this._el=n.element||e.getCanvasContainer(),this._state="disabled",this._button=n.button||"right",this._bearingSnap=n.bearingSnap||0,this._pitchWithRotate=!1!==n.pitchWithRotate,t.bindAll(["onMouseDown","_onMouseMove","_onMouseUp","_onBlur","_onDragFrame"],this)};br.prototype.isEnabled=function(){return"disabled"!==this._state},br.prototype.isActive=function(){return"active"===this._state},br.prototype.enable=function(){this.isEnabled()||(this._state="enabled")},br.prototype.disable=function(){if(this.isEnabled())switch(this._state){case"active":this._state="disabled",this._unbind(),this._deactivate(),this._fireEvent("rotateend"),this._pitchWithRotate&&this._fireEvent("pitchend"),this._fireEvent("moveend");break;case"pending":this._state="disabled",this._unbind();break;default:this._state="disabled"}},br.prototype.onMouseDown=function(e){if("enabled"===this._state){var r="touchstart"===e.type;if(r)this._startTime=Date.now();else if("right"===this._button){if(this._eventButton=n.mouseButton(e),this._eventButton!==(e.ctrlKey?0:2))return}else{if(e.ctrlKey||0!==n.mouseButton(e))return;this._eventButton=0}n.disableDrag(),r?(t.window.document.addEventListener("touchmove",this._onMouseMove,{capture:!0}),t.window.document.addEventListener("touchend",this._onMouseUp)):(t.window.document.addEventListener("mousemove",this._onMouseMove,{capture:!0}),t.window.document.addEventListener("mouseup",this._onMouseUp)),t.window.addEventListener("blur",this._onBlur),this._state="pending",this._inertia=[[t.browser.now(),this._map.getBearing()]],this._startPos=this._prevPos=this._lastPos=n.mousePos(this._el,e),this._center=this._map.transform.centerPoint,e.preventDefault()}},br.prototype._onMouseMove=function(t){var e=n.mousePos(this._el,t);this._lastPos.equals(e)||(this._lastMoveEvent=t,this._lastPos=e,"pending"===this._state&&(this._state="active",this._fireEvent("rotatestart",t),this._fireEvent("movestart",t),this._pitchWithRotate&&this._fireEvent("pitchstart",t)),this._frameId||(this._frameId=this._map._requestRenderFrame(this._onDragFrame)))},br.prototype._onDragFrame=function(){this._frameId=null;var e=this._lastMoveEvent;if(e){var n=this._map.transform,r=this._prevPos,i=this._lastPos,o=.8*(r.x-i.x),a=-.5*(r.y-i.y),s=n.bearing-o,u=n.pitch-a,c=this._inertia,l=c[c.length-1];this._drainInertiaBuffer(),c.push([t.browser.now(),this._map._normalizeBearing(s,l[1])]);var h=n.bearing;if(n.bearing=s,this._pitchWithRotate){var f=n.pitch;n.pitch=u,n.pitch!==f&&this._fireEvent("pitch",e)}n.bearing!==h&&this._fireEvent("rotate",e),this._fireEvent("move",e),delete this._lastMoveEvent,this._prevPos=this._lastPos}},br.prototype._onMouseUp=function(t){if("touchend"===t.type&&this._startPos===this._lastPos&&Date.now()-this._startTime<300&&this._el.click(),n.mouseButton(t)===this._eventButton)switch(this._state){case"active":this._state="enabled",n.suppressClick(),this._unbind(),this._deactivate(),this._inertialRotate(t);break;case"pending":this._state="enabled",this._unbind()}},br.prototype._onBlur=function(t){switch(this._state){case"active":this._state="enabled",this._unbind(),this._deactivate(),this._fireEvent("rotateend",t),this._pitchWithRotate&&this._fireEvent("pitchend",t),this._fireEvent("moveend",t);break;case"pending":this._state="enabled",this._unbind()}},br.prototype._unbind=function(){t.window.document.removeEventListener("mousemove",this._onMouseMove,{capture:!0}),t.window.document.removeEventListener("mouseup",this._onMouseUp),t.window.document.removeEventListener("touchmove",this._onMouseMove,{capture:!0}),t.window.document.removeEventListener("touchend",this._onMouseUp),t.window.removeEventListener("blur",this._onBlur),n.enableDrag()},br.prototype._deactivate=function(){this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),delete this._lastMoveEvent,delete this._startPos,delete this._prevPos,delete this._lastPos},br.prototype._inertialRotate=function(t){var e=this;this._fireEvent("rotateend",t),this._drainInertiaBuffer();var n=this._map,r=n.getBearing(),i=this._inertia,o=function(){Math.abs(r)<e._bearingSnap?n.resetNorth({noMoveStart:!0},{originalEvent:t}):e._fireEvent("moveend",t),e._pitchWithRotate&&e._fireEvent("pitchend",t)};if(i.length<2)o();else{var a=i[0],s=i[i.length-1],u=i[i.length-2],c=n._normalizeBearing(r,u[1]),l=s[1]-a[1],h=l<0?-1:1,f=(s[0]-a[0])/1e3;if(0!==l&&0!==f){var p=Math.abs(l*(.25/f));p>180&&(p=180);var d=p/180;c+=h*p*(d/2),Math.abs(n._normalizeBearing(c,0))<this._bearingSnap&&(c=n._normalizeBearing(0,c)),n.rotateTo(c,{duration:1e3*d,easing:_r,noMoveStart:!0},{originalEvent:t})}else o()}},br.prototype._fireEvent=function(e,n){return this._map.fire(new t.Event(e,n?{originalEvent:n}:{}))},br.prototype._drainInertiaBuffer=function(){for(var e=this._inertia,n=t.browser.now();e.length>0&&n-e[0][0]>160;)e.shift()};var xr={linearity:.3,easing:t.bezier(0,0,.3,1),maxSpeed:1400,deceleration:2500},wr=function(e,n){this._map=e,this._el=e.getCanvasContainer(),this._state="disabled",this._clickTolerance=n.clickTolerance||1,this._inertiaOptions=xr,t.bindAll(["_onMove","_onMouseUp","_onTouchEnd","_onBlur","_onDragFrame"],this)};wr.prototype.isEnabled=function(){return"disabled"!==this._state},wr.prototype.isActive=function(){return"active"===this._state},wr.prototype.enable=function(e){this.isEnabled()||(this._el.classList.add("mapboxgl-touch-drag-pan"),this._state="enabled",this._inertiaOptions=t.extend(xr,e))},wr.prototype.disable=function(){if(this.isEnabled())switch(this._el.classList.remove("mapboxgl-touch-drag-pan"),this._state){case"active":this._state="disabled",this._unbind(),this._deactivate(),this._fireEvent("dragend"),this._fireEvent("moveend");break;case"pending":this._state="disabled",this._unbind();break;default:this._state="disabled"}},wr.prototype.onMouseDown=function(e){"enabled"===this._state&&(e.ctrlKey||0!==n.mouseButton(e)||(n.addEventListener(t.window.document,"mousemove",this._onMove,{capture:!0}),n.addEventListener(t.window.document,"mouseup",this._onMouseUp),this._start(e)))},wr.prototype.onTouchStart=function(e){this.isEnabled()&&(e.touches&&e.touches.length>1&&("pending"===this._state||"active"===this._state)||(n.addEventListener(t.window.document,"touchmove",this._onMove,{capture:!0,passive:!1}),n.addEventListener(t.window.document,"touchend",this._onTouchEnd),this._start(e)))},wr.prototype._start=function(e){t.window.addEventListener("blur",this._onBlur),this._state="pending",this._startPos=this._mouseDownPos=this._prevPos=this._lastPos=n.mousePos(this._el,e),this._startTouch=this._lastTouch=t.window.TouchEvent&&e instanceof t.window.TouchEvent?n.touchPos(this._el,e):null,this._inertia=[[t.browser.now(),this._startPos]]},wr.prototype._touchesMatch=function(t,e){return!(!t||!e||t.length!==e.length)&&t.every((function(t,n){return e[n]===t}))},wr.prototype._onMove=function(e){e.preventDefault();var r=t.window.TouchEvent&&e instanceof t.window.TouchEvent?n.touchPos(this._el,e):null,i=n.mousePos(this._el,e);(r?this._touchesMatch(this._lastTouch,r):this._lastPos.equals(i))||"pending"===this._state&&i.dist(this._mouseDownPos)<this._clickTolerance||(this._lastMoveEvent=e,this._lastPos=i,this._lastTouch=r,this._drainInertiaBuffer(),this._inertia.push([t.browser.now(),this._lastPos]),"pending"===this._state&&(this._state="active",this._shouldStart=!0),this._frameId||(this._frameId=this._map._requestRenderFrame(this._onDragFrame)))},wr.prototype._onDragFrame=function(){this._frameId=null;var t=this._lastMoveEvent;if(t)if(this._map.touchZoomRotate.isActive())this._abort(t);else if(this._shouldStart&&(this._fireEvent("dragstart",t),this._fireEvent("movestart",t),this._shouldStart=!1),this.isActive()){var e=this._map.transform;e.setLocationAtPoint(e.pointLocation(this._prevPos),this._lastPos),this._fireEvent("drag",t),this._fireEvent("move",t),this._prevPos=this._lastPos,delete this._lastMoveEvent}},wr.prototype._onMouseUp=function(t){if(0===n.mouseButton(t))switch(this._state){case"active":this._state="enabled",n.suppressClick(),this._unbind(),this._deactivate(),this._inertialPan(t);break;case"pending":this._state="enabled",this._unbind()}},wr.prototype._onTouchEnd=function(t){if(t.touches&&0!==t.touches.length)switch(this._state){case"pending":case"active":break;case"enabled":this.onTouchStart(t)}else switch(this._state){case"active":this._state="enabled",this._unbind(),this._deactivate(),this._inertialPan(t);break;case"pending":this._state="enabled",this._unbind();break;case"enabled":this._unbind()}},wr.prototype._abort=function(e){switch(this._state){case"active":this._state="enabled",this._shouldStart||(this._fireEvent("dragend",e),this._fireEvent("moveend",e)),this._unbind(),this._deactivate(),t.window.TouchEvent&&e instanceof t.window.TouchEvent&&e.touches.length>1&&n.addEventListener(t.window.document,"touchend",this._onTouchEnd);break;case"pending":this._state="enabled",this._unbind();break;case"enabled":this._unbind()}},wr.prototype._onBlur=function(t){this._abort(t)},wr.prototype._unbind=function(){n.removeEventListener(t.window.document,"touchmove",this._onMove,{capture:!0,passive:!1}),n.removeEventListener(t.window.document,"touchend",this._onTouchEnd),n.removeEventListener(t.window.document,"mousemove",this._onMove,{capture:!0}),n.removeEventListener(t.window.document,"mouseup",this._onMouseUp),n.removeEventListener(t.window,"blur",this._onBlur)},wr.prototype._deactivate=function(){this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),delete this._lastMoveEvent,delete this._startPos,delete this._prevPos,delete this._mouseDownPos,delete this._lastPos,delete this._startTouch,delete this._lastTouch,delete this._shouldStart},wr.prototype._inertialPan=function(t){this._fireEvent("dragend",t),this._drainInertiaBuffer();var e=this._inertia;if(e.length<2)this._fireEvent("moveend",t);else{var n=e[e.length-1],r=e[0],i=n[1].sub(r[1]),o=(n[0]-r[0])/1e3;if(0===o||n[1].equals(r[1]))this._fireEvent("moveend",t);else{var a=this._inertiaOptions,s=a.linearity,u=a.easing,c=a.maxSpeed,l=a.deceleration,h=i.mult(s/o),f=h.mag();f>c&&(f=c,h._unit()._mult(f));var p=f/(l*s),d=h.mult(-p/2);this._map.panBy(d,{duration:1e3*p,easing:u,noMoveStart:!0},{originalEvent:t})}}},wr.prototype._fireEvent=function(e,n){return this._map.fire(new t.Event(e,n?{originalEvent:n}:{}))},wr.prototype._drainInertiaBuffer=function(){for(var e=this._inertia,n=t.browser.now();e.length>0&&n-e[0][0]>160;)e.shift()};var Er=function(e){this._map=e,this._el=e.getCanvasContainer(),t.bindAll(["_onKeyDown"],this)};function Or(t){return t*(2-t)}Er.prototype.isEnabled=function(){return!!this._enabled},Er.prototype.enable=function(){this.isEnabled()||(this._el.addEventListener("keydown",this._onKeyDown,!1),this._enabled=!0)},Er.prototype.disable=function(){this.isEnabled()&&(this._el.removeEventListener("keydown",this._onKeyDown),this._enabled=!1)},Er.prototype._onKeyDown=function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e=0,n=0,r=0,i=0,o=0;switch(t.keyCode){case 61:case 107:case 171:case 187:e=1;break;case 189:case 109:case 173:e=-1;break;case 37:t.shiftKey?n=-1:(t.preventDefault(),i=-1);break;case 39:t.shiftKey?n=1:(t.preventDefault(),i=1);break;case 38:t.shiftKey?r=1:(t.preventDefault(),o=-1);break;case 40:t.shiftKey?r=-1:(o=1,t.preventDefault());break;default:return}var a=this._map,s=a.getZoom(),u={duration:300,delayEndEvents:500,easing:Or,zoom:e?Math.round(s)+e*(t.shiftKey?2:1):s,bearing:a.getBearing()+15*n,pitch:a.getPitch()+10*r,offset:[100*-i,100*-o],center:a.getCenter()};a.easeTo(u,{originalEvent:t})}};var Sr=function(e){this._map=e,t.bindAll(["_onDblClick","_onZoomEnd"],this)};Sr.prototype.isEnabled=function(){return!!this._enabled},Sr.prototype.isActive=function(){return!!this._active},Sr.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},Sr.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Sr.prototype.onTouchStart=function(t){var e=this;if(this.isEnabled()&&!(t.points.length>1))if(this._tapped){var n=t.points[0],r=this._tappedPoint;if(r&&r.dist(n)<=30){t.originalEvent.preventDefault();var i=function(){e._tapped&&e._zoom(t),e._map.off("touchcancel",o),e._resetTapped()},o=function(){e._map.off("touchend",i),e._resetTapped()};this._map.once("touchend",i),this._map.once("touchcancel",o)}else this._resetTapped()}else this._tappedPoint=t.points[0],this._tapped=setTimeout((function(){e._tapped=null,e._tappedPoint=null}),300)},Sr.prototype._resetTapped=function(){clearTimeout(this._tapped),this._tapped=null,this._tappedPoint=null},Sr.prototype.onDblClick=function(t){this.isEnabled()&&(t.originalEvent.preventDefault(),this._zoom(t))},Sr.prototype._zoom=function(t){this._active=!0,this._map.on("zoomend",this._onZoomEnd),this._map.zoomTo(this._map.getZoom()+(t.originalEvent.shiftKey?-1:1),{around:t.lngLat},t)},Sr.prototype._onZoomEnd=function(){this._active=!1,this._map.off("zoomend",this._onZoomEnd)};var Tr=t.bezier(0,0,.15,1),Cr=function(e){this._map=e,this._el=e.getCanvasContainer(),t.bindAll(["_onMove","_onEnd","_onTouchFrame"],this)};Cr.prototype.isEnabled=function(){return!!this._enabled},Cr.prototype.enable=function(t){this.isEnabled()||(this._el.classList.add("mapboxgl-touch-zoom-rotate"),this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around)},Cr.prototype.disable=function(){this.isEnabled()&&(this._el.classList.remove("mapboxgl-touch-zoom-rotate"),this._enabled=!1)},Cr.prototype.disableRotation=function(){this._rotationDisabled=!0},Cr.prototype.enableRotation=function(){this._rotationDisabled=!1},Cr.prototype.isActive=function(){return this.isEnabled()&&!!this._gestureIntent},Cr.prototype.onStart=function(e){if(this.isEnabled()&&2===e.touches.length){var r=n.mousePos(this._el,e.touches[0]),i=n.mousePos(this._el,e.touches[1]),o=r.add(i).div(2);this._startVec=r.sub(i),this._startAround=this._map.transform.pointLocation(o),this._gestureIntent=void 0,this._inertia=[],n.addEventListener(t.window.document,"touchmove",this._onMove,{passive:!1}),n.addEventListener(t.window.document,"touchend",this._onEnd)}},Cr.prototype._getTouchEventData=function(t){var e=n.mousePos(this._el,t.touches[0]),r=n.mousePos(this._el,t.touches[1]),i=e.sub(r);return{vec:i,center:e.add(r).div(2),scale:i.mag()/this._startVec.mag(),bearing:this._rotationDisabled?0:180*i.angleWith(this._startVec)/Math.PI}},Cr.prototype._onMove=function(e){if(2===e.touches.length){var n=this._getTouchEventData(e),r=n.vec,i=n.scale,o=n.bearing;if(!this._gestureIntent){var a=this._rotationDisabled&&1!==i||Math.abs(1-i)>.15;Math.abs(o)>10?this._gestureIntent="rotate":a&&(this._gestureIntent="zoom"),this._gestureIntent&&(this._map.fire(new t.Event(this._gestureIntent+"start",{originalEvent:e})),this._map.fire(new t.Event("movestart",{originalEvent:e})),this._startVec=r)}this._lastTouchEvent=e,this._frameId||(this._frameId=this._map._requestRenderFrame(this._onTouchFrame)),e.preventDefault()}},Cr.prototype._onTouchFrame=function(){this._frameId=null;var e=this._gestureIntent;if(e){var n=this._map.transform;this._startScale||(this._startScale=n.scale,this._startBearing=n.bearing);var r=this._getTouchEventData(this._lastTouchEvent),i=r.center,o=r.bearing,a=r.scale,s=n.pointLocation(i),u=n.locationPoint(s);"rotate"===e&&(n.bearing=this._startBearing+o),n.zoom=n.scaleZoom(this._startScale*a),n.setLocationAtPoint(this._startAround,u),this._map.fire(new t.Event(e,{originalEvent:this._lastTouchEvent})),this._map.fire(new t.Event("move",{originalEvent:this._lastTouchEvent})),this._drainInertiaBuffer(),this._inertia.push([t.browser.now(),a,i])}},Cr.prototype._onEnd=function(e){n.removeEventListener(t.window.document,"touchmove",this._onMove,{passive:!1}),n.removeEventListener(t.window.document,"touchend",this._onEnd);var r=this._gestureIntent,i=this._startScale;if(this._frameId&&(this._map._cancelRenderFrame(this._frameId),this._frameId=null),delete this._gestureIntent,delete this._startScale,delete this._startBearing,delete this._lastTouchEvent,r){this._map.fire(new t.Event(r+"end",{originalEvent:e})),this._drainInertiaBuffer();var o=this._inertia,a=this._map;if(o.length<2)a.snapToNorth({},{originalEvent:e});else{var s=o[o.length-1],u=o[0],c=a.transform.scaleZoom(i*s[1]),l=a.transform.scaleZoom(i*u[1]),h=c-l,f=(s[0]-u[0])/1e3,p=s[2];if(0!==f&&c!==l){var d=.15*h/f;Math.abs(d)>2.5&&(d=d>0?2.5:-2.5);var A=1e3*Math.abs(d/(12*.15)),g=c+d*A/2e3;a.easeTo({zoom:g,duration:A,easing:Tr,around:this._aroundCenter?a.getCenter():a.unproject(p),noMoveStart:!0},{originalEvent:e})}else a.snapToNorth({},{originalEvent:e})}}},Cr.prototype._drainInertiaBuffer=function(){for(var e=this._inertia,n=t.browser.now();e.length>2&&n-e[0][0]>160;)e.shift()};var Pr={scrollZoom:yr,boxZoom:vr,dragRotate:br,dragPan:wr,keyboard:Er,doubleClickZoom:Sr,touchZoomRotate:Cr},Mr=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),n.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.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){return e=t.LngLatBounds.convert(e),this._cameraForBoxAndBearing(e.getNorthWest(),e.getSouthEast(),0,n)},n.prototype._cameraForBoxAndBearing=function(e,n,r,i){if("number"==typeof(i=t.extend({padding:{top:0,bottom:0,right:0,left:0},offset:[0,0],maxZoom:this.transform.maxZoom},i)).padding){var o=i.padding;i.padding={top:o,bottom:o,right:o,left:o}}if(t.deepEqual(Object.keys(i.padding).sort((function(t,e){return t<e?-1:t>e?1:0})),["bottom","left","right","top"])){var a=this.transform,s=a.project(t.LngLat.convert(e)),u=a.project(t.LngLat.convert(n)),c=s.rotate(-r*Math.PI/180),l=u.rotate(-r*Math.PI/180),h=new t.Point(Math.max(c.x,l.x),Math.max(c.y,l.y)),f=new t.Point(Math.min(c.x,l.x),Math.min(c.y,l.y)),p=h.sub(f),d=(a.width-i.padding.left-i.padding.right)/p.x,A=(a.height-i.padding.top-i.padding.bottom)/p.y;if(!(A<0||d<0)){var g=Math.min(a.scaleZoom(a.scale*Math.min(d,A)),i.maxZoom),m=t.Point.convert(i.offset),y=(i.padding.left-i.padding.right)/2,v=(i.padding.top-i.padding.bottom)/2,_=new t.Point(m.x+y,m.y+v).mult(a.scale/a.zoomScale(g));return{center:a.unproject(s.add(u).div(2).sub(_)),zoom:g,bearing:r}}t.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.")}else t.warnOnce("options.padding must be a positive number, or an Object with keys 'bottom', 'left', 'right', 'top'")},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?(n=t.extend(e,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),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=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="zoom"in e?+e.zoom:o,c="bearing"in e?this._normalizeBearing(e.bearing,a):a,l="pitch"in e?+e.pitch:s,h=i.centerPoint.add(t.Point.convert(e.offset)),f=i.pointLocation(h),p=t.LngLat.convert(e.center||f);this._normalizeCenter(p);var d,A,g=i.project(f),m=i.project(p).sub(g),y=i.zoomScale(u-o);return e.around&&(d=t.LngLat.convert(e.around),A=i.locationPoint(d)),this._zooming=u!==o,this._rotating=a!==c,this._pitching=l!==s,this._prepareEase(n,e.noMoveStart),clearTimeout(this._easeEndTimeoutID),this._ease((function(e){if(r._zooming&&(i.zoom=t.number(o,u,e)),r._rotating&&(i.bearing=t.number(a,c,e)),r._pitching&&(i.pitch=t.number(s,l,e)),d)i.setLocationAtPoint(d,A);else{var f=i.zoomScale(i.zoom-o),p=u>o?Math.min(2,y):Math.max(.5,y),v=Math.pow(p,1-e),_=i.unproject(g.add(m.mult(e*v)).mult(f));i.setLocationAtPoint(i.renderWorldCopies?_.wrap():_,h)}r._fireMoveEvents(n)}),(function(){e.delayEndEvents?r._easeEndTimeoutID=setTimeout((function(){return r._afterEase(n)}),e.delayEndEvents):r._afterEase(n)}),e),this},n.prototype._prepareEase=function(e,n){this._moving=!0,n||this.fire(new t.Event("movestart",e)),this._zooming&&this.fire(new t.Event("zoomstart",e)),this._rotating&&this.fire(new t.Event("rotatestart",e)),this._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){var n=this._zooming,r=this._rotating,i=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,n&&this.fire(new t.Event("zoomend",e)),r&&this.fire(new t.Event("rotateend",e)),i&&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(),c="zoom"in e?t.clamp(+e.zoom,o.minZoom,o.maxZoom):a,l="bearing"in e?this._normalizeBearing(e.bearing,s):s,h="pitch"in e?+e.pitch:u,f=o.zoomScale(c-a),p=o.centerPoint.add(t.Point.convert(e.offset)),d=o.pointLocation(p),A=t.LngLat.convert(e.center||d);this._normalizeCenter(A);var g=o.project(d),m=o.project(A).sub(g),y=e.curve,v=Math.max(o.width,o.height),_=v/f,b=m.mag();if("minZoom"in e){var x=t.clamp(Math.min(e.minZoom,a,c),o.minZoom,o.maxZoom),w=v/o.zoomScale(x-a);y=Math.sqrt(w/b*2)}var E=y*y;function O(t){var e=(_*_-v*v+(t?-1:1)*E*E*b*b)/(2*(t?_:v)*E*b);return Math.log(Math.sqrt(e*e+1)-e)}function S(t){return(Math.exp(t)-Math.exp(-t))/2}function T(t){return(Math.exp(t)+Math.exp(-t))/2}var C=O(0),P=function(t){return T(C)/T(C+y*t)},M=function(t){return v*((T(C)*(S(e=C+y*t)/T(e))-S(C))/E)/b;var e},I=(O(1)-C)/y;if(Math.abs(b)<1e-6||!isFinite(I)){if(Math.abs(v-_)<1e-6)return this.easeTo(e,n);var B=_<v?-1:1;I=Math.abs(Math.log(_/v))/y,M=function(){return 0},P=function(t){return Math.exp(B*y*t)}}if("duration"in e)e.duration=+e.duration;else{var R="screenSpeed"in e?+e.screenSpeed/y:+e.speed;e.duration=1e3*I/R}return e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=s!==l,this._pitching=h!==u,this._prepareEase(n,!1),this._ease((function(e){var i=e*I,f=1/P(i);o.zoom=1===e?c:a+o.scaleZoom(f),r._rotating&&(o.bearing=t.number(s,l,e)),r._pitching&&(o.pitch=t.number(u,h,e));var d=1===e?A:o.unproject(g.add(m.mult(M(i))).mult(f));o.setLocationAtPoint(o.renderWorldCopies?d.wrap():d,p),r._fireMoveEvents(n)}),(function(){return r._afterEase(n)}),e),this},n.prototype.isEasing=function(){return!!this._easeFrameId},n.prototype.stop=function(){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var t=this._onEaseEnd;delete this._onEaseEnd,t.call(this)}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),Ir=function(e){void 0===e&&(e={}),this.options=e,t.bindAll(["_updateEditLink","_updateData","_updateCompact"],this)};Ir.prototype.getDefaultPosition=function(){return"bottom-right"},Ir.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._innerContainer=n.create("div","mapboxgl-ctrl-attrib-inner",this._container),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},Ir.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},Ir.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"}},Ir.prototype._updateData=function(t){!t||"metadata"!==t.sourceDataType&&"style"!==t.dataType||(this._updateAttributions(),this._updateEditLink())},Ir.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)}},Ir.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact")};var Br=function(){t.bindAll(["_updateLogo"],this),t.bindAll(["_updateCompact"],this)};Br.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},Br.prototype.onRemove=function(){n.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},Br.prototype.getDefaultPosition=function(){return"bottom-left"},Br.prototype._updateLogo=function(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")},Br.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}},Br.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 Rr=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};Rr.prototype.add=function(t){var e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e},Rr.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)}},Rr.prototype.run=function(){var t=this._currentlyRunning=this._queue;this._queue=[];for(var e=0,n=t;e<n.length;e+=1){var r=n[e];if(!r.cancelled&&(r.callback(),this._cleared))break}this._cleared=!1,this._currentlyRunning=!1},Rr.prototype.clear=function(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]};var kr={"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"},Lr=t.window.HTMLImageElement,Dr=t.window.HTMLElement,jr={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,bearingSnap:7,clickTolerance:3,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},Fr=function(r){function i(e){var i=this;if(null!=(e=t.extend({},jr,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 o=new fr(e.minZoom,e.maxZoom,e.minPitch,e.maxPitch,e.renderWorldCopies);if(r.call(this,o,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 Rr,this._controls=[],this._mapId=t.uniqueId(),this._locale=t.extend({},kr,e.locale),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 Dr))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","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",(function(){return i._update(!1)})),this.on("moveend",(function(){return i._update(!1)})),this.on("zoom",(function(){return i._update(!0)})),void 0!==t.window&&(t.window.addEventListener("online",this._onWindowOnline,!1),t.window.addEventListener("resize",this._onWindowResize,!1)),function(t,e){var r=t.getCanvasContainer(),i=null,o=!1,a=null;for(var s in Pr)t[s]=new Pr[s](t,e),e.interactive&&e[s]&&t[s].enable(e[s]);n.addEventListener(r,"mouseout",(function(e){t.fire(new Ar("mouseout",t,e))})),n.addEventListener(r,"mousedown",(function(i){o=!0,a=n.mousePos(r,i);var s=new Ar("mousedown",t,i);t.fire(s),s.defaultPrevented||(e.interactive&&!t.doubleClickZoom.isActive()&&t.stop(),t.boxZoom.onMouseDown(i),t.boxZoom.isActive()||t.dragPan.isActive()||t.dragRotate.onMouseDown(i),t.boxZoom.isActive()||t.dragRotate.isActive()||t.dragPan.onMouseDown(i))})),n.addEventListener(r,"mouseup",(function(e){var n=t.dragRotate.isActive();i&&!n&&t.fire(new Ar("contextmenu",t,i)),i=null,o=!1,t.fire(new Ar("mouseup",t,e))})),n.addEventListener(r,"mousemove",(function(e){if(!t.dragPan.isActive()&&!t.dragRotate.isActive()){for(var n=e.target;n&&n!==r;)n=n.parentNode;n===r&&t.fire(new Ar("mousemove",t,e))}})),n.addEventListener(r,"mouseover",(function(e){for(var n=e.target;n&&n!==r;)n=n.parentNode;n===r&&t.fire(new Ar("mouseover",t,e))})),n.addEventListener(r,"touchstart",(function(n){var r=new gr("touchstart",t,n);t.fire(r),r.defaultPrevented||(e.interactive&&t.stop(),t.boxZoom.isActive()||t.dragRotate.isActive()||t.dragPan.onTouchStart(n),t.touchZoomRotate.onStart(n),t.doubleClickZoom.onTouchStart(r))}),{passive:!1}),n.addEventListener(r,"touchmove",(function(e){t.fire(new gr("touchmove",t,e))}),{passive:!1}),n.addEventListener(r,"touchend",(function(e){t.fire(new gr("touchend",t,e))})),n.addEventListener(r,"touchcancel",(function(e){t.fire(new gr("touchcancel",t,e))})),n.addEventListener(r,"click",(function(i){var o=n.mousePos(r,i);(!a||o.equals(a)||o.dist(a)<e.clickTolerance)&&t.fire(new Ar("click",t,i))})),n.addEventListener(r,"dblclick",(function(e){var n=new Ar("dblclick",t,e);t.fire(n),n.defaultPrevented||t.doubleClickZoom.onDblClick(n)})),n.addEventListener(r,"contextmenu",(function(e){var n=t.dragRotate.isActive();o||n?o&&(i=e):t.fire(new Ar("contextmenu",t,e)),(t.dragRotate.isEnabled()||t.listens("contextmenu"))&&e.preventDefault()})),n.addEventListener(r,"wheel",(function(n){e.interactive&&t.stop();var r=new mr("wheel",t,n);t.fire(r),r.defaultPrevented||t.scrollZoom.onWheel(n)}),{passive:!1})}(this,e);var a="string"==typeof e.hash&&e.hash||void 0;this._hash=e.hash&&new dr(a).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 Ir({customAttribution:e.customAttribution})),this.addControl(new Br,e.logoPosition),this.on("style.load",(function(){i.transform.unmodified&&i.jumpTo(i.style.stylesheet)})),this.on("data",(function(e){i._update("style"===e.dataType),i.fire(new t.Event(e.dataType+"data",e))})),this.on("dataloading",(function(e){i.fire(new t.Event(e.dataType+"dataloading",e))}))}r&&(i.__proto__=r),i.prototype=Object.create(r&&r.prototype),i.prototype.constructor=i;var o={showTileBoundaries:{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&&e.getDefaultPosition&&(n=e.getDefaultPosition()),void 0===n&&(n="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.resize=function(e){var n=this._containerDimensions(),r=n[0],i=n[1];return this._resizeCanvas(r,i),this.transform.resize(r,i),this.painter.resize(r,i),this.fire(new t.Event("movestart",e)).fire(new t.Event("move",e)).fire(new t.Event("resize",e)).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.dragPan.isActive()||this.dragRotate.isActive()||this.scrollZoom.isActive()},i.prototype.isZooming=function(){return this._zooming||this.scrollZoom.isZooming()},i.prototype.isRotating=function(){return this._rotating||this.dragRotate.isActive()},i.prototype.on=function(t,e,n){var i=this;if(void 0===n)return r.prototype.on.call(this,t,e);var o=function(){var r;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 Ar(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 Ar(t,i,r.originalEvent)))},mouseout:function(e){a&&(a=!1,n.call(i,new Ar(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)}}();for(var a in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(o),o.delegates)this.on(a,o.delegates[a]);return this},i.prototype.off=function(t,e,n){if(void 0===n)return r.prototype.off.call(this,t,e);if(this._delegatedListeners&&this._delegatedListeners[t])for(var i=this._delegatedListeners[t],o=0;o<i.length;o++){var a=i[o];if(a.layer===e&&a.listener===n){for(var s in a.delegates)this.off(s,a.delegates[s]);return i.splice(o,1),this}}return 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._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.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.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(n instanceof Lr){var c=t.browser.getImageData(n),l=c.width,h=c.height,f=c.data;this.style.addImage(e,{data:new t.RGBAImage({width:l,height:h},f),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`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));var p=n.width,d=n.height,A=n.data,g=n;this.style.addImage(e,{data:new t.RGBAImage({width:p,height:d},new Uint8Array(A)),pixelRatio:i,stretchX:a,stretchY:s,content:u,sdf:o,version:0,userImage:g}),g.onAdd&&g.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 Lr?t.browser.getImageData(n):n,o=i.width,a=i.height,s=i.data;if(void 0===o||void 0===a)return this.fire(new t.ErrorEvent(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(o!==r.data.width||a!==r.data.height)return 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")));var u=!(n instanceof Lr);r.data.replace(s,u),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.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.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 in 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.style.position="absolute",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");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)}))},i.prototype._resizeCanvas=function(e,n){var r=t.window.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 ur(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.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(){var e,n=this,r=0,i=this.painter.context.extTimerQuery;this.listens("gpu-timing-frame")&&(e=i.createQueryEXT(),i.beginQueryEXT(i.TIME_ELAPSED_EXT,e),r=t.browser.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run();var o=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;var a=this.transform.zoom,s=t.browser.now();this.style.zoomHistory.update(a,s);var u=new t.EvaluationParameters(a,{now:s,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),c=u.crossFadingFactor();1===c&&c===this._crossFadingFactor||(o=!0,this._crossFadingFactor=c),this.style.update(u)}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(),gpuTiming:!!this.listens("gpu-timing-layer"),fadeDuration:this._fadeDuration}),this.fire(new t.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new t.Event("load"))),this.style&&(this.style.hasTransitions()||o)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){var l=t.browser.now()-r;i.endQueryEXT(i.TIME_ELAPSED_EXT,e),setTimeout((function(){var r=i.getQueryObjectEXT(e,i.QUERY_RESULT_EXT)/1e6;i.deleteQueryEXT(e),n.fire(new t.Event("gpu-timing-frame",{cpuTime:l,gpuTime:r}))}),50)}if(this.listens("gpu-timing-layer")){var h=this.painter.collectGpuTimers();setTimeout((function(){var e=n.painter.queryGpuTimers(h);n.fire(new t.Event("gpu-timing-layer",{layerTimes:e}))}),50)}return this._sourcesDirty||this._repaint||this._styleDirty||this._placementDirty?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new t.Event("idle")),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.setStyle(null),void 0!==t.window&&(t.window.removeEventListener("resize",this._onWindowResize,!1),t.window.removeEventListener("online",this._onWindowOnline,!1));var r=this.painter.context.gl.getExtension("WEBGL_lose_context");r&&r.loseContext(),zr(this._canvasContainer),zr(this._controlContainer),zr(this._missingCSSCanary),this._container.classList.remove("mapboxgl-map"),this.fire(new t.Event("remove"))},i.prototype.triggerRepaint=function(){var e=this;this.style&&!this._frame&&(this._frame=t.browser.frame((function(){e._frame=null,e._render()})))},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.showCollisionBoxes.get=function(){return!!this._showCollisionBoxes},o.showCollisionBoxes.set=function(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,t?this.style._generateCollisionBoxes():this._update())},o.showOverdrawInspector.get=function(){return!!this._showOverdrawInspector},o.showOverdrawInspector.set=function(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())},o.repaint.get=function(){return!!this._repaint},o.repaint.set=function(t){this._repaint!==t&&(this._repaint=t,this.triggerRepaint())},o.vertices.get=function(){return!!this._vertices},o.vertices.set=function(t){this._vertices=t,this._update()},i.prototype._setCacheLimits=function(e,n){t.setCacheLimits(e,n)},o.version.get=function(){return t.version},Object.defineProperties(i.prototype,o),i}(Mr);function zr(t){t.parentNode&&t.parentNode.removeChild(t)}var Ur={showCompass:!0,showZoom:!0,visualizePitch:!1},Nr=function(e){var r=this;this.options=t.extend({},Ur,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))};function Gr(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}Nr.prototype._updateZoomButtons=function(){var t=this._map.getZoom();this._zoomInButton.disabled=t===this._map.getMaxZoom(),this._zoomOutButton.disabled=t===this._map.getMinZoom()},Nr.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},Nr.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 br(t,{button:"left",element:this._compass}),n.addEventListener(this._compass,"mousedown",this._handler.onMouseDown),n.addEventListener(this._compass,"touchstart",this._handler.onMouseDown,{passive:!1}),this._handler.enable()),this._container},Nr.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),n.removeEventListener(this._compass,"mousedown",this._handler.onMouseDown),n.removeEventListener(this._compass,"touchstart",this._handler.onMouseDown,{passive:!1}),this._handler.disable(),delete this._handler),delete this._map},Nr.prototype._createButton=function(t,e){var r=n.create("button",t,this._container);return r.type="button",r.addEventListener("click",e),r},Nr.prototype._setButtonTitle=function(t,e){var n=this._map._getUIString("NavigationControl."+e);t.title=n,t.setAttribute("aria-label",n)};var Vr={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 Hr(t,e,n){var r=t.classList;for(var i in Vr)r.remove("mapboxgl-"+n+"-anchor-"+i);r.add("mapboxgl-"+n+"-anchor-"+e)}var Wr,qr=function(e){function r(r,i){var o=this;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._draggable=r&&r.draggable||!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 a=n.createNS("http://www.w3.org/2000/svg","svg");a.setAttributeNS(null,"display","block"),a.setAttributeNS(null,"height","41px"),a.setAttributeNS(null,"width","27px"),a.setAttributeNS(null,"viewBox","0 0 27 41");var s=n.createNS("http://www.w3.org/2000/svg","g");s.setAttributeNS(null,"stroke","none"),s.setAttributeNS(null,"stroke-width","1"),s.setAttributeNS(null,"fill","none"),s.setAttributeNS(null,"fill-rule","evenodd");var u=n.createNS("http://www.w3.org/2000/svg","g");u.setAttributeNS(null,"fill-rule","nonzero");var c=n.createNS("http://www.w3.org/2000/svg","g");c.setAttributeNS(null,"transform","translate(3.0, 29.0)"),c.setAttributeNS(null,"fill","#000000");for(var l=0,h=[{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<h.length;l+=1){var f=h[l],p=n.createNS("http://www.w3.org/2000/svg","ellipse");p.setAttributeNS(null,"opacity","0.04"),p.setAttributeNS(null,"cx","10.5"),p.setAttributeNS(null,"cy","5.80029008"),p.setAttributeNS(null,"rx",f.rx),p.setAttributeNS(null,"ry",f.ry),c.appendChild(p)}var d=n.createNS("http://www.w3.org/2000/svg","g");d.setAttributeNS(null,"fill",this._color);var A=n.createNS("http://www.w3.org/2000/svg","path");A.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),d.appendChild(A);var g=n.createNS("http://www.w3.org/2000/svg","g");g.setAttributeNS(null,"opacity","0.25"),g.setAttributeNS(null,"fill","#000000");var m=n.createNS("http://www.w3.org/2000/svg","path");m.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"),g.appendChild(m);var y=n.createNS("http://www.w3.org/2000/svg","g");y.setAttributeNS(null,"transform","translate(6.0, 7.0)"),y.setAttributeNS(null,"fill","#FFFFFF");var v=n.createNS("http://www.w3.org/2000/svg","g");v.setAttributeNS(null,"transform","translate(8.0, 8.0)");var _=n.createNS("http://www.w3.org/2000/svg","circle");_.setAttributeNS(null,"fill","#000000"),_.setAttributeNS(null,"opacity","0.25"),_.setAttributeNS(null,"cx","5.5"),_.setAttributeNS(null,"cy","5.5"),_.setAttributeNS(null,"r","5.4999962");var b=n.createNS("http://www.w3.org/2000/svg","circle");b.setAttributeNS(null,"fill","#FFFFFF"),b.setAttributeNS(null,"cx","5.5"),b.setAttributeNS(null,"cy","5.5"),b.setAttributeNS(null,"r","5.4999962"),v.appendChild(_),v.appendChild(b),u.appendChild(c),u.appendChild(d),u.appendChild(g),u.appendChild(y),u.appendChild(v),a.appendChild(u),this._element.appendChild(a),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()})),this._element.addEventListener("focus",(function(){var t=o._map.getContainer();t.scrollTop=0,t.scrollLeft=0})),Hr(this._element,this._anchor,"marker"),this._popup=null}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.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=Gr(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,Vr[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){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._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._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),Xr={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showUserLocation:!0},Jr=function(e){function r(n){e.call(this),this.options=t.extend({},Xr,n),t.bindAll(["_onSuccess","_onError","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.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!==Wr?r(Wr):void 0!==t.window.navigator.permissions?t.window.navigator.permissions.query({name:"geolocation"}).then((function(t){Wr="denied"!==t.state,r(Wr)})):(Wr=!!t.window.navigator.geolocation,r(Wr)),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(),n.remove(this._container),this._map=void 0},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_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}},r.prototype._onSuccess=function(e){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(t){t?this._userLocationDotMarker.setLngLat([t.coords.longitude,t.coords.latitude]).addTo(this._map):this._userLocationDotMarker.remove()},r.prototype._onError=function(e){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 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","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=n.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new qr(this._dotElement),this.options.trackUserLocation&&(this._watchState="OFF")),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",(function(e){var n=e.originalEvent&&"resize"===e.originalEvent.type;e.geolocateSource||"ACTIVE_LOCK"!==r._watchState||n||(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":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")}"OFF"===this._watchState&&void 0!==this._geolocationWatchID?this._clearWatch():void 0===this._geolocationWatchID&&(this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),this._geolocationWatchID=t.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,this.options.positionOptions))}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),Zr={maxWidth:100,unit:"metric"},Qr=function(e){this.options=t.extend({},Zr,e),t.bindAll(["_onMove","setUnit"],this)};function Kr(t,e,n){var r,i,o,a,s,u,c=n&&n.maxWidth||100,l=t._container.clientHeight/2,h=(r=t.unproject([0,l]),i=t.unproject([c,l]),o=Math.PI/180,a=r.lat*o,s=i.lat*o,u=Math.sin(a)*Math.sin(s)+Math.cos(a)*Math.cos(s)*Math.cos((i.lng-r.lng)*o),6371e3*Math.acos(Math.min(u,1)));if(n&&"imperial"===n.unit){var f=3.2808*h;f>5280?Yr(e,c,f/5280,t._getUIString("ScaleControl.Miles")):Yr(e,c,f,t._getUIString("ScaleControl.Feet"))}else n&&"nautical"===n.unit?Yr(e,c,h/1852,t._getUIString("ScaleControl.NauticalMiles")):h>=1e3?Yr(e,c,h/1e3,t._getUIString("ScaleControl.Kilometers")):Yr(e,c,h,t._getUIString("ScaleControl.Meters"))}function Yr(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))),u=s/n;t.style.width=e*u+"px",t.innerHTML=s+r}Qr.prototype.getDefaultPosition=function(){return"bottom-left"},Qr.prototype._onMove=function(){Kr(this._map,this._container,this.options)},Qr.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},Qr.prototype.onRemove=function(){n.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},Qr.prototype.setUnit=function(t){this.options.unit=t,Kr(this._map,this._container,this.options)};var $r=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")};$r.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},$r.prototype.onRemove=function(){n.remove(this._controlContainer),this._map=null,t.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},$r.prototype._checkFullscreenSupport=function(){return!!(t.window.document.fullscreenEnabled||t.window.document.mozFullScreenEnabled||t.window.document.msFullscreenEnabled||t.window.document.webkitFullscreenEnabled)},$r.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)},$r.prototype._updateTitle=function(){var t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t},$r.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},$r.prototype._isFullscreen=function(){return this._fullscreen},$r.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())},$r.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 ti={closeButton:!0,closeOnClick:!0,className:"",maxWidth:"240px"},ei=function(e){function r(n){e.call(this),this.options=t.extend(Object.create(ti),n),t.bindAll(["_update","_onClickClose","remove"],this)}return e&&(r.__proto__=e),r.prototype=Object.create(e&&e.prototype),r.prototype.constructor=r,r.prototype.addTo=function(e){var n=this;return this._map=e,this.options.closeOnClick&&this._map.on("click",this._onClickClose),this._map.on("remove",this.remove),this._update(),this._trackPointer?(this._map.on("mousemove",(function(t){n._update(t.point)})),this._map.on("mouseup",(function(t){n._update(t.point)})),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("click",this._onClickClose),this._map.off("remove",this.remove),this._map.off("mousemove"),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._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},r.prototype.trackPointer=function(){var t=this;return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",(function(e){t._update(e.point)})),this._map.on("drag",(function(e){t._update(e.point)})),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.style.maxWidth},r.prototype.setMaxWidth=function(t){return this.options.maxWidth=t,this._update(),this},r.prototype.setDOMContent=function(t){return this._createContent(),this._content.appendChild(t),this._update(),this},r.prototype.addClassName=function(t){this._container.classList.add(t)},r.prototype.removeClassName=function(t){this._container.classList.remove(t)},r.prototype.toggleClassName=function(t){return this._container.classList.toggle(t)},r.prototype._createContent=function(){this._content&&n.remove(this._content),this._content=n.create("div","mapboxgl-popup-content",this._container),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._onClickClose))},r.prototype._update=function(e){var r=this,i=this._lngLat||this._trackPointer;if(this._map&&i&&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=Gr(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||e)){var o=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat),a=this.options.anchor,s=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(!a){var u,c=this._container.offsetWidth,l=this._container.offsetHeight;u=o.y+s.bottom.y<l?["top"]:o.y>this._map.transform.height-l?["bottom"]:[],o.x<c/2?u.push("left"):o.x>this._map.transform.width-c/2&&u.push("right"),a=0===u.length?"bottom":u.join("-")}var h=o.add(s[a]).round();n.setTransform(this._container,Vr[a]+" translate("+h.x+"px,"+h.y+"px)"),Hr(this._container,a,"popup")}},r.prototype._onClickClose=function(){this.remove()},r}(t.Evented),ni={version:t.version,supported:e,setRTLTextPlugin:t.setRTLTextPlugin,getRTLTextPluginStatus:t.getRTLTextPluginStatus,Map:Fr,NavigationControl:Nr,GeolocateControl:Jr,AttributionControl:Ir,ScaleControl:Qr,FullscreenControl:$r,Popup:ei,Marker:qr,Style:je,LngLat:t.LngLat,LngLatBounds:t.LngLatBounds,Point:t.Point,MercatorCoordinate:t.MercatorCoordinate,Evented:t.Evented,config:t.config,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 Rt.workerCount},set workerCount(t){Rt.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 ni})),n}()},function(t,e,n){"use strict";n.r(e);var r=n(3),i=n.n(r),o=n(5),a=n.n(o),s=n(6),u=n.n(s),c=n(2),l=n.n(c),h=n(0),f=n.n(h);function p(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=l()(t);if(e){var i=l()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return u()(this,n)}}var d=function(t){a()(n,t);var e=p(n);function n(){return i()(this,n),e.apply(this,arguments)}return n}(n(216).a);f()(d,"layerName","GreatCircleLayer"),f()(d,"defaultProps",{getHeight:{type:"accessor",value:0},greatCircle:!0});var A=n(4),g=n.n(A),m=n(189),y=n(211);function v(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=l()(t);if(e){var i=l()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return u()(this,n)}}function _(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 b=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?_(Object(n),!0).forEach((function(e){f()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},y.a.defaultProps),x=function(t){a()(n,t);var e=v(n);function n(){return i()(this,n),e.apply(this,arguments)}return g()(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,c=t.lineWidthMaxPixels,l=t.lineJointRounded,h=t.lineMiterLimit,f=t.lineDashJustified,p=t.getElevation,d=t.getFillColor,A=t.getLineColor,g=t.getLineWidth,m=this.props,v=m.updateTriggers,_=m.material,b=m.transitions;return new(this.getSubLayerClass("cell",y.a))({filled:i,wireframe:r,extruded:n,elevationScale:e,stroked:o,lineWidthUnits:a,lineWidthScale:s,lineWidthMinPixels:u,lineWidthMaxPixels:c,lineJointRounded:l,lineMiterLimit:h,lineDashJustified:f,material:_,transitions:b,getElevation:p,getFillColor:d,getLineColor:A,getLineWidth:g},this.getSubLayerProps({id:"cell",updateTriggers:v&&{getElevation:v.getElevation,getFillColor:v.getFillColor,getLineColor:v.getLineColor,getLineWidth:v.getLineWidth}}),this.indexToBounds())}}]),n}(m.a);f()(x,"layerName","GeoCellLayer"),f()(x,"defaultProps",b);var w=n(9),E=n.n(w),O=n(122),S=n.n(O),T=180/Math.PI;function C(t,e,n){var r=1<<e;return[(t[0]+n[0])/r,(t[1]+n[1])/r]}function P(t){return t>=.5?1/3*(4*t*t-1):1/3*(1-4*(1-t)*(1-t))}function M(t){return[P(t[0]),P(t[1])]}function I(t,e){var n=E()(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 B(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}}function R(t){if("string"==typeof t){if(t.indexOf("/")>0)return t;t=function(t){var e=t.padEnd(16,"0");return S.a.fromString(e,16)}(t)}return function(t){for(var e=S.a.fromString(t,!0,10).toString(2);e.length<64;)e="0"+e;for(var n=e.lastIndexOf("1"),r=e.substring(0,3),i=e.substring(3,n),o=i.length/2,a=S.a.fromString(r,!0,2).toString(10),s=S.a.fromString(i,!0,2).toString(4);s.length<o;)s="0"+s;return"".concat(a,"/").concat(s)}(t.toString())}function k(t){return function(t){for(var e,n,r,i,o,a,s=t.face,u=t.ij,c=t.level,l=[[0,0],[0,1],[1,1],[1,0],[0,0]],h=Math.max(1,Math.ceil(100*Math.pow(2,-c))),f=new Float64Array(4*h*2+2),p=0,d=0,A=0;A<4;A++)for(var g=l[A].slice(0),m=l[A+1],y=(m[0]-g[0])/h,v=(m[1]-g[1])/h,_=0;_<h;_++){g[0]+=y,g[1]+=v;var b=I(s,M(C(u,c,g))),x=(e=b,n=void 0,r=void 0,i=void 0,o=void 0,a=void 0,n=E()(e,3),r=n[0],i=n[1],o=n[2],a=Math.atan2(o,Math.sqrt(r*r+i*i)),[Math.atan2(i,r)*T,a*T]);Math.abs(x[1])>89.999&&(x[0]=d);var w=x[0]-d;x[0]+=w>180?-360:w<-180?360:0,f[p++]=x[0],f[p++]=x[1],d=x[0]}return f[p++]=f[0],f[p++]=f[1],f}(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],c=0,l=0;"1"===u?l=1:"2"===u?(c=1,l=1):"3"===u&&(c=1);var h=Math.pow(2,e-1);B(h,a,c,l),a[0]+=h*c,a[1]+=h*l}if(r%2==1){var f=a[0];a[0]=a[1],a[1]=f}return{face:r,ij:a,level:e}}(R(t)))}function L(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=l()(t);if(e){var i=l()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return u()(this,n)}}var D=function(t){a()(n,t);var e=L(n);function n(){return i()(this,n),e.apply(this,arguments)}return g()(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 k(n(t,e))}}}}]),n}(x);f()(D,"layerName","S2Layer"),f()(D,"defaultProps",{getS2Token:{type:"accessor",value:function(t){return t.token}}});var j=n(18);function F(t){var e=function(t){for(var e=0,n=0,r=1<<t.length,i=r/512,o=0;o<t.length;o++){r>>=1;var a=parseInt(t[o]);a%2&&(e|=r),a>1&&(n|=r)}return[[e/i,512-n/i],[(e+.99)/i,512-(n+.99)/i]]}(t),n=E()(e,2),r=n[0],i=n[1],o=Object(j.p)(r),a=E()(o,2),s=a[0],u=a[1],c=Object(j.p)(i),l=E()(c,2),h=l[0],f=l[1];return[h,u,h,f,s,f,s,u,h,u]}function z(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=l()(t);if(e){var i=l()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return u()(this,n)}}var U=function(t){a()(n,t);var e=z(n);function n(){return i()(this,n),e.apply(this,arguments)}return g()(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 F(n(t,e))}}}}]),n}(x);f()(U,"layerName","QuadkeyLayer"),f()(U,"defaultProps",{getQuadkey:{type:"accessor",value:function(t){return t.quadkey}}});var N=n(65),G=n(215),V=n(67),H=n.n(V),W=n(39),q=n.n(W),X=n(20),J=function(){function t(e){i()(this,t),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}var e;return g()(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)||X.a.error("byteLength not defined in tile data")(),t}},{key:"_loadData",value:(e=H()(q.a.mark((function t(e){var n,r,i,o,a,s,u,c,l,h,f,p,d,A;return q.a.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,c=this.userData,l=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:c,zoom:l,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]])}))),function(t){return e.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}(),Z=n(37),Q=n.n(Z),K=n(156),Y=n(84);const $=-1,tt=0,et=1;function nt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var rt=n(81);const it=new rt.a,ot=new rt.a;class at{constructor(t=[0,0,0],e=[0,0,0],n){nt(this,"center",void 0),nt(this,"halfDiagonal",void 0),nt(this,"minimum",void 0),nt(this,"maximum",void 0),n=n||it.copy(t).add(e).scale(.5),this.center=new rt.a(n),this.halfDiagonal=new rt.a(e).subtract(this.center),this.minimum=new rt.a(t),this.maximum=new rt.a(e)}clone(){return new at(this.minimum,this.maximum,this.center)}equals(t){return this===t||Boolean(t)&&this.minimum.equals(t.minimum)&&this.maximum.equals(t.maximum)}transform(t){return this.center.transformAsPoint(t),this.halfDiagonal.transform(t),this.minimum.transform(t),this.maximum.transform(t),this}intersectPlane(t){const{halfDiagonal:e}=this,n=ot.from(t.normal),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?et:i+r<0?$:tt}distanceTo(t){return Math.sqrt(this.distanceSquaredTo(t))}distanceSquaredTo(t){const e=it.from(t).subtract(this.center),{halfDiagonal:n}=this;let r,i=0;return r=Math.abs(e.x)-n.x,r>0&&(i+=r*r),r=Math.abs(e.y)-n.y,r>0&&(i+=r*r),r=Math.abs(e.z)-n.z,r>0&&(i+=r*r),i}}var st=n(25);const ut=new rt.a,ct=new rt.a;class lt{constructor(t=[0,0,0],e=0){nt(this,"center",void 0),nt(this,"radius",void 0),this.radius=-0,this.center=new rt.a,this.fromCenterRadius(t,e)}fromCenterRadius(t,e){return this.center.from(t),this.radius=e,this}fromCornerPoints(t,e){return e=ut.from(e),this.center=(new rt.a).from(t).add(e).scale(.5),this.radius=this.center.distance(e),this}equals(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.radius===t.radius}clone(){return new lt(this.center,this.radius)}union(t){const e=this.center,n=this.radius,r=t.center,i=t.radius,o=ut.copy(r).subtract(e),a=o.magnitude();if(n>=a+i)return this.clone();if(i>=a+n)return t.clone();const s=.5*(n+a+i);return ct.copy(o).scale((-n+s)/a).add(e),this.center.copy(ct),this.radius=s,this}expand(t){const e=ut.from(t).subtract(this.center).magnitude();return e>this.radius&&(this.radius=e),this}transform(t){this.center.transform(t);const e=st.e(ut,t);return this.radius=Math.max(e[0],Math.max(e[1],e[2]))*this.radius,this}distanceSquaredTo(t){const e=this.distanceTo(t);return e*e}distanceTo(t){const e=ut.from(t).subtract(this.center);return Math.max(0,e.len()-this.radius)}intersectPlane(t){const e=this.center,n=this.radius,r=t.normal.dot(e)+t.distance;return r<-n?$:r<n?tt:et}}var ht,ft=n(169),pt=n(22),dt=n(53),At=n(54),gt=n(33),mt=n(24);!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"}(ht||(ht={}));const yt=Object.freeze([1,0,0,0,1,0,0,0,1]);class vt extends ft.a{static get IDENTITY(){return function(){bt||(bt=new vt,Object.freeze(bt));return bt}()}static get ZERO(){return function(){_t||(_t=new vt([0,0,0,0,0,0,0,0,0]),Object.freeze(_t));return _t}()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return ht}constructor(t,...e){super(-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(t)?this.copy(t):e.length>0?this.copy([t,...e]):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this.check()}identity(){return this.copy(yt)}fromObject(t){return this.check()}fromQuaternion(t){return At.c(this,t),this.check()}set(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()}setRowMajor(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()}determinant(){return At.b(this)}transpose(){return At.i(this,this),this.check()}invert(){return At.d(this,this),this.check()}multiplyLeft(t){return At.e(this,t,this),this.check()}multiplyRight(t){return At.e(this,this,t),this.check()}rotate(t){return At.f(this,this,t),this.check()}scale(t){return Array.isArray(t)?At.g(this,this,t):At.g(this,this,[t,t]),this.check()}translate(t){return At.h(this,this,t),this.check()}transform(t,e){let n;switch(t.length){case 2:n=gt.i(e||[-0,-0],t,this);break;case 3:n=mt.o(e||[-0,-0,-0],t,this);break;case 4:n=Object(dt.e)(e||[-0,-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Object(pt.b)(n,t.length),n}transformVector(t,e){return this.transform(t,e)}transformVector2(t,e){return this.transform(t,e)}transformVector3(t,e){return this.transform(t,e)}}let _t,bt;var xt=n(294);const wt=new rt.a,Et=new rt.a,Ot=new rt.a,St=new rt.a,Tt=new rt.a,Ct=new rt.a,Pt=new rt.a,Mt=0,It=1,Bt=2,Rt=3,kt=4,Lt=5,Dt=6,jt=7,Ft=8;class zt{constructor(t=[0,0,0],e=[0,0,0,0,0,0,0,0,0]){nt(this,"center",void 0),nt(this,"halfAxes",void 0),this.center=(new rt.a).from(t),this.halfAxes=new vt(e)}get halfSize(){const t=this.halfAxes.getColumn(0),e=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2);return[new rt.a(t).len(),new rt.a(e).len(),new rt.a(n).len()]}get quaternion(){const t=this.halfAxes.getColumn(0),e=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2),r=new rt.a(t).normalize(),i=new rt.a(e).normalize(),o=new rt.a(n).normalize();return(new xt.a).fromMatrix3(new vt([...r,...i,...o]))}fromCenterHalfSizeQuaternion(t,e,n){const r=new xt.a(n),i=(new vt).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 rt.a).from(t),this.halfAxes=i,this}clone(){return new zt(this.center,this.halfAxes)}equals(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.halfAxes.equals(t.halfAxes)}getBoundingSphere(t=new lt){const e=this.halfAxes,n=e.getColumn(0,Ot),r=e.getColumn(1,St),i=e.getColumn(2,Tt),o=wt.copy(n).add(r).add(i);return t.center.copy(this.center),t.radius=o.magnitude(),t}intersectPlane(t){const e=this.center,n=t.normal,r=this.halfAxes,i=n.x,o=n.y,a=n.z,s=Math.abs(i*r[Mt]+o*r[It]+a*r[Bt])+Math.abs(i*r[Rt]+o*r[kt]+a*r[Lt])+Math.abs(i*r[Dt]+o*r[jt]+a*r[Ft]),u=n.dot(e)+t.distance;return u<=-s?$:u>=s?et:tt}distanceTo(t){return Math.sqrt(this.distanceSquaredTo(t))}distanceSquaredTo(t){const e=Et.from(t).subtract(this.center),n=this.halfAxes,r=n.getColumn(0,Ot),i=n.getColumn(1,St),o=n.getColumn(2,Tt),a=r.magnitude(),s=i.magnitude(),u=o.magnitude();r.normalize(),i.normalize(),o.normalize();let c,l=0;return c=Math.abs(e.dot(r))-a,c>0&&(l+=c*c),c=Math.abs(e.dot(i))-s,c>0&&(l+=c*c),c=Math.abs(e.dot(o))-u,c>0&&(l+=c*c),l}computePlaneDistances(t,e,n=[-0,-0]){let r=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;const o=this.center,a=this.halfAxes,s=a.getColumn(0,Ot),u=a.getColumn(1,St),c=a.getColumn(2,Tt),l=Ct.copy(s).add(u).add(c).add(o),h=Pt.copy(l).subtract(t);let f=e.dot(h);return r=Math.min(f,r),i=Math.max(f,i),l.copy(o).add(s).add(u).subtract(c),h.copy(l).subtract(t),f=e.dot(h),r=Math.min(f,r),i=Math.max(f,i),l.copy(o).add(s).subtract(u).add(c),h.copy(l).subtract(t),f=e.dot(h),r=Math.min(f,r),i=Math.max(f,i),l.copy(o).add(s).subtract(u).subtract(c),h.copy(l).subtract(t),f=e.dot(h),r=Math.min(f,r),i=Math.max(f,i),o.copy(l).subtract(s).add(u).add(c),h.copy(l).subtract(t),f=e.dot(h),r=Math.min(f,r),i=Math.max(f,i),o.copy(l).subtract(s).add(u).subtract(c),h.copy(l).subtract(t),f=e.dot(h),r=Math.min(f,r),i=Math.max(f,i),o.copy(l).subtract(s).subtract(u).add(c),h.copy(l).subtract(t),f=e.dot(h),r=Math.min(f,r),i=Math.max(f,i),o.copy(l).subtract(s).subtract(u).subtract(c),h.copy(l).subtract(t),f=e.dot(h),r=Math.min(f,r),i=Math.max(f,i),n[0]=r,n[1]=i,n}transform(t){this.center.transformAsPoint(t);const e=this.halfAxes.getColumn(0,Ot);e.transformAsPoint(t);const n=this.halfAxes.getColumn(1,St);n.transformAsPoint(t);const r=this.halfAxes.getColumn(2,Tt);return r.transformAsPoint(t),this.halfAxes=new vt([...e,...n,...r]),this}getTransform(){throw new Error("not implemented")}}var Ut=n(136),Nt=n(13);const Gt=new rt.a,Vt=new rt.a;class Ht{constructor(t=[0,0,1],e=0){nt(this,"normal",void 0),nt(this,"distance",void 0),this.normal=new rt.a,this.distance=-0,this.fromNormalDistance(t,e)}fromNormalDistance(t,e){return Object(Ut.a)(Number.isFinite(e)),this.normal.from(t).normalize(),this.distance=e,this}fromPointNormal(t,e){t=Gt.from(t),this.normal.from(e).normalize();const n=-this.normal.dot(t);return this.distance=n,this}fromCoefficients(t,e,n,r){return this.normal.set(t,e,n),Object(Ut.a)(Object(Nt.d)(this.normal.len(),1)),this.distance=r,this}clone(){return new Ht(this.normal,this.distance)}equals(t){return Object(Nt.d)(this.distance,t.distance)&&Object(Nt.d)(this.normal,t.normal)}getPointDistance(t){return this.normal.dot(t)+this.distance}transform(t){const e=Vt.copy(this.normal).transformAsVector(t).normalize(),n=this.normal.scale(-this.distance).transform(t);return this.fromPointNormal(n,e)}projectPointOntoPlane(t,e=[0,0,0]){t=Gt.from(t);const n=this.getPointDistance(t),r=Vt.copy(this.normal).scale(n);return t.subtract(r).to(e)}}const Wt=[new rt.a([1,0,0]),new rt.a([0,1,0]),new rt.a([0,0,1])],qt=new rt.a,Xt=new rt.a;new Ht(new rt.a(1,0,0),0);class Jt{constructor(t=[]){nt(this,"planes",void 0),this.planes=t}fromBoundingSphere(t){this.planes.length=2*Wt.length;const e=t.center,n=t.radius;let r=0;for(const t of Wt){let i=this.planes[r],o=this.planes[r+1];i||(i=this.planes[r]=new Ht),o||(o=this.planes[r+1]=new Ht);const a=qt.copy(t).scale(-n).add(e);t.dot(a);i.fromPointNormal(a,t);const s=qt.copy(t).scale(n).add(e),u=Xt.copy(t).negate();u.dot(s);o.fromPointNormal(s,u),r+=2}return this}computeVisibility(t){let e=et;for(const n of this.planes){switch(t.intersectPlane(n)){case $:return $;case tt:e=tt}}return e}computeVisibilityWithPlaneMask(t,e){if(Object(Ut.a)(Number.isFinite(e),"parentPlaneMask is required."),e===Jt.MASK_OUTSIDE||e===Jt.MASK_INSIDE)return e;let n=Jt.MASK_INSIDE;const r=this.planes;for(let i=0;i<this.planes.length;++i){const o=i<31?1<<i:0;if(i<31&&0==(e&o))continue;const a=r[i],s=t.intersectPlane(a);if(s===$)return Jt.MASK_OUTSIDE;s===tt&&(n|=o)}return n}}nt(Jt,"MASK_OUTSIDE",4294967295),nt(Jt,"MASK_INSIDE",0),nt(Jt,"MASK_INDETERMINATE",2147483647);var Zt=n(75);new rt.a,new rt.a,new rt.a,new rt.a,new rt.a;var Qt=n(288);new rt.a,new rt.a,new rt.a,new rt.a,new rt.a,new rt.a,new rt.a,new rt.a,new rt.a,new rt.a,new rt.a,new rt.a,Math.PI;var Kt=.1,Yt=1e-12,$t=1e-15,te=1e-20;Math.PI,Math.PI,Math.PI,Math.PI;const ee=new vt,ne=new vt,re=new vt,ie=new vt,oe=new vt;function ae(t,e={}){const n=te;let r=0,i=0;const o=ne,a=re;o.identity(),a.copy(t);const s=n*function(t){let e=0;for(let n=0;n<9;++n){const r=t[n];e+=r*r}return Math.sqrt(e)}(a);for(;i<10&&ce(a)>s;)le(a,ie),oe.copy(ie).transpose(),a.multiplyRight(ie),a.multiplyLeft(oe),o.multiplyRight(ie),++r>2&&(++i,r=0);return e.unitary=o.toTarget(e.unitary),e.diagonal=a.toTarget(e.diagonal),e}const se=[1,0,0],ue=[2,2,1];function ce(t){let e=0;for(let n=0;n<3;++n){const r=t[ee.getElementIndex(ue[n],se[n])];e+=2*r*r}return Math.sqrt(e)}function le(t,e){const n=$t;let r=0,i=1;for(let e=0;e<3;++e){const n=Math.abs(t[ee.getElementIndex(ue[e],se[e])]);n>r&&(i=e,r=n)}const o=se[i],a=ue[i];let s=1,u=0;if(Math.abs(t[ee.getElementIndex(a,o)])>n){const e=(t[ee.getElementIndex(a,a)]-t[ee.getElementIndex(o,o)])/2/t[ee.getElementIndex(a,o)];let n;n=e<0?-1/(-e+Math.sqrt(1+e*e)):1/(e+Math.sqrt(1+e*e)),s=1/Math.sqrt(1+n*n),u=n*s}return vt.IDENTITY.to(e),e[ee.getElementIndex(o,o)]=e[ee.getElementIndex(a,a)]=s,e[ee.getElementIndex(a,o)]=u,e[ee.getElementIndex(o,a)]=-u,e}const he=new rt.a,fe=new rt.a,pe=new rt.a,de=new rt.a,Ae=new rt.a,ge=new vt,me={diagonal:new vt,unitary:new vt};function ye(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return ve(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 ve(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=n.call(t)},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 ve(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 _e=[[.5,.5],[0,0],[0,1],[1,0],[1,1]],be=_e.concat([[0,.5],[.5,0],[1,.5],[.5,1]]),xe=be.concat([[.25,.5],[.75,.5]]),we=function(){function t(e,n,r){i()(this,t),this.x=e,this.y=n,this.z=r}return g()(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,c=this.getBoundingVolume(r,s,u);if(a&&!this.insideBounds(a))return!1;if(n.computeVisibility(c)<0)return!1;if(!this.childVisible){var l=this.z;if(l<o&&l>=i){var h=c.distanceTo(e.cameraPosition)*e.scale/e.height;l+=Math.floor(Math.log2(h))}if(l>=o)return this.selected=!0,!0}this.selected=!1,this.childVisible=!0;var f,p=ye(this.children);try{for(p.s();!(f=p.n()).done;){f.value.update(t)}}catch(t){p.e(t)}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=ye(this._children);try{for(n.s();!(e=n.n()).done;){var r=e.value;r.getSelected(t)}}catch(t){n.e(t)}finally{n.f()}}return t}},{key:"insideBounds",value:function(t){var e=E()(t,4),n=e[0],r=e[1],i=e[2],o=e[3],a=512/Math.pow(2,this.z);return this.x*a<i&&this.y*a<o&&(this.x+1)*a>n&&(this.y+1)*a>r}},{key:"getBoundingVolume",value:function(t,e,n){if(n){var r,i=[],o=ye(this.z<1?xe:this.z<2?be:_e);try{for(o.s();!(r=o.n()).done;){var a=r.value,s=Me(this.x+a[0],this.y+a[1],this.z);s[2]=t[0],i.push(n(s)),t[0]!==t[1]&&(s[2]=t[1],i.push(n(s)))}}catch(t){o.e(t)}finally{o.f()}return function(t,e=new zt){if(!t||0===t.length)return e.halfAxes=new vt([0,0,0,0,0,0,0,0,0]),e.center=new rt.a,e;const n=t.length,r=new rt.a(0,0,0);for(const e of t)r.add(e);const i=1/n;r.multiplyByScalar(i);let o=0,a=0,s=0,u=0,c=0,l=0;for(const e of t){const t=he.copy(e).subtract(r);o+=t.x*t.x,a+=t.x*t.y,s+=t.x*t.z,u+=t.y*t.y,c+=t.y*t.z,l+=t.z*t.z}o*=i,a*=i,s*=i,u*=i,c*=i,l*=i;const h=ge;h[0]=o,h[1]=a,h[2]=s,h[3]=a,h[4]=u,h[5]=c,h[6]=s,h[7]=c,h[8]=l;const{unitary:f}=ae(h,me),p=e.halfAxes.copy(f);let d=p.getColumn(0,pe),A=p.getColumn(1,de),g=p.getColumn(2,Ae),m=-Number.MAX_VALUE,y=-Number.MAX_VALUE,v=-Number.MAX_VALUE,_=Number.MAX_VALUE,b=Number.MAX_VALUE,x=Number.MAX_VALUE;for(const e of t)he.copy(e),m=Math.max(he.dot(d),m),y=Math.max(he.dot(A),y),v=Math.max(he.dot(g),v),_=Math.min(he.dot(d),_),b=Math.min(he.dot(A),b),x=Math.min(he.dot(g),x);d=d.multiplyByScalar(.5*(_+m)),A=A.multiplyByScalar(.5*(b+y)),g=g.multiplyByScalar(.5*(x+v)),e.center.copy(d).add(A).add(g);const w=fe.set(m-_,y-b,v-x).multiplyByScalar(.5),E=new vt([w[0],0,0,0,w[1],0,0,0,w[2]]);return e.halfAxes.multiplyRight(E),e}(i)}var u=512/Math.pow(2,this.z),c=this.x*u+512*e,l=512-(this.y+1)*u;return new at([c,l,t[0]],[c+u,l+u,t[1]])}}]),t}();var Ee=[-1/0,-1/0,1/0,1/0],Oe={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;if(!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 Se(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]])];return[Math.min.apply(Math,Q()(n.map((function(t){return t[0]})))),Math.min.apply(Math,Q()(n.map((function(t){return t[1]})))),Math.max.apply(Math,Q()(n.map((function(t){return t[0]})))),Math.max.apply(Math,Q()(n.map((function(t){return t[1]}))))]}function Te(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],c=new RegExp("{".concat(u,"}"),"g");o=o.replace(c,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 Ce(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},c=e.unproject([i,o],u),l=e.unproject([i+a,o],u),h=e.unproject([i,o+s],u),f=e.unproject([i+a,o+s],u);return[Math.min(c[0],l[0],h[0],f[0]),Math.min(c[1],l[1],h[1],f[1]),Math.max(c[0],l[0],h[0],f[0]),Math.max(c[1],l[1],h[1],f[1])]}var p=Ce({viewport:e,z:n[0],cullRect:r}),d=Ce({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 Pe(t,e){return 512*Math.pow(2,t)/e}function Me(t,e,n){var r=Pe(n,512),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 Ie(t,e,n,r){var i=Pe(n,r);return[t/i*512,e/i*512]}function Be(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:512;if(t.isGeospatial){var o=Me(e,n,r),a=E()(o,2),s=a[0],u=a[1],c=Me(e+1,n+1,r),l=E()(c,2),h=l[0],f=l[1];return{west:s,north:u,east:h,south:f}}var p=Ie(e,n,r,i),d=E()(p,2),A=d[0],g=d[1],m=Ie(e+1,n+1,r,i),y=E()(m,2),v=y[0],_=y[1];return{left:A,top:g,right:v,bottom:_}}function Re(t,e,n,r,i){for(var o=function(t,e,n){return n?Se(t,n).map((function(t){return t*e/512})):t.map((function(t){return t*e/512}))}(function(t,e,n){var r;if(e&&2===e.length){var i=E()(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),Pe(e,n),i),a=E()(o,4),s=a[0],u=a[1],c=a[2],l=a[3],h=[],f=Math.floor(s);f<c;f++)for(var p=Math.floor(u);p<l;p++)h.push({x:f,y:p,z:e});return h}function ke(t){var e=t.viewport,n=t.maxZoom,r=t.minZoom,i=t.zRange,o=t.extent,a=t.tileSize,s=void 0===a?512:a,u=t.modelMatrix,c=t.modelMatrixInverse,l=t.zoomOffset,h=void 0===l?0:l,f=e.isGeospatial?Math.round(e.zoom+Math.log2(512/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;return u&&c&&o&&!e.isGeospatial&&(p=Se(o,u)),e.isGeospatial?function(t,e,n,r){var i=t instanceof K.a&&t.resolution?t.projectPosition:null,o=Object.values(t.getFrustumPlanes()).map((function(t){var e=t.normal,n=t.distance;return new Ht(e.clone().negate(),n)})),a=new Jt(o),s=t.distanceScales.unitsPerMeter[2],u=n&&n[0]*s||0,c=n&&n[1]*s||0,l=t instanceof Y.a&&t.pitch<=60?e:0;if(r){var h=r,f=E()(h,4),p=f[0],d=f[1],A=f[2],g=f[3],m=Object(j.l)([p,g]),y=Object(j.l)([A,d]);r=[m[0],512-m[1],y[0],512-y[1]]}var v=new we(0,0,0),_={viewport:t,project:i,cullingVolume:a,elevationBounds:[u,c],minZ:l,maxZ:e,bounds:r,offset:0};if(v.update(_),t instanceof Y.a&&t.subViewports&&t.subViewports.length>1){for(_.offset=-1;v.update(_)&&!(--_.offset<-3););for(_.offset=1;v.update(_)&&!(++_.offset>3););}return v.getSelected()}(e,f,i,o):Re(e,f,s,p||Ee,c)}var Le,De=n(208),je=n(77);function Fe(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return ze(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 ze(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=n.call(t)},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 ze(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 Ue=(Le={},f()(Le,"best-available",(function(t){var e,n=Fe(t);try{for(n.s();!(e=n.n()).done;){e.value.state=0}}catch(t){n.e(t)}finally{n.f()}var r,i=Fe(t);try{for(i.s();!(r=i.n()).done;){var o=r.value;o.isSelected&&!Ge(o)&&Ve(o)}}catch(t){i.e(t)}finally{i.f()}var a,s=Fe(t);try{for(s.s();!(a=s.n()).done;){var u=a.value;u.isVisible=Boolean(2&u.state)}}catch(t){s.e(t)}finally{s.f()}})),f()(Le,"no-overlap",(function(t){var e,n=Fe(t);try{for(n.s();!(e=n.n()).done;){e.value.state=0}}catch(t){n.e(t)}finally{n.f()}var r,i=Fe(t);try{for(i.s();!(r=i.n()).done;){var o=r.value;o.isSelected&&Ge(o)}}catch(t){i.e(t)}finally{i.f()}var a,s=Fe(Array.from(t).sort((function(t,e){return t.zoom-e.zoom})));try{for(s.s();!(a=s.n()).done;){var u=a.value;if(u.isVisible=Boolean(2&u.state),u.children&&(u.isVisible||1&u.state)){var c,l=Fe(u.children);try{for(l.s();!(c=l.n()).done;){c.value.state=1}}catch(t){l.e(t)}finally{l.f()}}else u.isSelected&&Ve(u)}}catch(t){s.e(t)}finally{s.f()}})),f()(Le,"never",(function(){})),Le),Ne=function(){function t(e){var n=this;i()(this,t),f()(this,"_getCullBounds",Object(je.a)(Ce)),this.opts=e,this.onTileLoad=function(t){n.opts.onTileLoad(t),n.opts.maxCacheByteSize&&(n._cacheByteSize+=t.byteLength,n._resizeCache())},this._requestScheduler=new De.a({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 Zt.a,this._modelMatrixInverse=new Zt.a,this.setOptions(e)}return g()(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=Fe(this._cache.values());try{for(e.s();!(t=e.n()).done;){var n=t.value;n.isLoading&&n.abort()}}catch(t){e.e(t)}finally{e.f()}this._cache.clear(),this._tiles=[],this._selectedTiles=null}},{key:"reloadAll",value:function(){var t,e=Fe(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(t){e.e(t)}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 Zt.a(i),a=!o.equals(this._modelMatrix);if(this._viewport&&t.equals(this._viewport)&&Object(Nt.d)(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=Ce({viewport:this._viewport,z:this._zRange,cullRect:e}),r=E()(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 c=Math.min(u.top,u.bottom),l=Math.max(u.top,u.bottom);return u.left<a&&u.right>i&&c<s&&l>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 ke({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:Be(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||"best-available",n=new Array(this._cache.size),r=0,i=Fe(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(t){i.e(t)}finally{i.f()}var a,s=Fe(this._selectedTiles);try{for(s.s();!(a=s.n()).done;){var u=a.value;u.isSelected=!0,u.isVisible=!0}}catch(t){s.e(t)}finally{s.f()}("function"==typeof e?e:Ue[e])(Array.from(this._cache.values())),r=0;var c,l=Fe(this._cache.values());try{for(l.s();!(c=l.n()).done;){var h=c.value;if(n[r++]!==h.isVisible)return!0}}catch(t){l.e(t)}finally{l.f()}return!1}},{key:"_pruneRequests",value:function(){var t,e=this.opts.maxRequests,n=[],r=0,i=Fe(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(t){i.e(t)}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=Fe(e.values());try{for(n.s();!(t=n.n()).done;){var r=t.value;r.parent=null,r.children&&(r.children.length=0)}}catch(t){n.e(t)}finally{n.f()}var i,o=Fe(e.values());try{for(o.s();!(i=o.n()).done;){var a=i.value,s=this._getNearestAncestor(a);a.parent=s,null!=s&&s.children&&s.children.push(a)}}catch(t){o.e(t)}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=Fe(t);try{for(o.s();!(i=o.n()).done;){var a=E()(i.value,2),s=a[0],u=a[1];if(u.isVisible||(this._cacheByteSize-=e.maxCacheByteSize?u.byteLength:0,t.delete(s),this.opts.onTileUnload(u)),t.size<=n&&this._cacheByteSize<=r)break}}catch(t){o.e(t)}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 J(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 Ge(t){for(var e=t;e;){if(e.isLoaded||e.content)return e.state|=2,!0;e=e.parent}return!1}function Ve(t){var e,n=Fe(t.children);try{for(n.s();!(e=n.n()).done;){var r=e.value;r.isLoaded||r.content?r.state|=2:Ve(r)}}catch(t){n.e(t)}finally{n.f()}}function He(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 We(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?He(Object(n),!0).forEach((function(e){f()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):He(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function qe(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=l()(t);if(e){var i=l()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return u()(this,n)}}var Xe={TilesetClass:Ne,data:{type:"data",value:[]},dataComparator:Oe.equals,renderSubLayers:{type:"function",value:function(t){return new G.a(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:"best-available",zRange:null,maxRequests:6,zoomOffset:0},Je=function(t){a()(n,t);var e=qe(n);function n(){return i()(this,n),e.apply(this,arguments)}return g()(n,[{key:"initializeState",value:function(){this.state={tileset: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)?Te(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.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(We(We({},t.props),{},{id:"".concat(t.id,"-").concat(e.id),data:e.content,_offset:0,tile:e}));e.layers=Object(N.b)(r,Boolean).map((function(t){return t.clone(We({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}(m.a);f()(Je,"defaultProps",Xe),f()(Je,"layerName","TileLayer");var Ze=n(7),Qe=n.n(Ze);function Ke(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 Ye(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ke(Object(n),!0).forEach((function(e){f()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ke(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function $e(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=l()(t);if(e){var i=l()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return u()(this,n)}}var tn=function(t){a()(n,t);var e=$e(n);function n(){return i()(this,n),e.apply(this,arguments)}return g()(n,[{key:"getShaders",value:function(){var t=Qe()(l()(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;\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(){Qe()(l()(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=Ye(Ye({},t.uniforms),{},{fadeTrail:r,trailLength:i,currentTime:o}),Qe()(l()(n.prototype),"draw",this).call(this,t)}}]),n}(n(112).a);f()(tn,"layerName","TripsLayer"),f()(tn,"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 en=function(t){var e,n=void 0!==(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=Z(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 c=0,l=function(){return c};var h=!1;function f(t){var e,r=n["_"+t];return e="Cannot call unknown function "+t+", make sure it is exported",r||ut("Assertion failed: "+e),r}function p(t,e,n,r,i){var o={string:function(t){var e=0;if(null!=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){var u=t.charCodeAt(++a);s=65536+((1023&s)<<10)|1023&u}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,y,e,n)})(t,e=tt(n),n)}return e},array:function(t){var e=tt(t.length);return function(t,e){m.set(t,e)}(t,e),e}};var a=f(t),s=[],u=0;if(r)for(var c=0;c<r.length;c++){var l=o[n[c]];l?(0===u&&(u=nt()),s[c]=l(r[c])):s[c]=r[c]}var h=a.apply(null,s);return h=function(t){return"string"===e?A(t):"boolean"===e?Boolean(t):t}(h),0!==u&&et(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 c=a-65536;o+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else o+=String.fromCharCode((31&a)<<6|s)}else o+=String.fromCharCode(a)}return o}(y,t,e):""}var g,m,y,v,_,b,x;"undefined"!=typeof TextDecoder&&new TextDecoder("utf-16le");function w(t,e){return t%e>0&&(t+=e-t%e),t}function E(t){g=t,n.HEAP8=m=new Int8Array(t),n.HEAP16=v=new Int16Array(t),n.HEAP32=_=new Int32Array(t),n.HEAPU8=y=new Uint8Array(t),n.HEAPU16=new Uint16Array(t),n.HEAPU32=new Uint32Array(t),n.HEAPF32=b=new Float32Array(t),n.HEAPF64=x=new Float64Array(t)}var O=n.TOTAL_MEMORY||33554432;function S(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()}}O=(g=n.buffer?n.buffer:new ArrayBuffer(O)).byteLength,E(g),_[6004]=5266928;var T=[],C=[],P=[],M=[];var I=Math.abs,B=Math.ceil,R=Math.floor,k=Math.min,L=0,D=null,j=null;n.preloadedImages={},n.preloadedAudios={};var F,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+AAAAHAAAACwAAAAaAAAAKwAAAD4AAAAvAAAAQAAAABoAAAAqAAAAHQAAACwAAAA1AAAAOgAAAEEAAAAcAAAAHwAAACoAAAAtAAAAJwAAACMAAAAZAAAAPwAAADsAAAA4AAAALgAAADwAAAA4AAAARAAAABsAAAAoAAAAIwAAAC8AAAAmAAAAKwAAAB0AAABFAAAAMwAAAEAAAAAwAAAAMQAAAB4AAAAhAAAAQwAAAEIAAAAyAAAAMQAAAH8AAAA9AAAAQgAAACEAAAAwAAAAKQAAADIAAAAwAAAAIAAAAB4AAABGAAAAQwAAADQAAAAzAAAARQAAADYAAABHAAAAJgAAAC8AAAAiAAAANAAAADkAAABGAAAASgAAACAAAAAlAAAAMgAAADUAAAA9AAAAQQAAAEsAAAAfAAAAKQAAACwAAAA2AAAARwAAADcAAABJAAAAIgAAADMAAAAkAAAANwAAACgAAAA2AAAAJAAAAEgAAAA8AAAASQAAADgAAABEAAAAPwAAAE0AAAAjAAAALgAAAC0AAAA5AAAAOwAAAEoAAABOAAAAJQAAACcAAAA0AAAAOgAAAH8AAAA+AAAATAAAACwAAABBAAAAKgAAADsAAAA/AAAATgAAAE8AAAAnAAAALQAAADkAAAA8AAAASAAAAEQAAABQAAAAKAAAADcAAAAuAAAAPQAAADUAAAAxAAAAKQAAAFEAAABLAAAAQgAAAD4AAAArAAAAOgAAACoAAABSAAAAQAAAAEwAAAA/AAAAfwAAADgAAAAtAAAATwAAADsAAABNAAAAQAAAAC8AAAA+AAAAKwAAAFQAAABFAAAAUgAAAEEAAAA6AAAANQAAACwAAABWAAAATAAAAEsAAABCAAAAQwAAAFEAAABVAAAAMQAAADAAAAA9AAAAQwAAAEIAAAAyAAAAMAAAAFcAAABVAAAARgAAAEQAAAA4AAAAPAAAAC4AAABaAAAATQAAAFAAAABFAAAAMwAAAEAAAAAvAAAAWQAAAEcAAABUAAAARgAAAEMAAAA0AAAAMgAAAFMAAABXAAAASgAAAEcAAABZAAAASQAAAFsAAAAzAAAARQAAADYAAABIAAAAfwAAAEkAAAA3AAAAUAAAADwAAABYAAAASQAAAFsAAABIAAAAWAAAADYAAABHAAAANwAAAEoAAABOAAAAUwAAAFwAAAA0AAAAOQAAAEYAAABLAAAAQQAAAD0AAAA1AAAAXgAAAFYAAABRAAAATAAAAFYAAABSAAAAYAAAADoAAABBAAAAPgAAAE0AAAA/AAAARAAAADgAAABdAAAATwAAAFoAAABOAAAASgAAADsAAAA5AAAAXwAAAFwAAABPAAAATwAAAE4AAAA/AAAAOwAAAF0AAABfAAAATQAAAFAAAABEAAAASAAAADwAAABjAAAAWgAAAFgAAABRAAAAVQAAAF4AAABlAAAAPQAAAEIAAABLAAAAUgAAAGAAAABUAAAAYgAAAD4AAABMAAAAQAAAAFMAAAB/AAAASgAAAEYAAABkAAAAVwAAAFwAAABUAAAARQAAAFIAAABAAAAAYQAAAFkAAABiAAAAVQAAAFcAAABlAAAAZgAAAEIAAABDAAAAUQAAAFYAAABMAAAASwAAAEEAAABoAAAAYAAAAF4AAABXAAAAUwAAAGYAAABkAAAAQwAAAEYAAABVAAAAWAAAAEgAAABbAAAASQAAAGMAAABQAAAAaQAAAFkAAABhAAAAWwAAAGcAAABFAAAAVAAAAEcAAABaAAAATQAAAFAAAABEAAAAagAAAF0AAABjAAAAWwAAAEkAAABZAAAARwAAAGkAAABYAAAAZwAAAFwAAABTAAAATgAAAEoAAABsAAAAZAAAAF8AAABdAAAATwAAAFoAAABNAAAAbQAAAF8AAABqAAAAXgAAAFYAAABRAAAASwAAAGsAAABoAAAAZQAAAF8AAABcAAAATwAAAE4AAABtAAAAbAAAAF0AAABgAAAAaAAAAGIAAABuAAAATAAAAFYAAABSAAAAYQAAAH8AAABiAAAAVAAAAGcAAABZAAAAbwAAAGIAAABuAAAAYQAAAG8AAABSAAAAYAAAAFQAAABjAAAAUAAAAGkAAABYAAAAagAAAFoAAABxAAAAZAAAAGYAAABTAAAAVwAAAGwAAAByAAAAXAAAAGUAAABmAAAAawAAAHAAAABRAAAAVQAAAF4AAABmAAAAZQAAAFcAAABVAAAAcgAAAHAAAABkAAAAZwAAAFsAAABhAAAAWQAAAHQAAABpAAAAbwAAAGgAAABrAAAAbgAAAHMAAABWAAAAXgAAAGAAAABpAAAAWAAAAGcAAABbAAAAcQAAAGMAAAB0AAAAagAAAF0AAABjAAAAWgAAAHUAAABtAAAAcQAAAGsAAAB/AAAAZQAAAF4AAABzAAAAaAAAAHAAAABsAAAAZAAAAF8AAABcAAAAdgAAAHIAAABtAAAAbQAAAGwAAABdAAAAXwAAAHUAAAB2AAAAagAAAG4AAABiAAAAaAAAAGAAAAB3AAAAbwAAAHMAAABvAAAAYQAAAG4AAABiAAAAdAAAAGcAAAB3AAAAcAAAAGsAAABmAAAAZQAAAHgAAABzAAAAcgAAAHEAAABjAAAAdAAAAGkAAAB1AAAAagAAAHkAAAByAAAAcAAAAGQAAABmAAAAdgAAAHgAAABsAAAAcwAAAG4AAABrAAAAaAAAAHgAAAB3AAAAcAAAAHQAAABnAAAAdwAAAG8AAABxAAAAaQAAAHkAAAB1AAAAfwAAAG0AAAB2AAAAcQAAAHkAAABqAAAAdgAAAHgAAABsAAAAcgAAAHUAAAB5AAAAbQAAAHcAAABvAAAAcwAAAG4AAAB5AAAAdAAAAHgAAAB4AAAAcwAAAHIAAABwAAAAeQAAAHcAAAB2AAAAeQAAAHQAAAB4AAAAdwAAAHUAAABxAAAAdgAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAEAAAAFAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAIAAAAFAAAAAQAAAAAAAAD/////AQAAAAAAAAADAAAABAAAAAIAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAwAAAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAUAAAABAAAAAAAAAAAAAAABAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAAFAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAEAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAQAAAAFAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAUAAAAFAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAUAAAAFAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAMAAAAAAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAADAAAAAAAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAABAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAADAAAAAwAAAAMAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAADAAAABQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAUAAAAFAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAAAAAAAAAAABAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAADAAAAAAAAAAMAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAMAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAFAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAFAAAAAAAAAAAAAAAAAAAAAQAAAAMAAAABAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAMAAAABAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAADAAAABQAAAAEAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAFAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAEAAAABQAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAgAAAAUAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAMAAAABAAAAAAAAAAEAAAAAAAAABQAAAAAAAAAAAAAABQAAAAUAAAAAAAAAAAAAAP////8BAAAAAAAAAAMAAAAEAAAAAgAAAAAAAAAAAAAAAQAAAAAAAAAAAAAABQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAFAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAABQAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAQAAAP//////////AQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAMAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAIAAAAAAAAAAAAAAAEAAAACAAAABgAAAAQAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABgAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAABwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABgAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAoAAAACAAAAAAAAAAAAAAABAAAAAQAAAAUAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAIAAAAAAAAAAAAAAAEAAAADAAAABwAAAAYAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAHAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAABAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAOAAAAAgAAAAAAAAAAAAAAAQAAAAAAAAAJAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAwAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAgAAAAAAAAAAAAAAAQAAAAQAAAAIAAAACgAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAsAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAJAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAACAAAAAAAAAAAAAAABAAAACwAAAA8AAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAA4AAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAgAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAFAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcAAAACAAAAAAAAAAAAAAABAAAADAAAABAAAAAMAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAPAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAEAAAAKAAAAEwAAAAgAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACQAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAADwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABAAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAJAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAgAAAAAAAAAAAAAAAQAAAA0AAAARAAAADQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAABEAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAATAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAABMAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACQAAAAIAAAAAAAAAAAAAAAEAAAAOAAAAEgAAAA8AAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAPAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEgAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAABIAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAATAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAEgAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABMAAAACAAAAAAAAAAAAAAABAAAA//////////8TAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABMAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAASAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABIAAAAAAAAAGAAAAAAAAAAhAAAAAAAAAB4AAAAAAAAAIAAAAAMAAAAxAAAAAQAAADAAAAADAAAAMgAAAAMAAAAIAAAAAAAAAAUAAAAFAAAACgAAAAUAAAAWAAAAAAAAABAAAAAAAAAAEgAAAAAAAAApAAAAAQAAACEAAAAAAAAAHgAAAAAAAAAEAAAAAAAAAAAAAAAFAAAAAgAAAAUAAAAPAAAAAQAAAAgAAAAAAAAABQAAAAUAAAAfAAAAAQAAABYAAAAAAAAAEAAAAAAAAAACAAAAAAAAAAYAAAAAAAAADgAAAAAAAAAKAAAAAAAAAAsAAAAAAAAAEQAAAAMAAAAYAAAAAQAAABcAAAADAAAAGQAAAAMAAAAAAAAAAAAAAAEAAAAFAAAACQAAAAUAAAAFAAAAAAAAAAIAAAAAAAAABgAAAAAAAAASAAAAAQAAAAoAAAAAAAAACwAAAAAAAAAEAAAAAQAAAAMAAAAFAAAABwAAAAUAAAAIAAAAAQAAAAAAAAAAAAAAAQAAAAUAAAAQAAAAAQAAAAUAAAAAAAAAAgAAAAAAAAAHAAAAAAAAABUAAAAAAAAAJgAAAAAAAAAJAAAAAAAAABMAAAAAAAAAIgAAAAMAAAAOAAAAAQAAABQAAAADAAAAJAAAAAMAAAADAAAAAAAAAA0AAAAFAAAAHQAAAAUAAAABAAAAAAAAAAcAAAAAAAAAFQAAAAAAAAAGAAAAAQAAAAkAAAAAAAAAEwAAAAAAAAAEAAAAAgAAAAwAAAAFAAAAGgAAAAUAAAAAAAAAAQAAAAMAAAAAAAAADQAAAAUAAAACAAAAAQAAAAEAAAAAAAAABwAAAAAAAAAaAAAAAAAAACoAAAAAAAAAOgAAAAAAAAAdAAAAAAAAACsAAAAAAAAAPgAAAAMAAAAmAAAAAQAAAC8AAAADAAAAQAAAAAMAAAAMAAAAAAAAABwAAAAFAAAALAAAAAUAAAANAAAAAAAAABoAAAAAAAAAKgAAAAAAAAAVAAAAAQAAAB0AAAAAAAAAKwAAAAAAAAAEAAAAAwAAAA8AAAAFAAAAHwAAAAUAAAADAAAAAQAAAAwAAAAAAAAAHAAAAAUAAAAHAAAAAQAAAA0AAAAAAAAAGgAAAAAAAAAfAAAAAAAAACkAAAAAAAAAMQAAAAAAAAAsAAAAAAAAADUAAAAAAAAAPQAAAAMAAAA6AAAAAQAAAEEAAAADAAAASwAAAAMAAAAPAAAAAAAAABYAAAAFAAAAIQAAAAUAAAAcAAAAAAAAAB8AAAAAAAAAKQAAAAAAAAAqAAAAAQAAACwAAAAAAAAANQAAAAAAAAAEAAAABAAAAAgAAAAFAAAAEAAAAAUAAAAMAAAAAQAAAA8AAAAAAAAAFgAAAAUAAAAaAAAAAQAAABwAAAAAAAAAHwAAAAAAAAAyAAAAAAAAADAAAAAAAAAAMQAAAAMAAAAgAAAAAAAAAB4AAAADAAAAIQAAAAMAAAAYAAAAAwAAABIAAAADAAAAEAAAAAMAAABGAAAAAAAAAEMAAAAAAAAAQgAAAAMAAAA0AAAAAwAAADIAAAAAAAAAMAAAAAAAAAAlAAAAAwAAACAAAAAAAAAAHgAAAAMAAABTAAAAAAAAAFcAAAADAAAAVQAAAAMAAABKAAAAAwAAAEYAAAAAAAAAQwAAAAAAAAA5AAAAAQAAADQAAAADAAAAMgAAAAAAAAAZAAAAAAAAABcAAAAAAAAAGAAAAAMAAAARAAAAAAAAAAsAAAADAAAACgAAAAMAAAAOAAAAAwAAAAYAAAADAAAAAgAAAAMAAAAtAAAAAAAAACcAAAAAAAAAJQAAAAMAAAAjAAAAAwAAABkAAAAAAAAAFwAAAAAAAAAbAAAAAwAAABEAAAAAAAAACwAAAAMAAAA/AAAAAAAAADsAAAADAAAAOQAAAAMAAAA4AAAAAwAAAC0AAAAAAAAAJwAAAAAAAAAuAAAAAwAAACMAAAADAAAAGQAAAAAAAAAkAAAAAAAAABQAAAAAAAAADgAAAAMAAAAiAAAAAAAAABMAAAADAAAACQAAAAMAAAAmAAAAAwAAABUAAAADAAAABwAAAAMAAAA3AAAAAAAAACgAAAAAAAAAGwAAAAMAAAA2AAAAAwAAACQAAAAAAAAAFAAAAAAAAAAzAAAAAwAAACIAAAAAAAAAEwAAAAMAAABIAAAAAAAAADwAAAADAAAALgAAAAMAAABJAAAAAwAAADcAAAAAAAAAKAAAAAAAAABHAAAAAwAAADYAAAADAAAAJAAAAAAAAABAAAAAAAAAAC8AAAAAAAAAJgAAAAMAAAA+AAAAAAAAACsAAAADAAAAHQAAAAMAAAA6AAAAAwAAACoAAAADAAAAGgAAAAMAAABUAAAAAAAAAEUAAAAAAAAAMwAAAAMAAABSAAAAAwAAAEAAAAAAAAAALwAAAAAAAABMAAAAAwAAAD4AAAAAAAAAKwAAAAMAAABhAAAAAAAAAFkAAAADAAAARwAAAAMAAABiAAAAAwAAAFQAAAAAAAAARQAAAAAAAABgAAAAAwAAAFIAAAADAAAAQAAAAAAAAABLAAAAAAAAAEEAAAAAAAAAOgAAAAMAAAA9AAAAAAAAADUAAAADAAAALAAAAAMAAAAxAAAAAwAAACkAAAADAAAAHwAAAAMAAABeAAAAAAAAAFYAAAAAAAAATAAAAAMAAABRAAAAAwAAAEsAAAAAAAAAQQAAAAAAAABCAAAAAwAAAD0AAAAAAAAANQAAAAMAAABrAAAAAAAAAGgAAAADAAAAYAAAAAMAAABlAAAAAwAAAF4AAAAAAAAAVgAAAAAAAABVAAAAAwAAAFEAAAADAAAASwAAAAAAAAA5AAAAAAAAADsAAAAAAAAAPwAAAAMAAABKAAAAAAAAAE4AAAADAAAATwAAAAMAAABTAAAAAwAAAFwAAAADAAAAXwAAAAMAAAAlAAAAAAAAACcAAAADAAAALQAAAAMAAAA0AAAAAAAAADkAAAAAAAAAOwAAAAAAAABGAAAAAwAAAEoAAAAAAAAATgAAAAMAAAAYAAAAAAAAABcAAAADAAAAGQAAAAMAAAAgAAAAAwAAACUAAAAAAAAAJwAAAAMAAAAyAAAAAwAAADQAAAAAAAAAOQAAAAAAAAAuAAAAAAAAADwAAAAAAAAASAAAAAMAAAA4AAAAAAAAAEQAAAADAAAAUAAAAAMAAAA/AAAAAwAAAE0AAAADAAAAWgAAAAMAAAAbAAAAAAAAACgAAAADAAAANwAAAAMAAAAjAAAAAAAAAC4AAAAAAAAAPAAAAAAAAAAtAAAAAwAAADgAAAAAAAAARAAAAAMAAAAOAAAAAAAAABQAAAADAAAAJAAAAAMAAAARAAAAAwAAABsAAAAAAAAAKAAAAAMAAAAZAAAAAwAAACMAAAAAAAAALgAAAAAAAABHAAAAAAAAAFkAAAAAAAAAYQAAAAMAAABJAAAAAAAAAFsAAAADAAAAZwAAAAMAAABIAAAAAwAAAFgAAAADAAAAaQAAAAMAAAAzAAAAAAAAAEUAAAADAAAAVAAAAAMAAAA2AAAAAAAAAEcAAAAAAAAAWQAAAAAAAAA3AAAAAwAAAEkAAAAAAAAAWwAAAAMAAAAmAAAAAAAAAC8AAAADAAAAQAAAAAMAAAAiAAAAAwAAADMAAAAAAAAARQAAAAMAAAAkAAAAAwAAADYAAAAAAAAARwAAAAAAAABgAAAAAAAAAGgAAAAAAAAAawAAAAMAAABiAAAAAAAAAG4AAAADAAAAcwAAAAMAAABhAAAAAwAAAG8AAAADAAAAdwAAAAMAAABMAAAAAAAAAFYAAAADAAAAXgAAAAMAAABSAAAAAAAAAGAAAAAAAAAAaAAAAAAAAABUAAAAAwAAAGIAAAAAAAAAbgAAAAMAAAA6AAAAAAAAAEEAAAADAAAASwAAAAMAAAA+AAAAAwAAAEwAAAAAAAAAVgAAAAMAAABAAAAAAwAAAFIAAAAAAAAAYAAAAAAAAABVAAAAAAAAAFcAAAAAAAAAUwAAAAMAAABlAAAAAAAAAGYAAAADAAAAZAAAAAMAAABrAAAAAwAAAHAAAAADAAAAcgAAAAMAAABCAAAAAAAAAEMAAAADAAAARgAAAAMAAABRAAAAAAAAAFUAAAAAAAAAVwAAAAAAAABeAAAAAwAAAGUAAAAAAAAAZgAAAAMAAAAxAAAAAAAAADAAAAADAAAAMgAAAAMAAAA9AAAAAwAAAEIAAAAAAAAAQwAAAAMAAABLAAAAAwAAAFEAAAAAAAAAVQAAAAAAAABfAAAAAAAAAFwAAAAAAAAAUwAAAAAAAABPAAAAAAAAAE4AAAAAAAAASgAAAAMAAAA/AAAAAQAAADsAAAADAAAAOQAAAAMAAABtAAAAAAAAAGwAAAAAAAAAZAAAAAUAAABdAAAAAQAAAF8AAAAAAAAAXAAAAAAAAABNAAAAAQAAAE8AAAAAAAAATgAAAAAAAAB1AAAABAAAAHYAAAAFAAAAcgAAAAUAAABqAAAAAQAAAG0AAAAAAAAAbAAAAAAAAABaAAAAAQAAAF0AAAABAAAAXwAAAAAAAABaAAAAAAAAAE0AAAAAAAAAPwAAAAAAAABQAAAAAAAAAEQAAAAAAAAAOAAAAAMAAABIAAAAAQAAADwAAAADAAAALgAAAAMAAABqAAAAAAAAAF0AAAAAAAAATwAAAAUAAABjAAAAAQAAAFoAAAAAAAAATQAAAAAAAABYAAAAAQAAAFAAAAAAAAAARAAAAAAAAAB1AAAAAwAAAG0AAAAFAAAAXwAAAAUAAABxAAAAAQAAAGoAAAAAAAAAXQAAAAAAAABpAAAAAQAAAGMAAAABAAAAWgAAAAAAAABpAAAAAAAAAFgAAAAAAAAASAAAAAAAAABnAAAAAAAAAFsAAAAAAAAASQAAAAMAAABhAAAAAQAAAFkAAAADAAAARwAAAAMAAABxAAAAAAAAAGMAAAAAAAAAUAAAAAUAAAB0AAAAAQAAAGkAAAAAAAAAWAAAAAAAAABvAAAAAQAAAGcAAAAAAAAAWwAAAAAAAAB1AAAAAgAAAGoAAAAFAAAAWgAAAAUAAAB5AAAAAQAAAHEAAAAAAAAAYwAAAAAAAAB3AAAAAQAAAHQAAAABAAAAaQAAAAAAAAB3AAAAAAAAAG8AAAAAAAAAYQAAAAAAAABzAAAAAAAAAG4AAAAAAAAAYgAAAAMAAABrAAAAAQAAAGgAAAADAAAAYAAAAAMAAAB5AAAAAAAAAHQAAAAAAAAAZwAAAAUAAAB4AAAAAQAAAHcAAAAAAAAAbwAAAAAAAABwAAAAAQAAAHMAAAAAAAAAbgAAAAAAAAB1AAAAAQAAAHEAAAAFAAAAaQAAAAUAAAB2AAAAAQAAAHkAAAAAAAAAdAAAAAAAAAByAAAAAQAAAHgAAAABAAAAdwAAAAAAAAByAAAAAAAAAHAAAAAAAAAAawAAAAAAAABkAAAAAAAAAGYAAAAAAAAAZQAAAAMAAABTAAAAAQAAAFcAAAADAAAAVQAAAAMAAAB2AAAAAAAAAHgAAAAAAAAAcwAAAAUAAABsAAAAAQAAAHIAAAAAAAAAcAAAAAAAAABcAAAAAQAAAGQAAAAAAAAAZgAAAAAAAAB1AAAAAAAAAHkAAAAFAAAAdwAAAAUAAABtAAAAAQAAAHYAAAAAAAAAeAAAAAAAAABfAAAAAQAAAGwAAAABAAAAcgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAEAAAABAAAAAAAAAAAAAAABAAAAAAAAAAEAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAB+ogX28rbpPxqumpJv+fM/165tC4ns9D+XaEnTqUsEQFrOtNlC4PA/3U+0XG6P9b9TdUUBxTTjP4PUp8ex1ty/B1rD/EN43z+lcDi6LLrZP/a45NWEHMY/oJ5ijLDZ+j/xw3rjxWPjP2B8A46ioQdAotff3wla2z+FMSpA1jj+v6b5Y1mtPbS/cIu8K0F457/2esiyJpDNv98k5Ts2NeA/pvljWa09tD88ClUJ60MDQPZ6yLImkM0/4ONKxa0UBcD2uOTVhBzGv5G7JRxGave/8cN648Vj47+HCwtkjAXIv6LX398JWtu/qyheaCAL9D9TdUUBxTTjv4gyTxslhwVAB1rD/EN4378EH/28teoFwH6iBfbytum/F6ztFYdK/r/Xrm0Liez0vwcS6wNGWeO/Ws602ULg8L9TCtRLiLT8P8pi5RexJsw/BlIKPVwR5T95Wyu0/QjnP5PjoT7YYcu/mBhKZ6zrwj8wRYS7NebuP3qW6geh+Ls/SLrixebL3r+pcyymN9XrPwmkNHp7xec/GWNMZVAA17+82s+x2BLiPwn2ytbJ9ek/LgEH1sMS1j8yp/2LhTfeP+SnWwtQBbu/d38gkp5X7z8ytsuHaADGPzUYObdf1+m/7IauECWhwz+cjSACjzniP76Z+wUhN9K/1+GEKzup67+/GYr/04baPw6idWOvsuc/ZedTWsRa5b/EJQOuRzi0v/OncYhHPes/h49PixY53j+i8wWfC03Nvw2idWOvsue/ZedTWsRa5T/EJQOuRzi0P/KncYhHPeu/iY9PixY53r+i8wWfC03NP9anWwtQBbs/d38gkp5X778ytsuHaADGvzUYObdf1+k/74auECWhw7+cjSACjzniv8CZ+wUhN9I/1uGEKzup6z+/GYr/04bavwmkNHp7xee/F2NMZVAA1z+82s+x2BLivwr2ytbJ9em/KwEH1sMS1r8yp/2LhTfev81i5RexJsy/BlIKPVwR5b95Wyu0/Qjnv5DjoT7YYcs/nBhKZ6zrwr8wRYS7Nebuv3OW6geh+Lu/SLrixebL3j+pcyymN9Xrv8rHIFfWehZAMBwUdlo0DECTUc17EOb2PxpVB1SWChdAzjbhb9pTDUDQhmdvECX5P9FlMKCC9+g/IIAzjELgE0DajDngMv8GQFhWDmDPjNs/y1guLh96EkAxPi8k7DIEQJCc4URlhRhA3eLKKLwkEECqpNAyTBD/P6xpjXcDiwVAFtl//cQm4z+Ibt3XKiYTQM7mCLUb3QdAoM1t8yVv7D8aLZv2Nk8UQEAJPV5nQwxAtSsfTCoE9z9TPjXLXIIWQBVanC5W9AtAYM3d7Adm9j++5mQz1FoWQBUThyaVBghAwH5muQsV7T89Q1qv82MUQJoWGOfNuBdAzrkClkmwDkDQjKq77t37Py+g0dtitsE/ZwAMTwVPEUBojepluNwBQGYbtuW+t9w/HNWIJs6MEkDTNuQUSlgEQKxktPP5TcQ/ixbLB8JjEUCwuWjXMQYCQAS/R09FkRdAowpiZjhhDkB7LmlczD/7P01iQmhhsAVAnrtTwDy84z/Z6jfQ2TgTQChOCXMnWwpAhrW3daoz8z/HYJvVPI4VQLT3ik5FcA5Angi7LOZd+z+NNVzDy5gXQBXdvVTFUA1AYNMgOeYe+T8+qHXGCwkXQKQTOKwa5AJA8gFVoEMW0T+FwzJyttIRQAEAAAD/////BwAAAP////8xAAAA/////1cBAAD/////YQkAAP////+nQQAA/////5HLAQD/////95AMAP/////B9lcAAAAAAAAAAAAAAAAAAgAAAP////8OAAAA/////2IAAAD/////rgIAAP/////CEgAA/////06DAAD/////IpcDAP/////uIRkA/////4LtrwAAAAAAAAAAAAAAAAAAAAAAAgAAAP//////////AQAAAAMAAAD//////////////////////////////////////////////////////////////////////////wEAAAAAAAAAAgAAAP///////////////wMAAAD//////////////////////////////////////////////////////////////////////////wEAAAAAAAAAAgAAAP///////////////wMAAAD//////////////////////////////////////////////////////////////////////////wEAAAAAAAAAAgAAAP///////////////wMAAAD//////////////////////////////////////////////////////////wIAAAD//////////wEAAAAAAAAA/////////////////////wMAAAD/////////////////////////////////////////////////////AwAAAP////////////////////8AAAAA/////////////////////wEAAAD///////////////8CAAAA////////////////////////////////AwAAAP////////////////////8AAAAA////////////////AgAAAAEAAAD/////////////////////////////////////////////////////AwAAAP////////////////////8AAAAA////////////////AgAAAAEAAAD/////////////////////////////////////////////////////AwAAAP////////////////////8AAAAA////////////////AgAAAAEAAAD/////////////////////////////////////////////////////AwAAAP////////////////////8AAAAA////////////////AgAAAAEAAAD/////////////////////////////////////////////////////AQAAAAIAAAD///////////////8AAAAA/////////////////////wMAAAD/////////////////////////////////////////////////////AQAAAAIAAAD///////////////8AAAAA/////////////////////wMAAAD/////////////////////////////////////////////////////AQAAAAIAAAD///////////////8AAAAA/////////////////////wMAAAD/////////////////////////////////////////////////////AQAAAAIAAAD///////////////8AAAAA/////////////////////wMAAAD///////////////////////////////8CAAAA////////////////AQAAAP////////////////////8AAAAA/////////////////////wMAAAD/////////////////////////////////////////////////////AwAAAP////////////////////8AAAAAAQAAAP//////////AgAAAP//////////////////////////////////////////////////////////AwAAAP///////////////wIAAAAAAAAAAQAAAP//////////////////////////////////////////////////////////////////////////AwAAAP///////////////wIAAAAAAAAAAQAAAP//////////////////////////////////////////////////////////////////////////AwAAAP///////////////wIAAAAAAAAAAQAAAP//////////////////////////////////////////////////////////////////////////AwAAAAEAAAD//////////wIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAgAAAAAAAAACAAAAAQAAAAEAAAACAAAAAgAAAAAAAAAFAAAABQAAAAAAAAACAAAAAgAAAAMAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAIAAAABAAAAAgAAAAIAAAACAAAAAAAAAAUAAAAGAAAAAAAAAAIAAAACAAAAAwAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAIAAAAAAAAAAgAAAAEAAAADAAAAAgAAAAIAAAAAAAAABQAAAAcAAAAAAAAAAgAAAAIAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAgAAAAAAAAACAAAAAQAAAAQAAAACAAAAAgAAAAAAAAAFAAAACAAAAAAAAAACAAAAAgAAAAMAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAACAAAAAAAAAAIAAAABAAAAAAAAAAIAAAACAAAAAAAAAAUAAAAJAAAAAAAAAAIAAAACAAAAAwAAAAUAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAIAAAACAAAAAAAAAAMAAAAOAAAAAgAAAAAAAAACAAAAAwAAAAAAAAAAAAAAAgAAAAIAAAADAAAABgAAAAAAAAAAAAAAAAAAAAAAAAALAAAAAgAAAAIAAAAAAAAAAwAAAAoAAAACAAAAAAAAAAIAAAADAAAAAQAAAAAAAAACAAAAAgAAAAMAAAAHAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAACAAAAAgAAAAAAAAADAAAACwAAAAIAAAAAAAAAAgAAAAMAAAACAAAAAAAAAAIAAAACAAAAAwAAAAgAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAIAAAACAAAAAAAAAAMAAAAMAAAAAgAAAAAAAAACAAAAAwAAAAMAAAAAAAAAAgAAAAIAAAADAAAACQAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAgAAAAIAAAAAAAAAAwAAAA0AAAACAAAAAAAAAAIAAAADAAAABAAAAAAAAAACAAAAAgAAAAMAAAAKAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAACAAAAAgAAAAAAAAADAAAABgAAAAIAAAAAAAAAAgAAAAMAAAAPAAAAAAAAAAIAAAACAAAAAwAAAAsAAAAAAAAAAAAAAAAAAAAAAAAABgAAAAIAAAACAAAAAAAAAAMAAAAHAAAAAgAAAAAAAAACAAAAAwAAABAAAAAAAAAAAgAAAAIAAAADAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAgAAAAIAAAAAAAAAAwAAAAgAAAACAAAAAAAAAAIAAAADAAAAEQAAAAAAAAACAAAAAgAAAAMAAAANAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAACAAAAAgAAAAAAAAADAAAACQAAAAIAAAAAAAAAAgAAAAMAAAASAAAAAAAAAAIAAAACAAAAAwAAAA4AAAAAAAAAAAAAAAAAAAAAAAAACQAAAAIAAAACAAAAAAAAAAMAAAAFAAAAAgAAAAAAAAACAAAAAwAAABMAAAAAAAAAAgAAAAIAAAADAAAADwAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAgAAAAAAAAACAAAAAQAAABMAAAACAAAAAgAAAAAAAAAFAAAACgAAAAAAAAACAAAAAgAAAAMAAAAQAAAAAAAAAAAAAAAAAAAAAAAAABEAAAACAAAAAAAAAAIAAAABAAAADwAAAAIAAAACAAAAAAAAAAUAAAALAAAAAAAAAAIAAAACAAAAAwAAABEAAAAAAAAAAAAAAAAAAAAAAAAAEgAAAAIAAAAAAAAAAgAAAAEAAAAQAAAAAgAAAAIAAAAAAAAABQAAAAwAAAAAAAAAAgAAAAIAAAADAAAAEgAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAgAAAAAAAAACAAAAAQAAABEAAAACAAAAAgAAAAAAAAAFAAAADQAAAAAAAAACAAAAAgAAAAMAAAATAAAAAAAAAAAAAAAAAAAAAAAAAA8AAAACAAAAAAAAAAIAAAABAAAAEgAAAAIAAAACAAAAAAAAAAUAAAAOAAAAAAAAAAIAAAACAAAAAwAAAAIAAAABAAAAAAAAAAEAAAACAAAAAAAAAAAAAAACAAAAAQAAAAAAAAABAAAAAgAAAAEAAAAAAAAAAgAAAAAAAAAFAAAABAAAAAAAAAABAAAABQAAAAAAAAAAAAAABQAAAAQAAAAAAAAAAQAAAAUAAAAEAAAAAAAAAAUAAAAAAAAAAgAAAAEAAAAAAAAAAQAAAAIAAAAAAAAAAAAAAAIAAAABAAAAAAAAAAEAAAACAAAAAQAAAAAAAAACAAAAAgAAAAAAAAABAAAAAAAAAAAAAAAFAAAABAAAAAAAAAABAAAABQAAAAAAAAAAAAAABQAAAAQAAAAAAAAAAQAAAAUAAAAEAAAAAAAAAAUAAAAFAAAAAAAAAAEAAAAAAAAAAAAAAMuhRbbsNlBBYqHW9OmHIkF9XBuqnS31QAK37uYhNMhAOSo3UUupm0DC+6pc6JxvQHV9eseEEEJAzURsCyqlFEB8BQ4NMJjnPyy3tBoS97o/xawXQznRjj89J2K2CZxhP6vX43RIIDQ/S8isgygEBz+LvFHQkmzaPjFFFO7wMq4+AADMLkTtjkIAAOgkJqxhQgAAU7B0MjRCAADwpBcVB0IAAACYP2HaQQAAAIn/Ja5BzczM4Eg6gUHNzMxMU7BTQTMzMzNfgCZBAAAAAEi3+UAAAAAAwGPNQDMzMzMzy6BAmpmZmZkxc0AzMzMzM/NFQDMzMzMzMxlAzczMzMzM7D+ygXSx2U6RQKimJOvQKnpA23hmONTHY0A/AGcxyudNQNb3K647mzZA+S56rrwWIUAm4kUQ+9UJQKre9hGzh/M/BLvoy9WG3T+LmqMf8VHGP2m3nYNV37A/gbFHcyeCmT+cBPWBckiDP61tZACjKW0/q2RbYVUYVj8uDypVyLNAP6jGS5cA5zBBwcqhBdCNGUEGEhQ/JVEDQT6WPnRbNO1AB/AWSJgT1kDfUWNCNLDAQNk+5C33OqlAchWL34QSk0DKvtDIrNV8QNF0G3kFzGVASSeWhBl6UED+/0mNGuk4QGjA/dm/1CJALPLPMql6DEDSHoDrwpP1P2jouzWST+A/egAAAAAAAABKAwAAAAAAAPoWAAAAAAAAyqAAAAAAAAB6ZQQAAAAAAErGHgAAAAAA+mvXAAAAAADK8+MFAAAAAHqqOykAAAAASqmhIAEAAAD6oGvkBwAAAMpm8T43AAAAes+ZuIIBAABKrDQMkwoAAPq1cFUFSgAAyvkUViUGAgAAAAAAAwAAAAYAAAACAAAABQAAAAEAAAAEAAAAAAAAAAAAAAAFAAAAAwAAAAEAAAAGAAAABAAAAAIAAAAAAAAAAAAAAP////8AAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////////8AAAAA/////wAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAP////8AAAAAAAAAAAEAAAABAAAAAAAAAAAAAAD/////AAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAA/////wUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAP////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////AAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////////wAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAUAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////////8AAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAABAAAAAAAAAAAAAAABAAAAAQAAAAEAAAAAAAAAAQAAAAAAAAAFAAAAAQAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAEAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAAAAAAABAAEAAAEBAAAAAAABAAAAAQAAAAEAAQAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAACAAAAAQAAAAMAAAAOAAAABgAAAAsAAAACAAAABwAAAAEAAAAYAAAABQAAAAoAAAABAAAABgAAAAAAAAAmAAAABwAAAAwAAAADAAAACAAAAAIAAAAxAAAACQAAAA4AAAAAAAAABQAAAAQAAAA6AAAACAAAAA0AAAAEAAAACQAAAAMAAAA/AAAACwAAAAYAAAAPAAAACgAAABAAAABIAAAADAAAAAcAAAAQAAAACwAAABEAAABTAAAACgAAAAUAAAATAAAADgAAAA8AAABhAAAADQAAAAgAAAARAAAADAAAABIAAABrAAAADgAAAAkAAAASAAAADQAAABMAAAB1AAAADwAAABMAAAARAAAAEgAAABAAAAAHAAAABwAAAAEAAAACAAAABAAAAAMAAAAAAAAAAAAAAAcAAAADAAAAAQAAAAIAAAAFAAAABAAAAAAAAAAAAAAAYWxnb3MuYwBfcG9seWZpbGxJbnRlcm5hbABhZGphY2VudEZhY2VEaXJbdG1wRmlqay5mYWNlXVtmaWprLmZhY2VdID09IEtJAGZhY2VpamsuYwBfZmFjZUlqa1BlbnRUb0dlb0JvdW5kYXJ5AGFkamFjZW50RmFjZURpcltjZW50ZXJJSksuZmFjZV1bZmFjZTJdID09IEtJAF9mYWNlSWprVG9HZW9Cb3VuZGFyeQBwb2x5Z29uLT5uZXh0ID09IE5VTEwAbGlua2VkR2VvLmMAYWRkTmV3TGlua2VkUG9seWdvbgBuZXh0ICE9IE5VTEwAbG9vcCAhPSBOVUxMAGFkZE5ld0xpbmtlZExvb3AAcG9seWdvbi0+Zmlyc3QgPT0gTlVMTABhZGRMaW5rZWRMb29wAGNvb3JkICE9IE5VTEwAYWRkTGlua2VkQ29vcmQAbG9vcC0+Zmlyc3QgPT0gTlVMTABpbm5lckxvb3BzICE9IE5VTEwAbm9ybWFsaXplTXVsdGlQb2x5Z29uAGJib3hlcyAhPSBOVUxMAGNhbmRpZGF0ZXMgIT0gTlVMTABmaW5kUG9seWdvbkZvckhvbGUAY2FuZGlkYXRlQkJveGVzICE9IE5VTEwAcmV2RGlyICE9IElOVkFMSURfRElHSVQAbG9jYWxpai5jAGgzVG9Mb2NhbElqawBiYXNlQ2VsbCAhPSBvcmlnaW5CYXNlQ2VsbAAhKG9yaWdpbk9uUGVudCAmJiBpbmRleE9uUGVudCkAcGVudGFnb25Sb3RhdGlvbnMgPj0gMABkaXJlY3Rpb25Sb3RhdGlvbnMgPj0gMABiYXNlQ2VsbCA9PSBvcmlnaW5CYXNlQ2VsbABiYXNlQ2VsbCAhPSBJTlZBTElEX0JBU0VfQ0VMTABsb2NhbElqa1RvSDMAIV9pc0Jhc2VDZWxsUGVudGFnb24oYmFzZUNlbGwpAGJhc2VDZWxsUm90YXRpb25zID49IDAAd2l0aGluUGVudGFnb25Sb3RhdGlvbnMgPj0gMABncmFwaC0+YnVja2V0cyAhPSBOVUxMAHZlcnRleEdyYXBoLmMAaW5pdFZlcnRleEdyYXBoAG5vZGUgIT0gTlVMTABhZGRWZXJ0ZXhOb2Rl";function V(t){return t}function H(t){return t.replace(/\b__Z[\w\d_]+/g,(function(t){return t===t?t:t+" ["+t+"]"}))}function W(){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 q(){return m.length}function X(t){try{var e=new ArrayBuffer(t);if(e.byteLength!=t)return;return new Int8Array(e).set(m),$(e),E(e),1}catch(t){}}var J="function"==typeof atob?atob:function(t){var e,n,r,i,o,a,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",u="",c=0;t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{e=s.indexOf(t.charAt(c++))<<2|(i=s.indexOf(t.charAt(c++)))>>4,n=(15&i)<<4|(o=s.indexOf(t.charAt(c++)))>>2,r=(3&o)<<6|(a=s.indexOf(t.charAt(c++))),u+=String.fromCharCode(e),64!==o&&(u+=String.fromCharCode(n)),64!==a&&(u+=String.fromCharCode(r))}while(c<t.length);return u};function Z(t){if(G(t))return function(t){try{for(var e=J(t),n=new Uint8Array(e.length),r=0;r<e.length;++r)n[r]=e.charCodeAt(r);return n}catch(t){throw new Error("Converting base64 string to bytes failed.")}}(t.slice(N.length))}var Q,K,Y=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,c=t.Math.sqrt,l=t.Math.pow,h=t.Math.cos,f=t.Math.sin,p=t.Math.tan,d=t.Math.acos,A=t.Math.asin,g=t.Math.atan,m=t.Math.atan2,y=t.Math.ceil,v=t.Math.imul,_=t.Math.min,b=t.Math.clz32,x=e.b,w=e.c,E=e.d,O=e.e,S=e.f,T=e.g,C=e.h,P=e.i,M=24048;function I(t,e,n,r){var i,o;0|B(t|=0,e|=0,n|=0,r|=0,0)&&(Pe(0|r,0,(o=1+(0|v(3*n|0,n+1|0))|0)<<3|0),(i=0|ve(o,4))&&(R(t,e,n,r,i,o,0),ye(i)))}function B(t,e,n,r,o){t|=0,e|=0,n|=0,o|=0;var a,s=0,u=0,c=0,l=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|kt(t,e))return M=a,0|(d=1);i[d>>2]=0;t: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|k(s,e,4,d)))&0==(0|(e=0|w()))){s=2;break t}if(0|kt(s,e)){s=1;break t}}if(0==(0|(s=0|k(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),l=6==(0|(c=h+1|0)),0|kt(s,e)){s=1;break t}if((0|(f=f+(l&t&1)|0))>(0|n)){s=0;break}h=t?l?0:c: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|k(s,e,4,d)))&0==(0|(e=0|w()))){s=2;break t}if(0|kt(s,e)){s=1;break t}}if(0==(0|(s=0|k(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),l=6==(0|(c=h+1|0)),0|kt(s,e)){s=1;break t}if((0|(f=f+(l&t&1)|0))>(0|n)){s=0;break}h=t?l?0:c:h,p=p+1|0,u=t?0:u}else s=0}while(0);return M=a,0|(d=s)}function R(t,e,n,r,o,a,s){n|=0,r|=0,o|=0,a|=0,s|=0;var u,c,l=0,h=0,f=0,p=0,d=0;if(c=M,M=M+16|0,u=c,0==(0|(t|=0))&0==(0|(e|=0)))M=c;else{if(l=0|we(0|t,0|e,0|a,((0|a)<0)<<31>>31|0),w(),!(0==(0|(d=0|i[(p=h=r+(l<<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+((l=(l+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));l=o+(l<<2)|0,f&&(0|i[l>>2])<=(0|s)||(i[(d=h)>>2]=t,i[d+4>>2]=e,i[l>>2]=s,(0|s)>=(0|n)||(d=s+1|0,i[u>>2]=0,R(p=0|k(t,e,2,u),0|w(),n,r,o,a,d),i[u>>2]=0,R(p=0|k(t,e,3,u),0|w(),n,r,o,a,d),i[u>>2]=0,R(p=0|k(t,e,1,u),0|w(),n,r,o,a,d),i[u>>2]=0,R(p=0|k(t,e,5,u),0|w(),n,r,o,a,d),i[u>>2]=0,R(p=0|k(t,e,4,u),0|w(),n,r,o,a,d),i[u>>2]=0,R(p=0|k(t,e,6,u),0|w(),n,r,o,a,d))),M=c}}function k(t,e,n,r){t|=0,e|=0,n|=0;var o,a,s=0,u=0,c=0,l=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|Ee(0|t,0|e,45),w(),a=127&o,u=0|Lt(t,e),s=0|Ee(0|t,0|e,52),w(),s&=15;t:do{if(s)for(;;){if(f=0|Ee(0|t,0|e,0|(h=3*(15-s|0)|0)),w(),f&=7,p=0==(0|Ut(s)),s=s+-1|0,l=0|Oe(7,0,0|h),e&=~(0|w()),t=(h=0|Oe(0|i[(p?464:48)+(28*f|0)+(n<<2)>>2],0,0|h))|t&~l,e|=0|w(),!(n=0|i[(p?672:256)+(28*f|0)+(n<<2)>>2])){n=0;break t}if(!s){c=6;break}}else c=6}while(0);6==(0|c)&&(t|=f=0|Oe(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|Oe(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|jt(p|t,e),e=0|w(),i[r>>2]=1+(0|i[r>>2]))),c=0|Ee(0|t,0|e,45),w(),c&=127;t:do{if(0|D(c)){e:do{if(1==(0|Lt(t,e))){if((0|a)!=(0|c)){if(0|U(c,0|i[7728+(28*a|0)>>2])){t=0|zt(t,e),u=1,e=0|w();break}t=0|jt(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|jt(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|Dt(t,e),e=0|w(),s=s+1|0}while((0|s)!=(0|n))}if((0|a)!=(0|c)){if(!(0|j(c))){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|jt(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,c,l,h,f,p,d,A,g,m=0,y=0,v=0,_=0,b=0,x=0,E=0,O=0,S=0,T=0,C=0,P=0,I=0,B=0;if(g=M,M=M+48|0,p=g+32|0,d=g+16|0,A=g,(0|(m=0|i[(t|=0)>>2]))<=0)return M=g,0|(P=0);u=t+4|0,c=p+8|0,l=d+8|0,h=A+8|0,f=((0|e)<0)<<31>>31,C=0;t:for(;;){S=(y=0|i[u>>2])+(C<<4)|0,i[p>>2]=i[S>>2],i[p+4>>2]=i[S+4>>2],i[p+8>>2]=i[S+8>>2],i[p+12>>2]=i[S+12>>2],(0|C)==(m+-1|0)?(i[d>>2]=i[y>>2],i[d+4>>2]=i[y+4>>2],i[d+8>>2]=i[y+8>>2],i[d+12>>2]=i[y+12>>2]):(S=y+(C+1<<4)|0,i[d>>2]=i[S>>2],i[d+4>>2]=i[S+4>>2],i[d+8>>2]=i[S+8>>2],i[d+12>>2]=i[S+12>>2]),S=0|q(p,d,n);e:do{if((0|S)>0){T=+(0|S),O=0;n:for(;;){B=+(S-O|0),I=+(0|O),o[A>>3]=+o[p>>3]*B/T+ +o[d>>3]*I/T,o[h>>3]=+o[c>>3]*B/T+ +o[l>>3]*I/T,y=0|we(0|(x=0|Nt(A,n)),0|(E=0|w()),0|e,0|f),w(),_=0|i[(v=m=s+(y<<3)|0)>>2],v=0|i[v+4>>2];r:do{if(0==(0|_)&0==(0|v))P=14;else for(b=0;;){if((0|b)>(0|e)){m=1;break r}if((0|_)==(0|x)&(0|v)==(0|E)){m=7;break r}if(0==(0|(_=0|i[(v=m=s+((y=(y+1|0)%(0|e)|0)<<3)|0)>>2]))&0==(0|(v=0|i[v+4>>2]))){P=14;break}b=b+1|0}}while(0);switch(14==(0|P)&&(P=0,0==(0|x)&0==(0|E)?m=7:(i[m>>2]=x,i[m+4>>2]=E,m=0|i[r>>2],i[(b=a+(m<<3)|0)>>2]=x,i[b+4>>2]=E,i[r>>2]=m+1,m=0)),7&m){case 7:case 0:break;default:break n}if((0|S)<=(0|(O=O+1|0))){P=8;break e}}if(0|m){m=-1,P=20;break t}}else P=8}while(0);if(8==(0|P)&&(P=0),(0|(C=C+1|0))>=(0|(m=0|i[t>>2]))){m=0,P=20;break}}return 20==(0|P)?(M=g,0|m):0}function D(t){return 0|i[7728+(28*(t|=0)|0)+16>>2]}function j(t){return 4==(0|(t|=0))|117==(0|t)|0}function F(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 V(t){return+o[(t|=0)+16>>3]<+o[t+24>>3]|0}function H(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 W(t,e){t|=0,e|=0;var n,r,a,s,c,l,h=0,f=0;s=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 qt(e,a),Ht(f=0|i[(h=a)>>2],h=0|i[h+4>>2],n),Wt(f,h,r),c=+Ct(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],l=+Ct(n,r),f=~~+y(+l*l/+Se(+ +u(+(+o[h>>3]-+o[f>>3])/(+o[n>>3]-+o[r>>3])),3)/(c*(2.59807621135*c)*.8)),M=s,0|(0==(0|f)?1:f)}function q(t,e,n){t|=0,e|=0,n|=0;var r,o,a,s,u,c=0,l=0;s=M,M=M+288|0,r=s+264|0,o=s+96|0,l=(c=a=s)+96|0;do{i[c>>2]=0,c=c+4|0}while((0|c)<(0|l));return qt(n,a),Ht(c=0|i[(l=a)>>2],l=0|i[l+4>>2],r),Wt(c,l,o),u=+Ct(r,o+8|0),l=~~+y(+ +Ct(t,e)/(2*u)),M=s,0|(0==(0|l)?1:l)}function X(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 J(t,e){t|=0;var n,r,a,s,c=0,l=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|(c=~~f)),p-=+(0|(t=~~p));do{if(f<.5){if(f<.3333333333333333){if(i[e>>2]=c,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){c=c+1|0,i[e>>2]=c;break}i[e>>2]=c;break}if(!(f<.6666666666666666)){if(c=c+1|0,i[e>>2]=c,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]=c;break}}else t=t+1|0,i[e+4>>2]=t;c=c+1|0,i[e>>2]=c}while(0);do{if(r<0){if(1&t){c=~~(+(0|c)-(2*(+((d=0|_e(0|c,((0|c)<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]=c;break}c=~~(+(0|c)-2*(+((d=0|_e(0|c,((0|c)<0)<<31>>31|0,0|(d=(0|t)/2|0),((0|d)<0)<<31>>31|0))>>>0)+4294967296*+(0|w()))),i[e>>2]=c;break}}while(0);d=e+4|0,a<0&&(c=c-((1|t<<1)/2|0)|0,i[e>>2]=c,t=0-t|0,i[d>>2]=t),l=t-c|0,(0|c)<0?(h=0-c|0,i[d>>2]=l,i[s>>2]=h,i[e>>2]=0,t=l,c=0):h=0,(0|t)<0&&(c=c-t|0,i[e>>2]=c,h=h-t|0,i[s>>2]=h,i[d>>2]=0,t=0),n=c-h|0,l=t-h|0,(0|h)<0&&(i[e>>2]=n,i[d>>2]=l,i[s>>2]=0,t=l,c=n,h=0),(0|(l=(0|h)<(0|(l=(0|t)<(0|c)?t:c))?h:l))<=0||(i[e>>2]=c-l,i[d>>2]=t-l,i[s>>2]=h-l)}function Z(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 Q(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 K(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|v(0|i[(t|=0)>>2],e),i[t>>2]=r,n=0|v(0|i[(r=t+4|0)>>2],e),i[r>>2]=n,e=0|v(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|ge(+((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|ge(+((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|ge(+(((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|ge(+((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 ct(t){switch(0|(t|=0)){case 1:t=3;break;case 3:t=2;break;case 2:t=6;break;case 6:t=4;break;case 4:t=5;break;case 5:t=1}return 0|t}function lt(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 gt(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 mt(t,e,n,r){e|=0,n|=0,r|=0;var a,s=0,u=0,c=0,l=0;if(a=M,M=M+32|0,function(t,e){e|=0;var n,r,i=0;i=+o[(t=t|0)>>3],n=+h(+i),i=+f(+i),o[e+16>>3]=i,i=+o[t+8>>3],r=n*+h(+i),o[e>>3]=r,i=n*+f(+i),o[e+8>>3]=i}(t|=0,u=a),i[n>>2]=0,s=+ue(15888,u),(c=+ue(15912,u))<s&&(i[n>>2]=1,s=c),(c=+ue(15936,u))<s&&(i[n>>2]=2,s=c),(c=+ue(15960,u))<s&&(i[n>>2]=3,s=c),(c=+ue(15984,u))<s&&(i[n>>2]=4,s=c),(c=+ue(16008,u))<s&&(i[n>>2]=5,s=c),(c=+ue(16032,u))<s&&(i[n>>2]=6,s=c),(c=+ue(16056,u))<s&&(i[n>>2]=7,s=c),(c=+ue(16080,u))<s&&(i[n>>2]=8,s=c),(c=+ue(16104,u))<s&&(i[n>>2]=9,s=c),(c=+ue(16128,u))<s&&(i[n>>2]=10,s=c),(c=+ue(16152,u))<s&&(i[n>>2]=11,s=c),(c=+ue(16176,u))<s&&(i[n>>2]=12,s=c),(c=+ue(16200,u))<s&&(i[n>>2]=13,s=c),(c=+ue(16224,u))<s&&(i[n>>2]=14,s=c),(c=+ue(16248,u))<s&&(i[n>>2]=15,s=c),(c=+ue(16272,u))<s&&(i[n>>2]=16,s=c),(c=+ue(16296,u))<s&&(i[n>>2]=17,s=c),(c=+ue(16320,u))<s&&(i[n>>2]=18,s=c),(c=+ue(16344,u))<s&&(i[n>>2]=19,s=c),(c=+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=+St((s=+o[16368+(24*n|0)>>3])-+St(+function(t,e){t|=0;var n,r,i,a,s;return a=+o[(e=e|0)>>3],r=+h(+a),i=+o[e+8>>3]-+o[t+8>>3],s=r*+f(+i),n=+o[t>>3],+ +m(+s,+(+f(+a)*+h(+n)-+h(+i)*(r*+f(+n))))}(15568+(n<<4)|0,t))),l=0|Ut(e)?+St(s+-.3334731722518321):s,s=+p(+c)/.381966011250105,(0|e)>0){u=0;do{s*=2.6457513110645907,u=u+1|0}while((0|u)!=(0|e))}c=+h(+l)*s,o[r>>3]=c,l=+f(+l)*s,o[r+8>>3]=l,M=a}function yt(t,e,n,r,a){e|=0,n|=0,r|=0,a|=0;var s=0,l=0;if((s=+function(t){var e,n;return n=+o[(t=t|0)>>3],e=+o[t+8>>3],+ +c(+(n*n+e*e))}(t|=0))<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(l=+m(+ +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=+g(.381966011250105*(n?s:s/2.6457513110645907))):(s=+g(.381966011250105*s),0|Ut(n)&&(l=+St(l+.3334731722518321))),function(t,e,n,r){t|=0,e=+e,r|=0;var a=0,s=0,c=0,l=0;if((n=+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(c=+h(+n),n=+f(+n),e=c*+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(l=+h(+e),s=n*+f(+s)/l,n=+o[t>>3],e=(c-+f(+e)*+f(+n))/+h(+n)/l,c=s>1?1:s,e=e>1?1:e,(e=+o[t+8>>3]+ +m(+(c<-1?-1:c),+(e<-1?-1:e)))>3.141592653589793)do{e+=-6.283185307179586}while(e>3.141592653589793);if(e<-3.141592653589793)do{e+=6.283185307179586}while(e<-3.141592653589793);return void(o[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])>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,+St(+o[16368+(24*e|0)>>3]-l),s,a)}function vt(t,e,n){e|=0,n|=0;var r,o;r=M,M=M+16|0,Q((t|=0)+4|0,o=r),yt(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,c,l,h,f,p,d,A,g,m,y,v,_,b,x,w,O,S,T,C,P,I=0,B=0,R=0,k=0,L=0,D=0;if(P=M,M=M+272|0,k=P+240|0,S=P,T=P+224|0,C=P+208|0,m=P+176|0,y=P+160|0,v=P+192|0,_=P+144|0,b=P+128|0,x=P+112|0,w=P+96|0,O=P+80|0,i[(I=P+256|0)>>2]=e,i[k>>2]=i[t>>2],i[k+4>>2]=i[t+4>>2],i[k+8>>2]=i[t+8>>2],i[k+12>>2]=i[t+12>>2],bt(k,I,S),i[a>>2]=0,(0|(k=r+n+(5==(0|r)&1)|0))<=(0|n))M=P;else{u=T+4|0,c=m+4|0,l=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,g=C+4|0,R=n;t:for(;;){B=S+(((0|R)%5|0)<<4)|0,i[C>>2]=i[B>>2],i[C+4>>2]=i[B+4>>2],i[C+8>>2]=i[B+8>>2],i[C+12>>2]=i[B+12>>2];do{}while(2==(0|xt(C,s,0,1)));if((0|R)>(0|n)&0!=(0|Ut(e))){if(i[m>>2]=i[C>>2],i[m+4>>2]=i[C+4>>2],i[m+8>>2]=i[C+8>>2],i[m+12>>2]=i[C+12>>2],Q(u,y),r=0|i[m>>2],I=0|i[17008+(80*r|0)+(i[T>>2]<<2)>>2],i[m>>2]=i[18608+(80*r|0)+(20*I|0)>>2],(0|(B=0|i[18608+(80*r|0)+(20*I|0)+16>>2]))>0){t=0;do{at(c),t=t+1|0}while((0|t)<(0|B))}switch(B=18608+(80*r|0)+(20*I|0)+4|0,i[v>>2]=i[B>>2],i[v+4>>2]=i[B+4>>2],i[v+8>>2]=i[B+8>>2],$(v,3*(0|i[h>>2])|0),K(c,v,c),Z(c),Q(c,_),L=+(0|i[f>>2]),o[b>>3]=3*L,o[p>>3]=0,D=-1.5*L,o[x>>3]=D,o[d>>3]=2.598076211353316*L,o[w>>3]=D,o[A>>3]=-2.598076211353316*L,0|i[17008+(80*(0|i[m>>2])|0)+(i[C>>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(y,_,r,t,O),yt(O,0|i[m>>2],s,1,a+8+(i[a>>2]<<4)|0),i[a>>2]=1+(0|i[a>>2])}if((0|R)<(0|l)&&(Q(g,m),yt(m,0|i[C>>2],s,1,a+8+(i[a>>2]<<4)|0),i[a>>2]=1+(0|i[a>>2])),i[T>>2]=i[C>>2],i[T+4>>2]=i[C+4>>2],i[T+8>>2]=i[C+8>>2],i[T+12>>2]=i[C+12>>2],(0|(R=R+1|0))>=(0|k)){t=3;break}}3!=(0|t)?12==(0|t)&&E(22474,22521,581,22531):M=P}}function bt(t,e,n){t|=0,e|=0,n|=0;var r,o=0,a=0,s=0,u=0,c=0;r=M,M=M+128|0,a=r,u=20208,c=(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|c));u=20272,c=(s=a)+60|0;do{i[s>>2]=i[u>>2],s=s+4|0,u=u+4|0}while((0|s)<(0|c));o=(c=0==(0|Ut(0|i[e>>2])))?o:a,lt(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],K(a,o,e=n+4|0),Z(e),i[n+16>>2]=i[t>>2],K(a,o+12|0,e=n+20|0),Z(e),i[n+32>>2]=i[t>>2],K(a,o+24|0,e=n+36|0),Z(e),i[n+48>>2]=i[t>>2],K(a,o+36|0,e=n+52|0),Z(e),i[n+64>>2]=i[t>>2],K(a,o+48|0,n=n+68|0),Z(n),M=r}function xt(t,e,n,r){n|=0,r|=0;var o,a,s,u,c,l,h=0,f=0,p=0,d=0,A=0;if(l=M,M=M+32|0,c=l+12|0,a=l,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=l,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=l,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?(X(c,d,0,0),Y(A,c,a),st(a),K(a,c,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[c>>2]=i[t>>2],i[c+4>>2]=i[t+4>>2],i[c+8>>2]=i[t+8>>2],e=0|i[16848+(e<<2)>>2],$(c,u?3*e|0:e),K(A,c,A),Z(A),r=u&&((0|i[s>>2])+(0|i[A>>2])+(0|i[p>>2])|0)==(0|d)?1:2,M=l,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 Et(t,e,n,r,a){t|=0,e|=0,n|=0,r|=0,a|=0;var s,u,c,l,h,f,p,d,A,g,m,y,v,_,b,x,w,O,S=0,T=0,C=0,P=0,I=0;if(O=M,M=M+240|0,_=O+208|0,b=O,x=O+192|0,w=O+176|0,A=O+160|0,g=O+144|0,m=O+128|0,y=O+112|0,v=O+96|0,i[(S=O+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],Ot(_,S,b),i[a>>2]=0,(0|(d=r+n+(6==(0|r)&1)|0))<=(0|n))M=O;else{u=n+6|0,c=16928+((s=0|i[S>>2])<<2)|0,l=g+8|0,h=m+8|0,f=y+8|0,p=x+4|0,T=0,C=n,r=-1;t:for(;;){if(t=b+((S=(0|C)%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=T,T=0|xt(x,s,0,1),(0|C)>(0|n)&0!=(0|Ut(e))&&(1!=(0|t)&&(0|i[x>>2])!=(0|r))){switch(Q(b+(((S+5|0)%6|0)<<4)+4|0,w),Q(b+(S<<4)+4|0,A),P=+(0|i[c>>2]),o[g>>3]=3*P,o[l>>3]=0,I=-1.5*P,o[m>>3]=I,o[h>>3]=2.598076211353316*P,o[y>>3]=I,o[f>>3]=-2.598076211353316*P,S=0|i[_>>2],0|i[17008+(80*S|0)+(((0|r)==(0|S)?0|i[x>>2]:r)<<2)>>2]){case 1:t=m,r=g;break;case 3:t=y,r=m;break;case 2:t=g,r=y;break;default:t=8;break t}ae(w,A,r,t,v),0|se(w,v)||0|se(A,v)||(yt(v,0|i[_>>2],s,1,a+8+(i[a>>2]<<4)|0),i[a>>2]=1+(0|i[a>>2]))}if((0|C)<(0|u)&&(Q(p,w),yt(w,0|i[x>>2],s,1,a+8+(i[a>>2]<<4)|0),i[a>>2]=1+(0|i[a>>2])),(0|(C=C+1|0))>=(0|d)){t=3;break}r=0|i[x>>2]}3!=(0|t)?8==(0|t)&&E(22557,22521,746,22602):M=O}}function Ot(t,e,n){t|=0,e|=0,n|=0;var r,o=0,a=0,s=0,u=0,c=0;r=M,M=M+160|0,a=r,u=20336,c=(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|c));u=20416,c=(s=a)+72|0;do{i[s>>2]=i[u>>2],s=s+4|0,u=u+4|0}while((0|s)<(0|c));o=(c=0==(0|Ut(0|i[e>>2])))?o:a,lt(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],K(a,o,e=n+4|0),Z(e),i[n+16>>2]=i[t>>2],K(a,o+12|0,e=n+20|0),Z(e),i[n+32>>2]=i[t>>2],K(a,o+24|0,e=n+36|0),Z(e),i[n+48>>2]=i[t>>2],K(a,o+36|0,e=n+52|0),Z(e),i[n+64>>2]=i[t>>2],K(a,o+48|0,e=n+68|0),Z(e),i[n+80>>2]=i[t>>2],K(a,o+60|0,n=n+84|0),Z(n),M=r}function St(t){var e;return e=(t=+t)<0?t+6.283185307179586:t,+(t>=6.283185307179586?e+-6.283185307179586:e)}function Tt(t,e){return e|=0,+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 Ct(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*+m(+ +c(+a),+ +c(+(1-a)))*6371.007180918475}function Pt(t,e,n){t|=0,n|=0;var r,i,a,s,u=0,l=0,d=0,A=0,y=0,v=0;return v=+o[(e|=0)>>3],a=+o[t>>3],y=+f(.5*(v-a)),d=+o[e+8>>3],i=+o[t+8>>3],A=+f(.5*(d-i)),r=+h(+a),s=+h(+v),A=2*+m(+ +c(+(A=y*y+A*(s*r*A))),+ +c(+(1-A))),y=+o[n>>3],v=+f(.5*(y-v)),u=+o[n+8>>3],d=+f(.5*(u-d)),l=+h(+y),d=2*+m(+ +c(+(d=v*v+d*(s*l*d))),+ +c(+(1-d))),y=+f(.5*(a-y)),u=+f(.5*(i-u)),u=2*+m(+ +c(+(u=y*y+u*(r*l*u))),+ +c(+(1-u))),4*+g(+ +c(+ +p(.5*(l=.5*(A+d+u)))*+p(.5*(l-A))*+p(.5*(l-d))*+p(.5*(l-u))))}function Mt(t,e){return e=0|Ee(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|Ee(0|(t|=0),0|e,45),w(),(a&=127)>>>0>121)return 0|(e=0);n=0|Ee(0|t,0|e,52),w(),n&=15;do{if(0|n){for(i=1,r=0;;){if(o=0|Ee(0|t,0|e,3*(15-i|0)|0),w(),0!=(0|(o&=7))&(1^r)){if(1==(0|o)&0!=(0|D(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|Ee(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 Bt(t,e,n){n|=0;var r=0,i=0;if(r=0|Ee(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|Oe(0|n,0,52),e=0|w()|-15728641&e,(0|r)>(0|n))do{i=0|Oe(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 Rt(t,e,n,r){n|=0,r|=0;var o,a=0,s=0,u=0,c=0,l=0,h=0;if(u=0|Ee(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|(l=0|ee(7,n-u|0)))/7|0,c=0|Ee(0|t,0|e,45),w(),0|D(127&c)){t:do{if(u)for(s=1;;){if(a=0|Ee(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|Oe(u+1|0,0,52),a=0|w()|-15728641&e,Rt(e=(h|t)&~(e=0|Oe(7,0,0|(c=3*(14-u|0)|0))),u=a&~(0|w()),n,r),a=r+(o<<3)|0,!s)return Rt((h=0|Oe(1,0,0|c))|e,0|w()|u,n,a),h=a+(o<<3)|0,Rt((l=0|Oe(2,0,0|c))|e,0|w()|u,n,h),h=h+(o<<3)|0,Rt((l=0|Oe(3,0,0|c))|e,0|w()|u,n,h),h=h+(o<<3)|0,Rt((l=0|Oe(4,0,0|c))|e,0|w()|u,n,h),h=h+(o<<3)|0,Rt((l=0|Oe(5,0,0|c))|e,0|w()|u,n,h),void Rt((l=0|Oe(6,0,0|c))|e,0|w()|u,n,h+(o<<3)|0);s=a+(o<<3)|0,(0|l)>6&&(Pe(0|a,0,(h=(s>>>0>(l=a+8|0)>>>0?s:l)+-1+(0-a)|0)+8&-8|0),a=l+(h>>>3<<3)|0),Rt((h=0|Oe(2,0,0|c))|e,0|w()|u,n,a),h=a+(o<<3)|0,Rt((l=0|Oe(3,0,0|c))|e,0|w()|u,n,h),h=h+(o<<3)|0,Rt((l=0|Oe(4,0,0|c))|e,0|w()|u,n,h),h=h+(o<<3)|0,Rt((l=0|Oe(5,0,0|c))|e,0|w()|u,n,h),Rt((l=0|Oe(6,0,0|c))|e,0|w()|u,n,h+(o<<3)|0)}}function kt(t,e){var n=0,r=0,i=0;if(i=0|Ee(0|(t|=0),0|(e|=0),45),w(),!(0|D(127&i)))return 0|(i=0);i=0|Ee(0|t,0|e,52),w(),i&=15;t:do{if(i)for(r=1;;){if(n=0|Ee(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|Ee(0|(t|=0),0|(e|=0),52),w(),!(i&=15))return 0|(i=0);for(r=1;;){if(n=0|Ee(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 Dt(t,e){var n=0,r=0,i=0,o=0,a=0,s=0,u=0;if(u=0|Ee(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|Oe(7,0,0|(o=3*(15-s|0)|0)),i=0|w(),a=0|Ee(0|t,0|e,0|o),w(),t=(o=0|Oe(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|Ee(0|t,0|e,52),w(),r&=15){n=1;e:for(;;){switch(a=0|Ee(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|Ee(0|t,0|e,0|(a=3*(15-n|0)|0)),w(),o=0|Oe(7,0,0|a),e&=~(0|w()),t=t&~o|(a=0|Oe(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 jt(t,e){var n=0,r=0,i=0,o=0,a=0;if(r=0|Ee(0|(t|=0),0|(e|=0),52),w(),!(r&=15))return r=t,x(0|(n=e)),0|r;for(n=1;a=0|Ee(0|t,0|e,0|(o=3*(15-n|0)|0)),w(),i=0|Oe(7,0,0|o),e&=~(0|w()),t=(o=0|Oe(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 Ft(t,e){var n=0,r=0,i=0,o=0,a=0,s=0,u=0;if(u=0|Ee(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|Oe(7,0,0|(o=3*(15-s|0)|0)),i=0|w(),a=0|Ee(0|t,0|e,0|o),w(),t=(o=0|Oe(0|ct(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|Ee(0|t,0|e,52),w(),r&=15){n=1;e:for(;;){switch(a=0|Ee(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|Oe(7,0,0|(i=3*(15-n|0)|0)),a=e&~(0|w()),e=0|Ee(0|t,0|e,0|i),w(),t=t&~o|(e=0|Oe(0|ct(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|Ee(0|(t|=0),0|(e|=0),52),w(),!(r&=15))return r=t,x(0|(n=e)),0|r;for(n=1;o=0|Oe(7,0,0|(a=3*(15-n|0)|0)),i=e&~(0|w()),e=0|Ee(0|t,0|e,0|a),w(),t=(e=0|Oe(0|ct(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,mt(t|=0,e|=0,n|=0,i=r),J(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,c=0,l=0,h=0;if(n=M,M=M+64|0,c=n+40|0,o=n+24|0,a=n+12|0,s=n,Oe(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?(c=0,x(0|(u=0)),M=n,0|c):(Oe(0|F(t),0,45),u=0|w()|r,c=-1,x(0|u),M=n,0|c);if(i[c>>2]=i[t>>2],i[c+4>>2]=i[t+4>>2],i[c+8>>2]=i[t+8>>2],i[c+12>>2]=i[t+12>>2],u=c+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),Z(s),l=0|Oe(7,0,0|(h=3*(15-e|0)|0)),r&=~(0|w()),t=(h=0|Oe(0|tt(s),0,0|h))|t&~l,r=0|w()|r,(0|e)>1;)e=e+-1|0;else t=-1;t:do{if((0|i[u>>2])<=2&&(0|i[c+8>>2])<=2&&(0|i[c+12>>2])<=2){if(e=0|Oe(0|(o=0|F(c)),0,45),e|=t,t=0|w()|-1040385&r,s=0|z(c),!(0|D(o))){if((0|s)<=0)break;for(a=0;;){if(o=0|Ee(0|e,0|t,52),w(),o&=15)for(r=1;c=0|Ee(0|e,0|t,0|(h=3*(15-r|0)|0)),w(),l=0|Oe(7,0,0|h),t&=~(0|w()),e=e&~l|(h=0|Oe(0|ut(7&c),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|Ee(0|e,0|t,52),w(),a&=15;e:do{if(a){r=1;n:for(;;){switch(h=0|Ee(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[c>>2]))for(r=1;l=0|Oe(7,0,0|(c=3*(15-r|0)|0)),h=t&~(0|w()),t=0|Ee(0|e,0|t,0|c),w(),e=e&~l|(t=0|Oe(0|ct(7&t),0,0|c)),t=0|h|w(),r>>>0<a>>>0;)r=r+1|0;else for(r=1;c=0|Ee(0|e,0|t,0|(h=3*(15-r|0)|0)),w(),l=0|Oe(7,0,0|h),t&=~(0|w()),e=e&~l|(h=0|Oe(0|ut(7&c),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|Dt(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|(l=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|Ee(0|(t|=0),0|(e|=0),52),w(),a&=15,s=0|Ee(0|t,0|e,45),w(),o=0==(0|a),0|D(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|Ee(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 Vt(t,e,n){n|=0;var r,o,a=0,s=0,u=0,c=0,l=0,h=0;o=M,M=M+16|0,r=o,h=0|Ee(0|(t|=0),0|(e|=0),45),w(),h&=127;t:do{if(0!=(0|D(h))&&(u=0|Ee(0|t,0|e,52),w(),0!=(0|(u&=15)))){a=1;e:for(;;){switch(l=0|Ee(0|t,0|e,3*(15-a|0)|0),w(),7&l){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;c=0|Oe(7,0,0|(e=3*(15-s|0)|0)),l=a&~(0|w()),a=0|Ee(0|t,0|a,0|e),w(),t=t&~c|(a=0|Oe(0|ct(7&a),0,0|e)),a=0|l|w(),s>>>0<u>>>0;)s=s+1|0}else a=e}while(0);if(l=7728+(28*h|0)|0,i[n>>2]=i[l>>2],i[n+4>>2]=i[l+4>>2],i[n+8>>2]=i[l+8>>2],i[n+12>>2]=i[l+12>>2],0|Gt(t,a,n)){if(c=n+4|0,i[r>>2]=i[c>>2],i[r+4>>2]=i[c+4>>2],i[r+8>>2]=i[c+8>>2],u=0|Ee(0|t,0|a,52),w(),l=15&u,1&u?(it(c),u=l+1|0):u=l,0|D(h)){t:do{if(l)for(e=1;;){if(s=0|Ee(0|t,0|a,3*(15-e|0)|0),w(),0|(s&=7)){a=s;break t}if(!(e>>>0<l>>>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|D(h))do{}while(0!=(0|xt(n,u,0,0)));(0|u)!=(0|l)&&nt(c)}else(0|u)!=(0|l)&&(i[c>>2]=i[r>>2],i[c+4>>2]=i[r+4>>2],i[c+8>>2]=i[r+8>>2]);M=o}else M=o}function Ht(t,e,n){n|=0;var r,i;r=M,M=M+16|0,Vt(t|=0,e|=0,i=r),e=0|Ee(0|t,0|e,52),w(),vt(i,15&e,n),M=r}function Wt(t,e,n){n|=0;var r,i,o=0,a=0;i=M,M=M+16|0,Vt(t|=0,e|=0,r=i),o=0|Ee(0|t,0|e,45),w(),o=0==(0|D(127&o)),a=0|Ee(0|t,0|e,52),w(),a&=15;t:do{if(!o){if(0|a)for(o=1;;){if(!(0==((0|Oe(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);Et(r,a,0,6,n),M=i}function qt(t,e){e|=0;var n,r=0,o=0,a=0,s=0,u=0,c=0;if(Oe(0|(t|=0),0,52),n=134225919|w(),(0|t)<1){o=0,r=0;do{0|D(o)&&(Oe(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|D(u)){for(Oe(0|u,0,45),o=1,a=-1,s=0|n|w();a&=~(c=0|Oe(7,0,3*(15-o|0)|0)),s&=~(0|w()),(0|o)!=(0|t);)o=o+1|0;i[(c=e+(r<<3)|0)>>2]=a,i[c+4>>2]=s,r=r+1|0}u=u+1|0}while(122!=(0|u))}}function Xt(t,e,n,r){var o,a=0,s=0,u=0,c=0,l=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|Ee(0|t,0|e,52),w(),a&=15,s=0|Ee(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&&(l=0|Bt(t,e,s),c=0|w(),(0|l)==(0|(s=0|Bt(n,r,s)))&(0|c)==(0|w()))){if(a=0|Ee(0|t,0|e,0|(s=3*(15^a)|0)),w(),a&=7,s=0|Ee(0|n,0|r,0|s),w(),0==(0|a)|0==(0|(s&=7)))return M=o,0|(l=1);if((0|i[21136+(a<<2)>>2])==(0|s))return M=o,0|(l=1);if((0|i[21168+(a<<2)>>2])==(0|s))return M=o,0|(l=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[(l=u)>>2])==(0|n)&&(0|i[l+4>>2])==(0|r)||(0|i[(l=u+8|0)>>2])==(0|n)&&(0|i[l+4>>2])==(0|r)||(0|i[(l=u+16|0)>>2])==(0|n)&&(0|i[l+4>>2])==(0|r)||(0|i[(l=u+24|0)>>2])==(0|n)&&(0|i[l+4>>2])==(0|r)||(0|i[(l=u+32|0)>>2])==(0|n)&&(0|i[l+4>>2])==(0|r)||(0|i[(l=u+40|0)>>2])==(0|n)&&(0|i[l+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|(l=a)}function Jt(t,e,n){n|=0;var r,o,a,s,u=0;if(a=M,M=M+16|0,o=a,u=0|Ee(0|(t|=0),0|(e|=0),56),w(),-1==(0|(e=0|function(t,e,n){n|=0;var r,o=0;if(o=0|kt(t=t|0,e=e|0),(n+-1|0)>>>0>5)return 0|(n=-1);if(1==(0|n)&(r=0!=(0|o)))return 0|(n=-1);return o=0|function(t,e){var n,r,o,a=0,s=0,u=0,c=0,l=0;if(o=M,M=M+32|0,r=o,Vt(t=t|0,e=e|0,n=o+16|0),u=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]}(u,r),e=0|function(t,e){t|=0;var n=0,r=0;if((e|=0)>>>0>20)return 0|(e=-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>>2])!=(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 0|(t=-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|(e=0|i[11152+(216*e|0)+(72*n|0)+(24*t|0)+(r<<3)+4>>2])}(u,0|i[n>>2]),!(0|D(u)))return M=o,0|(l=e);switch(0|u){case 4:t=0,a=14;break;case 14:t=1,a=14;break;case 24:t=2,a=14;break;case 38:t=3,a=14;break;case 49:t=4,a=14;break;case 58:t=5,a=14;break;case 63:t=6,a=14;break;case 72:t=7,a=14;break;case 83:t=8,a=14;break;case 97:t=9,a=14;break;case 107:t=10,a=14;break;case 117:t=11,a=14;break;default:c=0,s=0}14==(0|a)&&(c=0|i[22096+(24*t|0)+8>>2],s=0|i[22096+(24*t|0)+16>>2]);(0|(t=0|i[n>>2]))!=(0|i[r>>2])&&(u=0|j(u),t=0|i[n>>2],u|(0|t)==(0|s)&&(e=(e+1|0)%6|0));if(3==(0|l)&(0|t)==(0|s))return M=o,0|(l=(e+5|0)%6|0);if(!(5==(0|l)&(0|t)==(0|c)))return M=o,0|(l=e);return M=o,0|(l=(e+1|0)%6|0)}(t,e),r?0|(n=(5-o+(0|i[22384+(n<<2)>>2])|0)%5|0):0|(n=(6-o+(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))))return i[n>>2]=0,void(M=a);Vt(r,t,o),u=0|Ee(0|r,0|t,52),w(),u&=15,0|kt(r,t)?_t(o,u,e,2,n):Et(o,u,e,2,n),M=a}function Zt(t){t|=0;var e,n,r=0;return(e=0|ve(1,12))||E(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]&&E(22721,22646,61,22744),i[(r=t)>>2]=e,i[n>>2]=e,0|e)}function Qt(t,e){t|=0,e|=0;var n,r;return(r=0|me(24))||E(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]&&E(22787,22646,82,22772),i[t>>2]=r,i[e>>2]=r,0|r)}function Kt(t){var e,n,r=0,a=0,s=0,c=0,l=0,h=0,f=0,p=0,d=0,A=0,g=0,m=0,y=0,v=0,_=0,b=0,x=0,w=0,O=0,S=0,T=0,C=0,P=0,M=0,I=0,B=0,R=0,k=0,L=0,D=0;if(0|i[(c=(t|=0)+8|0)>>2])return 0|(D=1);if(!(s=0|i[t>>2]))return 0|(D=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|(D=0);(n=0|me(a<<2))||E(22807,22646,317,22826),(e=0|me(a<<5))||E(22848,22646,321,22826),i[t>>2]=0,i[(C=t+4|0)>>2]=0,i[c>>2]=0,a=0,k=0,T=0,g=0;t:for(;;){if(A=0|i[s>>2]){l=0,h=A;do{if(p=+o[h+8>>3],r=h,h=0|i[h+16>>2],f=+o[(c=(d=0==(0|h))?A:h)+8>>3],+u(+(p-f))>3.141592653589793){D=14;break}l+=(f-p)*(+o[r>>3]+ +o[c>>3])}while(!d);if(14==(0|D)){D=0,l=0,r=A;do{S=+o[r+8>>3],B=0|i[(R=r+16|0)>>2],O=+o[(B=0==(0|B)?A:B)+8>>3],l+=(+o[r>>3]+ +o[B>>3])*((O<0?O+6.283185307179586:O)-(S<0?S+6.283185307179586:S)),r=0|i[(0==(0|r)?s:R)>>2]}while(0!=(0|r))}l>0?(i[n+(k<<2)>>2]=s,k=k+1|0,c=T,r=g):D=19}else D=19;if(19==(0|D)){D=0;do{if(!a){if(g){c=C,h=g+8|0,r=s,a=t;break}if(0|i[t>>2]){D=27;break t}c=C,h=t,r=s,a=t;break}if(0|i[(r=a+8|0)>>2]){D=21;break t}if(!(a=0|ve(1,12))){D=23;break t}i[r>>2]=a,c=a+4|0,h=a,r=g}while(0);if(i[h>>2]=s,i[c>>2]=s,h=e+(T<<5)|0,d=0|i[s>>2]){for(o[(A=e+(T<<5)+8|0)>>3]=17976931348623157e292,o[(g=e+(T<<5)+24|0)>>3]=17976931348623157e292,o[h>>3]=-17976931348623157e292,o[(m=e+(T<<5)+16|0)>>3]=-17976931348623157e292,x=17976931348623157e292,w=-17976931348623157e292,c=0,y=d,p=17976931348623157e292,_=17976931348623157e292,b=-17976931348623157e292,f=-17976931348623157e292;l=+o[y>>3],S=+o[y+8>>3],y=0|i[y+16>>2],O=+o[((v=0==(0|y))?d:y)+8>>3],l<p&&(o[A>>3]=l,p=l),S<_&&(o[g>>3]=S,_=S),l>b?o[h>>3]=l:l=b,S>f&&(o[m>>3]=S,f=S),x=S>0&S<x?S:x,w=S<0&S>w?S:w,c|=+u(+(S-O))>3.141592653589793,!v;)b=l;c&&(o[m>>3]=w,o[g>>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;c=T+1|0}if(s=0|i[(R=s+8|0)>>2],i[R>>2]=0,!s){D=45;break}T=c,g=r}if(21==(0|D))E(22624,22646,35,22658);else if(23==(0|D))E(22678,22646,37,22658);else if(27==(0|D))E(22721,22646,61,22744);else if(45==(0|D)){t:do{if((0|k)>0){for(R=0==(0|c),I=c<<2,B=0==(0|t),M=0,r=0;;){if(P=0|i[n+(M<<2)>>2],R)D=73;else{if(!(T=0|me(I))){D=50;break}if(!(C=0|me(I))){D=52;break}e:do{if(B)a=0;else{for(c=0,a=0,h=t;s=e+(c<<5)|0,0|Yt(0|i[h>>2],s,0|i[P>>2])?(i[T+(a<<2)>>2]=h,i[C+(a<<2)>>2]=s,v=a+1|0):v=a,h=0|i[h+8>>2];)c=c+1|0,a=v;if((0|v)>0)if(s=0|i[T>>2],1==(0|v))a=s;else for(m=0,y=-1,a=s,g=s;;){for(d=0|i[g>>2],s=0,h=0;A=(0|(c=0|i[i[T+(h<<2)>>2]>>2]))==(0|d)?s:s+(1&(0|Yt(c,0|i[C+(h<<2)>>2],0|i[d>>2])))|0,(0|(h=h+1|0))!=(0|v);)s=A;if(a=(c=(0|A)>(0|y))?g:a,(0|(s=m+1|0))==(0|v))break e;m=s,y=c?A:y,g=0|i[T+(s<<2)>>2]}else a=0}}while(0);if(ye(T),ye(C),a){if(s=0|i[(c=a+4|0)>>2])a=s+8|0;else if(0|i[a>>2]){D=70;break}i[a>>2]=P,i[c>>2]=P}else D=73}if(73==(0|D)){if(D=0,0|(r=0|i[P>>2]))do{C=r,r=0|i[r+16>>2],ye(C)}while(0!=(0|r));ye(P),r=2}if((0|(M=M+1|0))>=(0|k)){L=r;break t}}50==(0|D)?E(22863,22646,249,22882):52==(0|D)?E(22901,22646,252,22882):70==(0|D)&&E(22721,22646,61,22744)}else L=0}while(0);return ye(n),ye(e),0|(D=L)}return 0}function Yt(t,e,n){t|=0;var r,a=0,s=0,u=0,c=0,l=0,h=0,f=0;if(!(0|H(e|=0,n|=0)))return 0|(t=0);if(e=0|V(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(;c=+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],c>u?(l=c,c=h):(l=u,u=c,c=s,s=h),r<u|r>l;)if(!(n=0|i[n>>2])){n=22;break t}if(a=(c=c<0?c+6.283185307179586:c)==a|(h=s<0?s+6.283185307179586:s)==a?a+-2220446049250313e-31:a,((h+=(r-u)/(l-u)*(c-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(;c=+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],c>u?(l=c,c=h):(l=u,u=c,c=s,s=h),r<u|r>l;)if(!(n=0|i[n>>2])){n=22;break t}if(s+(r-u)/(l-u)*(c-s)>(a=c==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,c,l,h=0,f=0,p=0,d=0,A=0,g=0,m=0,y=0,v=0,_=0;if(l=M,M=M+32|0,_=l+16|0,c=l,h=0|Ee(0|(t|=0),0|(e|=0),52),w(),h&=15,m=0|Ee(0|n,0|o,52),w(),(0|h)!=(15&m|0))return M=l,0|(_=1);if(A=0|Ee(0|t,0|e,45),w(),A&=127,g=0|Ee(0|n,0|o,45),w(),m=(0|A)!=(0|(g&=127))){if(7==(0|(p=0|G(A,g))))return M=l,0|(_=2);7==(0|(d=0|G(g,A)))?E(22925,22949,151,22959):(y=p,f=d)}else y=0,f=0;s=0|D(A),u=0|D(g),i[_>>2]=0,i[_+4>>2]=0,i[_+8>>2]=0,i[_+12>>2]=0;do{if(y){if(p=(0|(g=0|i[4304+(28*A|0)+(y<<2)>>2]))>0,u)if(p){A=0,d=n,p=o;do{d=0|Ft(d,p),p=0|w(),1==(0|(f=0|ct(f)))&&(f=0|ct(1)),A=A+1|0}while((0|A)!=(0|g));g=f,A=d,d=p}else g=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|ct(f),A=A+1|0}while((0|A)!=(0|g));g=f,A=d,d=p}else g=f,A=n,d=o;if(Gt(A,d,_),m||E(22972,22949,181,22959),(p=0!=(0|s))&(f=0!=(0|u))&&E(22999,22949,182,22959),p){if(f=0|Lt(t,e),0|r[22032+(7*f|0)+y>>0]){h=3;break}A=d=0|i[21200+(28*f|0)+(y<<2)>>2],v=26}else if(f){if(f=0|Lt(A,d),0|r[22032+(7*f|0)+g>>0]){h=4;break}A=0,d=0|i[21200+(28*g|0)+(f<<2)>>2],v=26}else f=0;if(26==(0|v))if((0|d)<=-1&&E(23030,22949,212,22959),(0|A)<=-1&&E(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[c>>2]=0,i[c+4>>2]=0,i[c+8>>2]=0,ot(c,y),0|h)for(;0|Ut(h)?rt(c):it(c),(0|h)>1;)h=h+-1|0;if((0|f)>0){h=0;do{st(c),h=h+1|0}while((0|h)!=(0|f))}K(v=_+4|0,c,v),Z(v),v=50}else if(Gt(n,o,_),0!=(0|s)&0!=(0|u))if((0|g)!=(0|A)&&E(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));v=50}else v=50;else v=50}while(0);return 50==(0|v)&&(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=l,0|(_=h)}function te(t,e,n,r){n|=0,r|=0;var o,a,s=0,u=0,c=0,l=0,h=0,f=0,p=0,d=0,A=0,g=0,m=0,y=0,v=0;if(a=M,M=M+48|0,c=a+36|0,l=a+24|0,h=a+12|0,f=a,u=0|Ee(0|(t|=0),0|(e|=0),52),w(),u&=15,d=0|Ee(0|t,0|e,45),w(),o=0|D(d&=127),Oe(0|u,0,52),m=134225919|w(),i[(g=r)>>2]=-1,i[g+4>>2]=m,!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|(m=1)):(A=0|Oe(0|s,0,45),g=0|w(),g=-1040385&i[(d=r)+4>>2]|g,i[(m=r)>>2]=i[d>>2]|A,i[m+4>>2]=g,M=a,0|(m=0));for(i[c>>2]=i[n>>2],i[c+4>>2]=i[n+4>>2],i[c+8>>2]=i[n+8>>2];i[l>>2]=i[c>>2],i[l+4>>2]=i[c+4>>2],i[l+8>>2]=i[c+8>>2],0|Ut(u)?(et(c),i[h>>2]=i[c>>2],i[h+4>>2]=i[c+4>>2],i[h+8>>2]=i[c+8>>2],rt(h)):(nt(c),i[h>>2]=i[c>>2],i[h+4>>2]=i[c+4>>2],i[h+8>>2]=i[c+8>>2],it(h)),Y(l,h,f),Z(f),y=0|i[(g=r)>>2],g=0|i[g+4>>2],n=0|Oe(7,0,0|(v=3*(15-u|0)|0)),g&=~(0|w()),v=0|Oe(0|tt(f),0,0|v),g=0|w()|g,i[(m=r)>>2]=v|y&~n,i[m+4>>2]=g,(0|u)>1;)u=u+-1|0;t:do{if((0|i[c>>2])<=1&&(0|i[c+4>>2])<=1&&(0|i[c+8>>2])<=1){f=127==(0|(l=0|N(d,u=0|tt(c))))?0:0|D(l);e:do{if(u){if(o){if(c=21408+(28*(0|Lt(t,e))|0)+(u<<2)|0,(0|(c=0|i[c>>2]))>0){n=0;do{u=0|ut(u),n=n+1|0}while((0|n)!=(0|c))}if(1==(0|u)){s=3;break t}127==(0|(n=0|N(d,u)))&&E(23104,22949,376,23134),0|D(n)?E(23147,22949,377,23134):(A=c,p=u,s=n)}else A=0,p=u,s=l;if((0|(h=0|i[4304+(28*d|0)+(p<<2)>>2]))<=-1&&E(23178,22949,384,23134),!f){if((0|A)<=-1&&E(23030,22949,417,23134),0|A){u=0,n=0|i[(c=r)>>2],c=0|i[c+4>>2];do{n=0|jt(n,c),c=0|w(),i[(v=r)>>2]=n,i[v+4>>2]=c,u=u+1|0}while((0|u)<(0|A))}if((0|h)<=0){u=54;break}for(u=0,n=0|i[(c=r)>>2],c=0|i[c+4>>2];;)if(n=0|jt(n,c),c=0|w(),i[(v=r)>>2]=n,i[v+4>>2]=c,(0|(u=u+1|0))==(0|h)){u=54;break e}}if(7==(0|(l=0|G(s,d)))&&E(22925,22949,393,23134),n=0|i[(u=r)>>2],u=0|i[u+4>>2],(0|h)>0){c=0;do{n=0|jt(n,u),u=0|w(),i[(v=r)>>2]=n,i[v+4>>2]=u,c=c+1|0}while((0|c)!=(0|h))}if(n=0|Lt(n,u),v=0|j(s),(0|(n=0|i[(v?21824:21616)+(28*l|0)+(n<<2)>>2]))<=-1&&E(23030,22949,412,23134),n){u=0,c=0|i[(l=r)>>2],l=0|i[l+4>>2];do{c=0|Dt(c,l),l=0|w(),i[(v=r)>>2]=c,i[v+4>>2]=l,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*(v=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&&E(23201,22949,433,23134),u){s=0,n=0|i[(c=r)>>2],c=0|i[c+4>>2];do{n=0|jt(n,c),c=0|w(),i[(v=r)>>2]=n,i[v+4>>2]=c,s=s+1|0}while((0|s)<(0|u));s=l,u=54}else s=l,u=55;else s=l,u=54}while(0);if(54==(0|u)&&f&&(u=55),55==(0|u)&&1==(0|Lt(0|i[(v=r)>>2],0|i[v+4>>2]))){s=4;break}m=0|i[(v=r)>>2],v=-1040385&i[v+4>>2],y=0|Oe(0|s,0,45),v=0|v|w(),i[(s=r)>>2]=m|y,i[s+4>>2]=v,s=0}else s=2}while(0);return M=a,0|(v=s)}function ee(t,e){var n=0;if(!(e|=0))return 0|(n=1);n=t|=0,t=1;do{t=0|v(0==(1&e|0)?1:n,t),e>>=1,n=0|v(n,n)}while(0!=(0|e));return 0|t}function ne(t,e,n){t|=0;var r,a,s=0,u=0,c=0,l=0,h=0,f=0,p=0,d=0;if(!(0|H(e|=0,n|=0)))return 0|(d=0);if(e=0|V(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;l=+o[r+(p<<4)>>3],f=+o[r+(p<<4)+8>>3],c=+o[r+((t=(n+2|0)%(0|d)|0)<<4)>>3],u=+o[r+(t<<4)+8>>3],l>c?(h=l,l=f):(h=c,c=l,l=u,u=f),a<c|a>h;){if(!((0|(n=p+1|0))<(0|d))){n=22;break t}t=p,p=n,n=t}if(s=(l=l<0?l+6.283185307179586:l)==s|(f=u<0?u+6.283185307179586:u)==s?s+-2220446049250313e-31:s,((f+=(a-c)/(h-c)*(l-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;l=+o[r+(p<<4)>>3],f=+o[r+(p<<4)+8>>3],c=+o[r+((t=(n+2|0)%(0|d)|0)<<4)>>3],u=+o[r+(t<<4)+8>>3],l>c?(h=l,l=f):(h=c,c=l,l=u,u=f),a<c|a>h;){if(!((0|(n=p+1|0))<(0|d))){n=22;break t}t=p,p=n,n=t}if(u+(a-c)/(h-c)*(l-u)>(s=l==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,c,l=0,h=0,f=0,p=0,d=0,A=0,g=0,m=0,y=0,v=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[(c=e+16|0)>>3]=-17976931348623157e292,!((0|r)<=0)){for(n=0|i[t+4>>2],m=17976931348623157e292,y=-17976931348623157e292,v=0,t=-1,p=17976931348623157e292,d=17976931348623157e292,g=-17976931348623157e292,h=-17976931348623157e292,_=0;l=+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],l<p&&(o[a>>3]=l,p=l),A<d&&(o[s>>3]=A,d=A),l>g?o[e>>3]=l:l=g,A>h&&(o[c>>3]=A,h=A),m=A>0&A<m?A:m,y=A<0&A>y?A:y,v|=+u(+(A-f))>3.141592653589793,(0|(t=_+1|0))!=(0|r);)b=_,g=l,_=t,t=b;v&&(o[c>>3]=y,o[s>>3]=m)}}function ie(t,e){e|=0;var n,r=0,a=0,s=0,c=0,l=0,h=0,f=0,p=0,d=0,A=0,g=0,m=0,y=0,v=0,_=0,b=0,x=0,w=0,E=0,O=0,S=0;if(y=0|i[(t|=0)>>2]){if(o[(v=e+8|0)>>3]=17976931348623157e292,o[(_=e+24|0)>>3]=17976931348623157e292,o[e>>3]=-17976931348623157e292,o[(b=e+16|0)>>3]=-17976931348623157e292,(0|y)>0){for(s=0|i[t+4>>2],g=17976931348623157e292,m=-17976931348623157e292,a=0,r=-1,f=17976931348623157e292,p=17976931348623157e292,A=-17976931348623157e292,l=-17976931348623157e292,x=0;c=+o[s+(x<<4)>>3],d=+o[s+(x<<4)+8>>3],h=+o[s+(((0|(O=r+2|0))==(0|y)?0:O)<<4)+8>>3],c<f&&(o[v>>3]=c,f=c),d<p&&(o[_>>3]=d,p=d),c>A?o[e>>3]=c:c=A,d>l&&(o[b>>3]=d,l=d),g=d>0&d<g?d:g,m=d<0&d>m?d:m,a|=+u(+(d-h))>3.141592653589793,(0|(r=x+1|0))!=(0|y);)O=x,A=c,x=r,r=O;a&&(o[b>>3]=m,o[_>>3]=g)}}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[(O=t+8|0)>>2]))<=0)){n=t+12|0,E=0;do{if(s=0|i[n>>2],a=E,_=e+((E=E+1|0)<<5)|0,b=0|i[s+(a<<3)>>2]){if(o[(x=e+(E<<5)+8|0)>>3]=17976931348623157e292,o[(t=e+(E<<5)+24|0)>>3]=17976931348623157e292,o[_>>3]=-17976931348623157e292,o[(w=e+(E<<5)+16|0)>>3]=-17976931348623157e292,(0|b)>0){for(y=0|i[s+(a<<3)+4>>2],g=17976931348623157e292,m=-17976931348623157e292,s=0,a=-1,v=0,f=17976931348623157e292,p=17976931348623157e292,d=-17976931348623157e292,l=-17976931348623157e292;c=+o[y+(v<<4)>>3],A=+o[y+(v<<4)+8>>3],h=+o[y+(((0|(a=a+2|0))==(0|b)?0:a)<<4)+8>>3],c<f&&(o[x>>3]=c,f=c),A<p&&(o[t>>3]=A,p=A),c>d?o[_>>3]=c:c=d,A>l&&(o[w>>3]=A,l=A),g=A>0&A<g?A:g,m=A<0&A>m?A:m,s|=+u(+(A-h))>3.141592653589793,(0|(a=v+1|0))!=(0|b);)S=v,v=a,d=c,a=S;s&&(o[w>>3]=m,o[t>>3]=g)}}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[O>>2]}while((0|E)<(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,c,l,h,f,p=0;c=+o[(t|=0)>>3],u=+o[e>>3]-c,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]))-(c-h)*(l=+o[r+8>>3]-f))/(u*l-a*p),o[i>>3]=c+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 ce(t,e,n){t|=0,n|=0;var r=0;(0|(e|=0))>0?(r=0|ve(e,4),i[t>>2]=r,r||E(23230,23253,40,23267)):i[t>>2]=0,i[t+4>>2]=e,i[t+8>>2]=0,i[t+12>>2]=n}function le(t){var e,n,r,a=0,s=0,c=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(c=0|i[t>>2],h=0|i[c+(a<<2)>>2])break;a=a+1|0}a=c+(~~(+u(+ +l(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(c=h+32|0,(0|s)==(0|h))i[a>>2]=i[c>>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[c>>2]}ye(h),i[r>>2]=(0|i[r>>2])-1}}while(0)}ye(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(+ +l(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 ye(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,c=0;(r=0|me(40))||E(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(+ +l(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|Tt(a,e)&&0|Tt(a+16|0,n));)if(s=0|i[a+32>>2],!(0|i[(a=0==(0|s)?a:s)+32>>2])){c=10;break}if(10==(0|c)){i[a+32>>2]=r;break}return ye(r),0|(c=a)}i[s>>2]=r}while(0);return i[(c=t+8|0)>>2]=1+(0|i[c>>2]),0|(c=r)}function de(t,e,n){e|=0,n|=0;var r=0,a=0;if(a=~~(+u(+ +l(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|Tt(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|Tt(t,e)&&0|Tt(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(+ +l(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|Tt(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 ge(t){return 0|~~+function(t){return+ +Me(+(t=+t))}(t=+t)}function me(t){t|=0;var e,n=0,r=0,o=0,a=0,s=0,u=0,c=0,l=0,h=0,f=0,p=0,d=0,A=0,g=0,m=0,y=0,v=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>>>=c=n>>>12&16)>>>5&8)|c|(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[(c=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=c);if(s=0|i[5830]){for(r=(s&0-s)-1|0,r=l=0|i[23620+(((o=(r>>>=a=r>>>12&16)>>>5&8)|a|(u=(r>>>=o)>>>2&4)|(c=(r>>>=u)>>>1&2)|(l=(r>>>=c)>>>1&1))+(r>>>l)<<2)>>2],c=l,l=(-8&i[l+4>>2])-h|0;(t=0|i[r+16>>2])||(t=0|i[r+20>>2]);)r=t,c=(a=(u=(-8&i[t+4>>2])-h|0)>>>0<l>>>0)?t:c,l=a?u:l;if((u=c+h|0)>>>0>c>>>0){a=0|i[c+24>>2],n=0|i[c+12>>2];do{if((0|n)==(0|c)){if(!(n=0|i[(t=c+20|0)>>2])&&!(n=0|i[(t=c+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[c+8>>2],i[r+12>>2]=n,i[n+8>>2]=r,r=n}while(0);do{if(0|a){if(n=0|i[c+28>>2],(0|c)==(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|c)?x:a+20|0)>>2]=r,!r)break;i[r+24>>2]=a,0|(n=0|i[c+16>>2])&&(i[r+16>>2]=n,i[n+24>>2]=r),0|(n=0|i[c+20>>2])&&(i[r+20>>2]=n,i[n+24>>2]=r)}}while(0);return l>>>0<16?(x=l+h|0,i[c+4>>2]=3|x,i[(x=c+x+4|0)>>2]=1|i[x>>2]):(i[c+4>>2]=3|h,i[u+4>>2]=1|l,i[u+l>>2]=l,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]=l,i[5834]=u),M=e,0|(x=c+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,l=(t>>>=8)?h>>>0>16777215?31:h>>>((l=14-((c=((m=t<<(p=(t+1048320|0)>>>16&8))+520192|0)>>>16&4)|p|(l=((m<<=c)+245760|0)>>>16&2))+(m<<l>>>15)|0)+7|0)&1|l<<1:0,r=0|i[23620+(l<<2)>>2];t:do{if(r)for(t=0,c=h<<(31==(0|l)?0:25-(l>>>1)|0),s=0;;){if((u=(-8&i[r+4>>2])-h|0)>>>0<a>>>0){if(!u){t=r,a=0,m=65;break t}t=r,a=u}if(s=0==(0|(m=0|i[r+20>>2]))|(0|m)==(0|(r=0|i[r+16+(c>>>31<<2)>>2]))?s:m,!r){r=s,m=61;break}c<<=1}else r=0,t=0,m=61}while(0);if(61==(0|m)){if(0==(0|r)&0==(0|t)){if(!(t=((t=2<<l)|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|(c=(p>>>=s)>>>2&4)|(l=(p>>>=c)>>>1&2)|(r=(p>>>=l)>>>1&1))+(p>>>r)<<2)>>2]}r?m=65:(c=t,u=a)}if(65==(0|m))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){c=t,u=a;break}s=r}if(0!=(0|c)&&u>>>0<((0|i[5831])-h|0)>>>0&&(f=c+h|0)>>>0>c>>>0){s=0|i[c+24>>2],n=0|i[c+12>>2];do{if((0|n)==(0|c)){if(!(n=0|i[(t=c+20|0)>>2])&&!(n=0|i[(t=c+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[c+8>>2],i[x+12>>2]=n,i[n+8>>2]=x}while(0);do{if(s){if(t=0|i[c+28>>2],(0|c)==(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|c)?x:s+20|0)>>2]=n,!n)break;i[n+24>>2]=s,0|(t=0|i[c+16>>2])&&(i[n+16>>2]=t,i[t+24>>2]=n),(t=0|i[c+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[c+4>>2]=3|x,i[(x=c+x+4|0)>>2]=1|i[x>>2];else{if(i[c+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=c+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),c=p+48|0,(h=(s=t+(l=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,m=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])){m=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,m=145;break t}}else o=t,m=136;else n=0}else m=128}while(0);do{if(128==(0|m))if(-1!=(0|(r=0|Ie(0)))&&(n=r,g=(n=(0==((g=(A=0|i[5948])+-1|0)&n|0)?0:(g+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])&&g>>>0<=A>>>0|g>>>0>d>>>0){n=0;break}if((0|(t=0|Ie(0|n)))==(0|r)){u=n,s=r,m=145;break t}o=t,m=136}else n=0}while(0);do{if(136==(0|m)){if(r=0-n|0,!(c>>>0>n>>>0&n>>>0<2147483647&-1!=(0|o))){if(-1==(0|o)){n=0;break}u=n,s=o,m=145;break t}if((t=l-n+(t=0|i[5949])&0-t)>>>0>=2147483647){u=n,s=o,m=145;break t}if(-1==(0|Ie(0|t))){Ie(0|r),n=0;break}u=t+n|0,s=o,m=145;break t}}while(0);i[5940]=4|i[5940],m=143}}while(0);if(143==(0|m)&&h>>>0<2147483647&&!(-1==(0|(_=0|Ie(0|h)))|1^(v=(y=(g=0|Ie(0))-_|0)>>>0>(p+40|0)>>>0)|_>>>0<g>>>0&-1!=(0|_)&-1!=(0|g)^1)&&(u=v?y:n,s=_,m=145),145==(0|m)){n=(0|i[5937])+u|0,i[5937]=n,n>>>0>(0|i[5938])>>>0&&(i[5938]=n),l=0|i[5835];t:do{if(l){for(n=23764;;){if((0|s)==((t=0|i[n>>2])+(r=0|i[n+4>>2])|0)){m=154;break}if(!(o=0|i[n+8>>2]))break;n=o}if(154==(0|m)&&(b=n+4|0,0==(8&i[n+12>>2]|0))&&s>>>0>l>>>0&t>>>0<=l>>>0){i[b>>2]=r+u,b=l+(_=0==(7&(_=l+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[l+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)){m=162;break}if(!(t=0|i[n+8>>2]))break;n=t}if(162==(0|m)&&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,c=(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|l)==(0|n))x=(0|i[5832])+c|0,i[5832]=x,i[5835]=h,i[h+4>>2]=1|x;else{if((0|i[5834])==(0|n)){x=(0|i[5831])+c|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+c|0}else a=c;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<=l>>>0&&(x=t+(0|i[n+4>>2])|0)>>>0>l>>>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=l+16|0)>>>0?l: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|l)){if(s=t-l|0,i[r>>2]=-2&i[r>>2],i[l+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]=l,i[n+12>>2]=l,i[l+8>>2]=n,i[l+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[l+28>>2]=o,i[l+20>>2]=0,i[a>>2]=0,!((n=0|i[5830])&(t=1<<o))){i[5830]=n|t,i[r>>2]=l,i[l+24>>2]=r,i[l+12>>2]=l,i[l+8>>2]=l;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]=l,i[l+24>>2]=n,i[l+12>>2]=l,i[l+8>>2]=l;break t}}while(0);x=0|i[(b=n+8|0)>>2],i[x+12>>2]=l,i[b>>2]=l,i[l+8>>2]=x,i[l+12>>2]=n,i[l+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 ye(t){var e=0,n=0,r=0,o=0,a=0,s=0,u=0,c=0;if(t|=0){n=t+-8|0,o=0|i[5833],c=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=c+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>=c>>>0)&&1&(r=0|i[(t=c+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|c)){if(c=(0|i[5832])+e|0,i[5832]=c,i[5835]=u,i[u+4>>2]=1|c,(0|u)!=(0|i[5834]))return;return i[5834]=0,void(i[5831]=0)}if((0|i[5834])==(0|c))return c=(0|i[5831])+e|0,i[5831]=c,i[5834]=s,i[u+4>>2]=1|c,void(i[s+c>>2]=c);o=(-8&r)+e|0,n=r>>>3;do{if(r>>>0<256){if(e=0|i[c+8>>2],(0|(t=0|i[c+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[c+24>>2],t=0|i[c+12>>2];do{if((0|t)==(0|c)){if(t=0|i[(n=(e=c+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[c+8>>2],i[n+12>>2]=t,i[t+8>>2]=n,n=t}while(0);if(0|a){if(t=0|i[c+28>>2],(0|i[(e=23620+(t<<2)|0)>>2])==(0|c)){if(i[e>>2]=n,!n){i[5830]=i[5830]&~(1<<t);break}}else if(i[((0|i[(r=a+16|0)>>2])==(0|c)?r:a+20|0)>>2]=n,!n)break;i[n+24>>2]=a,0|(e=0|i[(t=c+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=((c=t<<(s=(t+1048320|0)>>>16&8))+520192|0)>>>16&4)|s|(r=((c<<=a)+245760|0)>>>16&2))+(c<<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);c=0|i[(s=t+8|0)>>2],i[c+12>>2]=u,i[s>>2]=u,i[u+8>>2]=c,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(c=(0|i[5837])-1|0,i[5837]=c,!(0|c)){for(t=23772;t=0|i[t>>2];)t=t+8|0;i[5837]=-1}}}}function ve(t,e){e|=0;var n=0;return(t|=0)?(n=0|v(e,t),(e|t)>>>0>65535&&(n=(0|(n>>>0)/(t>>>0))==(0|e)?n:-1)):n=0,(t=0|me(n))&&3&i[t+-4>>2]?(Pe(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,c=0,l=0,h=0,f=0,p=0,d=0,A=0;if(h=t|=0,s=n|=0,u=p=r|=0,!(l=c=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|l))|0)>>>0<=31){s=f=a+1|0,t=h>>>(f>>>0)&(e=a-31>>31)|l<<(u=31-a|0),e&=l>>>(f>>>0),a=0,u=h<<u;break}return o?(i[o>>2]=0|t,i[o+4>>2]=c|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|l))|0,t=(f=32-u|0)-1>>31&l>>>((d=u-32|0)>>>0)|(l<<f|h>>>(u>>>0))&(e=d>>31),e&=l>>>(u>>>0),a=h<<(A=64-u|0)&(c=f>>31),u=(l<<A|h>>>(d>>>0))&c|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=c|0&e)),A)):(d=l>>>((A=0|be(0|s))>>>0)|0,A=l<<32-A|h>>>(A>>>0)|0,0|(x(0|d),A))}if(a)return 0|o&&(i[o>>2]=(l>>>0)%(s>>>0),i[o+4>>2]=0),A=(l>>>0)/(s>>>0)>>>0,0|(x(0|(d=0)),A);if(!h)return 0|o&&(i[o>>2]=0,i[o+4>>2]=(l>>>0)%(u>>>0)),A=(l>>>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&l|0&e),d=0,A=l>>>((0|be(0|u))>>>0),0|(x(0|d),A);if((a=(0|b(0|u))-(0|b(0|l))|0)>>>0<=30){s=e=a+1|0,t=l<<(u=31-a|0)|h>>>(e>>>0),e=l>>>(e>>>0),a=0,u=h<<u;break}return o?(i[o>>2]=0|t,i[o+4>>2]=c|0&e,A=0,0|(x(0|(d=0)),A)):(A=0,0|(x(0|(d=0)),A))}while(0);if(s){l=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(),c=u,u=0;do{r=c,c=a>>>31|c<<1,a=u|a<<1,_e(0|l,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));l=c,c=0}else l=u,c=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|(l|s)<<1|0&(s<<1|a>>>31)|c)),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 Ee(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 Oe(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 Se(t,e){return e=+e,(t=+t)!=t?+e:e!=e?+t:+_(+t,+e)}function Te(t){return(t=+t)>=0?+s(t+.5):+y(t-.5)}function Ce(t,e,n){t|=0,e|=0;var o,a,s=0;if((0|(n|=0))>=8192)return T(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 Pe(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):+y(t-.5)}function Ie(t){t|=0;var e,n,r;return r=0|S(),(0|t)>0&(0|(e=(n=0|i[a>>2])+t|0))<(0|n)|(0|e)<0?(P(0|e),O(12),-1):(0|e)>(0|r)&&!(0|C(0|e))?(O(12),-1):(i[a>>2]=e,0|n)}return{___uremdi3:we,_bitshift64Lshr:Ee,_bitshift64Shl:Oe,_calloc:ve,_cellAreaKm2:function(t,e){var n,r,o,a=0;if(o=M,M=M+192|0,r=o,Ht(t|=0,e|=0,n=o+168|0),Wt(t,e,r),(0|(e=0|i[r>>2]))>0){if(a=+Pt(r+8|0,r+8+((1!=(0|e)&1)<<4)|0,n)+0,1!=(0|e)){t=1;do{a+=+Pt(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,Ht(t|=0,e|=0,n=o+168|0),Wt(t,e,r),(0|(e=0|i[r>>2]))>0){if(a=+Pt(r+8|0,r+8+((1!=(0|e)&1)<<4)|0,n)+0,1!=(0|e)){t=1;do{a+=+Pt(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,Ht(t|=0,e|=0,n=o+168|0),Wt(t,e,r),(0|(e=0|i[r>>2]))<=0)return M=o,+(a=0);if(a=+Pt(r+8|0,r+8+((1!=(0|e)&1)<<4)|0,n)+0,1==(0|e))return M=o,+a;t=1;do{a+=+Pt(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,c=0,l=0,h=0,f=0,p=0,d=0,A=0,g=0,m=0,y=0,v=0,_=0,b=0,x=0,E=0,O=0,S=0;if(!(n|=0))return 0|(O=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|(O=0);if(i[(O=e)>>2]=o,i[O+4>>2]=a,1==(0|n))return 0|(O=0);o=1;do{E=0|i[(x=t+(o<<3)|0)+4>>2],i[(O=e+(o<<3)|0)>>2]=i[x>>2],i[O+4>>2]=E,o=o+1|0}while((0|o)!=(0|n));return 0|(o=0)}if(!(E=0|me(x=n<<3)))return 0|(O=-3);if(Ce(0|E,0|t,0|x),!(r=0|ve(n,8)))return ye(E),0|(O=-3);o=n;t:for(;;){_=0|Ee(0|(f=0|i[(u=E)>>2]),0|(u=0|i[u+4>>2]),52),w(),b=(_&=15)+-1|0,v=(0|o)>0;e:do{if(v){if(y=((0|o)<0)<<31>>31,g=0|Oe(0|b,0,52),m=0|w(),b>>>0>15)for(a=0,t=f,n=u;;){if(!(0==(0|t)&0==(0|n))){if(s=0|Ee(0|t,0|n,52),w(),c=(0|(s&=15))<(0|b),s=(0|s)==(0|b),n=0|we(0|(h=c?0:s?t:0),0|(t=c?0:s?n:0),0|o,0|y),w(),0==(0|(l=0|i[(c=s=r+(n<<3)|0)>>2]))&0==(0|(c=0|i[c+4>>2])))n=h;else for(g=0,A=n,d=c,n=h;;){if((0|g)>(0|o)){O=41;break t}if((0|l)==(0|n)&(-117440513&d|0)==(0|t)){h=0|Ee(0|l,0|d,56),w(),p=(h&=7)+1|0,m=0|Ee(0|l,0|d,45),w();n:do{if(0|D(127&m)){if(l=0|Ee(0|l,0|d,52),w(),!(l&=15)){c=6;break}for(c=1;;){if(!(0==((m=0|Oe(7,0,3*(15-c|0)|0))&n|0)&0==((0|w())&t|0))){c=7;break n}if(!(c>>>0<l>>>0)){c=6;break}c=c+1|0}}else c=7}while(0);if((h+2|0)>>>0>c>>>0){O=51;break t}m=0|Oe(0|p,0,56),t=0|w()|-117440513&t,i[(c=s)>>2]=0,i[c+4>>2]=0,c=A,n|=m}else c=(A+1|0)%(0|o)|0;if(0==(0|(l=0|i[(d=s=r+(c<<3)|0)>>2]))&0==(0|(d=0|i[d+4>>2])))break;g=g+1|0,A=c}i[(m=s)>>2]=n,i[m+4>>2]=t}if((0|(a=a+1|0))>=(0|o))break e;t=0|i[(n=E+(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(c=0|Ee(0|t,0|n,52),w(),(0|(c&=15))>=(0|b)){if((0|c)!=(0|b)&&(t|=g,n=-15728641&n|m,c>>>0>=_>>>0)){s=b;do{A=0|Oe(7,0,3*(14-s|0)|0),s=s+1|0,t|=A,n=0|w()|n}while(s>>>0<c>>>0)}}else t=0,n=0;if(c=0|we(0|t,0|n,0|o,0|y),w(),!(0==(0|(h=0|i[(l=s=r+(c<<3)|0)>>2]))&0==(0|(l=0|i[l+4>>2]))))for(A=0;;){if((0|A)>(0|o)){O=41;break t}if((0|h)==(0|t)&(-117440513&l|0)==(0|n)){p=0|Ee(0|h,0|l,56),w(),d=(p&=7)+1|0,S=0|Ee(0|h,0|l,45),w();n:do{if(0|D(127&S)){if(h=0|Ee(0|h,0|l,52),w(),!(h&=15)){l=6;break}for(l=1;;){if(!(0==((S=0|Oe(7,0,3*(15-l|0)|0))&t|0)&0==((0|w())&n|0))){l=7;break n}if(!(l>>>0<h>>>0)){l=6;break}l=l+1|0}}else l=7}while(0);if((p+2|0)>>>0>l>>>0){O=51;break t}S=0|Oe(0|d,0,56),n=0|w()|-117440513&n,i[(d=s)>>2]=0,i[d+4>>2]=0,t|=S}else c=(c+1|0)%(0|o)|0;if(0==(0|(h=0|i[(l=s=r+(c<<3)|0)>>2]))&0==(0|(l=0|i[l+4>>2])))break;A=A+1|0}i[(S=s)>>2]=t,i[S+4>>2]=n}if((0|(a=a+1|0))>=(0|o))break e;t=0|i[(n=E+(a<<3)|0)>>2],n=0|i[n+4>>2]}}}while(0);if((o+5|0)>>>0<11){O=99;break}if(!(m=0|ve((0|o)/6|0,8))){O=58;break}e:do{if(v){A=0,d=0;do{if(!(0==(0|(a=0|i[(t=c=r+(A<<3)|0)>>2]))&0==(0|(t=0|i[t+4>>2])))){l=0|Ee(0|a,0|t,56),w(),n=(l&=7)+1|0,h=-117440513&t,S=0|Ee(0|a,0|t,45),w();n:do{if(0|D(127&S)){if(p=0|Ee(0|a,0|t,52),w(),0|(p&=15))for(s=1;;){if(!(0==(a&(S=0|Oe(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|Oe(0|n,0,56),t=0|w()|h,i[(n=c)>>2]=a,i[n+4>>2]=t,n=l+2|0}}while(0);7==(0|n)&&(i[(S=m+(d<<3)|0)>>2]=a,i[S+4>>2]=-117440513&t,d=d+1|0)}A=A+1|0}while((0|A)!=(0|o));if(v){if(g=((0|o)<0)<<31>>31,p=0|Oe(0|b,0,52),A=0|w(),b>>>0>15)for(t=0,a=0;;){do{if(!(0==(0|f)&0==(0|u))){for(l=0|Ee(0|f,0|u,52),w(),s=(0|(l&=15))<(0|b),l=(0|l)==(0|b),s=0|we(0|(c=s?0:l?f:0),0|(l=s?0:l?u:0),0|o,0|g),w(),n=0;;){if((0|n)>(0|o)){O=98;break t}if((-117440513&(h=0|i[(S=r+(s<<3)|0)+4>>2])|0)==(0|l)&&(0|i[S>>2])==(0|c)){O=70;break}if((0|i[(S=r+((s=(s+1|0)%(0|o)|0)<<3)|0)>>2])==(0|c)&&(0|i[S+4>>2])==(0|l))break;n=n+1|0}if(70==(0|O)&&(O=0,!0&100663296==(117440512&h|0)))break;i[(S=e+(a<<3)|0)>>2]=f,i[S+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=E+(t<<3)|0)>>2],u=0|i[u+4>>2]}for(t=0,a=0;;){do{if(!(0==(0|f)&0==(0|u))){if(l=0|Ee(0|f,0|u,52),w(),(0|(l&=15))>=(0|b))if((0|l)!=(0|b))if(n=f|p,s=-15728641&u|A,l>>>0<_>>>0)l=s;else{c=b;do{S=0|Oe(7,0,3*(14-c|0)|0),c=c+1|0,n|=S,s=0|w()|s}while(c>>>0<l>>>0);l=s}else n=f,l=u;else n=0,l=0;for(c=0|we(0|n,0|l,0|o,0|g),w(),s=0;;){if((0|s)>(0|o)){O=98;break t}if((-117440513&(h=0|i[(S=r+(c<<3)|0)+4>>2])|0)==(0|l)&&(0|i[S>>2])==(0|n)){O=93;break}if((0|i[(S=r+((c=(c+1|0)%(0|o)|0)<<3)|0)>>2])==(0|n)&&(0|i[S+4>>2])==(0|l))break;s=s+1|0}if(93==(0|O)&&(O=0,!0&100663296==(117440512&h|0)))break;i[(S=e+(a<<3)|0)>>2]=f,i[S+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=E+(t<<3)|0)>>2],u=0|i[u+4>>2]}}else a=0,o=d}else a=0,o=0}while(0);if(Pe(0|r,0,0|x),Ce(0|E,0|m,o<<3|0),ye(m),!o)break;e=e+(a<<3)|0}return 41==(0|O)?(ye(E),ye(r),0|(S=-1)):51==(0|O)?(ye(E),ye(r),0|(S=-2)):58==(0|O)?(ye(E),ye(r),0|(S=-3)):98==(0|O)?(ye(m),ye(E),ye(r),0|(S=-1)):(99==(0|O)&&Ce(0|e,0|E,o<<3|0),ye(E),ye(r),0|(S=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],ye(o)}while(0!=(0|n));o=e,e=0|i[e+8>>2],ye(o)}while(0!=(0|e));if(e=t,t=0|i[t+8>>2],r||ye(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,l=0,p=0,d=0;if(r=M,M=M+176|0,Jt(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)),l=u,u=+o[n+8+(t<<4)+8>>3],l=d*d+(l=+f(.5*(u-l)))*(+h(+p)*+h(+s)*l),a+=2*+m(+ +c(+l),+ +c(+(1-l)))}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,l=0,p=0,d=0;if(r=M,M=M+176|0,Jt(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)),l=u,u=+o[n+8+(t<<4)+8>>3],l=d*d+(l=+f(.5*(u-l)))*(+h(+p)*+h(+s)*l),a+=2*+m(+ +c(+l),+ +c(+(1-l)))}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,l=0,p=0,d=0;if(r=M,M=M+176|0,Jt(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)),l=u,u=+o[n+8+(t<<4)+8>>3],l=d*d+(l=+f(.5*(u-l)))*(+h(+s)*+h(+p)*l),a+=2*+m(+ +c(+l),+ +c(+(1-l)))}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:ye,_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|Ee(0|t,0|e,56),w(),i[o>>2]=0,o=0|k(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|Ee(0|t,0|e,56),w(),i[r>>2]=0,t=0|k(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,c=0,l=0,h=0;if(a=M,M=M+16|0,o=a,!(0|Xt(t|=0,e|=0,n|=0,r|=0)))return l=0,x(0|(c=0)),M=a,0|l;for(c=-2130706433&e,s=(s=0==(0|kt(t,e)))?1:2;i[o>>2]=0,u=s+1|0,!((0|(h=0|k(t,e,s,o)))==(0|n)&(0|w())==(0|r));){if(!(u>>>0<7)){s=0,t=0,l=6;break}s=u}return 6==(0|l)?(x(0|s),M=a,0|t):(h=0|Oe(0|s,0,56),l=0|c|w()|268435456,h|=t,x(0|l),M=a,0|h)},_getH3UnidirectionalEdgeBoundary:Jt,_getH3UnidirectionalEdgesFromHexagon:function(t,e,n){n|=0;var r,o=0;r=0==(0|kt(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:qt,_getRes0Indexes:function(t){t|=0;var e=0,n=0,r=0;e=0;do{Oe(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,c=0,l=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|Ee(0|(e|=0),0|(n|=0),52),w(),l=15&s,i[f>>2]=l,c=0|Ee(0|e,0|n,45),w(),c&=127;t:do{if(0|D(c)){if(0|l)for(a=1;;){if(!(0==((h=0|Oe(7,0,3*(15-a|0)|0))&e|0)&0==((0|w())&n|0))){s=0;break t}if(!(a>>>0<l>>>0))break;a=a+1|0}if(!(1&s))return h=0|Oe(l+1|0,0,52),p=0|w()|-15728641&n,t((h|e)&~(f=0|Oe(7,0,3*(14-l|0)|0)),p&~(0|w()),r),void(M=o);s=1}else s=0}while(0);Vt(e,n,u),s?(bt(u,f,p),h=5):(Ot(u,f,p),h=6);t:do{if(0|D(c))if(l)for(a=1;;){if(!(0==((c=0|Oe(7,0,3*(15-a|0)|0))&e|0)&0==((0|w())&n|0))){a=8;break t}if(!(a>>>0<l>>>0)){a=20;break}a=a+1|0}else a=20;else a=8}while(0);if(Pe(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|(l=0|i[(c=r+(a<<2)|0)>>2]))|(0|l)==(0|u));)a=a+1|0;i[c>>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|(l=0|i[(c=r+(a<<2)|0)>>2]))|(0|l)==(0|u));)a=a+1|0;i[c>>2]=u,s=s+1|0}while((0|s)!=(0|h))}M=o},_h3GetResolution:function(t,e){return e=0|Ee(0|(t|=0),0|(e|=0),52),w(),15&e|0},_h3IndexesAreNeighbors:Xt,_h3IsPentagon:kt,_h3IsResClassIII:function(t,e){return e=0|Ee(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,c=0,l=0,h=0,f=0,p=0,d=0,A=0,g=0,m=0,y=0,v=0,_=0,b=0,x=0,w=0,E=0;if(a=M,M=M+48|0,c=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,c))){if((0|(x=0|ft(s,c)))<0)return M=a,0|(w=x);for(i[s>>2]=0,i[s+4>>2]=0,i[s+8>>2]=0,i[c>>2]=0,i[c+4>>2]=0,i[c+8>>2]=0,$t(t,e,t,e,s),$t(t,e,n,r,c),At(s),At(c),x?(g=+(0|x),b=s,n=p=0|i[s>>2],r=d=0|i[(v=s+4|0)>>2],s=A=0|i[(_=s+8|0)>>2],m=+((0|i[c>>2])-p|0)/g,y=+((0|i[c+4>>2])-d|0)/g,g=+((0|i[c+8>>2])-A|0)/g):(v=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],m=0,y=0,g=0),i[w>>2]=n,i[(A=w+4|0)>>2]=r,i[(d=w+8|0)>>2]=s,p=0;;){E=m*(h=+(0|p))+ +(0|n),l=y*h+ +(0|i[v>>2]),h=g*h+ +(0|i[_>>2]),r=~~+Te(+E),c=~~+Te(+l),n=~~+Te(+h),E=+u(+(+(0|r)-E)),l=+u(+(+(0|c)-l)),h=+u(+(+(0|n)-h));do{if(!(E>l&E>h)){if(f=0-r|0,l>h){s=f-n|0;break}s=c,n=f-c|0;break}r=0-(c+n)|0,s=c}while(0);if(i[w>>2]=r,i[A>>2]=s,i[d>>2]=n,gt(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,c=0,l=0;if(o=M,M=M+176|0,r=o,(0|(e|=0))<1)return ce(n,0,0),void(M=o);c=0|Ee(0|i[(c=t)>>2],0|i[c+4>>2],52),w(),ce(n,(0|e)>6?e:6,15&c),c=0;do{if(Wt(0|i[(a=t+(c<<3)|0)>>2],0|i[a+4>>2],r),(0|(a=0|i[r>>2]))>0){l=0;do{u=r+8+(l<<4)|0,(s=0|de(n,a=r+8+(((0|(l=l+1|0))%(0|a)|0)<<4)|0,u))?fe(n,s):pe(n,u,a),a=0|i[r>>2]}while((0|l)<(0|a))}c=c+1|0}while((0|c)!=(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 Kt(n),le(o),void(M=a);do{e=0|Zt(n);do{Qt(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));Kt(n),le(o),M=a},_h3ToCenterChild:function(t,e,n){n|=0;var r=0,i=0;if(r=0|Ee(0|(t|=0),0|(e|=0),52),w(),(0|n)<16&(0|(r&=15))<=(0|n)){if((0|r)!=(0|n)&&(t|=i=0|Oe(0|n,0,52),e=0|w()|-15728641&e,(0|r)<(0|n)))do{i=0|Oe(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:Rt,_h3ToGeo:Ht,_h3ToGeoBoundary:Wt,_h3ToParent:Bt,_h3UnidirectionalEdgeIsValid:function(t,e){var n=0;if(!(!0&268435456==(2013265920&(e|=0)|0)))return 0|(n=0);switch(n=0|Ee(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|kt(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,c=0,l=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|kt(t,e))t=1;else{if(s=(0|n)>0){a=0,h=t;do{if(0==(0|(h=0|k(h,e,4,f)))&0==(0|(e=0|w()))){t=2;break t}if(a=a+1|0,0|kt(h,e)){t=1;break t}}while((0|a)<(0|n));if(i[(l=r)>>2]=h,i[l+4>>2]=e,l=n+-1|0,s){s=0,u=1,a=h,t=e;do{if(0==(0|(a=0|k(a,t,2,f)))&0==(0|(t=0|w()))){t=2;break t}if(i[(c=r+(u<<3)|0)>>2]=a,i[c+4>>2]=t,u=u+1|0,0|kt(a,t)){t=1;break t}s=s+1|0}while((0|s)<(0|n));c=0,s=u;do{if(0==(0|(a=0|k(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|kt(a,t)){t=1;break t}c=c+1|0}while((0|c)<(0|n));u=0;do{if(0==(0|(a=0|k(a,t,1,f)))&0==(0|(t=0|w()))){t=2;break t}if(i[(c=r+(s<<3)|0)>>2]=a,i[c+4>>2]=t,s=s+1|0,0|kt(a,t)){t=1;break t}u=u+1|0}while((0|u)<(0|n));u=0;do{if(0==(0|(a=0|k(a,t,5,f)))&0==(0|(t=0|w()))){t=2;break t}if(i[(c=r+(s<<3)|0)>>2]=a,i[c+4>>2]=t,s=s+1|0,0|kt(a,t)){t=1;break t}u=u+1|0}while((0|u)<(0|n));u=0;do{if(0==(0|(a=0|k(a,t,4,f)))&0==(0|(t=0|w()))){t=2;break t}if(i[(c=r+(s<<3)|0)>>2]=a,i[c+4>>2]=t,s=s+1|0,0|kt(a,t)){t=1;break t}u=u+1|0}while((0|u)<(0|n));for(u=0;;){if(0==(0|(a=0|k(a,t,6,f)))&0==(0|(t=0|w()))){t=2;break t}if((0|u)!=(0|l)){if(i[(c=r+(s<<3)|0)>>2]=a,i[c+4>>2]=t,0|kt(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)>>2]=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|B(t|=0,e|=0,n|=0,r|=0,i|=0)){if(Pe(0|r,0,(o=1+(0|v(3*n|0,n+1|0))|0)<<3|0),0|i)return Pe(0|i,0,o<<2|0),void R(t,e,n,r,i,o,0);(i=0|ve(o,4))&&(R(t,e,n,r,i,o,0),ye(i))}},_llvm_minnum_f64:Se,_llvm_round_f64:Te,_malloc:me,_maxFaceCount:function(t,e){var n=0,r=0;if(r=0|Ee(0|(t|=0),0|(e|=0),45),w(),!(0|D(127&r)))return 0|(r=2);if(r=0|Ee(0|t,0|e,52),w(),!(r&=15))return 0|(r=5);for(n=1;;){if(!(0==((0|Oe(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|Ee(0|(t|=0),0|(e|=0),52),w(),(0|n)<16&(0|(t&=15))<=(0|n)?0|(n=0|ee(7,n-t|0)):0|(n=0)},_maxKringSize:function(t){return 1+(0|v(3*(t|=0)|0,t+1|0))|0},_maxPolyfillSize:function(t,e){e|=0;var n,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|W(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|Ee(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:Ce,_memset:Pe,_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:Ct,_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*+m(+ +c(+a),+ +c(+(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*+m(+ +c(+a),+ +c(+(1-a)))},_polyfill:function(t,e,n){var r,o=0,a=0,s=0,u=0,c=0;if(r=M,M=M+48|0,o=r+8|0,a=r,0|function(t,e,n){e|=0,n|=0;var r,o,a,s,u,c=0,l=0,h=0,f=0,p=0,d=0,A=0,g=0,m=0,y=0,v=0,_=0,b=0,x=0,O=0,S=0,T=0,C=0,P=0,I=0,k=0,D=0,j=0,F=0,z=0;u=M,M=M+112|0,o=u+80|0,d=u+72|0,a=u,s=u+56|0,(z=0|me(32+(i[(A=(t=t|0)+8|0)>>2]<<5)|0))||E(22848,22448,800,22456);if(ie(t,z),c=0|i[(h=t)+4>>2],i[(p=d)>>2]=i[h>>2],i[p+4>>2]=c,re(d,o),p=0|W(o,e),c=0|i[d>>2],(0|(h=0|i[A>>2]))>0){f=0|i[t+12>>2],l=0;do{c=(0|i[f+(l<<3)>>2])+c|0,l=l+1|0}while((0|l)!=(0|h))}if(l=0|ve(r=(p=(0|p)<(0|c)?c:p)+12|0,8),g=0|ve(r,8),i[o>>2]=0,F=0|i[(j=t)+4>>2],i[(c=d)>>2]=i[j>>2],i[c+4>>2]=F,0|(c=0|L(d,r,e,o,l,g)))return ye(l),ye(g),ye(z),M=u,0|(z=c);t:do{if((0|i[A>>2])>0){for(h=t+12|0,c=0;f=0|L((0|i[h>>2])+(c<<3)|0,r,e,o,l,g),c=c+1|0,!(0|f);)if((0|c)>=(0|i[A>>2]))break t;return ye(l),ye(g),ye(z),M=u,0|(z=f)}}while(0);(0|p)>-12&&Pe(0|g,0,((0|r)>1?r:1)<<3|0);t:do{if((0|i[o>>2])>0){F=((0|r)<0)<<31>>31,C=l,P=g,I=l,k=l,D=g,j=l,c=l,x=l,O=g,S=g,T=g,l=g;e:for(;;){for(b=0|i[o>>2],v=0,_=0,h=0;;){p=(f=a)+56|0;do{i[f>>2]=0,f=f+4|0}while((0|f)<(0|p));if(d=0|i[(e=C+(v<<3)|0)>>2],e=0|i[e+4>>2],0|B(d,e,1,a,0)){p=(f=a)+56|0;do{i[f>>2]=0,f=f+4|0}while((0|f)<(0|p));0|(f=0|ve(7,4))&&(R(d,e,1,a,f,7,0),ye(f))}y=0;do{g=0|i[(m=a+(y<<3)|0)>>2],m=0|i[m+4>>2];n:do{if(!(0==(0|g)&0==(0|m))){if(d=0|we(0|g,0|m,0|r,0|F),w(),e=0|i[(p=f=n+(d<<3)|0)>>2],p=0|i[p+4>>2],!(0==(0|e)&0==(0|p)))for(A=0;;){if((0|A)>(0|r))break e;if((0|e)==(0|g)&(0|p)==(0|m))break n;if(e=0|i[(p=f=n+((d=(d+1|0)%(0|r)|0)<<3)|0)>>2],p=0|i[p+4>>2],0==(0|e)&0==(0|p))break;A=A+1|0}0==(0|g)&0==(0|m)||(Ht(g,m,s),0|oe(t,z,s)&&(i[(A=f)>>2]=g,i[A+4>>2]=m,i[(A=P+(h<<3)|0)>>2]=g,i[A+4>>2]=m,h=h+1|0))}}while(0);y=y+1|0}while(y>>>0<7);if((0|(_=_+1|0))>=(0|b))break;v=v+1|0}if((0|b)>0&&Pe(0|I,0,b<<3|0),i[o>>2]=h,!((0|h)>0))break t;g=l,m=T,y=j,v=S,_=O,b=P,l=x,T=c,S=k,O=I,x=g,c=m,j=D,D=y,k=v,I=_,P=C,C=b}return ye(k),ye(D),ye(z),M=u,0|(z=-1)}c=g}while(0);return ye(z),ye(l),ye(c),M=u,0|(z=0)}(t|=0,e|=0,n|=0)){if(s=0|i[(c=t)+4>>2],i[(u=a)>>2]=i[c>>2],i[u+4>>2]=s,re(a,o),u=0|W(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||Pe(0|n,0,8+(((0|(c=e+11|0))>0?c: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,c=0,l=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=l=t+(h<<3)|0)>>2],u=0|i[u+4>>2];do{if(!(0==(0|s)&0==(0|u))){if((0|a)>=(0|r)){s=-1,a=16;break t}if(c=0|Ee(0|s,0|u,52),w(),(0|(c&=15))>(0|o)){s=-2,a=16;break t}if((0|c)==(0|o)){i[(l=n+(a<<3)|0)>>2]=s,i[l+4>>2]=u,a=a+1|0;break}if((0|(s=(0|ee(7,o-c|0))+a|0))>(0|r)){s=-1,a=16;break t}Rt(0|i[l>>2],0|i[l+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},{a:ut,b:function(t){c=t},c:l,d:function(t,e,n,r){ut("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:q,g:function(t,e,n){y.set(y.subarray(e,e+n),t)},h:function(t){var e=q();if(t>2130706432)return!1;for(var n=Math.max(e,16777216);n<t;)n=n<=536870912?w(2*n,16777216):Math.min(w((3*n+2147483648)/4,16777216),2130706432);return!!X(n)},i:function(t){ut("OOM")},j:V,k:H,l:X,m:W,n:function(){var t=W();return n.extraStackTrace&&(t+="\n"+n.extraStackTrace()),H(t)},o:24032,p:24016},g),$=(n.___uremdi3=Y.___uremdi3,n._bitshift64Lshr=Y._bitshift64Lshr,n._bitshift64Shl=Y._bitshift64Shl,n._calloc=Y._calloc,n._cellAreaKm2=Y._cellAreaKm2,n._cellAreaM2=Y._cellAreaM2,n._cellAreaRads2=Y._cellAreaRads2,n._compact=Y._compact,n._destroyLinkedPolygon=Y._destroyLinkedPolygon,n._edgeLengthKm=Y._edgeLengthKm,n._edgeLengthM=Y._edgeLengthM,n._emscripten_replace_memory=Y._emscripten_replace_memory),tt=(n._exactEdgeLengthKm=Y._exactEdgeLengthKm,n._exactEdgeLengthM=Y._exactEdgeLengthM,n._exactEdgeLengthRads=Y._exactEdgeLengthRads,n._experimentalH3ToLocalIj=Y._experimentalH3ToLocalIj,n._experimentalLocalIjToH3=Y._experimentalLocalIjToH3,n._free=Y._free,n._geoToH3=Y._geoToH3,n._getDestinationH3IndexFromUnidirectionalEdge=Y._getDestinationH3IndexFromUnidirectionalEdge,n._getH3IndexesFromUnidirectionalEdge=Y._getH3IndexesFromUnidirectionalEdge,n._getH3UnidirectionalEdge=Y._getH3UnidirectionalEdge,n._getH3UnidirectionalEdgeBoundary=Y._getH3UnidirectionalEdgeBoundary,n._getH3UnidirectionalEdgesFromHexagon=Y._getH3UnidirectionalEdgesFromHexagon,n._getOriginH3IndexFromUnidirectionalEdge=Y._getOriginH3IndexFromUnidirectionalEdge,n._getPentagonIndexes=Y._getPentagonIndexes,n._getRes0Indexes=Y._getRes0Indexes,n._h3Distance=Y._h3Distance,n._h3GetBaseCell=Y._h3GetBaseCell,n._h3GetFaces=Y._h3GetFaces,n._h3GetResolution=Y._h3GetResolution,n._h3IndexesAreNeighbors=Y._h3IndexesAreNeighbors,n._h3IsPentagon=Y._h3IsPentagon,n._h3IsResClassIII=Y._h3IsResClassIII,n._h3IsValid=Y._h3IsValid,n._h3Line=Y._h3Line,n._h3LineSize=Y._h3LineSize,n._h3SetToLinkedGeo=Y._h3SetToLinkedGeo,n._h3ToCenterChild=Y._h3ToCenterChild,n._h3ToChildren=Y._h3ToChildren,n._h3ToGeo=Y._h3ToGeo,n._h3ToGeoBoundary=Y._h3ToGeoBoundary,n._h3ToParent=Y._h3ToParent,n._h3UnidirectionalEdgeIsValid=Y._h3UnidirectionalEdgeIsValid,n._hexAreaKm2=Y._hexAreaKm2,n._hexAreaM2=Y._hexAreaM2,n._hexRing=Y._hexRing,n._i64Subtract=Y._i64Subtract,n._kRing=Y._kRing,n._kRingDistances=Y._kRingDistances,n._llvm_minnum_f64=Y._llvm_minnum_f64,n._llvm_round_f64=Y._llvm_round_f64,n._malloc=Y._malloc,n._maxFaceCount=Y._maxFaceCount,n._maxH3ToChildrenSize=Y._maxH3ToChildrenSize,n._maxKringSize=Y._maxKringSize,n._maxPolyfillSize=Y._maxPolyfillSize,n._maxUncompactSize=Y._maxUncompactSize,n._memcpy=Y._memcpy,n._memset=Y._memset,n._numHexagons=Y._numHexagons,n._pentagonIndexCount=Y._pentagonIndexCount,n._pointDistKm=Y._pointDistKm,n._pointDistM=Y._pointDistM,n._pointDistRads=Y._pointDistRads,n._polyfill=Y._polyfill,n._res0IndexCount=Y._res0IndexCount,n._round=Y._round,n._sbrk=Y._sbrk,n._sizeOfCoordIJ=Y._sizeOfCoordIJ,n._sizeOfGeoBoundary=Y._sizeOfGeoBoundary,n._sizeOfGeoCoord=Y._sizeOfGeoCoord,n._sizeOfGeoPolygon=Y._sizeOfGeoPolygon,n._sizeOfGeofence=Y._sizeOfGeofence,n._sizeOfH3Index=Y._sizeOfH3Index,n._sizeOfLinkedGeoPolygon=Y._sizeOfLinkedGeoPolygon,n._uncompact=Y._uncompact,n.establishStackSpace=Y.establishStackSpace,n.stackAlloc=Y.stackAlloc),et=n.stackRestore=Y.stackRestore,nt=n.stackSave=Y.stackSave;if(n.asm=Y,n.cwrap=function(t,e,n,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":m[t>>0]=e;break;case"i16":v[t>>1]=e;break;case"i32":_[t>>2]=e;break;case"i64":z=[e>>>0,(F=e,+I(F)>=1?F>0?(0|k(+R(F/4294967296),4294967295))>>>0:~~+B((F-+(~~F>>>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:ut("invalid type for setValue: "+n)}},n.getValue=function(t,e,n){switch("*"===(e=e||"i8").charAt(e.length-1)&&(e="i32"),e){case"i1":case"i8":return m[t>>0];case"i16":return v[t>>1];case"i32":case"i64":return _[t>>2];case"float":return b[t>>2];case"double":return x[t>>3];default:ut("invalid type for getValue: "+e)}return null},n.getTempRet0=l,U){G(U)||(Q=U,U=n.locateFile?n.locateFile(Q,a):a+Q),L++,n.monitorRunDependencies&&n.monitorRunDependencies(L);var rt=function(t){t.byteLength&&(t=new Uint8Array(t)),y.set(t,8),n.memoryInitializerRequest&&delete n.memoryInitializerRequest.response,function(t){if(L--,n.monitorRunDependencies&&n.monitorRunDependencies(L),0==L&&(null!==D&&(clearInterval(D),D=null),j)){var e=j;j=null,e()}}()},it=function(){i(U,rt,(function(){throw"could not load memory initializer "+U}))},ot=Z(U);if(ot)rt(ot.buffer);else if(n.memoryInitializerRequest){var at=function(){var t=n.memoryInitializerRequest,e=t.response;if(200!==t.status&&0!==t.status){var r=Z(n.memoryInitializerRequestURL);if(!r)return console.warn("a problem seems to have happened with Module.memoryInitializerRequest, status: "+t.status+", retrying "+U),void it();e=r.buffer}rt(e)};n.memoryInitializerRequest.response?setTimeout(at,0):n.memoryInitializerRequest.addEventListener("load",at)}else it()}function st(t){function e(){K||(K=!0,h||(S(C),S(P),n.onRuntimeInitialized&&n.onRuntimeInitialized(),function(){if(n.postRun)for("function"==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;)t=n.postRun.shift(),M.unshift(t);var t;S(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(),T.unshift(t);var t;S(T)}(),L>0||(n.setStatus?(n.setStatus("Running..."),setTimeout((function(){setTimeout((function(){n.setStatus("")}),1),e()}),1)):e()))}function ut(t){throw n.onAbort&&n.onAbort(t),s(t+=""),u(t),h=!0,"abort("+t+"). Build with -s ASSERTIONS=1 for more info."}if(j=function t(){K||st(),K||(j=t)},n.run=st,n.abort=ut,n.preInit)for("function"==typeof n.preInit&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.pop()();return st(),t}("object"==typeof en?en:{}),nn="number",rn={};[["sizeOfH3Index",nn],["sizeOfGeoCoord",nn],["sizeOfGeoBoundary",nn],["sizeOfGeoPolygon",nn],["sizeOfGeofence",nn],["sizeOfLinkedGeoPolygon",nn],["sizeOfCoordIJ",nn],["h3IsValid","number",["number","number"]],["geoToH3","number",[nn,nn,"number"]],["h3ToGeo",null,["number","number",nn]],["h3ToGeoBoundary",null,["number","number",nn]],["maxKringSize",nn,[nn]],["kRing",null,["number","number",nn,nn]],["kRingDistances",null,["number","number",nn,nn,nn]],["hexRing",null,["number","number",nn,nn]],["maxPolyfillSize",nn,[nn,"number"]],["polyfill",null,[nn,"number",nn]],["h3SetToLinkedGeo",null,[nn,nn,nn]],["destroyLinkedPolygon",null,[nn]],["compact",nn,[nn,nn,nn]],["uncompact",nn,[nn,nn,nn,nn,"number"]],["maxUncompactSize",nn,[nn,nn,"number"]],["h3IsPentagon","number",["number","number"]],["h3IsResClassIII","number",["number","number"]],["h3GetBaseCell",nn,["number","number"]],["h3GetResolution",nn,["number","number"]],["maxFaceCount",nn,["number","number"]],["h3GetFaces",null,["number","number",nn]],["h3ToParent","number",["number","number","number"]],["h3ToChildren",null,["number","number","number",nn]],["h3ToCenterChild","number",["number","number","number"]],["maxH3ToChildrenSize",nn,["number","number","number"]],["h3IndexesAreNeighbors","number",["number","number","number","number"]],["getH3UnidirectionalEdge","number",["number","number","number","number"]],["getOriginH3IndexFromUnidirectionalEdge","number",["number","number"]],["getDestinationH3IndexFromUnidirectionalEdge","number",["number","number"]],["h3UnidirectionalEdgeIsValid","number",["number","number"]],["getH3IndexesFromUnidirectionalEdge",null,["number","number",nn]],["getH3UnidirectionalEdgesFromHexagon",null,["number","number",nn]],["getH3UnidirectionalEdgeBoundary",null,["number","number",nn]],["h3Distance",nn,["number","number","number","number"]],["h3Line",nn,["number","number","number","number",nn]],["h3LineSize",nn,["number","number","number","number"]],["experimentalH3ToLocalIj",nn,["number","number","number","number",nn]],["experimentalLocalIjToH3",nn,["number","number",nn,nn]],["hexAreaM2",nn,["number"]],["hexAreaKm2",nn,["number"]],["edgeLengthM",nn,["number"]],["edgeLengthKm",nn,["number"]],["pointDistM",nn,[nn,nn]],["pointDistKm",nn,[nn,nn]],["pointDistRads",nn,[nn,nn]],["cellAreaM2",nn,["number","number"]],["cellAreaKm2",nn,["number","number"]],["cellAreaRads2",nn,["number","number"]],["exactEdgeLengthM",nn,["number","number"]],["exactEdgeLengthKm",nn,["number","number"]],["exactEdgeLengthRads",nn,["number","number"]],["numHexagons",nn,["number"]],["getRes0Indexes",null,[nn]],["res0IndexCount",nn],["getPentagonIndexes",null,[nn,nn]],["pentagonIndexCount",nn]].forEach((function(t){rn[t[0]]=en.cwrap.apply(en,t)}));var on=rn.sizeOfH3Index(),an=rn.sizeOfGeoCoord(),sn=rn.sizeOfGeoBoundary(),un=(rn.sizeOfGeoPolygon(),rn.sizeOfGeofence(),rn.sizeOfLinkedGeoPolygon()),cn=(rn.sizeOfCoordIJ(),"m"),ln="km";function hn(t){if("number"!=typeof t||t<0||t>15||Math.floor(t)!==t)throw new Error("Invalid resolution: "+t)}var fn=/[^0-9a-fA-F]/;function pn(t){if(Array.isArray(t)&&2===t.length&&Number.isInteger(t[0])&&Number.isInteger(t[1]))return t;if("string"!=typeof t||fn.test(t))return[0,0];var e=parseInt(t.substring(0,t.length-8),16);return[parseInt(t.substring(t.length-8),16),e]}function dn(t){if(t>=0)return t.toString(16);var e=gn(8,(t&=2147483647).toString(16));return e=(parseInt(e[0],16)+8).toString(16)+e.substring(1)}function An(t,e){return dn(e)+gn(8,dn(t))}function gn(t,e){for(var n=t-e.length,r="",i=0;i<n;i++)r+="0";return r+=e}function mn(t){return[t,en.getTempRet0()]}function yn(t){var e=mn(t),n=e[0],r=e[1];return r?An(n,r):null}function vn(t,e,n){en.HEAPU32.set(pn(t),e/4+2*n)}function _n(t,e){for(var n=e.length,r=0;r<n;r++)vn(e[r],t,r)}function bn(t){return 180*en.getValue(t,"double")/Math.PI}function xn(t){return[bn(t),bn(t+8)]}function wn(t){return[bn(t+8),bn(t)]}function En(t,e,n){for(var r=en.getValue(t,"i32"),i=t+8,o=[],a=e?wn:xn,s=0;s<2*r;s+=2)o.push(a(i+8*s));return n&&o.push(o[0]),o}function On(t){var e=pn(t),n=e[0],r=e[1];return Boolean(rn.h3IsPentagon(n,r))}function Sn(t){var e=en._malloc(an),n=pn(t),r=n[0],i=n[1];rn.h3ToGeo(r,i,e);var o=xn(e);return en._free(e),o}function Tn(t,e){var n=en._malloc(sn),r=pn(t),i=r[0],o=r[1];rn.h3ToGeoBoundary(i,o,n);var a=En(n,e,e);return en._free(n),a}function Cn(t,e){if(!t||!t.length)return[];var n=t.length,r=en._calloc(n,on);_n(r,t);var i=en._calloc(un),o=i;rn.h3SetToLinkedGeo(r,n,i);var a=function(t,e){for(var n,r,i,o,a=[],s=e?wn:xn;t;){for(a.push(n=[]),r=en.getValue(t,"i8*");r;){for(n.push(i=[]),o=en.getValue(r,"i8*");o;)i.push(s(o)),o=en.getValue(o+16,"i8*");e&&i.push(i[0]),r=en.getValue(r+8,"i8*")}t=en.getValue(t+8,"i8*")}return a}(i,e);return rn.destroyLinkedPolygon(o),en._free(o),en._free(r),a}function Pn(t,e){switch(hn(t),e){case cn:return rn.edgeLengthM(t);case ln:return rn.edgeLengthKm(t);default:throw new Error("Unknown unit: "+e)}}function Mn(t){return t*Math.PI/180}var In=n(50),Bn=n(27),Rn=n.n(Bn),kn=n(160);function Ln(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=l()(t);if(e){var i=l()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return u()(this,n)}}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}function jn(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){f()(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}function Fn(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return zn(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 zn(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=n.call(t)},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 zn(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 Un(t,e){e=void 0===e?t[0][0]:e;var n,r=Fn(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(t){r.e(t)}finally{r.f()}}function Nn(t,e,n){var r=Sn(t),i=E()(r,2),o=i[0],a=i[1],s=e.length;Un(e,a);for(var u=e[0]===e[s-1]?s-1:s,c=0;c<u;c++)e[c][0]=Object(Nt.g)(a,e[c][0],n),e[c][1]=Object(Nt.g)(o,e[c][1],n)}function Gn(t,e,n){var r=Sn(t(e,n)),i=E()(r,2),o=i[0];return[i[1],o]}function Vn(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=Tn(t,!0);return 1!==e?Nn(t,n,e):Un(n),n}var Hn=jn(jn({},y.a.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}),Wn=function(t){a()(n,t);var e=Ln(n);function n(){return i()(this,n),e.apply(this,arguments)}return g()(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,n,r,i=-1,o=!1,a=!1,s=Object(In.a)(this.props.data),u=s.iterable,c=s.objectInfo,l=Fn(u);try{for(l.s();!(t=l.n()).done;){var h=t.value;c.index++;var f=this.props.getHexagon(h,c),p=(e=void 0,n=void 0,r=void 0,e=pn(f),n=e[0],r=e[1],rn.h3IsValid(n,r)?rn.h3GetResolution(n,r):-1);if(i<0){if(i=p,!this.props.highPrecision)break}else if(i!==p){a=!0;break}if(On(f)){o=!0;break}}}catch(t){l.e(t)}finally{l.f()}return{resolution:i,edgeLengthKM:i>=0?Pn(i,"km"):0,hasMultipleRes:a,hasPentagon:o}}},{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.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=en._malloc(an);en.HEAPF64.set([t,e].map(Mn),r/8);var i=yn(rn.geoToH3(r,n));return en._free(r),i}(t.latitude,t.longitude,n);if(i!==o){if(i){var a=(s=o,u=pn(i),c=u[0],l=u[1],h=pn(s),f=h[0],p=h[1],rn.h3Distance(c,l,f,p));if(a>=0&&a*r<10)return}var s,u,c,l,h,f,p,d=t.distanceScales.unitsPerMeter,A=Vn(o),g=Sn(o),m=E()(g,2),y=m[0],v=m[1],_=t.projectFlat([v,y]),b=E()(_,2),x=b[0],w=b[1];A=A.map((function(e){var n=t.projectFlat(e);return[(n[0]-x)/d[0],(n[1]-w)/d[1]]})),this.setState({centerHex:o,vertices:A})}}}}},{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,c=t.lineWidthScale,l=t.lineWidthMinPixels,h=t.lineWidthMaxPixels,f=t.getFillColor,p=t.getElevation,d=t.getLineColor,A=t.getLineWidth,g=t.transitions,m=t.updateTriggers;return{elevationScale:e,extruded:i,coverage:r,wireframe:o,stroked:a,filled:s,lineWidthUnits:u,lineWidthScale:c,lineWidthMinPixels:l,lineWidthMaxPixels:h,material:n,getElevation:p,getFillColor:f,getLineColor:d,getLineWidth:A,transitions:g,updateTriggers:{getFillColor:m.getFillColor,getElevation:m.getElevation,getLineColor:m.getLineColor,getLineWidth:m.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",y.a),a=this._getForwardProps();return a.updateTriggers.getPolygon=function(t,e){return null==t?e:"object"===Rn()(t)?jn(jn({},t),{},{coverage:e}):{getHexagon:t,coverage:e}}(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=Fn(t);try{for(i.s();!(e=i.n()).done;){var o=e.value;n[r++]=o[0],n[r++]=o[1]}}catch(t){i.e(t)}finally{i.f()}return n}(Vn(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",kn.a),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:Gn.bind(null,n)})}}]),n}(m.a);function qn(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Xn(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 Xn(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=n.call(t)},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 Xn(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 Jn(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=l()(t);if(e){var i=l()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return u()(this,n)}}f()(Wn,"defaultProps",Hn),f()(Wn,"layerName","H3HexagonLayer"),f()(Wn,"_checkH3Lib",(function(){}));var Zn=function(t){a()(n,t);var e=Jn(n);function n(){return i()(this,n),e.apply(this,arguments)}return g()(n,[{key:"initializeState",value:function(){Wn._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=Object(In.a)(i),u=s.iterable,c=s.objectInfo,l=qn(u);try{for(l.s();!(r=l.n()).done;){var h=r.value;c.index++;var f,p=qn(Cn(o(h,c),!0));try{for(p.s();!(f=p.n()).done;){var d=f.value;a.push(this.getSubLayerRow({polygon:d},h,c.index))}}catch(t){p.e(t)}finally{p.f()}}}catch(t){l.e(t)}finally{l.f()}this.setState({polygons:a})}}},{key:"indexToBounds",value:function(){return{data:this.state.polygons,getPolygon:function(t){return t.polygon}}}}]),n}(x);f()(Zn,"layerName","H3ClusterLayer"),f()(Zn,"defaultProps",{getHexagons:{type:"accessor",value:function(t){return t.hexagons}}});var Qn=n(58),Kn=n(12),Yn=n(218),$n=n(214),tr=n(233),er=n(295),nr=n(178),rr=n(219);function ir(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 or(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ir(Object(n),!0).forEach((function(e){f()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ir(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function ar(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=l()(t);if(e){var i=l()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return u()(this,n)}}var sr=function(t){a()(n,t);var e=ar(n);function n(){return i()(this,n),e.apply(this,arguments)}return g()(n,[{key:"getShaders",value:function(){var t=Qe()(l()(n.prototype),"getShaders",this).call(this);return t.modules.push(er.a),or(or({},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);\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;Qe()(l()(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){Qe()(l()(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)}),Qe()(l()(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 nr.a(this.context.gl,or(or({},this.getShaders()),{},{id:n,geometry:t,defines:or(or(or({},a.defines),null==i?void 0:i.defines),{},{HAS_UV_REGIONS:t.attributes.uvRegions}),parameters:null==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 tr.a(this.context.gl,{attributes:{NORMAL:e.attributes.normals,TEXCOORD_0:e.attributes.texCoords},material:or({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;Qe()(l()(n.prototype),"finalizeState",this).call(this,t),null===(e=this.state.materialParser)||void 0===e||e.delete(),this.setState({materialParser:null})}}]),n}(rr.a);f()(sr,"layerName","MeshLayer"),f()(sr,"defaultProps",{pbrMaterial:{type:"object",value:null},featureIds:{type:"array",value:null,optional:!0}});var ur=n(202),cr=n(1);function lr(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}Math.max(6378137,6378137,6356752.314245179);function hr(t){return t}new rt.a;function fr(t,e=[],n=hr){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 pr(t,e,n=hr){return"longitude"in e?(e.longitude=n(t[0]),e.latitude=n(t[1]),e.height=t[2]):"x"in e?(e.x=n(t[0]),e.y=n(t[1]),e.z=t[2]):(e[0]=n(t[0]),e[1]=n(t[1]),e[2]=t[2]),e}const dr=new rt.a,Ar=new rt.a,gr=new rt.a;const mr=new rt.a,yr={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"}},vr={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},_r={east:new rt.a,north:new rt.a,up:new rt.a,west:new rt.a,south:new rt.a,down:new rt.a},br=new rt.a,xr=new rt.a,wr=new rt.a;function Er(t,e,n,r,i,o){const a=yr[e]&&yr[e][n];let s,u,c;Object(Ut.a)(a&&(!r||r===a));const l=mr.copy(i);if(Object(Nt.d)(l.x,0,1e-14)&&Object(Nt.d)(l.y,0,1e-14)){const t=Math.sign(l.z);s=br.fromArray(vr[e]),"east"!==e&&"west"!==e&&s.scale(t),u=xr.fromArray(vr[n]),"east"!==n&&"west"!==n&&u.scale(t),c=wr.fromArray(vr[r]),"east"!==r&&"west"!==r&&c.scale(t)}else{const{up:i,east:o,north:a}=_r;o.set(-l.y,l.x,0).normalize(),t.geodeticSurfaceNormal(l,i),a.copy(i).cross(o);const{down:h,west:f,south:p}=_r;h.copy(i).scale(-1),f.copy(o).scale(-1),p.copy(a).scale(-1),s=_r[e],u=_r[n],c=_r[r]}return o[0]=s.x,o[1]=s.y,o[2]=s.z,o[3]=0,o[4]=u.x,o[5]=u.y,o[6]=u.z,o[7]=0,o[8]=c.x,o[9]=c.y,o[10]=c.z,o[11]=0,o[12]=l.x,o[13]=l.y,o[14]=l.z,o[15]=1,o}const Or=new rt.a,Sr=new rt.a,Tr=new rt.a,Cr=new rt.a,Pr=new rt.a,Mr=new rt.a;class Ir{constructor(t=0,e=0,n=0){lr(this,"radii",void 0),lr(this,"radiiSquared",void 0),lr(this,"radiiToTheFourth",void 0),lr(this,"oneOverRadii",void 0),lr(this,"oneOverRadiiSquared",void 0),lr(this,"minimumRadius",void 0),lr(this,"maximumRadius",void 0),lr(this,"centerToleranceSquared",Kt),lr(this,"squaredXOverSquaredZ",void 0),Object(Ut.a)(t>=0),Object(Ut.a)(e>=0),Object(Ut.a)(n>=0),this.radii=new rt.a(t,e,n),this.radiiSquared=new rt.a(t*t,e*e,n*n),this.radiiToTheFourth=new rt.a(t*t*t*t,e*e*e*e,n*n*n*n),this.oneOverRadii=new rt.a(0===t?0:1/t,0===e?0:1/e,0===n?0:1/n),this.oneOverRadiiSquared=new rt.a(0===t?0:1/(t*t),0===e?0:1/(e*e),0===n?0:1/(n*n)),this.minimumRadius=Math.min(t,e,n),this.maximumRadius=Math.max(t,e,n),0!==this.radiiSquared.z&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}equals(t){return this===t||Boolean(t&&this.radii.equals(t.radii))}toString(){return this.radii.toString()}cartographicToCartesian(t,e=[0,0,0]){const n=Sr,r=Tr,[,,i]=t;this.geodeticSurfaceNormalCartographic(t,n),r.copy(this.radiiSquared).scale(n);const o=Math.sqrt(n.dot(r));return r.scale(1/o),n.scale(i),r.add(n),r.to(e)}cartesianToCartographic(t,e=[0,0,0]){Mr.from(t);const n=this.scaleToGeodeticSurface(Mr,Cr);if(!n)return;const r=this.geodeticSurfaceNormal(n,Sr),i=Pr;i.copy(Mr).subtract(n);const o=Math.atan2(r.y,r.x),a=Math.asin(r.z),s=Math.sign(mt.e(i,Mr))*mt.h(i);return pr([o,a,s],e,Nt.b._cartographicRadians?hr:Nt.i)}eastNorthUpToFixedFrame(t,e=new Zt.a){return Er(this,"east","north","up",t,e)}localFrameToFixedFrame(t,e,n,r,i=new Zt.a){return Er(this,t,e,n,r,i)}geocentricSurfaceNormal(t,e=[0,0,0]){return Or.from(t).normalize().to(e)}geodeticSurfaceNormalCartographic(t,e=[0,0,0]){const n=function(t,e=[]){return fr(t,e,Nt.b._cartographicRadians?hr:Nt.j)}(t),r=n[0],i=n[1],o=Math.cos(i);return Or.set(o*Math.cos(r),o*Math.sin(r),Math.sin(i)).normalize(),Or.to(e)}geodeticSurfaceNormal(t,e=[0,0,0]){return Or.from(t).scale(this.oneOverRadiiSquared).normalize().to(e)}scaleToGeodeticSurface(t,e){return function(t,e,n=[]){const{oneOverRadii:r,oneOverRadiiSquared:i,centerToleranceSquared:o}=e;dr.from(t);const a=dr.x,s=dr.y,u=dr.z,c=r.x,l=r.y,h=r.z,f=a*a*c*c,p=s*s*l*l,d=u*u*h*h,A=f+p+d,g=Math.sqrt(1/A);if(!Number.isFinite(g))return;const m=Ar;if(m.copy(t).scale(g),A<o)return m.to(n);const y=i.x,v=i.y,_=i.z,b=gr;b.set(m.x*y*2,m.y*v*2,m.z*_*2);let x,w,E,O,S=(1-g)*dr.len()/(.5*b.len()),T=0;do{S-=T,x=1/(1+S*y),w=1/(1+S*v),E=1/(1+S*_);const t=x*x,e=w*w,n=E*E;O=f*t+p*e+d*n-1;T=O/(-2*(f*(t*x)*y+p*(e*w)*v+d*(n*E)*_))}while(Math.abs(O)>Yt);return dr.scale([x,w,E]).to(n)}(t,this,e)}scaleToGeocentricSurface(t,e=[0,0,0]){Cr.from(t);const n=Cr.x,r=Cr.y,i=Cr.z,o=this.oneOverRadiiSquared,a=1/Math.sqrt(n*n*o.x+r*r*o.y+i*i*o.z);return Cr.multiplyScalar(a).to(e)}transformPositionToScaledSpace(t,e=[0,0,0]){return Cr.from(t).scale(this.oneOverRadii).to(e)}transformPositionFromScaledSpace(t,e=[0,0,0]){return Cr.from(t).scale(this.radii).to(e)}getSurfaceNormalIntersectionWithZAxis(t,e=0,n=[0,0,0]){Object(Ut.a)(Object(Nt.d)(this.radii.x,this.radii.y,$t)),Object(Ut.a)(this.radii.z>0),Cr.from(t);const r=Cr.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(r)>=this.radii.z-e))return Cr.set(0,0,r).to(n)}}lr(Ir,"WGS84",new Ir(6378137,6378137,6356752.314245179));var Br=n(73),Rr=n(101),kr=n(19);class Lr{constructor(t,e,n){Object(cr.a)(this,"item",void 0),Object(cr.a)(this,"previous",void 0),Object(cr.a)(this,"next",void 0),this.item=t,this.previous=e,this.next=n}}class Dr{constructor(){Object(cr.a)(this,"head",null),Object(cr.a)(this,"tail",null),Object(cr.a)(this,"_length",0)}get length(){return this._length}add(t){const e=new Lr(t,this.tail,null);return this.tail?(this.tail.next=e,this.tail=e):(this.head=e,this.tail=e),++this._length,e}remove(t){t&&(t.previous&&t.next?(t.previous.next=t.next,t.next.previous=t.previous):t.previous?(t.previous.next=null,this.tail=t.previous):t.next?(t.next.previous=null,this.head=t.next):(this.head=null,this.tail=null),t.next=null,t.previous=null,--this._length)}splice(t,e){t!==e&&(this.remove(e),this._insert(t,e))}_insert(t,e){const n=t.next;t.next=e,this.tail===t?this.tail=e:n.previous=e,e.next=n,e.previous=t,++this._length}}function jr(t){return null!=t}class Fr{constructor(){Object(cr.a)(this,"_list",void 0),Object(cr.a)(this,"_sentinel",void 0),Object(cr.a)(this,"_trimTiles",void 0),this._list=new Dr,this._sentinel=this._list.add("sentinel"),this._trimTiles=!1}reset(){this._list.splice(this._list.tail,this._sentinel)}touch(t){const e=t._cacheNode;jr(e)&&this._list.splice(this._sentinel,e)}add(t,e,n){jr(e._cacheNode)||(e._cacheNode=this._list.add(e),n&&n(t,e))}unloadTile(t,e,n){const r=e._cacheNode;jr(r)&&(this._list.remove(r),e._cacheNode=void 0,n&&n(t,e))}unloadTiles(t,e){const n=this._trimTiles;this._trimTiles=!1;const r=this._list,i=1024*t.maximumMemoryUsage*1024,o=this._sentinel;let a=r.head;for(;a!==o&&(t.gpuMemoryUsageInBytes>i||n);){const n=a.item;a=a.next,this.unloadTile(t,n,e)}}trim(){this._trimTiles=!0}}const zr=new rt.a,Ur=new rt.a,Nr=new Jt([new Ht,new Ht,new Ht,new Ht,new Ht,new Ht]);function Gr(t,e){const{cameraDirection:n,cameraUp:r,height:i}=t,{metersPerUnit:o}=t.distanceScales,a=Hr(t,t.center),s=Ir.WGS84.eastNorthUpToFixedFrame(a),u=t.unprojectPosition(t.cameraPosition),c=Ir.WGS84.cartographicToCartesian(u,new rt.a),l=new rt.a(s.transformAsVector(new rt.a(n).scale(o))).normalize(),h=new rt.a(s.transformAsVector(new rt.a(r).scale(o))).normalize();!function(t){const e=t.getFrustumPlanes(),n=Vr(e.near,t.cameraPosition),r=Hr(t,n),i=Hr(t,t.cameraPosition,Ur);let o=0;Nr.planes[o++].fromPointNormal(r,zr.copy(r).subtract(i));for(const i in e){if("near"===i)continue;const a=Vr(e[i],n,Ur),s=Hr(t,a,Ur);Nr.planes[o++].fromPointNormal(s,zr.copy(r).subtract(s))}}(t);const f=t.constructor,{longitude:p,latitude:d,width:A,bearing:g,zoom:m}=t;return{camera:{position:c,direction:l,up:h},viewport:t,topDownViewport:new f({longitude:p,latitude:d,height:i,width:A,bearing:g,zoom:m,pitch:0}),height:i,cullingVolume:Nr,frameNumber:e,sseDenominator:1.15}}function Vr(t,e,n=new rt.a){const r=t.normal.dot(e);return n.copy(t.normal).scale(t.distance-r).add(e),n}function Hr(t,e,n=new rt.a){const r=t.unprojectPosition(e);return Ir.WGS84.cartographicToCartesian(r,n)}const Wr=new rt.a;function qr(t,e){if(t instanceof zt){const{halfAxes:n}=t,r=function(t){t.getColumn(0,Wr);const e=t.getColumn(1),n=t.getColumn(2),r=Wr.add(e).add(n);return r.len()}(n);return Math.log2(6356752.314245179/(r+e[2]))}if(t instanceof lt){const{radius:n}=t;return Math.log2(6356752.314245179/(n+e[2]))}if(t.width&&t.height){const{width:e,height:n}=t;return(Math.log2(6378137/e)+Math.log2(6378137/n))/2}return 1}function Xr(t,e,n){const r=Ir.WGS84.cartographicToCartesian([t.xmax,t.ymax,t.zmax],new rt.a),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(6356752.314245179/(i+e[2]))}const Jr=0,Zr=1,Qr=3,Kr=4,Yr=5,$r=1,ti=2,ei="empty",ni="scenegraph",ri="pointcloud",ii="mesh",oi="I3S",ai="TILES3D",si="geometricError",ui=1;function ci(t){return null!=t}const li=new rt.a,hi=new rt.a,fi=new rt.a;function pi(t,e,n){if(Object(Rr.a)(t,"3D Tile: boundingVolume must be defined"),t.box)return function(t,e,n){const r=new rt.a(t[0],t[1],t[2]);e.transform(r,r);let i=[];if(10===t.length){const e=t.slice(3,6),n=new xt.a;n.fromArray(t,6);const r=new rt.a([1,0,0]),o=new rt.a([0,1,0]),a=new rt.a([0,0,1]);r.transformByQuaternion(n),r.scale(e[0]),o.transformByQuaternion(n),o.scale(e[1]),a.transformByQuaternion(n),a.scale(e[2]),i=[...r.toArray(),...o.toArray(),...a.toArray()]}else i=[...t.slice(3,6),...t.slice(6,9),...t.slice(9,12)];const o=e.transformAsVector(i.slice(0,3)),a=e.transformAsVector(i.slice(3,6)),s=e.transformAsVector(i.slice(6,9)),u=new vt([o[0],o[1],o[2],a[0],a[1],a[2],s[0],s[1],s[2]]);if(ci(n))return n.center=r,n.halfAxes=u,n;return new zt(r,u)}(t.box,e,n);if(t.region){const[e,n,r,i,o,a]=t.region,s=Ir.WGS84.cartographicToCartesian([Object(Nt.c)(e),Object(Nt.c)(i),o],hi),u=Ir.WGS84.cartographicToCartesian([Object(Nt.c)(r),Object(Nt.c)(n),a],fi),c=(new rt.a).addVectors(s,u).multiplyScalar(.5),l=(new rt.a).subVectors(s,u).len()/2;return di([c[0],c[1],c[2],l],new Zt.a)}if(t.sphere)return di(t.sphere,e,n);throw new Error("3D Tile: boundingVolume must contain a sphere, region, or box")}function di(t,e,n){const r=new rt.a(t[0],t[1],t[2]);e.transform(r,r);const i=e.getScale(li),o=Math.max(Math.max(i[0],i[1]),i[2]),a=t[3]*o;return ci(n)?(n.center=r,n.radius=a,n):new lt(r,a)}new rt.a,new rt.a,new Zt.a,new rt.a,new rt.a,new rt.a;function Ai(t,e){if(t.dynamicScreenSpaceError&&t.dynamicScreenSpaceErrorComputedDensity){const n=t.dynamicScreenSpaceErrorComputedDensity,r=t.dynamicScreenSpaceErrorFactor;return function(t,e){const n=t*e;return 1-Math.exp(-n*n)}(e,n)*r}return 0}const gi=new rt.a,mi=new rt.a,yi=new rt.a,vi=new rt.a,_i=new rt.a,bi=new Zt.a,xi=new Zt.a;function wi(t,e){const{topDownViewport:n}=e,r=t.header.mbs[1],i=t.header.mbs[0],o=t.header.mbs[2],a=t.header.mbs[3],s=[...t.boundingVolume.center],u=n.unprojectPosition(n.cameraPosition);Ir.WGS84.cartographicToCartesian(u,gi),mi.copy(gi).subtract(s).normalize(),Ir.WGS84.eastNorthUpToFixedFrame(s,bi),xi.copy(bi).invert(),yi.copy(gi).transform(xi);const c=Math.sqrt(yi[0]*yi[0]+yi[1]*yi[1]),l=c*c/yi[2];vi.copy([yi[0],yi[1],l]);const h=vi.transform(bi).subtract(s).normalize(),f=mi.cross(h).normalize().scale(a).add(s),p=Ir.WGS84.cartesianToCartographic(f),d=n.project([i,r,o]),A=n.project(p);return _i.copy(d).subtract(A).magnitude()}class Ei{constructor(t=0){Object(cr.a)(this,"_map",new Map),Object(cr.a)(this,"_array",void 0),Object(cr.a)(this,"_length",void 0),this._array=new Array(t),this._length=t}get length(){return this._length}set length(t){this._length=t,t>this._array.length&&(this._array.length=t)}get values(){return this._array}get(t){return Object(Rr.a)(t<this._array.length),this._array[t]}set(t,e){Object(Rr.a)(t>=0),t>=this.length&&(this.length=t+1),this._map.has(this._array[t])&&this._map.delete(this._array[t]),this._array[t]=e,this._map.set(e,t)}delete(t){const e=this._map.get(t);e>=0&&(this._array.splice(e,1),this._map.delete(t),this.length--)}peek(){return this._array[this._length-1]}push(t){if(!this._map.has(t)){const e=this.length++;this._array[e]=t,this._map.set(t,e)}}pop(){const t=this._array[--this.length];return this._map.delete(t),t}reserve(t){Object(Rr.a)(t>=0),t>this._array.length&&(this._array.length=t)}resize(t){Object(Rr.a)(t>=0),this.length=t}trim(t){null==t&&(t=this.length),this._array.length=t}reset(){this._array=[],this._map=new Map,this._length=0}find(t){return this._map.has(t)}}const Oi={loadSiblings:!1,skipLevelOfDetail:!1,maximumScreenSpaceError:2,updateTransforms:!0,onTraversalEnd:()=>{},viewportTraversersMap:{},basePath:""};class Si{traversalFinished(t){return!0}constructor(t){Object(cr.a)(this,"options",void 0),Object(cr.a)(this,"root",void 0),Object(cr.a)(this,"requestedTiles",void 0),Object(cr.a)(this,"selectedTiles",void 0),Object(cr.a)(this,"emptyTiles",void 0),Object(cr.a)(this,"lastUpdate",(new Date).getTime()),Object(cr.a)(this,"updateDebounceTime",1e3),Object(cr.a)(this,"_traversalStack",void 0),Object(cr.a)(this,"_emptyTraversalStack",void 0),Object(cr.a)(this,"_frameNumber",void 0),this.options={...Oi,...t},this._traversalStack=new Ei,this._emptyTraversalStack=new Ei,this._frameNumber=null,this.root=null,this.selectedTiles={},this.requestedTiles={},this.emptyTiles={}}traverse(t,e,n){this.root=t,this.options={...this.options,...n},this.reset(),this.updateTile(t,e),this._frameNumber=e.frameNumber,this.executeTraversal(t,e)}reset(){this.requestedTiles={},this.selectedTiles={},this.emptyTiles={},this._traversalStack.reset(),this._emptyTraversalStack.reset()}executeTraversal(t,e){const n=this._traversalStack;for(t._selectionDepth=1,n.push(t);n.length>0;){const t=n.pop();let r=!1;this.canTraverse(t,e)&&(this.updateChildTiles(t,e),r=this.updateAndPushChildren(t,e,n,t.hasRenderContent?t._selectionDepth+1:t._selectionDepth));const i=t.parent,o=Boolean(!i||i._shouldRefine),a=!r;t.hasRenderContent?t.refine===$r?(this.loadTile(t,e),this.selectTile(t,e)):t.refine===ti&&(this.loadTile(t,e),a&&this.selectTile(t,e)):(this.emptyTiles[t.id]=t,this.loadTile(t,e),a&&this.selectTile(t,e)),this.touchTile(t,e),t._shouldRefine=r&&o}const r=(new Date).getTime();(this.traversalFinished(e)||r-this.lastUpdate>this.updateDebounceTime)&&(this.lastUpdate=r,this.options.onTraversalEnd(e))}updateChildTiles(t,e){const n=t.children;for(const t of n)this.updateTile(t,e);return!0}updateAndPushChildren(t,e,n,r){const{loadSiblings:i,skipLevelOfDetail:o}=this.options,a=t.children;a.sort(this.compareDistanceToCamera.bind(this));const s=t.refine===ti&&t.hasRenderContent&&!o;let u=!1,c=!0;for(const t of a)if(t._selectionDepth=r,t.isVisibleAndInRequestVolume?(n.find(t)&&n.delete(t),n.push(t),u=!0):(s||i)&&(this.loadTile(t,e),this.touchTile(t,e)),s){let n;if(n=!!t._inRequestVolume&&(t.hasRenderContent?t.contentAvailable:this.executeEmptyTraversal(t,e)),c=c&&n,!c)return!1}return u||(c=!1),c}updateTile(t,e){this.updateTileVisibility(t,e)}selectTile(t,e){this.shouldSelectTile(t)&&(t._selectedFrame=e.frameNumber,this.selectedTiles[t.id]=t)}loadTile(t,e){this.shouldLoadTile(t)&&(t._requestedFrame=e.frameNumber,t._priority=t._getPriority(),this.requestedTiles[t.id]=t)}touchTile(t,e){t.tileset._cache.touch(t),t._touchedFrame=e.frameNumber}canTraverse(t,e,n=!1,r=!1){return!!t.hasChildren&&(t.hasTilesetContent?!t.contentExpired:!(!r&&!t.isVisibleAndInRequestVolume)&&this.shouldRefine(t,e,n))}shouldLoadTile(t){return t.hasUnloadedContent||t.contentExpired}shouldSelectTile(t){return t.contentAvailable&&!this.options.skipLevelOfDetail}shouldRefine(t,e,n){let r=t._screenSpaceError;return n&&(r=t.getScreenSpaceError(e,!0)),r>this.options.maximumScreenSpaceError}updateTileVisibility(t,e){const n=[];if(this.options.viewportTraversersMap)for(const t in this.options.viewportTraversersMap){this.options.viewportTraversersMap[t]===e.viewport.id&&n.push(t)}else n.push(e.viewport.id);t.updateVisibility(e,n)}compareDistanceToCamera(t,e){return t._distanceToCamera-e._distanceToCamera}anyChildrenVisible(t,e){let n=!1;for(const r of t.children)r.updateVisibility(e),n=n||r.isVisibleAndInRequestVolume;return n}executeEmptyTraversal(t,e){let n=!0;const r=this._emptyTraversalStack;for(r.push(t);r.length>0&&n;){const t=r.pop();this.updateTile(t,e),t.isVisibleAndInRequestVolume||this.loadTile(t,e),this.touchTile(t,e);if(!t.hasRenderContent&&this.canTraverse(t,e,!1,!0)){const e=t.children;for(const t of e)r.find(t)&&r.delete(t),r.push(t)}else t.contentAvailable||(n=!1)}return n}}const Ti=new rt.a;class Ci{constructor(t,e,n,r=""){Object(cr.a)(this,"tileset",void 0),Object(cr.a)(this,"header",void 0),Object(cr.a)(this,"id",void 0),Object(cr.a)(this,"url",void 0),Object(cr.a)(this,"parent",void 0),Object(cr.a)(this,"refine",void 0),Object(cr.a)(this,"type",void 0),Object(cr.a)(this,"contentUrl",void 0),Object(cr.a)(this,"lodMetricType",void 0),Object(cr.a)(this,"lodMetricValue",void 0),Object(cr.a)(this,"boundingVolume",void 0),Object(cr.a)(this,"content",void 0),Object(cr.a)(this,"contentState",void 0),Object(cr.a)(this,"gpuMemoryUsageInBytes",void 0),Object(cr.a)(this,"children",void 0),Object(cr.a)(this,"depth",void 0),Object(cr.a)(this,"viewportIds",void 0),Object(cr.a)(this,"transform",void 0),Object(cr.a)(this,"extensions",void 0),Object(cr.a)(this,"userData",void 0),Object(cr.a)(this,"computedTransform",void 0),Object(cr.a)(this,"hasEmptyContent",void 0),Object(cr.a)(this,"hasTilesetContent",void 0),Object(cr.a)(this,"traverser",void 0),Object(cr.a)(this,"_cacheNode",void 0),Object(cr.a)(this,"_frameNumber",void 0),Object(cr.a)(this,"_lodJudge",void 0),Object(cr.a)(this,"_expireDate",void 0),Object(cr.a)(this,"_expiredContent",void 0),Object(cr.a)(this,"_shouldRefine",void 0),Object(cr.a)(this,"_distanceToCamera",void 0),Object(cr.a)(this,"_centerZDepth",void 0),Object(cr.a)(this,"_screenSpaceError",void 0),Object(cr.a)(this,"_visibilityPlaneMask",void 0),Object(cr.a)(this,"_visible",void 0),Object(cr.a)(this,"_inRequestVolume",void 0),Object(cr.a)(this,"_stackLength",void 0),Object(cr.a)(this,"_selectionDepth",void 0),Object(cr.a)(this,"_touchedFrame",void 0),Object(cr.a)(this,"_visitedFrame",void 0),Object(cr.a)(this,"_selectedFrame",void 0),Object(cr.a)(this,"_requestedFrame",void 0),Object(cr.a)(this,"_priority",void 0),Object(cr.a)(this,"_contentBoundingVolume",void 0),Object(cr.a)(this,"_viewerRequestVolume",void 0),Object(cr.a)(this,"_initialTransform",void 0),this.header=e,this.tileset=t,this.id=r||e.id,this.url=e.url,this.parent=n,this.refine=this._getRefine(e.refine),this.type=e.type,this.contentUrl=e.contentUrl,this.lodMetricType="geometricError",this.lodMetricValue=0,this.boundingVolume=null,this.content=null,this.contentState=Jr,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 Si({}),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 Zt.a,this.transform=new Zt.a,this._initializeLodMetric(e),this._initializeTransforms(e),this._initializeBoundingVolumes(e),this._initializeContent(e),this._initializeRenderingState(e),this._lodJudge=null,this._expireDate=null,this._expiredContent=null,Object.seal(this)}destroy(){this.header=null}isDestroyed(){return null===this.header}get selected(){return this._selectedFrame===this.tileset._frameNumber}get isVisible(){return this._visible}get isVisibleAndInRequestVolume(){return this._visible&&this._inRequestVolume}get hasRenderContent(){return!this.hasEmptyContent&&!this.hasTilesetContent}get hasChildren(){return this.children.length>0||this.header.children&&this.header.children.length>0}get contentReady(){return this.contentState===Qr||this.hasEmptyContent}get contentAvailable(){return Boolean(this.contentReady&&this.hasRenderContent||this._expiredContent&&!this.contentFailed)}get hasUnloadedContent(){return this.hasRenderContent&&this.contentUnloaded}get contentUnloaded(){return this.contentState===Jr}get contentExpired(){return this.contentState===Kr}get contentFailed(){return this.contentState===Yr}getScreenSpaceError(t,e){switch(this.tileset.type){case oi:return wi(this,t);case ai:return function(t,e,n){const r=t.tileset,i=t.parent&&t.parent.lodMetricValue||t.lodMetricValue,o=n?i:t.lodMetricValue;if(0===o)return 0;const a=Math.max(t._distanceToCamera,1e-7),{height:s,sseDenominator:u}=e,{viewDistanceScale:c}=r.options;let l=o*s*(c||1)/(a*u);return l-=Ai(r,a),l}(this,t,e);default:throw new Error("Unsupported tileset type")}}unselect(){this._selectedFrame=0}_getPriority(){const t=this.tileset._traverser,{skipLevelOfDetail:e}=t.options,n=this.refine===$r||e;if(n&&!this.isVisible&&void 0!==this._visible)return-1;if(this.tileset._frameNumber-this._touchedFrame>=1)return-1;if(this.contentState===Jr)return-1;const 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)}async loadContent(){if(this.hasEmptyContent)return!1;if(this.content)return!0;this.contentExpired&&(this._expireDate=null),this.contentState=Zr;const t=await this.tileset._requestScheduler.scheduleRequest(this.id,this._getPriority.bind(this));if(!t)return this.contentState=Jr,!1;try{const e=this.tileset.getTileUrl(this.contentUrl),n=this.tileset.loader,r={...this.tileset.loadOptions,[n.id]:{...this.tileset.loadOptions[n.id],isTileset:"json"===this.type,...this._getLoaderSpecificOptions(n.id)}};return this.content=await Object(ur.a)(e,n,r),this.tileset.options.contentLoader&&await this.tileset.options.contentLoader(this),this._isTileset()&&this.tileset._initializeTileHeaders(this.content,this),this.contentState=Qr,this._onContentLoaded(),!0}catch(t){throw this.contentState=Yr,t}finally{t.done()}}unloadContent(){return this.content&&this.content.destroy&&this.content.destroy(),this.content=null,this.header.content&&this.header.content.destroy&&this.header.content.destroy(),this.header.content=null,this.contentState=Jr,!0}updateVisibility(t,e){if(this._frameNumber===t.frameNumber)return;const n=this.parent,r=n?n._visibilityPlaneMask:Jt.MASK_INDETERMINATE;if(this.tileset._traverser.options.updateTransforms){const t=n?n.computedTransform:this.tileset.modelMatrix;this._updateTransform(t)}this._distanceToCamera=this.distanceToTile(t),this._screenSpaceError=this.getScreenSpaceError(t,!1),this._visibilityPlaneMask=this.visibility(t,r),this._visible=this._visibilityPlaneMask!==Jt.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(t),this._frameNumber=t.frameNumber,this.viewportIds=e}visibility(t,e){const{cullingVolume:n}=t,{boundingVolume:r}=this;return n.computeVisibilityWithPlaneMask(r,e)}contentVisibility(){return!0}distanceToTile(t){const e=this.boundingVolume;return Math.sqrt(Math.max(e.distanceSquaredTo(t.camera.position),0))}cameraSpaceZDepth({camera:t}){const e=this.boundingVolume;return Ti.subVectors(e.center,t.position),t.direction.dot(Ti)}insideViewerRequestVolume(t){const e=this._viewerRequestVolume;return!e||e.distanceSquaredTo(t.camera.position)<=0}updateExpiration(){if(null!=this._expireDate&&this.contentReady&&!this.hasEmptyContent){const t=Date.now();Date.lessThan(this._expireDate,t)&&(this.contentState=Kr,this._expiredContent=this.content)}}get extras(){return this.header.extras}_initializeLodMetric(t){"lodMetricType"in t?this.lodMetricType=t.lodMetricType:(this.lodMetricType=this.parent&&this.parent.lodMetricType||this.tileset.lodMetricType,console.warn("3D Tile: Required prop lodMetricType is undefined. Using parent lodMetricType")),"lodMetricValue"in t?this.lodMetricValue=t.lodMetricValue:(this.lodMetricValue=this.parent&&this.parent.lodMetricValue||this.tileset.lodMetricValue,console.warn("3D Tile: Required prop lodMetricValue is undefined. Using parent lodMetricValue"))}_initializeTransforms(t){this.transform=t.transform?new Zt.a(t.transform):new Zt.a;const e=this.parent,n=this.tileset,r=e&&e.computedTransform?e.computedTransform.clone():n.modelMatrix.clone();this.computedTransform=new Zt.a(r).multiplyRight(this.transform);const i=e&&e._initialTransform?e._initialTransform.clone():new Zt.a;this._initialTransform=new Zt.a(i).multiplyRight(this.transform)}_initializeBoundingVolumes(t){this._contentBoundingVolume=null,this._viewerRequestVolume=null,this._updateBoundingVolume(t)}_initializeContent(t){this.content={_tileset:this.tileset,_tile:this},this.hasEmptyContent=!0,this.contentState=Jr,this.hasTilesetContent=!1,t.contentUrl&&(this.content=null,this.hasEmptyContent=!1)}_initializeRenderingState(t){this.depth=t.level||(this.parent?this.parent.depth+1:0),this._shouldRefine=!1,this._distanceToCamera=0,this._centerZDepth=0,this._screenSpaceError=0,this._visibilityPlaneMask=Jt.MASK_INDETERMINATE,this._visible=void 0,this._inRequestVolume=!1,this._stackLength=0,this._selectionDepth=0,this._frameNumber=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._requestedFrame=0,this._priority=0}_getRefine(t){return t||this.parent&&this.parent.refine||ti}_isTileset(){return-1!==this.contentUrl.indexOf(".json")}_onContentLoaded(){switch(this.content&&this.content.type){case"vctr":case"geom":this.tileset._traverser.disableSkipLevelOfDetail=!0}this._isTileset()&&(this.hasTilesetContent=!0)}_updateBoundingVolume(t){this.boundingVolume=pi(t.boundingVolume,this.computedTransform,this.boundingVolume);const e=t.content;e&&(e.boundingVolume&&(this._contentBoundingVolume=pi(e.boundingVolume,this.computedTransform,this._contentBoundingVolume)),t.viewerRequestVolume&&(this._viewerRequestVolume=pi(t.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)))}_updateTransform(t=new Zt.a){const e=t.clone().multiplyRight(this.transform);!e.equals(this.computedTransform)&&(this.computedTransform=e,this._updateBoundingVolume(this.header))}_getLoaderSpecificOptions(t){switch(t){case"i3s":return{...this.tileset.options.i3s,tile:this.header,tileset:this.tileset.tileset,isTileHeader:!1};case"3d-tiles":case"cesium-ion":default:return{assetGltfUpAxis:(e=this.tileset.tileset).asset&&e.asset.gltfUpAxis||"Y"}}var e}}class Pi extends Si{compareDistanceToCamera(t,e){return 0===e._distanceToCamera&&0===t._distanceToCamera?e._centerZDepth-t._centerZDepth:e._distanceToCamera-t._distanceToCamera}updateTileVisibility(t,e){if(super.updateTileVisibility(t,e),!t.isVisibleAndInRequestVolume)return;const n=t.children.length>0;if(t.hasTilesetContent&&n){const n=t.children[0];return this.updateTileVisibility(n,e),void(t._visible=n._visible)}if(this.meetsScreenSpaceErrorEarly(t,e))return void(t._visible=!1);const r=t.refine===ti,i=t._optimChildrenWithinParent===ui;r&&i&&n&&!this.anyChildrenVisible(t,e)&&(t._visible=!1)}meetsScreenSpaceErrorEarly(t,e){const{parent:n}=t;return!(!n||n.hasTilesetContent||n.refine!==$r)&&!this.shouldRefine(t,e,!0)}}class Mi{constructor(){Object(cr.a)(this,"frameNumberMap",new Map)}register(t,e){const n=this.frameNumberMap.get(t)||new Map,r=n.get(e)||0;n.set(e,r+1),this.frameNumberMap.set(t,n)}deregister(t,e){const n=this.frameNumberMap.get(t);if(!n)return;const r=n.get(e)||1;n.set(e,r-1)}isZero(t,e){var n;return 0===((null===(n=this.frameNumberMap.get(t))||void 0===n?void 0:n.get(e))||0)}}const Ii="REQUESTED",Bi="COMPLETED",Ri="ERROR";class ki{constructor(){Object(cr.a)(this,"_statusMap",void 0),Object(cr.a)(this,"pendingTilesRegister",new Mi),this._statusMap={}}add(t,e,n,r){if(!this._statusMap[e]){const{frameNumber:i,viewport:{id:o}}=r;this._statusMap[e]={request:t,callback:n,key:e,frameState:r,status:Ii},this.pendingTilesRegister.register(o,i),t().then(t=>{this._statusMap[e].status=Bi;const{frameNumber:n,viewport:{id:i}}=this._statusMap[e].frameState;this.pendingTilesRegister.deregister(i,n),this._statusMap[e].callback(t,r)}).catch(t=>{this._statusMap[e].status=Ri;const{frameNumber:r,viewport:{id:i}}=this._statusMap[e].frameState;this.pendingTilesRegister.deregister(i,r),n(t)})}}update(t,e){if(this._statusMap[t]){const{frameNumber:n,viewport:{id:r}}=this._statusMap[t].frameState;this.pendingTilesRegister.deregister(r,n);const{frameNumber:i,viewport:{id:o}}=e;this.pendingTilesRegister.register(o,i),this._statusMap[t].frameState=e}}find(t){return this._statusMap[t]}hasPendingTiles(t,e){return!this.pendingTilesRegister.isZero(t,e)}}class Li extends Si{traversalFinished(t){return!this._tileManager.hasPendingTiles(t.viewport.id,this._frameNumber||0)}constructor(t){super(t),Object(cr.a)(this,"_tileManager",void 0),this._tileManager=new ki}shouldRefine(t,e){return t._lodJudge=function(t,e){if(0===t.lodMetricValue||isNaN(t.lodMetricValue))return"DIG";const n=2*wi(t,e);return n<2?"OUT":!t.header.children||n<=t.lodMetricValue?"DRAW":t.header.children?"DIG":"OUT"}(t,e),"DIG"===t._lodJudge}updateChildTiles(t,e){const n=t.header.children||[],r=t.children,i=t.tileset;for(const o of n){const n="".concat(o.id,"-").concat(e.viewport.id),a=r&&r.find(t=>t.id===n);if(a)a&&this.updateTile(a,e);else{let r=()=>this._loadTile(o.id,i);this._tileManager.find(n)?this._tileManager.update(n,e):(i.tileset.nodePages&&(r=()=>i.tileset.nodePagesTile.formTileFromNodePages(o.id)),this._tileManager.add(r,n,e=>this._onTileLoad(e,t,n),e))}}return!1}async _loadTile(t,e){const{loader:n}=e,r=e.getTileUrl("".concat(e.url,"/nodes/").concat(t)),i={...e.loadOptions,i3s:{...e.loadOptions.i3s,isTileHeader:!0,loadContent:!1}};return await Object(ur.a)(r,n,i)}_onTileLoad(t,e,n){const r=new Ci(e.tileset,t,e,n);e.children.push(r);const 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)}}const Di={description:"",ellipsoid:Ir.WGS84,modelMatrix:new Zt.a,throttleRequests:!0,maxRequests:64,maximumMemoryUsage:32,maximumTilesSelected:0,debounceTime:0,onTileLoad:()=>{},onTileUnload:()=>{},onTileError:()=>{},onTraversalComplete:t=>t,contentLoader:void 0,viewDistanceScale:1,maximumScreenSpaceError:8,loadTiles:!0,updateTransforms:!0,viewportTraversersMap:null,loadOptions:{fetch:{}},attributions:[],basePath:"",i3s:{}},ji="Tiles In Tileset(s)";class Fi{constructor(t,e){Object(cr.a)(this,"options",void 0),Object(cr.a)(this,"loadOptions",void 0),Object(cr.a)(this,"type",void 0),Object(cr.a)(this,"tileset",void 0),Object(cr.a)(this,"loader",void 0),Object(cr.a)(this,"url",void 0),Object(cr.a)(this,"basePath",void 0),Object(cr.a)(this,"modelMatrix",void 0),Object(cr.a)(this,"ellipsoid",void 0),Object(cr.a)(this,"lodMetricType",void 0),Object(cr.a)(this,"lodMetricValue",void 0),Object(cr.a)(this,"refine",void 0),Object(cr.a)(this,"root",void 0),Object(cr.a)(this,"roots",void 0),Object(cr.a)(this,"asset",void 0),Object(cr.a)(this,"description",void 0),Object(cr.a)(this,"properties",void 0),Object(cr.a)(this,"extras",void 0),Object(cr.a)(this,"attributions",void 0),Object(cr.a)(this,"credits",void 0),Object(cr.a)(this,"stats",void 0),Object(cr.a)(this,"traverseCounter",void 0),Object(cr.a)(this,"geometricError",void 0),Object(cr.a)(this,"selectedTiles",void 0),Object(cr.a)(this,"updatePromise",null),Object(cr.a)(this,"tilesetInitializationPromise",void 0),Object(cr.a)(this,"cartographicCenter",void 0),Object(cr.a)(this,"cartesianCenter",void 0),Object(cr.a)(this,"zoom",void 0),Object(cr.a)(this,"boundingVolume",void 0),Object(cr.a)(this,"gpuMemoryUsageInBytes",void 0),Object(cr.a)(this,"dynamicScreenSpaceErrorComputedDensity",void 0),Object(cr.a)(this,"_traverser",void 0),Object(cr.a)(this,"_cache",void 0),Object(cr.a)(this,"_requestScheduler",void 0),Object(cr.a)(this,"_frameNumber",void 0),Object(cr.a)(this,"_queryParamsString",void 0),Object(cr.a)(this,"_queryParams",void 0),Object(cr.a)(this,"_extensionsUsed",void 0),Object(cr.a)(this,"_tiles",void 0),Object(cr.a)(this,"_pendingCount",void 0),Object(cr.a)(this,"lastUpdatedVieports",void 0),Object(cr.a)(this,"_requestedTiles",void 0),Object(cr.a)(this,"_emptyTiles",void 0),Object(cr.a)(this,"frameStateData",void 0),Object(cr.a)(this,"maximumMemoryUsage",void 0),Object(Rr.a)(t),this.options={...Di,...e},this.tileset=t,this.loader=t.loader,this.type=t.type,this.url=t.url,this.basePath=t.basePath||kr.b.dirname(this.url),this.modelMatrix=this.options.modelMatrix,this.ellipsoid=this.options.ellipsoid,this.lodMetricType=t.lodMetricType,this.lodMetricValue=t.lodMetricValue,this.refine=t.root.refine,this.loadOptions=this.options.loadOptions||{},this.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 Fr,this._requestScheduler=new De.a({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 Br.a({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(t)}destroy(){this._destroy()}isLoaded(){return 0===this._pendingCount&&0!==this._frameNumber&&0===this._requestedTiles.length}get tiles(){return Object.values(this._tiles)}get frameNumber(){return this._frameNumber}get queryParams(){return this._queryParamsString||(this._queryParamsString=function(t){const e=[];for(const n of Object.keys(t))e.push("".concat(n,"=").concat(t[n]));switch(e.length){case 0:return"";case 1:return"?".concat(e[0]);default:return"?".concat(e.join("&"))}}(this._queryParams)),this._queryParamsString}setProps(t){this.options={...this.options,...t}}setOptions(t){this.options={...this.options,...t}}getTileUrl(t){return t.startsWith("data:")?t:"".concat(t).concat(this.queryParams)}hasExtension(t){return Boolean(this._extensionsUsed&&this._extensionsUsed.indexOf(t)>-1)}update(t=null){this.tilesetInitializationPromise.then(()=>{!t&&this.lastUpdatedVieports?t=this.lastUpdatedVieports:this.lastUpdatedVieports=t,t&&this.doUpdate(t)})}async selectTiles(t=null){return await this.tilesetInitializationPromise,t&&(this.lastUpdatedVieports=t),this.updatePromise||(this.updatePromise=new Promise(t=>{setTimeout(()=>{this.lastUpdatedVieports&&this.doUpdate(this.lastUpdatedVieports),t(this._frameNumber),this.updatePromise=null},this.options.debounceTime)})),this.updatePromise}doUpdate(t){if("loadTiles"in this.options&&!this.options.loadTiles)return;if(this.traverseCounter>0)return;const e=t instanceof Array?t:[t];this._cache.reset(),this._frameNumber++,this.traverseCounter=e.length;const n=[];for(const t of e){const e=t.id;this._needTraverse(e)?n.push(e):this.traverseCounter--}for(const t of e){const e=t.id;if(this.roots[e]||(this.roots[e]=this._initializeTileHeaders(this.tileset,null)),!n.includes(e))continue;const r=Gr(t,this._frameNumber);this._traverser.traverse(this.roots[e],r,this.options)}}_needTraverse(t){let e=t;return this.options.viewportTraversersMap&&(e=this.options.viewportTraversersMap[t]),e===t}_onTraversalEnd(t){const e=t.viewport.id;this.frameStateData[e]||(this.frameStateData[e]={selectedTiles:[],_requestedTiles:[],_emptyTiles:[]});const n=this.frameStateData[e],r=Object.values(this._traverser.selectedTiles),[i,o]=function(t,e,n){if(0===n||t.length<=n)return[t,[]];const r=[],{longitude:i,latitude:o}=e.viewport;for(const[e,n]of t.entries()){const[t,a]=n.header.mbs,s=Math.abs(i-t),u=Math.abs(o-a),c=Math.sqrt(u*u+s*s);r.push([e,c])}const a=r.sort((t,e)=>t[1]-e[1]),s=[];for(let e=0;e<n;e++)s.push(t[a[e][0]]);const u=[];for(let e=n;e<a.length;e++)u.push(t[a[e][0]]);return[s,u]}(r,t,this.options.maximumTilesSelected);n.selectedTiles=i;for(const t of o)t.unselect();n._requestedTiles=Object.values(this._traverser.requestedTiles),n._emptyTiles=Object.values(this._traverser.emptyTiles),this.traverseCounter--,this.traverseCounter>0||this._updateTiles()}_updateTiles(){this.selectedTiles=[],this._requestedTiles=[],this._emptyTiles=[];for(const t in this.frameStateData){const e=this.frameStateData[t];this.selectedTiles=this.selectedTiles.concat(e.selectedTiles),this._requestedTiles=this._requestedTiles.concat(e._requestedTiles),this._emptyTiles=this._emptyTiles.concat(e._emptyTiles)}this.selectedTiles=this.options.onTraversalComplete(this.selectedTiles);for(const t of this.selectedTiles)this._tiles[t.id]=t;this._loadTiles(),this._unloadTiles(),this._updateStats()}_tilesChanged(t,e){if(t.length!==e.length)return!0;const n=new Set(t.map(t=>t.id)),r=new Set(e.map(t=>t.id));let i=t.filter(t=>!r.has(t.id)).length>0;return i=i||e.filter(t=>!n.has(t.id)).length>0,i}_loadTiles(){for(const t of this._requestedTiles)t.contentUnloaded&&this._loadTile(t)}_unloadTiles(){this._cache.unloadTiles(this,(t,e)=>t._unloadTile(e))}_updateStats(){let t=0,e=0;for(const n of this.selectedTiles)n.contentAvailable&&n.content&&(t++,n.content.pointCount?e+=n.content.pointCount:e+=n.content.vertexCount);this.stats.get("Tiles In View").count=this.selectedTiles.length,this.stats.get("Tiles To Render").count=t,this.stats.get("Points/Vertices").count=e}async _initializeTileSet(t){this.type===oi&&(this.calculateViewPropsI3S(),t.root=await t.root),this.root=this._initializeTileHeaders(t,null),this.type===ai&&(this._initializeTiles3DTileset(t),this.calculateViewPropsTiles3D()),this.type===oi&&this._initializeI3STileset()}calculateViewPropsI3S(){var t;const e=this.tileset.fullExtent;if(e){const{xmin:t,xmax:n,ymin:r,ymax:i,zmin:o,zmax:a}=e;return this.cartographicCenter=new rt.a(t+(n-t)/2,r+(i-r)/2,o+(a-o)/2),this.cartesianCenter=Ir.WGS84.cartographicToCartesian(this.cartographicCenter,new rt.a),void(this.zoom=Xr(e,this.cartographicCenter,this.cartesianCenter))}const n=null===(t=this.tileset.store)||void 0===t?void 0:t.extent;if(n){const[t,e,r,i]=n;return this.cartographicCenter=new rt.a(t+(r-t)/2,e+(i-e)/2,0),this.cartesianCenter=Ir.WGS84.cartographicToCartesian(this.cartographicCenter,new rt.a),void(this.zoom=function(t,e,n){const[r,i,o,a]=t;return Xr({xmin:r,xmax:o,ymin:i,ymax:a,zmin:0,zmax:0},e,n)}(n,this.cartographicCenter,this.cartesianCenter))}console.warn("Extent is not defined in the tileset header"),this.cartographicCenter=new rt.a,this.zoom=1}calculateViewPropsTiles3D(){const t=this.root;Object(Rr.a)(t);const{center:e}=t.boundingVolume;if(!e)return console.warn("center was not pre-calculated for the root tile"),this.cartographicCenter=new rt.a,void(this.zoom=1);0!==e[0]||0!==e[1]||0!==e[2]?this.cartographicCenter=Ir.WGS84.cartesianToCartographic(e,new rt.a):this.cartographicCenter=new rt.a(0,0,-Ir.WGS84.radii[0]),this.cartesianCenter=e,this.zoom=qr(t.boundingVolume,this.cartographicCenter)}_initializeStats(){this.stats.get(ji),this.stats.get("Tiles Loading"),this.stats.get("Tiles In Memory"),this.stats.get("Tiles In View"),this.stats.get("Tiles To Render"),this.stats.get("Tiles Loaded"),this.stats.get("Tiles Unloaded"),this.stats.get("Failed Tile Loads"),this.stats.get("Points/Vertices","memory"),this.stats.get("Tile Memory Use","memory")}_initializeTileHeaders(t,e){const n=new Ci(this,t.root,e);if(e&&(e.children.push(n),n.depth=e.depth+1),this.type===ai){const t=[];for(t.push(n);t.length>0;){const e=t.pop();this.stats.get(ji).incrementCount();const n=e.header.children||[];for(const r of n){const n=new Ci(this,r,e);e.children.push(n),n.depth=e.depth+1,t.push(n)}}}return n}_initializeTraverser(){let t;switch(this.type){case ai:t=Pi;break;case oi:t=Li;break;default:t=Si}return new t({basePath:this.basePath,onTraversalEnd:this._onTraversalEnd.bind(this)})}_destroyTileHeaders(t){this._destroySubtree(t)}async _loadTile(t){let e;try{this._onStartTileLoading(),e=await t.loadContent()}catch(e){this._onTileLoadError(t,e)}finally{this._onEndTileLoading(),this._onTileLoad(t,e)}}_onTileLoadError(t,e){this.stats.get("Failed Tile Loads").incrementCount();const n=e.message||e.toString(),r=t.url;console.error("A 3D tile failed to load: ".concat(t.url," ").concat(n)),this.options.onTileError(t,n,r)}_onTileLoad(t,e){if(e){if(this.type===oi){var n,r;const t=(null===(n=this.tileset)||void 0===n||null===(r=n.nodePagesTile)||void 0===r?void 0:r.nodesInNodePages)||0;this.stats.get(ji).reset(),this.stats.get(ji).addCount(t)}t&&t.content&&function(t,e){Object(Rr.a)(t),Object(Rr.a)(e);const{rtcCenter:n,gltfUpAxis:r}=e,{computedTransform:i,boundingVolume:{center:o}}=t;let a=new Zt.a(i);switch(n&&a.translate(n),r){case"Z":break;case"Y":const t=(new Zt.a).rotateX(Math.PI/2);a=a.multiplyRight(t);break;case"X":const e=(new Zt.a).rotateY(-Math.PI/2);a=a.multiplyRight(e)}e.isQuantized&&a.translate(e.quantizedVolumeOffset).scale(e.quantizedVolumeScale);const s=new rt.a(o);e.cartesianModelMatrix=a,e.cartesianOrigin=s;const u=Ir.WGS84.cartesianToCartographic(s,new rt.a),c=Ir.WGS84.eastNorthUpToFixedFrame(s).invert();e.cartographicModelMatrix=c.multiplyRight(a),e.cartographicOrigin=u,e.coordinateSystem||(e.modelMatrix=e.cartographicModelMatrix)}(t,t.content),this._addTileToCache(t),this.options.onTileLoad(t)}}_onStartTileLoading(){this._pendingCount++,this.stats.get("Tiles Loading").incrementCount()}_onEndTileLoading(){this._pendingCount--,this.stats.get("Tiles Loading").decrementCount()}_addTileToCache(t){this._cache.add(this,t,e=>e._updateCacheStats(t))}_updateCacheStats(t){this.stats.get("Tiles Loaded").incrementCount(),this.stats.get("Tiles In Memory").incrementCount(),this.gpuMemoryUsageInBytes+=t.content.byteLength||0,this.stats.get("Tile Memory Use").count=this.gpuMemoryUsageInBytes}_unloadTile(t){this.gpuMemoryUsageInBytes-=t.content&&t.content.byteLength||0,this.stats.get("Tiles In Memory").decrementCount(),this.stats.get("Tiles Unloaded").incrementCount(),this.stats.get("Tile Memory Use").count=this.gpuMemoryUsageInBytes,this.options.onTileUnload(t),t.unloadContent()}_destroy(){const t=[];for(this.root&&t.push(this.root);t.length>0;){const e=t.pop();for(const n of e.children)t.push(n);this._destroyTile(e)}this.root=null}_destroySubtree(t){const e=t,n=[];for(n.push(e);n.length>0;){t=n.pop();for(const e of t.children)n.push(e);t!==e&&this._destroyTile(t)}e.children=[]}_destroyTile(t){this._cache.unloadTile(this,t),this._unloadTile(t),t.destroy()}_initializeTiles3DTileset(t){if(this.asset=t.asset,!this.asset)throw new Error("Tileset must have an asset property.");if("0.0"!==this.asset.version&&"1.0"!==this.asset.version)throw new Error("The tileset must be 3D Tiles version 0.0 or 1.0.");"tilesetVersion"in this.asset&&(this._queryParams.v=this.asset.tilesetVersion),this.credits={attributions:this.options.attributions||[]},this.description=this.options.description||"",this.properties=t.properties,this.geometricError=t.geometricError,this._extensionsUsed=t.extensionsUsed,this.extras=t.extras}_initializeI3STileset(){this.loadOptions.i3s&&"token"in this.loadOptions.i3s&&(this._queryParams.token=this.loadOptions.i3s.token)}}const zi={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect",GLTF:"glTF"};Object.keys(zi);function Ui(t,e,n){Object(Rr.a)(t instanceof ArrayBuffer);const r=new TextDecoder("utf8"),i=new Uint8Array(t,e,n);return r.decode(i)}var Ni=n(177);const Gi={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130},Vi={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,...Gi},Hi={[Gi.DOUBLE]:Float64Array,[Gi.FLOAT]:Float32Array,[Gi.UNSIGNED_SHORT]:Uint16Array,[Gi.UNSIGNED_INT]:Uint32Array,[Gi.UNSIGNED_BYTE]:Uint8Array,[Gi.BYTE]:Int8Array,[Gi.SHORT]:Int16Array,[Gi.INT]:Int32Array},Wi={DOUBLE:Gi.DOUBLE,FLOAT:Gi.FLOAT,UNSIGNED_SHORT:Gi.UNSIGNED_SHORT,UNSIGNED_INT:Gi.UNSIGNED_INT,UNSIGNED_BYTE:Gi.UNSIGNED_BYTE,BYTE:Gi.BYTE,SHORT:Gi.SHORT,INT:Gi.INT};class qi{static fromTypedArray(t){t=ArrayBuffer.isView(t)?t.constructor:t;for(const e in Hi){if(Hi[e]===t)return e}throw new Error("Failed to convert GL type")}static fromName(t){const e=Wi[t];if(!e)throw new Error("Failed to convert GL type");return e}static getArrayType(t){switch(t){case Gi.UNSIGNED_SHORT_5_6_5:case Gi.UNSIGNED_SHORT_4_4_4_4:case Gi.UNSIGNED_SHORT_5_5_5_1:return Uint16Array;default:const e=Hi[t];if(!e)throw new Error("Failed to convert GL type");return e}}static getByteSize(t){return qi.getArrayType(t).BYTES_PER_ELEMENT}static validate(t){return Boolean(qi.getArrayType(t))}static createTypedArray(t,e,n=0,r){void 0===r&&(r=(e.byteLength-n)/qi.getByteSize(t));return new(qi.getArrayType(t))(e,n,r)}}class Xi{constructor(t,e){Object(cr.a)(this,"json",void 0),Object(cr.a)(this,"buffer",void 0),Object(cr.a)(this,"featuresLength",0),Object(cr.a)(this,"_cachedTypedArrays",{}),this.json=t,this.buffer=e}getExtension(t){return this.json.extensions&&this.json.extensions[t]}hasProperty(t){return Boolean(this.json[t])}getGlobalProperty(t,e=Vi.UNSIGNED_INT,n=1){const r=this.json[t];return r&&Number.isFinite(r.byteOffset)?this._getTypedArrayFromBinary(t,e,n,1,r.byteOffset):r}getPropertyArray(t,e,n){const r=this.json[t];return r&&Number.isFinite(r.byteOffset)?("componentType"in r&&(e=qi.fromName(r.componentType)),this._getTypedArrayFromBinary(t,e,n,this.featuresLength,r.byteOffset)):this._getTypedArrayFromArray(t,e,r)}getProperty(t,e,n,r,i){const o=this.json[t];if(!o)return o;const a=this.getPropertyArray(t,e,n);if(1===n)return a[r];for(let t=0;t<n;++t)i[t]=a[n*r+t];return i}_getTypedArrayFromBinary(t,e,n,r,i){const o=this._cachedTypedArrays;let a=o[t];return a||(a=qi.createTypedArray(e,this.buffer.buffer,this.buffer.byteOffset+i,r*n),o[t]=a),a}_getTypedArrayFromArray(t,e,n){const r=this._cachedTypedArrays;let i=r[t];return i||(i=qi.createTypedArray(e,n),r[t]=i),i}}const Ji={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Zi={SCALAR:(t,e)=>t[e],VEC2:(t,e)=>[t[2*e+0],t[2*e+1]],VEC3:(t,e)=>[t[3*e+0],t[3*e+1],t[3*e+2]],VEC4:(t,e)=>[t[4*e+0],t[4*e+1],t[4*e+2],t[4*e+3]],MAT2:(t,e)=>[t[4*e+0],t[4*e+1],t[4*e+2],t[4*e+3]],MAT3:(t,e)=>[t[9*e+0],t[9*e+1],t[9*e+2],t[9*e+3],t[9*e+4],t[9*e+5],t[9*e+6],t[9*e+7],t[9*e+8]],MAT4:(t,e)=>[t[16*e+0],t[16*e+1],t[16*e+2],t[16*e+3],t[16*e+4],t[16*e+5],t[16*e+6],t[16*e+7],t[16*e+8],t[16*e+9],t[16*e+10],t[16*e+11],t[16*e+12],t[16*e+13],t[16*e+14],t[16*e+15]]},Qi={SCALAR:(t,e,n)=>{e[n]=t},VEC2:(t,e,n)=>{e[2*n+0]=t[0],e[2*n+1]=t[1]},VEC3:(t,e,n)=>{e[3*n+0]=t[0],e[3*n+1]=t[1],e[3*n+2]=t[2]},VEC4:(t,e,n)=>{e[4*n+0]=t[0],e[4*n+1]=t[1],e[4*n+2]=t[2],e[4*n+3]=t[3]},MAT2:(t,e,n)=>{e[4*n+0]=t[0],e[4*n+1]=t[1],e[4*n+2]=t[2],e[4*n+3]=t[3]},MAT3:(t,e,n)=>{e[9*n+0]=t[0],e[9*n+1]=t[1],e[9*n+2]=t[2],e[9*n+3]=t[3],e[9*n+4]=t[4],e[9*n+5]=t[5],e[9*n+6]=t[6],e[9*n+7]=t[7],e[9*n+8]=t[8],e[9*n+9]=t[9]},MAT4:(t,e,n)=>{e[16*n+0]=t[0],e[16*n+1]=t[1],e[16*n+2]=t[2],e[16*n+3]=t[3],e[16*n+4]=t[4],e[16*n+5]=t[5],e[16*n+6]=t[6],e[16*n+7]=t[7],e[16*n+8]=t[8],e[16*n+9]=t[9],e[16*n+10]=t[10],e[16*n+11]=t[11],e[16*n+12]=t[12],e[16*n+13]=t[13],e[16*n+14]=t[14],e[16*n+15]=t[15]}};const Ki=t=>void 0!==t;function Yi(t,e,n){if(!e)return null;let r=t.getExtension("3DTILES_batch_table_hierarchy");const 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){let n,r,i;const o=t.instancesLength,a=t.classes;let s,u=t.classIds,c=t.parentCounts,l=t.parentIds,h=o;Ki(u.byteOffset)&&(u.componentType=defaultValue(u.componentType,GL.UNSIGNED_SHORT),u.type=AttributeType.SCALAR,i=getBinaryAccessor(u),u=i.createArrayBufferView(e.buffer,e.byteOffset+u.byteOffset,o));if(Ki(c))for(Ki(c.byteOffset)&&(c.componentType=defaultValue(c.componentType,GL.UNSIGNED_SHORT),c.type=AttributeType.SCALAR,i=getBinaryAccessor(c),c=i.createArrayBufferView(e.buffer,e.byteOffset+c.byteOffset,o)),s=new Uint16Array(o),h=0,n=0;n<o;++n)s[n]=h,h+=c[n];Ki(l)&&Ki(l.byteOffset)&&(l.componentType=defaultValue(l.componentType,GL.UNSIGNED_SHORT),l.type=AttributeType.SCALAR,i=getBinaryAccessor(l),l=i.createArrayBufferView(e.buffer,e.byteOffset+l.byteOffset,h));const f=a.length;for(n=0;n<f;++n){const t=a[n].length,r=a[n].instances,i=getBinaryProperties(t,r,e);a[n].instances=combine(i,r)}const p=new Array(f).fill(0),d=new Uint16Array(o);for(n=0;n<o;++n)r=u[n],d[n]=p[r],++p[r];const A={classes:a,classIds:u,classIndexes:d,parentCounts:c,parentIndexes:s,parentIds:l};return function(t){const e=t.classIds.length;for(let n=0;n<e;++n)to(t,n,stack)}(A),A}(r,n):null}function $i(t,e,n){if(!t)return;const r=t.parentCounts;return t.parentIds?n(t,e):r>0?function(t,e,n){const r=t.classIds,i=t.parentCounts,o=t.parentIds,a=t.parentIndexes,s=r.length,u=scratchVisited;u.length=Math.max(u.length,s);const c=++marker,l=scratchStack;l.length=0,l.push(e);for(;l.length>0;){if(e=l.pop(),u[e]===c)continue;u[e]=c;const r=n(t,e);if(Ki(r))return r;const s=i[e],h=a[e];for(let t=0;t<s;++t){const n=o[h+t];n!==e&&l.push(n)}}return null}(t,e,n):function(t,e,n){let r=!0;for(;r;){const i=n(t,e);if(Ki(i))return i;const o=t.parentIds[e];r=o!==e,e=o}throw new Error("traverseHierarchySingleParent")}(t,e,n)}function to(t,e,n){const r=t.parentCounts,i=t.parentIds,o=t.parentIndexes,a=t.classIds.length;if(!Ki(i))return;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);const s=Ki(r)?r[e]:1,u=Ki(r)?o[e]:e;for(let r=0;r<s;++r){const o=i[u+r];o!==e&&to(t,o,n)}n.pop(e)}function eo(t){return null!=t}const no=(t,e)=>t,ro={HIERARCHY:!0,extensions:!0,extras:!0};class io{constructor(t,e,n,r={}){var i;Object(cr.a)(this,"json",void 0),Object(cr.a)(this,"binary",void 0),Object(cr.a)(this,"featureCount",void 0),Object(cr.a)(this,"_extensions",void 0),Object(cr.a)(this,"_properties",void 0),Object(cr.a)(this,"_binaryProperties",void 0),Object(cr.a)(this,"_hierarchy",void 0),Object(Rr.a)(n>=0),this.json=t||{},this.binary=e,this.featureCount=n,this._extensions=(null===(i=this.json)||void 0===i?void 0:i.extensions)||{},this._properties={};for(const t in this.json)ro[t]||(this._properties[t]=this.json[t]);this._binaryProperties=this._initializeBinaryProperties(),r["3DTILES_batch_table_hierarchy"]&&(this._hierarchy=Yi(this,this.json,this.binary))}getExtension(t){return this.json&&this.json.extensions&&this.json.extensions[t]}memorySizeInBytes(){return 0}isClass(t,e){if(this._checkBatchId(t),Object(Rr.a)("string"==typeof e,e),this._hierarchy){return eo($i(this._hierarchy,t,(t,n)=>{const r=t.classIds[n];return t.classes[r].name===e}))}return!1}isExactClass(t,e){return Object(Rr.a)("string"==typeof e,e),this.getExactClassName(t)===e}getExactClassName(t){if(this._checkBatchId(t),this._hierarchy){const e=this._hierarchy.classIds[t];return this._hierarchy.classes[e].name}}hasProperty(t,e){return this._checkBatchId(t),Object(Rr.a)("string"==typeof e,e),eo(this._properties[e])||this._hasPropertyInHierarchy(t,e)}getPropertyNames(t,e){this._checkBatchId(t),(e=eo(e)?e:[]).length=0;const n=Object.keys(this._properties);return e.push(...n),this._hierarchy&&this._getPropertyNamesInHierarchy(t,e),e}getProperty(t,e){if(this._checkBatchId(t),Object(Rr.a)("string"==typeof e,e),this._binaryProperties){const n=this._binaryProperties[e];if(eo(n))return this._getBinaryProperty(n,t)}const n=this._properties[e];if(eo(n))return no(n[t]);if(this._hierarchy){const n=this._getHierarchyProperty(t,e);if(eo(n))return n}}setProperty(t,e,n){const r=this.featureCount;if(this._checkBatchId(t),Object(Rr.a)("string"==typeof e,e),this._binaryProperties){const r=this._binaryProperties[e];if(r)return void this._setBinaryProperty(r,t,n)}if(this._hierarchy&&this._setHierarchyProperty(this,t,e,n))return;let i=this._properties[e];eo(i)||(this._properties[e]=new Array(r),i=this._properties[e]),i[t]=no(n)}_checkBatchId(t){if(!(t>=0&&t<this.featureCount))throw new Error("batchId not in range [0, featureCount - 1].")}_getBinaryProperty(t,e){return t.unpack(t.typedArray,e)}_setBinaryProperty(t,e,n){t.pack(n,t.typedArray,e)}_initializeBinaryProperties(){let t=null;for(const e in this._properties){const n=this._properties[e],r=this._initializeBinaryProperty(e,n);r&&(t=t||{},t[e]=r)}return t}_initializeBinaryProperty(t,e){if("byteOffset"in e){const n=e;Object(Rr.a)(this.binary,"Property ".concat(t," requires a batch table binary.")),Object(Rr.a)(n.type,"Property ".concat(t," requires a type."));const r=function(t,e,n,r){const{componentType:i}=t;Object(Rr.a)(t.componentType);const o="string"==typeof i?qi.fromName(i):i,a=Ji[t.type],s=Zi[t.type],u=Qi[t.type];return n+=t.byteOffset,{values:qi.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}_hasPropertyInHierarchy(t,e){if(!this._hierarchy)return!1;const n=$i(this._hierarchy,t,(t,n)=>{const r=t.classIds[n];return eo(t.classes[r].instances[e])});return eo(n)}_getPropertyNamesInHierarchy(t,e){$i(this._hierarchy,t,(t,n)=>{const r=t.classIds[n],i=t.classes[r].instances;for(const t in i)i.hasOwnProperty(t)&&-1===e.indexOf(t)&&e.push(t)})}_getHierarchyProperty(t,e){return $i(this._hierarchy,t,(t,n)=>{const r=t.classIds[n],i=t.classes[r],o=t.classIndexes[n],a=i.instances[e];return eo(a)?eo(a.typedArray)?this._getBinaryProperty(a,o):no(a[o]):null})}_setHierarchyProperty(t,e,n,r){const i=$i(this._hierarchy,e,(t,i)=>{const o=t.classIds[i],a=t.classes[o],s=t.classIndexes[i],u=a.instances[n];return!!eo(u)&&(Object(Rr.a)(i===e,'Inherited property "'.concat(n,'" is read-only.')),eo(u.typedArray)?this._setBinaryProperty(u,s,r):u[s]=no(r),!0)});return eo(i)}}function oo(t,e,n=0){const r=new DataView(e);if(t.magic=r.getUint32(n,!0),n+=4,t.version=r.getUint32(n,!0),n+=4,t.byteLength=r.getUint32(n,!0),n+=4,1!==t.version)throw new Error("3D Tile Version ".concat(t.version," not supported"));return n}function ao(t,e,n){const r=new DataView(e);let i;t.header=t.header||{};let o=r.getUint32(n,!0);n+=4;let a=r.getUint32(n,!0);n+=4;let s=r.getUint32(n,!0);n+=4;let u=r.getUint32(n,!0);return n+=4,s>=570425344?(n-=8,i=o,s=a,u=0,o=0,a=0,console.warn("b3dm tile in legacy format.")):u>=570425344&&(n-=4,i=s,s=o,u=a,o=0,a=0,console.warn("b3dm tile in legacy format.")),t.header.featureTableJsonByteLength=o,t.header.featureTableBinaryByteLength=a,t.header.batchTableJsonByteLength=s,t.header.batchTableBinaryByteLength=u,t.header.batchLength=i,n}function so(t,e,n,r){return n=function(t,e,n,r){const{featureTableJsonByteLength:i,featureTableBinaryByteLength:o,batchLength:a}=t.header;if(t.featureTableJson={BATCH_LENGTH:a||0},i>0){const r=Ui(e,n,i);t.featureTableJson=JSON.parse(r)}return n+=i,t.featureTableBinary=new Uint8Array(e,n,o),n+=o}(t,e,n),n=function(t,e,n,r){const{batchTableJsonByteLength:i,batchTableBinaryByteLength:o}=t.header;if(i>0){const r=Ui(e,n,i);t.batchTableJson=JSON.parse(r),n+=i,o>0&&(t.batchTableBinary=new Uint8Array(e,n,o),t.batchTableBinary=new Uint8Array(t.batchTableBinary),n+=o)}return n}(t,e,n)}function uo(t,e=[0,0,0]){const 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 co(t,e,n){if(!(e||t&&t.batchIds&&n))return null;const{batchIds:r,isRGB565:i,pointCount:o}=t;if(r&&n){const t=new Uint8ClampedArray(3*o);for(let e=0;e<o;e++){const i=r[e],o=n.getProperty(i,"dimensions").map(t=>255*t);t[3*e]=o[0],t[3*e+1]=o[1],t[3*e+2]=o[2]}return{type:Vi.UNSIGNED_BYTE,value:t,size:3,normalized:!0}}if(i){const t=new Uint8ClampedArray(3*o);for(let n=0;n<o;n++){const r=uo(e[n]);t[3*n]=r[0],t[3*n+1]=r[1],t[3*n+2]=r[2]}return{type:Vi.UNSIGNED_BYTE,value:t,size:3,normalized:!0}}return e&&e.length===3*o?{type:Vi.UNSIGNED_BYTE,value:e,size:3,normalized:!0}:{type:Vi.UNSIGNED_BYTE,value:e,size:4,normalized:!0}}function lo(t,e){if(!t)throw new Error("math.gl assertion failed. ".concat(e))}new Qt.a,new rt.a,new Qt.a,new Qt.a,new Uint8Array(1);function ho(t,e=255){return Object(Nt.a)(t,0,e)/e*2-1}function fo(t){return t<0?-1:1}function po(t,e,n,r){if(lo(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=ho(t,n),r.y=ho(e,n),r.z=1-(Math.abs(r.x)+Math.abs(r.y)),r.z<0){const t=r.x;r.x=(1-Math.abs(r.y))*fo(t),r.y=(1-Math.abs(t))*fo(r.y)}return r.normalize()}function Ao(t,e,n){return po(t,e,255,n)}const go=new rt.a;function mo(t,e,n){return t.isQuantized?n["3d-tiles"]&&n["3d-tiles"].decodeQuantizedPositions?(t.isQuantized=!1,function(t,e){const n=new rt.a,r=new Float32Array(3*t.pointCount);for(let 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:Vi.UNSIGNED_SHORT,value:e,size:3,normalized:!0}:e}async function yo(t,e,n,r,i){n=so(t,e,n=ao(t,e,n=oo(t,e,n))),function(t){t.attributes={positions:null,colors:null,normals:null,batchIds:null},t.isQuantized=!1,t.isTranslucent=!1,t.isRGB565=!1,t.isOctEncoded16P=!1}(t);const{featureTable:o,batchTable:a}=function(t){const e=new Xi(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",Vi.FLOAT,3);const r=function(t,e){let n=null;if(!t.batchIds&&e.hasProperty("BATCH_ID")&&(t.batchIds=e.getPropertyArray("BATCH_ID",Vi.UNSIGNED_SHORT,1),t.batchIds)){const r=e.getGlobalProperty("BATCH_LENGTH");if(!r)throw new Error("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");const{batchTableJson:i,batchTableBinary:o}=t;n=new io(i,o,r)}return n}(t,e);return{featureTable:e,batchTable:r}}(t);return await async function(t,e,n,r,i){let o,a,s;const u=t.batchTableJson&&t.batchTableJson.extensions&&t.batchTableJson.extensions["3DTILES_draco_point_compression"];u&&(s=u.properties);const c=e.getExtension("3DTILES_draco_point_compression");if(c){a=c.properties;const e=c.byteOffset,n=c.byteLength;if(!a||!Number.isFinite(e)||!n)throw new Error("Draco properties, byteOffset, and byteLength must be defined");o=t.featureTableBinary.slice(e,e+n),t.hasPositions=Number.isFinite(a.POSITION),t.hasColors=Number.isFinite(a.RGB)||Number.isFinite(a.RGBA),t.hasNormals=Number.isFinite(a.NORMAL),t.hasBatchIds=Number.isFinite(a.BATCH_ID),t.isTranslucent=Number.isFinite(a.RGBA)}if(!o)return!0;const l={buffer:o,properties:{...a,...s},featureTableProperties:a,batchTableProperties:s,dequantizeInShader:!1};return await async function(t,e,n,r){const{parse:i}=r,o={...n,draco:{...n.draco,extraAttributes:e.batchTableProperties||{}}};delete o["3d-tiles"];const a=await i(e.buffer,Ni.a,o),s=a.attributes.POSITION&&a.attributes.POSITION.value,u=a.attributes.COLOR_0&&a.attributes.COLOR_0.value,c=a.attributes.NORMAL&&a.attributes.NORMAL.value,l=a.attributes.BATCH_ID&&a.attributes.BATCH_ID.value,h=s&&a.attributes.POSITION.value.quantization,f=c&&a.attributes.NORMAL.value.quantization;if(h){const e=a.POSITION.data.quantization,n=e.range;t.quantizedVolumeScale=new rt.a(n,n,n),t.quantizedVolumeOffset=new rt.a(e.minValues),t.quantizedRange=(1<<e.quantizationBits)-1,t.isQuantizedDraco=!0}f&&(t.octEncodedRange=(1<<a.NORMAL.data.quantization.quantizationBits)-1,t.isOctEncodedDraco=!0);const p={};if(e.batchTableProperties)for(const t of Object.keys(e.batchTableProperties))a.attributes[t]&&a.attributes[t].value&&(p[t.toLowerCase()]=a.attributes[t].value);t.attributes={positions:s,colors:co(t,u,void 0),normals:c,batchIds:l,...p}}(t,l,r,i)}(t,o,0,r,i),function(t,e,n){if(!t.attributes.positions)if(e.hasProperty("POSITION"))t.attributes.positions=e.getPropertyArray("POSITION",Vi.FLOAT,3);else if(e.hasProperty("POSITION_QUANTIZED")){const r=e.getPropertyArray("POSITION_QUANTIZED",Vi.UNSIGNED_SHORT,3);if(t.isQuantized=!0,t.quantizedRange=65535,t.quantizedVolumeScale=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Vi.FLOAT,3),!t.quantizedVolumeScale)throw new Error("QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");if(t.quantizedVolumeOffset=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Vi.FLOAT,3),!t.quantizedVolumeOffset)throw new Error("QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");t.attributes.positions=mo(t,r,n)}if(!t.attributes.positions)throw new Error("Either POSITION or POSITION_QUANTIZED must be defined.")}(t,o,r),function(t,e,n){if(!t.attributes.colors){let r=null;e.hasProperty("RGBA")?(r=e.getPropertyArray("RGBA",Vi.UNSIGNED_BYTE,4),t.isTranslucent=!0):e.hasProperty("RGB")?r=e.getPropertyArray("RGB",Vi.UNSIGNED_BYTE,3):e.hasProperty("RGB565")&&(r=e.getPropertyArray("RGB565",Vi.UNSIGNED_SHORT,1),t.isRGB565=!0),t.attributes.colors=co(t,r,n)}e.hasProperty("CONSTANT_RGBA")&&(t.constantRGBA=e.getGlobalProperty("CONSTANT_RGBA",Vi.UNSIGNED_BYTE,4))}(t,o,a),function(t,e){if(!t.attributes.normals){let n=null;e.hasProperty("NORMAL")?n=e.getPropertyArray("NORMAL",Vi.FLOAT,3):e.hasProperty("NORMAL_OCT16P")&&(n=e.getPropertyArray("NORMAL_OCT16P",Vi.UNSIGNED_BYTE,2),t.isOctEncoded16P=!0),t.attributes.normals=function(t,e){if(!e)return null;if(t.isOctEncoded16P){const n=new Float32Array(3*t.pointsLength);for(let r=0;r<t.pointsLength;r++)Ao(e[2*r],e[2*r+1],go),go.toArray(n,3*r);return{type:Vi.FLOAT,size:2,value:n}}return{type:Vi.FLOAT,size:2,value:e}}(t,n)}}(t,o),n}var vo=n(290),_o=n(83);const bo=0,xo=1;function wo(t,e,n,r){t.rotateYtoZ=!0;const 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=Object(_o.c)(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}async function Eo(t,e,n,r){const i=n["3d-tiles"]||{};if(function(t,e,n){switch(e){case bo:const e=new Uint8Array(t.gltfArrayBuffer,t.gltfByteOffset),n=(new TextDecoder).decode(e);t.gltfUrl=n.replace(/[\s\0]+$/,""),delete t.gltfArrayBuffer,delete t.gltfByteOffset,delete t.gltfByteLength;break;case xo:break;default:throw new Error("b3dm: Illegal glTF format field")}}(t,e),i.loadGLTF){const{parse:e,fetch:i}=r;t.gltfUrl&&(t.gltfArrayBuffer=await i(t.gltfUrl,n),t.gltfByteOffset=0),t.gltfArrayBuffer&&(t.gltf=await e(t.gltfArrayBuffer,vo.a,n,r),delete t.gltfArrayBuffer,delete t.gltfByteOffset,delete t.gltfByteLength)}}async function Oo(t,e,n,r,i){var o;n=function(t,e,n,r,i){n=oo(t,e,n),n=ao(t,e,n),n=so(t,e,n),n=wo(t,e,n,r);const o=new Xi(t.featureTableJson,t.featureTableBinary);return t.rtcCenter=o.getGlobalProperty("RTC_CENTER",Vi.FLOAT,3),n}(t,e,n,r),await Eo(t,xo,r,i);const a=null==t||null===(o=t.gltf)||void 0===o?void 0:o.extensions;return a&&a.CESIUM_RTC&&(t.rtcCenter=a.CESIUM_RTC.center),n}async function So(t,e,n,r,i){return n=function(t,e,n,r,i){if(n=oo(t,e,n),1!==t.version)throw new Error("Instanced 3D Model version ".concat(t.version," is not supported"));n=ao(t,e,n);const o=new DataView(e);if(t.gltfFormat=o.getUint32(n,!0),n=so(t,e,n+=4),n=wo(t,e,n,r),0===t.featureTableJsonByteLength)throw new Error("i3dm parser: featureTableJsonByteLength is zero.");const a=new Xi(t.featureTableJson,t.featureTableBinary),s=a.getGlobalProperty("INSTANCES_LENGTH");if(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",Vi.FLOAT,3);new io(t.batchTableJson,t.batchTableBinary,s);return function(t,e,n,r){const i=[new Array(r),t._batchTable][0],o=new rt.a,a=new rt.a,s=new rt.a,u=new rt.a,c=new vt,l=new xt.a,h=new rt.a,f={},p=new Zt.a,d=[],A=[],g=new rt.a,m=new rt.a;for(let n=0;n<r;n++){let r;if(e.hasProperty("POSITION"))r=e.getProperty("POSITION",Vi.FLOAT,3,n,o);else if(e.hasProperty("POSITION_QUANTIZED")){r=e.getProperty("POSITION_QUANTIZED",Vi.UNSIGNED_SHORT,3,n,o);const t=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Vi.FLOAT,3,g);if(!t)throw new Error("i3dm parser: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");const i=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Vi.FLOAT,3,m);if(!i)throw new Error("i3dm parser: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");const a=65535;for(let e=0;e<3;e++)r[e]=r[e]/a*i[e]+t[e]}if(!r)throw new Error("i3dm: POSITION or POSITION_QUANTIZED must be defined for each instance.");o.copy(r),f.translation=o,t.normalUp=e.getProperty("NORMAL_UP",Vi.FLOAT,3,n,d),t.normalRight=e.getProperty("NORMAL_RIGHT",Vi.FLOAT,3,n,A);const y=!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",Vi.UNSIGNED_SHORT,2,d),t.octNormalRight=e.getProperty("NORMAL_RIGHT_OCT32P",Vi.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?(Ir.WGS84.eastNorthUpToFixedFrame(o,p),p.getRotationMatrix3(c)):c.identity()}y&&(u.copy(a).cross(s).normalize(),c.setColumn(0,a),c.setColumn(1,s),c.setColumn(2,u)),l.fromMatrix3(c),f.rotation=l,h.set(1,1,1);const v=e.getProperty("SCALE",Vi.FLOAT,1,n);Number.isFinite(v)&&h.multiplyByScalar(v);const _=e.getProperty("SCALE_NON_UNIFORM",Vi.FLOAT,3,n,d);_&&h.scale(_),f.scale=h;let b=e.getProperty("BATCH_ID",Vi.UNSIGNED_SHORT,1,n);void 0===b&&(b=n);const x=(new Zt.a).fromQuaternion(f.rotation);p.identity(),p.translate(f.translation),p.multiplyRight(x),p.scale(f.scale);const w=p.clone();i[n]={modelMatrix:w,batchId:b}}t.instances=i}(t,a,0,s),n}(t,e,n,r),await Eo(t,t.gltfFormat,r,i),n}async function To(t,e=0,n,r,i={}){switch(i.byteOffset=e,i.type=function(t,e=0){const n=new DataView(t);return"".concat(String.fromCharCode(n.getUint8(e+0))).concat(String.fromCharCode(n.getUint8(e+1))).concat(String.fromCharCode(n.getUint8(e+2))).concat(String.fromCharCode(n.getUint8(e+3)))}(t,e),i.type){case zi.COMPOSITE:return await async function(t,e,n,r,i,o){n=oo(t,e,n);const a=new DataView(e);for(t.tilesLength=a.getUint32(n,!0),n+=4,t.tiles=[];t.tiles.length<t.tilesLength&&t.byteLength-n>12;){const a={};t.tiles.push(a),n=await o(e,n,r,i,a)}return n}(i,t,e,n,r,To);case zi.BATCHED_3D_MODEL:return await Oo(i,t,e,n,r);case zi.GLTF:return await async function(t,e,n,r){t.rotateYtoZ=!0,t.gltfUpAxis=n["3d-tiles"]&&n["3d-tiles"].assetGltfUpAxis?n["3d-tiles"].assetGltfUpAxis:"Y";const{parse:i}=r;t.gltf=await i(e,vo.a,n,r)}(i,t,n,r);case zi.INSTANCED_3D_MODEL:return await So(i,t,e,n,r);case zi.POINT_CLOUD:return await yo(i,t,e,n,r);default:throw new Error("3DTileLoader: unknown type ".concat(i.type))}}var Co=n(98);async function Po(t,e,n){const r=t[e].bufferView,i=t.bufferViews[r],o=t.buffers[i.buffer];if(o.uri){const t=await Object(Co.a)(o.uri),e=await t.arrayBuffer();return new Uint8Array(e,i.byteOffset,i.byteLength)}return new Uint8Array(n,i.byteOffset,i.byteLength)}function Mo(t){const e=new DataView(t);return e.getUint32(0,!0)+2**32*e.getUint32(4,!0)}const Io={id:"3d-tiles-subtree",name:"3D Tiles Subtree",module:"3d-tiles",version:"3.2.10",extensions:["subtree"],mimeTypes:["application/octet-stream"],tests:["subtree"],parse:async function(t){if(1952609651!==new Uint32Array(t.slice(0,4))[0])throw new Error("Wrong subtree file magic number");if(1!==new Uint32Array(t.slice(4,8))[0])throw new Error("Wrong subtree file verson, must be 1");const e=Mo(t.slice(8,16)),n=new Uint8Array(t,24,e),r=new TextDecoder("utf8").decode(n),i=JSON.parse(r),o=Mo(t.slice(16,24));let a=new ArrayBuffer(0);return o&&(a=t.slice(24+e)),"bufferView"in i.tileAvailability&&(i.tileAvailability.explicitBitstream=await Po(i,"tileAvailability",a)),"bufferView"in i.contentAvailability&&(i.contentAvailability.explicitBitstream=await Po(i,"contentAvailability",a)),"bufferView"in i.childSubtreeAvailability&&(i.childSubtreeAvailability.explicitBitstream=await Po(i,"childSubtreeAvailability",a)),i},options:{}},Bo={QUADTREE:4,OCTREE:8};function Ro(t,e){return"constant"in t?Boolean(t.constant):!!t.explicitBitstream&&function(t,e){const n=Math.floor(t/8),r=t%8;return 1==(e[n]>>r&1)}(e,t.explicitBitstream)}function ko(t,e,n,r){const{basePath:i,refine:o,getRefine:a,lodMetricType:s,getTileType:u,rootLodMetricValue:c,rootBoundingVolume:l}=r,h=t.contentUrl&&t.contentUrl.replace("".concat(i,"/"),""),f=c/2**e,p=function(t,e,n){if(e.region){const{childTileX:r,childTileY:i,childTileZ:o}=n,[a,s,u,c,l,h]=e.region,f=2**t,p=(u-a)/f,d=(c-s)/f,A=(h-l)/f,[g,m]=[a+p*r,a+p*(r+1)],[y,v]=[s+d*i,s+d*(i+1)],[_,b]=[l+A*o,l+A*(o+1)];return{region:[g,y,m,v,_,b]}}return console.warn("Unsupported bounding volume type: ",e),null}(e,l,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 Lo(t,e){return parseInt(t.toString(2)+e.toString(2),2)}function Do(t,e,n,r,i){const o=function(t){const e={};for(const n in t)e["{".concat(n,"}")]=t[n];return e}({level:e,x:n,y:r,z:i});return t.replace(/{level}|{x}|{y}|{z}/gi,t=>o[t])}function jo(t){if(!t.contentUrl)return ei;const e=t.contentUrl.split(".").pop();switch(e){case"pnts":return ri;case"i3dm":case"b3dm":case"glb":case"gltf":return ni;default:return e}}function Fo(t){switch(t){case"REPLACE":case"replace":return ti;case"ADD":case"add":return $r;default:return t}}function zo(t,e){if(/^[a-z][0-9a-z+.-]*:/i.test(e)){const n=new URL(t,"".concat(e,"/"));return decodeURI(n.toString())}return t.startsWith("/")?t:"".concat(e,"/").concat(t)}function Uo(t,e){if(!t)return null;if(t.content){const n=t.content.uri||t.content.url;t.contentUrl=zo(n,e.basePath)}return t.id=t.contentUrl,t.lodMetricType=si,t.lodMetricValue=t.geometricError,t.transformMatrix=t.transform,t.type=jo(t),t.refine=Fo(t.refine),t}async function No(t){if(!t.root)return null;const e=t.basePath,n=t.root.extensions["3DTILES_implicit_tiling"],{subdivisionScheme:r,maximumLevel:i,subtreeLevels:o,subtrees:{uri:a}}=n,s=zo(Do(a,0,0,0,0),e),u=await Object(ur.a)(s,Io),c=zo(t.root.content.uri,e),l=t.root.refine,h=t.root.geometricError,f=t.root.boundingVolume,p={contentUrlTemplate:c,subtreesUriTemplate:a,subdivisionScheme:r,subtreeLevels:o,maximumLevel:i,refine:l,basePath:e,lodMetricType:si,rootLodMetricValue:h,rootBoundingVolume:f,getTileType:jo,getRefine:Fo};return await async function(t,e,n){if(!t)return null;t.lodMetricType=si,t.lodMetricValue=t.geometricError,t.transformMatrix=t.transform;const{children:r,contentUrl:i}=await async function t(e){const{options:n,parentData:r={mortonIndex:0,x:0,y:0,z:0},childIndex:i=0,globalData:o={level:0,mortonIndex:0,x:0,y:0,z:0}}=e;let{subtree:a,level:s=0}=e;const{subdivisionScheme:u,subtreeLevels:c,maximumLevel:l,contentUrlTemplate:h,subtreesUriTemplate:f,basePath:p}=n,d={children:[],lodMetricValue:0,contentUrl:""},A=Bo[u],g=1&i,m=i>>1&1,y=i>>2&1,v=(A**s-1)/(A-1);let _=Lo(r.mortonIndex,i),b=v+_,x=Lo(r.x,g),w=Lo(r.y,m),E=Lo(r.z,y),O=!1;s+1>c&&(O=Ro(a.childSubtreeAvailability,_));const S=Lo(o.x,x),T=Lo(o.y,w),C=Lo(o.z,E),P=s+o.level;if(O){const t=Do("".concat(p,"/").concat(f),P,S,T,C);a=await Object(ur.a)(t,Io),o.mortonIndex=_,o.x=x,o.y=w,o.z=E,o.level=s,_=0,b=0,x=0,w=0,E=0,s=0}if(!Ro(a.tileAvailability,b)||s>l)return d;Ro(a.contentAvailability,b)&&(d.contentUrl=Do(h,P,S,T,C));const M=s+1,I={mortonIndex:_,x:x,y:w,z:E};for(let e=0;e<A;e++){const r=await t({subtree:a,options:n,parentData:I,childIndex:e,level:M,globalData:o});if(r.contentUrl||r.children.length){const t=ko(r,P+1,{childTileX:x,childTileY:w,childTileZ:E},n);d.children.push(t)}}return d}({subtree:e,options:n});i&&(t.contentUrl=i,t.content={uri:i.replace("".concat(n.basePath,"/"),"")});return t.refine=Fo(t.refine),t.type=jo(t),t.children=r,t.id=t.contentUrl,t}(t.root,u,p)}const Go={id:"3d-tiles",name:"3D Tiles",module:"3d-tiles",version:"3.2.10",extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],tests:["cmpt","pnts","b3dm","i3dm"],parse:async function(t,e,n){const r=e["3d-tiles"]||{};let i;i="auto"===r.isTileset?n.url&&-1!==n.url.indexOf(".json"):r.isTileset;t=i?await async function(t,e,n){var r;const i=JSON.parse((new TextDecoder).decode(t));return i.loader=e.loader||Go,i.url=n.url,i.basePath=function(t){return kr.b.dirname(t.url)}(i),i.root=function(t){var e,n;return(null==t||null===(e=t.extensionsRequired)||void 0===e?void 0:e.includes("3DTILES_implicit_tiling"))&&(null==t||null===(n=t.extensionsUsed)||void 0===n?void 0:n.includes("3DTILES_implicit_tiling"))}(i)?await No(i):function(t){const e=t.basePath,n=Uo(t.root,t),r=[];for(r.push(n);r.length>0;){const t=(r.pop()||{}).children||[];for(const n of t)Uo(n,{basePath:e}),r.push(n)}return n}(i),i.type=ai,i.lodMetricType=si,i.lodMetricValue=(null===(r=i.root)||void 0===r?void 0:r.lodMetricValue)||0,i}(t,e,n):await async function(t,e,n){const r={content:{featureIds:null}};return await To(t,0,e,n,r.content),r.content}(t,e,n);return t},options:{"3d-tiles":{loadGLTF:!0,decodeQuantizedPositions:!1,isTileset:"auto",assetGltfUpAxis:null}}};function Vo(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 Ho(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Vo(Object(n),!0).forEach((function(e){f()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Vo(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Wo(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=l()(t);if(e){var i=l()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return u()(this,n)}}var qo=[0],Xo={getPointColor:{type:"accessor",value:[0,0,0,255]},pointSize:1,data:null,loader:Go,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}},Jo=function(t){a()(r,t);var e,n=Wo(r);function r(){return i()(this,r),n.apply(this,arguments)}return g()(r,[{key:"initializeState",value:function(){"onTileLoadFail"in this.props&&X.a.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[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:(e=H()(q.a.mark((function t(e){var n,r,i,o,a,s,u;return q.a.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:Ho({},r)},!i.preload){t.next=10;break}return t.next=7,i.preload(e,r);case 7:(a=t.sent).headers&&(o.loadOptions.fetch=Ho(Ho({},o.loadOptions.fetch),{},{headers:a.headers})),Object.assign(o,a);case 10:return t.next=12,Object(ur.a)(e,i,o.loadOptions);case 12:s=t.sent,u=new Fi(s,Ho({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)}))),function(t){return e.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 ri:return this._makePointCloudLayer(t,e);case ni:return this._make3DModelLayer(t);case ii: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,c=r.normals,l=r.colors;if(!u)return null;var h=e&&e.props.data||{header:{vertexCount:i},attributes:{POSITION:u,NORMAL:c,COLOR_0:l}},f=this.props,p=f.pointSize,d=f.getPointColor;return new(this.getSubLayerClass("pointcloud",Yn.a))({pointSize:p},this.getSubLayerProps({id:"pointcloud"}),{id:"".concat(this.id,"-pointcloud-").concat(t.id),tile:t,data:h,coordinateSystem:Kn.a.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",$n.a))({_lighting:"pbr"},this.getSubLayerProps({id:"scenegraph"}),{id:"".concat(this.id,"-scenegraph-").concat(t.id),tile:t,data:r||qo,scenegraph:n,coordinateSystem:Kn.a.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?Kn.a.METER_OFFSETS:s,c=n.material,l=n.featureIds,h=this.props._getMeshColor,f=e&&e.props.mesh||new Qn.a({drawMode:4,attributes:Zo(r),indices:i});return new(this.getSubLayerClass("mesh",sr))(this.getSubLayerProps({id:"mesh"}),{id:"".concat(this.id,"-mesh-").concat(t.id),tile:t,mesh:f,data:qo,getColor:h(t),pbrMaterial:c,modelMatrix:o,coordinateOrigin:a,coordinateSystem:u,featureIds:l,_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}}]),r}(m.a);function Zo(t){var e={};return e.positions=Ho(Ho({},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}f()(Jo,"defaultProps",Xo),f()(Jo,"layerName","Tile3DLayer");const Qo={name:"Terrain",id:"terrain",module:"terrain",version:"3.2.10",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}}};function Ko(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=l()(t);if(e){var i=l()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return u()(this,n)}}function Yo(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?Yo(Object(n),!0).forEach((function(e){f()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Yo(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var ta=[1],ea=$o($o({},Je.defaultProps),{},{elevationData:Oe,texture:$o($o({},Oe),{},{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:[Qo]});function na(t){return Array.isArray(t)?t.join(";"):t||""}var ra=function(t){a()(n,t);var e=Ko(n);function n(){return i()(this,n),e.apply(this,arguments)}return g()(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&&X.a.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=$o($o({},s),{},{terrain:$o($o({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=Te(n,t),c=i&&Te(i,t),l=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;h=[d.left,d.bottom],f=[d.right,d.top]}var A=[h[0],h[1],f[0],f[1]],g=this.loadTerrain({elevationData:u,bounds:A,elevationDecoder:o,meshMaxError:a,signal:l}),m=c?r(c,{propName:"texture",layer:this,loaders:[],signal:l}).catch((function(t){return null})):Promise.resolve(null);return Promise.all([g,m])}},{key:"renderSubLayers",value:function(t){var e=this.getSubLayerClass("mesh",rr.a),n=this.props,r=n.color,i=n.wireframe,o=n.material,a=t.data;if(!a)return null;var s=E()(a,2),u=s[0],c=s[1];return new e(t,{data:ta,mesh:u,texture:c,_instanced:!1,coordinateSystem:Kn.a.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,Q()(n.map((function(t){return t[0]})))),i=Math.max.apply(Math,Q()(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,c=t.maxZoom,l=t.minZoom,h=t.extent,f=t.maxRequests,p=t.onTileLoad,d=t.onTileUnload,A=t.onTileError,g=t.maxCacheSize,m=t.maxCacheByteSize,y=t.refinementStrategy;return this.state.isTiled?new Je(this.getSubLayerProps({id:"tiles"}),{getTileData:this.getTiledTerrainData.bind(this),renderSubLayers:this.renderSubLayers.bind(this),updateTriggers:{getTileData:{elevationData:na(r),texture:na(i),meshMaxError:a,elevationDecoder:s}},onViewportLoad:this.onViewportLoad.bind(this),zRange:this.state.zRange||null,tileSize:u,maxZoom:c,minZoom:l,extent:h,maxRequests:f,onTileLoad:p,onTileUnload:d,onTileError:A,maxCacheSize:g,maxCacheByteSize:m,refinementStrategy:y}):new(this.getSubLayerClass("mesh",rr.a))(this.getSubLayerProps({id:"mesh"}),{data:ta,mesh:this.state.terrain,texture:i,_instanced:!1,getPosition:function(t){return[0,0,0]},getColor:e,material:n,wireframe:o})}}]),n}(m.a);f()(ra,"defaultProps",ea),f()(ra,"layerName","TerrainLayer");var ia=n(36);function oa(t,e,n){const r=aa(t),i=Object.keys(r).filter(t=>r[t]!==Array);return function(t,e,n){const{pointPositionsCount:r,pointFeaturesCount:i,linePositionsCount:o,linePathsCount:a,lineFeaturesCount:s,polygonPositionsCount:u,polygonObjectsCount:c,polygonRingsCount:l,polygonFeaturesCount:h,propArrayTypes:f,coordLength:p}=e,{numericPropKeys:d=[],PositionDataType:A=Float32Array}=n,g=t[0]&&"id"in t[0],m=t.length>65535?Uint32Array:Uint16Array,y={type:"Point",positions:new A(r*p),globalFeatureIds:new m(r),featureIds:i>65535?new Uint32Array(r):new Uint16Array(r),numericProps:{},properties:[],fields:[]},v={type:"LineString",pathIndices:o>65535?new Uint32Array(a+1):new Uint16Array(a+1),positions:new A(o*p),globalFeatureIds:new m(o),featureIds:s>65535?new Uint32Array(o):new Uint16Array(o),numericProps:{},properties:[],fields:[]},_={type:"Polygon",polygonIndices:u>65535?new Uint32Array(c+1):new Uint16Array(c+1),primitivePolygonIndices:u>65535?new Uint32Array(l+1):new Uint16Array(l+1),positions:new A(u*p),triangles:[],globalFeatureIds:new m(u),featureIds:h>65535?new Uint32Array(u):new Uint16Array(u),numericProps:{},properties:[],fields:[]};for(const t of[y,v,_])for(const e of d){const n=f[e];t.numericProps[e]=new n(t.positions.length/p)}v.pathIndices[a]=o,_.polygonIndices[c]=u,_.primitivePolygonIndices[l]=u;const b={pointPosition:0,pointFeature:0,linePosition:0,linePath:0,lineFeature:0,polygonPosition:0,polygonObject:0,polygonRing:0,polygonFeature:0,feature:0};for(const e of t){const t=e.geometry,n=e.properties||{};switch(t.type){case"Point":sa(t,y,b,p,n),y.properties.push(pa(n,d)),g&&y.fields.push({id:e.id}),b.pointFeature++;break;case"LineString":ua(t,v,b,p,n),v.properties.push(pa(n,d)),g&&v.fields.push({id:e.id}),b.lineFeature++;break;case"Polygon":ca(t,_,b,p,n),_.properties.push(pa(n,d)),g&&_.fields.push({id:e.id}),b.polygonFeature++;break;default:throw new Error("Invalid geometry type")}b.feature++}return function(t,e,n,r){return{points:{...t,positions:{value:t.positions,size:r},globalFeatureIds:{value:t.globalFeatureIds,size:1},featureIds:{value:t.featureIds,size:1},numericProps:ha(t.numericProps,1)},lines:{...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:ha(e.numericProps,1)},polygons:{...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:ha(n.numericProps,1)}}}(y,v,_,p)}(t,{propArrayTypes:r,...e},{numericPropKeys:n&&n.numericPropKeys||i,PositionDataType:n?n.PositionDataType:Float32Array})}function aa(t){const e={};for(const n of t)if(n.properties)for(const t in n.properties){const r=n.properties[t];e[t]=da(r,e[t])}return e}function sa(t,e,n,r,i){e.positions.set(t.data,n.pointPosition*r);const o=t.data.length/r;fa(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 ua(t,e,n,r,i){e.positions.set(t.data,n.linePosition*r);const o=t.data.length/r;fa(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(let i=0,o=t.indices.length;i<o;++i){const a=t.indices[i],s=i===o-1?t.data.length:t.indices[i+1];e.pathIndices[n.linePath++]=n.linePosition,n.linePosition+=(s-a)/r}}function ca(t,e,n,r,i){e.positions.set(t.data,n.polygonPosition*r);const o=t.data.length/r;fa(e,i,n.polygonPosition,o),e.globalFeatureIds.fill(n.feature,n.polygonPosition,n.polygonPosition+o),e.featureIds.fill(n.polygonFeature,n.polygonPosition,n.polygonPosition+o);for(let i=0,o=t.indices.length;i<o;++i){const o=n.polygonPosition;e.polygonIndices[n.polygonObject++]=o;const a=t.areas[i],s=t.indices[i],u=t.indices[i+1];for(let i=0,o=s.length;i<o;++i){const a=s[i],c=i===o-1?void 0===u?t.data.length:u[0]:s[i+1];e.primitivePolygonIndices[n.polygonRing++]=n.polygonPosition,n.polygonPosition+=(c-a)/r}la(e,a,s,{startPosition:o,endPosition:n.polygonPosition,coordLength:r})}}function la(t,e,n,{startPosition:r,endPosition:i,coordLength:o}){const a=r*o,s=i*o,u=t.positions.subarray(a,s),c=n[0],l=n.slice(1).map(t=>(t-c)/o),h=Object(ia.f)(u,l,o,e);for(let e=0,n=h.length;e<n;++e)t.triangles.push(r+h[e])}function ha(t,e){const n={};for(const r in t)n[r]={value:t[r],size:e};return n}function fa(t,e,n,r){for(const i in t.numericProps)if(i in e){const o=e[i];t.numericProps[i].fill(o,n,n+r)}}function pa(t,e){const n={};for(const r in t)e.includes(r)||(n[r]=t[r]);return n}function da(t,e){return e!==Array&&Number.isFinite(t)?e===Float64Array||Math.fround(t)!==t?Float64Array:Float32Array:Array}var Aa=n(193),ga=n.n(Aa);function ma(t){let e=0;for(let e,n,r=0,i=t.length-1;r<t.length;r++)t[r],t[i],(n[0]-e[0])*(e[1]+n[1]);return e}function ya(t,e,n){e&&n&&(1===t?e.id=n.readVarint():2===t?function(t,e){const n=t.readVarint()+t.pos;for(;t.pos<n;){const n=e._keys[t.readVarint()],r=e._values[t.readVarint()];e.properties[n]=r}}(n,e):3===t?e.type=n.readVarint():4===t&&(e._geometry=n.pos))}class va{static get types(){return["Unknown","Point","LineString","Polygon"]}constructor(t,e,n,r,i){Object(cr.a)(this,"properties",void 0),Object(cr.a)(this,"extent",void 0),Object(cr.a)(this,"type",void 0),Object(cr.a)(this,"id",void 0),Object(cr.a)(this,"_pbf",void 0),Object(cr.a)(this,"_geometry",void 0),Object(cr.a)(this,"_keys",void 0),Object(cr.a)(this,"_values",void 0),this.properties={},this.extent=n,this.type=0,this.id=null,this._pbf=t,this._geometry=-1,this._keys=r,this._values=i,t.readFields(ya,this,e)}loadGeometry(){const t=this._pbf;t.pos=this._geometry;const e=t.readVarint()+t.pos;let n=1,r=0,i=0,o=0;const a=[];let s;for(;t.pos<e;){if(r<=0){const e=t.readVarint();7&e,e>>3}if(1===n||2===n)t.readSVarint(),t.readSVarint(),1===n&&(s&&a.push(s),[]),s&&s.push([i,o]);else{if(7!==n)throw new Error("unknown command ".concat(n));s&&s.push(s[0].slice())}}return s&&a.push(s),a}bbox(){const t=this._pbf;t.pos=this._geometry;const e=t.readVarint()+t.pos;let n=1,r=0,i=0,o=0,a=1/0,s=-1/0,u=1/0,c=-1/0;for(;t.pos<e;){if(r<=0){const e=t.readVarint();7&e,e>>3}if(1===n||2===n)t.readSVarint(),t.readSVarint(),i<a&&i,i>s&&i,o<u&&o,o>c&&o;else if(7!==n)throw new Error("unknown command ".concat(n))}return[a,u,s,c]}_toGeoJSON(t){let e,n,r=this.loadGeometry(),i=va.types[this.type];switch(this.type){case 1:const i=[];for(0;e<r.length;e++)i[e]=r[e][0];i,t(r,this);break;case 2:for(0;e<r.length;e++)t(r[e],this);break;case 3:for(function(t){const e=t.length;if(e<=1)return[t];const n=[];let r,i;for(let o=0;o<e;o++){const e=ma(t[o]);0!==e&&(void 0===i&&e<0,i===e<0?(r&&n.push(r),[t[o]]):r&&r.push(t[o]))}return r&&n.push(r),n}(r),0;e<r.length;e++)for(0;n<r[e].length;n++)t(r[e][n],this)}1===r.length?r[0]:"Multi".concat(i);const o={type:"Feature",geometry:{type:i,coordinates:r},properties:this.properties};return null!==this.id&&(o.id=this.id),o}toGeoJSON(t){if("function"==typeof t)return this._toGeoJSON(t);const{x:e,y:n,z:r}=t,i=this.extent*Math.pow(2,r),o=this.extent*e,a=this.extent*n;return this._toGeoJSON((function(t){for(let e=0;e<t.length;e++){const n=t[e];n[0]=360*(n[0]+o)/i-180;const r=180-360*(n[1]+a)/i;n[1]=360/Math.PI*Math.atan(Math.exp(r*Math.PI/180))-90}}))}}class _a{constructor(t,e){Object(cr.a)(this,"version",void 0),Object(cr.a)(this,"name",void 0),Object(cr.a)(this,"extent",void 0),Object(cr.a)(this,"length",void 0),Object(cr.a)(this,"_pbf",void 0),Object(cr.a)(this,"_keys",void 0),Object(cr.a)(this,"_values",void 0),Object(cr.a)(this,"_features",void 0),this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(ba,this,e),this.length=this._features.length}feature(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];const e=this._pbf.readVarint()+this._pbf.pos;return new va(this._pbf,e,this.extent,this._keys,this._values)}}function ba(t,e,n){e&&n&&(15===t?e.version=n.readVarint():1===t?e.name=n.readString():5===t?e.extent=n.readVarint():2===t?e._features.push(n.pos):3===t?e._keys.push(n.readString()):4===t&&e._values.push(function(t){let e=null;const n=t.readVarint()+t.pos;for(;t.pos<n;){const e=t.readVarint()>>3;1===e?t.readString():2===e?t.readFloat():3===e?t.readDouble():4===e?t.readVarint64():5===e?t.readVarint():6===e?t.readSVarint():7===e?t.readBoolean():null}return e}(n)))}class xa{constructor(t,e){Object(cr.a)(this,"layers",void 0),this.layers=t.readFields(wa,{},e)}}function wa(t,e,n){if(3===t&&n){const t=new _a(n,n.readVarint()+n.pos);t.length&&e&&(e[t.name]=t)}}function Ea(t){const e=t.indices.length;if(e<=1)return{type:"Polygon",data:t.data,areas:[[Object(ia.g)(t.data)]],indices:[t.indices]};const n=[],r=[];let i,o=[],a=[],s=0;for(let u,c,l=0;l<e;l++){t.indices[l]-s,t.indices[l+1]-s||t.data.length;const e=t.data.slice(c,u),h=Object(ia.g)(e);if(0!==h)void 0===i&&h<0,i===h<0?(a.length&&(n.push(o),r.push(a)),[c],[h]):(o.push(h),a.push(c));else{const e=t.data.slice(0,c),n=t.data.slice(u);t.data=e.concat(n),u-c}}return o&&n.push(o),a.length&&r.push(a),{type:"Polygon",areas:n,indices:r,data:t.data}}function Oa(t,e,n){e&&n&&(1===t?e.id=n.readVarint():2===t?function(t,e){const n=t.readVarint()+t.pos;for(;t.pos<n;){const n=e._keys[t.readVarint()],r=e._values[t.readVarint()];e.properties[n]=r}}(n,e):3===t?e.type=n.readVarint():4===t&&(e._geometry=n.pos))}let Sa,Ta,Ca,Pa,Ma,Ia,Ba;class Ra{constructor(t,e,n,r,i,o){Object(cr.a)(this,"properties",void 0),Object(cr.a)(this,"extent",void 0),Object(cr.a)(this,"type",void 0),Object(cr.a)(this,"id",void 0),Object(cr.a)(this,"_pbf",void 0),Object(cr.a)(this,"_geometry",void 0),Object(cr.a)(this,"_keys",void 0),Object(cr.a)(this,"_values",void 0),Object(cr.a)(this,"_geometryInfo",void 0),this.properties={},this.extent=n,this.type=0,this.id=null,this._pbf=t,this._geometry=-1,this._keys=r,this._values=i,this._geometryInfo=o,t.readFields(Oa,this,e)}loadGeometry(){const t=this._pbf;t.pos=this._geometry,t.readVarint()+t.pos,1,0,0,0,0;const e=[],n=[];for(;t.pos<Sa;)if(Pa<=0&&(t.readVarint(),7&Ca,Ca>>3),1===Ta||2===Ta)t.readSVarint(),t.readSVarint(),1===Ta&&e.push(Ba),n.push(Ma,Ia),2;else{if(7!==Ta)throw new Error("unknown command ".concat(Ta));if(Ba>0){const t=e[e.length-1];n.push(n[t],n[t+1]),2}}return{data:n,indices:e}}_toBinaryCoordinates(t){const e=this.loadGeometry();let n;t(e.data,this);switch(this.type){case 1:this._geometryInfo.pointFeaturesCount++,this._geometryInfo.pointPositionsCount+=e.indices.length,{type:"Point",...e};break;case 2:this._geometryInfo.lineFeaturesCount++,this._geometryInfo.linePathsCount+=e.indices.length,this._geometryInfo.linePositionsCount+=e.data.length/2,{type:"LineString",...e};break;case 3:Ea(e),this._geometryInfo.polygonFeaturesCount++,this._geometryInfo.polygonObjectsCount+=n.indices.length;for(const t of n.indices)this._geometryInfo.polygonRingsCount+=t.length;this._geometryInfo.polygonPositionsCount+=n.data.length/2;break;default:throw new Error("Invalid geometry type: ".concat(this.type))}const r={type:"Feature",geometry:n,properties:this.properties};return null!==this.id&&(r.id=this.id),r}toBinaryCoordinates(t){if("function"==typeof t)return this._toBinaryCoordinates(t);const{x:e,y:n,z:r}=t,i=this.extent*Math.pow(2,r),o=this.extent*e,a=this.extent*n;return this._toBinaryCoordinates(t=>function(t,e,n,r){for(let i=0,o=t.length;i<o;i+=2){t[i]=360*(t[i]+e)/r-180;const o=180-360*(t[i+1]+n)/r;t[i+1]=360/Math.PI*Math.atan(Math.exp(o*Math.PI/180))-90}}(t,o,a,i))}}class ka{constructor(t,e){Object(cr.a)(this,"version",void 0),Object(cr.a)(this,"name",void 0),Object(cr.a)(this,"extent",void 0),Object(cr.a)(this,"length",void 0),Object(cr.a)(this,"_pbf",void 0),Object(cr.a)(this,"_keys",void 0),Object(cr.a)(this,"_values",void 0),Object(cr.a)(this,"_features",void 0),this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(La,this,e),this.length=this._features.length}feature(t,e){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];const n=this._pbf.readVarint()+this._pbf.pos;return new Ra(this._pbf,n,this.extent,this._keys,this._values,e)}}function La(t,e,n){e&&n&&(15===t?e.version=n.readVarint():1===t?e.name=n.readString():5===t?e.extent=n.readVarint():2===t?e._features.push(n.pos):3===t?e._keys.push(n.readString()):4===t&&e._values.push(function(t){let e=null;const n=t.readVarint()+t.pos;for(;t.pos<n;){const e=t.readVarint()>>3;1===e?t.readString():2===e?t.readFloat():3===e?t.readDouble():4===e?t.readVarint64():5===e?t.readVarint():6===e?t.readSVarint():7===e?t.readBoolean():null}return e}(n)))}class Da{constructor(t,e){Object(cr.a)(this,"layers",void 0),this.layers=t.readFields(ja,{},e)}}function ja(t,e,n){if(3===t&&n){const t=new ka(n,n.readVarint()+n.pos);t.length&&e&&(e[t.name]=t)}}function Fa(t,e){var n,r;const i=function(t){var e;if(null==t||!t.mvt)throw new Error("mvt options required");const n="wgs84"===(null===t.mvt||void 0===e?void 0:e.coordinates),{tileIndex:r}=t.mvt,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||null===e.gis||void 0===n?void 0:n.format)||(null==e||null===e.mvt||void 0===r?void 0:r.shape);switch(o){case"columnar-table":return{shape:"columnar-table",data:za(t,i)};case"geojson-row-table":return{shape:"geojson-row-table",data:Ua(t,i)};case"geojson":return Ua(t,i);case"binary-geometry":case"binary":return za(t,i);default:throw new Error(o)}}function za(t,e){const[n,r]=function(t,e){const 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];const i=new Da(new ga.a(t));return(e&&Array.isArray(e.layers)?e.layers:Object.keys(i.layers)).forEach(t=>{const o=i.layers[t];if(o)for(let i=0;i<o.length;i++){const a=Ga(o.feature(i,r),e,t);n.push(a)}}),[n,r]}(t,e),i=oa(n,r);return i.byteLength=t.byteLength,i}function Ua(t,e){if(t.byteLength<=0)return[];const n=[],r=new xa(new ga.a(t));return(Array.isArray(e.layers)?e.layers:Object.keys(r.layers)).forEach(t=>{const i=r.layers[t];if(i)for(let r=0;r<i.length;r++){const o=Na(i.feature(r),e,t);n.push(o)}}),n}function Na(t,e,n){const r=t.toGeoJSON("wgs84"===e.coordinates?e.tileIndex:Va);return e.layerProperty&&(r.properties[e.layerProperty]=n),r}function Ga(t,e,n){const r=t.toBinaryCoordinates("wgs84"===e.coordinates?e.tileIndex:Ha);return e.layerProperty&&r.properties&&(r.properties[e.layerProperty]=n),r}function Va(t,e){const{extent:n}=e;for(let e=0;e<t.length;e++){const r=t[e];r[0]/=n,r[1]/=n}}function Ha(t,e){const{extent:n}=e;for(let e=0,r=t.length;e<r;++e)t[e]/=n}const Wa={name:"Mapbox Vector Tile",id:"mvt",module:"mvt",version:"3.2.10",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}}};function qa(t,e){const n=null==e?void 0:e.globalFeatureId;return void 0!==n?function(t,e){const n=Za(t);for(const t of n){let n=0,r=t.featureIds.value[0];for(let i=0;i<t.featureIds.value.length;i++){const o=t.featureIds.value[i];if(o!==r){if(e===t.globalFeatureIds.value[n])return Qa(t,n,i);n=i,r=o}}if(e===t.globalFeatureIds.value[n])return Qa(t,n,t.featureIds.value.length)}throw new Error("featureId:".concat(e," not found"))}(t,n):Xa(t,null==e?void 0:e.type)}function Xa(t,e){return function(t){const e=[];for(const n of t){if(0===n.featureIds.value.length)continue;let t=0,r=n.featureIds.value[0];for(let i=0;i<n.featureIds.value.length;i++){const o=n.featureIds.value[i];o!==r&&(e.push(Qa(n,t,i)),t=i,r=o)}e.push(Qa(n,t,n.featureIds.value.length))}return e}(Za(t,e))}function Ja(t,e,n){switch(t.type){case"Point":return function(t,e,n){const{positions:r}=t,i=Ka(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,e=-1/0,n=1/0){const{positions:r}=t,i=t.pathIndices.value.filter(t=>t>=e&&t<=n);if(!(i.length>2)){return{type:"LineString",coordinates:Ka(r,i[0],i[1])}}const o=[];for(let t=0;t<i.length-1;t++){const e=Ka(r,i[t],i[t+1]);o.push(e)}return{type:"MultiLineString",coordinates:o}}(t,e,n);case"Polygon":return function t(e,n=-1/0,r=1/0){const{positions:i}=e,o=e.polygonIndices.value.filter(t=>t>=n&&t<=r),a=e.primitivePolygonIndices.value.filter(t=>t>=n&&t<=r);if(!(o.length>2)){const t=[];for(let e=0;e<a.length-1;e++){const n=a[e],r=a[e+1],o=Ka(i,n,r);t.push(o)}return{type:"Polygon",coordinates:t}}const s=[];for(let n=0;n<o.length-1;n++){const r=o[n],i=o[n+1],a=t(e,r,i).coordinates;s.push(a)}return{type:"MultiPolygon",coordinates:s}}(t,e,n);default:const r=t;throw new Error("Unsupported geometry type: ".concat(null==r?void 0:r.type))}}function Za(t,e){if(!Boolean(t.points||t.lines||t.polygons))return t.type=e||function(t){if(t.pathIndices)return"LineString";if(t.polygonIndices)return"Polygon";return"Point"}(t),[t];const n=[];return t.points&&(t.points.type="Point",n.push(t.points)),t.lines&&(t.lines.type="LineString",n.push(t.lines)),t.polygons&&(t.polygons.type="Polygon",n.push(t.polygons)),n}function Qa(t,e,n){return{type:"Feature",geometry:Ja(t,e,n),properties:function(t,e=0,n){const r=Object.assign({},t.properties[t.featureIds.value[e]]);for(const n in t.numericProps)r[n]=t.numericProps[n].value[e];return r}(t,e),...function(t,e=0,n){return t.fields&&t.fields[t.featureIds.value[e]]}(t,e)}}function Ka(t,e,n){e=e||0,n=n||t.value.length/t.size;const r=[];for(let i=e;i<n;i++){const e=Array();for(let n=i*t.size;n<(i+1)*t.size;n++)e.push(Number(t.value[n]));r.push(e)}return r}var Ya=n(205);function $a(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=l()(t);if(e){var i=l()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return u()(this,n)}}var ts={clipBounds:[0,0,1,1]},es="\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",ns={name:"clip-vs",vs:es},rs={"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"},is={name:"clip-fs",fs:es},os={"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"},as=function(t){a()(n,t);var e=$a(n);function n(){return i()(this,n),e.apply(this,arguments)}return g()(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:[ns],inject:rs}:{modules:[is],inject:os}}},{key:"draw",value:function(t){var e=t.uniforms,n=this.props.clipBounds,r=void 0===n?ts.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}(Ya.a);function ss(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 us(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ss(Object(n),!0).forEach((function(e){f()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ss(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}f()(as,"defaultProps",ts),f()(as,"extensionName","ClipExtension");var cs={Point:ls,MultiPoint:function(t,e,n){return hs(t,e,n)},LineString:fs,MultiLineString:function(t,e,n){return t.map((function(t){return fs(t,e,n)}))},Polygon:ps,MultiPolygon:function(t,e,n){return t.map((function(t){return ps(t,e,n)}))}};function ls(t,e,n){var r=E()(t,2),i=r[0],o=r[1],a=E()(e,2),s=a[0],u=a[1],c=Object(Nt.g)(s[0],u[0],i),l=Object(Nt.g)(s[1],u[1],o);return n.unprojectFlat([c,l])}function hs(t,e,n){return t.map((function(t){return ls(t,e,n)}))}function fs(t,e,n){return hs(t,e,n)}function ps(t,e,n){return t.map((function(t){return hs(t,e,n)}))}function ds(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return As(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 As(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=n.call(t)},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 As(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 gs=["points","lines","polygons"];function ms(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 c=t.numericProps[e].value.findIndex((function(t,e){return t===n&&i[e]>=o&&i[e]<a}));return c>=0?t.globalFeatureIds.value[c]:-1}return e?u=ys(t.properties,(function(t){return t[e]===n}),o,a):t.fields&&(u=ys(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 ys(t,e,n,r){for(var i=n;i<r;i++)if(e(t[i],i))return i;return-1}function vs(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return _s(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 _s(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=n.call(t)},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 _s(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 bs(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=l()(t);if(e){var i=l()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return u()(this,n)}}function xs(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 ws(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?xs(Object(n),!0).forEach((function(e){f()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):xs(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Es=ws(ws({},G.a.defaultProps),{},{onDataLoad:{type:"function",value:null,optional:!0,compare:!1},uniqueIdProperty:"",highlightedFeatureId:null,loaders:[Wa],binary:!0}),Os=function(t){a()(r,t);var e,n=bs(r);function r(){return i()(this,r),n.apply(this,arguments)}return g()(r,[{key:"initializeState",value:function(){Qe()(l()(r.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&&Qe()(l()(r.prototype),"isLoaded",this)}},{key:"updateState",value:function(t){var e,n=t.props,i=t.oldProps,o=t.context,a=t.changeFlags;a.dataChanged&&this._updateTileData(),null!==(e=this.state)&&void 0!==e&&e.data&&(Qe()(l()(r.prototype),"updateState",this).call(this,{props:n,oldProps:i,context:o,changeFlags:a}),this._setWGS84PropertyForTiles());var s=n.highlightColor;s!==i.highlightColor&&Array.isArray(s)&&this.setState({highlightColor:s})}},{key:"_updateTileData",value:(e=H()(q.a.mark((function t(){var e,n,r,i,o;return q.a.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]])}))),function(){return e.apply(this,arguments)})},{key:"_getTilesetOptions",value:function(){var t=Qe()(l()(r.prototype),"_getTilesetOptions",this).call(this),e=this.state.tileJSON,n=this.props,i=n.minZoom,o=n.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?Qe()(l()(r.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=Te(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=ws(ws({},u),{},{mimeType:"application/x-protobuf",mvt:ws(ws({},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,n=e.x,i=e.y,o=e.z,a=Math.pow(2,o),s=512/a,u=-s,c=512*n/a,h=512*(1-i/a),f=(new Zt.a).scale([s,u,1]);t.autoHighlight=!1,this.context.viewport.resolution||(t.modelMatrix=f,t.coordinateOrigin=[c,h,0],t.coordinateSystem=Kn.a.CARTESIAN,t.extensions=[].concat(Q()(t.extensions||[]),[new as]));var p=Qe()(l()(r.prototype),"renderSubLayers",this).call(this,t);return!this.state.binary||p instanceof G.a||X.a.warn("renderSubLayers() must return GeoJsonLayer when using binary:true")(),p}},{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=Ss(s,r),n=Ts(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=Qe()(l()(r.prototype),"getPickingInfo",this).call(this,t),n=Boolean(this.context.viewport.resolution);if(this.state.binary&&-1!==e.index){var i=t.sourceLayer.props.data;e.object=qa(i,{globalFeatureId:e.index})}return e.object&&!n&&(e.object=Ps(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,c=Cs(s);if(!(Cs(n)||c))return-1;var l=c?s:n;return Array.isArray(u)?u.findIndex((function(t){var e=Ss(t,a)===l,n=c||Ts(t)===r;return e&&n})):u&&i?function(t,e,n,r){var i,o=ds(gs);try{for(o.s();!(i=o.n()).done;){var a=i.value,s=t[a]&&ms(t[a],e,n,r);if(s>=0)return s}}catch(t){o.e(t)}finally{o.f()}return-1}(u,a,l,c?"":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=vs(n);try{for(o.s();!(t=o.n()).done;){var a=t.value,s=Ss(a.object,this.props.uniqueIdProperty);void 0===s?i.push(a.object):r.has(s)||(r.add(s),i.push(a.object))}}catch(t){o.e(t)}finally{o.f()}return i}},{key:"_setWGS84PropertyForTiles",value:function(){var t=this;this.state.tileset.selectedTiles.forEach((function(e){e.hasOwnProperty("dataInWGS84")||Object.defineProperty(e,"dataInWGS84",{get:function(){if(!e.content)return null;if(t.state.binary&&Array.isArray(e.content)&&!e.content.length)return[];var n,r=e.bbox;if(void 0===e._contentWGS84&&(n=r,Number.isFinite(n.west)&&Number.isFinite(n.north)&&Number.isFinite(n.east)&&Number.isFinite(n.south))){var i=t.state.binary?qa(e.content):e.content;e._contentWGS84=i.map((function(e){return Ps(e,r,t.context.viewport)}))}return e._contentWGS84}})}))}}]),r}(Je);function Ss(t,e){return t.properties&&e?t.properties[e]:"id"in t?t.id:void 0}function Ts(t){var e;return(null===(e=t.properties)||void 0===e?void 0:e.layerName)||null}function Cs(t){return null!=t&&""!==t}function Ps(t,e,n){var r=ws(ws({},t),{},{geometry:{type:t.geometry.type}});return Object.defineProperty(r.geometry,"coordinates",{get:function(){return function(t,e,n){var r=[n.projectFlat([e.west,e.north]),n.projectFlat([e.east,e.south])];return us(us({},t),{},{coordinates:cs[t.type](t.coordinates,r,n)})}(t.geometry,e,n).coordinates}}),r}f()(Os,"layerName","MVTLayer"),f()(Os,"defaultProps",Es);for(var Ms={},Is=0;Is<"0123456789bcdefghjkmnpqrstuvwxyz".length;Is++)Ms["0123456789bcdefghjkmnpqrstuvwxyz".charAt(Is)]=Is;function Bs(t){var e=function(t){for(var e,n=!0,r=90,i=-90,o=180,a=-180,s=0,u=0,c=t.length;u<c;u++){var l=t[u].toLowerCase();s=Ms[l];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=E()(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]}function Rs(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=l()(t);if(e){var i=l()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return u()(this,n)}}var ks=function(t){a()(n,t);var e=Rs(n);function n(){return i()(this,n),e.apply(this,arguments)}return g()(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 Bs(n(t,e))}}}}]),n}(x);f()(ks,"layerName","GeohashLayer"),f()(ks,"defaultProps",{getGeohash:{type:"accessor",value:function(t){return t.geohash}}}),n.d(e,"GreatCircleLayer",(function(){return d})),n.d(e,"S2Layer",(function(){return D})),n.d(e,"QuadkeyLayer",(function(){return U})),n.d(e,"TileLayer",(function(){return Je})),n.d(e,"TripsLayer",(function(){return tn})),n.d(e,"H3ClusterLayer",(function(){return Zn})),n.d(e,"H3HexagonLayer",(function(){return Wn})),n.d(e,"Tile3DLayer",(function(){return Jo})),n.d(e,"TerrainLayer",(function(){return ra})),n.d(e,"MVTLayer",(function(){return Os})),n.d(e,"GeohashLayer",(function(){return ks})),n.d(e,"_GeoCellLayer",(function(){return x})),n.d(e,"_getURLFromTemplate",(function(){return Te})),n.d(e,"_Tileset2D",(function(){return Ne})),n.d(e,"_Tile2DHeader",(function(){return J}))},function(t,e,n){"use strict";n.r(e);var r=n(3),i=n.n(r),o=n(4),a=n.n(o),s=n(7),u=n.n(s),c=n(5),l=n.n(c),h=n(6),f=n.n(h),p=n(2),d=n.n(p),A=n(0),g=n.n(A),m=n(20),y=n(181),v=n(8),_=n(234),b=n(197),x=n(178),w=n(293);function E(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const r=Math.fround(t),i=t-r;return e[n]=r,e[n+1]=i,e}function O(t){return t-Math.fround(t)}function S(t){const e=new Float32Array(32);for(let n=0;n<4;++n)for(let r=0;r<4;++r){const i=4*n+r;E(t[4*r+n],e,2*i)}return e}const T={ONE:1};const C={name:"fp64-arithmetic",vs:"uniform float ONE;\nvec2 split(float a) {\n const float SPLIT = 4097.0;\n float t = a * SPLIT;\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float a_hi = t * ONE - (t - a);\n float a_lo = a * ONE - a_hi;\n#else\n float a_hi = t - (t - a);\n float a_lo = a - a_hi;\n#endif\n return vec2(a_hi, a_lo);\n}\nvec2 split2(vec2 a) {\n vec2 b = split(a.x);\n b.y += a.y;\n return b;\n}\nvec2 quickTwoSum(float a, float b) {\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float sum = (a + b) * ONE;\n float err = b - (sum - a) * ONE;\n#else\n float sum = a + b;\n float err = b - (sum - a);\n#endif\n return vec2(sum, err);\n}\nvec2 twoSum(float a, float b) {\n float s = (a + b);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float v = (s * ONE - a) * ONE;\n float err = (a - (s - v) * ONE) * ONE * ONE * ONE + (b - v);\n#else\n float v = s - a;\n float err = (a - (s - v)) + (b - v);\n#endif\n return vec2(s, err);\n}\n\nvec2 twoSub(float a, float b) {\n float s = (a - b);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float v = (s * ONE - a) * ONE;\n float err = (a - (s - v) * ONE) * ONE * ONE * ONE - (b + v);\n#else\n float v = s - a;\n float err = (a - (s - v)) - (b + v);\n#endif\n return vec2(s, err);\n}\n\nvec2 twoSqr(float a) {\n float prod = a * a;\n vec2 a_fp64 = split(a);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float err = ((a_fp64.x * a_fp64.x - prod) * ONE + 2.0 * a_fp64.x *\n a_fp64.y * ONE * ONE) + a_fp64.y * a_fp64.y * ONE * ONE * ONE;\n#else\n float err = ((a_fp64.x * a_fp64.x - prod) + 2.0 * a_fp64.x * a_fp64.y) + a_fp64.y * a_fp64.y;\n#endif\n return vec2(prod, err);\n}\n\nvec2 twoProd(float a, float b) {\n float prod = a * b;\n vec2 a_fp64 = split(a);\n vec2 b_fp64 = split(b);\n float err = ((a_fp64.x * b_fp64.x - prod) + a_fp64.x * b_fp64.y +\n a_fp64.y * b_fp64.x) + a_fp64.y * b_fp64.y;\n return vec2(prod, err);\n}\n\nvec2 sum_fp64(vec2 a, vec2 b) {\n vec2 s, t;\n s = twoSum(a.x, b.x);\n t = twoSum(a.y, b.y);\n s.y += t.x;\n s = quickTwoSum(s.x, s.y);\n s.y += t.y;\n s = quickTwoSum(s.x, s.y);\n return s;\n}\n\nvec2 sub_fp64(vec2 a, vec2 b) {\n vec2 s, t;\n s = twoSub(a.x, b.x);\n t = twoSub(a.y, b.y);\n s.y += t.x;\n s = quickTwoSum(s.x, s.y);\n s.y += t.y;\n s = quickTwoSum(s.x, s.y);\n return s;\n}\n\nvec2 mul_fp64(vec2 a, vec2 b) {\n vec2 prod = twoProd(a.x, b.x);\n prod.y += a.x * b.y;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n prod = split2(prod);\n#endif\n prod = quickTwoSum(prod.x, prod.y);\n prod.y += a.y * b.x;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n prod = split2(prod);\n#endif\n prod = quickTwoSum(prod.x, prod.y);\n return prod;\n}\n\nvec2 div_fp64(vec2 a, vec2 b) {\n float xn = 1.0 / b.x;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n vec2 yn = mul_fp64(a, vec2(xn, 0));\n#else\n vec2 yn = a * xn;\n#endif\n float diff = (sub_fp64(a, mul_fp64(b, yn))).x;\n vec2 prod = twoProd(xn, diff);\n return sum_fp64(yn, prod);\n}\n\nvec2 sqrt_fp64(vec2 a) {\n if (a.x == 0.0 && a.y == 0.0) return vec2(0.0, 0.0);\n if (a.x < 0.0) return vec2(0.0 / 0.0, 0.0 / 0.0);\n\n float x = 1.0 / sqrt(a.x);\n float yn = a.x * x;\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n vec2 yn_sqr = twoSqr(yn) * ONE;\n#else\n vec2 yn_sqr = twoSqr(yn);\n#endif\n float diff = sub_fp64(a, yn_sqr).x;\n vec2 prod = twoProd(x * 0.5, diff);\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n return sum_fp64(split(yn), prod);\n#else\n return sum_fp64(vec2(yn, 0.0), prod);\n#endif\n}\n",fs:null,getUniforms:function(){return T},fp64ify:E,fp64LowPart:O,fp64ifyMatrix4:S};var P,M,I=n(155),B=n(204),R={SUM:1,MEAN:2,MIN:3,MAX:4};function k(t,e){return t+e}function L(t,e){return e>t?e:t}function D(t,e){return e<t?e:t}function j(t,e,n){var r=R[t]||R.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 R.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(D,1/0):null}(t,e)};case R.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(k,0):null}(t,e)};case R.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(k,0)/n.length:null}(t,e)};case R.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(L,-1/0):null}(t,e)};default:return null}}function F(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 z,U={projectPoints:!1,viewport:null,createBufferObjects:!0,moduleSettings:{}},N=3402823466e29,G=[32775,32774],V=[32776,32774],H=[32776,32775],W=(P={},g()(P,R.SUM,32774),g()(P,R.MEAN,32774),g()(P,R.MIN,G),g()(P,R.MAX,V),P),q={size:1,operation:R.SUM,needMin:!1,needMax:!1,combineMaxMin:!1},X=(M={},g()(M,10240,9728),g()(M,10241,9728),n(102)),J=n(71),Z=(z={},g()(z,10240,9728),g()(z,10241,9728),z);function Q(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},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,c=void 0===u||u,l=e.parameters,h=void 0===l?Z:l,f=new X.a(t,{data:s,format:Object(v.j)(t)?34836:6408,type:5126,border:0,mipmaps:!1,parameters:h,dataFormat:6408,width:r,height:o,unpackFlipY:c});return f}function K(t,e){var n=e.id,r=e.width,i=void 0===r?1:r,o=e.height,a=void 0===o?1:o,s=e.texture;return new J.a(t,{id:n,width:i,height:a,attachments:g()({},36064,s)})}function Y(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return $(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 $(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=n.call(t)},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 $(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 tt(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 et(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?tt(Object(n),!0).forEach((function(e){g()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):tt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var nt=["aggregationBuffer","maxMinBuffer","minBuffer","maxBuffer"],rt={maxData:"maxBuffer",minData:"minBuffer",maxMinData:"maxMinBuffer"},it=[y.a.WEBGL2,y.a.COLOR_ATTACHMENT_RGBA32F,y.a.BLEND_EQUATION_MINMAX,y.a.FLOAT_BLEND,y.a.TEXTURE_FLOAT],ot=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i()(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=Object(v.j)(e)&&Object(_.c)(this.gl,y.a.BLEND_EQUATION_MINMAX,y.a.COLOR_ATTACHMENT_RGBA32F,y.a.TEXTURE_FLOAT),this._hasGPUSupport&&this._setupModels()}return a()(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,c=r.meanTextures,l=r.resources;null==t||t.delete(),null==e||e.delete(),null==n||n.delete(),function(t){(t=Array.isArray(t)?t:[t]).forEach((function(t){for(var e in t)t[e].delete()}))}([o,i,a,s,u,c,l])}},{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||m.a.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,rt){var i=rt[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=et(et({},U),t),n=e.weights;return n&&(e.weights=function(t){var e={};for(var n in t)e[n]=et(et({},q),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,c=t.weights;for(var l in c){e[l]={};var h=c[l],f=h.needMin,p=h.needMax,d=h.combineMaxMin;e[l].aggregationTexture=r[l],e[l].aggregationBuffer=Object(b.d)(i[l],{target:c[l].aggregationBuffer,sourceType:5126}),f&&p&&d?(e[l].maxMinBuffer=Object(b.d)(o[l],{target:c[l].maxMinBuffer,sourceType:5126}),e[l].maxMinTexture=u["".concat(l,"-maxMinTexture")]):(f&&(e[l].minBuffer=Object(b.d)(a[l],{target:c[l].minBuffer,sourceType:5126}),e[l].minTexture=u["".concat(l,"-minTexture")]),p&&(e[l].maxBuffer=Object(b.d)(s[l],{target:c[l].maxBuffer,sourceType:5126}),e[l].maxTexture=u["".concat(l,"-maxTexture")]))}return this._trackGPUResultBuffers(e,c),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,c=t.scaling,l=this.state,h=l.maxMinFramebuffers,f=l.minFramebuffers,p=l.maxFramebuffers,d=[o,a],A={blend:!0,depthTest:!1,blendFunc:[1,1]},g={cellSize:e,gridSize:d,projectPoints:n,translation:u,scaling:c};for(var m in s){var y=s[m],v=y.needMin,_=y.needMax,b=v&&_&&s[m].combineMaxMin;this._renderToWeightsTexture({id:m,parameters:A,moduleSettings:i,uniforms:g,gridSize:d,attributes:r,weights:s}),b?this._renderToMaxMinTexture({id:m,parameters:et(et({},A),{},{blendEquation:H}),gridSize:d,minOrMaxFb:h[m],clearParams:{clearColor:[0,0,0,N]},combineMaxMin:b}):(v&&this._renderToMaxMinTexture({id:m,parameters:et(et({},A),{},{blendEquation:G}),gridSize:d,minOrMaxFb:f[m],clearParams:{clearColor:[N,N,N,0]},combineMaxMin:b}),_&&this._renderToMaxMinTexture({id:m,parameters:et(et({},A),{},{blendEquation:V}),gridSize:d,minOrMaxFb:p[m],clearParams:{clearColor:[0,0,0,0]},combineMaxMin:b}))}}},{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,c=this.gl,l=this.allAggregationModel;Object(v.o)(c,et(et({},s),{},{framebuffer:i,viewport:[0,0,r[0],r[1]]}),(function(){c.clear(16384),l.draw({parameters:n,uniforms:{uSampler:u[e].texture,gridSize:r,combineMaxMin:o}})}))}},{key:"_renderToWeightsTexture",value:function(t){var e=t.id,n=t.parameters,r=t.moduleSettings,i=t.uniforms,o=t.gridSize,a=t.weights,s=this.state,u=s.framebuffers,c=s.equations,l=s.weightAttributes,h=this.gl,f=this.gridAggregationModel,p=a[e].operation,d=p===R.MIN?[N,N,N,0]:[0,0,0,0];if(Object(v.o)(h,{framebuffer:u[e],viewport:[0,0,o[0],o[1]],clearColor:d},(function(){h.clear(16384);var t={weights:l[e]};f.draw({parameters:et(et({},n),{},{blendEquation:c[e]}),moduleSettings:r,uniforms:i,attributes:t})})),p===R.MEAN){var A=this.state,m=A.meanTextures,y=A.textures,_={_sourceTextures:{aggregationValues:m[e]},_targetTexture:y[e],elementCount:y[e].width*y[e].height};this.meanTransform?this.meanTransform.update(_):this.meanTransform=function(t,e){return new w.a(t,et({vs:"#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",_targetTextureVarying:"meanValues"},e))}(h,_),this.meanTransform.run({parameters:{blend:!1,depthTest:!1}}),u[e].attach(g()({},36064,y[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,r=e.framebuffers,i=e.maxMinFramebuffers,o=e.minFramebuffers,a=e.maxFramebuffers,s=e.meanTextures,u=e.equations,c=t.weights,l=t.numCol,h=t.numRow,f={width:l,height:h};for(var p in c){var d=c[p],A=d.needMin,m=d.needMax,y=d.combineMaxMin,v=d.operation;n[p]=c[p].aggregationTexture||n[p]||Q(this.gl,{id:"".concat(p,"-texture"),width:l,height:h}),n[p].resize(f);var _=n[p];v===R.MEAN&&(s[p]=s[p]||Q(this.gl,{id:"".concat(p,"-mean-texture"),width:l,height:h}),s[p].resize(f),_=s[p]),r[p]?r[p].attach(g()({},36064,_)):r[p]=K(this.gl,{id:"".concat(p,"-fb"),width:l,height:h,texture:_}),r[p].resize(f),u[p]=W[v]||W.SUM,(A||m)&&(A&&m&&y?i[p]||(_=c[p].maxMinTexture||this._getMinMaxTexture("".concat(p,"-maxMinTexture")),i[p]=K(this.gl,{id:"".concat(p,"-maxMinFb"),texture:_})):(A&&(o[p]||(_=c[p].minTexture||this._getMinMaxTexture("".concat(p,"-minTexture")),o[p]=K(this.gl,{id:"".concat(p,"-minFb"),texture:_}))),m&&(a[p]||(_=c[p].maxTexture||this._getMinMaxTexture("".concat(p,"-maxTexture")),a[p]=K(this.gl,{id:"".concat(p,"-maxFb"),texture:_})))))}}},{key:"_getMinMaxTexture",value:function(t){var e=this.state.resources;return e[t]||(e[t]=Q(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=at(a,s),!this.allAggregationModel){var u=r*o;this.allAggregationModel=st(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]){var i,o=Y(nt);try{for(o.s();!(i=o.n()).done;){var a=i.value;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]}}}catch(t){o.e(t)}finally{o.f()}}}},{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 Object(_.c)(t,it)}}]),t}();function at(t,e){var n=Object(I.a)({vs:"#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",fs:"#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",modules:[C,B.a]},e);return new x.a(t,et({id:"Gird-Aggregation-Model",vertexCount:1,drawMode:0},n))}function st(t,e){return new x.a(t,{id:"All-Aggregation-Model",vs:"#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",fs:"#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",modules:[C],vertexCount:1,drawMode:0,isInstanced:!0,instanceCount:e,attributes:{position:[0,0]}})}var ut=n(58),ct=n(220),lt=n(157),ht=[[255,255,178],[254,217,118],[254,178,76],[253,141,60],[240,59,32],[189,0,38]];function ft(t){var e,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Float32Array;if(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}function pt(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 dt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?pt(Object(n),!0).forEach((function(e){g()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):pt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function At(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=d()(t);if(e){var i=d()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return f()(this,n)}}var gt=[0,0,0,0],mt=[0,255,0,255],yt=["minColor","maxColor","colorRange","colorDomain"],vt={cellSizePixels:{value:100,min:1},cellMarginPixels:{value:2,min:0,max:5},colorDomain:null,colorRange:ht},_t=function(t){l()(n,t);var e=At(n);function n(){return i()(this,n),e.apply(this,arguments)}return a()(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:[ct.a]}}},{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){u()(d()(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||gt,a=this.props.maxColor||mt,s=this.props.colorDomain||[1,0];this.state.model.setUniforms(e).setUniforms({minColor:o,maxColor:a,maxTexture:i,colorDomain:s}).draw({parameters:dt({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,c=t.size,l=0;l<n;l++){var h=l%s,f=Math.floor(l/s);u[l*c+0]=h*a/i*2-1,u[l*c+1]=1-f*a/o*2,u[l*c+2]=0}}},{key:"_getModel",value:function(t){return new x.a(t,dt(dt({},this.getShaders()),{},{id:this.props.id,geometry:new ut.a({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?(m.a.deprecated("ScreenGridLayer props: minColor and maxColor","colorRange, colorDomain")(),!0):!r&&!i}},{key:"_updateUniforms",value:function(t,e,n){var r=this.state.model;if(yt.some((function(n){return t[n]!==e[n]}))&&r.setUniforms({shouldUseMinMax:this._shouldUseMinMax()}),t.colorRange!==e.colorRange&&r.setUniforms({colorRange:ft(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,c=s.cellMarginPixels,l=u>c?c:0,h=new Float32Array([(u-l)/o*2,-(u-l)/a*2,1]);r.setUniforms({cellScale:h})}}}],[{key:"isSupported",value:function(t){return Object(_.c)(t,[y.a.TEXTURE_FLOAT])}}]),n}(lt.a);g()(_t,"layerName","ScreenGridCellLayer"),g()(_t,"defaultProps",vt);var bt=n(131),xt=n(158),wt=n(189);function Et(t,e){var n={};for(var r in t)e.includes(r)||(n[r]=t[r]);return n}function Ot(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return St(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 St(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=n.call(t)},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 St(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 Tt(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=d()(t);if(e){var i=d()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return f()(this,n)}}var Ct=function(t){l()(n,t);var e=Tt(n);function n(){return i()(this,n),e.apply(this,arguments)}return a()(n,[{key:"initializeAggregationLayer",value:function(t){u()(d()(n.prototype),"initializeState",this).call(this,this.context),this.setState({ignoreProps:Et(this.constructor._propTypes,t.data.props),dimensions:t})}},{key:"updateState",value:function(t){if(u()(d()(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:Object(v.e)(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,c=s.props,l=s.accessors,h=void 0===l?[]:l,f=i.updateTriggersChanged;if(i.dataChanged)return!0;if(f){if(f.all)return!0;var p,d=Ot(h);try{for(d.s();!(p=d.n()).done;){var A=p.value;if(f[A])return!0}}catch(t){d.e(t)}finally{d.f()}}if(a)return!!i.extensionsChanged||Object(bt.a)({oldProps:r,newProps:n,ignoreProps:u,propTypes:this.constructor._propTypes});var g,m=Ot(c);try{for(m.s();!(g=m.n()).done;){var y=g.value;if(n[y]!==r[y])return!0}}catch(t){m.e(t)}finally{m.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 xt.a(this.context.gl,{id:this.props.id,stats:this.context.stats})}}]),n}(wt.a);g()(Ct,"layerName","AggregationLayer");var Pt=n(32),Mt=n(9),It=n.n(Mt);function Bt(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Rt(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 Rt(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=n.call(t)},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 Rt(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 kt(t,e,n){var r=n;return r.domain=function(){return t},r.range=function(){return e},r}function Lt(t,e){return kt(t,e,(function(n){return function(t,e,n){var r=t[1]-t[0];if(r<=0)return m.a.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 Dt(t,e){return kt(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 jt(t,e){for(var n=t.sort(Ft),r=0,i=Math.max(1,e.length),o=new Array(i-1);++r<i;)o[r-1]=zt(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;Ft(t[i],e)>0?r=i:n=i+1}return n}(t,n)]}(o,e,t)};return a.thresholds=function(){return o},kt(t,e,a)}function Ft(t,e){return t-e}function zt(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 Ut(t,e){var n,r=new Map,i=[],o=Bt(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(t){o.e(t)}finally{o.f()}return kt(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 Nt(t){return null!=t}function Gt(t,e){return("function"==typeof e?t.map(e):t).filter(Nt)}function Vt(t,e){return Gt(t,e)}function Ht(t,e){return n=Gt(t,e),r=[],n.forEach((function(t){!r.includes(t)&&Nt(t)&&r.push(t)})),r;var n,r}function Wt(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return qt(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 qt(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=n.call(t)},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 qt(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 Xt=function(t){return t.length},Jt=function(t){return t.points},Zt=function(t){return t.index},Qt=function(t,e){return t<e?-1:t>e?1:t>=e?0:NaN},Kt={getValue:Xt,getPoints:Jt,getIndex:Zt,filterData:null},Yt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Kt;i()(this,t),this.aggregatedBins=this.getAggregatedBins(e,n),this._updateMinMaxValues(),this.binMap=this.getBinMap()}return a()(t,[{key:"getAggregatedBins",value:function(t,e){for(var n=e.getValue,r=void 0===n?Xt:n,i=e.getPoints,o=void 0===i?Jt:i,a=e.getIndex,s=void 0===a?Zt:a,u=e.filterData,c="function"==typeof u,l=t.length,h=[],f=0,p=0;p<l;p++){var d=t[p],A=o(d),g=s(d),m=c?A.filter(u):A;d.filteredPoints=c?m:null;var y=m.length?r(m):null;null!=y&&(h[f]={i:Number.isFinite(g)?g:p,value:y,counts:m.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=It()(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=Wt(this.aggregatedBins);try{for(n.s();!(t=n.n()).done;){var r=t.value;e[r.i]=r}}catch(t){n.e(t)}finally{n.f()}return e}},{key:"_updateMinMaxValues",value:function(){var t,e=0,n=0,r=3402823466e29,i=0,o=Wt(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(t){o.e(t)}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 Qt(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=It()(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 Qt(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=It()(e,2),r=n[0],i=n[1],o=this.sortedBins;switch(t){case"quantize":case"linear":return[o[r].value,o[i].value];case"quantile":return Vt(o.slice(r,i+1),(function(t){return t.value}));case"ordinal":return Ht(o,(function(t){return t.value}));default:return[o[r].value,o[i].value]}}}]),t}(),$t=n(50),te=n(12);function ee(t){return Number.isFinite(t)?t:0}function ne(t,e){for(var n,r,i=t.positions.value,o=1/0,a=-1/0,s=1/0,u=-1/0,c=0;c<e;c++)r=i[3*c],o=(n=i[3*c+1])<o?n:o,a=n>a?n:a,s=r<s?r:s,u=r>u?r:u;return{xMin:ee(s),xMax:ee(u),yMin:ee(o),yMax:ee(a)}}function re(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 ie(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!n)return{xOffset:e,yOffset:e};var r=t.yMin,i=t.yMax,o=(r+i)/2;return ae(e,o)}function oe(t,e,n,r){var i=ie(t,e,r!==te.a.CARTESIAN),o=function(t,e,n,r){var i=r.width,o=r.height,a=n===te.a.CARTESIAN?[-i/2,-o/2]:[-180,-90];m.a.assert(n===te.a.CARTESIAN||n===te.a.LNGLAT||n===te.a.DEFAULT);var s=t.xMin,u=t.yMin;return[-1*(re(s-a[0],e.xOffset)+a[0]),-1*(re(u-a[1],e.yOffset)+a[1])]}(t,i,r,n),a=t.xMin,s=t.yMin,u=t.xMax,c=t.yMax,l=u-a+i.xOffset,h=c-s+i.yOffset;return{gridOffset:i,translation:o,width:l,height:h,numCol:Math.ceil(l/i.xOffset),numRow:Math.ceil(h/i.yOffset)}}function ae(t,e){var n;return{yOffset:t/6378e3*(180/Math.PI),xOffset:(n=e,t/6378e3*(180/Math.PI)/Math.cos(n*Math.PI/180))}}function se(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 ue(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?se(Object(n),!0).forEach((function(e){g()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):se(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function ce(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return le(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 le(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=n.call(t)},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 le(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 he(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,c=o.positions.value,l=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,c=-1/0,l=0;l<e;l++)r=i[l*o],n=i[l*o+1],Number.isFinite(r)&&Number.isFinite(n)&&(a=n<a?n:a,s=n>s?n:s,u=r<u?r:u,c=r>c?r:c);return{xMin:u,xMax:c,yMin:a,yMax:s}}(o.positions,u),f=e.posOffset||[180,90],p=e.gridOffset||ie(h,i);if(p.xOffset<=0||p.yOffset<=0)return{gridHash:{},gridOffset:p};var d,A=a.width,g=a.height,m=Math.ceil(A/p.xOffset),y=Math.ceil(g/p.yOffset),v={},_=Object($t.a)(r),b=_.iterable,x=_.objectInfo,w=new Array(3),E=ce(b);try{for(E.s();!(d=E.n()).done;){var O=d.value;x.index++,w[0]=c[x.index*l],w[1]=c[x.index*l+1],w[2]=l>=3?c[x.index*l+2]:0;var S=s?a.project(w):w,T=It()(S,2),C=T[0],P=T[1];if(Number.isFinite(C)&&Number.isFinite(P)){var M=Math.floor((P+f[1])/p.yOffset),I=Math.floor((C+f[0])/p.xOffset);if(!s||I>=0&&I<m&&M>=0&&M<y){var B="".concat(M,"-").concat(I);v[B]=v[B]||{count:0,points:[],lonIdx:I,latIdx:M},v[B].count+=1,v[B].points.push({source:O,index:x.index})}}}}catch(t){E.e(t)}finally{E.f()}return{gridHash:v,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),c=parseInt(s[1],10),l=o++;i[l]=ue({index:l,position:[r[0]+n.xOffset*c,r[1]+n.yOffset*u]},e[a])}return i}(n);return{gridHash:n.gridHash,gridOffset:n.gridOffset,data:r}}function fe(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return pe(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 pe(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=n.call(t)},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 pe(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 de(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=d()(t);if(e){var i=d()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return f()(this,n)}}var Ae=function(t){l()(n,t);var e=de(n);function n(){return i()(this,n),e.apply(this,arguments)}return a()(n,[{key:"initializeAggregationLayer",value:function(t){var e=t.dimensions,r=this.context.gl;u()(d()(n.prototype),"initializeAggregationLayer",this).call(this,e),this.setState({layerData:{},gpuGridAggregator:new ot(r,{id:"".concat(this.id,"-gpu-aggregator")}),cpuGridAggregator:he})}},{key:"updateState",value:function(t){u()(d()(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(),u()(d()(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){m.a.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 Pt.a(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,c=void 0===u?[0,0,0]:u,l=e.boundingBox,h=e.projectPoints,f=e.gpuAggregation,p=e.numCol,d=e.numRow,A=t.props,g=this.context.viewport,m=this.getAttributes(),y=this.getNumInstances();if(f){var v=this.state.weights;r.run({weights:v,cellSize:[i.xOffset,i.yOffset],numCol:p,numRow:d,translation:s,scaling:c,vertexCount:y,projectPoints:h,attributes:m,moduleSettings:this.getModuleSettings()})}else{var _=n(A,{gridOffset:i,projectPoints:h,attributes:m,viewport:g,posOffset:o,boundingBox:l});this.setState({layerData:_})}}},{key:"_updateWeightBins",value:function(){var t=this.state.getValue,e=new Yt(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,c=o.totalCount,l=new Float32Array(n*r*4).fill(0),h=fe(a);try{for(h.s();!(t=h.n()).done;){var f=t.value,p=i[f.i],d=p.lonIdx,A=p.latIdx,g=f.value,m=f.counts,y=4*(d+A*n);l[y]=g,l[y+4-1]=m}}catch(t){h.e(t)}finally{h.f()}var v=new Float32Array([u,0,0,s]),_=new Float32Array([u,0,0,c]),b=new Float32Array([s,0,0,c]);this.updateResults({aggregationData:l,maxMinData:v,maxData:_,minData:b})}}]),n}(Ct);function ge(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=d()(t);if(e){var i=d()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return f()(this,n)}}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 ye(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){g()(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}g()(Ae,"layerName","GridAggregationLayer");var ve=ye(ye({},_t.defaultProps),{},{getPosition:{type:"accessor",value:function(t){return t.position}},getWeight:{type:"accessor",value:1},gpuAggregation:!0,aggregation:"SUM"}),_e={data:{props:["cellSizePixels"]},weights:{props:["aggregation"],accessors:["getWeight"]}},be=function(t){l()(n,t);var e=ge(n);function n(){return i()(this,n),e.apply(this,arguments)}return a()(n,[{key:"initializeState",value:function(){var t,e=this.context.gl;if(!_t.isSupported(e))return this.setState({supported:!1}),void m.a.error("ScreenGridLayer: ".concat(this.id," is not supported on this browser"))();u()(d()(n.prototype),"initializeAggregationLayer",this).call(this,{dimensions:_e,getCellSize:function(t){return t.cellSizePixels}});var r={count:{size:1,operation:R.SUM,needMax:!0,maxTexture:Q(e,{id:"".concat(this.id,"-max-texture")})}};this.setState({supported:!0,projectPoints:!0,weights:r,subLayerData:{attributes:{}},maxTexture:r.count.maxTexture,positionAttributeName:"positions",posOffset:[0,0],translation:[1,-1]}),this.getAttributeManager().add((t={},g()(t,"positions",{size:3,accessor:"getPosition",type:5130,fp64:this.use64bitPositions()}),g()(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){u()(d()(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",_t))(this.props,this.getSubLayerProps({id:"cell-layer",updateTriggers:o}),{data:{attributes:{instanceCounts:a}},maxTexture:e,numInstances:n*r})}},{key:"finalizeState",value:function(t){u()(d()(n.prototype),"finalizeState",this).call(this,t);var e=this.state,r=e.aggregationBuffer,i=e.maxBuffer,o=e.maxTexture;null==r||r.delete(),null==i||i.delete(),null==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=ot.getAggregationData(ye({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&&!ot.isSupported(this.context.gl)&&(m.a.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("positions"),s=this.state.dimensions,u=s.data,c=s.weights,l=a||o||r||this.isAggregationDirty(t,{compareAll:i,dimension:u}),h=this.isAggregationDirty(t,{dimension:c});this.setState({aggregationDataDirty:l,aggregationWeightsDirty:h});var f=this.context.viewport;if(r||n){var p=f.width,d=f.height,A=Math.ceil(p/e),g=Math.ceil(d/e);this.allocateResources(g,A),this.setState({scaling:[p/2,-d/2,1],gridOffset:{xOffset:e,yOffset:e},width:p,height:d,numCol:A,numRow:g})}h&&this._updateAccessors(t),(l||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=R[r]),this.setState({getValue:j(r,n,{data:i})})}},{key:"_resetResults",value:function(){var t=this.state.weights.count;t&&(t.aggregationData=null)}}]),n}(Ae);g()(be,"layerName","ScreenGridLayer"),g()(be,"defaultProps",ve);var xe=n(210),we=n(27),Ee=n.n(we);function Oe(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 Se(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Oe(Object(n),!0).forEach((function(e){g()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Oe(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Te(){}var Ce=["getBins","getDomain","getScaleFunc"],Pe=[{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}],Me=function(t){return t.cellSize},Ie=function(){function t(e){i()(this,t),this.state={layerData:{},dimensions:{}},this.changeFlags={},this.dimensionUpdaters={},this._getCellSize=e.getCellSize||Me,this._getAggregator=e.getAggregator,this._addDimension(e.dimensions||Pe)}return a()(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)||[]).forEach((function(t){return"function"==typeof t&&t()})),a=!0);return this.setState({aggregationDirty:a}),this.state}},{key:"setState",value:function(t){this.state=Se(Se({},this.state),t)}},{key:"setDimensionState",value:function(t,e){this.setState({dimensions:Se(Se({},this.state.dimensions),{},g()({},t,Se(Se({},this.state.dimensions[t]),e)))})}},{key:"normalizeResult",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.hexagons?Se({data:t.hexagons},t):t.layerData?Se({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?F(u,{data:e.data}):j(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,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];e.forEach((function(e){var n=e.key;t.dimensionUpdaters[n]=t.getDimensionUpdaters(e),t.state.dimensions[n]={getValue:null,domain:null,sortedBins:null,scaleFunc:Te}}))}},{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:Se({updater:this.getDimensionSortedBins},i),getDomain:Se({updater:this.getDimensionValueDomain},o),getScaleFunc:Se({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=Ce.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]={},Ce.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"!==Ee()(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 Yt(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,c=r.onSet,l=t[s.prop],h=t[a.prop]||this.state.dimensions[n].valueDomain,f=function(t){switch(t){case"quantize":return Lt;case"linear":return Dt;case"quantile":return jt;case"ordinal":return Ut;default:return Lt}}(u&&t[u.prop])(h,l);"object"===Ee()(c)&&"function"==typeof t[c.props]&&t[c.props](f.domain()),this.setDimensionState(n,{scaleFunc:f})}},{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,c=a.domain();return u>=c[0]&&u<=c[c.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].attributeAccessor:Te}}],[{key:"defaultDimensions",value:function(){return Pe}}]),t}();function Be(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=d()(t);if(e){var i=d()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return f()(this,n)}}function Re(){}var ke={colorDomain:null,colorRange:ht,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:he,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}},Le=function(t){l()(n,t);var e=Be(n);function n(){return i()(this,n),e.apply(this,arguments)}return a()(n,[{key:"initializeState",value:function(){var t=new Ie({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){u()(d()(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",xe.a),c=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:c}),{data:s.state.layerData.data})}}]),n}(Ct);g()(Le,"layerName","CPUGridLayer"),g()(Le,"defaultProps",ke);var De=n(160),je=Math.PI/3,Fe=[0,je,2*je,3*je,4*je,5*je];function ze(t){return t[0]}function Ue(t){return t[1]}function Ne(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Ge(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 Ge(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=n.call(t)},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 Ge(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 Ve(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?Ve(Object(n),!0).forEach((function(e){g()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ve(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function We(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=d()(t);if(e){var i=d()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return f()(this,n)}}function qe(){}var Xe={colorDomain:null,colorRange:ht,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:qe,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:qe,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().size,a=1/0,s=1/0,u=-1/0,c=-1/0;for(n=0;n<o*t.length;n+=o){var l=i[n],h=i[n+1];Number.isFinite(l)&&Number.isFinite(h)&&(a=Math.min(l,a),u=Math.max(l,u),s=Math.min(h,s),c=Math.max(h,c))}return[a,s,u,c].every(Number.isFinite)?[(a+u)/2,(s+c)/2]:null}(r,e):null,u=function(t,e,n){var r=e.getDistanceScales(n).unitsPerMeter;return t*r[0]}(i,o,s),c=[],l=Object($t.a)(r),h=l.iterable,f=l.objectInfo,p=a.positions.value,d=a.positions.getAccessor().size,A=Ne(h);try{for(A.s();!(n=A.n()).done;){var g=n.value;f.index++;var y=f.index*d,v=[p[y],p[y+1]];Number.isFinite(v[0])&&Number.isFinite(v[1])?c.push({screenCoord:o.projectFlat(v),source:g,index:f.index}):m.a.warn("HexagonLayer: invalid position")()}}catch(t){A.e(t)}finally{A.f()}return{hexagons:function(){var t,e,n,r=0,i=0,o=1,a=1,s=ze,u=Ue;function c(t){var r,i={},o=[],a=t.length;for(r=0;r<a;++r)if(!isNaN(l=+s.call(null,c=t[r],r,t))&&!isNaN(h=+u.call(null,c,r,t))){var c,l,h,f=Math.round(h/=n),p=Math.round(l=l/e-(1&f)/2),d=h-f;if(3*Math.abs(d)>1){var A=l-p,g=p+(l<p?-1:1)/2,m=f+(h<f?-1:1),y=l-g,v=h-m;A*A+d*d>y*y+v*v&&(p=g+(1&f?1:-1)/2,f=m)}var _=p+"-"+f,b=i[_];b?b.push(c):(o.push(b=i[_]=[c]),b.x=(p+(1&f)/2)*e,b.y=f*n)}return o}function l(t){var e=0,n=0;return Fe.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 c.hexagon=function(e){return"m"+l(null==e?t:+e).join("l")+"z"},c.centers=function(){for(var s=[],u=Math.round(i/n),c=Math.round(r/e),l=u*n;l<a+t;l+=n,++u)for(var h=c*e+(1&u)*e/2;h<o+e/2;h+=e)s.push([h,l]);return s},c.mesh=function(){var e=l(t).slice(0,4).join("l");return c.centers().map((function(t){return"M"+t+"m"+e})).join("")},c.x=function(t){return arguments.length?(s=t,c):s},c.y=function(t){return arguments.length?(u=t,c):u},c.radius=function(r){return arguments.length?(e=2*(t=+r)*Math.sin(je),n=1.5*t,c):t},c.size=function(t){return arguments.length?(r=i=0,o=+t[0],a=+t[1],c):[o-r,a-i]},c.extent=function(t){return arguments.length?(r=+t[0][0],i=+t[0][1],o=+t[1][0],a=+t[1][1],c):[[r,i],[o,a]]},c.radius(1)}().radius(u).x((function(t){return t.screenCoord[0]})).y((function(t){return t.screenCoord[1]}))(c).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}},Je=function(t){l()(n,t);var e=We(n);function n(){return i()(this,n),e.apply(this,arguments)}return a()(n,[{key:"initializeState",value:function(){var t=new Ie({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(u()(d()(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 m.a.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,c=this.getSubLayerClass("hexagon-cell",De.a),l=this._getSublayerUpdateTriggers();return new c(He(He({},u?{vertices:u,radius:1}:{radius:s.layerData.radiusCommon||1,radiusUnits:"common",angle:90}),{},{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}}),this.getSubLayerProps({id:"hexagon-cell",updateTriggers:l}),{data:s.layerData.data})}}]),n}(Ct);g()(Je,"layerName","HexagonLayer"),g()(Je,"defaultProps",Xe);var Ze,Qe=n(217),Ke=n(111),Ye={N:[0,.5],E:[.5,0],S:[0,-.5],W:[-.5,0],NE:[.5,.5],NW:[-.5,.5],SE:[.5,-.5],SW:[-.5,-.5]},$e=[Ye.W,Ye.SW,Ye.S],tn=[Ye.S,Ye.SE,Ye.E],en=[Ye.E,Ye.NE,Ye.N],nn=[Ye.NW,Ye.W,Ye.N],rn=[[-.5,1/6],[-.5,-1/6],[-1/6,-.5],[1/6,-.5]],on=[[-1/6,-.5],[1/6,-.5],[.5,-1/6],[.5,1/6]],an=[[.5,-1/6],[.5,1/6],[1/6,.5],[-1/6,.5]],sn=[[-.5,1/6],[-.5,-1/6],[1/6,.5],[-1/6,.5]],un=[Ye.W,Ye.SW,Ye.SE,Ye.E],cn=[Ye.S,Ye.SE,Ye.NE,Ye.N],ln=[Ye.NW,Ye.W,Ye.E,Ye.NE],hn=[Ye.NW,Ye.SW,Ye.S,Ye.N],fn=[[-.5,1/6],[-.5,-1/6],[.5,-1/6],[.5,1/6]],pn=[[-1/6,-.5],[1/6,-.5],[1/6,.5],[-1/6,.5]],dn=[Ye.NW,Ye.SW,Ye.SE,Ye.NE],An=[Ye.NW,Ye.SW,Ye.SE,Ye.E,Ye.N],gn=[Ye.W,Ye.SW,Ye.SE,Ye.NE,Ye.N],mn=[Ye.NW,Ye.W,Ye.S,Ye.SE,Ye.NE],yn=[Ye.NW,Ye.SW,Ye.S,Ye.E,Ye.NE],vn=[Ye.NW,Ye.W,[.5,-1/6],[.5,1/6],Ye.N],_n=[[-1/6,-.5],[1/6,-.5],Ye.E,Ye.NE,Ye.N],bn=[[-.5,1/6],[-.5,-1/6],Ye.S,Ye.SE,Ye.E],xn=[Ye.W,Ye.SW,Ye.S,[1/6,.5],[-1/6,.5]],wn=[Ye.NW,Ye.W,[-1/6,-.5],[1/6,-.5],Ye.N],En=[[-.5,1/6],[-.5,-1/6],Ye.E,Ye.NE,Ye.N],On=[Ye.S,Ye.SE,Ye.E,[1/6,.5],[-1/6,.5]],Sn=[Ye.W,Ye.SW,Ye.S,[.5,-1/6],[.5,1/6]],Tn=[Ye.W,Ye.SW,Ye.SE,Ye.E,[1/6,.5],[-1/6,.5]],Cn=[[-.5,1/6],[-.5,-1/6],Ye.S,Ye.SE,Ye.NE,Ye.N],Pn=[Ye.NW,Ye.W,[-1/6,-.5],[1/6,-.5],Ye.E,Ye.NE],Mn=[Ye.NW,Ye.SW,Ye.S,[.5,-1/6],[.5,1/6],Ye.N],In=[Ye.W,Ye.SW,Ye.S,Ye.E,Ye.NE,Ye.N],Bn=[Ye.NW,Ye.W,Ye.S,Ye.SE,Ye.E,Ye.N],Rn=[[-.5,1/6],[-.5,-1/6],[-1/6,-.5],[1/6,-.5],Ye.E,Ye.NE,Ye.N],kn=[Ye.W,Ye.SW,Ye.S,[.5,-1/6],[.5,1/6],[1/6,.5],[-1/6,.5]],Ln=[Ye.NW,Ye.W,[-1/6,-.5],[1/6,-.5],[.5,-1/6],[.5,1/6],Ye.N],Dn=[[-.5,1/6],[-.5,-1/6],Ye.S,Ye.SE,Ye.E,[1/6,.5],[-1/6,.5]],jn=[[-.5,1/6],[-.5,-1/6],[-1/6,-.5],[1/6,-.5],[.5,-1/6],[.5,1/6],[1/6,.5],[-1/6,.5]],Fn={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 zn(t){return parseInt(t,4)}var Un=(Ze={},g()(Ze,zn("0000"),[]),g()(Ze,zn("2222"),[]),g()(Ze,zn("2221"),[$e]),g()(Ze,zn("2212"),[tn]),g()(Ze,zn("2122"),[en]),g()(Ze,zn("1222"),[nn]),g()(Ze,zn("0001"),[$e]),g()(Ze,zn("0010"),[tn]),g()(Ze,zn("0100"),[en]),g()(Ze,zn("1000"),[nn]),g()(Ze,zn("2220"),[rn]),g()(Ze,zn("2202"),[on]),g()(Ze,zn("2022"),[an]),g()(Ze,zn("0222"),[sn]),g()(Ze,zn("0002"),[rn]),g()(Ze,zn("0020"),[on]),g()(Ze,zn("0200"),[an]),g()(Ze,zn("2000"),[sn]),g()(Ze,zn("0011"),[un]),g()(Ze,zn("0110"),[cn]),g()(Ze,zn("1100"),[ln]),g()(Ze,zn("1001"),[hn]),g()(Ze,zn("2211"),[un]),g()(Ze,zn("2112"),[cn]),g()(Ze,zn("1122"),[ln]),g()(Ze,zn("1221"),[hn]),g()(Ze,zn("2200"),[fn]),g()(Ze,zn("2002"),[pn]),g()(Ze,zn("0022"),[fn]),g()(Ze,zn("0220"),[pn]),g()(Ze,zn("1111"),[dn]),g()(Ze,zn("1211"),[An]),g()(Ze,zn("2111"),[gn]),g()(Ze,zn("1112"),[mn]),g()(Ze,zn("1121"),[yn]),g()(Ze,zn("1011"),[An]),g()(Ze,zn("0111"),[gn]),g()(Ze,zn("1110"),[mn]),g()(Ze,zn("1101"),[yn]),g()(Ze,zn("1200"),[vn]),g()(Ze,zn("0120"),[_n]),g()(Ze,zn("0012"),[bn]),g()(Ze,zn("2001"),[xn]),g()(Ze,zn("1022"),[vn]),g()(Ze,zn("2102"),[_n]),g()(Ze,zn("2210"),[bn]),g()(Ze,zn("0221"),[xn]),g()(Ze,zn("1002"),[wn]),g()(Ze,zn("2100"),[En]),g()(Ze,zn("0210"),[On]),g()(Ze,zn("0021"),[Sn]),g()(Ze,zn("1220"),[wn]),g()(Ze,zn("0122"),[En]),g()(Ze,zn("2012"),[On]),g()(Ze,zn("2201"),[Sn]),g()(Ze,zn("0211"),[Tn]),g()(Ze,zn("2110"),[Cn]),g()(Ze,zn("1102"),[Pn]),g()(Ze,zn("1021"),[Mn]),g()(Ze,zn("2011"),[Tn]),g()(Ze,zn("0112"),[Cn]),g()(Ze,zn("1120"),[Pn]),g()(Ze,zn("1201"),[Mn]),g()(Ze,zn("2101"),[In]),g()(Ze,zn("0121"),[In]),g()(Ze,zn("1012"),[Bn]),g()(Ze,zn("1210"),[Bn]),g()(Ze,zn("0101"),{0:[$e,en],1:[In],2:[In]}),g()(Ze,zn("1010"),{0:[nn,tn],1:[Bn],2:[Bn]}),g()(Ze,zn("2121"),{0:[In],1:[In],2:[$e,en]}),g()(Ze,zn("1212"),{0:[Bn],1:[Bn],2:[nn,tn]}),g()(Ze,zn("2120"),{0:[Rn],1:[Rn],2:[rn,en]}),g()(Ze,zn("2021"),{0:[kn],1:[kn],2:[$e,an]}),g()(Ze,zn("1202"),{0:[Ln],1:[Ln],2:[nn,on]}),g()(Ze,zn("0212"),{0:[Dn],1:[Dn],2:[tn,sn]}),g()(Ze,zn("0102"),{0:[rn,en],1:[Rn],2:[Rn]}),g()(Ze,zn("0201"),{0:[$e,an],1:[kn],2:[kn]}),g()(Ze,zn("1020"),{0:[nn,on],1:[Ln],2:[Ln]}),g()(Ze,zn("2010"),{0:[tn,sn],1:[Dn],2:[Dn]}),g()(Ze,zn("2020"),{0:[sn,on],1:[jn],2:[rn,an]}),g()(Ze,zn("0202"),{0:[an,rn],1:[jn],2:[sn,on]}),Ze);function Nn(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 Gn(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Nn(Object(n),!0).forEach((function(e){g()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Nn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Vn=1,Hn=2,Wn={zIndex:0,zOffset:.005};function qn(t,e){return Array.isArray(e)?t<e[0]?0:t<e[1]?1:2:t>=e?1:0}function Xn(t){var e=t.cellWeights,n=t.x,r=t.y,i=t.width,o=t.height,a=t.threshold;t.thresholdValue&&(m.a.deprecated("thresholdValue","threshold")(),a=t.thresholdValue);var s=n<0,u=n>=i-1,c=r<0,l=r>=o-1,h=s||u||c||l,f={},p={};s||l?p.top=0:(f.top=e[(r+1)*i+n],p.top=qn(f.top,a)),u||l?p.topRight=0:(f.topRight=e[(r+1)*i+n+1],p.topRight=qn(f.topRight,a)),u||c?p.right=0:(f.right=e[r*i+n+1],p.right=qn(f.right,a)),s||c?p.current=0:(f.current=e[r*i+n],p.current=qn(f.current,a));var d=p.top,A=p.topRight,g=p.right,y=p.current,v=-1;Number.isFinite(a)&&(v=d<<3|A<<2|g<<1|y),Array.isArray(a)&&(v=d<<6|A<<4|g<<2|y);var _=0;return h||(_=qn((f.top+f.topRight+f.right+f.current)/4,a)),{code:v,meanCode:_}}function Jn(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?Vn:s,c=Gn(Gn({},Wn),t.thresholdData),l=u===Hn?Un[o]:Fn[o];Array.isArray(l)||(l=l[a]);var h=c.zIndex*c.zOffset,f=(r+1)*n[0],p=(i+1)*n[1],d=e[0]+f,A=e[1]+p;if(u===Hn){var g=[];return l.forEach((function(t){var e=[];t.forEach((function(t){var r=d+t[0]*n[0],i=A+t[1]*n[1];e.push([r,i,h])})),g.push(e)})),g}var m=[];return l.forEach((function(t){t.forEach((function(t){var e=d+t[0]*n[0],r=A+t[1]*n[1];m.push([e,r,h])}))})),m}function Zn(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return Qn(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 Qn(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=n.call(t)},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 Qn(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 Kn(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=d()(t);if(e){var i=d()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return f()(this,n)}}var Yn=[255,255,255,255],$n={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},tr={data:{props:["cellSize"]},weights:{props:["aggregation"],accessors:["getWeight"]}},er=function(t){l()(n,t);var e=Kn(n);function n(){return i()(this,n),e.apply(this,arguments)}return a()(n,[{key:"initializeState",value:function(){var t;u()(d()(n.prototype),"initializeAggregationLayer",this).call(this,{dimensions:tr}),this.setState({contourData:{},projectPoints:!1,weights:{count:{size:1,operation:R.SUM}}}),this.getAttributeManager().add((t={},g()(t,"positions",{size:3,accessor:"getPosition",type:5130,fp64:this.use64bitPositions()}),g()(t,"count",{size:3,accessor:"getWeight"}),t))}},{key:"updateState",value:function(t){u()(d()(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",Qe.a),i=this.getSubLayerClass("bands",Ke.a);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||Yn},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||Yn}})]}},{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&&!ot.isSupported(this.context.gl)&&(m.a.warn("GPU Grid Aggregation not supported, falling back to CPU")(),s=!1);var u=s!==this.state.gpuAggregation;this.setState({gpuAggregation:s});var c=this.state.dimensions,l=this.isAttributeChanged("positions"),h=c.data,f=c.weights,p=this.state.boundingBox;if(l&&(p=ne(this.getAttributes(),this.getNumInstances()),this.setState({boundingBox:p})),l||a){var d=oe(p,r,o,i),A=d.gridOffset,g=d.translation,y=d.width,v=d.height,_=d.numCol,b=d.numRow;this.allocateResources(b,_),this.setState({gridOffset:A,boundingBox:p,translation:g,posOffset:g.slice(),gridOrigin:[-1*g[0],-1*g[1]],width:y,height:v,numCol:_,numRow:b})}var x=l||u||this.isAggregationDirty(t,{dimension:h,compareAll:s}),w=this.isAggregationDirty(t,{dimension:f});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=R[r]),this.setState({getValue:j(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=[],c=i[0],l=i[1],h=0,f=0,p=Zn(n);try{for(p.s();!(e=p.n()).done;)for(var d=e.value,A=d.contour,g=A.threshold,m=-1;m<c;m++)for(var y=-1;y<l;y++){var v=Xn({cellWeights:r,threshold:g,x:m,y:y,width:c,height:l}),_=v.code,b=v.meanCode,x={type:Hn,gridOrigin:o,cellSize:a,x:m,y:y,width:c,height:l,code:_,meanCode:b,thresholdData:d};if(Array.isArray(g)){x.type=Hn;var w,E=Zn(Jn(x));try{for(E.s();!(w=E.n()).done;){var O=w.value;u[f++]={vertices:O,contour:A}}}catch(t){E.e(t)}finally{E.f()}}else{x.type=Vn;for(var S=Jn(x),T=0;T<S.length;T+=2)s[h++]={start:S[T],end:S[T+1],contour:A}}}}catch(t){p.e(t)}finally{p.f()}return{contourSegments:s,contourPolygons:u}}({thresholdData:o,cellWeights:ot.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}(Ae);g()(er,"layerName","ContourLayer"),g()(er,"defaultProps",$n);var nr=n(221),rr=n(34),ir=n(272);function or(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 ar(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?or(Object(n),!0).forEach((function(e){g()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):or(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function sr(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=d()(t);if(e){var i=d()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return f()(this,n)}}var ur={colorDomain:null,colorRange:ht,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},cr=function(t){l()(n,t);var e=sr(n);function n(){return i()(this,n),e.apply(this,arguments)}return a()(n,[{key:"getShaders",value:function(){return u()(d()(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:[B.a,nr.a,ct.a,C]})}},{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 x.a(t,ar(ar({},this.getShaders()),{},{id:this.props.id,geometry:new ir.a,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,c=n.gridOrigin,l=n.gridOffset,h=n.elevationRange,f=n.colorMaxMinBuffer,p=n.elevationMaxMinBuffer,d=[Object(rr.b)(c[0]),Object(rr.b)(c[1])],A=[Object(rr.b)(l[0]),Object(rr.b)(l[1])],g=this.getDomainUniforms(),m=ft(this.props.colorRange);this.bindUniformBuffers(f,p),this.state.model.setUniforms(e).setUniforms(g).setUniforms({cellSize:r,offset:i,extruded:o,elevationScale:a,coverage:s,gridSize:u,gridOrigin:c,gridOriginLow:d,gridOffset:l,gridOffsetLow:A,colorRange:m,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}(lt.a);function lr(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 hr(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?lr(Object(n),!0).forEach((function(e){g()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):lr(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function fr(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=d()(t);if(e){var i=d()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return f()(this,n)}}g()(cr,"layerName","GPUGridCellLayer"),g()(cr,"defaultProps",ur);var pr={colorDomain:null,colorRange:ht,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},dr={data:{props:["cellSize","colorAggregation","elevationAggregation"]}},Ar=function(t){l()(n,t);var e=fr(n);function n(){return i()(this,n),e.apply(this,arguments)}return a()(n,[{key:"initializeState",value:function(t){var e,r=t.gl,i=ot.isSupported(r);i||m.a.error("GPUGridLayer is not supported on this browser, use GridLayer instead")(),u()(d()(n.prototype),"initializeAggregationLayer",this).call(this,{dimensions:dr}),this.setState({gpuAggregation:!0,projectPoints:!1,isSupported:i,weights:{color:{needMin:!0,needMax:!0,combineMaxMin:!0,maxMinBuffer:new Pt.a(r,{byteLength:16,accessor:{size:4,type:5126,divisor:1}})},elevation:{needMin:!0,needMax:!0,combineMaxMin:!0,maxMinBuffer:new Pt.a(r,{byteLength:16,accessor:{size:4,type:5126,divisor:1}})}},positionAttributeName:"positions"}),this.getAttributeManager().add((e={},g()(e,"positions",{size:3,accessor:"getPosition",type:5130,fp64:this.use64bitPositions()}),g()(e,"color",{size:3,accessor:"getColorWeight"}),g()(e,"elevation",{size:3,accessor:"getElevationWeight"}),e))}},{key:"updateState",value:function(t){!1!==this.state.isSupported&&(u()(d()(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],c=Math.floor(t/a[0]),l=t-c*a[0],h=Math.floor((c*u[1]+s[1]+90+u[1]/2)/u[1]),f=Math.floor((l*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],c=Math.floor(t/a[0]);return[(t-c*a[0])*u[0]+s[0],c*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=ot.getAggregationData(hr({pixelIndex:r},o.getData("color"))),u=ot.getAggregationData(hr({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 c=this.props,l=this.state.gridHash;if(!l){var h=this.state,f=h.gridOffset,p=h.translation,d=h.boundingBox,A=this.context.viewport;l=he(c,{gridOffset:f,attributes:this.getAttributes(),viewport:A,translation:p,boundingBox:d}).gridHash,this.setState({gridHash:l})}var g=l[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,c=this.state,l=c.weights,h=c.numRow,f=c.numCol,p=c.gridOrigin,d=c.gridOffset,A=l.color,g=l.elevation,m=ft(this.props.colorRange);return new(this.getSubLayerClass("gpu-grid-cell",cr))({gridSize:[f,h],gridOrigin:p,gridOffset:[d.xOffset,d.yOffset],colorRange:m,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:g.aggregationBuffer}},colorMaxMinBuffer:A.maxMinBuffer,elevationMaxMinBuffer:g.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||e.delete()})),u()(d()(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("positions"),c=u||this.isAttributeChanged(),l=this.state.boundingBox;if(u&&(l=ne(this.getAttributes(),this.getNumInstances()),this.setState({boundingBox:l})),u||a){var h=oe(l,r,o,i),f=h.gridOffset,p=h.translation,d=h.width,A=h.height,g=h.numCol,m=h.numRow;this.allocateResources(m,g),this.setState({gridOffset:f,translation:p,gridOrigin:[-1*p[0],-1*p[1]],width:d,height:A,numCol:g,numRow:m})}var y=c||this.isAggregationDirty(t,{dimension:s.data,compareAll:!0});y&&this._updateAccessors(t),this.setState({aggregationDataDirty:y})}},{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=R[n],a.operation=R[r]}}]),n}(Ae);function gr(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=d()(t);if(e){var i=d()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return f()(this,n)}}function mr(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 yr(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?mr(Object(n),!0).forEach((function(e){g()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):mr(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}g()(Ar,"layerName","GPUGridLayer"),g()(Ar,"defaultProps",pr);var vr=yr(yr(yr({},Ar.defaultProps),Le.defaultProps),{},{gpuAggregation:!1}),_r=function(t){l()(n,t);var e=gr(n);function n(){return i()(this,n),e.apply(this,arguments)}return a()(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",Ar):this.getSubLayerClass("CPU",Le))(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&&(!!ot.isSupported(this.context.gl)&&(0===n&&100===r&&(null===i&&null===o&&("quantile"!==a&&"ordinal"!==a))))}}]),n}(wt.a);function br(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return xr(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 xr(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=n.call(t)},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 xr(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 wr(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)]}function Er(t,e){return e[0]>=t[0]&&e[2]<=t[2]&&e[1]>=t[1]&&e[3]<=t[3]}g()(_r,"layerName","GridLayer"),g()(_r,"defaultProps",vr);var Or=new Float32Array(12);function Sr(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,r=0,i=br(t);try{for(i.s();!(e=i.n()).done;)for(var o=e.value,a=0;a<n;a++)Or[r++]=o[a]||0}catch(t){i.e(t)}finally{i.f()}return Or}function Tr(t,e,n){var r=It()(t,4),i=r[0],o=r[1],a=r[2],s=r[3],u=a-i,c=s-o,l=u,h=c;u/c<e/n?l=e/n*c:h=n/e*u,l<e&&(l=e,h=n);var f=(a+i)/2,p=(s+o)/2;return[f-l/2,p-h/2,f+l/2,p+h/2]}function Cr(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 Pr(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Cr(Object(n),!0).forEach((function(e){g()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Cr(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Mr(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=d()(t);if(e){var i=d()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return f()(this,n)}}var Ir=function(t){l()(n,t);var e=Mr(n);function n(){return i()(this,n),e.apply(this,arguments)}return a()(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:[B.a]}}},{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 x.a(t,Pr(Pr({},this.getShaders()),{},{id:this.props.id,geometry:new ut.a({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,c=r.aggregationMode,l=r.colorDomain;n.setUniforms(Pr(Pr({},e),{},{texture:i,maxTexture:o,colorTexture:a,intensity:s,threshold:u,aggregationMode:c,colorDomain:l})).draw()}}]),n}(lt.a);g()(Ir,"layerName","TriangleLayer");var Br;function Rr(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 kr(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Rr(Object(n),!0).forEach((function(e){g()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Rr(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Lr(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=d()(t);if(e){var i=d()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return f()(this,n)}}var Dr={mipmaps:!1,parameters:(Br={},g()(Br,10240,9729),g()(Br,10241,9729),g()(Br,10242,33071),g()(Br,10243,33071),Br),dataFormat:6408},jr=[0,0],Fr={SUM:0,MEAN:1},zr={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:ht,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}},Ur=[y.a.BLEND_EQUATION_MINMAX,y.a.TEXTURE_FLOAT],Nr=[y.a.COLOR_ATTACHMENT_RGBA32F,y.a.FLOAT_BLEND],Gr={data:{props:["radiusPixels"]}},Vr=function(t){l()(n,t);var e=Lr(n);function n(){return i()(this,n),e.apply(this,arguments)}return a()(n,[{key:"initializeState",value:function(){var t=this.context.gl;if(!Object(_.c)(t,Ur))return this.setState({supported:!1}),void m.a.error("HeatmapLayer: ".concat(this.id," is not supported on this browser"))();u()(d()(n.prototype),"initializeAggregationLayer",this).call(this,Gr),this.setState({supported:!0,colorDomain:jr}),this._setupTextureParams(),this._setupAttributes(),this._setupResources()}},{key:"shouldUpdateState",value:function(t){return t.changeFlags.somethingChanged}},{key:"updateState",value:function(t){this.state.supported&&(u()(d()(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,c=s.intensity,l=s.threshold,h=s.aggregation;return new(this.getSubLayerClass("triangle",Ir))(this.getSubLayerProps({id:"triangle-layer",updateTriggers:u}),{coordinateSystem:te.a.DEFAULT,data:{attributes:{positions:n,texCoords:r}},vertexCount:4,maxTexture:i,colorTexture:o,aggregationMode:Fr[h]||0,texture:e,intensity:c,threshold:l,colorDomain:a})}},{key:"finalizeState",value:function(t){u()(d()(n.prototype),"finalizeState",this).call(this,t);var e=this.state,r=e.weightsTransform,i=e.weightsTexture,o=e.maxWeightTransform,a=e.maxWeightsTexture,s=e.triPositionBuffer,c=e.triTexCoordBuffer,l=e.colorTexture,h=e.updateTimer;null==r||r.delete(),null==i||i.delete(),null==o||o.delete(),null==a||a.delete(),null==s||s.delete(),null==c||c.delete(),null==l||l.delete(),h&&clearTimeout(h)}},{key:"_getAttributeManager",value:function(){return new xt.a(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 X.a(t,kr({width:n,height:n,format:r,type:i},Dr)),maxWeightsTexture:new X.a(t,kr({format:r,type:i},Dr))})}},{key:"_setupAttributes",value:function(){this.getAttributeManager().add({positions:{size:3,type:5130,accessor:"getPosition"},weights:{size:1,accessor:"getWeight"}}),this.setState({positionAttributeName:"positions"})}},{key:"_setupTextureParams",value:function(){var t=this.context.gl,e=this.props.weightsTextureSize,n=Math.min(e,Object(v.f)(t,3379)),r=Object(_.c)(t,Nr),i=function(t){var e=t.gl;return t.floatTargetSupport?{format:Object(v.j)(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||m.a.warn("HeatmapLayer: ".concat(this.id," rendering to float texture not supported, fallingback to low precession format"))()}},{key:"getShaders",value:function(t){return u()(d()(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 w.a(n,kr({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 w.a(t,kr(kr({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 Pt.a(t,{byteLength:48,accessor:{size:3}}),triTexCoordBuffer:new Pt.a(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=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.context.viewport,n=[e.unproject([0,0]),e.unproject([e.width,0]),e.unproject([e.width,e.height]),e.unproject([0,e.height])].map((function(t){return t.map(Math.fround)})),r=wr(n),i={visibleWorldBounds:r,viewportCorners:n},o=!1;if(t||!this.state.worldBounds||!Er(this.state.worldBounds,r)){var a=this._worldToCommonBounds(r),s=this._commonToWorldBounds(a);this.props.coordinateSystem===te.a.LNGLAT&&(s[1]=Math.max(s[1],-85.051129),s[3]=Math.min(s[3],85.051129),s[0]=Math.max(s[0],-360),s[2]=Math.min(s[2],360));var u=this._worldToCommonBounds(s);i.worldBounds=s,i.normalizedCommonBounds=u,o=!0}return this.setState(i),o}},{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(Sr(i,3));var a=i.map((function(t){return e=o.projectPosition(t),n=r,i=It()(n,4),a=i[0],s=i[1],u=i[2],c=i[3],[(e[0]-a)/(u-a),(e[1]-s)/(c-s)];var e,n,i,a,s,u,c}));n.subData(Sr(a,2))}},{key:"_updateColorTexture",value:function(t){var e=t.props.colorRange,n=this.state.colorTexture,r=ft(e,!1,Uint8Array);n?n.setImageData({data:r,width:e.length}):n=new X.a(this.context.gl,kr({data:r,width:e.length,height:1},Dr)),this.setState({colorTexture:n})}},{key:"_updateWeightmap",value:function(){var t,e=this,n=this.props,r=n.radiusPixels,i=n.colorDomain,o=n.aggregation,a=this.state,s=a.weightsTransform,u=a.worldBounds,c=a.textureSize,l=a.weightsTexture,h=a.weightsScale;this.state.isWeightMapDirty=!1;var f=this._worldToCommonBounds(u,{useLayerCoordinateSystem:!0});if(i&&"SUM"===o){var p=this.context.viewport.distanceScales.metersPerUnit[2]*(f[2]-f[0])/c;this.state.colorDomain=i.map((function(t){return t*p*h}))}else this.state.colorDomain=i||jr;var d={radiusPixels:r,commonBounds:f,textureWidth:c,weightsScale:h};s.update({elementCount:this.getNumInstances()}),Object(v.o)(this.context.gl,{clearColor:[0,0,0,0]},(function(){s.run({uniforms:d,parameters:{blend:!0,depthTest:!1,blendFunc:[1,1],blendEquation:32774},clearRenderTarget:!0,attributes:e.getAttributes(),moduleSettings:e.getModuleSettings()})})),this._updateMaxWeightValue(),l.setParameters((t={},g()(t,10240,9729),g()(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]:{},i=r.useLayerCoordinateSystem,o=void 0!==i&&i,a=It()(t,4),s=a[0],u=a[1],c=a[2],l=a[3],h=this.context.viewport,f=this.state.textureSize,p=this.props.coordinateSystem,d=o&&(p===te.a.LNGLAT_OFFSETS||p===te.a.METER_OFFSETS),A=d?h.projectPosition(this.props.coordinateOrigin):[0,0],g=2*f/h.scale;return o&&!d?(e=this.projectPosition([s,u,0]),n=this.projectPosition([c,l,0])):(e=h.projectPosition([s,u,0]),n=h.projectPosition([c,l,0])),Tr([e[0]-A[0],e[1]-A[1],n[0]-A[0],n[1]-A[1]],g,g)}},{key:"_commonToWorldBounds",value:function(t){var e=It()(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}(Ct);g()(Vr,"layerName","HeatmapLayer"),g()(Vr,"defaultProps",zr),n.d(e,"ScreenGridLayer",(function(){return be})),n.d(e,"CPUGridLayer",(function(){return Le})),n.d(e,"HexagonLayer",(function(){return Je})),n.d(e,"ContourLayer",(function(){return er})),n.d(e,"GridLayer",(function(){return _r})),n.d(e,"GPUGridLayer",(function(){return Ar})),n.d(e,"AGGREGATION_OPERATION",(function(){return R})),n.d(e,"HeatmapLayer",(function(){return Vr})),n.d(e,"_GPUGridAggregator",(function(){return ot})),n.d(e,"_CPUAggregator",(function(){return Ie})),n.d(e,"_AggregationLayer",(function(){return Ct})),n.d(e,"_BinSorter",(function(){return Yt}))},function(t,e,n){"use strict";n.r(e);var r=n(178),i=n(293),o=n(195),a=n(287),s=n(8),u=n(181),c=n(234),l=n(197),h=n(222),f=n(32),p=n(292),d=n(71),A=n(104),g=n(102),m=n(223),y=n(224),v=n(286),_=n(58),b=n(45);const x={x:[2,0,1],y:[0,1,2],z:[1,2,0]};class w extends _.a{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{id:e=Object(b.c)("truncated-code-geometry")}=t,{indices:n,attributes:r}=function(t){const{bottomRadius:e=0,topRadius:n=0,height:r=1,nradial:i=10,nvertical:o=10,verticalAxis:a="y",topCap:s=!1,bottomCap:u=!1}=t,c=(s?2:0)+(u?2:0),l=(i+1)*(o+1+c),h=Math.atan2(e-n,r),f=Math.sin,p=Math.cos,d=Math.PI,A=p(h),g=f(h),m=s?-2:0,y=o+(u?2:0),v=i+1,_=new Uint16Array(i*(o+c)*6),b=x[a],w=new Float32Array(3*l),E=new Float32Array(3*l),O=new Float32Array(2*l);let S=0,T=0;for(let t=m;t<=y;t++){let a,s=t/o,u=r*s;t<0?(u=0,s=1,a=e):t>o?(u=r,s=1,a=n):a=e+t/o*(n-e),-2!==t&&t!==o+2||(a=0,s=0),u-=r/2;for(let e=0;e<v;e++){const n=f(e*d*2/i),r=p(e*d*2/i);w[S+b[0]]=n*a,w[S+b[1]]=u,w[S+b[2]]=r*a,E[S+b[0]]=t<0||t>o?0:n*A,E[S+b[1]]=t<0?-1:t>o?1:g,E[S+b[2]]=t<0||t>o?0:r*A,O[T+0]=e/i,O[T+1]=s,T+=2,S+=3}}for(let t=0;t<o+c;t++)for(let e=0;e<i;e++){const n=6*(t*i+e);_[n+0]=v*(t+0)+0+e,_[n+1]=v*(t+0)+1+e,_[n+2]=v*(t+1)+1+e,_[n+3]=v*(t+0)+0+e,_[n+4]=v*(t+1)+1+e,_[n+5]=v*(t+1)+0+e}return{indices:_,attributes:{POSITION:{size:3,value:w},NORMAL:{size:3,value:E},TEXCOORD_0:{size:2,value:O}}}}(t);super({...t,id:e,indices:n,attributes:{...r,...t.attributes}})}}class E extends w{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{id:e=Object(b.c)("cone-geometry"),radius:n=1,cap:r=!0}=t;super({...t,id:e,topRadius:0,topCap:Boolean(r),bottomCap:Boolean(r),bottomRadius:n})}}var O=n(272);class S extends w{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{id:e=Object(b.c)("cylinder-geometry"),radius:n=1}=t;super({...t,id:e,bottomRadius:n,topRadius:n})}}var T=n(81);const C=[-1,0,0,0,1,0,0,0,-1,0,0,1,0,-1,0,1,0,0],P=[3,4,5,3,5,1,3,1,0,3,0,4,4,0,2,4,2,5,2,0,1,5,2,1];class M extends _.a{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{id:e=Object(b.c)("ico-sphere-geometry")}=t,{indices:n,attributes:r}=function(t){const{iterations:e=0}=t,n=Math.PI,r=2*n,i=[...C];let o=[...P];i.push(),o.push();const a=(()=>{const t={};return(e,n)=>{const r=(e*=3)>(n*=3)?e:n,o="".concat(e<n?e:n,"|").concat(r);if(o in t)return t[o];const a=i[e],s=i[e+1],u=i[e+2];let c=(a+i[n])/2,l=(s+i[n+1])/2,h=(u+i[n+2])/2;const f=Math.sqrt(c*c+l*l+h*h);return c/=f,l/=f,h/=f,i.push(c,l,h),t[o]=i.length/3-1}})();for(let t=0;t<e;t++){const t=[];for(let e=0;e<o.length;e+=3){const n=a(o[e+0],o[e+1]),r=a(o[e+1],o[e+2]),i=a(o[e+2],o[e+0]);t.push(i,o[e+0],n,n,o[e+1],r,r,o[e+2],i,n,r,i)}o=t}const s=new Array(i.length),u=new Array(i.length/3*2);for(let t=o.length-3;t>=0;t-=3){const e=o[t+0],a=o[t+1],c=o[t+2],l=3*e,h=3*a,f=3*c,p=2*e,d=2*a,A=2*c,g=i[l+0],m=i[l+1],y=i[l+2],v=Math.acos(y/Math.sqrt(g*g+m*m+y*y)),_=Math.atan2(m,g)+n,b=v/n,x=1-_/r,w=i[h+0],E=i[h+1],O=i[h+2],S=Math.acos(O/Math.sqrt(w*w+E*E+O*O)),C=Math.atan2(E,w)+n,P=S/n,M=1-C/r,I=i[f+0],B=i[f+1],R=i[f+2],k=Math.acos(R/Math.sqrt(I*I+B*B+R*R)),L=Math.atan2(B,I)+n,D=k/n,j=1-L/r,F=[I-w,B-E,R-O],z=[g-w,m-E,y-O],U=new T.a(F).cross(z).normalize();let N;(0===x||0===M||0===j)&&(0===x||x>.5)&&(0===M||M>.5)&&(0===j||j>.5)&&(i.push(i[l+0],i[l+1],i[l+2]),N=i.length/3-1,o.push(N),u[2*N+0]=1,u[2*N+1]=b,s[3*N+0]=U.x,s[3*N+1]=U.y,s[3*N+2]=U.z,i.push(i[h+0],i[h+1],i[h+2]),N=i.length/3-1,o.push(N),u[2*N+0]=1,u[2*N+1]=P,s[3*N+0]=U.x,s[3*N+1]=U.y,s[3*N+2]=U.z,i.push(i[f+0],i[f+1],i[f+2]),N=i.length/3-1,o.push(N),u[2*N+0]=1,u[2*N+1]=D,s[3*N+0]=U.x,s[3*N+1]=U.y,s[3*N+2]=U.z),s[l+0]=s[h+0]=s[f+0]=U.x,s[l+1]=s[h+1]=s[f+1]=U.y,s[l+2]=s[h+2]=s[f+2]=U.z,u[p+0]=x,u[p+1]=b,u[d+0]=M,u[d+1]=P,u[A+0]=j,u[A+1]=D}return{indices:{size:1,value:new Uint16Array(o)},attributes:{POSITION:{size:3,value:new Float32Array(i)},NORMAL:{size:3,value:new Float32Array(s)},TEXCOORD_0:{size:2,value:new Float32Array(u)}}}}(t);super({...t,id:e,indices:n,attributes:{...r,...t.attributes}})}}class I extends _.a{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{id:e=Object(b.c)("plane-geometry")}=t,{indices:n,attributes:r}=function(t){const{type:e="x,y",offset:n=0,flipCull:r=!1,unpack:i=!1}=t,o=e.split(",");let a=t["".concat(o[0],"len")]||1;const s=t["".concat(o[1],"len")]||1,u=t["n".concat(o[0])]||1,c=t["n".concat(o[1])]||1,l=(u+1)*(c+1),h=new Float32Array(3*l),f=new Float32Array(3*l),p=new Float32Array(2*l);r&&(a=-a);let d=0,A=0;for(let t=0;t<=c;t++)for(let i=0;i<=u;i++){const o=i/u,l=t/c;switch(p[d+0]=r?1-o:o,p[d+1]=l,e){case"x,y":h[A+0]=a*o-.5*a,h[A+1]=s*l-.5*s,h[A+2]=n,f[A+0]=0,f[A+1]=0,f[A+2]=r?1:-1;break;case"x,z":h[A+0]=a*o-.5*a,h[A+1]=n,h[A+2]=s*l-.5*s,f[A+0]=0,f[A+1]=r?1:-1,f[A+2]=0;break;case"y,z":h[A+0]=n,h[A+1]=a*o-.5*a,h[A+2]=s*l-.5*s,f[A+0]=r?1:-1,f[A+1]=0,f[A+2]=0;break;default:throw new Error("PlaneGeometry: unknown type")}d+=2,A+=3}const g=u+1,m=new Uint16Array(u*c*6);for(let t=0;t<c;t++)for(let e=0;e<u;e++){const n=6*(t*u+e);m[n+0]=(t+0)*g+e,m[n+1]=(t+1)*g+e,m[n+2]=(t+0)*g+e+1,m[n+3]=(t+1)*g+e,m[n+4]=(t+1)*g+e+1,m[n+5]=(t+0)*g+e+1}const y={indices:{size:1,value:m},attributes:{POSITION:{size:3,value:h},NORMAL:{size:3,value:f},TEXCOORD_0:{size:2,value:p}}};return i?function(t){const{indices:e,attributes:n}=t;if(!e)return t;const r=e.value.length,i={};for(const t in n){const o=n[t],{constant:a,value:s,size:u}=o;if(a||!u)continue;const c=new s.constructor(r*u);for(let t=0;t<r;++t){const n=e.value[t];for(let e=0;e<u;e++)c[t*u+e]=s[n*u+e]}i[t]={size:u,value:c}}return{attributes:Object.assign({},n,i)}}(y):y}(t);super({...t,id:e,indices:n,attributes:{...r,...t.attributes}})}}class B extends _.a{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{id:e=Object(b.c)("sphere-geometry")}=t,{indices:n,attributes:r}=function(t){const{nlat:e=10,nlong:n=10}=t;let{radius:r=1}=t;const i=Math.PI-0,o=2*Math.PI-0,a=(e+1)*(n+1);if("number"==typeof r){const t=r;r=(e,n,r,i,o)=>t}const s=new Float32Array(3*a),u=new Float32Array(3*a),c=new Float32Array(2*a),l=new(a>65535?Uint32Array:Uint16Array)(e*n*6);for(let t=0;t<=e;t++)for(let a=0;a<=n;a++){const l=a/n,h=t/e,f=a+t*(n+1),p=2*f,d=3*f,A=o*l,g=i*h,m=Math.sin(A),y=Math.cos(A),v=Math.sin(g),_=Math.cos(g),b=y*v,x=_,w=m*v,E=r(b,x,w,l,h);s[d+0]=E*b,s[d+1]=E*x,s[d+2]=E*w,u[d+0]=b,u[d+1]=x,u[d+2]=w,c[p+0]=l,c[p+1]=1-h}const h=n+1;for(let t=0;t<n;t++)for(let n=0;n<e;n++){const r=6*(t*e+n);l[r+0]=n*h+t,l[r+1]=n*h+t+1,l[r+2]=(n+1)*h+t,l[r+3]=(n+1)*h+t,l[r+4]=n*h+t+1,l[r+5]=(n+1)*h+t+1}return{indices:{size:1,value:l},attributes:{POSITION:{size:3,value:s},NORMAL:{size:3,value:u},TEXCOORD_0:{size:2,value:c}}}}(t);super({...t,id:e,indices:n,attributes:{...r,...t.attributes}})}}n.d(e,"Model",(function(){return r.a})),n.d(e,"Transform",(function(){return i.a})),n.d(e,"ProgramManager",(function(){return o.a})),n.d(e,"Timeline",(function(){return a.a})),n.d(e,"instrumentGLContext",(function(){return s.h})),n.d(e,"isWebGL2",(function(){return s.j})),n.d(e,"FEATURES",(function(){return u.a})),n.d(e,"hasFeatures",(function(){return c.c})),n.d(e,"getParameters",(function(){return s.f})),n.d(e,"setParameters",(function(){return s.n})),n.d(e,"withParameters",(function(){return s.o})),n.d(e,"cssToDeviceRatio",(function(){return s.e})),n.d(e,"readPixelsToBuffer",(function(){return l.d})),n.d(e,"copyToTexture",(function(){return l.b})),n.d(e,"cloneTextureFrom",(function(){return h.a})),n.d(e,"Buffer",(function(){return f.a})),n.d(e,"Program",(function(){return p.a})),n.d(e,"Framebuffer",(function(){return d.a})),n.d(e,"Renderbuffer",(function(){return A.a})),n.d(e,"Texture2D",(function(){return g.a})),n.d(e,"TextureCube",(function(){return m.a})),n.d(e,"Texture3D",(function(){return y.a})),n.d(e,"TransformFeedback",(function(){return v.a})),n.d(e,"Geometry",(function(){return _.a})),n.d(e,"ConeGeometry",(function(){return E})),n.d(e,"CubeGeometry",(function(){return O.a})),n.d(e,"CylinderGeometry",(function(){return S})),n.d(e,"IcoSphereGeometry",(function(){return M})),n.d(e,"PlaneGeometry",(function(){return I})),n.d(e,"SphereGeometry",(function(){return B})),n.d(e,"TruncatedConeGeometry",(function(){return w}))},function(t,e,n){"use strict";n.r(e);var r=n(175),i=n.n(r),o=n(3),a=n.n(o),s=n(4),u=n.n(s),c=n(0),l=n.n(c),h=n(8),f=n(190),p=n(288),d=n(75);function A(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 g(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?A(Object(n),!0).forEach((function(e){l()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):A(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function m(t,e,n,r){if(n){if(n.userData._googleMap===t)return n;v(n)}var i={click:null,dblclick:null,mousemove:null,mouseout:null},o=new f.a(g(g({},r),{},{useDevicePixels:!!r.interleaved||r.useDevicePixels,style:r.interleaved?null:{pointerEvents:"none"},parent:y(e,r.style),initialViewState:{longitude:0,latitude:0,zoom:1},controller:!1})),a=function(e){i[e]=t.addListener(e,(function(t){return function(t,e,n){var r={type:e,offsetCenter:w(n,t),srcEvent:n};switch(e){case"click":r.tapCount=1,t._onPointerDown(r),t._onEvent(r);break;case"dblclick":r.type="click",r.tapCount=2,t._onEvent(r);break;case"mousemove":r.type="pointermove",t._onPointerMove(r);break;case"mouseout":r.type="pointerleave",t._onPointerMove(r);break;default:return}}(o,e,t)}))};for(var s in i)a(s);return o.userData._googleMap=t,o.userData._eventListeners=i,o}function y(t,e){var n,r,i=document.createElement("div");(i.style.position="absolute",Object.assign(i.style,e),"getPanes"in t)?null===(n=t.getPanes())||void 0===n||n.overlayLayer.appendChild(i):null===(r=t.getMap())||void 0===r||r.getDiv().appendChild(i);return i}function v(t){var e=t.userData._eventListeners;for(var n in e)e[n]&&e[n].remove();t.finalize()}function _(t,e){var n=b(t),r=n.width,i=n.height,o=e.getCameraParams(),a=o.center,s=o.heading,u=o.tilt,c=o.zoom,l=i?r/i:1,h=(new d.a).perspective({fovy:25*Math.PI/180,aspect:l,near:.75,far:3e14});return{width:r,height:i,viewState:{altitude:.5*h[5],bearing:s,latitude:a.lat(),longitude:a.lng(),pitch:u,projectionMatrix:h,repeat:!0,zoom:c-1}}}function b(t){var e=t.getDiv().firstChild;return{width:e.offsetWidth,height:e.offsetHeight}}function x(t,e,n){var r=new google.maps.Point(e,n),i=t.fromContainerPixelToLatLng(r);return[i.lng(),i.lat()]}function w(t,e){if(t.pixel)return t.pixel;var n=e.getViewports()[0].project([t.latLng.lng(),t.latLng.lat()]);return{x:n[0],y:n[1]}}var E=["width","height","left","top"];function O(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 S(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?O(Object(n),!0).forEach((function(e){l()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var T=function(){return!1},C={depthMask:!0,depthTest:!0,blend:!0,blendFunc:[770,771,1,771],blendEquation:32774};function P(){}var M={interleaved:!0},I=function(){function t(e){a()(this,t),l()(this,"props",{}),l()(this,"_map",null),l()(this,"_deck",null),l()(this,"_overlay",null),this.setProps(S(S({},M),e))}return u()(t,[{key:"setMap",value:function(t){var e=this;if(t!==this._map){var n;if(this._map)null===(n=this._overlay)||void 0===n||n.setMap(null),this._map=null;if(t){this._map=t;var r=google.maps.RenderingType.UNINITIALIZED;t.getRenderingType()!==r?this._createOverlay(t):t.addListener("renderingtype_changed",(function(){e._createOverlay(t)}))}}}},{key:"setProps",value:function(t){if(Object.assign(this.props,t),this._deck){if(t.style){var e=this._deck.canvas.parentElement.style;Object.assign(e,t.style),t.style=null}this._deck.setProps(t)}}},{key:"pickObject",value:function(t){return this._deck&&this._deck.pickObject(t)}},{key:"pickMultipleObjects",value:function(t){return this._deck&&this._deck.pickMultipleObjects(t)}},{key:"pickObjects",value:function(t){return this._deck&&this._deck.pickObjects(t)}},{key:"finalize",value:function(){this.setMap(null),this._deck&&(v(this._deck),this._deck=null)}},{key:"_createOverlay",value:function(t){var e=this.props.interleaved,n=google.maps.RenderingType,r=n.VECTOR,i=n.UNINITIALIZED,o=t.getRenderingType();if(o!==i){var a=new(o===r&&google.maps.WebGLOverlayView?google.maps.WebGLOverlayView:google.maps.OverlayView);a instanceof google.maps.WebGLOverlayView?(e?(a.onAdd=P,a.onContextRestored=this._onContextRestored.bind(this),a.onDraw=this._onDrawVectorInterleaved.bind(this)):(a.onAdd=this._onAdd.bind(this),a.onContextRestored=P,a.onDraw=this._onDrawVectorOverlay.bind(this)),a.onContextLost=this._onContextLost.bind(this)):(a.onAdd=this._onAdd.bind(this),a.draw=this._onDrawRaster.bind(this)),a.onRemove=this._onRemove.bind(this),this._overlay=a,this._overlay.setMap(t)}}},{key:"_onAdd",value:function(){this._deck=m(this._map,this._overlay,this._deck,this.props)}},{key:"_onContextRestored",value:function(t){var e=this,n=t.gl;if(this._map&&this._overlay){var r=m(this._map,this._overlay,this._deck,S({gl:n,_customRender:function(){e._overlay&&e._overlay.requestRedraw()}},this.props));this._deck=r;var i=r.animationLoop;i._renderFrame=function(){var t=n.getParameter(34964);Object(h.o)(n,{},(function(){i.onRender()})),n.bindBuffer(34962,t)}}}},{key:"_onContextLost",value:function(){this._deck&&(v(this._deck),this._deck=null)}},{key:"_onRemove",value:function(){var t;null===(t=this._deck)||void 0===t||t.setProps({layerFilter:T})}},{key:"_onDrawRaster",value:function(){if(this._deck&&this._map){var t=this._deck,e=function(t,e){var n=b(t),r=n.width,i=n.height,o=e.getProjection(),a=t.getBounds();if(!a)return{width:r,height:i,left:0,top:0};var s=a.getNorthEast(),u=a.getSouthWest(),c=o.fromLatLngToDivPixel(s),l=o.fromLatLngToDivPixel(u),h=x(o,r/2,i/2),f=new google.maps.LatLng(0,h[0]),d=o.fromLatLngToContainerPixel(f),A=o.fromLatLngToDivPixel(f);if(!(c&&l&&A&&d))return{width:r,height:i,left:0,top:0};var g=Math.round(A.x-d.x),m=A.y-d.y,y=x(o,r/2,0),v=x(o,r/2,i),_=h[1],w=h[0];if(Math.abs(_)>85.05113){_=_>0?85.05113:-85.05113;var E=new google.maps.LatLng(_,w);m+=o.fromLatLngToContainerPixel(E).y-i/2}m=Math.round(m);var O=180*new p.a(y).sub(v).verticalAngle()/Math.PI;O<0&&(O+=360);var S,T=t.getHeading()||0,C=t.getZoom()-1;if(0===O)S=i?(l.y-c.y)/i:1;else if(O===T){var P=new p.a([c.x,c.y]).sub([l.x,l.y]).len(),M=new p.a([r,-i]).len();S=M?P/M:1}return{width:r,height:i,left:g,top:m,zoom:C+=Math.log2(S||1),bearing:O,pitch:t.getTilt(),latitude:_,longitude:w}}(this._map,this._overlay),n=e.width,r=e.height,o=e.left,a=e.top,s=i()(e,E),u=t.canvas.parentElement.style;u.left="".concat(o,"px"),u.top="".concat(a,"px");t.setProps({width:n,height:r,viewState:S({altitude:1e4,repeat:!0},s)}),t.redraw()}}},{key:"_onDrawVectorInterleaved",value:function(t){var e=t.gl,n=t.transformer;if(this._deck&&this._map){var r=this._deck;if(r.setProps(S(S({},_(this._map,n)),{},{width:null,height:null})),r.isInitialized){var i=Object(h.f)(e,36006);r.setProps({_framebuffer:i}),r.needsRedraw({clearRedrawFlags:!0}),Object(h.n)(e,{viewport:[0,0,e.canvas.width,e.canvas.height],scissor:[0,0,e.canvas.width,e.canvas.height],stencilFunc:[519,0,255,519,0,255]}),Object(h.o)(e,C,(function(){r._drawLayers("google-vector",{clearCanvas:!1})}))}}}},{key:"_onDrawVectorOverlay",value:function(t){var e=t.transformer;if(this._deck&&this._map){var n=this._deck;n.setProps(S({},_(this._map,e))),n.redraw()}}}]),t}();n.d(e,"GoogleMapsOverlay",(function(){return I}))},function(t,e,n){"use strict";n.r(e);var r=n(0),i=n.n(r),o=n(3),a=n.n(o),s=n(4),u=n.n(s),c=n(7),l=n.n(c),h=n(5),f=n.n(h),p=n(6),d=n.n(p),A=n(2),g=n.n(A),m=n(133),y=n(121);function v(t){switch(t){case"int8":return Int8Array;case"uint8":return Uint8Array;case"int16":return Int16Array;case"uint16":return Uint16Array;case"float32":return Float32Array;case"float64":return Float64Array;case"int32":return Int32Array;case"uint32":return Uint32Array;case"int64":return BigInt64Array;case"uint64":return BigUint64Array;default:throw new Error("Unrecognized dtype ".concat(t))}}function _(t,e){if(!t)return null;for(var n in t){var r=t[n].attributes;for(var i in r){var o=r[i],a=o.dtype,s=o.value,u=v(a);r[i].value=new u(s.buffer)}}return t}function b(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 x(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?b(Object(n),!0).forEach((function(e){i()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):b(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function w(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=g()(t);if(e){var i=g()(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return d()(this,n)}}n.d(e,"default",(function(){return E}));var E=function(t){f()(n,t);var e=w(n);function n(){return a()(this,n),e.apply(this,arguments)}return u()(n,[{key:"defaults",value:function(){return x(x({},l()(g()(n.prototype),"defaults",this).call(this)),{},{_model_name:n.model_name,_model_module:n.model_module,_model_module_version:n.model_module_version,_view_name:n.view_name,_view_module:n.view_module,_view_module_version:n.view_module_version,custom_libraries:[],json_input:null,mapbox_key:null,selected_data:[],data_buffer:null,tooltip:null,width:"100%",height:500,js_warning:!1})}}],[{key:"serializers",get:function(){return x(x({},m.DOMWidgetModel.serializers),{},{data_buffer:{deserialize:_}})}},{key:"model_name",get:function(){return"JupyterTransportModel"}},{key:"model_module",get:function(){return y.MODULE_NAME}},{key:"model_module_version",get:function(){return y.MODULE_VERSION}},{key:"view_name",get:function(){return"JupyterTransportView"}},{key:"view_module",get:function(){return y.MODULE_NAME}},{key:"view_module_version",get:function(){return y.MODULE_VERSION}}]),n}(m.DOMWidgetModel)},function(t,e,n){"use strict";n.r(e);var r=n(40),i=n(166),o=n(176),a=n(124),s=n(85);function u(){i.a.setCallbacks({onInitialize:function(t){var e=t.transport,n=function(t){var e=t.jupyterModel;if(!e)throw new Error("deck.gl playground currently only works with the Jupyter Widget Transport");return{width:e.get("width"),height:e.get("height"),customLibraries:e.get("custom_libraries"),mapboxApiKey:e.get("mapbox_key"),jsonInput:e.get("json_input"),tooltip:e.get("tooltip")}}(e),r=n.width,i=n.height,u=n.customLibraries,l=n.mapboxApiKey,h=n.jsonInput,f=n.tooltip;Object(a.b)();var p=e.getRootDOMElement(),d=Object(o.a)(r,i);p.appendChild(d);var A=JSON.parse(h),g=Object(s.createDeck)({mapboxApiKey:l,container:d,jsonInput:A,tooltip:f,handleEvent:function(t,n){return function(t,e,n){if("hover"===e&&!n.picked&&-1===n.index)return;var r=JSON.parse(JSON.stringify(n,c));t.sendJSONMessage(e,r)}(e,t,n)},customLibraries:u});e.userData.deck=g},onFinalize:function(t){t.transport.userData.deck.finalize()},onMessage:function(t){var e,n=t.transport,r=t.type,i=t.json,o=(t.binary,n.userData.deck);switch(r){case"json":e=s.jsonConverter.convert(i),o.setProps(e);break;case"json-with-binary":e=s.jsonConverter.convert(i);var a=function(t){for(var e=t.binary,n=t.convertedJson,r=0;r<n.layers.length;r++){var i=n.layers[r].id,o=n.layers[r];n.layers[r]=o.clone({data:e[i]})}return n}({binary:n.jupyterModel.get("data_buffer"),convertedJson:e});o.setProps(a)}}})}function c(t,e){return e instanceof r.Layer?e.id:e}n.d(e,"initPlayground",(function(){return u})),n.d(e,"createDeck",(function(){return s.createDeck})),n.d(e,"updateDeck",(function(){return s.updateDeck}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var r=n(58),i=n(45);const o=new Uint16Array([0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23]),a=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]),s=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]),u=new Float32Array([0,0,1,0,1,1,0,1,1,0,1,1,0,1,0,0,0,1,0,0,1,0,1,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,0,0,0,1,0,1,1,0,1]),c={POSITION:{size:3,value:new Float32Array(a)},NORMAL:{size:3,value:new Float32Array(s)},TEXCOORD_0:{size:2,value:new Float32Array(u)}};class l extends r.a{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{id:e=Object(i.c)("cube-geometry")}=t;super({...t,id:e,indices:{size:1,value:new Uint16Array(o)},attributes:{...c,...t.attributes}})}}},function(t,e,n){"use strict";var r=n(1),i=n(134);Object(i.a)();class o{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"sessionStorage";Object(r.a)(this,"storage",void 0),Object(r.a)(this,"id",void 0),Object(r.a)(this,"config",{}),this.storage=function(t){try{const e=window[t],n="__storage_test__";return e.setItem(n,n),e.removeItem(n),e}catch(t){return null}}(n),this.id=t,this.config={},Object.assign(this.config,e),this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(t){return this.config={},this.updateConfiguration(t)}updateConfiguration(t){if(Object.assign(this.config,t),this.storage){const t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}return this}_loadConfiguration(){let t={};if(this.storage){const e=this.storage.getItem(this.id);t=e?JSON.parse(e):{}}return Object.assign(this.config,t),this}}function a(t,e,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:600;const i=t.src.replace(/\(/g,"%28").replace(/\)/g,"%29");t.width>r&&(n=Math.min(n,r/t.width));const 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]}let s;function u(t){return"string"==typeof t?s[t.toUpperCase()]||s.WHITE:t}function c(t,e){if(!t)throw new Error(e||"Assertion failed")}!function(t){t[t.BLACK=30]="BLACK",t[t.RED=31]="RED",t[t.GREEN=32]="GREEN",t[t.YELLOW=33]="YELLOW",t[t.BLUE=34]="BLUE",t[t.MAGENTA=35]="MAGENTA",t[t.CYAN=36]="CYAN",t[t.WHITE=37]="WHITE",t[t.BRIGHT_BLACK=90]="BRIGHT_BLACK",t[t.BRIGHT_RED=91]="BRIGHT_RED",t[t.BRIGHT_GREEN=92]="BRIGHT_GREEN",t[t.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",t[t.BRIGHT_BLUE=94]="BRIGHT_BLUE",t[t.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",t[t.BRIGHT_CYAN=96]="BRIGHT_CYAN",t[t.BRIGHT_WHITE=97]="BRIGHT_WHITE"}(s||(s={}));var l=n(93);function h(){let t;var e,n;if(i.a&&"performance"in l.b)t=null===l.b||void 0===l.b||null===(e=l.b.performance)||void 0===e||null===(n=e.now)||void 0===n?void 0:n.call(e);else if("hrtime"in l.a){var r;const e=null===l.a||void 0===l.a||null===(r=l.a.hrtime)||void 0===r?void 0:r.call(l.a);t=1e3*e[0]+e[1]/1e6}else t=Date.now();return t}n.d(e,"a",(function(){return m}));const f={debug:i.a&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},p={enabled:!0,level:0};function d(){}const A={},g={once:!0};class m{constructor(){let{id:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:""};Object(r.a)(this,"id",void 0),Object(r.a)(this,"VERSION","8.9.0-alpha.5"),Object(r.a)(this,"_startTs",h()),Object(r.a)(this,"_deltaTs",h()),Object(r.a)(this,"_storage",void 0),Object(r.a)(this,"userData",{}),Object(r.a)(this,"LOG_THROTTLE_TIMEOUT",0),this.id=t,this._storage=new o("__probe-".concat(this.id,"__"),p),this.userData={},this.timeStamp("".concat(this.id," started")),function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["constructor"];const n=Object.getPrototypeOf(t),r=Object.getOwnPropertyNames(n);for(const n of r)"function"==typeof t[n]&&(e.find(t=>n===t)||(t[n]=t[n].bind(t)))}(this),Object.seal(this)}set level(t){this.setLevel(t)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((h()-this._startTs).toPrecision(10))}getDelta(){return Number((h()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._storage.updateConfiguration({enabled:t}),this}setLevel(t){return this._storage.updateConfiguration({level:t}),this}get(t){return this._storage.config[t]}set(t,e){this._storage.updateConfiguration({[t]:e})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(t,e){c(t,e)}warn(t){return this._getLogFunction(0,t,f.warn,arguments,g)}error(t){return this._getLogFunction(0,t,f.error,arguments)}deprecated(t,e){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(e,"` instead"))}removed(t,e){return this.error("`".concat(t,"` has been removed. Use `").concat(e,"` instead"))}probe(t,e){return this._getLogFunction(t,e,f.log,arguments,{time:!0,once:!0})}log(t,e){return this._getLogFunction(t,e,f.debug,arguments)}info(t,e){return this._getLogFunction(t,e,console.info,arguments)}once(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,f.debug||f.info,arguments,g)}table(t,e,n){return e?this._getLogFunction(t,e,console.table||d,n&&[n],{tag:_(e)}):d}image(t){let{logLevel:e,priority:r,image:o,message:s="",scale:u=1}=t;return this._shouldLog(e||r)?i.a?function(t){let{image:e,message:n="",scale:r=1}=t;if("string"==typeof e){const t=new Image;return t.onload=()=>{const e=a(t,n,r);console.log(...e)},t.src=e,d}const i=e.nodeName||"";if("img"===i.toLowerCase())return console.log(...a(e,n,r)),d;if("canvas"===i.toLowerCase()){const t=new Image;return t.onload=()=>console.log(...a(t,n,r)),t.src=e.toDataURL(),d}return d}({image:o,message:s,scale:u}):function(t){let{image:e,message:r="",scale:i=1}=t,o=null;try{o=n(248)}catch(t){}if(o)return()=>o(e,{fit:"box",width:"".concat(Math.round(80*i),"%")}).then(t=>console.log(t));return d}({image:o,message:s,scale:u}):d}time(t,e){return this._getLogFunction(t,e,console.time?console.time:console.info)}timeEnd(t,e){return this._getLogFunction(t,e,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,e){return this._getLogFunction(t,e,console.timeStamp||d)}group(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{collapsed:!1};const r=v({logLevel:t,message:e,opts:n}),{collapsed:i}=n;return r.method=(i?console.groupCollapsed:console.group)||console.info,this._getLogFunction(r)}groupCollapsed(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.group(t,e,Object.assign({},n,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||d)}withGroup(t,e,n){this.group(t,e)();try{n()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=y(t)}_getLogFunction(t,e,n,r,o){if(this._shouldLog(t)){o=v({logLevel:t,message:e,args:r,opts:o}),c(n=n||o.method),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=h();const a=o.tag||o.message;if(o.once){if(A[a])return d;A[a]=h()}return e=function(t,e,n){if("string"==typeof e){const s=n.time?function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;const n=Math.max(e-t.length,0);return"".concat(" ".repeat(n)).concat(t)}(function(t){let e;return e=t<10?"".concat(t.toFixed(2),"ms"):t<100?"".concat(t.toFixed(1),"ms"):t<1e3?"".concat(t.toFixed(0),"ms"):"".concat((t/1e3).toFixed(2),"s"),e}(n.total)):"";e=n.time?"".concat(t,": ").concat(s," ").concat(e):"".concat(t,": ").concat(e),r=e,o=n.color,a=n.background,i.a||"string"!=typeof r||(o&&(o=u(o),r="[".concat(o,"m").concat(r,"")),a&&(o=u(a),r="[".concat(a+10,"m").concat(r,""))),e=r}var r,o,a;return e}(this.id,o.message,o),n.bind(console,e,...o.args)}return d}}function y(t){if(!t)return 0;let e;switch(typeof t){case"number":e=t;break;case"object":e=t.logLevel||t.priority||0;break;default:return 0}return c(Number.isFinite(e)&&e>=0),e}function v(t){const{logLevel:e,message:n}=t;t.logLevel=y(e);const r=t.args?Array.from(t.args):[];for(;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());const i=typeof t.message;return c("string"===i||"object"===i),Object.assign(t,{args:r},t.opts)}function _(t){for(const e in t)for(const n in t[e])return n||"untitled";return"empty"}Object(r.a)(m,"VERSION","8.9.0-alpha.5")},,,,,,,,,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(134),i=n(167);const o=globalThis;function a(t){if(!t&&!Object(r.a)())return"Node";if(Object(i.a)(t))return"Electron";const e="undefined"!=typeof navigator?navigator:{},n=t||e.userAgent||"";if(n.indexOf("Edge")>-1)return"Edge";const a=-1!==n.indexOf("MSIE "),s=-1!==n.indexOf("Trident/");return a||s?"IE":o.chrome?"Chrome":o.safari?"Safari":o.mozInnerScreenX?"Firefox":"Unknown"}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(8),i=n(38),o=n(32),a=n(45);class s extends i.a{get[Symbol.toStringTag](){return"TransformFeedback"}static isSupported(t){return Object(r.j)(t)}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(r.a)(t),super(t,e),this.initialize(e),this.stubRemovedMethods("TransformFeedback","v6.0",["pause","resume"]),Object.seal(this)}initialize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.buffers={},this.unused={},this.configuration=null,this.bindOnUse=!0,Object(a.a)(this.buffers)||this.bind(()=>this._unbindBuffers()),this.setProps(t),this}setProps(t){"program"in t&&(this.configuration=t.program&&t.program.configuration),"configuration"in t&&(this.configuration=t.configuration),"bindOnUse"in t&&(t=t.bindOnUse),"buffers"in t&&this.setBuffers(t.buffers)}setBuffers(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.bind(()=>{for(const e in t)this.setBuffer(e,t[e])}),this}setBuffer(t,e){const n=this._getVaryingIndex(t),{buffer:i,byteSize:o,byteOffset:a}=this._getBufferParams(e);return n<0?(this.unused[t]=i,r.k.warn("".concat(this.id," unused varying buffer ").concat(t))(),this):(this.buffers[n]=e,this.bindOnUse||this._bindBuffer(n,i,a,o),this)}begin(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.gl.bindTransformFeedback(36386,this.handle),this._bindBuffers(),this.gl.beginTransformFeedback(t),this}end(){return this.gl.endTransformFeedback(),this._unbindBuffers(),this.gl.bindTransformFeedback(36386,null),this}_getBufferParams(t){let e,n,r;return t instanceof o.a==!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}}_getVaryingInfo(t){return this.configuration&&this.configuration.getVaryingInfo(t)}_getVaryingIndex(t){if(this.configuration)return this.configuration.getVaryingInfo(t).location;const e=Number(t);return Number.isFinite(e)?e:-1}_bindBuffers(){if(this.bindOnUse)for(const t in this.buffers){const{buffer:e,byteSize:n,byteOffset:r}=this._getBufferParams(this.buffers[t]);this._bindBuffer(t,e,r,n)}}_unbindBuffers(){if(this.bindOnUse)for(const t in this.buffers)this._bindBuffer(t,null)}_bindBuffer(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3?arguments[3]:void 0;const i=e&&e.handle;return i&&void 0!==r?this.gl.bindBufferRange(35982,t,i,n,r):this.gl.bindBufferBase(35982,t,i),this}_createHandle(){return this.gl.createTransformFeedback()}_deleteHandle(){this.gl.deleteTransformFeedback(this.handle)}_bindHandle(t){this.gl.bindTransformFeedback(36386,this.handle)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));let r=1,i=1;class o{constructor(){this.time=0,this.channels=new Map,this.animations=new Map,this.playing=!1,this.lastEngineTime=-1}addChannel(t){const{delay:e=0,duration:n=Number.POSITIVE_INFINITY,rate:i=1,repeat:o=1}=t,a=r++,s={time:0,delay:e,duration:n,rate:i,repeat:o};return this._setChannelTime(s,this.time),this.channels.set(a,s),a}removeChannel(t){this.channels.delete(t);for(const[e,n]of this.animations)n.channel===t&&this.detachAnimation(e)}isFinished(t){const e=this.channels.get(t);return void 0!==e&&this.time>=e.delay+e.duration*e.repeat}getTime(t){if(void 0===t)return this.time;const e=this.channels.get(t);return void 0===e?-1:e.time}setTime(t){this.time=Math.max(0,t);const e=this.channels.values();for(const t of e)this._setChannelTime(t,this.time);const n=this.animations.values();for(const t of n){const{animation:e,channel:n}=t;e.setTime(this.getTime(n))}}play(){this.playing=!0}pause(){this.playing=!1,this.lastEngineTime=-1}reset(){this.setTime(0)}attachAnimation(t,e){const n=i++;return this.animations.set(n,{animation:t,channel:e}),t.setTime(this.getTime(e)),n}detachAnimation(t){this.animations.delete(t)}update(t){this.playing&&(-1===this.lastEngineTime&&(this.lastEngineTime=t),this.setTime(this.time+(t-this.lastEngineTime)),this.lastEngineTime=t)}_setChannelTime(t,e){const n=e-t.delay;n>=t.duration*t.repeat?t.time=t.duration*t.rate:(t.time=Math.max(0,n)%t.duration,t.time*=t.rate)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(114),i=n(13),o=n(22),a=n(33),s=n(53);class u extends r.a{constructor(t=0,e=0){super(2),Object(i.f)(t)&&1===arguments.length?this.copy(t):(i.b.debug&&(Object(o.a)(t),Object(o.a)(e)),this[0]=t,this[1]=e)}set(t,e){return this[0]=t,this[1]=e,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this.check()}fromObject(t){return i.b.debug&&(Object(o.a)(t.x),Object(o.a)(t.y)),this[0]=t.x,this[1]=t.y,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t}get ELEMENTS(){return 2}horizontalAngle(){return Math.atan2(this.y,this.x)}verticalAngle(){return Math.atan2(this.x,this.y)}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return a.j(this,this,t),this.check()}transformAsVector(t){return Object(s.a)(this,this,t),this.check()}transformByMatrix3(t){return a.i(this,this,t),this.check()}transformByMatrix2x3(t){return a.h(this,this,t),this.check()}transformByMatrix2(t){return a.g(this,this,t),this.check()}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(47),i=n(126),o=n(49);const a={};async function s(t,e=null,n={}){return e&&(t=function(t,e,n){if(t.startsWith("http"))return t;const i=n.modules||{};if(i[t])return i[t];if(!r.b)return"modules/".concat(e,"/dist/libs/").concat(t);if(n.CDN)return Object(o.a)(n.CDN.startsWith("http")),"".concat(n.CDN,"/").concat(e,"@").concat("3.2.10","/dist/libs/").concat(t);if(r.d)return"../src/libs/".concat(t);return"modules/".concat(e,"/src/libs/").concat(t)}(t,e,n)),a[t]=a[t]||async function(t){if(t.endsWith("wasm")){const e=await fetch(t);return await e.arrayBuffer()}if(!r.b)try{return i&&i.requireFromFile&&await i.requireFromFile(t)}catch{return null}if(r.d)return importScripts(t);const e=await fetch(t);return function(t,e){if(!r.b)return i.requireFromString&&i.requireFromString(t,e);if(r.d)return eval.call(r.a,t),null;const n=document.createElement("script");n.id=e;try{n.appendChild(document.createTextNode(t))}catch(e){n.text=t}return document.body.appendChild(n),null}(await e.text(),t)}(t),await a[t]}},function(t,e,n){"use strict";var r={};n.r(r),n.d(r,"name",(function(){return ot})),n.d(r,"decode",(function(){return at}));var i={};n.r(i),n.d(i,"name",(function(){return ft})),n.d(i,"preprocess",(function(){return pt}));var o={};n.r(o),n.d(o,"name",(function(){return dt})),n.d(o,"preprocess",(function(){return At}));var a={};n.r(a),n.d(a,"name",(function(){return yt})),n.d(a,"preprocess",(function(){return vt})),n.d(a,"decode",(function(){return _t})),n.d(a,"encode",(function(){return bt}));var s={};n.r(s),n.d(s,"name",(function(){return Ot})),n.d(s,"decode",(function(){return St})),n.d(s,"encode",(function(){return Tt}));var u={};n.r(u),n.d(u,"name",(function(){return Ct})),n.d(u,"decode",(function(){return Pt})),n.d(u,"encode",(function(){return Mt}));var c={};n.r(c),n.d(c,"name",(function(){return It})),n.d(c,"decode",(function(){return Bt})),n.d(c,"encode",(function(){return Rt}));var l=n(289);const h="https://unpkg.com/@loaders.gl/textures@".concat("3.2.10","/dist/libs/basis_encoder.wasm"),f="https://unpkg.com/@loaders.gl/textures@".concat("3.2.10","/dist/libs/basis_encoder.js");let p,d;async function A(t){const e=t.modules||{};return e.basis?e.basis:(p=p||async function(t){let e=null,n=null;return[e,n]=await Promise.all([await Object(l.a)("basis_transcoder.js","textures",t),await Object(l.a)("basis_transcoder.wasm","textures",t)]),e=e||globalThis.BASIS,await function(t,e){const n={};e&&(n.wasmBinary=e);return new Promise(e=>{t(n).then(t=>{const{BasisFile:n,initializeBasis:r}=t;r(),e({BasisFile:n})})})}(e,n)}(t),await p)}async function g(t){const e=t.modules||{};return e.basisEncoder?e.basisEncoder:(d=d||async function(t){let e=null,n=null;return[e,n]=await Promise.all([await Object(l.a)(f,"textures",t),await Object(l.a)(h,"textures",t)]),e=e||globalThis.BASIS,await function(t,e){const n={};e&&(n.wasmBinary=e);return new Promise(e=>{t(n).then(t=>{const{BasisFile:n,KTX2File:r,initializeBasis:i,BasisEncoder:o}=t;i(),e({BasisFile:n,KTX2File:r,BasisEncoder:o})})})}(e,n)}(t),await d)}const m={COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_RGBA8_ETC2_EAC:37493,COMPRESSED_SRGB8_ETC2:37494,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37495,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37496,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37497,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGB_ATC_WEBGL:35986,COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL:35987,COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL:34798,COMPRESSED_RGBA_ASTC_4X4_KHR:37808,COMPRESSED_RGBA_ASTC_5X4_KHR:37809,COMPRESSED_RGBA_ASTC_5X5_KHR:37810,COMPRESSED_RGBA_ASTC_6X5_KHR:37811,COMPRESSED_RGBA_ASTC_6X6_KHR:37812,COMPRESSED_RGBA_ASTC_8X5_KHR:37813,COMPRESSED_RGBA_ASTC_8X6_KHR:37814,COMPRESSED_RGBA_ASTC_8X8_KHR:37815,COMPRESSED_RGBA_ASTC_10X5_KHR:37816,COMPRESSED_RGBA_ASTC_10X6_KHR:37817,COMPRESSED_RGBA_ASTC_10X8_KHR:37818,COMPRESSED_RGBA_ASTC_10X10_KHR:37819,COMPRESSED_RGBA_ASTC_12X10_KHR:37820,COMPRESSED_RGBA_ASTC_12X12_KHR:37821,COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR:37840,COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR:37841,COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR:37842,COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR:37843,COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR:37844,COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR:37845,COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR:37846,COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR:37847,COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR:37848,COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR:37849,COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR:37850,COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR:37851,COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR:37852,COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR:37853,COMPRESSED_RED_RGTC1_EXT:36283,COMPRESSED_SIGNED_RED_RGTC1_EXT:36284,COMPRESSED_RED_GREEN_RGTC2_EXT:36285,COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT:36286,COMPRESSED_SRGB_S3TC_DXT1_EXT:35916,COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:35917,COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT:35918,COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:35919},y=["","WEBKIT_","MOZ_"],v={WEBGL_compressed_texture_s3tc:"dxt",WEBGL_compressed_texture_s3tc_srgb:"dxt-srgb",WEBGL_compressed_texture_etc1:"etc1",WEBGL_compressed_texture_etc:"etc2",WEBGL_compressed_texture_pvrtc:"pvrtc",WEBGL_compressed_texture_atc:"atc",WEBGL_compressed_texture_astc:"astc",EXT_texture_compression_rgtc:"rgtc"};let _=null;function b(t){if(!_){t=t||function(){try{return document.createElement("canvas").getContext("webgl")}catch(t){return null}}()||void 0,_=new Set;for(const e of y)for(const n in v)if(t&&t.getExtension("".concat(e).concat(n))){const t=v[n];_.add(t)}}return _}n(232);const x=[171,75,84,88,32,50,48,187,13,10,26,10];const w={etc1:{basisFormat:0,compressed:!0,format:m.COMPRESSED_RGB_ETC1_WEBGL},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:m.COMPRESSED_RGB_S3TC_DXT1_EXT},bc3:{basisFormat:3,compressed:!0,format:m.COMPRESSED_RGBA_S3TC_DXT5_EXT},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:m.COMPRESSED_RGB_PVRTC_4BPPV1_IMG},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:m.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG},"astc-4x4":{basisFormat:10,compressed:!0,format:m.COMPRESSED_RGBA_ASTC_4X4_KHR},"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 E(t,e,n){const r=new t(new Uint8Array(e));try{if(!r.startTranscoding())throw new Error("Failed to start basis transcoding");const t=r.getNumImages(),e=[];for(let i=0;i<t;i++){const t=r.getNumLevels(i),o=[];for(let e=0;e<t;e++)o.push(O(r,i,e,n));e.push(o)}return e}finally{r.close(),r.delete()}}function O(t,e,n,r){const i=t.getImageWidth(e,n),o=t.getImageHeight(e,n),a=t.getHasAlpha(),{compressed:s,format:u,basisFormat:c}=C(r,a),l=t.getImageTranscodedSizeInBytes(e,n,c),h=new Uint8Array(l);if(!t.transcodeImage(h,e,n,c,0,0))throw new Error("failed to start Basis transcoding");return{width:i,height:o,data:h,compressed:s,format:u,hasAlpha:a}}function S(t,e,n){const r=new t(new Uint8Array(e));try{if(!r.startTranscoding())throw new Error("failed to start KTX2 transcoding");const t=r.getLevels(),e=[];for(let i=0;i<t;i++){e.push(T(r,i,n));break}return[e]}finally{r.close(),r.delete()}}function T(t,e,n){const{alphaFlag:r,height:i,width:o}=t.getImageLevelInfo(e,0,0),{compressed:a,format:s,basisFormat:u}=C(n,r),c=t.getImageTranscodedSizeInBytes(e,0,0,u),l=new Uint8Array(c);if(!t.transcodeImage(l,e,0,0,u,0,-1,-1))throw new Error("Failed to transcode KTX2 image");return{width:o,height:i,data:l,compressed:a,hasAlpha:r,format:s}}function C(t,e){let n=t&&t.basis&&t.basis.format;return"auto"===n&&(n=P()),"object"==typeof n&&(n=e?n.alpha:n.noAlpha),n=n.toLowerCase(),w[n]}function P(){const t=b();return t.has("astc")?"astc-4x4":t.has("dxt")?{alpha:"bc3",noAlpha:"bc1"}:t.has("pvrtc")?{alpha:"pvrtc1-4-rgba",noAlpha:"pvrtc1-4-rgb"}:t.has("etc1")?"etc1":t.has("etc2")?"etc2":"rgb565"}const M={name:"Basis",id:"basis",module:"textures",version:"3.2.10",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"}}},I={...M,parse:async function(t,e){if("auto"===e.basis.containerFormat){if(function(t){const 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])}(t)){return S((await g(e)).KTX2File,t,e)}const{BasisFile:n}=await A(e);return E(n,t,e)}switch(e.basis.module){case"encoder":const n=await g(e);switch(e.basis.containerFormat){case"ktx2":return S(n.KTX2File,t,e);case"basis":default:return E(n.BasisFile,t,e)}case"transcoder":default:const{BasisFile:r}=await A(e);return E(r,t,e)}}};var B=n(291),R=n(212),k=n(83);function L(t,e){if(!t)throw new Error(e||"assert failed: gltf")}function D(t,e){if(t.startsWith("data:")||t.startsWith("http:")||t.startsWith("https:"))return t;const n=e.baseUri||e.uri;if(!n)throw new Error("'baseUri' must be provided to resolve relative url ".concat(t));return n.substr(0,n.lastIndexOf("/")+1)+t}function j(t,e,n){const r=t.bufferViews[n];L(r);const i=e[r.buffer];L(i);const o=(r.byteOffset||0)+i.byteOffset;return new Uint8Array(i.arrayBuffer,o,r.byteLength)}var F=n(1),z=n(173),U=n(143);const N=["SCALAR","VEC2","VEC3","VEC4"],G=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],V=new Map(G),H={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},W={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},q={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function X(t){return N[t-1]||N[0]}function J(t){const e=V.get(t.constructor);if(!e)throw new Error("Illegal typed array");return e}function Z(t,e){const n=q[t.componentType],r=H[t.type],i=W[t.componentType],o=t.count*r,a=t.count*r*i;return L(a>=0&&a<=e.byteLength),{ArrayType:n,length:o,byteLength:a}}const Q={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]};class K{constructor(t){Object(F.a)(this,"gltf",void 0),Object(F.a)(this,"sourceBuffers",void 0),Object(F.a)(this,"byteLength",void 0),this.gltf=t||{json:{...Q},buffers:[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(t){return this.json[t]}getExtraData(t){return(this.json.extras||{})[t]}getExtension(t){const e=this.getUsedExtensions().find(e=>e===t),n=this.json.extensions||{};return e?n[t]||!0:null}getRequiredExtension(t){return this.getRequiredExtensions().find(e=>e===t)?this.getExtension(t):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getObjectExtension(t,e){return(t.extensions||{})[e]}getScene(t){return this.getObject("scenes",t)}getNode(t){return this.getObject("nodes",t)}getSkin(t){return this.getObject("skins",t)}getMesh(t){return this.getObject("meshes",t)}getMaterial(t){return this.getObject("materials",t)}getAccessor(t){return this.getObject("accessors",t)}getTexture(t){return this.getObject("textures",t)}getSampler(t){return this.getObject("samplers",t)}getImage(t){return this.getObject("images",t)}getBufferView(t){return this.getObject("bufferViews",t)}getBuffer(t){return this.getObject("buffers",t)}getObject(t,e){if("object"==typeof e)return e;const n=this.json[t]&&this.json[t][e];if(!n)throw new Error("glTF file error: Could not find ".concat(t,"[").concat(e,"]"));return n}getTypedArrayForBufferView(t){const e=(t=this.getBufferView(t)).buffer,n=this.gltf.buffers[e];L(n);const r=(t.byteOffset||0)+n.byteOffset;return new Uint8Array(n.arrayBuffer,r,t.byteLength)}getTypedArrayForAccessor(t){t=this.getAccessor(t);const e=this.getBufferView(t.bufferView),n=this.getBuffer(e.buffer).data,{ArrayType:r,length:i}=Z(t,e);return new r(n,e.byteOffset+t.byteOffset,i)}getTypedArrayForImageData(t){t=this.getAccessor(t);const e=this.getBufferView(t.bufferView),n=this.getBuffer(e.buffer).data,r=e.byteOffset||0;return new Uint8Array(n,r,e.byteLength)}addApplicationData(t,e){return this.json[t]=e,this}addExtraData(t,e){return this.json.extras=this.json.extras||{},this.json.extras[t]=e,this}addObjectExtension(t,e,n){return t.extensions=t.extensions||{},t.extensions[e]=n,this.registerUsedExtension(e),this}setObjectExtension(t,e,n){(t.extensions||{})[e]=n}removeObjectExtension(t,e){const n=t.extensions||{},r=n[e];return delete n[e],r}addExtension(t,e={}){return L(e),this.json.extensions=this.json.extensions||{},this.json.extensions[t]=e,this.registerUsedExtension(t),e}addRequiredExtension(t,e={}){return L(e),this.addExtension(t,e),this.registerRequiredExtension(t),e}registerUsedExtension(t){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(e=>e===t)||this.json.extensionsUsed.push(t)}registerRequiredExtension(t){this.registerUsedExtension(t),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(e=>e===t)||this.json.extensionsRequired.push(t)}removeExtension(t){this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,t),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,t),this.json.extensions&&delete this.json.extensions[t]}setDefaultScene(t){this.json.scene=t}addScene(t){const{nodeIndices:e}=t;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:e}),this.json.scenes.length-1}addNode(t){const{meshIndex:e,matrix:n}=t;this.json.nodes=this.json.nodes||[];const r={mesh:e};return n&&(r.matrix=n),this.json.nodes.push(r),this.json.nodes.length-1}addMesh(t){const{attributes:e,indices:n,material:r,mode:i=4}=t,o={primitives:[{attributes:this._addAttributes(e),mode:i}]};if(n){const t=this._addIndices(n);o.primitives[0].indices=t}return Number.isFinite(r)&&(o.primitives[0].material=r),this.json.meshes=this.json.meshes||[],this.json.meshes.push(o),this.json.meshes.length-1}addPointCloud(t){const e={primitives:[{attributes:this._addAttributes(t),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(e),this.json.meshes.length-1}addImage(t,e){const n=Object(z.a)(t),r=e||(null==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}addBufferView(t){const e=t.byteLength;L(Number.isFinite(e)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(t);const n={buffer:0,byteOffset:this.byteLength,byteLength:e};return this.byteLength+=Object(U.b)(e,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(n),this.json.bufferViews.length-1}addAccessor(t,e){const n={bufferView:t,type:X(e.size),componentType:e.componentType,count:e.count,max:e.max,min:e.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(n),this.json.accessors.length-1}addBinaryBuffer(t,e={size:3}){const n=this.addBufferView(t);let r={min:e.min,max:e.max};r.min&&r.max||(r=this._getAccessorMinMax(t,e.size));const i={size:e.size,componentType:J(t),count:Math.round(t.length/e.size),min:r.min,max:r.max};return this.addAccessor(n,Object.assign(i,e))}addTexture(t){const{imageIndex:e}=t,n={source:e};return this.json.textures=this.json.textures||[],this.json.textures.push(n),this.json.textures.length-1}addMaterial(t){return this.json.materials=this.json.materials||[],this.json.materials.push(t),this.json.materials.length-1}createBinaryChunk(){var t,e;this.gltf.buffers=[];const n=this.byteLength,r=new ArrayBuffer(n),i=new Uint8Array(r);let o=0;for(const t of this.sourceBuffers||[])o=Object(U.a)(t,i,o);null!==(t=this.json)&&void 0!==t&&null!==(e=t.buffers)&&void 0!==e&&e[0]?this.json.buffers[0].byteLength=n:this.json.buffers=[{byteLength:n}],this.gltf.binary=r,this.sourceBuffers=[r]}_removeStringFromArray(t,e){let n=!0;for(;n;){const r=t.indexOf(e);r>-1?t.splice(r,1):n=!1}}_addAttributes(t={}){const e={};for(const n in t){const r=t[n],i=this._getGltfAttributeName(n),o=this.addBinaryBuffer(r.value,r);e[i]=o}return e}_addIndices(t){return this.addBinaryBuffer(t,{size:1})}_getGltfAttributeName(t){switch(t.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return t}}_getAccessorMinMax(t,e){const n={min:null,max:null};if(t.length<e)return n;n.min=[],n.max=[];const r=t.subarray(0,e);for(const t of r)n.min.push(t),n.max.push(t);for(let r=e;r<t.length;r+=e)for(let i=0;i<e;i++)n.min[0+i]=Math.min(n.min[0+i],t[r+i]),n.max[0+i]=Math.max(n.max[0+i],t[r+i]);return n}}const Y=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]),$=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]),tt={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},et={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};let nt;async function rt(){return nt||(nt=async function(){let t="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM+lLKFaF99GaG99FaG99GXGXAGCI9HQBAF9FQFEXGXGX9DBBB8/9DBBB+/ABCGJHG1BB+yAB1BBHE+yHI+L+TABCFJHL1BBHK+yHO+L+THN9DBBBB9gHVyAN9DBB/+hANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE86BBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG86BBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG86BBABCIJRBAFCaJHFQBSGMMAF9FQBEXGXGX9DBBB8/9DBBB+/ABCIJHG8uFB+yAB8uFBHE+yHI+L+TABCGJHL8uFBHK+yHO+L+THN9DBBBB9gHVyAN9DB/+g6ANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE87FBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG87FBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG87FBABCNJRBAFCaJHFQBMMM/SEIEaE99EaF99GXAF9FQBCBREABRIEXGXGX9D/zI818/AICKJ8uFBHLCEq+y+VHKAI8uFB+y+UHO9DB/+g6+U9DBBB8/9DBBB+/AO9DBBBB9gy+SHN+L9DBBB9P9d9FQBAN+oRVSFMCUUUU94RVMAICIJ8uFBRcAICGJ8uFBRMABALCFJCEZAEqCFWJAV87FBGXGXAKAM+y+UHN9DB/+g6+U9DBBB8/9DBBB+/AN9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRMSFMCUUUU94RMMABALCGJCEZAEqCFWJAM87FBGXGXAKAc+y+UHK9DB/+g6+U9DBBB8/9DBBB+/AK9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRcSFMCUUUU94RcMABALCaJCEZAEqCFWJAc87FBGXGX9DBBU8/AOAO+U+TANAN+U+TAKAK+U+THO9DBBBBAO9DBBBB9gy+R9DB/+g6+U9DBBB8/+SHO+L9DBBB9P9d9FQBAO+oRcSFMCUUUU94RcMABALCEZAEqCFWJAc87FBAICNJRIAECIJREAFCaJHFQBMMM9JBGXAGCGrAF9sHF9FQBEXABAB8oGBHGCNWCN91+yAGCi91CnWCUUU/8EJ+++U84GBABCIJRBAFCaJHFQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEM/lFFFaGXGXAFABqCEZ9FQBABRESFMGXGXAGCT9PQBABRESFMABREEXAEAF8oGBjGBAECIJAFCIJ8oGBjGBAECNJAFCNJ8oGBjGBAECSJAFCSJ8oGBjGBAECTJREAFCTJRFAGC9wJHGCb9LQBMMAGCI9JQBEXAEAF8oGBjGBAFCIJRFAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF2BB86BBAECFJREAFCFJRFAGCaJHGQBMMABMoFFGaGXGXABCEZ9FQBABRESFMAFCgFZC+BwsN9sRIGXGXAGCT9PQBABRESFMABREEXAEAIjGBAECSJAIjGBAECNJAIjGBAECIJAIjGBAECTJREAGC9wJHGCb9LQBMMAGCI9JQBEXAEAIjGBAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF86BBAECFJREAGCaJHGQBMMABMMMFBCUNMIT9kBB";WebAssembly.validate(Y)&&(t="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",console.log("Warning: meshopt_decoder is using experimental SIMD support"));const e=await WebAssembly.instantiate(function(t){const e=new Uint8Array(t.length);for(let n=0;n<t.length;++n){const r=t.charCodeAt(n);e[n]=r>96?r-71:r>64?r-65:r>47?r+4:r>46?63:62}let n=0;for(let r=0;r<t.length;++r)e[n++]=e[r]<60?$[e[r]]:64*(e[r]-60)+e[++r];return e.buffer.slice(0,n)}(t),{});return await e.instance.exports.__wasm_call_ctors(),e.instance}()),nt}function it(t,e,n,r,i,o,a){const s=t.exports.sbrk,u=r+3&-4,c=s(u*i),l=s(o.length),h=new Uint8Array(t.exports.memory.buffer);h.set(o,l);const f=e(c,r,i,l,o.length);if(0===f&&a&&a(c,u,i),n.set(h.subarray(c,c+r*i)),s(c-s(0)),0!==f)throw new Error("Malformed buffer data: ".concat(f))}const ot="EXT_meshopt_compression";async function at(t,e){var n;const r=new K(t);if(null==e||null===(n=e.gltf)||void 0===n||!n.decompressMeshes)return;const i=[];for(const e of t.json.bufferViews||[])i.push(st(r,e));await Promise.all(i),r.removeExtension("EXT_meshopt_compression")}async function st(t,e){const n=t.getObjectExtension(e,"EXT_meshopt_compression");if(n){const{byteOffset:r=0,byteLength:i=0,byteStride:o,count:a,mode:s,filter:u="NONE",buffer:c}=n,l=t.gltf.buffers[c],h=new Uint8Array(l.arrayBuffer,l.byteOffset+r,i),f=new Uint8Array(t.gltf.buffers[e.buffer].arrayBuffer,e.byteOffset,e.byteLength);return await async function(t,e,n,r,i,o="NONE"){const a=await rt();it(a,a.exports[et[i]],t,e,n,r,a.exports[tt[o||"NONE"]])}(f,a,o,h,s,u),f}return null}var ut=n(69);const ct=["image/png","image/jpeg","image/gif"],lt={};function ht(t){return void 0===lt[t]&&(lt[t]=function(t){switch(t){case"image/webp":return function(){if(!ut.c)return!1;try{return 0===document.createElement("canvas").toDataURL("image/webp").indexOf("data:image/webp")}catch{return!1}}();case"image/svg":return ut.c;default:if(!ut.c){const{_parseImageNode:e}=globalThis;return Boolean(e)&&ct.includes(t)}return!0}}(t)),lt[t]}const ft="EXT_texture_webp";function pt(t,e){const n=new K(t);if(!ht("image/webp")){if(n.getRequiredExtensions().includes("EXT_texture_webp"))throw new Error("gltf: Required extension ".concat("EXT_texture_webp"," not supported by browser"));return}const{json:r}=n;for(const t of r.textures||[]){const e=n.getObjectExtension(t,"EXT_texture_webp");e&&(t.source=e.source),n.removeObjectExtension(t,"EXT_texture_webp")}n.removeExtension("EXT_texture_webp")}const dt="KHR_texture_basisu";function At(t,e){const n=new K(t),{json:r}=n;for(const t of r.textures||[]){const e=n.getObjectExtension(t,"KHR_texture_basisu");e&&(t.source=e.source),n.removeObjectExtension(t,"KHR_texture_basisu")}n.removeExtension("KHR_texture_basisu")}var gt=n(177);function mt(t){const{buffer:e,size:n,count:r}=function(t){let e=t,n=1,r=0;t&&t.value&&(e=t.value,n=t.size||1);e&&(ArrayBuffer.isView(e)||(e=function(t,e,n=!1){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);return{value:e,size:n,byteOffset:0,count:r,type:X(n),componentType:J(e)}}const yt="KHR_draco_mesh_compression";function vt(t,e,n){const r=new K(t);for(const t of Et(r))r.getObjectExtension(t,"KHR_draco_mesh_compression")}async function _t(t,e,n){var r;if(null==e||null===(r=e.gltf)||void 0===r||!r.decompressMeshes)return;const i=new K(t),o=[];for(const t of Et(i))i.getObjectExtension(t,"KHR_draco_mesh_compression")&&o.push(xt(i,t,e,n));await Promise.all(o),i.removeExtension("KHR_draco_mesh_compression")}function bt(t,e={}){const n=new K(t);for(const t of n.json.meshes||[])wt(t,e),n.addRequiredExtension("KHR_draco_mesh_compression")}async function xt(t,e,n,r){const i=t.getObjectExtension(e,"KHR_draco_mesh_compression");if(!i)return;const o=t.getTypedArrayForBufferView(i.bufferView),a=Object(k.c)(o.buffer,o.byteOffset),{parse:s}=r,u={...n};delete u["3d-tiles"];const c=await s(a,gt.a,u,r),l=function(t){const e={};for(const n in t){const r=t[n];if("indices"!==n){const t=mt(r);e[n]=t}}return e}(c.attributes);for(const[n,r]of Object.entries(l))if(n in e.attributes){const i=e.attributes[n],o=t.getAccessor(i);null!=o&&o.min&&null!=o&&o.max&&(r.min=o.min,r.max=o.max)}e.attributes=l,c.indices&&(e.indices=mt(c.indices)),function(t){if(!t.attributes&&Object.keys(t.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}(e)}function wt(t,e,n=4,r,i){var o;if(!r.DracoWriter)throw new Error("options.gltf.DracoWriter not provided");const a=r.DracoWriter.encodeSync({attributes:t}),s=null==i||null===(o=i.parseSync)||void 0===o?void 0:o.call(i,{attributes:t}),u=r._addFauxAttributes(s.attributes);return{primitives:[{attributes:u,mode:n,extensions:{KHR_draco_mesh_compression:{bufferView:r.addBufferView(a),attributes:u}}}]}}function*Et(t){for(const e of t.json.meshes||[])for(const t of e.primitives)yield t}const Ot="KHR_lights_punctual";async function St(t){const e=new K(t),{json:n}=e,r=e.getExtension("KHR_lights_punctual");r&&(e.json.lights=r.lights,e.removeExtension("KHR_lights_punctual"));for(const t of n.nodes||[]){const n=e.getObjectExtension(t,"KHR_lights_punctual");n&&(t.light=n.light),e.removeObjectExtension(t,"KHR_lights_punctual")}}async function Tt(t){const e=new K(t),{json:n}=e;if(n.lights){const t=e.addExtension("KHR_lights_punctual");L(!t.lights),t.lights=n.lights,delete n.lights}if(e.json.lights){for(const t of e.json.lights){const n=t.node;e.addObjectExtension(n,"KHR_lights_punctual",t)}delete e.json.lights}}const Ct="KHR_materials_unlit";async function Pt(t){const e=new K(t),{json:n}=e;e.removeExtension("KHR_materials_unlit");for(const t of n.materials||[]){t.extensions&&t.extensions.KHR_materials_unlit&&(t.unlit=!0),e.removeObjectExtension(t,"KHR_materials_unlit")}}function Mt(t){const e=new K(t),{json:n}=e;if(e.materials)for(const t of n.materials||[])t.unlit&&(delete t.unlit,e.addObjectExtension(t,"KHR_materials_unlit",{}),e.addExtension("KHR_materials_unlit"))}const It="KHR_techniques_webgl";async function Bt(t){const e=new K(t),{json:n}=e,r=e.getExtension("KHR_techniques_webgl");if(r){const t=function(t,e){const{programs:n=[],shaders:r=[],techniques:i=[]}=t,o=new TextDecoder;return r.forEach(t=>{if(!Number.isFinite(t.bufferView))throw new Error("KHR_techniques_webgl: no shader code");t.code=o.decode(e.getTypedArrayForBufferView(t.bufferView))}),n.forEach(t=>{t.fragmentShader=r[t.fragmentShader],t.vertexShader=r[t.vertexShader]}),i.forEach(t=>{t.program=n[t.program]}),i}(r,e);for(const r of n.materials||[]){const n=e.getObjectExtension(r,"KHR_techniques_webgl");n&&(r.technique=Object.assign({},n,t[n.technique]),r.technique.values=kt(r.technique,e)),e.removeObjectExtension(r,"KHR_techniques_webgl")}e.removeExtension("KHR_techniques_webgl")}}async function Rt(t,e){}function kt(t,e){const n=Object.assign({},t.values);return Object.keys(t.uniforms||{}).forEach(e=>{t.uniforms[e].value&&!(e in n)&&(n[e]=t.uniforms[e].value)}),Object.keys(n).forEach(t=>{"object"==typeof n[t]&&void 0!==n[t].index&&(n[t].texture=e.getTexture(n[t].index))}),n}const Lt=[r,i,o,a,s,u,c];function Dt(t,e){var n;const r=(null==e||null===(n=e.gltf)||void 0===n?void 0:n.excludeExtensions)||{};return!(t in r&&!r[t])}const jt={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},Ft={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"};class zt{constructor(){Object(F.a)(this,"idToIndexMap",{animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}}),Object(F.a)(this,"json",void 0)}normalize(t,e){this.json=t.json;const n=t.json;switch(n.asset&&n.asset.version){case"2.0":return;case void 0:case"1.0":break;default:return void console.warn("glTF: Unknown version ".concat(n.asset.version))}if(!e.normalize)throw new Error("glTF v1 is not supported.");console.warn("Converting glTF v1 to glTF v2 format. This is experimental and may fail."),this._addAsset(n),this._convertTopLevelObjectsToArrays(n),function(t){const e=new K(t),{json:n}=e;for(const t of n.images||[]){const n=e.getObjectExtension(t,"KHR_binary_glTF");n&&Object.assign(t,n),e.removeObjectExtension(t,"KHR_binary_glTF")}n.buffers&&n.buffers[0]&&delete n.buffers[0].uri,e.removeExtension("KHR_binary_glTF")}(t),this._convertObjectIdsToArrayIndices(n),this._updateObjects(n),this._updateMaterial(n)}_addAsset(t){t.asset=t.asset||{},t.asset.version="2.0",t.asset.generator=t.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}_convertTopLevelObjectsToArrays(t){for(const e in jt)this._convertTopLevelObjectToArray(t,e)}_convertTopLevelObjectToArray(t,e){const n=t[e];if(n&&!Array.isArray(n)){t[e]=[];for(const r in n){const i=n[r];i.id=i.id||r;const o=t[e].length;t[e].push(i),this.idToIndexMap[e][r]=o}}}_convertObjectIdsToArrayIndices(t){for(const e in jt)this._convertIdsToIndices(t,e);"scene"in t&&(t.scene=this._convertIdToIndex(t.scene,"scene"));for(const e of t.textures)this._convertTextureIds(e);for(const e of t.meshes)this._convertMeshIds(e);for(const e of t.nodes)this._convertNodeIds(e);for(const e of t.scenes)this._convertSceneIds(e)}_convertTextureIds(t){t.source&&(t.source=this._convertIdToIndex(t.source,"image"))}_convertMeshIds(t){for(const e of t.primitives){const{attributes:t,indices:n,material:r}=e;for(const e in t)t[e]=this._convertIdToIndex(t[e],"accessor");n&&(e.indices=this._convertIdToIndex(n,"accessor")),r&&(e.material=this._convertIdToIndex(r,"material"))}}_convertNodeIds(t){t.children&&(t.children=t.children.map(t=>this._convertIdToIndex(t,"node"))),t.meshes&&(t.meshes=t.meshes.map(t=>this._convertIdToIndex(t,"mesh")))}_convertSceneIds(t){t.nodes&&(t.nodes=t.nodes.map(t=>this._convertIdToIndex(t,"node")))}_convertIdsToIndices(t,e){t[e]||(console.warn("gltf v1: json doesn't contain attribute ".concat(e)),t[e]=[]);for(const n of t[e])for(const t in n){const e=n[t],r=this._convertIdToIndex(e,t);n[t]=r}}_convertIdToIndex(t,e){const n=Ft[e];if(n in this.idToIndexMap){const 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}_updateObjects(t){for(const t of this.json.buffers)delete t.type}_updateMaterial(t){for(const i of t.materials){var e,n,r;i.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};const o=(null===(e=i.values)||void 0===e?void 0:e.tex)||(null===(n=i.values)||void 0===n?void 0:n.texture2d_0)||(null===(r=i.values)||void 0===r?void 0:r.diffuseTex),a=t.textures.findIndex(t=>t.id===o);-1!==a&&(i.pbrMetallicRoughness.baseColorTexture={index:a})}}}const Ut={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Nt={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Gt=10240,Vt=10241,Ht=10242,Wt=10243,qt=10497,Xt={magFilter:Gt,minFilter:Vt,wrapS:Ht,wrapT:Wt},Jt={[Gt]:9729,[Vt]:9986,[Ht]:qt,[Wt]:qt};class Zt{constructor(){Object(F.a)(this,"baseUri",""),Object(F.a)(this,"json",{}),Object(F.a)(this,"buffers",[]),Object(F.a)(this,"images",[])}postProcess(t,e={}){const{json:n,buffers:r=[],images:i=[],baseUri:o=""}=t;return L(n),this.baseUri=o,this.json=n,this.buffers=r,this.images=i,this._resolveTree(this.json,e),this.json}_resolveTree(t,e={}){t.bufferViews&&(t.bufferViews=t.bufferViews.map((t,e)=>this._resolveBufferView(t,e))),t.images&&(t.images=t.images.map((t,e)=>this._resolveImage(t,e))),t.samplers&&(t.samplers=t.samplers.map((t,e)=>this._resolveSampler(t,e))),t.textures&&(t.textures=t.textures.map((t,e)=>this._resolveTexture(t,e))),t.accessors&&(t.accessors=t.accessors.map((t,e)=>this._resolveAccessor(t,e))),t.materials&&(t.materials=t.materials.map((t,e)=>this._resolveMaterial(t,e))),t.meshes&&(t.meshes=t.meshes.map((t,e)=>this._resolveMesh(t,e))),t.nodes&&(t.nodes=t.nodes.map((t,e)=>this._resolveNode(t,e))),t.skins&&(t.skins=t.skins.map((t,e)=>this._resolveSkin(t,e))),t.scenes&&(t.scenes=t.scenes.map((t,e)=>this._resolveScene(t,e))),void 0!==t.scene&&(t.scene=t.scenes[this.json.scene])}getScene(t){return this._get("scenes",t)}getNode(t){return this._get("nodes",t)}getSkin(t){return this._get("skins",t)}getMesh(t){return this._get("meshes",t)}getMaterial(t){return this._get("materials",t)}getAccessor(t){return this._get("accessors",t)}getCamera(t){return null}getTexture(t){return this._get("textures",t)}getSampler(t){return this._get("samplers",t)}getImage(t){return this._get("images",t)}getBufferView(t){return this._get("bufferViews",t)}getBuffer(t){return this._get("buffers",t)}_get(t,e){if("object"==typeof e)return e;const n=this.json[t]&&this.json[t][e];return n||console.warn("glTF file error: Could not find ".concat(t,"[").concat(e,"]")),n}_resolveScene(t,e){return t.id=t.id||"scene-".concat(e),t.nodes=(t.nodes||[]).map(t=>this.getNode(t)),t}_resolveNode(t,e){return t.id=t.id||"node-".concat(e),t.children&&(t.children=t.children.map(t=>this.getNode(t))),void 0!==t.mesh?t.mesh=this.getMesh(t.mesh):void 0!==t.meshes&&t.meshes.length&&(t.mesh=t.meshes.reduce((t,e)=>{const n=this.getMesh(e);return t.id=n.id,t.primitives=t.primitives.concat(n.primitives),t},{primitives:[]})),void 0!==t.camera&&(t.camera=this.getCamera(t.camera)),void 0!==t.skin&&(t.skin=this.getSkin(t.skin)),t}_resolveSkin(t,e){return t.id=t.id||"skin-".concat(e),t.inverseBindMatrices=this.getAccessor(t.inverseBindMatrices),t}_resolveMesh(t,e){return t.id=t.id||"mesh-".concat(e),t.primitives&&(t.primitives=t.primitives.map(t=>{const e=(t={...t}).attributes;t.attributes={};for(const n in e)t.attributes[n]=this.getAccessor(e[n]);return void 0!==t.indices&&(t.indices=this.getAccessor(t.indices)),void 0!==t.material&&(t.material=this.getMaterial(t.material)),t})),t}_resolveMaterial(t,e){if(t.id=t.id||"material-".concat(e),t.normalTexture&&(t.normalTexture={...t.normalTexture},t.normalTexture.texture=this.getTexture(t.normalTexture.index)),t.occlusionTexture&&(t.occlustionTexture={...t.occlustionTexture},t.occlusionTexture.texture=this.getTexture(t.occlusionTexture.index)),t.emissiveTexture&&(t.emmisiveTexture={...t.emmisiveTexture},t.emissiveTexture.texture=this.getTexture(t.emissiveTexture.index)),t.emissiveFactor||(t.emissiveFactor=t.emmisiveTexture?[1,1,1]:[0,0,0]),t.pbrMetallicRoughness){t.pbrMetallicRoughness={...t.pbrMetallicRoughness};const e=t.pbrMetallicRoughness;e.baseColorTexture&&(e.baseColorTexture={...e.baseColorTexture},e.baseColorTexture.texture=this.getTexture(e.baseColorTexture.index)),e.metallicRoughnessTexture&&(e.metallicRoughnessTexture={...e.metallicRoughnessTexture},e.metallicRoughnessTexture.texture=this.getTexture(e.metallicRoughnessTexture.index))}return t}_resolveAccessor(t,e){var n,r;if(t.id=t.id||"accessor-".concat(e),void 0!==t.bufferView&&(t.bufferView=this.getBufferView(t.bufferView)),t.bytesPerComponent=(n=t.componentType,Nt[n]),t.components=(r=t.type,Ut[r]),t.bytesPerElement=t.bytesPerComponent*t.components,t.bufferView){const e=t.bufferView.buffer,{ArrayType:n,byteLength:r}=Z(t,t.bufferView),i=(t.bufferView.byteOffset||0)+(t.byteOffset||0)+e.byteOffset;let o=e.arrayBuffer.slice(i,i+r);t.bufferView.byteStride&&(o=this._getValueFromInterleavedBuffer(e,i,t.bufferView.byteStride,t.bytesPerElement,t.count)),t.value=new n(o)}return t}_getValueFromInterleavedBuffer(t,e,n,r,i){const o=new Uint8Array(i*r);for(let a=0;a<i;a++){const i=e+a*n;o.set(new Uint8Array(t.arrayBuffer.slice(i,i+r)),a*r)}return o.buffer}_resolveTexture(t,e){return t.id=t.id||"texture-".concat(e),t.sampler="sampler"in t?this.getSampler(t.sampler):Jt,t.source=this.getImage(t.source),t}_resolveSampler(t,e){t.id=t.id||"sampler-".concat(e),t.parameters={};for(const e in t){const n=this._enumSamplerParameter(e);void 0!==n&&(t.parameters[n]=t[e])}return t}_enumSamplerParameter(t){return Xt[t]}_resolveImage(t,e){t.id=t.id||"image-".concat(e),void 0!==t.bufferView&&(t.bufferView=this.getBufferView(t.bufferView));const n=this.images[e];return n&&(t.image=n),t}_resolveBufferView(t,e){const n=t.buffer,r={id:"bufferView-".concat(e),...t,buffer:this.buffers[n]},i=this.buffers[n].arrayBuffer;let o=this.buffers[n].byteOffset||0;return"byteOffset"in t&&(o+=t.byteOffset),r.data=new Uint8Array(i,o,t.byteLength),r}_resolveCamera(t,e){return t.id=t.id||"camera-".concat(e),t.perspective,t.orthographic,t}}var Qt=n(101);const Kt=1735152710;function Yt(t,e=0,n={}){const r=new DataView(t),{magic:i=Kt}=n,o=r.getUint32(e,!1);return o===i||o===Kt}function $t(t,e,n=0,r={}){const i=new DataView(e),o=function(t,e=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)))}(i,n+0),a=i.getUint32(n+4,!0),s=i.getUint32(n+8,!0);switch(Object.assign(t,{header:{byteOffset:n,byteLength:s,hasBinChunk:!1},type:o,version:a,json:{},binChunks:[]}),n+=12,t.version){case 1:return function(t,e,n){Object(Qt.a)(t.header.byteLength>20);const r=e.getUint32(n+0,!0),i=e.getUint32(n+4,!0);return n+=8,Object(Qt.a)(0===i),te(t,e,n,r),n+=r,n+=ee(t,e,n,t.header.byteLength)}(t,i,n);case 2:return function(t,e,n,r){return Object(Qt.a)(t.header.byteLength>20),function(t,e,n,r){for(;n+8<=t.header.byteLength;){const i=e.getUint32(n+0,!0),o=e.getUint32(n+4,!0);switch(n+=8,o){case 1313821514:te(t,e,n,i);break;case 5130562:ee(t,e,n,i);break;case 0:r.strict||te(t,e,n,i);break;case 1:r.strict||ee(t,e,n,i)}n+=Object(U.b)(i,4)}}(t,e,n,r),n+t.header.byteLength}(t,i,n,{});default:throw new Error("Invalid GLB version ".concat(t.version,". Only supports v1 and v2."))}}function te(t,e,n,r){const i=new Uint8Array(e.buffer,n,r),o=new TextDecoder("utf8").decode(i);return t.json=JSON.parse(o),Object(U.b)(r,4)}function ee(t,e,n,r){return t.header.hasBinChunk=!0,t.binChunks.push({byteOffset:n,byteLength:r,arrayBuffer:e.buffer}),Object(U.b)(r,4)}async function ne(t,e,n=0,r,i){var o,a,s,u;!function(t,e,n,r){r.uri&&(t.baseUri=r.uri);if(e instanceof ArrayBuffer&&!Yt(e,n,r)){const t=new TextDecoder;e=t.decode(e)}if("string"==typeof e)t.json=Object(R.a)(e);else if(e instanceof ArrayBuffer){const i={};n=$t(i,e,n,r.glb),L("glTF"===i.type,"Invalid GLB magic string ".concat(i.type)),t._glb=i,t.json=i.json}else L(!1,"GLTF: must be ArrayBuffer or string");const i=t.json.buffers||[];if(t.buffers=new Array(i.length).fill(null),t._glb&&t._glb.header.hasBinChunk){const{binChunks:e}=t._glb;t.buffers[0]={arrayBuffer:e[0].arrayBuffer,byteOffset:e[0].byteOffset,byteLength:e[0].byteLength}}const o=t.json.images||[];t.images=new Array(o.length).fill({})}(t,e,n,r),function(t,e={}){(new zt).normalize(t,e)}(t,{normalize:null==r||null===(o=r.gltf)||void 0===o?void 0:o.normalize}),function(t,e={},n){const r=Lt.filter(t=>Dt(t.name,e));for(const o of r){var i;null===(i=o.preprocess)||void 0===i||i.call(o,t,e,n)}}(t,r,i);const c=[];if(null!=r&&null!==(a=r.gltf)&&void 0!==a&&a.loadBuffers&&t.json.buffers&&await async function(t,e,n){const r=t.json.buffers||[];for(let a=0;a<r.length;++a){const s=r[a];if(s.uri){var i,o;const{fetch:r}=n;L(r);const u=D(s.uri,e),c=await(null==n||null===(i=n.fetch)||void 0===i?void 0:i.call(n,u)),l=await(null==c||null===(o=c.arrayBuffer)||void 0===o?void 0:o.call(c));t.buffers[a]={arrayBuffer:l,byteOffset:0,byteLength:l.byteLength},delete s.uri}else null===t.buffers[a]&&(t.buffers[a]={arrayBuffer:new ArrayBuffer(s.byteLength),byteOffset:0,byteLength:s.byteLength})}}(t,r,i),null!=r&&null!==(s=r.gltf)&&void 0!==s&&s.loadImages){const e=async function(t,e,n){const r=function(t){const e=new Set,n=t.json.textures||[];for(const t of n)void 0!==t.source&&e.add(t.source);return Array.from(e).sort()}(t),i=t.json.images||[],o=[];for(const a of r)o.push(re(t,i[a],a,e,n));return await Promise.all(o)}(t,r,i);c.push(e)}const l=async function(t,e={},n){const r=Lt.filter(t=>Dt(t.name,e));for(const o of r){var i;await(null===(i=o.decode)||void 0===i?void 0:i.call(o,t,e,n))}}(t,r,i);return c.push(l),await Promise.all(c),null!=r&&null!==(u=r.gltf)&&void 0!==u&&u.postProcess?function(t,e){return(new Zt).postProcess(t,e)}(t,r):t}async function re(t,e,n,r,i){const{fetch:o,parse:a}=i;let s;if(e.uri&&!e.hasOwnProperty("bufferView")){const t=D(e.uri,r),n=await o(t);s=await n.arrayBuffer()}if(Number.isFinite(e.bufferView)){const n=j(t.json,t.buffers,e.bufferView);s=Object(k.c)(n.buffer,n.byteOffset,n.byteLength)}L(s,"glTF image has no data");let u=await a(s,[B.a,I],{mimeType:e.mimeType,basis:r.basis||{format:P()}},i);u&&u[0]&&(u={compressed:!0,mipmaps:!1,width:u[0].width,height:u[0].height,data:u[0]}),t.images=t.images||[],t.images[n]=u}n.d(e,"a",(function(){return ie}));const ie={name:"glTF",id:"gltf",module:"gltf",version:"3.2.10",extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:async function(t,e={},n){(e={...ie.options,...e}).gltf={...ie.options.gltf,...e.gltf};const{byteOffset:r=0}=e;return await ne({},t,r,e,n)},options:{gltf:{normalize:!0,loadBuffers:!0,loadImages:!0,decompressMeshes:!0,postProcess:!0},log:console},deprecatedOptions:{fetchImages:"gltf.loadImages",createImages:"gltf.loadImages",decompress:"gltf.decompressMeshes",postProcess:"gltf.postProcess",gltf:{decompress:"gltf.decompressMeshes"}}}},function(t,e,n){"use strict";var r=n(101),i=n(69);const{_parseImageNode:o}=globalThis,a="undefined"!=typeof Image,s="undefined"!=typeof ImageBitmap,u=Boolean(o),c=!!i.c||u;function l(t){const e=f(t);if(!e)throw new Error("Not an image");return e}function h(t){switch(l(t)){case"data":return t;case"image":case"imagebitmap":const e=document.createElement("canvas"),n=e.getContext("2d");if(!n)throw new Error("getImageData");return e.width=t.width,e.height=t.height,n.drawImage(t,0,0),n.getImageData(0,0,t.width,t.height);default:throw new Error("getImageData")}}function f(t){return"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?"imagebitmap":"undefined"!=typeof Image&&t instanceof Image?"image":t&&"object"==typeof t&&t.data&&t.width&&t.height?"data":null}const p=/^data:image\/svg\+xml/,d=/\.svg((\?|#).*)?$/;function A(t){return t&&(p.test(t)||d.test(t))}function g(t,e){if(A(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(t)])}async function m(t,e,n){const r=function(t,e){if(A(e)){let e=(new TextDecoder).decode(t);try{"function"==typeof unescape&&"function"==typeof encodeURIComponent&&(e=unescape(encodeURIComponent(e)))}catch(t){throw new Error(t.message)}return"data:image/svg+xml;base64,".concat(btoa(e))}return g(t,e)}(t,n),i=self.URL||self.webkitURL,o="string"!=typeof r&&i.createObjectURL(r);try{return await async function(t,e){const n=new Image;if(n.src=t,e.image&&e.image.decode&&n.decode)return await n.decode(),n;return await new Promise((e,r)=>{try{n.onload=()=>e(n),n.onerror=e=>r(new Error("Could not load image ".concat(t,": ").concat(e)))}catch(t){r(t)}})}(o||r,e)}finally{o&&i.revokeObjectURL(o)}}const y={};let v=!0;async function _(t,e,n){let r;if(A(n)){r=await m(t,e,n)}else r=g(t,n);const i=e&&e.imagebitmap;return await async function(t,e=null){!function(t){for(const e in t||y)return!1;return!0}(e)&&v||(e=null);if(e)try{return await createImageBitmap(t,e)}catch(t){console.warn(t),v=!1}return await createImageBitmap(t)}(r,i)}var b=n(173);n.d(e,"a",(function(){return x}));const x={id:"image",module:"images",name:"Images",version:"3.2.10",mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],extensions:["png","jpg","jpeg","gif","webp","bmp","ico","svg"],parse:async function(t,e,n){const i=((e=e||{}).image||{}).type||"auto",{url:o}=n||{};let u;switch(function(t){switch(t){case"auto":case"data":return function(){if(s)return"imagebitmap";if(a)return"image";if(c)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(t){switch(t){case"auto":return s||a||c;case"imagebitmap":return s;case"image":return a;case"data":return c;default:throw new Error("@loaders.gl/images: image ".concat(t," not supported in this environment"))}}(t),t}}(i)){case"imagebitmap":u=await _(t,e,o);break;case"image":u=await m(t,e,o);break;case"data":u=await async function(t,e){const{mimeType:n}=Object(b.a)(t)||{},i=globalThis._parseImageNode;return Object(r.a)(i),await i(t,n)}(t);break;default:Object(r.a)(!1)}return"data"===i&&(u=h(u)),u},tests:[t=>Boolean(Object(b.a)(new DataView(t)))],options:{image:{type:"auto",decode:!0}}}},function(t,e,n){"use strict";var r=n(38),i=n(52),o=n(71),a=n(8),s=n(104),u=n(10);const c={5126:w.bind(null,"uniform1fv",A,1,E),35664:w.bind(null,"uniform2fv",A,2,E),35665:w.bind(null,"uniform3fv",A,3,E),35666:w.bind(null,"uniform4fv",A,4,E),5124:w.bind(null,"uniform1iv",g,1,E),35667:w.bind(null,"uniform2iv",g,2,E),35668:w.bind(null,"uniform3iv",g,3,E),35669:w.bind(null,"uniform4iv",g,4,E),35670:w.bind(null,"uniform1iv",g,1,E),35671:w.bind(null,"uniform2iv",g,2,E),35672:w.bind(null,"uniform3iv",g,3,E),35673:w.bind(null,"uniform4iv",g,4,E),35674:w.bind(null,"uniformMatrix2fv",A,4,O),35675:w.bind(null,"uniformMatrix3fv",A,9,O),35676:w.bind(null,"uniformMatrix4fv",A,16,O),35678:x,35680:x,5125:w.bind(null,"uniform1uiv",m,1,E),36294:w.bind(null,"uniform2uiv",m,2,E),36295:w.bind(null,"uniform3uiv",m,3,E),36296:w.bind(null,"uniform4uiv",m,4,E),35685:w.bind(null,"uniformMatrix2x3fv",A,6,O),35686:w.bind(null,"uniformMatrix2x4fv",A,8,O),35687:w.bind(null,"uniformMatrix3x2fv",A,6,O),35688:w.bind(null,"uniformMatrix3x4fv",A,12,O),35689:w.bind(null,"uniformMatrix4x2fv",A,8,O),35690:w.bind(null,"uniformMatrix4x3fv",A,12,O),35678:x,35680:x,35679:x,35682:x,36289:x,36292:x,36293:x,36298:x,36299:x,36300:x,36303:x,36306:x,36307:x,36308:x,36311:x},l={},h={},f={},p=[0];function d(t,e,n,r){1===e&&"boolean"==typeof t&&(t=t?1:0),Number.isFinite(t)&&(p[0]=t,t=p);const i=t.length;if(i%e&&a.k.warn("Uniform size should be multiples of ".concat(e),t)(),t instanceof n)return t;let o=r[i];o||(o=new n(i),r[i]=o);for(let e=0;e<i;e++)o[e]=t[e];return o}function A(t,e){return d(t,e,Float32Array,l)}function g(t,e){return d(t,e,Int32Array,h)}function m(t,e){return d(t,e,Uint32Array,f)}function y(t,e,n){const r=c[n.type];if(!r)throw new Error("Unknown GLSL uniform type ".concat(n.type));return r().bind(null,t,e)}function v(t){if("]"!==t[t.length-1])return{name:t,length:1,isArray:!1};const e=t.match(/([^[]*)(\[[0-9]+\])?/);if(!e||e.length<2)throw new Error("Failed to parse GLSL uniform name ".concat(t));return{name:e[1],length:e[2]||1,isArray:Boolean(e[2])}}function _(t){return Array.isArray(t)||ArrayBuffer.isView(t)?function(t){if(0===t.length)return!1;const e=Math.min(t.length,16);for(let n=0;n<e;++n)if(!Number.isFinite(t[n]))return!1;return!0}(t):!!isFinite(t)||(!0===t||!1===t||(t instanceof i.a||(t instanceof s.a||t instanceof o.a&&Boolean(t.texture))))}function b(t,e,n){if(Array.isArray(n)||ArrayBuffer.isView(n))if(t[e]){const r=t[e];for(let t=0,e=n.length;t<e;++t)r[t]=n[t]}else t[e]=n.slice();else t[e]=n}function x(){let t=null;return(e,n,r)=>{const i=t!==r;return i&&(e.uniform1i(n,r),t=r),i}}function w(t,e,n,r){let i=null,o=null;return(a,s,c)=>{const l=e(c,n),h=l.length;let f=!1;if(null===i)i=new Float32Array(h),o=h,f=!0;else{Object(u.a)(o===h,"Uniform length cannot change.");for(let t=0;t<h;++t)if(l[t]!==i[t]){f=!0;break}}return f&&(r(a,t,s,l),i.set(l)),f}}function E(t,e,n,r){t[e](n,r)}function O(t,e,n,r){t[e](n,!1,r)}function S(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unnamed";const n=/#define[\s*]SHADER_NAME[\s*]([A-Za-z0-9_-]+)[\s*]/,r=t.match(n);return r?r[1]:e}function T(t,e,n,r){const i=t.split(/\r?\n/),o={},a={},s=r||S(e)||"(unnamed)",u="".concat(function(t){switch(t){case 35632:return"fragment";case 35633:return"vertex";default:return"unknown type"}}(n)," shader ").concat(s);for(let e=0;e<i.length;e++){const n=i[e];if(n.length<=1)continue;const r=n.split(":"),s=r[0],c=parseInt(r[2],10);if(isNaN(c))throw new Error("GLSL compilation error in ".concat(u,": ").concat(t));"WARNING"!==s?o[c]=n:a[c]=n}const c=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:": ";const r=t.split(/\r?\n/),i=String(r.length+e-1).length;return r.map((t,r)=>{const o=String(r+e),a=o.length;return P(o,i-a)+n+t})}(e);return{shaderName:u,errors:C(o,c),warnings:C(a,c)}}function C(t,e){let n="";for(let r=0;r<e.length;r++){const i=e[r];if((t[r+3]||t[r+2]||t[r+1])&&(n+="".concat(i,"\n"),t[r+1])){const e=t[r+1],i=e.split(":",3),o=i[0],a=parseInt(i[1],10)||0,s=e.substring(i.join(":").length+1).trim();n+=P("^^^ ".concat(o,": ").concat(s,"\n\n"),a)}}return n}function P(t,e){let n="";for(let t=0;t<e;++t)n+=" ";return"".concat(n).concat(t)}var M=n(45);class I extends r.a{get[Symbol.toStringTag](){return"Shader"}static getTypeName(t){switch(t){case 35633:return"vertex-shader";case 35632:return"fragment-shader";default:return Object(u.a)(!1),"unknown"}}constructor(t,e){Object(a.b)(t),Object(u.a)("string"==typeof e.source,"Shader: GLSL source code must be a JavaScript string");super(t,{id:S(e.source,null)||e.id||Object(M.c)("unnamed ".concat(I.getTypeName(e.shaderType)))}),this.shaderType=e.shaderType,this.source=e.source,this.initialize(e)}initialize(t){let{source:e}=t;const n=S(e,null);n&&(this.id=Object(M.c)(n)),this._compile(e)}getParameter(t){return this.gl.getShaderParameter(this.handle,t)}toString(){return"".concat(I.getTypeName(this.shaderType),":").concat(this.id)}getName(){return S(this.source)||"unnamed-shader"}getSource(){return this.gl.getShaderSource(this.handle)}getTranslatedSource(){const t=this.gl.getExtension("WEBGL_debug_shaders");return t?t.getTranslatedShaderSource(this.handle):"No translated source available. WEBGL_debug_shaders not implemented"}_compile(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.source;t.startsWith("#version ")||(t="#version 100\n".concat(t)),this.source=t,this.gl.shaderSource(this.handle,this.source),this.gl.compileShader(this.handle);if(!this.getParameter(35713)){const t=this.gl.getShaderInfoLog(this.handle),{shaderName:e,errors:n,warnings:r}=T(t,this.source,this.shaderType,this.id);throw a.k.error("GLSL compilation errors in ".concat(e,"\n").concat(n))(),a.k.warn("GLSL compilation warnings in ".concat(e,"\n").concat(r))(),new Error("GLSL compilation errors in ".concat(e))}}_deleteHandle(){this.gl.deleteShader(this.handle)}_getOptsFromHandle(){return{type:this.getParameter(35663),source:this.getSource()}}}class B extends I{get[Symbol.toStringTag](){return"VertexShader"}constructor(t,e){"string"==typeof e&&(e={source:e}),super(t,Object.assign({},e,{shaderType:35633}))}_createHandle(){return this.gl.createShader(35633)}}class R extends I{get[Symbol.toStringTag](){return"FragmentShader"}constructor(t,e){"string"==typeof e&&(e={source:e}),super(t,Object.assign({},e,{shaderType:35632}))}_createHandle(){return this.gl.createShader(35632)}}var k=n(61),L=n(78);class D{constructor(t){this.id=t.id,this.attributeInfos=[],this.attributeInfosByName={},this.attributeInfosByLocation=[],this.varyingInfos=[],this.varyingInfosByName={},Object.seal(this),this._readAttributesFromProgram(t),this._readVaryingsFromProgram(t)}getAttributeInfo(t){const e=Number(t);return Number.isFinite(e)?this.attributeInfosByLocation[e]:this.attributeInfosByName[t]||null}getAttributeLocation(t){const e=this.getAttributeInfo(t);return e?e.location:-1}getAttributeAccessor(t){const e=this.getAttributeInfo(t);return e?e.accessor:null}getVaryingInfo(t){const e=Number(t);return Number.isFinite(e)?this.varyingInfos[e]:this.varyingInfosByName[t]||null}getVaryingIndex(t){const e=this.getVaryingInfo();return e?e.location:-1}getVaryingAccessor(t){const e=this.getVaryingInfo();return e?e.accessor:null}_readAttributesFromProgram(t){const{gl:e}=t,n=e.getProgramParameter(t.handle,35721);for(let r=0;r<n;r++){const{name:n,type:i,size:o}=e.getActiveAttrib(t.handle,r),a=e.getAttribLocation(t.handle,n);a>=0&&this._addAttribute(a,n,i,o)}this.attributeInfos.sort((t,e)=>t.location-e.location)}_readVaryingsFromProgram(t){const{gl:e}=t;if(!Object(a.j)(e))return;const n=e.getProgramParameter(t.handle,35971);for(let r=0;r<n;r++){const{name:n,type:i,size:o}=e.getTransformFeedbackVarying(t.handle,r);this._addVarying(r,n,i,o)}this.varyingInfos.sort((t,e)=>t.location-e.location)}_addAttribute(t,e,n,r){const{type:i,components:o}=Object(L.a)(n),a={type:i,size:r*o};this._inferProperties(t,e,a);const s={location:t,name:e,accessor:new k.a(a)};this.attributeInfos.push(s),this.attributeInfosByLocation[t]=s,this.attributeInfosByName[s.name]=s}_inferProperties(t,e,n){/instance/i.test(e)&&(n.divisor=1)}_addVarying(t,e,n,r){const{type:i,components:o}=Object(L.a)(n),a={location:t,name:e,accessor:new k.a({type:i,size:r*o})};this.varyingInfos.push(a),this.varyingInfosByName[a.name]=a}}var j=n(46);n.d(e,"a",(function(){return U}));const F=35981,z=["setVertexArray","setAttributes","setBuffers","unsetBuffers","use","getUniformCount","getUniformInfo","getUniformLocation","getUniformValue","getVarying","getFragDataLocation","getAttachedShaders","getAttributeCount","getAttributeLocation","getAttributeInfo"];class U extends r.a{get[Symbol.toStringTag](){return"Program"}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(t,e),this.stubRemovedMethods("Program","v6.0",z),this._isCached=!1,this.initialize(e),Object.seal(this),this._setId(e.id)}initialize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{hash:e,vs:n,fs:r,varyings:i,bufferMode:o=F}=t;return this.hash=e||"",this.vs="string"==typeof n?new B(this.gl,{id:"".concat(t.id,"-vs"),source:n}):n,this.fs="string"==typeof r?new R(this.gl,{id:"".concat(t.id,"-fs"),source:r}):r,Object(u.a)(this.vs instanceof B),Object(u.a)(this.fs instanceof R),this.uniforms={},this._textureUniforms={},i&&i.length>0&&(Object(a.a)(this.gl),this.varyings=i,this.gl2.transformFeedbackVaryings(this.handle,i,o)),this._compileAndLink(),this._readUniformLocationsFromLinkedProgram(),this.configuration=new D(this),this.setProps(t)}delete(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._isCached?this:super.delete(t)}setProps(t){return"uniforms"in t&&this.setUniforms(t.uniforms),this}draw(t){let{logPriority:e,drawMode:n=4,vertexCount:r,offset:i=0,start:o,end:s,isIndexed:c=!1,indexType:l=5123,instanceCount:h=0,isInstanced:f=h>0,vertexArray:p=null,transformFeedback:d,framebuffer:A,parameters:g={},uniforms:m,samplers:y}=t;if((m||y)&&(a.k.deprecated("Program.draw({uniforms})","Program.setUniforms(uniforms)")(),this.setUniforms(m||{})),a.k.priority>=e){const t=A?A.id:"default",i="mode=".concat(Object(j.a)(this.gl,n)," verts=").concat(r," ")+"instances=".concat(h," indexType=").concat(Object(j.a)(this.gl,l)," ")+"isInstanced=".concat(f," isIndexed=").concat(c," ")+"Framebuffer=".concat(t);a.k.log(e,i)()}return Object(u.a)(p),this.gl.useProgram(this.handle),!(!this._areTexturesRenderable()||0===r||f&&0===h)&&(p.bindForDraw(r,h,()=>{if(void 0!==A&&(g=Object.assign({},g,{framebuffer:A})),d){const t=Object(L.c)(n);d.begin(t)}this._bindTextures(),Object(a.o)(this.gl,g,()=>{c&&f?this.gl2.drawElementsInstanced(n,r,l,i,h):c&&Object(a.j)(this.gl)&&!isNaN(o)&&!isNaN(s)?this.gl2.drawRangeElements(n,o,s,r,l,i):c?this.gl.drawElements(n,r,l,i):f?this.gl2.drawArraysInstanced(n,i,r,h):this.gl.drawArrays(n,i,r)}),d&&d.end()}),!0)}setUniforms(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};a.k.priority>=2&&function(t,e,n){for(const r in t){const i=t[r];if((!n||Boolean(n[r]))&&!_(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);for(const e in t){const n=t[e],r=this._uniformSetters[e];if(r){let t=n,a=!1;if(t instanceof o.a&&(t=t.texture),t instanceof i.a)if(a=this.uniforms[e]!==n,a){void 0===r.textureIndex&&(r.textureIndex=this._textureIndexCounter++);const n=t,{textureIndex:i}=r;n.bind(i),t=i,this._textureUniforms[e]=n}else t=r.textureIndex;else this._textureUniforms[e]&&delete this._textureUniforms[e];(r(t)||a)&&b(this.uniforms,e,n)}}return this}_areTexturesRenderable(){let t=!0;for(const e in this._textureUniforms){const n=this._textureUniforms[e];n.update(),t=t&&n.loaded}return t}_bindTextures(){for(const t in this._textureUniforms){const e=this._uniformSetters[t].textureIndex;this._textureUniforms[t].bind(e)}}_createHandle(){return this.gl.createProgram()}_deleteHandle(){this.gl.deleteProgram(this.handle)}_getOptionsFromHandle(t){const e=this.gl.getAttachedShaders(t),n={};for(const t of e){switch(this.gl.getShaderParameter(this.handle,35663)){case 35633:n.vs=new B({handle:t});break;case 35632:n.fs=new R({handle:t})}}return n}_getParameter(t){return this.gl.getProgramParameter(this.handle,t)}_setId(t){if(!t){const t=this._getName();this.id=Object(M.c)(t)}}_getName(){let t=this.vs.getName()||this.fs.getName();return t=t.replace(/shader/i,""),t=t?"".concat(t,"-program"):"program",t}_compileAndLink(){const{gl:t}=this;if(t.attachShader(this.handle,this.vs.handle),t.attachShader(this.handle,this.fs.handle),a.k.time(4,"linkProgram for ".concat(this._getName()))(),t.linkProgram(this.handle),a.k.timeEnd(4,"linkProgram for ".concat(this._getName()))(),t.debug||a.k.level>0){if(!t.getProgramParameter(this.handle,35714))throw new Error("Error linking: ".concat(t.getProgramInfoLog(this.handle)));t.validateProgram(this.handle);if(!t.getProgramParameter(this.handle,35715))throw new Error("Error validating: ".concat(t.getProgramInfoLog(this.handle)))}}_readUniformLocationsFromLinkedProgram(){const{gl:t}=this;this._uniformSetters={},this._uniformCount=this._getParameter(35718);for(let e=0;e<this._uniformCount;e++){const n=this.gl.getActiveUniform(this.handle,e),{name:r}=v(n.name);let i=t.getUniformLocation(this.handle,r);if(this._uniformSetters[r]=y(t,i,n),n.size>1)for(let e=0;e<n.size;e++)i=t.getUniformLocation(this.handle,"".concat(r,"[").concat(e,"]")),this._uniformSetters["".concat(r,"[").concat(e,"]")]=y(t,i,n)}this._textureIndexCounter=0}getActiveUniforms(t,e){return this.gl2.getActiveUniforms(this.handle,t,e)}getUniformBlockIndex(t){return this.gl2.getUniformBlockIndex(this.handle,t)}getActiveUniformBlockParameter(t,e){return this.gl2.getActiveUniformBlockParameter(this.handle,t,e)}uniformBlockBinding(t,e){this.gl2.uniformBlockBinding(this.handle,t,e)}}},function(t,e,n){"use strict";var r=n(179);const i="void main() {gl_FragColor = vec4(0);}",o="out vec4 transform_output;\nvoid main() {\n transform_output = vec4(0);\n}",a="#version 300 es\n".concat(o);function s(t,e){e=Array.isArray(e)?e:[e];const n=t.replace(/^\s+/,"").split(/\s+/),[r,i,o]=n;if(!e.includes(r)||!i||!o)return null;return{qualifier:r,type:i,name:o.split(";")[0]}}function u(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{version:e=100,input:n,inputType:r,output:s}=t;if(!n)return 300===e?a:e>300?"#version ".concat(e,"\n").concat(o):i;const u=c(n,r);return e>=300?"#version ".concat(e," ").concat(300===e?"es":"","\nin ").concat(r," ").concat(n,";\nout vec4 ").concat(s,";\nvoid main() {\n ").concat(s," = ").concat(u,";\n}"):"varying ".concat(r," ").concat(n,";\nvoid main() {\n gl_FragColor = ").concat(u,";\n}")}function c(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 Object(r.a)(!1),null}}var l=n(8),h=n(32),f=n(286),p=n(10);class d{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.gl=t,this.currentIndex=0,this.feedbackMap={},this.varyings=null,this.bindings=[],this.resources={},this._initialize(e),Object.seal(this)}setupResources(t){for(const e of this.bindings)this._setupTransformFeedback(e,t)}updateModelProps(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{varyings:e}=this;return e.length>0&&(t=Object.assign({},t,{varyings:e})),t}getDrawOptions(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=this.bindings[this.currentIndex],{sourceBuffers:n,transformFeedback:r}=e;return{attributes:Object.assign({},n,t.attributes),transformFeedback:r}}swap(){return!!this.feedbackMap&&(this.currentIndex=this._getNextIndex(),!0)}update(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._setupBuffers(t)}getBuffer(t){const{feedbackBuffers:e}=this.bindings[this.currentIndex],n=t?e[t]:null;return n?n instanceof h.a?n:n.buffer:null}getData(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{varyingName:e}=t,n=this.getBuffer(e);return n?n.getData():null}delete(){for(const t in this.resources)this.resources[t].delete()}_initialize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._setupBuffers(t),this.varyings=t.varyings||Object.keys(this.bindings[this.currentIndex].feedbackBuffers),this.varyings.length>0&&Object(p.a)(Object(l.j)(this.gl))}_getFeedbackBuffers(t){const{sourceBuffers:e={}}=t,n={};if(this.bindings[this.currentIndex]&&Object.assign(n,this.bindings[this.currentIndex].feedbackBuffers),this.feedbackMap)for(const t in this.feedbackMap){const r=this.feedbackMap[t];t in e&&(n[r]=t)}Object.assign(n,t.feedbackBuffers);for(const t in n){const r=n[t];if("string"==typeof r){const i=e[r],{byteLength:o,usage:a,accessor:s}=i;n[t]=this._createNewBuffer(t,{byteLength:o,usage:a,accessor:s})}}return n}_setupBuffers(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{sourceBuffers:e=null}=t;Object.assign(this.feedbackMap,t.feedbackMap);const n=this._getFeedbackBuffers(t);this._updateBindings({sourceBuffers:e,feedbackBuffers:n})}_setupTransformFeedback(t,e){let{model:n}=e;const{program:r}=n;t.transformFeedback=new f.a(this.gl,{program:r,buffers:t.feedbackBuffers})}_updateBindings(t){if(this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],t),this.feedbackMap){const{sourceBuffers:t,feedbackBuffers:e}=this._swapBuffers(this.bindings[this.currentIndex]),n=this._getNextIndex();this.bindings[n]=this._updateBinding(this.bindings[n],{sourceBuffers:t,feedbackBuffers:e})}}_updateBinding(t,e){return t?(Object.assign(t.sourceBuffers,e.sourceBuffers),Object.assign(t.feedbackBuffers,e.feedbackBuffers),t.transformFeedback&&t.transformFeedback.setBuffers(t.feedbackBuffers),t):{sourceBuffers:Object.assign({},e.sourceBuffers),feedbackBuffers:Object.assign({},e.feedbackBuffers)}}_swapBuffers(t){if(!this.feedbackMap)return null;const e=Object.assign({},t.sourceBuffers),n=Object.assign({},t.feedbackBuffers);for(const r in this.feedbackMap){const i=this.feedbackMap[r];e[r]=t.feedbackBuffers[i],n[i]=t.sourceBuffers[r],Object(p.a)(n[i]instanceof h.a)}return{sourceBuffers:e,feedbackBuffers:n}}_createNewBuffer(t,e){const n=new h.a(this.gl,e);return this.resources[t]&&this.resources[t].delete(),this.resources[t]=n,n}_getNextIndex(){return(this.currentIndex+1)%2}}var A=n(197),g=n(102),m=n(71),y=n(222);function v(t){let e=100;const n=t.match(/[^\s]+/g);if(n.length>=2&&"#version"===n[0]){const t=parseInt(n[1],10);Number.isFinite(t)&&(e=t)}return e}var _=n(183);const 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};function x(t){let{vs:e,sourceTextureMap:n,targetTextureVarying:i,targetTexture:o}=t;let a=Object.keys(n).length,u=null;const c={};let l=e,h={};if(a>0||i){const t=l.split("\n"),e=t.slice();if(t.forEach((t,o,l)=>{if(a>0){const i=function(t,e){const n={},i=function(t){return s(t,["attribute","in"])}(t);if(!i)return null;const{type:o,name:a}=i;if(a&&e[a]){const e="// ".concat(t," => Replaced by Transform with a sampler"),{samplerName:i,sizeName:s,uniformDeclerations:u}=function(t){const e="".concat("transform_uSampler_").concat(t),n="".concat("transform_uSize_").concat(t),r=" uniform sampler2D ".concat(e,";\n uniform vec2 ").concat(n,";");return{samplerName:e,sizeName:n,uniformDeclerations:r}}(a),c=function(t){switch(t){case"float":return"x";case"vec2":return"xy";case"vec3":return"xyz";case"vec4":return"xyzw";default:return Object(r.a)(!1),null}}(o),l=" ".concat(o," ").concat(a," = transform_getInput(").concat(i,", ").concat(s,").").concat(c,";\n");n[i]=a;return{updatedLine:e,inject:{"vs:#decl":u,"vs:#main-start":l},samplerTextureMap:n}}return null}(t,n);if(i){const{updatedLine:t,inject:n}=i;e[o]=t,h=Object(_.b)([h,n]),Object.assign(c,i.samplerTextureMap),a--}}i&&!u&&(u=function(t,e){const n=s(t,["varying","out"]);if(!n)return null;return n.name===e?n.type:null}(t,i))}),i){Object(p.a)(o);const t="".concat("transform_uSize_").concat(i),e={"vs:#decl":"uniform vec2 ".concat(t,";\n"),"vs:#main-start":" vec2 ".concat("transform_position"," = transform_getPos(").concat(t,");\n gl_Position = vec4(").concat("transform_position",", 0, 1.);\n")};h=Object(_.b)([h,e])}l=e.join("\n")}return{vs:l,targetTextureType:u,inject:h,samplerTextureMap:c}}const w={10241:9728,10240:9728,10242:33071,10243:33071};class E{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.gl=t,this.id=this.currentIndex=0,this._swapTexture=null,this.targetTextureVarying=null,this.targetTextureType=null,this.samplerTextureMap=null,this.bindings=[],this.resources={},this._initialize(e),Object.seal(this)}updateModelProps(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=this._processVertexShader(t);return Object.assign({},t,e)}getDrawOptions(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{sourceBuffers:e,sourceTextures:n,framebuffer:r,targetTexture:i}=this.bindings[this.currentIndex],o=Object.assign({},e,t.attributes),a=Object.assign({},t.uniforms),s=Object.assign({},t.parameters);let u=t.discard;if(this.hasSourceTextures||this.hasTargetTexture){o.transform_elementID=this.elementIDBuffer;for(const t in this.samplerTextureMap){const e=this.samplerTextureMap[t];a[t]=n[e]}this._setSourceTextureParameters();const t=function(t){let{sourceTextureMap:e,targetTextureVarying:n,targetTexture:r}=t;const i={};let o,a;n&&(({width:o,height:a}=r),i["".concat("transform_uSize_").concat(n)]=[o,a]);for(const t in e)({width:o,height:a}=e[t]),i["".concat("transform_uSize_").concat(t)]=[o,a];return i}({sourceTextureMap:n,targetTextureVarying:this.targetTextureVarying,targetTexture:i});Object.assign(a,t)}return this.hasTargetTexture&&(u=!1,s.viewport=[0,0,r.width,r.height]),{attributes:o,framebuffer:r,uniforms:a,discard:u,parameters:s}}swap(){return!!this._swapTexture&&(this.currentIndex=this._getNextIndex(),!0)}update(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._setupTextures(t)}getTargetTexture(){const{targetTexture:t}=this.bindings[this.currentIndex];return t}getData(){let{packed:t=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{framebuffer:e}=this.bindings[this.currentIndex],n=Object(A.c)(e);if(!t)return n;const i=n.constructor,o=function(t){switch(t){case"float":return 1;case"vec2":return 2;case"vec3":return 3;case"vec4":return 4;default:return Object(r.a)(!1),null}}(this.targetTextureType),a=new i(n.length*o/4);let s=0;for(let t=0;t<n.length;t+=4)for(let e=0;e<o;e++)a[s++]=n[t+e];return a}getFramebuffer(){return this.bindings[this.currentIndex].framebuffer}delete(){this.ownTexture&&this.ownTexture.delete(),this.elementIDBuffer&&this.elementIDBuffer.delete()}_initialize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{_targetTextureVarying:e,_swapTexture:n}=t;this._swapTexture=n,this.targetTextureVarying=e,this.hasTargetTexture=e,this._setupTextures(t)}_createTargetTexture(t){const{sourceTextures:e,textureOrReference:n}=t;if(n instanceof g.a)return n;const r=e[n];return r?(this._targetRefTexName=n,this._createNewTexture(r)):null}_setupTextures(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{sourceBuffers:e,_sourceTextures:n={},_targetTexture:r}=t,i=this._createTargetTexture({sourceTextures:n,textureOrReference:r});this.hasSourceTextures=this.hasSourceTextures||n&&Object.keys(n).length>0,this._updateBindings({sourceBuffers:e,sourceTextures:n,targetTexture:i}),"elementCount"in t&&this._updateElementIDBuffer(t.elementCount)}_updateElementIDBuffer(t){if("number"!=typeof t||this.elementCount>=t)return;const e=new Float32Array(t);e.forEach((t,e,n)=>{n[e]=e}),this.elementIDBuffer?this.elementIDBuffer.setData({data:e}):this.elementIDBuffer=new h.a(this.gl,{data:e,accessor:{size:1}}),this.elementCount=t}_updateBindings(t){if(this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],t),this._swapTexture){const{sourceTextures:t,targetTexture:e}=this._swapTextures(this.bindings[this.currentIndex]),n=this._getNextIndex();this.bindings[n]=this._updateBinding(this.bindings[n],{sourceTextures:t,targetTexture:e})}}_updateBinding(t,e){const{sourceBuffers:n,sourceTextures:r,targetTexture:i}=e;if(t||(t={sourceBuffers:{},sourceTextures:{},targetTexture:null}),Object.assign(t.sourceTextures,r),Object.assign(t.sourceBuffers,n),i){t.targetTexture=i;const{width:e,height:n}=i,{framebuffer:r}=t;r?(r.update({attachments:{36064:i},resizeAttachments:!1}),r.resize({width:e,height:n})):t.framebuffer=new m.a(this.gl,{id:"transform-framebuffer",width:e,height:n,attachments:{36064:i}})}return t}_setSourceTextureParameters(){const t=this.currentIndex,{sourceTextures:e}=this.bindings[t];for(const t in e)e[t].setParameters(w)}_swapTextures(t){if(!this._swapTexture)return null;const e=Object.assign({},t.sourceTextures);e[this._swapTexture]=t.targetTexture;return{sourceTextures:e,targetTexture:t.sourceTextures[this._swapTexture]}}_createNewTexture(t){const e=Object(y.a)(t,{parameters:{10241:9728,10240:9728,10242:33071,10243:33071},pixelStore:{37440:!1}});return this.ownTexture&&this.ownTexture.delete(),this.ownTexture=e,e}_getNextIndex(){return(this.currentIndex+1)%2}_processVertexShader(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{sourceTextures:e,targetTexture:n}=this.bindings[this.currentIndex],{vs:r,uniforms:i,targetTextureType:o,inject:a,samplerTextureMap:s}=x({vs:t.vs,sourceTextureMap:e,targetTextureVarying:this.targetTextureVarying,targetTexture:n}),c=Object(_.b)([t.inject||{},a]);this.targetTextureType=o,this.samplerTextureMap=s;return{vs:r,fs:t._fs||u({version:v(r),input:this.targetTextureVarying,inputType:o,output:"transform_output"}),modules:this.hasSourceTextures||this.targetTextureVarying?[b].concat(t.modules||[]):t.modules,uniforms:i,inject:c}}}var O=n(45),S=n(178);n.d(e,"a",(function(){return T}));class T{static isSupported(t){return Object(l.j)(t)}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.gl=t,this.model=null,this.elementCount=0,this.bufferTransform=null,this.textureTransform=null,this.elementIDBuffer=null,this._initialize(e),Object.seal(this)}delete(){const{model:t,bufferTransform:e,textureTransform:n}=this;t&&t.delete(),e&&e.delete(),n&&n.delete()}run(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{clearRenderTarget:e=!0}=t,n=this._updateDrawOptions(t);e&&n.framebuffer&&n.framebuffer.clear({color:!0}),this.model.transform(n)}swap(){let t=!1;const e=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const n of e)t=t||n.swap();Object(p.a)(t,"Nothing to swap")}getBuffer(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return this.bufferTransform&&this.bufferTransform.getBuffer(t)}getData(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const n of e){const e=n.getData(t);if(e)return e}return null}getFramebuffer(){return this.textureTransform&&this.textureTransform.getFramebuffer()}update(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"elementCount"in t&&this.model.setVertexCount(t.elementCount);const e=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const n of e)n.update(t)}_initialize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{gl:e}=this;this._buildResourceTransforms(e,t),t=this._updateModelProps(t),this.model=new S.a(e,Object.assign({},t,{fs:t.fs||u({version:v(t.vs)}),id:t.id||"transform-model",drawMode:t.drawMode||0,vertexCount:t.elementCount})),this.bufferTransform&&this.bufferTransform.setupResources({model:this.model})}_updateModelProps(t){let e=Object.assign({},t);const n=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const t of n)e=t.updateModelProps(e);return e}_buildResourceTransforms(t,e){(function(t){if(!Object(O.a)(t.feedbackBuffers)||!Object(O.a)(t.feedbackMap)||t.varyings&&t.varyings.length>0)return!0;return!1})(e)&&(this.bufferTransform=new d(t,e)),function(t){if(!Object(O.a)(t._sourceTextures)||t._targetTexture||t._targetTextureVarying)return!0;return!1}(e)&&(this.textureTransform=new E(t,e)),Object(p.a)(this.bufferTransform||this.textureTransform,"must provide source/feedback buffers or source/target textures")}_updateDrawOptions(t){let e=Object.assign({},t);const n=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const t of n)e=Object.assign(e,t.getDrawOptions(e));return e}}},function(t,e,n){"use strict";var r=n(115),i=n(22),o=n(114),a=n(13),s=n(24),u=n(53);let c;class l extends o.a{static get ZERO(){return c||(c=new l(0,0,0,0),Object.freeze(c)),c}constructor(t=0,e=0,n=0,r=0){super(-0,-0,-0,-0),Object(a.f)(t)&&1===arguments.length?this.copy(t):(a.b.debug&&(Object(i.a)(t),Object(i.a)(e),Object(i.a)(n),Object(i.a)(r)),this[0]=t,this[1]=e,this[2]=n,this[3]=r)}set(t,e,n,r){return this[0]=t,this[1]=e,this[2]=n,this[3]=r,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}fromObject(t){return a.b.debug&&(Object(i.a)(t.x),Object(i.a)(t.y),Object(i.a)(t.z),Object(i.a)(t.w)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this[3]=t.w,this}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t.w=this[3],t}get ELEMENTS(){return 4}get z(){return this[2]}set z(t){this[2]=Object(i.a)(t)}get w(){return this[3]}set w(t){this[3]=Object(i.a)(t)}transform(t){return s.p(this,this,t),this.check()}transformByMatrix3(t){return Object(u.e)(this,this,t),this.check()}transformByMatrix2(t){return Object(u.d)(this,this,t),this.check()}transformByQuaternion(t){return s.q(this,this,t),this.check()}applyMatrix4(t){return t.transform(this,this),this}}var h=n(11),f=n(54),p=n(35);function d(){var t=new h.a(4);return h.a!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function A(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 g(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=n[0],u=n[1],c=n[2],l=n[3];return t[0]=r*l+a*s+i*c-o*u,t[1]=i*l+a*u+o*s-r*c,t[2]=o*l+a*c+r*u-i*s,t[3]=a*l-r*s-i*u-o*c,t}function m(t,e,n,r){var i,o,a,s,u,c=e[0],l=e[1],f=e[2],p=e[3],d=n[0],A=n[1],g=n[2],m=n[3];return(o=c*d+l*A+f*g+p*m)<0&&(o=-o,d=-d,A=-A,g=-g,m=-m),1-o>h.b?(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*c+u*d,t[1]=s*l+u*A,t[2]=s*f+u*g,t[3]=s*p+u*m,t}function y(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}p.b,p.g,p.c,p.l;var v,_,b,x,w,E,O=p.a,S=p.k,T=p.d,C=p.i,P=p.h,M=p.m,I=p.j,B=(p.f,p.e,v=s.c(),_=s.f(1,0,0),b=s.f(0,1,0),function(t,e,n){var r=s.e(e,n);return r<-.999999?(s.d(v,_,e),s.g(v)<1e-6&&s.d(v,b,e),s.k(v,v),A(t,v,Math.PI),t):r>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(s.d(v,e,n),t[0]=v[0],t[1]=v[1],t[2]=v[2],t[3]=1+r,I(t,t))});x=d(),w=d(),E=f.a();n.d(e,"a",(function(){return k}));const R=[0,0,0,1];class k extends r.a{constructor(t=0,e=0,n=0,r=1){super(-0,-0,-0,-0),Array.isArray(t)&&1===arguments.length?this.copy(t):this.set(t,e,n,r)}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}set(t,e,n,r){return this[0]=t,this[1]=e,this[2]=n,this[3]=r,this.check()}fromObject(t){return this[0]=t.x,this[1]=t.y,this[2]=t.z,this[3]=t.w,this.check()}fromMatrix3(t){return y(this,t),this.check()}fromAxisRotation(t,e){return A(this,t,e),this.check()}identity(){var t;return(t=this)[0]=0,t[1]=0,t[2]=0,t[3]=1,this.check()}setAxisAngle(t,e){return this.fromAxisRotation(t,e)}get ELEMENTS(){return 4}get x(){return this[0]}set x(t){this[0]=Object(i.a)(t)}get y(){return this[1]}set y(t){this[1]=Object(i.a)(t)}get z(){return this[2]}set z(t){this[2]=Object(i.a)(t)}get w(){return this[3]}set w(t){this[3]=Object(i.a)(t)}len(){return P(this)}lengthSquared(){return M(this)}dot(t){return T(this,t)}rotationTo(t,e){return B(this,t,e),this.check()}add(t){return O(this,this,t),this.check()}calculateW(){var t,e,n,r,i;return t=this,n=(e=this)[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.check()}conjugate(){var t,e;return e=this,(t=this)[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],this.check()}invert(){var t,e,n,r,i,o,a,s;return t=this,n=(e=this)[0],r=e[1],i=e[2],o=e[3],s=(a=n*n+r*r+i*i+o*o)?1/a:0,t[0]=-n*s,t[1]=-r*s,t[2]=-i*s,t[3]=o*s,this.check()}lerp(t,e,n){return void 0===n?this.lerp(this,t,e):(C(this,t,e,n),this.check())}multiplyRight(t){return g(this,this,t),this.check()}multiplyLeft(t){return g(this,t,this),this.check()}normalize(){const t=this.len(),e=t>0?1/t:0;return this[0]=this[0]*e,this[1]=this[1]*e,this[2]=this[2]*e,this[3]=this[3]*e,0===t&&(this[3]=1),this.check()}rotateX(t){return function(t,e,n){n*=.5;var 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()}rotateY(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()}rotateZ(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()}scale(t){return S(this,this,t),this.check()}slerp(t,e,n){let r,i,o;switch(arguments.length){case 1:({start:r=R,target:i,ratio:o}=t);break;case 2:r=this,i=t,o=e;break;default:r=t,i=e,o=n}return m(this,r,i,o),this.check()}transformVector4(t,e=new l){return p.o(e,t,this),Object(i.b)(e,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(t,e){return this.setAxisAngle(t,e)}premultiply(t){return this.multiplyLeft(t)}multiply(t){return this.multiplyRight(t)}}},function(t,e,n){"use strict";var r=n(138);n.d(e,"a",(function(){return i}));const i={name:"pbr",vs:"uniform mat4 u_MVPMatrix;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_NormalMatrix;\n\nvarying vec3 pbr_vPosition;\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n# ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n# else\nvarying vec3 pbr_vNormal;\n# endif\n#endif\n\nvoid pbr_setPositionNormalTangentUV(vec4 position, vec4 normal, vec4 tangent, vec2 uv)\n{\n vec4 pos = u_ModelMatrix * position;\n pbr_vPosition = vec3(pos.xyz) / pos.w;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\n vec3 normalW = normalize(vec3(u_NormalMatrix * vec4(normal.xyz, 0.0)));\n vec3 tangentW = normalize(vec3(u_ModelMatrix * vec4(tangent.xyz, 0.0)));\n vec3 bitangentW = cross(normalW, tangentW) * tangent.w;\n pbr_vTBN = mat3(tangentW, bitangentW, normalW);\n#else\n pbr_vNormal = normalize(vec3(u_ModelMatrix * vec4(normal.xyz, 0.0)));\n#endif\n#endif\n\n#ifdef HAS_UV\n pbr_vUV = uv;\n#else\n pbr_vUV = vec2(0.,0.);\n#endif\n}\n",fs:"#if defined(USE_TEX_LOD) && !defined(FEATURE_GLSL_TEXTURE_LOD)\n# error PBR fragment shader: Texture LOD is not available\n#endif\n\n#if !defined(HAS_TANGENTS) && !defined(FEATURE_GLSL_DERIVATIVES)\n# error PBR fragment shader: Derivatives are not available\n#endif\n\n\n#if (__VERSION__ < 300)\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL1COND; INCR)\n#else\n #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL2COND; INCR)\n#endif\n\nprecision highp float;\n\nuniform bool pbr_uUnlit;\n\n#ifdef USE_IBL\nuniform samplerCube u_DiffuseEnvSampler;\nuniform samplerCube u_SpecularEnvSampler;\nuniform sampler2D u_brdfLUT;\nuniform vec2 u_ScaleIBLAmbient;\n#endif\n\n#ifdef HAS_BASECOLORMAP\nuniform sampler2D u_BaseColorSampler;\n#endif\n#ifdef HAS_NORMALMAP\nuniform sampler2D u_NormalSampler;\nuniform float u_NormalScale;\n#endif\n#ifdef HAS_EMISSIVEMAP\nuniform sampler2D u_EmissiveSampler;\nuniform vec3 u_EmissiveFactor;\n#endif\n#ifdef HAS_METALROUGHNESSMAP\nuniform sampler2D u_MetallicRoughnessSampler;\n#endif\n#ifdef HAS_OCCLUSIONMAP\nuniform sampler2D u_OcclusionSampler;\nuniform float u_OcclusionStrength;\n#endif\n\n#ifdef ALPHA_CUTOFF\nuniform float u_AlphaCutoff;\n#endif\n\nuniform vec2 u_MetallicRoughnessValues;\nuniform vec4 u_BaseColorFactor;\n\nuniform vec3 u_Camera;\n#ifdef PBR_DEBUG\nuniform vec4 u_ScaleDiffBaseMR;\nuniform vec4 u_ScaleFGDSpec;\n#endif\n\nvarying vec3 pbr_vPosition;\n\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n#else\nvarying vec3 pbr_vNormal;\n#endif\n#endif\n\n\nstruct PBRInfo\n{\n float NdotL;\n float NdotV;\n float NdotH;\n float LdotH;\n float VdotH;\n float perceptualRoughness;\n float metalness;\n vec3 reflectance0;\n vec3 reflectance90;\n float alphaRoughness;\n vec3 diffuseColor;\n vec3 specularColor;\n vec3 n;\n vec3 v;\n};\n\nconst float M_PI = 3.141592653589793;\nconst float c_MinRoughness = 0.04;\n\nvec4 SRGBtoLINEAR(vec4 srgbIn)\n{\n#ifdef MANUAL_SRGB\n#ifdef SRGB_FAST_APPROXIMATION\n vec3 linOut = pow(srgbIn.xyz,vec3(2.2));\n#else\n vec3 bLess = step(vec3(0.04045),srgbIn.xyz);\n vec3 linOut = mix( srgbIn.xyz/vec3(12.92), pow((srgbIn.xyz+vec3(0.055))/vec3(1.055),vec3(2.4)), bLess );\n#endif\n return vec4(linOut,srgbIn.w);;\n#else\n return srgbIn;\n#endif\n}\n\nvec3 getNormal()\n{\n#ifndef HAS_TANGENTS\n vec3 pos_dx = dFdx(pbr_vPosition);\n vec3 pos_dy = dFdy(pbr_vPosition);\n vec3 tex_dx = dFdx(vec3(pbr_vUV, 0.0));\n vec3 tex_dy = dFdy(vec3(pbr_vUV, 0.0));\n vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t);\n\n#ifdef HAS_NORMALS\n vec3 ng = normalize(pbr_vNormal);\n#else\n vec3 ng = cross(pos_dx, pos_dy);\n#endif\n\n t = normalize(t - ng * dot(ng, t));\n vec3 b = normalize(cross(ng, t));\n mat3 tbn = mat3(t, b, ng);\n#else\n mat3 tbn = pbr_vTBN;\n#endif\n\n#ifdef HAS_NORMALMAP\n vec3 n = texture2D(u_NormalSampler, pbr_vUV).rgb;\n n = normalize(tbn * ((2.0 * n - 1.0) * vec3(u_NormalScale, u_NormalScale, 1.0)));\n#else\n vec3 n = normalize(tbn[2].xyz);\n#endif\n\n return n;\n}\n\n\n#ifdef USE_IBL\nvec3 getIBLContribution(PBRInfo pbrInputs, vec3 n, vec3 reflection)\n{\n float mipCount = 9.0;\n float lod = (pbrInputs.perceptualRoughness * mipCount);\n vec3 brdf = SRGBtoLINEAR(texture2D(u_brdfLUT,\n vec2(pbrInputs.NdotV, 1.0 - pbrInputs.perceptualRoughness))).rgb;\n vec3 diffuseLight = SRGBtoLINEAR(textureCube(u_DiffuseEnvSampler, n)).rgb;\n\n#ifdef USE_TEX_LOD\n vec3 specularLight = SRGBtoLINEAR(textureCubeLod(u_SpecularEnvSampler, reflection, lod)).rgb;\n#else\n vec3 specularLight = SRGBtoLINEAR(textureCube(u_SpecularEnvSampler, reflection)).rgb;\n#endif\n\n vec3 diffuse = diffuseLight * pbrInputs.diffuseColor;\n vec3 specular = specularLight * (pbrInputs.specularColor * brdf.x + brdf.y);\n diffuse *= u_ScaleIBLAmbient.x;\n specular *= u_ScaleIBLAmbient.y;\n\n return diffuse + specular;\n}\n#endif\n\n\nvec3 diffuse(PBRInfo pbrInputs)\n{\n return pbrInputs.diffuseColor / M_PI;\n}\n\nvec3 specularReflection(PBRInfo pbrInputs)\n{\n return pbrInputs.reflectance0 +\n (pbrInputs.reflectance90 - pbrInputs.reflectance0) *\n pow(clamp(1.0 - pbrInputs.VdotH, 0.0, 1.0), 5.0);\n}\n\n\n\nfloat geometricOcclusion(PBRInfo pbrInputs)\n{\n float NdotL = pbrInputs.NdotL;\n float NdotV = pbrInputs.NdotV;\n float r = pbrInputs.alphaRoughness;\n\n float attenuationL = 2.0 * NdotL / (NdotL + sqrt(r * r + (1.0 - r * r) * (NdotL * NdotL)));\n float attenuationV = 2.0 * NdotV / (NdotV + sqrt(r * r + (1.0 - r * r) * (NdotV * NdotV)));\n return attenuationL * attenuationV;\n}\n\n\n\n\n\nfloat microfacetDistribution(PBRInfo pbrInputs)\n{\n float roughnessSq = pbrInputs.alphaRoughness * pbrInputs.alphaRoughness;\n float f = (pbrInputs.NdotH * roughnessSq - pbrInputs.NdotH) * pbrInputs.NdotH + 1.0;\n return roughnessSq / (M_PI * f * f);\n}\n\nvoid PBRInfo_setAmbientLight(inout PBRInfo pbrInputs) {\n pbrInputs.NdotL = 1.0;\n pbrInputs.NdotH = 0.0;\n pbrInputs.LdotH = 0.0;\n pbrInputs.VdotH = 1.0;\n}\n\nvoid PBRInfo_setDirectionalLight(inout PBRInfo pbrInputs, vec3 lightDirection) {\n vec3 n = pbrInputs.n;\n vec3 v = pbrInputs.v;\n vec3 l = normalize(lightDirection);\n vec3 h = normalize(l+v);\n\n pbrInputs.NdotL = clamp(dot(n, l), 0.001, 1.0);\n pbrInputs.NdotH = clamp(dot(n, h), 0.0, 1.0);\n pbrInputs.LdotH = clamp(dot(l, h), 0.0, 1.0);\n pbrInputs.VdotH = clamp(dot(v, h), 0.0, 1.0);\n}\n\nvoid PBRInfo_setPointLight(inout PBRInfo pbrInputs, PointLight pointLight) {\n vec3 light_direction = normalize(pointLight.position - pbr_vPosition);\n PBRInfo_setDirectionalLight(pbrInputs, light_direction);\n}\n\nvec3 calculateFinalColor(PBRInfo pbrInputs, vec3 lightColor) {\n vec3 F = specularReflection(pbrInputs);\n float G = geometricOcclusion(pbrInputs);\n float D = microfacetDistribution(pbrInputs);\n vec3 diffuseContrib = (1.0 - F) * diffuse(pbrInputs);\n vec3 specContrib = F * G * D / (4.0 * pbrInputs.NdotL * pbrInputs.NdotV);\n return pbrInputs.NdotL * lightColor * (diffuseContrib + specContrib);\n}\n\nvec4 pbr_filterColor(vec4 colorUnused)\n{\n#ifdef HAS_BASECOLORMAP\n vec4 baseColor = SRGBtoLINEAR(texture2D(u_BaseColorSampler, pbr_vUV)) * u_BaseColorFactor;\n#else\n vec4 baseColor = u_BaseColorFactor;\n#endif\n\n#ifdef ALPHA_CUTOFF\n if (baseColor.a < u_AlphaCutoff) {\n discard;\n }\n#endif\n\n vec3 color = vec3(0, 0, 0);\n\n if(pbr_uUnlit){\n color.rgb = baseColor.rgb;\n }\n else{\n\n\n float perceptualRoughness = u_MetallicRoughnessValues.y;\n float metallic = u_MetallicRoughnessValues.x;\n#ifdef HAS_METALROUGHNESSMAP\n\n vec4 mrSample = texture2D(u_MetallicRoughnessSampler, pbr_vUV);\n perceptualRoughness = mrSample.g * perceptualRoughness;\n metallic = mrSample.b * metallic;\n#endif\n perceptualRoughness = clamp(perceptualRoughness, c_MinRoughness, 1.0);\n metallic = clamp(metallic, 0.0, 1.0);\n\n float alphaRoughness = perceptualRoughness * perceptualRoughness;\n\n vec3 f0 = vec3(0.04);\n vec3 diffuseColor = baseColor.rgb * (vec3(1.0) - f0);\n diffuseColor *= 1.0 - metallic;\n vec3 specularColor = mix(f0, baseColor.rgb, metallic);\n float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b);\n\n\n\n float reflectance90 = clamp(reflectance * 25.0, 0.0, 1.0);\n vec3 specularEnvironmentR0 = specularColor.rgb;\n vec3 specularEnvironmentR90 = vec3(1.0, 1.0, 1.0) * reflectance90;\n\n vec3 n = getNormal();\n vec3 v = normalize(u_Camera - pbr_vPosition);\n\n float NdotV = clamp(abs(dot(n, v)), 0.001, 1.0);\n vec3 reflection = -normalize(reflect(v, n));\n\n PBRInfo pbrInputs = PBRInfo(\n 0.0,\n NdotV,\n 0.0,\n 0.0,\n 0.0,\n perceptualRoughness,\n metallic,\n specularEnvironmentR0,\n specularEnvironmentR90,\n alphaRoughness,\n diffuseColor,\n specularColor,\n n,\n v\n );\n\n#ifdef USE_LIGHTS\n PBRInfo_setAmbientLight(pbrInputs);\n color += calculateFinalColor(pbrInputs, lighting_uAmbientLight.color);\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uDirectionalLightCount, i++) {\n if (i < lighting_uDirectionalLightCount) {\n PBRInfo_setDirectionalLight(pbrInputs, lighting_uDirectionalLight[i].direction);\n color += calculateFinalColor(pbrInputs, lighting_uDirectionalLight[i].color);\n }\n }\n SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uPointLightCount, i++) {\n if (i < lighting_uPointLightCount) {\n PBRInfo_setPointLight(pbrInputs, lighting_uPointLight[i]);\n float attenuation = getPointLightAttenuation(lighting_uPointLight[i], distance(lighting_uPointLight[i].position, pbr_vPosition));\n color += calculateFinalColor(pbrInputs, lighting_uPointLight[i].color / attenuation);\n }\n }\n#endif\n#ifdef USE_IBL\n color += getIBLContribution(pbrInputs, n, reflection);\n#endif\n#ifdef HAS_OCCLUSIONMAP\n float ao = texture2D(u_OcclusionSampler, pbr_vUV).r;\n color = mix(color, color * ao, u_OcclusionStrength);\n#endif\n\n#ifdef HAS_EMISSIVEMAP\n vec3 emissive = SRGBtoLINEAR(texture2D(u_EmissiveSampler, pbr_vUV)).rgb * u_EmissiveFactor;\n color += emissive;\n#endif\n\n#ifdef PBR_DEBUG\n\n\n\n\n\n color = mix(color, baseColor.rgb, u_ScaleDiffBaseMR.y);\n color = mix(color, vec3(metallic), u_ScaleDiffBaseMR.z);\n color = mix(color, vec3(perceptualRoughness), u_ScaleDiffBaseMR.w);\n#endif\n\n }\n\n return vec4(pow(color,vec3(1.0/2.2)), baseColor.a);\n}\n",defines:{LIGHTING_FRAGMENT:1},dependencies:[r.a]}}])}));
//# sourceMappingURL=index.js.map