diff --git "a/rag/share/jupyter/nbextensions/pydeck/index.js" "b/rag/share/jupyter/nbextensions/pydeck/index.js" new file mode 100644--- /dev/null +++ "b/rag/share/jupyter/nbextensions/pydeck/index.js" @@ -0,0 +1,26 @@ +!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=260)}([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){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,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){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{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;ta(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{})}=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 L(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 D(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||L(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(142);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=Z(t[1],e,r,i),s=X(t[0]+1,e,n);const u=s===n-1?s:s-1;let c;return s=Z(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 Z(t,e,n,r){return r?Math.max(0,n-1-Math.round(t*e)):Math.min(Math.round(t*e),n-1)}const J=Object(G.a)(),Q=J&&"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(J,"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&&L(t,{copyState:!1,log:function(){for(var t=arguments.length,e=new Array(t),n=0;n1&&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(274);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){var r=n(271),i=n(272),o=n(273);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(21),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(144);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;n0&&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(1),T=n.n(S),C=n(124);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 D(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 L(t,e,n){const{azimuth:r,altitude:i}=D(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=L(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=L(this.timestamp,s,u)}return this}}]),n}(a.a),V=n(186),H=n(60);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(7),Z=n(188);function J(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=J(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(Z.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(178).a),K=n(205);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);n1&&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;a1&&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(73),ot=n(199),at=n(170),st=n(165),ut=n(164),ct=n(198),lt=n(172),ht=n(42),ft=n(86),pt=n(163),dt=n(78),At=n(19);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;e1&&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(159);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(84),Ot=n(13),St=n(25);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;e0&&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),Jt=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;o0&&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(158),ne=n(8),re=n.n(ne),ie=n(113);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=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);n0&&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(21),we=n(29),Ee=n(52),Oe=n(219),Se=n(67),Te=n(161),Ce=n(80),Pe=n(162),Me=n(138);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 Dt.a})),n.d(e,"phongLighting",(function(){return Dt.b})),n.d(e,"shadow",(function(){return Lt.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 Jt})),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";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t){var e=function(t,e){if("object"!==r(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===r(e)?e:String(e)}function o(t,e,n){return(e=i(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 o}))},,function(t,e,n){"use strict";var r=n(36);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 tn?n:t}const s=Math.log2||function(t){return Math.log(t)*Math.LOG2E};var u=n(26),c=n(34),l=n(25);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 D(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(ae&&(a=e)}}return{width:e,height:n,longitude:i,latitude:a,zoom:u,pitch:r,bearing:c}}const L=["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 L){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 D})),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(149);var s=n(216);n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return s}))},function(t,e,n){"use strict";var r=n(298);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;e0&&(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 B0&&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(63),o=n(53),a=n(7),s=n(10),u=n(143);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(68),i=n(84);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;l0&&(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(2),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;e80*n){g=f=t[0],m=p=t[1];for(let e=n;ef&&(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=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;n0||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.xo.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.x&&n.x>=u&&r!==n.x&&v(io.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=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;oe[2]&&(n|=2),t[1]e[3]&&(n|=8),n}function L(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;en&&(c=[],l.push(c),I(c,h)),p=D(f,d)}I(c,f),B(h,f)}return r?l:l[0]}function j(t,e){for(let n=0;n=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;ro?e:o,a=ns?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=L(a,{size:n,broken:!0,gridResolution:360,gridOffset:[-180,-180]});if(o)for(const t of s)Z(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;ei&&(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;a180||e<-180)&&(i-=360*Math.round(e/360)),t[a]=o=i}}function Z(t,e){let n;const r=t.length/e;for(let i=0;i1&&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(277)},function(t,e,n){var r=n(268),i=n(269),o=n(270);t.exports=function(t){return r(t)||i(t)||o()}},function(t,e,n){var r=n(266);Object.assign(r,n(66),n(292),n(291),n(151),n(294),n(196)),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(21),f=n(35),p=n(78),d=n(13),A=n(84),g=n(70),m=n(19),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.padding=e.padding,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 ec)n.set(e.subarray(0,c),i);else if(n.set(e,i),a)for(var l=u;l=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;f1)for(var n=1;nr&&(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(98);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.7",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(276)}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.7";const E=new b({id:"loaders.gl"});class O{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}var S=n(72);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=L(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]),L(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=D(u,o);E.warn("".concat(a," loader option '").concat(s).concat(u,"' not recognized. ").concat(t))()}}}function D(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 L(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(71),n(44))},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(8),l=n.n(c),h=n(5),f=n.n(h),p=n(6),d=n.n(p),A=n(1),g=n.n(A),m=n(114),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=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);n0&&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;f1&&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;t1&&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.readyStatethis.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.readyState0&&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){function n(e){return t.exports=n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},t.exports.__esModule=!0,t.exports.default=t.exports,n(e)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports},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.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(154),l=n(50);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=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(28),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(42),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(61),g=n(29);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;e0&&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(22);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(53),i=n(10),o=n(143);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;nthis._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(245),a=n.n(o),s=n(37);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);n4&&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=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;oA&&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,n){"use strict";n.r(e);var r=n(103),i=n(20);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(100),s=n(72),u=n(85),c=n(106);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(101);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(46),A=n(112),g=n(79),m=n(105),y=n(45),v=n(126),_=n(91),b=n(62);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(156);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(215);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(220),P=n(134),M=n(190),I=n(179);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 D(t,e,n){if(e.encodeSync)return e.encodeSync(t,n);throw new Error("Writer could not synchronously encode data")}async function L(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,D(t,n,r))}var G=n(221),V=n(127);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 Z=n(222);async function J(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(2);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;e0&&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 if (transparentColor.a == 0.0) {\n return vec4(color, alpha);\n }\n float blendedAlpha = alpha + transparentColor.a * (1.0 - alpha);\n float highLightRatio = alpha / blendedAlpha;\n vec3 blendedRGB = mix(transparentColor.rgb, color, highLightRatio);\n return vec4(blendedRGB, blendedAlpha);\n}\n\nvec2 getUV(vec2 pos) {\n return vec2(\n (pos.x - bounds[0]) / (bounds[2] - bounds[0]),\n (pos.y - bounds[3]) / (bounds[1] - bounds[3])\n );\n}\n\n".concat("\nvec3 packUVsIntoRGB(vec2 uv) {\n // Extract the top 8 bits. We want values to be truncated down so we can add a fraction\n vec2 uv8bit = floor(uv * 256.);\n\n // Calculate the normalized remainders of u and v parts that do not fit into 8 bits\n // Scale and clamp to 0-1 range\n vec2 uvFraction = fract(uv * 256.);\n vec2 uvFraction4bit = floor(uvFraction * 16.);\n\n // Remainder can be encoded in blue channel, encode as 4 bits for pixel coordinates\n float fractions = uvFraction4bit.x + uvFraction4bit.y * 16.;\n\n return vec3(uv8bit, fractions) / 255.;\n}\n","\n\nvoid main(void) {\n vec2 uv = vTexCoord;\n if (coordinateConversion < -0.5) {\n vec2 lnglat = mercator_to_lnglat(vTexPos);\n uv = getUV(lnglat);\n } else if (coordinateConversion > 0.5) {\n vec2 commonPos = lnglat_to_mercator(vTexPos);\n uv = getUV(commonPos);\n }\n vec4 bitmapColor = texture2D(bitmapTexture, uv);\n\n gl_FragColor = apply_opacity(color_tint(color_desaturate(bitmapColor.rgb)), bitmapColor.a * opacity);\n\n geometry.uv = uv;\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n\n if (picking_uActive) {\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 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",L);var z=n(118),U=n(231),N=n(232),G=n(168),V=n(167),H=n(223),W=n(117),q=n(224),X=n(229),Z=n(166),J=n(116),Q=n(171),K=n(169);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 Z.a})),n.d(e,"SolidPolygonLayer",(function(){return J.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;++r0&&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.lengththis.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){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";(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(71),n(44))},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(27),u=n.n(s),c=n(5),l=n.n(c),h=n(6),f=n.n(h),p=n(1),d=n.n(p),A=n(0),g=n.n(A),m=n(178),y=n(7),v=n(188);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);n0&&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;f1&&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(2),i=n(137);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(177),o=n(23),a=n(55),s=n(26),u=n(34),c=n(25),l=n(36);!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(20),i=n(85),o=n(45);const a=new(n(298).a)({id:"loaders.gl"});var s=n(62),u=n(112),c=n(22);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.byteLengtht 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(27),l=n.n(c),h=n(8),f=n.n(h),p=n(5),d=n.n(p),A=n(6),g=n.n(A),m=n(1),y=n.n(m),v=n(0),_=n.n(v),b=n(42),x=n(19),w=n(92),E=n(13),O=n(78);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;e0&&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,D=void 0!==k&&k,L=r.width,j=r.height,F=r.altitude,z=void 0===F?1.5:F,U=Math.pow(2,f);L=L||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:L,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 Z=(new O.a).translate([512*I,0,0]);X=Z.multiplyLeft(X)}return(t=e.call(this,T(T(T({},r),{},{width:L,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=D,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(174),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;r0;)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.length0?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;c0&&(a+=i),a+=p(t[c],c);e.length>0&&(a+=o)}for(var l=0;l0&&!d&&(a+=i);var v=s&&u?t[y]:y;a+=p(e[l][v],y)}l0&&!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-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=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):r1&&i[0].length=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;c1&&(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 L();if(s||!1!==s&&-1===t.indexOf(e)){for(var w=t.split(r),O=0;O=a)return y=y.slice(0,a),L(!0)}}return L()}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 L();c=C+A,C=t.indexOf(r,c),T=t.indexOf(n,c)}else if(-1!==T&&(T=a)return L(!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 L();if(a&&y.length>=a)return L(!0);break}var I=R(C);if(t.substr(S+1+I,A)===r){if(_.push(t.substring(c,S).replace(P,e)),D(S+1+I+A),T=t.indexOf(n,c),m&&(j(),l))return L();if(a&&y.length>=a)return L(!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 L();if(a&&y.length>=a)return L(!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()),L()}function D(e){c=e,B(_),_=[],C=t.indexOf(r,c)}function L(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(L(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.3.3",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{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){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=[];for(let r=0;r2&&void 0!==arguments[2]?arguments[2]:"sessionStorage";Object(s.a)(this,"storage",void 0),Object(s.a)(this,"id",void 0),Object(s.a)(this,"config",void 0),this.storage=function(t){try{const e=window[t],n="__storage_test__";return e.setItem(n,n),e.removeItem(n),e}catch(t){return null}}(n),this.id=t,this.config=e,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(t){if(Object.assign(this.config,t),this.storage){const t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}}_loadConfiguration(){let t={};if(this.storage){const e=this.storage.getItem(this.id);t=e?JSON.parse(e):{}}return Object.assign(this.config,t),this}}function j(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 F;function z(t){return"string"==typeof t?F[t.toUpperCase()]||F.WHITE:t}function U(t,e){if(!t)throw new Error(e||"Assertion failed")}!function(t){t[t.BLACK=30]="BLACK",t[t.RED=31]="RED",t[t.GREEN=32]="GREEN",t[t.YELLOW=33]="YELLOW",t[t.BLUE=34]="BLUE",t[t.MAGENTA=35]="MAGENTA",t[t.CYAN=36]="CYAN",t[t.WHITE=37]="WHITE",t[t.BRIGHT_BLACK=90]="BRIGHT_BLACK",t[t.BRIGHT_RED=91]="BRIGHT_RED",t[t.BRIGHT_GREEN=92]="BRIGHT_GREEN",t[t.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",t[t.BRIGHT_BLUE=94]="BRIGHT_BLUE",t[t.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",t[t.BRIGHT_CYAN=96]="BRIGHT_CYAN",t[t.BRIGHT_WHITE=97]="BRIGHT_WHITE"}(F||(F={}));var N=n(99);function G(){let t;var e,n;if(D.a&&"performance"in N.b)t=null===N.b||void 0===N.b||null===(e=N.b.performance)||void 0===e||null===(n=e.now)||void 0===n?void 0:n.call(e);else if("hrtime"in N.a){var r;const e=null===N.a||void 0===N.a||null===(r=N.a.hrtime)||void 0===r?void 0:r.call(N.a);t=1e3*e[0]+e[1]/1e6}else t=Date.now();return t}const V={debug:D.a&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},H={enabled:!0,level:0};function W(){}const q={},X={once:!0};class Z{constructor(){let{id:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:""};Object(s.a)(this,"id",void 0),Object(s.a)(this,"VERSION","8.9.7"),Object(s.a)(this,"_startTs",G()),Object(s.a)(this,"_deltaTs",G()),Object(s.a)(this,"_storage",void 0),Object(s.a)(this,"userData",{}),Object(s.a)(this,"LOG_THROTTLE_TIMEOUT",0),this.id=t,this.userData={},this._storage=new L("__probe-".concat(this.id,"__"),H),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((G()-this._startTs).toPrecision(10))}getDelta(){return Number((G()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._storage.setConfiguration({enabled:t}),this}setLevel(t){return this._storage.setConfiguration({level:t}),this}get(t){return this._storage.config[t]}set(t,e){this._storage.setConfiguration({[t]:e})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(t,e){U(t,e)}warn(t){return this._getLogFunction(0,t,V.warn,arguments,X)}error(t){return this._getLogFunction(0,t,V.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,V.log,arguments,{time:!0,once:!0})}log(t,e){return this._getLogFunction(t,e,V.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{const e=j(t,n,r);console.log(...e)},t.src=e,W}const i=e.nodeName||"";if("img"===i.toLowerCase())return console.log(...j(e,n,r)),W;if("canvas"===i.toLowerCase()){const t=new Image;return t.onload=()=>console.log(...j(t,n,r)),t.src=e.toDataURL(),W}return W}({image:r,message:i,scale:o}):function(t){let{image:e,message:n="",scale:r=1}=t;return console.warn("removed"),W}({image:r,message:i,scale:o}):W}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||W)}group(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{collapsed:!1};const r=Q({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||W)}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()>=J(t)}_getLogFunction(t,e,n,r,i){if(this._shouldLog(t)){i=Q({logLevel:t,message:e,args:r,opts:i}),U(n=n||i.method),i.total=this.getTotal(),i.delta=this.getDelta(),this._deltaTs=G();const o=i.tag||i.message;if(i.once){if(q[o])return W;q[o]=G()}return e=function(t,e,n){if("string"==typeof e){const a=n.time?function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;const n=Math.max(e-t.length,0);return"".concat(" ".repeat(n)).concat(t)}(function(t){let e;return e=t<10?"".concat(t.toFixed(2),"ms"):t<100?"".concat(t.toFixed(1),"ms"):t<1e3?"".concat(t.toFixed(0),"ms"):"".concat((t/1e3).toFixed(2),"s"),e}(n.total)):"";e=n.time?"".concat(t,": ").concat(a," ").concat(e):"".concat(t,": ").concat(e),r=e,i=n.color,o=n.background,D.a||"string"!=typeof r||(i&&(i=z(i),r="[".concat(i,"m").concat(r,"")),o&&(i=z(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 W}}function J(t){if(!t)return 0;let e;switch(typeof t){case"number":e=t;break;case"object":e=t.logLevel||t.priority||0;break;default:return 0}return U(Number.isFinite(e)&&e>=0),e}function Q(t){const{logLevel:e,message:n}=t;t.logLevel=J(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 U("string"===i||"object"===i),Object.assign(t,{args:r},t.opts)}function K(t){for(const e in t)for(const n in t[e])return n||"untitled";return"empty"}Object(s.a)(Z,"VERSION","8.9.7");new Z({id:"loaders.gl"});var Y=n(318);new class{constructor(){Object(s.a)(this,"console",void 0),this.console=console}log(){for(var t=arguments.length,e=new Array(t),n=0;n{const t=$();return t.loaderRegistry=t.loaderRegistry||[],t.loaderRegistry};var et,nt,rt=n(250),it=n.n(rt);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);n4)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=""}return e.length>50&&(e=e.slice(0,50)),e}function dt(t,e){var n,r,i=t,o=ot(it()(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=ot(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 At=n(131),gt={};var mt=n(41);var yt=n(88),vt=n.n(yt),_t=n(89),bt=n.n(_t),xt={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},wt=function(){function t(e){var n=e.container,r=e.props;vt()(this,t);var i=r.description,o=document.createElement("div");o.className="deck-json-description-box",Object.assign(o.style,xt),this.el=o;var a=document.createElement("div");a.innerHTML=i,o.appendChild(a),n.append(o)}return bt()(t,[{key:"remove",value:function(){this.el.remove(),this.description=null}}],[{key:"stringName",get:function(){return"description"}}]),t}();function Et(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=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 Tt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r={},i=Object.keys(e).filter(n),o=St(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 It={classes:Mt(mt,Ct),enumerations:{COORDINATE_SYSTEM:mt.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}}};!function(t){const e=tt();t=Array.isArray(t)?t:[t];for(const n of t){const t=k(n);e.find(e=>t===e)||e.unshift(t)}}([C]);var Bt=new mt.JSONConverter({configuration:It});function Rt(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(!gt[t]){var e=document.createElement("script");e.type="text/javascript",e.src=t,document.querySelector("head").appendChild(e),gt[t]=new Promise((function(t){e.onload=t}))}gt[t]}(i))}))}function r(t,r){!function(t,e){var n={classes:Mt(t,Ct),functions:Mt(t,Pt)};e.mergeConfiguration(n)}(r,Bt),n[t]=r,Object.values(n).every((function(t){return t}))&&"function"==typeof e&&e()}}function kt(t,e){var n=Bt.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=Ot(Ot({},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 mt.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 mt.log.info("Using Mapbox base maps")(),new mt.DeckGL(Ot(Ot(Ot({},u),n),{},{map:At.a,mapboxApiAccessToken:r,onLoad:At.c}));case"carto":return mt.log.info("Using Carto base maps")(),new mt.DeckGL(Ot(Ot({map:At.a},u),n));case"google_maps":return mt.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 mt.log.warn("No Google Maps API key set")(),null;var u=new mt.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}(Ot(Ot(Ot({},u),n),{},{googleMapsKey:i}));default:return mt.log.info("No recognized map provider specified")(),new mt.DeckGL(Ot(Ot(Ot({},u),n),{},{map:null,mapboxApiAccessToken:null}))}}function Lt(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&&Bt.mergeConfiguration(c);var l=o.layers||[],h=Bt.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);if.length&&e.setProps({layers:t})}}))}catch(t){console.error(t)}return e}},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){var r=n(214);function i(t,e){for(var n=0;n0&&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(100),i=n(108);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(124),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(51),i=n(155);var o=n(195),a=n(45),s=n(22),u=n(46),c=n(126),l=n(91),h=n(62),f=n(79);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(7),i=n(54),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(22),i=n(62);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;t60?"".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(7),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(71))},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(71))},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(45),i=n(46);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(27),i=n.n(r),o=n(8),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(1),y=n.n(m),v=n(13),_=n(58),b=n(125),x=n(19),w=n(29),E=n(50);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;e0&&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=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);n90)&&(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=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);n2?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;s0&&!Number.isFinite(t[0])}var L="\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(L,"\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(L,"\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=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);n2&&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 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:D},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=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);n0){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;df&&(L(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&&L(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||k})),this._texture.height!==this._canvasHeight&&(this._texture=(n=this._texture,r=this._canvasWidth,i=this._canvasHeight,o=this._textureParameters||k,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=P(t);try{var o=function(){var t=e.value;n._pendingCount++,Object(T.a)(t.url,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 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=0&&t=0&&t0?", ":"")+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=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);n0,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;u0?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(70),i=n(90),o=n(12),a=n(80),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(156),i=n(22),o=n(127),a=n(108);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(72),o=n(85);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(22);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 + * 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||360)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>>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>>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<=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<>>32-t,this.unsigned):a(0,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(52),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);n0&&void 0!==arguments[0]?arguments[0]:o;Object(i.b)(t)}function s(){for(var t=0,e=["mapboxgl-missing-css"];t{};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{}};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=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);n0&&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",L),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;s2&&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\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-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;rn[e]})):r.sort()),r}function B(t,e){for(var n,r,i=e[0].toUpperCase()+e.slice(1),o=0;o1&&!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=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 Z={mousedown:1,mousemove:2,mouseup:4};function J(){this.evEl="mousedown",this.evWin="mousemove mouseup",this.pressed=!1,U.apply(this,arguments)}_(J,U,{handler:function(t){var e=Z[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-1&&r.splice(t,1)}),2500)}}function lt(t){for(var e=t.srcEvent.clientX,n=t.srcEvent.clientY,r=0;r-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;te.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.distancee.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=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(233);n.d(e,"SimpleMeshLayer",(function(){return r.a}));var i=n(228);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(1),f=n.n(h),p=n(0),d=n.n(p),A=n(59),g=n(86),m=n(113);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(75);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;e0||"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(85);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(204);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);ni&&(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=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(1),g=n.n(A),m=n(78),y=n(42),v=n(12),_=n(83),b=n(90);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;e0&&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&&(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(27),l=n.n(c),h=n(5),f=n.n(h),p=n(6),d=n.n(p),A=n(1),g=n.n(A),m=n(0),y=n.n(m),v=n(12),_=n(165),b=n(43),x=n(13),w=n(75);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?{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);n0}},{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=L[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(138),z=n(24),U=n(161),N=n(32),G=n(7),V=n(29),H=n(80),W=n(162),q=n(145),X=n(68),Z=n(52),J=n(28),Q=n.n(J),K=n(107);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=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=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);n0&&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(Z.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}()),Dt=n(19),Lt=n(215);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);n1&&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,rGt&&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=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(27),f=n.n(h),p=n(8),d=n.n(p),A=n(5),g=n.n(A),m=n(6),y=n.n(m),v=n(1),_=n.n(v),b=n(251),x=n(189),w=n(33);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=o){for(var a=new Array(i).fill(1/0),s=new Array(i).fill(-1/0),u=0;us[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.byteLength0&&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=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=e[1])return t;for(var n=[],r=t.length,i=0,o=0;oe[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(43);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);n0&&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.byteLength1&&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(D.a)(ArrayBuffer.isView(o.value),"invalid ".concat(r.accessor));var a=Boolean(o.size)&&o.size!==this.size;return n.binaryAccessor=Object(L.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(D.a)("function"==typeof d,'accessor "'.concat(f,'" is not a function'));var A,g=t.getVertexOffset(r),m=Object(L.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.indexl?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(32),X=n(322),Z=n(75);function J(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=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=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 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=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);n1&&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(27),l=n.n(c),h=n(5),f=n.n(h),p=n(6),d=n.n(p),A=n(1),g=n.n(A),m=n(0),y=n.n(m),v=n(52),_=n(198),b=n(171);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;t0?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-1);u++,o[u]=s,a[u]=c,a[u+1]=x}for(let s=0,u=0;s=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);nr&&(as){var h=M(t,s,u,i);c+h>r&&(ar&&(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;u0,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=v0&&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);n0&&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(169);function Z(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 J(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 J(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 J(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=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=3,"Invalid cache limit"),G=new L(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(8),u=n.n(s),c=n(5),l=n.n(c),h=n(6),f=n.n(h),p=n(1),d=n.n(p),A=n(0),g=n.n(A),m=n(217),y=n(235),v=n(234),_=n(12),b=n(164),x=n(7),w=n(251),E=n(189),O=n(186),S=n(21),T=n(47),C=n(60),P=n(37);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=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 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 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(8),u=n.n(s),c=n(5),l=n.n(c),h=n(6),f=n.n(h),p=n(1),d=n.n(p),A=n(0),g=n.n(A),m=n(217),y=n(234),v=n(12),_=n(164),b=n(186),x=n(60);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=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);n0}},{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=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);n1&&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 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(32),l=n(5),h=n.n(l),f=n(6),p=n.n(f),d=n(1),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(73).a),v=n(180),_=n(74);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);n0&&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(28),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;e0&&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){var r=n(214);t.exports=function(t,e,n){return(e=r(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},t.exports.__esModule=!0,t.exports.default=t.exports},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(44))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(7);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(122),i=n(23),o=n(13);class a extends r.a{toString(){let t="[";if(o.b.printRowMajor){t+="row-major:";for(let e=0;e1&&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(27),u=n.n(s),c=n(8),l=n.n(c),h=n(5),f=n.n(h),p=n(6),d=n.n(p),A=n(1),g=n.n(A),m=n(0),y=n.n(m),v=n(73),_=n(7),b=n(12),x=n(21);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=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=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;ff&&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=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(2);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;ee[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"},D={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array};class L{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;ti?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;rthis.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(317);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(49);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 L(n);try{return r.parseSync(t,null==e?void 0:e.draco)}finally{r.destroy()}}}},function(t,e,n){"use strict";var r=n(7),i=n(204),o=n(47),a=n(10),s=n(188),u=n(321),c=n(63),l=n(33),h=n(38);let f=null;function p(t,e){var n;return new t((n=t.BYTES_PER_ELEMENT*e,(!f||f.byteLength1&&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{switch(t){case 34373:return this.gl.getVertexAttribOffset(n,t);default:return this.gl.getVertexAttrib(n,t)}})}}var g=n(176);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.elements&&this.setElementBuffer(this.elements);for(let t=0;t{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;t0;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(314),b=n(48),x=n(81);function w(t,e){const{maxElts:n=16,size:r=1}=e;let i="[";for(let o=0;o0&&(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)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 D}));const R=()=>{},k={};class D{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>> 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(7),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(74),i=n(107);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(51);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(77),i=n(187);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;tt+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){function n(e){return t.exports=n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,n(e)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){"use strict";n.d(e,"a",(function(){return a})),n.d(e,"b",(function(){return s}));var r=n(49),i=n(134),o=n(190);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(28),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 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(8),u=n.n(s),c=n(5),l=n.n(c),h=n(6),f=n.n(h),p=n(1),d=n.n(p),A=n(0),g=n.n(A),m=n(164),y=n(32),v=n(67);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);n0&&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(170),l=n(61),h=n(21),f=n(67);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;e0&&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(153),m=n(139),y=n(107),v=n(13),_=n(8),b=n.n(_),x=n(5),w=n.n(x),E=n(6),O=n.n(E),S=n(1),T=n.n(S),C=n(74),P=n(7),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=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=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);n4)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);n0&&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(172),Z=n(206),J=n(180);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;ef)d+=4*c;else for(var y=0;y=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=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);n1&&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=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=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(Z.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(68),ft=n(200),pt=n(313),dt=n(132),At=n(10),gt=n(38),mt=n(251),yt=n(189);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(142);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(315),Ot=n(76),St=n(147),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;ne.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"]},Dt={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},Lt={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(110);const Ut=-1!==zt.b.indexOf("firefox"),{WHEEL_EVENTS:Nt}=Lt;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}=Lt;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}=Lt;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 Zt={pointerdown:1,pointermove:2,pointerup:4,mousedown:1,mousemove:2,mouseup:4};function Jt(t){const e=Zt[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{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=Dt[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(29);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);n0&&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(112),a=n(320),s=n(21),u=n(32);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>>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>>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>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(;i239?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.pos127;);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;e268435455||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;o55295&&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=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(285),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":function(t,e){return t>e},"<=":function(t,e){return t<=e},">=":function(t,e){return t>=e},"<<":function(t,e){return t<>":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(77),i=n(205),o=n(187);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]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(191);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(321);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;tNumber.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(33),i=n(74),o=n(54),a=n(7),s=n(53),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(236);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){var r=n(194).default,i=n(261);t.exports=function(t){var e=i(t,"string");return"symbol"===r(e)?e:String(e)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(22),i=n(45),o=n(46),a=n(105);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(104);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(61),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(52),l=n(68),h=n(29),f=n(33);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);n0)){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;et.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(1),f=n.n(h),p=n(0),d=n.n(p),A=n(297),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(167).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(1),f=n.n(h),p=n(0),d=n.n(p),A=n(21),g=n(52),m=n(198),y=n(116),v=n(117),_=n(64),b=n(182);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);n0&&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,D=this.getSubLayerClass("fill",y.a),L=this.getSubLayerClass("stroke",v.a),j=this.shouldRenderSubLayer("fill",R)&&new D({_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 L({_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(136);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<>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<>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<0;t[n+p]=255&a,p+=d,a/=256,c-=8);t[n+p-d]|=128*A}},function(t,e){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&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(33),I=n(63);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-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(323);const k={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},D={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function L(t){if(!t._animation){const e=D[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;tt>=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;rl){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;nl){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{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:L(t.accessors[n]),interpolation:r,output:L(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(186);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(247);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 Z{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 J=n(319),Q=n(69),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(130);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=0&&i2&&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;u0;)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=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=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",J)},function(t,e,n){"use strict";var r=n(3),i=n.n(r),o=n(4),a=n.n(o),s=n(8),u=n.n(s),c=n(5),l=n.n(c),h=n(6),f=n.n(h),p=n(1),d=n.n(p),A=n(0),g=n.n(A),m=n(217),y=n(234),v=n(12),_=n(164),b=n(186),x=n(60);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 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(8),u=n.n(s),c=n(5),l=n.n(c),h=n(6),f=n.n(h),p=n(1),d=n.n(p),A=n(0),g=n.n(A),m=n(217),y=n(234),v=n(12),_=n(164),b=n(186),x=n(60);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 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(8),u=n.n(s),c=n(5),l=n.n(c),h=n(6),f=n.n(h),p=n(1),d=n.n(p),A=n(0),g=n.n(A),m=n(217),y=n(235),v=n(234),_=n(12),b=n(164),x=n(186),w=n(60);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 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(8),u=n.n(s),c=n(5),l=n.n(c),h=n(6),f=n.n(h),p=n(1),d=n.n(p),A=n(0),g=n.n(A),m=n(21),y=n(217),v=n(235),_=n(234),b=n(164),x=n(60),w=n(7),E=n(107),O=n(186),S=n(251),T=n(189),C=n(130);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 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 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(107),i=n(237),o=n(238),a=n(74),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(7),i=n(54);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(7),i=n(54),o=n(82),a=n(33);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(240);function i(){return!("object"==typeof t&&"[object process]"===String(t)&&!t.browser)||Object(r.a)()}}).call(this,n(44))},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(44))},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(243),i=n(244),o=n(2),a=n(30),s=n.n(a),u=n(111);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(44))},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;n80*n){r=s=t[0],o=u=t[1];for(var v=n;vs&&(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=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;e0||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=io?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=su?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.x&&r.x>=l&&i!==r.x&&g(on.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=(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;o0&&(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&&r2&&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";(function(t){n.d(e,"a",(function(){return i}));var r=n(249);function i(){return!("object"==typeof t&&"[object process]"===String(t)&&!t.browser)||Object(r.a)()}}).call(this,n(44))},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(44))},function(t,e,n){var r=n(287),i=n(288),o=n(289),a=n(290);t.exports=function(t){return r(t)||i(t)||o(t)||a()},t.exports.__esModule=!0,t.exports.default=t.exports},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(189),i=n(7),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(197).default.jupyterTransport,o=null,a=null;try{o=n(295).default,a=n(265).default}catch(t){}var s=n(128),u=s.MODULE_VERSION,c=s.MODULE_NAME,l=n(87),h=l.createDeck,f=l.updateDeck,p=n(296).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,n){var r=n(194).default;t.exports=function(t,e){if("object"!==r(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!==r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){function n(e,r){return t.exports=n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},t.exports.__esModule=!0,t.exports.default=t.exports,n(e,r)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports},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},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){var r=n(56);t.exports=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=r(t)););return t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return y}));var r=n(88),i=n.n(r),o=n(89),a=n.n(o),s=n(140),u=n.n(s),c=n(119),l=n.n(c),h=n(120),f=n.n(h),p=n(56),d=n.n(p),A=n(141),g=n(197);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(293),i=n(16),o=n(278).default,{registerLoaders:a,load:s,parse:u,fetchFile:c}=n(65),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(71))},function(t,e){},function(t,e){t.exports=function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e=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=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=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(242),i=n(199);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(280);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=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 + * @license MIT + */ +var r=n(283),i=n(226),o=n(284);function a(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(t,e){if(a()=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;os&&(n=s-u),o=n;o>=0;o--){for(var h=!0,f=0;fi&&(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>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;i239?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(;r0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(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;hi)&&(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;ir)&&(n=r);for(var i="",o=e;on)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||et.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>>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>>8*(r?i:3-i)&255}function D(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 L(t,e,n,r,o){return o||D(t,0,n,4),i.write(t,e,n,r,23,4),n+4}function j(t,e,n,r,o){return o||D(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),e0&&(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=(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=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>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 L(this,t,e,!0,n)},u.prototype.writeFloatBE=function(t,e,n){return L(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=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=0;--i)t[i+e]=this[i+n];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&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=e.length||i>=t.length);++i)e[i+n]=t[i];return i}}).call(this,n(71))},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>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;as?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;s0)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>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.length2&&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(r=1))return r;for(;no?n=i:r=i,i=.5*(r-n)+n}return i},r.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var i=o;function o(t,e){this.x=t,this.y=e}o.prototype={clone:function(){return new o(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,n=t.y-this.y;return e*e+n*n},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[2]*this.x+t[3]*this.y;return this.x=t[0]*this.x+t[1]*this.y,this.y=e,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),n=Math.sin(t),r=n*this.x+e*this.y;return this.x=e*this.x-n*this.y,this.y=r,this},_rotateAround:function(t,e){var n=Math.cos(t),r=Math.sin(t),i=e.y+r*(this.x-e.x)+n*(this.y-e.y);return this.x=e.x+n*(this.x-e.x)-r*(this.y-e.y),this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},o.convert=function(t){return t instanceof o?t:Array.isArray(t)?new o(t[0],t[1]):t};var a="undefined"!=typeof self?self:{},s=Math.pow(2,53)-1;function u(t,e,r,i){var o=new n(t,e,r,i);return function(t){return o.solve(t)}}var c=u(.25,.1,.25,1);function l(t,e,n){return Math.min(n,Math.max(e,t))}function h(t,e,n){var r=n-e,i=((t-e)%r+r)%r+e;return i===e?n:i}function f(t){for(var e=[],n=arguments.length-1;n-- >0;)e[n]=arguments[n+1];for(var r=0,i=e;r>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function g(t){return!!t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)}function m(t,e){t.forEach((function(t){e[t]&&(e[t]=e[t].bind(e))}))}function y(t,e){return-1!==t.indexOf(e,t.length-e.length)}function v(t,e,n){var r={};for(var i in t)r[i]=e.call(n||this,t[i],i,t);return r}function _(t,e,n){var r={};for(var i in t)e.call(n||this,t[i],i,t)&&(r[i]=t[i]);return r}function b(t){return Array.isArray(t)?t.map(b):"object"==typeof t&&t?v(t,b):t}var x={};function w(t){x[t]||("undefined"!=typeof console&&console.warn(t),x[t]=!0)}function E(t,e,n){return(n.y-t.y)*(e.x-t.x)>(e.y-t.y)*(n.x-t.x)}function O(t){for(var e=0,n=0,r=t.length,i=r-1,o=void 0,a=void 0;n@\,;\:\\"\/\[\]\?\=\{\}\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 C=null;function P(t){if(null==C){var e=t.navigator?t.navigator.userAgent:null;C=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return C}function M(t){try{var e=a[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return!1}}var I,B,R,k,D=a.performance&&a.performance.now?a.performance.now.bind(a.performance):Date.now.bind(Date),L=a.requestAnimationFrame||a.mozRequestAnimationFrame||a.webkitRequestAnimationFrame||a.msRequestAnimationFrame,j=a.cancelAnimationFrame||a.mozCancelAnimationFrame||a.webkitCancelAnimationFrame||a.msCancelAnimationFrame,F={now:D,frame:function(t){var e=L(t);return{cancel:function(){return j(e)}}},getImageData:function(t,e){void 0===e&&(e=0);var n=a.document.createElement("canvas"),r=n.getContext("2d");if(!r)throw new Error("failed to create canvas 2d context");return n.width=t.width,n.height=t.height,r.drawImage(t,0,0,t.width,t.height),r.getImageData(-e,-e,t.width+2*e,t.height+2*e)},resolveURL:function(t){return I||(I=a.document.createElement("a")),I.href=t,I.href},hardwareConcurrency:a.navigator&&a.navigator.hardwareConcurrency||4,get devicePixelRatio(){return a.devicePixelRatio},get prefersReducedMotion(){return!!a.matchMedia&&(null==B&&(B=a.matchMedia("(prefers-reduced-motion: reduce)")),B.matches)}},z={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":0===this.API_URL.indexOf("https://api.mapbox.com")?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},U={supported:!1,testSupport:function(t){!N&&k&&(G?V(t):R=t)}},N=!1,G=!1;function V(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,k),t.isContextLost())return;U.supported=!0}catch(t){}t.deleteTexture(e),N=!0}a.document&&((k=a.document.createElement("img")).onload=function(){R&&V(R),R=null,G=!0},k.onerror=function(){N=!0,R=null},k.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var H="01",W=function(t,e){this._transformRequestFn=t,this._customAccessToken=e,this._createSkuToken()};function q(t){return 0===t.indexOf("mapbox:")}W.prototype._createSkuToken=function(){var t=function(){for(var t="",e=0;e<10;e++)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",H,t].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=t.token,this._skuTokenExpiresAt=t.tokenExpiresAt},W.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},W.prototype.transformRequest=function(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}},W.prototype.normalizeStyleURL=function(t,e){if(!q(t))return t;var n=Q(t);return n.path="/styles/v1"+n.path,this._makeAPIURL(n,this._customAccessToken||e)},W.prototype.normalizeGlyphsURL=function(t,e){if(!q(t))return t;var n=Q(t);return n.path="/fonts/v1"+n.path,this._makeAPIURL(n,this._customAccessToken||e)},W.prototype.normalizeSourceURL=function(t,e){if(!q(t))return t;var n=Q(t);return n.path="/v4/"+n.authority+".json",n.params.push("secure"),this._makeAPIURL(n,this._customAccessToken||e)},W.prototype.normalizeSpriteURL=function(t,e,n,r){var i=Q(t);return q(t)?(i.path="/styles/v1"+i.path+"/sprite"+e+n,this._makeAPIURL(i,this._customAccessToken||r)):(i.path+=""+e+n,K(i))},W.prototype.normalizeTileURL=function(t,e){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!q(t))return t;var n=Q(t);n.path=n.path.replace(/(\.(png|jpg)\d*)(?=$)/,(F.devicePixelRatio>=2||512===e?"@2x":"")+(U.supported?".webp":"$1")),n.path=n.path.replace(/^.+\/v4\//,"/"),n.path="/v4"+n.path;var r=this._customAccessToken||function(t){for(var e=0,n=t;e=0&&t.params.splice(i,1)}if("/"!==r.path&&(t.path=""+r.path+t.path),!z.REQUIRE_ACCESS_TOKEN)return K(t);if(!(e=e||z.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+n);if("s"===e[0])throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+n);return t.params=t.params.filter((function(t){return-1===t.indexOf("access_token")})),t.params.push("access_token="+e),K(t)};var X=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function Z(t){return X.test(t)}var J=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function Q(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 K(t){var e=t.params.length?"?"+t.params.join("&"):"";return t.protocol+"://"+t.authority+t.path+e}function Y(t){if(!t)return null;var e=t.split(".");if(!e||3!==e.length)return null;try{return JSON.parse(decodeURIComponent(a.atob(e[1]).split("").map((function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)})).join("")))}catch(t){return null}}var $=function(t){this.type=t,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};$.prototype.getStorageKey=function(t){var e,n=Y(z.ACCESS_TOKEN);return e=n&&n.u?a.btoa(encodeURIComponent(n.u).replace(/%([0-9A-F]{2})/g,(function(t,e){return String.fromCharCode(Number("0x"+e))}))):z.ACCESS_TOKEN||"",t?"mapbox.eventData."+t+":"+e:"mapbox.eventData:"+e},$.prototype.fetchEventData=function(){var t=M("localStorage"),e=this.getStorageKey(),n=this.getStorageKey("uuid");if(t)try{var r=a.localStorage.getItem(e);r&&(this.eventData=JSON.parse(r));var i=a.localStorage.getItem(n);i&&(this.anonId=i)}catch(t){w("Unable to read from LocalStorage")}},$.prototype.saveEventData=function(){var t=M("localStorage"),e=this.getStorageKey(),n=this.getStorageKey("uuid");if(t)try{a.localStorage.setItem(n,this.anonId),Object.keys(this.eventData).length>=1&&a.localStorage.setItem(e,JSON.stringify(this.eventData))}catch(t){w("Unable to write to LocalStorage")}},$.prototype.processRequests=function(t){},$.prototype.postEvent=function(t,e,n,r){var i=this;if(z.EVENTS_URL){var o=Q(z.EVENTS_URL);o.params.push("access_token="+(r||z.ACCESS_TOKEN||""));var a={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.13.3",skuId:H,userId:this.anonId},s=e?f(a,e):a,u={url:K(o),headers:{"Content-Type":"text/plain"},body:JSON.stringify([s])};this.pendingRequest=bt(u,(function(t){i.pendingRequest=null,n(t),i.saveEventData(),i.processRequests(r)}))}},$.prototype.queueRequest=function(t,e){this.queue.push(t),this.processRequests(e)};var tt,et,nt=function(t){function e(){t.call(this,"map.load"),this.success={},this.skuToken=""}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.postMapLoadEvent=function(t,e,n,r){this.skuToken=n;var i=!(!r&&!z.ACCESS_TOKEN),o=Array.isArray(t)&&t.some((function(t){return q(t)||Z(t)}));z.EVENTS_URL&&i&&o&&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(),g(this.anonId)||(this.anonId=A()),this.postEvent(i,{skuToken:this.skuToken},(function(t){t||r&&(e.success[r]=!0)}),t))}},e}($),rt=new(function(t){function e(e){t.call(this,"appUserTurnstile"),this._customAccessToken=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.postTurnstileEvent=function(t,e){z.EVENTS_URL&&z.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return q(t)||Z(t)}))&&this.queueRequest(Date.now(),e)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var n=Y(z.ACCESS_TOKEN),r=n?n.u:z.ACCESS_TOKEN,i=r!==this.eventData.tokenU;g(this.anonId)||(this.anonId=A(),i=!0);var o=this.queue.shift();if(this.eventData.lastSuccess){var a=new Date(this.eventData.lastSuccess),s=new Date(o),u=(o-this.eventData.lastSuccess)/864e5;i=i||u>=1||u<-1||a.getDate()!==s.getDate()}else i=!0;if(!i)return this.processRequests();this.postEvent(o,{"enabled.telemetry":!1},(function(t){t||(e.eventData.lastSuccess=o,e.eventData.tokenU=r)}),t)}},e}($)),it=rt.postTurnstileEvent.bind(rt),ot=new nt,at=ot.postMapLoadEvent.bind(ot),st=500,ut=50;function ct(){a.caches&&!tt&&(tt=a.caches.open("mapbox-tiles"))}function lt(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}var ht,ft=1/0;function pt(){return null==ht&&(ht=a.OffscreenCanvas&&new a.OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof a.createImageBitmap),ht}var dt={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(dt);var At,gt,mt=function(t){function e(e,n,r){401===n&&Z(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)).constructor=e,e.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},e}(Error),yt=S()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===a.location.protocol?a.parent:a).location.href},vt=function(t,e){if(!(/^file:/.test(n=t.url)||/^file:/.test(yt())&&!/^\w+:/.test(n))){if(a.fetch&&a.Request&&a.AbortController&&a.Request.prototype.hasOwnProperty("signal"))return function(t,e){var n,r=new a.AbortController,i=new a.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:yt(),signal:r.signal}),o=!1,s=!1,u=(n=i.url).indexOf("sku=")>0&&Z(n);"json"===t.type&&i.headers.set("Accept","application/json");var c=function(n,r,o){if(!s){if(n&&"SecurityError"!==n.message&&w(n),r&&o)return l(r);var c=Date.now();a.fetch(i).then((function(n){if(n.ok){var r=u?n.clone():null;return l(n,r,c)}return e(new mt(n.statusText,n.status,t.url))})).catch((function(t){20!==t.code&&e(new Error(t.message))}))}},l=function(n,r,u){("arrayBuffer"===t.type?n.arrayBuffer():"json"===t.type?n.json():n.text()).then((function(t){s||(r&&u&&function(t,e,n){if(ct(),tt){var r={status:e.status,statusText:e.statusText,headers:new a.Headers};e.headers.forEach((function(t,e){return r.headers.set(e,t)}));var i=T(e.headers.get("Cache-Control")||"");i["no-store"]||(i["max-age"]&&r.headers.set("Expires",new Date(n+1e3*i["max-age"]).toUTCString()),new Date(r.headers.get("Expires")).getTime()-n<42e4||function(t,e){if(void 0===et)try{new Response(new ReadableStream),et=!0}catch(t){et=!1}et?e(t.body):t.blob().then(e)}(e,(function(e){var n=new a.Response(e,r);ct(),tt&&tt.then((function(e){return e.put(lt(t.url),n)})).catch((function(t){return w(t.message)}))})))}}(i,r,u),o=!0,e(null,t,n.headers.get("Cache-Control"),n.headers.get("Expires")))})).catch((function(t){s||e(new Error(t.message))}))};return u?function(t,e){if(ct(),!tt)return e(null);var n=lt(t.url);tt.then((function(t){t.match(n).then((function(r){var i=function(t){if(!t)return!1;var e=new Date(t.headers.get("Expires")||0),n=T(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,c):c(null,null),{cancel:function(){s=!0,o||r.abort()}}}(t,e);if(S()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e,void 0,!0)}var n;return function(t,e){var n=new a.XMLHttpRequest;for(var r in n.open(t.method||"GET",t.url,!0),"arrayBuffer"===t.type&&(n.responseType="arraybuffer"),t.headers)n.setRequestHeader(r,t.headers[r]);return"json"===t.type&&(n.responseType="text",n.setRequestHeader("Accept","application/json")),n.withCredentials="include"===t.credentials,n.onerror=function(){e(new Error(n.statusText))},n.onload=function(){if((n.status>=200&&n.status<300||0===n.status)&&null!==n.response){var r=n.response;if("json"===t.type)try{r=JSON.parse(n.response)}catch(t){return e(t)}e(null,r,n.getResponseHeader("Cache-Control"),n.getResponseHeader("Expires"))}else e(new mt(n.statusText,n.status,t.url))},n.send(t.body),{cancel:function(){return n.abort()}}}(t,e)},_t=function(t,e){return vt(f(t,{type:"arrayBuffer"}),e)},bt=function(t,e){return vt(f(t,{method:"POST"}),e)},xt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";At=[],gt=0;var wt=function(t,e){if(U.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),gt>=z.MAX_PARALLEL_IMAGE_REQUESTS){var n={requestParameters:t,callback:e,cancelled:!1,cancel:function(){this.cancelled=!0}};return At.push(n),n}gt++;var r=!1,i=function(){if(!r)for(r=!0,gt--;At.length&>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)},Ct.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var Pt={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}},Mt=function(t,e,n,r){this.message=(t?t+": ":"")+n,r&&(this.identifier=r),null!=e&&e.__line__&&(this.line=e.__line__)};function It(t){var e=t.value;return e?[new Mt(t.key,e,"constants have been deprecated as of v8")]:[]}function Bt(t){for(var e=[],n=arguments.length-1;n-- >0;)e[n]=arguments[n+1];for(var r=0,i=e;r":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var Jt=[jt,Ft,zt,Ut,Nt,Wt,Gt,Xt(Vt),qt];function Qt(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!Qt(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(var n=0,r=Jt;n255?255:t}function i(t){return r("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function o(t){return(e="%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))<0?0:e>1?1:e;var e}function a(t,e,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?t+(e-t)*n*6:2*n<1?e:3*n<2?t+(e-t)*(2/3-n)*6:t}try{e.parseCSSColor=function(t){var e,s=t.replace(/ /g,"").toLowerCase();if(s in n)return n[s].slice();if("#"===s[0])return 4===s.length?(e=parseInt(s.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===s.length&&(e=parseInt(s.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var u=s.indexOf("("),c=s.indexOf(")");if(-1!==u&&c+1===s.length){var l=s.substr(0,u),h=s.substr(u+1,c-(u+1)).split(","),f=1;switch(l){case"rgba":if(4!==h.length)return null;f=o(h.pop());case"rgb":return 3!==h.length?null:[i(h[0]),i(h[1]),i(h[2]),f];case"hsla":if(4!==h.length)return null;f=o(h.pop());case"hsl":if(3!==h.length)return null;var p=(parseFloat(h[0])%360+360)%360/360,d=o(h[1]),A=o(h[2]),g=A<=.5?A*(d+1):A+d-A*d,m=2*A-g;return[r(255*a(m,g,p+1/3)),r(255*a(m,g,p)),r(255*a(m,g,p-1/3)),f];default:return null}}return null}}catch(t){}})).parseCSSColor,te=function(t,e,n,r){void 0===r&&(r=1),this.r=t,this.g=e,this.b=n,this.a=r};te.parse=function(t){if(t){if(t instanceof te)return t;if("string"==typeof t){var e=$t(t);if(e)return new te(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},te.prototype.toString=function(){var t=this.toArray(),e=t[1],n=t[2],r=t[3];return"rgba("+Math.round(t[0])+","+Math.round(e)+","+Math.round(n)+","+r+")"},te.prototype.toArray=function(){var t=this.a;return 0===t?[0,0,0,0]:[255*this.r/t,255*this.g/t,255*this.b/t,t]},te.black=new te(0,0,0,1),te.white=new te(1,1,1,1),te.transparent=new te(0,0,0,0),te.red=new te(1,0,0,1);var ee=function(t,e,n){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=n,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};ee.prototype.compare=function(t,e){return this.collator.compare(t,e)},ee.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var ne=function(t,e,n,r,i){this.text=t,this.image=e,this.scale=n,this.fontStack=r,this.textColor=i},re=function(t){this.sections=t};re.fromString=function(t){return new re([new ne(t,null,null,null,null)])},re.prototype.isEmpty=function(){return 0===this.sections.length||!this.sections.some((function(t){return 0!==t.text.length||t.image&&0!==t.image.name.length}))},re.factory=function(t){return t instanceof re?t:re.fromString(t)},re.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(t){return t.text})).join("")},re.prototype.serialize=function(){for(var t=["format"],e=0,n=this.sections;e=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof n&&n>=0&&n<=255?void 0===r||"number"==typeof r&&r>=0&&r<=1?null:"Invalid rgba value ["+[t,e,n,r].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof r?[t,e,n,r]:[t,e,n]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function ae(t){if(null===t)return!0;if("string"==typeof t)return!0;if("boolean"==typeof t)return!0;if("number"==typeof t)return!0;if(t instanceof te)return!0;if(t instanceof ee)return!0;if(t instanceof re)return!0;if(t instanceof ie)return!0;if(Array.isArray(t)){for(var e=0,n=t;e2){var s=t[1];if("string"!=typeof s||!(s in he)||"object"===s)return e.error('The item type argument of "array" must be one of string, number, boolean',1);o=he[s],r++}else o=Vt;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=Xt(o,a)}else n=he[i];for(var u=[];r1)&&e.push(r)}}return e.concat(this.args.map((function(t){return t.serialize()})))};var pe=function(t){this.type=Wt,this.sections=t};pe.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var n=t[1];if(!Array.isArray(n)&&"object"==typeof n)return e.error("First argument must be an image or text section.");for(var r=[],i=!1,o=1;o<=t.length-1;++o){var a=t[o];if(i&&"object"==typeof a&&!Array.isArray(a)){i=!1;var s=null;if(a["font-scale"]&&!(s=e.parse(a["font-scale"],1,Ft)))return null;var u=null;if(a["text-font"]&&!(u=e.parse(a["text-font"],1,Xt(zt))))return null;var c=null;if(a["text-color"]&&!(c=e.parse(a["text-color"],1,Nt)))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,Vt);if(!h)return null;var f=h.type.kind;if("string"!==f&&"value"!==f&&"null"!==f&&"resolvedImage"!==f)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,r.push({content:h,scale:null,font:null,textColor:null})}}return new pe(r)},pe.prototype.evaluate=function(t){return new re(this.sections.map((function(e){var n=e.content.evaluate(t);return se(n)===qt?new ne("",n,null,null,null):new ne(ue(n),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},pe.prototype.eachChild=function(t){for(var e=0,n=this.sections;e-1),n},de.prototype.eachChild=function(t){t(this.input)},de.prototype.outputDefined=function(){return!1},de.prototype.serialize=function(){return["image",this.input.serialize()]};var Ae={"to-boolean":Ut,"to-color":Nt,"to-number":Ft,"to-string":zt},ge=function(t,e){this.type=t,this.args=e};ge.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var n=t[0];if(("to-boolean"===n||"to-string"===n)&&2!==t.length)return e.error("Expected one argument.");for(var r=Ae[n],i=[],o=1;o4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":oe(e[0],e[1],e[2],e[3])))return new te(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new le(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=e[2]||t[1]<=e[1]||t[3]>=e[3])}function we(t,e){var n=(180+t[0])/360,r=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t[1]*Math.PI/360)))/360,i=Math.pow(2,e.z);return[Math.round(n*i*8192),Math.round(r*i*8192)]}function Ee(t,e,n){return e[1]>t[1]!=n[1]>t[1]&&t[0]<(n[0]-e[0])*(t[1]-e[1])/(n[1]-e[1])+e[0]}function Oe(t,e){for(var n,r,i,o,a,s,u,c=!1,l=0,h=e.length;l0&&s<0||a<0&&s>0}function Ce(t,e,n){for(var r=0,i=n;rn[2]){var i=.5*r,o=t[0]-n[0]>i?-r:n[0]-t[0]>i?r:0;0===o&&(o=t[0]-n[2]>i?-r:n[2]-t[0]>i?r:0),t[0]+=o}be(e,t)}function ke(t,e,n,r){for(var i=8192*Math.pow(2,r.z),o=[8192*r.x,8192*r.y],a=[],s=0,u=t;s=0)return!1;var n=!0;return t.eachChild((function(t){n&&!ze(t,e)&&(n=!1)})),n}Le.parse=function(t,e){if(2!==t.length)return e.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(ae(t[1])){var n=t[1];if("FeatureCollection"===n.type)for(var r=0;re))throw new le("Input is not a number.");o=a-1}return 0}Ne.prototype.parse=function(t,e,n,r,i){return void 0===i&&(i={}),e?this.concat(e,n,r)._parse(t,i):this._parse(t,i)},Ne.prototype._parse=function(t,e){function n(t,e,n){return"assert"===n?new fe(e,[t]):"coerce"===n?new ge(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var 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 ce)&&"resolvedImage"!==o.type.kind&&function t(e){if(e instanceof Ue)return t(e.boundExpression);if(e instanceof ve&&"error"===e.name)return!1;if(e instanceof _e)return!1;if(e instanceof Le)return!1;var n=e instanceof ge||e instanceof fe,r=!0;return e.eachChild((function(e){r=n?r&&t(e):r&&e instanceof ce})),!!r&&je(e)&&ze(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(o)){var u=new ye;try{o=new ce(o.type,o.evaluate(u))}catch(t){return this.error(t.message),null}}return o}return this.error('Unknown expression "'+r+'". If you wanted a literal array, use ["literal", [...]].',0)}return this.error(void 0===t?"'undefined' value invalid. Use null instead.":"object"==typeof t?'Bare objects invalid. Use ["literal", {...}] instead.':"Expected an array, but found "+typeof t+" instead.")},Ne.prototype.concat=function(t,e,n){var r="number"==typeof t?this.path.concat(t):this.path,i=n?this.scope.concat(n):this.scope;return new Ne(this.registry,r,e||null,i,this.errors)},Ne.prototype.error=function(t){for(var e=[],n=arguments.length-1;n-- >0;)e[n]=arguments[n+1];var r=""+this.key+e.map((function(t){return"["+t+"]"})).join("");this.errors.push(new Dt(r,t))},Ne.prototype.checkSubtype=function(t,e){var n=Qt(t,e);return n&&this.error(n),n};var Ve=function(t,e,n){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var r=0,i=n;r=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 Ve(i,n,r)},Ve.prototype.evaluate=function(t){var e=this.labels,n=this.outputs;if(1===e.length)return n[0].evaluate(t);var r=this.input.evaluate(t);if(r<=e[0])return n[0].evaluate(t);var i=e.length;return r>=e[i-1]?n[i-1].evaluate(t):n[Ge(e,r)].evaluate(t)},Ve.prototype.eachChild=function(t){t(this.input);for(var e=0,n=this.outputs;e0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t};var We=Object.freeze({__proto__:null,number:He,color:function(t,e,n){return new te(He(t.r,e.r,n),He(t.g,e.g,n),He(t.b,e.b,n),He(t.a,e.a,n))},array:function(t,e,n){return t.map((function(t,r){return He(t,e[r],n)}))}}),qe=6/29*3*(6/29),Xe=Math.PI/180,Ze=180/Math.PI;function Je(t){return t>.008856451679035631?Math.pow(t,1/3):t/qe+4/29}function Qe(t){return t>6/29?t*t*t:qe*(t-4/29)}function Ke(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Ye(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function $e(t){var e=Ye(t.r),n=Ye(t.g),r=Ye(t.b),i=Je((.4124564*e+.3575761*n+.1804375*r)/.95047),o=Je((.2126729*e+.7151522*n+.072175*r)/1);return{l:116*o-16,a:500*(i-o),b:200*(o-Je((.0193339*e+.119192*n+.9503041*r)/1.08883)),alpha:t.a}}function tn(t){var e=(t.l+16)/116,n=isNaN(t.a)?e:e+t.a/500,r=isNaN(t.b)?e:e-t.b/200;return e=1*Qe(e),n=.95047*Qe(n),r=1.08883*Qe(r),new te(Ke(3.2404542*n-1.5371385*e-.4985314*r),Ke(-.969266*n+1.8760108*e+.041556*r),Ke(.0556434*n-.2040259*e+1.0572252*r),t.alpha)}function en(t,e,n){var r=e-t;return t+n*(r>180||r<-180?r-360*Math.round(r/360):r)}var nn={forward:$e,reverse:tn,interpolate:function(t,e,n){return{l:He(t.l,e.l,n),a:He(t.a,e.a,n),b:He(t.b,e.b,n),alpha:He(t.alpha,e.alpha,n)}}},rn={forward:function(t){var e=$e(t),n=e.l,r=e.a,i=e.b,o=Math.atan2(i,r)*Ze;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*Xe,n=t.c;return tn({l:t.l,a:Math.cos(e)*n,b:Math.sin(e)*n,alpha:t.alpha})},interpolate:function(t,e,n){return{h:en(t.h,e.h,n),c:He(t.c,e.c,n),l:He(t.l,e.l,n),alpha:He(t.alpha,e.alpha,n)}}},on=Object.freeze({__proto__:null,lab:nn,hcl:rn}),an=function(t,e,n,r,i){this.type=t,this.operator=e,this.interpolation=n,this.input=r,this.labels=[],this.outputs=[];for(var o=0,a=i;o1})))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,Ft)))return null;var u=[],c=null;"interpolate-hcl"===n||"interpolate-lab"===n?c=Nt:e.expectedType&&"value"!==e.expectedType.kind&&(c=e.expectedType);for(var l=0;l=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 an(c,n,r,i,u):e.error("Type "+Zt(c)+" is not interpolatable.")},an.prototype.evaluate=function(t){var e=this.labels,n=this.outputs;if(1===e.length)return n[0].evaluate(t);var r=this.input.evaluate(t);if(r<=e[0])return n[0].evaluate(t);var i=e.length;if(r>=e[i-1])return n[i-1].evaluate(t);var o=Ge(e,r),a=an.interpolationFactor(this.interpolation,r,e[o],e[o+1]),s=n[o].evaluate(t),u=n[o+1].evaluate(t);return"interpolate"===this.operator?We[this.type.kind.toLowerCase()](s,u,a):"interpolate-hcl"===this.operator?rn.reverse(rn.interpolate(rn.forward(s),rn.forward(u),a)):nn.reverse(nn.interpolate(nn.forward(s),nn.forward(u),a))},an.prototype.eachChild=function(t){t(this.input);for(var e=0,n=this.outputs;e=n.length)throw new le("Array index out of bounds: "+e+" > "+(n.length-1)+".");if(e!==Math.floor(e))throw new le("Array index must be an integer, but found "+e+" instead.");return n[e]},ln.prototype.eachChild=function(t){t(this.index),t(this.input)},ln.prototype.outputDefined=function(){return!1},ln.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var hn=function(t,e){this.type=Ut,this.needle=t,this.haystack=e};hn.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var n=e.parse(t[1],1,Vt),r=e.parse(t[2],2,Vt);return n&&r?Kt(n.type,[Ut,zt,Ft,jt,Vt])?new hn(n,r):e.error("Expected first argument to be of type boolean, string, number or null, but found "+Zt(n.type)+" instead"):null},hn.prototype.evaluate=function(t){var e=this.needle.evaluate(t),n=this.haystack.evaluate(t);if(!n)return!1;if(!Yt(e,["boolean","string","number","null"]))throw new le("Expected first argument to be of type boolean, string, number or null, but found "+Zt(se(e))+" instead.");if(!Yt(n,["string","array"]))throw new le("Expected second argument to be of type array or string, but found "+Zt(se(n))+" instead.");return n.indexOf(e)>=0},hn.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},hn.prototype.outputDefined=function(){return!0},hn.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var fn=function(t,e,n){this.type=Ft,this.needle=t,this.haystack=e,this.fromIndex=n};fn.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var n=e.parse(t[1],1,Vt),r=e.parse(t[2],2,Vt);if(!n||!r)return null;if(!Kt(n.type,[Ut,zt,Ft,jt,Vt]))return e.error("Expected first argument to be of type boolean, string, number or null, but found "+Zt(n.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,Ft);return i?new fn(n,r,i):null}return new fn(n,r)},fn.prototype.evaluate=function(t){var e=this.needle.evaluate(t),n=this.haystack.evaluate(t);if(!Yt(e,["boolean","string","number","null"]))throw new le("Expected first argument to be of type boolean, string, number or null, but found "+Zt(se(e))+" instead.");if(!Yt(n,["string","array"]))throw new le("Expected second argument to be of type array or string, but found "+Zt(se(n))+" instead.");if(this.fromIndex){var r=this.fromIndex.evaluate(t);return n.indexOf(e,r)}return n.indexOf(e)},fn.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)},fn.prototype.outputDefined=function(){return!1},fn.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var pn=function(t,e,n,r,i,o){this.inputType=t,this.type=e,this.input=n,this.cases=r,this.outputs=i,this.otherwise=o};pn.parse=function(t,e){if(t.length<5)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if(t.length%2!=1)return e.error("Expected an even number of arguments.");var n,r;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);for(var i={},o=[],a=2;aNumber.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,se(f)))return null}else n=se(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,Vt);if(!d)return null;var A=e.parse(t[t.length-1],t.length-1,r);return A?"value"!==d.type.kind&&e.concat(1).checkSubtype(n,d.type)?null:new pn(n,r,d,i,o,A):null},pn.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(se(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},pn.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},pn.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},pn.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],n=[],r={},i=0,o=Object.keys(this.cases).sort();i=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var n=e.parse(t[1],1,Vt),r=e.parse(t[2],2,Ft);if(!n||!r)return null;if(!Kt(n.type,[Xt(Vt),zt,Vt]))return e.error("Expected first argument to be of type array or string, but found "+Zt(n.type)+" instead");if(4===t.length){var i=e.parse(t[3],3,Ft);return i?new An(n.type,n,r,i):null}return new An(n.type,n,r)},An.prototype.evaluate=function(t){var e=this.input.evaluate(t),n=this.beginIndex.evaluate(t);if(!Yt(e,["string","array"]))throw new le("Expected first argument to be of type array or string, but found "+Zt(se(e))+" instead.");if(this.endIndex){var r=this.endIndex.evaluate(t);return e.slice(n,r)}return e.slice(n)},An.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)},An.prototype.outputDefined=function(){return!1},An.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var vn=yn("==",(function(t,e,n){return e===n}),mn),_n=yn("!=",(function(t,e,n){return e!==n}),(function(t,e,n,r){return!mn(0,e,n,r)})),bn=yn("<",(function(t,e,n){return e",(function(t,e,n){return e>n}),(function(t,e,n,r){return r.compare(e,n)>0})),wn=yn("<=",(function(t,e,n){return e<=n}),(function(t,e,n,r){return r.compare(e,n)<=0})),En=yn(">=",(function(t,e,n){return e>=n}),(function(t,e,n,r){return r.compare(e,n)>=0})),On=function(t,e,n,r,i){this.type=zt,this.number=t,this.locale=e,this.currency=n,this.minFractionDigits=r,this.maxFractionDigits=i};On.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var n=e.parse(t[1],1,Ft);if(!n)return null;var r=t[2];if("object"!=typeof r||Array.isArray(r))return e.error("NumberFormat options argument must be an object.");var i=null;if(r.locale&&!(i=e.parse(r.locale,1,zt)))return null;var o=null;if(r.currency&&!(o=e.parse(r.currency,1,zt)))return null;var a=null;if(r["min-fraction-digits"]&&!(a=e.parse(r["min-fraction-digits"],1,Ft)))return null;var s=null;return r["max-fraction-digits"]&&!(s=e.parse(r["max-fraction-digits"],1,Ft))?null:new On(n,i,o,a,s)},On.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))},On.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)},On.prototype.outputDefined=function(){return!1},On.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 Sn=function(t){this.type=Ft,this.input=t};Sn.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 "+Zt(n.type)+" instead."):new Sn(n):null},Sn.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 le("Expected value to be of type string or array, but found "+Zt(se(e))+" instead.")},Sn.prototype.eachChild=function(t){t(this.input)},Sn.prototype.outputDefined=function(){return!1},Sn.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Tn={"==":vn,"!=":_n,">":xn,"<":bn,">=":En,"<=":wn,array:fe,at:ln,boolean:fe,case:dn,coalesce:un,collator:_e,format:pe,image:de,in:hn,"index-of":fn,interpolate:an,"interpolate-hcl":an,"interpolate-lab":an,length:Sn,let:cn,literal:ce,match:pn,number:fe,"number-format":On,object:fe,slice:An,step:Ve,string:fe,"to-boolean":ge,"to-color":ge,"to-number":ge,"to-string":ge,var:Ue,within:Le};function Cn(t,e){var n=e[0],r=e[1],i=e[2],o=e[3];n=n.evaluate(t),r=r.evaluate(t),i=i.evaluate(t);var a=o?o.evaluate(t):1,s=oe(n,r,i,a);if(s)throw new le(s);return new te(n/255*a,r/255*a,i/255*a,a)}function Pn(t,e){return t in e}function Mn(t,e){var n=e[t];return void 0===n?null:n}function In(t){return{type:t}}function Bn(t){return{result:"success",value:t}}function Rn(t){return{result:"error",value:t}}function kn(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function Dn(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function Ln(t){return!!t.expression&&t.expression.interpolated}function jn(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function Fn(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function zn(t){return t}function Un(t,e,n){return void 0!==t?t:void 0!==e?e:void 0!==n?n:void 0}function Nn(t,e,n,r,i){return Un(typeof n===i?r[n]:void 0,t.default,e.default)}function Gn(t,e,n){if("number"!==jn(n))return Un(t.default,e.default);var r=t.stops.length;if(1===r)return t.stops[0][1];if(n<=t.stops[0][0])return t.stops[0][1];if(n>=t.stops[r-1][0])return t.stops[r-1][1];var i=Ge(t.stops.map((function(t){return t[0]})),n);return t.stops[i][1]}function Vn(t,e,n){var r=void 0!==t.base?t.base:1;if("number"!==jn(n))return Un(t.default,e.default);var i=t.stops.length;if(1===i)return t.stops[0][1];if(n<=t.stops[0][0])return t.stops[0][1];if(n>=t.stops[i-1][0])return t.stops[i-1][1];var o=Ge(t.stops.map((function(t){return t[0]})),n),a=function(t,e,n,r){var i=r-n,o=t-n;return 0===i?0:1===e?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}(n,r,t.stops[o][0],t.stops[o+1][0]),s=t.stops[o][1],u=t.stops[o+1][1],c=We[e.type]||zn;if(t.colorSpace&&"rgb"!==t.colorSpace){var l=on[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 Hn(t,e,n){return"color"===e.type?n=te.parse(n):"formatted"===e.type?n=re.fromString(n.toString()):"resolvedImage"===e.type?n=ie.fromString(n.toString()):jn(n)===e.type||"enum"===e.type&&e.values[n]||(n=void 0),Un(n,t.default,e.default)}ve.register(Tn,{error:[{kind:"error"},[zt],function(t,e){throw new le(e[0].evaluate(t))}],typeof:[zt,[Vt],function(t,e){return Zt(se(e[0].evaluate(t)))}],"to-rgba":[Xt(Ft,4),[Nt],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[Nt,[Ft,Ft,Ft],Cn],rgba:[Nt,[Ft,Ft,Ft,Ft],Cn],has:{type:Ut,overloads:[[[zt],function(t,e){return Pn(e[0].evaluate(t),t.properties())}],[[zt,Gt],function(t,e){var n=e[1];return Pn(e[0].evaluate(t),n.evaluate(t))}]]},get:{type:Vt,overloads:[[[zt],function(t,e){return Mn(e[0].evaluate(t),t.properties())}],[[zt,Gt],function(t,e){var n=e[1];return Mn(e[0].evaluate(t),n.evaluate(t))}]]},"feature-state":[Vt,[zt],function(t,e){return Mn(e[0].evaluate(t),t.featureState||{})}],properties:[Gt,[],function(t){return t.properties()}],"geometry-type":[zt,[],function(t){return t.geometryType()}],id:[Vt,[],function(t){return t.id()}],zoom:[Ft,[],function(t){return t.globals.zoom}],"heatmap-density":[Ft,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[Ft,[],function(t){return t.globals.lineProgress||0}],accumulated:[Vt,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[Ft,In(Ft),function(t,e){for(var n=0,r=0,i=e;r":[Ut,[zt,Vt],function(t,e){var n=e[0],r=e[1],i=t.properties()[n.value],o=r.value;return typeof i==typeof o&&i>o}],"filter-id->":[Ut,[Vt],function(t,e){var n=e[0],r=t.id(),i=n.value;return typeof r==typeof i&&r>i}],"filter-<=":[Ut,[zt,Vt],function(t,e){var n=e[0],r=e[1],i=t.properties()[n.value],o=r.value;return typeof i==typeof o&&i<=o}],"filter-id-<=":[Ut,[Vt],function(t,e){var n=e[0],r=t.id(),i=n.value;return typeof r==typeof i&&r<=i}],"filter->=":[Ut,[zt,Vt],function(t,e){var n=e[0],r=e[1],i=t.properties()[n.value],o=r.value;return typeof i==typeof o&&i>=o}],"filter-id->=":[Ut,[Vt],function(t,e){var n=e[0],r=t.id(),i=n.value;return typeof r==typeof i&&r>=i}],"filter-has":[Ut,[Vt],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[Ut,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[Ut,[Xt(zt)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[Ut,[Xt(Vt)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[Ut,[zt,Xt(Vt)],function(t,e){var n=e[0];return e[1].value.indexOf(t.properties()[n.value])>=0}],"filter-in-large":[Ut,[zt,Xt(Vt)],function(t,e){var n=e[0],r=e[1];return function(t,e,n,r){for(;n<=r;){var i=n+r>>1;if(e[i]===t)return!0;e[i]>t?r=i-1:n=i+1}return!1}(t.properties()[n.value],r.value,0,r.value.length-1)}],all:{type:Ut,overloads:[[[Ut,Ut],function(t,e){var n=e[1];return e[0].evaluate(t)&&n.evaluate(t)}],[In(Ut),function(t,e){for(var n=0,r=e;n0&&"string"==typeof t[0]&&t[0]in Tn}function Xn(t,e){var n=new Ne(Tn,[],e?function(t){var e={color:Nt,string:zt,number:Ft,enum:zt,boolean:Ut,formatted:Wt,resolvedImage:qt};return"array"===t.type?Xt(e[t.value]||Vt,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?Bn(new Wn(r,e)):Rn(n.errors)}Wn.prototype.evaluateWithoutErrorHandling=function(t,e,n,r,i,o){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=n,this._evaluator.canonical=r,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=o,this.expression.evaluate(this._evaluator)},Wn.prototype.evaluate=function(t,e,n,r,i,o){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=n||null,this._evaluator.canonical=r,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=o||null;try{var a=this.expression.evaluate(this._evaluator);if(null==a||"number"==typeof a&&a!=a)return this._defaultValue;if(this._enumValues&&!(a in this._enumValues))throw new le("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(a)+" instead.");return a}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var Zn=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!Fe(e.expression)};Zn.prototype.evaluateWithoutErrorHandling=function(t,e,n,r,i,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,n,r,i,o)},Zn.prototype.evaluate=function(t,e,n,r,i,o){return this._styleExpression.evaluate(t,e,n,r,i,o)};var Jn=function(t,e,n,r){this.kind=t,this.zoomStops=n,this._styleExpression=e,this.isStateDependent="camera"!==t&&!Fe(e.expression),this.interpolationType=r};function Qn(t,e){if("error"===(t=Xn(t,e)).result)return t;var n=t.value.expression,r=je(n);if(!r&&!kn(e))return Rn([new Dt("","data expressions not supported")]);var i=ze(n,["zoom"]);if(!i&&!Dn(e))return Rn([new Dt("","zoom expressions not supported")]);var o=function t(e){var n=null;if(e instanceof cn)n=t(e.result);else if(e instanceof un)for(var r=0,i=e.args;rr.maximum?[new Mt(e,n,n+" is greater than the maximum value "+r.maximum)]:[]}function er(t){var e,n,r,i=t.valueSpec,o=Rt(t.value.type),a={},s="categorical"!==o&&void 0===t.value.property,u=!s,c="array"===jn(t.value.stops)&&"array"===jn(t.value.stops[0])&&"object"===jn(t.value.stops[0][0]),l=Yn({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===o)return[new Mt(t.key,t.value,'identity function may not have a "stops" property')];var e=[],n=t.value;return e=e.concat($n({key:t.key,value:n,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:h})),"array"===jn(n)&&0===n.length&&e.push(new Mt(t.key,n,"array must have at least one stop")),e},default:function(t){return wr({key:t.key,value:t.value,valueSpec:i,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===o&&s&&l.push(new Mt(t.key,t.value,'missing required property "property"')),"identity"===o||t.value.stops||l.push(new Mt(t.key,t.value,'missing required property "stops"')),"exponential"===o&&t.valueSpec.expression&&!Ln(t.valueSpec)&&l.push(new Mt(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(u&&!kn(t.valueSpec)?l.push(new Mt(t.key,t.value,"property functions not supported")):s&&!Dn(t.valueSpec)&&l.push(new Mt(t.key,t.value,"zoom functions not supported"))),"categorical"!==o&&!c||void 0!==t.value.property||l.push(new Mt(t.key,t.value,'"property" property is required')),l;function h(t){var e=[],o=t.value,s=t.key;if("array"!==jn(o))return[new Mt(s,o,"array expected, "+jn(o)+" found")];if(2!==o.length)return[new Mt(s,o,"array length 2 expected, length "+o.length+" found")];if(c){if("object"!==jn(o[0]))return[new Mt(s,o,"object expected, "+jn(o[0])+" found")];if(void 0===o[0].zoom)return[new Mt(s,o,"object stop key must have zoom")];if(void 0===o[0].value)return[new Mt(s,o,"object stop key must have value")];if(r&&r>Rt(o[0].zoom))return[new Mt(s,o[0].zoom,"stop zoom values must appear in ascending order")];Rt(o[0].zoom)!==r&&(r=Rt(o[0].zoom),n=void 0,a={}),e=e.concat(Yn({key:s+"[0]",value:o[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:tr,value:f}}))}else e=e.concat(f({key:s+"[0]",value:o[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},o));return qn(kt(o[1]))?e.concat([new Mt(s+"[1]",o[1],"expressions are not allowed in function stops.")]):e.concat(wr({key:s+"[1]",value:o[1],valueSpec:i,style:t.style,styleSpec:t.styleSpec}))}function f(t,r){var s=jn(t.value),u=Rt(t.value),c=null!==t.value?t.value:r;if(e){if(s!==e)return[new Mt(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 Mt(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 kn(i)&&void 0===o&&(l+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Mt(t.key,c,l)]}return"categorical"!==o||"number"!==s||isFinite(u)&&Math.floor(u)===u?"categorical"!==o&&"number"===s&&void 0!==n&&u=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(var e=0,n=t.slice(1);ee?1:0}function ur(t){if(!t)return!0;var e,n=t[0];return t.length<=1?"any"!==n:"=="===n?cr(t[1],t[2],"=="):"!="===n?fr(cr(t[1],t[2],"==")):"<"===n||">"===n||"<="===n||">="===n?cr(t[1],t[2],n):"any"===n?(e=t.slice(1),["any"].concat(e.map(ur))):"all"===n?["all"].concat(t.slice(1).map(ur)):"none"===n?["all"].concat(t.slice(1).map(ur).map(fr)):"in"===n?lr(t[1],t.slice(2)):"!in"===n?fr(lr(t[1],t.slice(2))):"has"===n?hr(t[1]):"!has"===n?fr(hr(t[1])):"within"!==n||t}function cr(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 lr(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((function(t){return typeof t!=typeof e[0]}))?["filter-in-large",t,["literal",e.sort(sr)]]:["filter-in-small",t,["literal",e]]}}function hr(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function fr(t){return["!",t]}function pr(t){return ir(kt(t.value))?nr(Bt({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var n=e.value,r=e.key;if("array"!==jn(n))return[new Mt(r,n,"array expected, "+jn(n)+" found")];var i,o=e.styleSpec,a=[];if(n.length<1)return[new Mt(r,n,"filter array must have at least 1 element")];switch(a=a.concat(rr({key:r+"[0]",value:n[0],valueSpec:o.filter_operator,style:e.style,styleSpec:e.styleSpec})),Rt(n[0])){case"<":case"<=":case">":case">=":n.length>=2&&"$type"===Rt(n[1])&&a.push(new Mt(r,n,'"$type" cannot be use with operator "'+n[0]+'"'));case"==":case"!=":3!==n.length&&a.push(new Mt(r,n,'filter array for operator "'+n[0]+'" must have 3 elements'));case"in":case"!in":n.length>=2&&"string"!==(i=jn(n[1]))&&a.push(new Mt(r+"[1]",n[1],"string expected, "+i+" found"));for(var s=2;s=l[p+0]&&r>=l[p+1])?(a[f]=!0,o.push(c[f])):a[f]=!1}}},kr.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}},kr.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},kr.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},kr.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=0)){var l=t[c];u[c]=jr[s].shallow.indexOf(c)>=0?l:Gr(l,e)}t instanceof Error&&(u.message=t.message)}if(u.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==s&&(u.$name=s),u}throw new Error("can't serialize object of type "+typeof t)}function Vr(t){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||Ur(t)||Nr(t)||ArrayBuffer.isView(t)||t instanceof Dr)return t;if(Array.isArray(t))return t.map(Vr);if("object"==typeof t){var e=t.$name||"Object",n=jr[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=0?s:Vr(s)}}return r}throw new Error("can't deserialize object of type "+typeof t)}var Hr=function(){this.first=!0};Hr.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=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 qr(t){for(var e=0,n=t;e=65097&&t<=65103)||Wr["CJK Compatibility Ideographs"](t)||Wr["CJK Compatibility"](t)||Wr["CJK Radicals Supplement"](t)||Wr["CJK Strokes"](t)||!(!Wr["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||Wr["CJK Unified Ideographs Extension A"](t)||Wr["CJK Unified Ideographs"](t)||Wr["Enclosed CJK Letters and Months"](t)||Wr["Hangul Compatibility Jamo"](t)||Wr["Hangul Jamo Extended-A"](t)||Wr["Hangul Jamo Extended-B"](t)||Wr["Hangul Jamo"](t)||Wr["Hangul Syllables"](t)||Wr.Hiragana(t)||Wr["Ideographic Description Characters"](t)||Wr.Kanbun(t)||Wr["Kangxi Radicals"](t)||Wr["Katakana Phonetic Extensions"](t)||Wr.Katakana(t)&&12540!==t||!(!Wr["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)||!(!Wr["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||Wr["Unified Canadian Aboriginal Syllabics"](t)||Wr["Unified Canadian Aboriginal Syllabics Extended"](t)||Wr["Vertical Forms"](t)||Wr["Yijing Hexagram Symbols"](t)||Wr["Yi Syllables"](t)||Wr["Yi Radicals"](t))))}function Zr(t){return!(Xr(t)||function(t){return!!(Wr["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||Wr["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)||Wr["Letterlike Symbols"](t)||Wr["Number Forms"](t)||Wr["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)||Wr["Control Pictures"](t)&&9251!==t||Wr["Optical Character Recognition"](t)||Wr["Enclosed Alphanumerics"](t)||Wr["Geometric Shapes"](t)||Wr["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||Wr["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||Wr["CJK Symbols and Punctuation"](t)||Wr.Katakana(t)||Wr["Private Use Area"](t)||Wr["CJK Compatibility Forms"](t)||Wr["Small Form Variants"](t)||Wr["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 Jr(t){return t>=1424&&t<=2303||Wr["Arabic Presentation Forms-A"](t)||Wr["Arabic Presentation Forms-B"](t)}function Qr(t,e){return!(!e&&Jr(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||Wr.Khmer(t))}function Kr(t){for(var e=0,n=t;e-1&&($r="error"),Yr&&Yr(t)};function ni(){ri.fire(new St("pluginStateChange",{pluginStatus:$r,pluginURL:ti}))}var ri=new Ct,ii=function(){return $r},oi=function(){if("deferred"!==$r||!ti)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");$r="loading",ni(),ti&&_t({url:ti},(function(t){t?ei(t):($r="loaded",ni())}))},ai={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return"loaded"===$r||null!=ai.applyArabicShaping},isLoading:function(){return"loading"===$r},setState:function(t){$r=t.pluginStatus,ti=t.pluginURL},isParsed:function(){return null!=ai.applyArabicShaping&&null!=ai.processBidirectionalText&&null!=ai.processStyledBidirectionalText},getPluginURL:function(){return ti}},si=function(t,e){this.zoom=t,e?(this.now=e.now,this.fadeDuration=e.fadeDuration,this.zoomHistory=e.zoomHistory,this.transition=e.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Hr,this.transition={})};si.prototype.isSupportedScript=function(t){return function(t,e){for(var n=0,r=t;nthis.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*n}:{fromScale:.5,toScale:1,t:1-(1-n)*e}};var ui=function(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(Fn(t))return new Kn(t,e);if(qn(t)){var n=Qn(t,e);if("error"===n.result)throw new Error(n.value.map((function(t){return t.key+": "+t.message})).join(", "));return n.value}var r=t;return"string"==typeof t&&"color"===e.type&&(r=te.parse(t)),{kind:"constant",evaluate:function(){return r}}}(void 0===e?t.specification.default:e,t.specification)};ui.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},ui.prototype.possiblyEvaluate=function(t,e,n){return this.property.possiblyEvaluate(this,t,e,n)};var ci=function(t){this.property=t,this.value=new ui(t,void 0)};ci.prototype.transitioned=function(t,e){return new hi(this.property,this.value,e,f({},t.transition,this.transition),t.now)},ci.prototype.untransitioned=function(){return new hi(this.property,this.value,null,{},0)};var li=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};li.prototype.getValue=function(t){return b(this._values[t].value.value)},li.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new ci(this._values[t].property)),this._values[t].value=new ui(this._values[t].property,null===e?void 0:b(e))},li.prototype.getTransition=function(t){return b(this._values[t].transition)},li.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new ci(this._values[t].property)),this._values[t].transition=b(e)||void 0},li.prototype.serialize=function(){for(var t={},e=0,n=Object.keys(this._values);ethis.end)return this.prior=null,i;if(this.value.isDataDriven())return this.prior=null,i;if(r=1)return 1;var e=t*t,n=e*t;return 4*(t<.5?n:3*(t-e)+n-.75)}(a))}return i};var fi=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};fi.prototype.possiblyEvaluate=function(t,e,n){for(var r=new Ai(this._properties),i=0,o=Object.keys(this._values);ir.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:n,to:e}},e.prototype.interpolate=function(t){return t},e}(mi),vi=function(t){this.specification=t};vi.prototype.possiblyEvaluate=function(t,e,n,r){if(void 0!==t.value){if("constant"===t.expression.kind){var i=t.expression.evaluate(e,null,{},n,r);return this._calculate(i,i,i,e)}return this._calculate(t.expression.evaluate(new si(Math.floor(e.zoom-1),e)),t.expression.evaluate(new si(Math.floor(e.zoom),e)),t.expression.evaluate(new si(Math.floor(e.zoom+1),e)),e)}},vi.prototype._calculate=function(t,e,n,r){return r.zoom>r.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:n,to:e}},vi.prototype.interpolate=function(t){return t};var _i=function(t){this.specification=t};_i.prototype.possiblyEvaluate=function(t,e,n,r){return!!t.expression.evaluate(e,null,{},n,r)},_i.prototype.interpolate=function(){return!1};var bi=function(t){for(var e in this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],t){var n=t[e];n.specification.overridable&&this.overridableProperties.push(e);var r=this.defaultPropertyValues[e]=new ui(n,void 0),i=this.defaultTransitionablePropertyValues[e]=new ci(n);this.defaultTransitioningPropertyValues[e]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=r.possiblyEvaluate({})}};Fr("DataDrivenProperty",mi),Fr("DataConstantProperty",gi),Fr("CrossFadedDataDrivenProperty",yi),Fr("CrossFadedProperty",vi),Fr("ColorRampProperty",_i);var xi=function(t){function e(e,n){if(t.call(this),this.id=e.id,this.type=e.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},"custom"!==e.type&&(this.metadata=(e=e).metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),n.layout&&(this._unevaluatedLayout=new pi(n.layout)),n.paint)){for(var r in this._transitionablePaint=new li(n.paint),e.paint)this.setPaintProperty(r,e.paint[r],{validate:!1});for(var i in e.layout)this.setLayoutProperty(i,e.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Ai(n.paint)}}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},e.prototype.getLayoutProperty=function(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)},e.prototype.setLayoutProperty=function(t,e,n){void 0===n&&(n={}),null!=e&&this._validate(Ir,"layers."+this.id+".layout."+t,t,e,n)||("visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e)},e.prototype.getPaintProperty=function(t){return y(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&&this._validate(Mr,"layers."+this.id+".paint."+t,t,e,n))return!1;if(y(t,"-transition"))return this._transitionablePaint.setTransition(t.slice(0,-"-transition".length),e||void 0),!1;var r=this._transitionablePaint._values[t],i="cross-faded-data-driven"===r.property.specification["property-type"],o=r.value.isDataDriven(),a=r.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);var s=this._transitionablePaint._values[t].value;return s.isDataDriven()||o||i||this._handleOverridablePaintPropertyUpdate(t,a,s)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){},e.prototype._handleOverridablePaintPropertyUpdate=function(t,e,n){return!1},e.prototype.isHidden=function(t){return!!(this.minzoom&&t=this.maxzoom)||"none"===this.visibility},e.prototype.updateTransitions=function(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)},e.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},e.prototype.recalculate=function(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)},e.prototype.serialize=function(){var t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),_(t,(function(t,e){return!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)}))},e.prototype._validate=function(t,e,n,r,i){return void 0===i&&(i={}),(!i||!1!==i.validate)&&Br(this,t.call(Cr,{key:e,layerType:this.type,objectKey:n,value:r,styleSpec:Pt,style:{glyphs:!0,sprite:!0}}))},e.prototype.is3D=function(){return!1},e.prototype.isTileClipped=function(){return!1},e.prototype.hasOffscreenPass=function(){return!1},e.prototype.resize=function(){},e.prototype.isStateDependent=function(){for(var t in this.paint._values){var e=this.paint.get(t);if(e instanceof di&&kn(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1},e}(Ct),wi={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Ei=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},Oi=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function Si(t,e){void 0===e&&(e=1);var n=0,r=0;return{members:t.map((function(t){var i=wi[t.type].BYTES_PER_ELEMENT,o=n=Ti(n,Math.max(e,i)),a=t.components||1;return r=Math.max(r,i),n+=i*a,{name:t.name,type:t.type,components:a,offset:o}})),size:Ti(n,Math.max(r,e)),alignment:e}}function Ti(t,e){return Math.ceil(t/e)*e}Oi.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},Oi.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},Oi.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Oi.prototype.clear=function(){this.length=0},Oi.prototype.resize=function(t){this.reserve(t),this.length=t},Oi.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)}},Oi.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var Ci=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var n=this.length;return this.resize(n+1),this.emplace(n,t,e)},e.prototype.emplace=function(t,e,n){var r=2*t;return this.int16[r+0]=e,this.int16[r+1]=n,t},e}(Oi);Ci.prototype.bytesPerElement=4,Fr("StructArrayLayout2i4",Ci);var Pi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.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}(Oi);Pi.prototype.bytesPerElement=8,Fr("StructArrayLayout4i8",Pi);var Mi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n,r,i,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,n,r,i,o)},e.prototype.emplace=function(t,e,n,r,i,o,a){var s=6*t;return this.int16[s+0]=e,this.int16[s+1]=n,this.int16[s+2]=r,this.int16[s+3]=i,this.int16[s+4]=o,this.int16[s+5]=a,t},e}(Oi);Mi.prototype.bytesPerElement=12,Fr("StructArrayLayout2i4i12",Mi);var Ii=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n,r,i,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,n,r,i,o)},e.prototype.emplace=function(t,e,n,r,i,o,a){var s=4*t,u=8*t;return this.int16[s+0]=e,this.int16[s+1]=n,this.uint8[u+4]=r,this.uint8[u+5]=i,this.uint8[u+6]=o,this.uint8[u+7]=a,t},e}(Oi);Ii.prototype.bytesPerElement=8,Fr("StructArrayLayout2i4ub8",Ii);var Bi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var n=this.length;return this.resize(n+1),this.emplace(n,t,e)},e.prototype.emplace=function(t,e,n){var r=2*t;return this.float32[r+0]=e,this.float32[r+1]=n,t},e}(Oi);Bi.prototype.bytesPerElement=8,Fr("StructArrayLayout2f8",Bi);var Ri=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n,r,i,o,a,s,u,c){var l=this.length;return this.resize(l+1),this.emplace(l,t,e,n,r,i,o,a,s,u,c)},e.prototype.emplace=function(t,e,n,r,i,o,a,s,u,c,l){var h=10*t;return this.uint16[h+0]=e,this.uint16[h+1]=n,this.uint16[h+2]=r,this.uint16[h+3]=i,this.uint16[h+4]=o,this.uint16[h+5]=a,this.uint16[h+6]=s,this.uint16[h+7]=u,this.uint16[h+8]=c,this.uint16[h+9]=l,t},e}(Oi);Ri.prototype.bytesPerElement=20,Fr("StructArrayLayout10ui20",Ri);var ki=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n,r,i,o,a,s,u,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}(Oi);ki.prototype.bytesPerElement=24,Fr("StructArrayLayout4i4ui4i24",ki);var Di=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.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}(Oi);Di.prototype.bytesPerElement=12,Fr("StructArrayLayout3f12",Di);var Li=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){return this.uint32[1*t+0]=e,t},e}(Oi);Li.prototype.bytesPerElement=4,Fr("StructArrayLayout1ul4",Li);var ji=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n,r,i,o,a,s,u){var c=this.length;return this.resize(c+1),this.emplace(c,t,e,n,r,i,o,a,s,u)},e.prototype.emplace=function(t,e,n,r,i,o,a,s,u,c){var l=10*t,h=5*t;return this.int16[l+0]=e,this.int16[l+1]=n,this.int16[l+2]=r,this.int16[l+3]=i,this.int16[l+4]=o,this.int16[l+5]=a,this.uint32[h+3]=s,this.uint16[l+8]=u,this.uint16[l+9]=c,t},e}(Oi);ji.prototype.bytesPerElement=20,Fr("StructArrayLayout6i1ul2ui20",ji);var Fi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},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}(Oi);Fi.prototype.bytesPerElement=12,Fr("StructArrayLayout2i2i2i12",Fi);var zi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n,r,i){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,n,r,i)},e.prototype.emplace=function(t,e,n,r,i,o){var a=4*t,s=8*t;return this.float32[a+0]=e,this.float32[a+1]=n,this.float32[a+2]=r,this.int16[s+6]=i,this.int16[s+7]=o,t},e}(Oi);zi.prototype.bytesPerElement=16,Fr("StructArrayLayout2f1f2i16",zi);var Ui=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n,r){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,n,r)},e.prototype.emplace=function(t,e,n,r,i){var o=12*t,a=3*t;return this.uint8[o+0]=e,this.uint8[o+1]=n,this.float32[a+1]=r,this.float32[a+2]=i,t},e}(Oi);Ui.prototype.bytesPerElement=12,Fr("StructArrayLayout2ub2f12",Ui);var Ni=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n){var r=this.length;return this.resize(r+1),this.emplace(r,t,e,n)},e.prototype.emplace=function(t,e,n,r){var i=3*t;return this.uint16[i+0]=e,this.uint16[i+1]=n,this.uint16[i+2]=r,t},e}(Oi);Ni.prototype.bytesPerElement=6,Fr("StructArrayLayout3ui6",Ni);var Gi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n,r,i,o,a,s,u,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}(Oi);Gi.prototype.bytesPerElement=48,Fr("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Gi);var Vi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.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,S,T){var C=this.length;return this.resize(C+1),this.emplace(C,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,T)},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,T,C){var P=34*t,M=17*t;return this.int16[P+0]=e,this.int16[P+1]=n,this.int16[P+2]=r,this.int16[P+3]=i,this.int16[P+4]=o,this.int16[P+5]=a,this.int16[P+6]=s,this.int16[P+7]=u,this.uint16[P+8]=c,this.uint16[P+9]=l,this.uint16[P+10]=h,this.uint16[P+11]=f,this.uint16[P+12]=p,this.uint16[P+13]=d,this.uint16[P+14]=A,this.uint16[P+15]=g,this.uint16[P+16]=m,this.uint16[P+17]=y,this.uint16[P+18]=v,this.uint16[P+19]=_,this.uint16[P+20]=b,this.uint16[P+21]=x,this.uint16[P+22]=w,this.uint32[M+12]=E,this.float32[M+13]=O,this.float32[M+14]=S,this.float32[M+15]=T,this.float32[M+16]=C,t},e}(Oi);Vi.prototype.bytesPerElement=68,Fr("StructArrayLayout8i15ui1ul4f68",Vi);var Hi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){return this.float32[1*t+0]=e,t},e}(Oi);Hi.prototype.bytesPerElement=4,Fr("StructArrayLayout1f4",Hi);var Wi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.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}(Oi);Wi.prototype.bytesPerElement=6,Fr("StructArrayLayout3i6",Wi);var qi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,n){var r=this.length;return this.resize(r+1),this.emplace(r,t,e,n)},e.prototype.emplace=function(t,e,n,r){var i=4*t;return this.uint32[2*t+0]=e,this.uint16[i+2]=n,this.uint16[i+3]=r,t},e}(Oi);qi.prototype.bytesPerElement=8,Fr("StructArrayLayout1ul2ui8",qi);var Xi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._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}(Oi);Xi.prototype.bytesPerElement=4,Fr("StructArrayLayout2ui4",Xi);var Zi=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){return this.uint16[1*t+0]=e,t},e}(Oi);Zi.prototype.bytesPerElement=2,Fr("StructArrayLayout1ui2",Zi);var Ji=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.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}(Oi);Ji.prototype.bytesPerElement=16,Fr("StructArrayLayout4f16",Ji);var Qi=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return n.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},n.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},n.x1.get=function(){return this._structArray.int16[this._pos2+2]},n.y1.get=function(){return this._structArray.int16[this._pos2+3]},n.x2.get=function(){return this._structArray.int16[this._pos2+4]},n.y2.get=function(){return this._structArray.int16[this._pos2+5]},n.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},n.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},n.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},n.anchorPoint.get=function(){return new i(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,n),e}(Ei);Qi.prototype.size=20;var Ki=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new Qi(this,t)},e}(ji);Fr("CollisionBoxArray",Ki);var Yi=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return n.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},n.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},n.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},n.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},n.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},n.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},n.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},n.segment.get=function(){return this._structArray.uint16[this._pos2+10]},n.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},n.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},n.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},n.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},n.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},n.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},n.placedOrientation.set=function(t){this._structArray.uint8[this._pos1+37]=t},n.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},n.hidden.set=function(t){this._structArray.uint8[this._pos1+38]=t},n.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},n.crossTileID.set=function(t){this._structArray.uint32[this._pos4+10]=t},n.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(e.prototype,n),e}(Ei);Yi.prototype.size=48;var $i=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new Yi(this,t)},e}(Gi);Fr("PlacedSymbolArray",$i);var to=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return n.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},n.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},n.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},n.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},n.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},n.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},n.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},n.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},n.key.get=function(){return this._structArray.uint16[this._pos2+8]},n.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},n.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},n.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},n.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},n.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},n.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},n.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},n.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},n.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},n.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},n.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},n.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},n.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},n.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},n.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},n.crossTileID.set=function(t){this._structArray.uint32[this._pos4+12]=t},n.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},n.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},n.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},n.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(e.prototype,n),e}(Ei);to.prototype.size=68;var eo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new to(this,t)},e}(Vi);Fr("SymbolInstanceArray",eo);var no=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getoffsetX=function(t){return this.float32[1*t+0]},e}(Hi);Fr("GlyphOffsetArray",no);var ro=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getx=function(t){return this.int16[3*t+0]},e.prototype.gety=function(t){return this.int16[3*t+1]},e.prototype.gettileUnitDistanceFromAnchor=function(t){return this.int16[3*t+2]},e}(Wi);Fr("SymbolLineVertexArray",ro);var io=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var n={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return n.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},n.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},n.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(e.prototype,n),e}(Ei);io.prototype.size=8;var oo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new io(this,t)},e}(qi);Fr("FeatureIndexArray",oo);var ao=Si([{name:"a_pos",components:2,type:"Int16"}],4).members,so=function(t){void 0===t&&(t=[]),this.segments=t};function uo(t,e){return 256*(t=l(Math.floor(t),0,255))+l(Math.floor(e),0,255)}so.prototype.prepareSegment=function(t,e,n,r){var i=this.segments[this.segments.length-1];return t>so.MAX_VERTEX_ARRAY_LENGTH&&w("Max vertices per segment is "+so.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!i||i.vertexLength+t>so.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==r)&&(i={vertexOffset:e.length,primitiveOffset:n.length,vertexLength:0,primitiveLength:0},void 0!==r&&(i.sortKey=r),this.segments.push(i)),i},so.prototype.get=function(){return this.segments},so.prototype.destroy=function(){for(var t=0,e=this.segments;t>>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}})),ho=e((function(t){t.exports=function(t,e){for(var n,r=t.length,i=e^r,o=0;r>=4;)n=1540483477*(65535&(n=255&t.charCodeAt(o)|(255&t.charCodeAt(++o))<<8|(255&t.charCodeAt(++o))<<16|(255&t.charCodeAt(++o))<<24))+((1540483477*(n>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(n=1540483477*(65535&(n^=n>>>24))+((1540483477*(n>>>16)&65535)<<16)),r-=4,++o;switch(r){case 3:i^=(255&t.charCodeAt(o+2))<<16;case 2:i^=(255&t.charCodeAt(o+1))<<8;case 1:i=1540483477*(65535&(i^=255&t.charCodeAt(o)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0}})),fo=lo,po=ho;fo.murmur3=lo,fo.murmur2=po;var Ao=function(){this.ids=[],this.positions=[],this.indexed=!1};Ao.prototype.add=function(t,e,n,r){this.ids.push(mo(t)),this.positions.push(e,n,r)},Ao.prototype.getPositions=function(t){for(var e=mo(t),n=0,r=this.ids.length-1;n>1;this.ids[i]>=e?r=i:n=i+1}for(var o=[];this.ids[n]===e;)o.push({index:this.positions[3*n],start:this.positions[3*n+1],end:this.positions[3*n+2]}),n++;return o},Ao.serialize=function(t,e){var n=new Float64Array(t.ids),r=new Uint32Array(t.positions);return function t(e,n,r,i){for(;r>1],a=r-1,s=i+1;;){do{a++}while(e[a]o);if(a>=s)break;yo(e,a,s),yo(n,3*a,3*s),yo(n,3*a+1,3*s+1),yo(n,3*a+2,3*s+2)}s-ra.x+1||ua.y+1)&&w("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return n}function No(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?Uo(t):[]}}function Go(t,e,n,r,i){t.emplaceBack(2*e+(r+1)/2,2*n+(i+1)/2)}var Vo=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 Ni,this.segments=new so,this.programConfigurations=new Do(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function Ho(t,e){for(var n=0;n1){if(Zo(t,e))return!0;for(var r=0;r1?n:n.sub(e)._mult(i)._add(e))}function Yo(t,e){for(var n,r,i,o=!1,a=0;ae.y!=(i=n[u]).y>e.y&&e.x<(i.x-r.x)*(e.y-r.y)/(i.y-r.y)+r.x&&(o=!o);return o}function $o(t,e){for(var n=!1,r=0,i=t.length-1;re.y!=a.y>e.y&&e.x<(a.x-o.x)*(e.y-o.y)/(a.y-o.y)+o.x&&(n=!n)}return n}function ta(t,e,n){var r=n[0],i=n[2];if(t.xi.x&&e.x>i.x||t.yi.y&&e.y>i.y)return!1;var o=E(t,e,n[0]);return o!==E(t,e,n[1])||o!==E(t,e,n[2])||o!==E(t,e,n[3])}function ea(t,e,n){var r=e.paint.get(t).value;return"constant"===r.kind?r.value:n.programConfigurations.get(e.id).getMaxValue(t)}function na(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function ra(t,e,n,r,o){if(!e[0]&&!e[1])return t;var a=i.convert(e)._mult(o);"viewport"===n&&a._rotate(-r);for(var s=[],u=0;u=8192||l<0||l>=8192)){var h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),f=h.vertexLength;Go(this.layoutVertexArray,c,l,-1,-1),Go(this.layoutVertexArray,c,l,1,-1),Go(this.layoutVertexArray,c,l,1,1),Go(this.layoutVertexArray,c,l,-1,1),this.indexArray.emplaceBack(f,f+1,f+2),this.indexArray.emplaceBack(f,f+3,f+2),h.vertexLength+=4,h.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,n,{},r)},Fr("CircleBucket",Vo,{omit:["layers"]});var ia=new bi({"circle-sort-key":new mi(Pt.layout_circle["circle-sort-key"])}),oa={paint:new bi({"circle-radius":new mi(Pt.paint_circle["circle-radius"]),"circle-color":new mi(Pt.paint_circle["circle-color"]),"circle-blur":new mi(Pt.paint_circle["circle-blur"]),"circle-opacity":new mi(Pt.paint_circle["circle-opacity"]),"circle-translate":new gi(Pt.paint_circle["circle-translate"]),"circle-translate-anchor":new gi(Pt.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new gi(Pt.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new gi(Pt.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new mi(Pt.paint_circle["circle-stroke-width"]),"circle-stroke-color":new mi(Pt.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new mi(Pt.paint_circle["circle-stroke-opacity"])}),layout:ia},aa="undefined"!=typeof Float32Array?Float32Array:Array;function sa(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function ua(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],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,t[4]=(v=n[4])*r+(_=n[5])*s+(b=n[6])*h+(x=n[7])*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,t[8]=(v=n[8])*r+(_=n[9])*s+(b=n[10])*h+(x=n[11])*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,t[12]=(v=n[12])*r+(_=n[13])*s+(b=n[14])*h+(x=n[15])*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}Math.hypot||(Math.hypot=function(){for(var t=arguments,e=0,n=arguments.length;n--;)e+=t[n]*t[n];return Math.sqrt(e)});var ca,la=ua;function ha(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,t[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,t[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,t[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,t}ca=new aa(3),aa!=Float32Array&&(ca[0]=0,ca[1]=0,ca[2]=0),function(){var t=new aa(4);aa!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0)}();var fa=(function(){var t=new aa(2);aa!=Float32Array&&(t[0]=0,t[1]=0)}(),function(t){function e(e){t.call(this,e,oa)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new Vo(t)},e.prototype.queryRadius=function(t){var e=t;return ea("circle-radius",this,e)+ea("circle-stroke-width",this,e)+na(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,n,r,i,o,a,s){for(var u=ra(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),o.angle,a),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 pa(t,e)}))}(u,s),f=l?c*a:c,p=0,d=r;pt.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;u80*n){r=o=t[0],i=a=t[1];for(var d=n;do&&(o=s),u>a&&(a=u);c=0!==(c=Math.max(o-r,a-i))?1/c:0}return Ia(f,p,n,r,i,c),p}function Pa(t,e,n,r,i){var o,a;if(i===$a(t,e,n,r)>0)for(o=e;o=e;o-=r)a=Qa(o,t[o],t[o+1],a);return a&&Ha(a,a.next)&&(Ka(a),a=a.next),a}function Ma(t,e){if(!t)return t;e||(e=t);var n,r=t;do{if(n=!1,r.steiner||!Ha(r,r.next)&&0!==Va(r.prev,r,r.next))r=r.next;else{if(Ka(r),(r=e=r.prev)===r.next)break;n=!0}}while(n||r!==e);return e}function Ia(t,e,n,r,i,o,a){if(t){!a&&o&&function(t,e,n,r){var i=t;do{null===i.z&&(i.z=za(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,n,r,i,o,a,s,u,c=1;do{for(n=t,t=null,o=null,a=0;n;){for(a++,r=n,s=0,e=0;e0||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?Ra(t,r,i,o):Ba(t))e.push(s.i/n),e.push(t.i/n),e.push(u.i/n),Ka(t),t=u.next,c=u.next;else if((t=u)===c){a?1===a?Ia(t=ka(Ma(t),e,n),e,n,r,i,o,2):2===a&&Da(t,e,n,r,i,o):Ia(Ma(t),e,n,r,i,o,1);break}}}function Ba(t){var e=t.prev,n=t,r=t.next;if(Va(e,n,r)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(Na(e.x,e.y,n.x,n.y,r.x,r.y,i.x,i.y)&&Va(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function Ra(t,e,n,r){var i=t.prev,o=t,a=t.next;if(Va(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=za(i.x=c&&f&&f.z<=l;){if(h!==t.prev&&h!==t.next&&Na(i.x,i.y,o.x,o.y,a.x,a.y,h.x,h.y)&&Va(h.prev,h,h.next)>=0)return!1;if(h=h.prevZ,f!==t.prev&&f!==t.next&&Na(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&Va(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;h&&h.z>=c;){if(h!==t.prev&&h!==t.next&&Na(i.x,i.y,o.x,o.y,a.x,a.y,h.x,h.y)&&Va(h.prev,h,h.next)>=0)return!1;h=h.prevZ}for(;f&&f.z<=l;){if(f!==t.prev&&f!==t.next&&Na(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&Va(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function ka(t,e,n){var r=t;do{var i=r.prev,o=r.next.next;!Ha(i,o)&&Wa(i,r,r.next,o)&&Za(i,o)&&Za(o,i)&&(e.push(i.i/n),e.push(r.i/n),e.push(o.i/n),Ka(r),Ka(r.next),r=t=o),r=r.next}while(r!==t);return Ma(r)}function Da(t,e,n,r,i,o){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&Ga(a,s)){var u=Ja(a,s);return a=Ma(a,a.next),u=Ma(u,u.next),Ia(a,e,n,r,i,o),void Ia(u,e,n,r,i,o)}s=s.next}a=a.next}while(a!==t)}function La(t,e){return t.x-e.x}function ja(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.x&&r.x>=l&&i!==r.x&&Na(on.x||r.x===n.x&&Fa(n,r)))&&(n=r,f=u)),r=r.next}while(r!==c);return n}(t,e)){var n=Ja(e,t);Ma(e,e.next),Ma(n,n.next)}}function Fa(t,e){return Va(t.prev,t,e.prev)<0&&Va(e.next,t,t.next)<0}function za(t,e,n,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Ua(t){var e=t,n=t;do{(e.x=0&&(t-a)*(r-s)-(n-a)*(e-s)>=0&&(n-a)*(o-s)-(i-a)*(r-s)>=0}function Ga(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&Wa(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(Za(t,e)&&Za(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)&&(Va(t.prev,t,e.prev)||Va(t,e.prev,e))||Ha(t,e)&&Va(t.prev,t,t.next)>0&&Va(e.prev,e,e.next)>0)}function Va(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function Ha(t,e){return t.x===e.x&&t.y===e.y}function Wa(t,e,n,r){var i=Xa(Va(t,e,n)),o=Xa(Va(t,e,r)),a=Xa(Va(n,r,t)),s=Xa(Va(n,r,e));return i!==o&&a!==s||!(0!==i||!qa(t,n,e))||!(0!==o||!qa(t,r,e))||!(0!==a||!qa(n,t,r))||!(0!==s||!qa(n,e,r))}function qa(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 Xa(t){return t>0?1:t<0?-1:0}function Za(t,e){return Va(t.prev,t,t.next)<0?Va(t,e,t.next)>=0&&Va(t,t.prev,e)>=0:Va(t,e,t.prev)<0||Va(t,t.next,e)<0}function Ja(t,e){var n=new Ya(t.i,t.x,t.y),r=new Ya(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function Qa(t,e,n,r){var i=new Ya(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Ka(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Ya(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function $a(t,e,n,r){for(var i=0,o=e,a=n-r;or;){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(es(e,r,n),o(e[i],h)>0&&es(e,r,i);f0;)p--}0===o(e[r],h)?es(e,r,p):es(e,++p,i),p<=n&&(r=p+1),n<=p&&(i=p-1)}}(t,e,n||0,r||t.length-1,i||ns)}function es(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function ns(t,e){return te?1:0}function rs(t,e){var n=t.length;if(n<=1)return[t];for(var r,i,o=[],a=0;a1)for(var u=0;u0&&n.holes.push(r+=t[i-1].length)}return n},Sa.default=Ta;var ss=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Ci,this.indexArray=new Ni,this.indexArray2=new Xi,this.programConfigurations=new Do(t.layers,t.zoom),this.segments=new so,this.segments2=new so,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};ss.prototype.populate=function(t,e,n){this.hasPattern=os("fill",this.layers,e);for(var r=this.layers[0].layout.get("fill-sort-key"),i=[],o=0,a=t;o>3}if(o--,1===r||2===r)a+=t.readSVarint(),s+=t.readSVarint(),1===r&&(e&&u.push(e),e=[]),e.push(new i(a,s));else{if(7!==r)throw new Error("unknown command "+r);e&&e.push(e[0].clone())}}return e&&u.push(e),u},ps.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,n=1,r=0,i=0,o=0,a=1/0,s=-1/0,u=1/0,c=-1/0;t.pos>3}if(r--,1===n||2===n)(i+=t.readSVarint())s&&(s=i),(o+=t.readSVarint())c&&(c=o);else if(7!==n)throw new Error("unknown command "+n)}return[a,u,s,c]},ps.prototype.toGeoJSON=function(t,e,n){var r,i,o=this.extent*Math.pow(2,n),a=this.extent*t,s=this.extent*e,u=this.loadGeometry(),c=ps.types[this.type];function l(t){for(var e=0;e>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 vs(t,e,n){if(3===t){var r=new gs(n,n.readVarint()+n.pos);r.length&&(e[r.name]=r)}}ms.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new fs(this._pbf,e,this.extent,this._keys,this._values)};var _s={VectorTile:function(t,e){this.layers=t.readFields(vs,{},e)},VectorTileFeature:fs,VectorTileLayer:gs},bs=_s.VectorTileFeature.types,xs=Math.pow(2,13);function ws(t,e,n,r,i,o,a,s){t.emplaceBack(e,n,2*Math.floor(r*xs)+a,i*xs*2,o*xs*2,Math.round(s))}var Es=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new Mi,this.indexArray=new Ni,this.programConfigurations=new Do(t.layers,t.zoom),this.segments=new so,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function Os(t,e){return t.x===e.x&&(t.x<0||t.x>8192)||t.y===e.y&&(t.y<0||t.y>8192)}Es.prototype.populate=function(t,e,n){this.features=[],this.hasPattern=os("fill-extrusion",this.layers,e);for(var r=0,i=t;r8192}))||B.every((function(t){return t.y<0}))||B.every((function(t){return t.y>8192}))))for(var A=0,g=0;g=1){var y=d[g-1];if(!Os(m,y)){h.vertexLength+4>so.MAX_VERTEX_ARRAY_LENGTH&&(h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var v=m.sub(y)._perp()._unit(),_=y.dist(m);A+_>32768&&(A=0),ws(this.layoutVertexArray,m.x,m.y,v.x,v.y,0,0,A),ws(this.layoutVertexArray,m.x,m.y,v.x,v.y,0,1,A),ws(this.layoutVertexArray,y.x,y.y,v.x,v.y,0,0,A+=_),ws(this.layoutVertexArray,y.x,y.y,v.x,v.y,0,1,A);var b=h.vertexLength;this.indexArray.emplaceBack(b,b+2,b+1),this.indexArray.emplaceBack(b+1,b+2,b+3),h.vertexLength+=4,h.primitiveLength+=2}}}}if(h.vertexLength+u>so.MAX_VERTEX_ARRAY_LENGTH&&(h=this.segments.prepareSegment(u,this.layoutVertexArray,this.indexArray)),"Polygon"===bs[t.type]){for(var x=[],w=[],E=h.vertexLength,O=0,S=s;O=2&&t[u-1].equals(t[u-2]);)u--;for(var c=0;c0;if(w&&m>c){var O=l.dist(p);if(O>2*h){var S=l.sub(l.sub(p)._mult(h/O)._round());this.updateDistance(p,S),this.addCurrentVertex(S,A,0,0,f),p=S}}var T=p&&d,C=T?n:s?"butt":r;if(T&&"round"===C&&(bi&&(C="bevel"),"bevel"===C&&(b>2&&(C="flipbevel"),b100)y=g.mult(-1);else{var P=b*A.add(g).mag()/A.sub(g).mag();y._perp()._mult(P*(E?-1:1))}this.addCurrentVertex(l,y,0,0,f),this.addCurrentVertex(l,y.mult(-1),0,0,f)}else if("bevel"===C||"fakeround"===C){var M=-Math.sqrt(b*b-1),I=E?M:0,B=E?0:M;if(p&&this.addCurrentVertex(l,A,I,B,f),"fakeround"===C)for(var R=Math.round(180*x/Math.PI/20),k=1;k2*h){var U=l.add(d.sub(l)._mult(h/z)._round());this.updateDistance(l,U),this.addCurrentVertex(U,g,0,0,f),l=U}}}}},Ds.prototype.addCurrentVertex=function(t,e,n,r,i,o){void 0===o&&(o=!1);var a=e.y*r-e.x,s=-e.y-e.x*r;this.addHalfVertex(t,e.x+e.y*n,e.y-e.x*n,o,!1,n,i),this.addHalfVertex(t,a,s,o,!0,-r,i),this.distance>ks/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,n,r,i,o))},Ds.prototype.addHalfVertex=function(t,e,n,r,i,o,a){var s=.5*(this.lineClips?this.scaledDistance*(ks-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((t.x<<1)+(r?1:0),(t.y<<1)+(i?1:0),Math.round(63*e)+128,Math.round(63*n)+128,1+(0===o?0:o<0?-1:1)|(63&s)<<2,s>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);var u=a.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,u),a.primitiveLength++),i?this.e2=u:this.e1=u},Ds.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},Ds.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.updateScaledDistance()},Fr("LineBucket",Ds,{omit:["layers","patternFeatures"]});var Ls=new bi({"line-cap":new gi(Pt.layout_line["line-cap"]),"line-join":new mi(Pt.layout_line["line-join"]),"line-miter-limit":new gi(Pt.layout_line["line-miter-limit"]),"line-round-limit":new gi(Pt.layout_line["line-round-limit"]),"line-sort-key":new mi(Pt.layout_line["line-sort-key"])}),js={paint:new bi({"line-opacity":new mi(Pt.paint_line["line-opacity"]),"line-color":new mi(Pt.paint_line["line-color"]),"line-translate":new gi(Pt.paint_line["line-translate"]),"line-translate-anchor":new gi(Pt.paint_line["line-translate-anchor"]),"line-width":new mi(Pt.paint_line["line-width"]),"line-gap-width":new mi(Pt.paint_line["line-gap-width"]),"line-offset":new mi(Pt.paint_line["line-offset"]),"line-blur":new mi(Pt.paint_line["line-blur"]),"line-dasharray":new vi(Pt.paint_line["line-dasharray"]),"line-pattern":new yi(Pt.paint_line["line-pattern"]),"line-gradient":new _i(Pt.paint_line["line-gradient"])}),layout:Ls},Fs=new(function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.possiblyEvaluate=function(e,n){return n=new si(Math.floor(n.zoom),{now:n.now,fadeDuration:n.fadeDuration,zoomHistory:n.zoomHistory,transition:n.transition}),t.prototype.possiblyEvaluate.call(this,e,n)},e.prototype.evaluate=function(e,n,r,i){return n=f({},n,{zoom:Math.floor(n.zoom)}),t.prototype.evaluate.call(this,e,n,r,i)},e}(mi))(js.paint.properties["line-width"].specification);Fs.useIntegerZoom=!0;var zs=function(t){function e(e){t.call(this,e,js),this.gradientVersion=0}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._handleSpecialPaintPropertyUpdate=function(t){"line-gradient"===t&&(this.stepInterpolant=this._transitionablePaint._values["line-gradient"].value.expression._styleExpression.expression instanceof Ve,this.gradientVersion=(this.gradientVersion+1)%s)},e.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},e.prototype.recalculate=function(e,n){t.prototype.recalculate.call(this,e,n),this.paint._values["line-floorwidth"]=Fs.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)},e.prototype.createBucket=function(t){return new Ds(t)},e.prototype.queryRadius=function(t){var e=t,n=Us(ea("line-width",this,e),ea("line-gap-width",this,e)),r=ea("line-offset",this,e);return n/2+Math.abs(r)+na(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,n,r,o,a,s){var u=ra(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),a.angle,s),c=s/2*Us(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=3)for(var o=0;o0?e+2*t:t}var Ns=Si([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Gs=Si([{name:"a_projected_pos",components:3,type:"Float32"}],4),Vs=(Si([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Si([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),Hs=(Si([{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"}]),Si([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),Ws=Si([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function qs(t,e,n){return t.sections.forEach((function(t){t.text=function(t,e,n){var r=e.layout.get("text-transform").evaluate(n,{});return"uppercase"===r?t=t.toLocaleUpperCase():"lowercase"===r&&(t=t.toLocaleLowerCase()),ai.applyArabicShaping&&(t=ai.applyArabicShaping(t)),t}(t.text,e,n)})),t}Si([{name:"triangle",components:3,type:"Uint16"}]),Si([{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"}]),Si([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),Si([{type:"Float32",name:"offsetX"}]),Si([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var Xs={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},Zs=function(t,e,n,r,i){var o,a,s=8*i-r-1,u=(1<>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)},Js=function(t,e,n,r,i,o){var a,s,u,c=8*o-i-1,l=(1<>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<0;t[n+p]=255&a,p+=d,a/=256,c-=8);t[n+p-d]|=128*A},Qs=Ks;function Ks(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Ks.Varint=0,Ks.Fixed64=1,Ks.Bytes=2,Ks.Fixed32=5;var Ys="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function $s(t){return t.type===Ks.Bytes?t.readVarint()+t.pos:t.pos+1}function tu(t,e,n){return n?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function eu(t,e,n){var r=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));n.realloc(r);for(var i=n.pos-1;i>=t;i--)n.buf[i+r]=n.buf[i]}function nu(t,e){for(var n=0;n>>8,t[n+2]=e>>>16,t[n+3]=e>>>24}function pu(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function du(t,e,n){1===t&&n.readMessage(Au,e)}function Au(t,e,n){if(3===t){var r=n.readMessage(gu,{}),i=r.width,o=r.height,a=r.left,s=r.top,u=r.advance;e.push({id:r.id,bitmap:new ya({width:i+6,height:o+6},r.bitmap),metrics:{width:i,height:o,left:a,top:s,advance:u}})}}function gu(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 mu(t){for(var e=0,n=0,r=0,i=t;r=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>3,o=this.pos;this.type=7&r,t(i,e,this),this.pos===o&&this.skip(r)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=hu(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=pu(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=hu(this.buf,this.pos)+4294967296*hu(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=hu(this.buf,this.pos)+4294967296*pu(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=Zs(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Zs(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,n,r=this.buf;return e=127&(n=r[this.pos++]),n<128?e:(e|=(127&(n=r[this.pos++]))<<7,n<128?e:(e|=(127&(n=r[this.pos++]))<<14,n<128?e:(e|=(127&(n=r[this.pos++]))<<21,n<128?e:function(t,e,n){var r,i,o=n.buf;if(r=(112&(i=o[n.pos++]))>>4,i<128)return tu(t,r,e);if(r|=(127&(i=o[n.pos++]))<<3,i<128)return tu(t,r,e);if(r|=(127&(i=o[n.pos++]))<<10,i<128)return tu(t,r,e);if(r|=(127&(i=o[n.pos++]))<<17,i<128)return tu(t,r,e);if(r|=(127&(i=o[n.pos++]))<<24,i<128)return tu(t,r,e);if(r|=(1&(i=o[n.pos++]))<<31,i<128)return tu(t,r,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(n=r[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&Ys?function(t,e,n){return Ys.decode(t.subarray(e,n))}(this.buf,e,t):function(t,e,n){for(var r="",i=e;i239?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?(a=t[i+2],128==(192&(o=t[i+1]))&&128==(192&a)&&((c=(15&u)<<12|(63&o)<<6|63&a)<=2047||c>=55296&&c<=57343)&&(c=null)):4===l&&(a=t[i+2],s=t[i+3],128==(192&(o=t[i+1]))&&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!==Ks.Bytes)return t.push(this.readVarint(e));var n=$s(this);for(t=t||[];this.pos127;);else if(e===Ks.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Ks.Fixed32)this.pos+=4;else{if(e!==Ks.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;e268435455||t<0?function(t,e){var n,r;if(t>=0?(n=t%4294967296|0,r=t/4294967296|0):(r=~(-t/4294967296),4294967295^(n=~(-t%4294967296))?n=n+1|0:(n=0,r=r+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,n){n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,n.buf[n.pos]=127&(t>>>=7)}(n,0,e),function(t,e){var n=(7&t)<<4;e.buf[e.pos++]|=n|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(r,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,n){for(var r,i,o=0;o55295&&r<57344){if(!i){r>56319||o+1===e.length?(t[n++]=239,t[n++]=191,t[n++]=189):i=r;continue}if(r<56320){t[n++]=239,t[n++]=191,t[n++]=189,i=r;continue}r=i-55296<<10|r-56320|65536,i=null}else i&&(t[n++]=239,t[n++]=191,t[n++]=189,i=null);r<128?t[n++]=r:(r<2048?t[n++]=r>>6|192:(r<65536?t[n++]=r>>12|224:(t[n++]=r>>18|240,t[n++]=r>>12&63|128),t[n++]=r>>6&63|128),t[n++]=63&r|128)}return n}(this.buf,t,this.pos);var n=this.pos-e;n>=128&&eu(e,n,this),this.pos=e-1,this.writeVarint(n),this.pos+=n},writeFloat:function(t){this.realloc(4),Js(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Js(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=128&&eu(n,r,this),this.pos=n-1,this.writeVarint(r),this.pos+=r},writeMessage:function(t,e,n){this.writeTag(t,Ks.Bytes),this.writeRawMessage(e,n)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,nu,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,ru,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,au,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,iu,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,ou,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,su,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,uu,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,cu,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,lu,e)},writeBytesField:function(t,e){this.writeTag(t,Ks.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Ks.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Ks.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Ks.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Ks.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Ks.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Ks.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Ks.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Ks.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Ks.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var yu=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},vu={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};vu.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},vu.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},vu.tlbr.get=function(){return this.tl.concat(this.br)},vu.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(yu.prototype,vu);var _u=function(t,e){var n={},r={};this.haveRenderCallbacks=[];var i=[];this.addImages(t,n,i),this.addImages(e,r,i);var o=mu(i),a=new va({width:o.w||1,height:o.h||1});for(var s in t){var u=t[s],c=n[s].paddedRect;va.copy(u.data,a,{x:0,y:0},{x:c.x+1,y:c.y+1},u.data)}for(var l in e){var h=e[l],f=r[l].paddedRect,p=f.x+1,d=f.y+1,A=h.data.width,g=h.data.height;va.copy(h.data,a,{x:0,y:0},{x:p,y:d},h.data),va.copy(h.data,a,{x:0,y:g-1},{x:p,y:d-1},{width:A,height:1}),va.copy(h.data,a,{x:0,y:0},{x:p,y:d+g},{width:A,height:1}),va.copy(h.data,a,{x:A-1,y:0},{x:p-1,y:d},{width:1,height:g}),va.copy(h.data,a,{x:0,y:0},{x:p+A,y:d},{width:1,height:g})}this.image=a,this.iconPositions=n,this.patternPositions=r};_u.prototype.addImages=function(t,e,n){for(var r in t){var i=t[r],o={x:0,y:0,w:i.data.width+2,h:i.data.height+2};n.push(o),e[r]=new yu(o,i),i.hasRenderCallback&&this.haveRenderCallbacks.push(r)}},_u.prototype.patchUpdatedImages=function(t,e){for(var n in t.dispatchRenderCallbacks(this.haveRenderCallbacks),t.updatedImages)this.patchUpdatedImage(this.iconPositions[n],t.getImage(n),e),this.patchUpdatedImage(this.patternPositions[n],t.getImage(n),e)},_u.prototype.patchUpdatedImage=function(t,e,n){if(t&&e&&t.version!==e.version){t.version=e.version;var r=t.tl;n.update(e.data,void 0,{x:r[0],y:r[1]})}},Fr("ImagePosition",yu),Fr("ImageAtlas",_u);var bu={horizontal:1,vertical:2,horizontalOnly:3},xu=function(){this.scale=1,this.fontStack="",this.imageName=null};xu.forText=function(t,e){var n=new xu;return n.scale=t||1,n.fontStack=e,n},xu.forImage=function(t){var e=new xu;return e.imageName=t,e};var wu=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};function Eu(t,e,n,r,i,o,a,s,u,c,l,h,f,p,d,A){var g,m=wu.fromFeature(t,i);h===bu.vertical&&m.verticalizePunctuation();var y=ai.processBidirectionalText,v=ai.processStyledBidirectionalText;if(y&&1===m.sections.length){g=[];for(var _=0,b=y(m.toString(),Iu(m,c,o,e,r,p,d));_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)}D?(t.verticalizable=!0,E.push({glyph:P,imageName:R,x:f,y:p+M,vertical:D,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:D,scale:T.scale,fontStack:T.fontStack,sectionIndex:C,metrics:I,rect:B}),f+=I.advance*T.scale+c)}0!==E.length&&(d=Math.max(f-c,d),Ru(E,0,E.length-1,g,O)),f=0;var V=o*b+O;w.lineOffset=Math.max(O,x),p+=V,A=Math.max(V,A),++m}else p+=o,++m}var H,W=p- -17,q=Bu(a),X=q.horizontalAlign,Z=q.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=0&&r>=t&&Ou[this.text.charCodeAt(r)];r--)n--;this.text=this.text.substring(t,n),this.sectionIndex=this.sectionIndex.slice(t,n)},wu.prototype.substring=function(t,e){var n=new wu;return n.text=this.text.substring(t,e),n.sectionIndex=this.sectionIndex.slice(t,e),n.sections=this.sections,n},wu.prototype.toString=function(){return this.text},wu.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce((function(e,n){return Math.max(e,t.sections[n].scale)}),0)},wu.prototype.addTextSection=function(t,e){this.text+=t.text,this.sections.push(xu.forText(t.scale,t.fontStack||e));for(var n=this.sections.length-1,r=0;r=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var Ou={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Su={};function Tu(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 Cu(t,e,n,r){var i=Math.pow(t-e,2);return r?t=0,h=0,f=0;f-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;sr;)c-=u.shift().angleDelta;if(c>i)return!1;a++,s+=l.dist(h)}return!0}function Nu(t){for(var e=0,n=0;nc){var d=(c-u)/p,A=He(h.x,f.x,d),g=He(h.y,f.y,d),m=new Du(A,g,f.angleTo(h),l);return m._round(),!a||Uu(t,m,s,a,e)?m:void 0}u+=p}}function Wu(t,e,n,r,i,o,a,s,u){var c=Gu(r,o,a),l=Vu(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=0&&b=0&&x=0&&p+l<=h){var w=new Du(b,x,v,A);w._round(),i&&!Uu(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 qu(t,e,n,r,o){for(var a=[],s=0;s=r&&f.x>=r||(h.x>=r?h=new i(r,h.y+(r-h.x)/(f.x-h.x)*(f.y-h.y))._round():f.x>=r&&(f=new i(r,h.y+(r-h.x)/(f.x-h.x)*(f.y-h.y))._round()),h.y>=o&&f.y>=o||(h.y>=o?h=new i(h.x+(o-h.y)/(f.y-h.y)*(f.x-h.x),o)._round():f.y>=o&&(f=new i(h.x+(o-h.y)/(f.y-h.y)*(f.x-h.x),o)._round()),c&&h.equals(c[c.length-1])||a.push(c=[h]),c.push(f)))))}return a}function Xu(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=Zu(f,0,T[0]),b=Zu(p,0,T[1]),_=Zu(f,T[0],T[2]),x=Zu(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=Qu(r.stretch-v,_,l,t.left),p=Ku(r.fixed-w,E,r.stretch,A),d=Qu(o.stretch-b,x,h,t.top),m=Ku(o.fixed-O,S,o.stretch,g),y=Qu(u.stretch-v,_,l,t.left),T=Ku(u.fixed-w,E,u.stretch,A),C=Qu(c.stretch-b,x,h,t.top),P=Ku(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),D=new i(T/s,P/s),L=e*Math.PI/180;if(L){var j=Math.sin(L),F=Math.cos(L),z=[F,-j,j,F];M._matMult(z),I._matMult(z),R._matMult(z),B._matMult(z)}var U=r.stretch+r.fixed,N=o.stretch+o.fixed;return{tl:M,tr:I,bl:R,br:B,tex:{x:a.paddedRect.x+1+U,y:a.paddedRect.y+1+N,w:u.stretch+u.fixed-U,h:c.stretch+c.fixed-N},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:k,pixelOffsetBR:D,minFontScaleX:E/s/l,minFontScaleY:S/s/h,isSDF:n}};if(r&&(a.stretchX||a.stretchY))for(var P=Ju(f,m,A),M=Ju(p,y,g),I=0;I0&&(d=Math.max(10,d),this.circleDiameter=d)}else{var A=a.top*s-u,g=a.bottom*s+u,m=a.left*s-u,y=a.right*s+u,v=a.collisionPadding;if(v&&(m-=v[0]*s,A-=v[1]*s,y+=v[2]*s,g+=v[3]*s),l){var _=new i(m,A),b=new i(y,A),x=new i(m,g),w=new i(y,g),E=l*Math.PI/180;_._rotate(E),b._rotate(E),x._rotate(E),w._rotate(E),m=Math.min(_.x,b.x,x.x,w.x),y=Math.max(_.x,b.x,x.x,w.x),A=Math.min(_.y,b.y,x.y,w.y),g=Math.max(_.y,b.y,x.y,w.y)}t.emplaceBack(e.x,e.y,m,A,y,g,n,r,o)}this.boxEndIndex=t.length},$u=function(t,e){if(void 0===t&&(t=[]),void 0===e&&(e=tc),this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(var n=(this.length>>1)-1;n>=0;n--)this._down(n)};function tc(t,e){return te?1:0}function ec(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;ca)&&(a=l.x),(!c||l.y>s)&&(s=l.y)}var h=Math.min(a-r,s-o),f=h/2,p=new $u([],nc);if(0===h)return new i(r,o);for(var d=r;dg.d||!g.d)&&(g=y,n&&console.log("found best %d after %d probes",Math.round(1e4*y.d)/1e4,m)),y.max-g.d<=e||(p.push(new rc(y.p.x-(f=y.h/2),y.p.y-f,f,t)),p.push(new rc(y.p.x+f,y.p.y-f,f,t)),p.push(new rc(y.p.x-f,y.p.y+f,f,t)),p.push(new rc(y.p.x+f,y.p.y+f,f,t)),m+=4)}return n&&(console.log("num probes: "+m),console.log("best distance: "+g.d)),g.p}function nc(t,e){return e.max-t.max}function rc(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;it.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,Ko(t,c,l))}return(n?1:-1)*Math.sqrt(r)}(this.p,r),this.max=this.d+this.h*Math.SQRT2}$u.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1)},$u.prototype.pop=function(){if(0!==this.length){var t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}},$u.prototype.peek=function(){return this.data[0]},$u.prototype._up=function(t){for(var e=this.data,n=this.compare,r=e[t];t>0;){var i=t-1>>1,o=e[i];if(n(r,o)>=0)break;e[t]=o,t=i}e[t]=r},$u.prototype._down=function(t){for(var e=this.data,n=this.compare,r=this.length>>1,i=e[t];t=0)break;e[t]=a,t=o}e[t]=i};var ic=Number.POSITIVE_INFINITY;function oc(t,e){return e[1]!==ic?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 ac(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function sc(t,e,n,r,o,a,s,u,c,l,h,f,p,d,A){var g=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;h32640&&w(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):"composite"===m.kind&&((y=[128*d.compositeTextSizes[0].evaluate(s,{},A),128*d.compositeTextSizes[1].evaluate(s,{},A)])[0]>32640||y[1]>32640)&&w(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),t.addSymbols(t.text,g,y,u,a,s,l,e,c.lineStartIndex,c.lineLength,p,A);for(var v=0,_=h;v<_.length;v+=1)f[_[v]]=t.text.placedSymbolArray.length-1;return 4*g.length}function uc(t){for(var e in t)return t[e];return null}function cc(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])0)&&("constant"!==o.value.kind||o.value.value.length>0),c="constant"!==s.value.kind||!!s.value.value||Object.keys(s.parameters).length>0,l=i.get("symbol-sort-key");if(this.features=[],u||c){for(var h=e.iconDependencies,f=e.glyphDependencies,p=e.availableImages,d=new si(this.zoom),A=0,g=t;A=0;for(var B=0,R=E.sections;B=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;u0},mc.prototype.hasIconData=function(){return this.icon.segments.get().length>0},mc.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},mc.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},mc.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},mc.prototype.addIndicesForPlacedSymbol=function(t,e){for(var n=t.placedSymbolArray.get(e),r=n.vertexStartIndex+4*n.numGlyphs,i=n.vertexStartIndex;i1||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=0&&r.indexOf(t)===n&&e.addIndicesForPlacedSymbol(e.text,t)})),i.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,i.verticalPlacedTextSymbolIndex),i.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,i.placedIconSymbolIndex),i.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,i.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},Fr("SymbolBucket",mc,{omit:["layers","collisionBoxArray","features","compareText"]}),mc.MAX_GLYPHS=65535,mc.addDynamicAttributes=pc;var yc=new bi({"symbol-placement":new gi(Pt.layout_symbol["symbol-placement"]),"symbol-spacing":new gi(Pt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new gi(Pt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new mi(Pt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new gi(Pt.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new gi(Pt.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new gi(Pt.layout_symbol["icon-ignore-placement"]),"icon-optional":new gi(Pt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new gi(Pt.layout_symbol["icon-rotation-alignment"]),"icon-size":new mi(Pt.layout_symbol["icon-size"]),"icon-text-fit":new gi(Pt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new gi(Pt.layout_symbol["icon-text-fit-padding"]),"icon-image":new mi(Pt.layout_symbol["icon-image"]),"icon-rotate":new mi(Pt.layout_symbol["icon-rotate"]),"icon-padding":new gi(Pt.layout_symbol["icon-padding"]),"icon-keep-upright":new gi(Pt.layout_symbol["icon-keep-upright"]),"icon-offset":new mi(Pt.layout_symbol["icon-offset"]),"icon-anchor":new mi(Pt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new gi(Pt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new gi(Pt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new gi(Pt.layout_symbol["text-rotation-alignment"]),"text-field":new mi(Pt.layout_symbol["text-field"]),"text-font":new mi(Pt.layout_symbol["text-font"]),"text-size":new mi(Pt.layout_symbol["text-size"]),"text-max-width":new mi(Pt.layout_symbol["text-max-width"]),"text-line-height":new gi(Pt.layout_symbol["text-line-height"]),"text-letter-spacing":new mi(Pt.layout_symbol["text-letter-spacing"]),"text-justify":new mi(Pt.layout_symbol["text-justify"]),"text-radial-offset":new mi(Pt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new gi(Pt.layout_symbol["text-variable-anchor"]),"text-anchor":new mi(Pt.layout_symbol["text-anchor"]),"text-max-angle":new gi(Pt.layout_symbol["text-max-angle"]),"text-writing-mode":new gi(Pt.layout_symbol["text-writing-mode"]),"text-rotate":new mi(Pt.layout_symbol["text-rotate"]),"text-padding":new gi(Pt.layout_symbol["text-padding"]),"text-keep-upright":new gi(Pt.layout_symbol["text-keep-upright"]),"text-transform":new mi(Pt.layout_symbol["text-transform"]),"text-offset":new mi(Pt.layout_symbol["text-offset"]),"text-allow-overlap":new gi(Pt.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new gi(Pt.layout_symbol["text-ignore-placement"]),"text-optional":new gi(Pt.layout_symbol["text-optional"])}),vc={paint:new bi({"icon-opacity":new mi(Pt.paint_symbol["icon-opacity"]),"icon-color":new mi(Pt.paint_symbol["icon-color"]),"icon-halo-color":new mi(Pt.paint_symbol["icon-halo-color"]),"icon-halo-width":new mi(Pt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new mi(Pt.paint_symbol["icon-halo-blur"]),"icon-translate":new gi(Pt.paint_symbol["icon-translate"]),"icon-translate-anchor":new gi(Pt.paint_symbol["icon-translate-anchor"]),"text-opacity":new mi(Pt.paint_symbol["text-opacity"]),"text-color":new mi(Pt.paint_symbol["text-color"],{runtimeType:Nt,getOverride:function(t){return t.textColor},hasOverride:function(t){return!!t.textColor}}),"text-halo-color":new mi(Pt.paint_symbol["text-halo-color"]),"text-halo-width":new mi(Pt.paint_symbol["text-halo-width"]),"text-halo-blur":new mi(Pt.paint_symbol["text-halo-blur"]),"text-translate":new gi(Pt.paint_symbol["text-translate"]),"text-translate-anchor":new gi(Pt.paint_symbol["text-translate-anchor"])}),layout:yc},_c=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:jt,this.defaultValue=t};_c.prototype.evaluate=function(t){if(t.formattedSection){var e=this.defaultValue.property.overrides;if(e&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default},_c.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)},_c.prototype.outputDefined=function(){return!1},_c.prototype.serialize=function(){return null},Fr("FormatSectionOverride",_c,{omit:["defaultValue"]});var bc=function(t){function e(e){t.call(this,e,vc)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.recalculate=function(e,n){if(t.prototype.recalculate.call(this,e,n),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){var r=this.layout.get("text-writing-mode");if(r){for(var i=[],o=0,a=r;o",targetMapId:r,sourceMapId:o.mapId})}}},Dc.prototype.receive=function(t){var e=t.data,n=e.id;if(n&&(!e.targetMapId||this.mapId===e.targetMapId))if(""===e.type){delete this.tasks[n];var r=this.cancelCallbacks[n];delete this.cancelCallbacks[n],r&&r()}else S()||e.mustQueue?(this.tasks[n]=e,this.taskQueue.push(n),this.invoker.trigger()):this.processTask(n,e)},Dc.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)}},Dc.prototype.processTask=function(t,e){var n=this;if(""===e.type){var r=this.callbacks[t];delete this.callbacks[t],r&&(e.error?r(Vr(e.error)):r(null,Vr(e.data)))}else{var i=!1,o=P(this.globalScope)?void 0:[],a=e.hasCallback?function(e,r){i=!0,delete n.cancelCallbacks[t],n.target.postMessage({id:t,type:"",sourceMapId:n.mapId,error:e?Gr(e):null,data:Gr(r,o)},o)}:function(t){i=!0},s=null,u=Vr(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)}},Dc.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var jc=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]))};jc.prototype.setNorthEast=function(t){return this._ne=t instanceof Fc?new Fc(t.lng,t.lat):Fc.convert(t),this},jc.prototype.setSouthWest=function(t){return this._sw=t instanceof Fc?new Fc(t.lng,t.lat):Fc.convert(t),this},jc.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 jc))return Array.isArray(t)?4===t.length||t.every(Array.isArray)?this.extend(jc.convert(t)):this.extend(Fc.convert(t)):this;if(n=t._ne,!(e=t._sw)||!n)return this}return r||i?(r.lng=Math.min(e.lng,r.lng),r.lat=Math.min(e.lat,r.lat),i.lng=Math.max(n.lng,i.lng),i.lat=Math.max(n.lat,i.lat)):(this._sw=new Fc(e.lng,e.lat),this._ne=new Fc(n.lng,n.lat)),this},jc.prototype.getCenter=function(){return new Fc((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},jc.prototype.getSouthWest=function(){return this._sw},jc.prototype.getNorthEast=function(){return this._ne},jc.prototype.getNorthWest=function(){return new Fc(this.getWest(),this.getNorth())},jc.prototype.getSouthEast=function(){return new Fc(this.getEast(),this.getSouth())},jc.prototype.getWest=function(){return this._sw.lng},jc.prototype.getSouth=function(){return this._sw.lat},jc.prototype.getEast=function(){return this._ne.lng},jc.prototype.getNorth=function(){return this._ne.lat},jc.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},jc.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},jc.prototype.isEmpty=function(){return!(this._sw&&this._ne)},jc.prototype.contains=function(t){var e=Fc.convert(t),n=e.lng,r=e.lat,i=this._sw.lng<=n&&n<=this._ne.lng;return this._sw.lng>this._ne.lng&&(i=this._sw.lng>=n&&n>=this._ne.lng),this._sw.lat<=r&&r<=this._ne.lat&&i},jc.convert=function(t){return!t||t instanceof jc?t:new jc(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(h(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.distanceTo=function(t){var e=Math.PI/180,n=this.lat*e,r=t.lat*e,i=Math.sin(n)*Math.sin(r)+Math.cos(n)*Math.cos(r)*Math.cos((t.lng-this.lng)*e);return 6371008.8*Math.acos(Math.min(i,1))},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 jc(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: , lat: }, an object {lon: , lat: }, or an array of [, ]")};var zc=2*Math.PI*6371008.8;function Uc(t){return zc*Math.cos(t*Math.PI/180)}function Nc(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 Vc(t,e){return t/Uc(e)}function Hc(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}var Wc=function(t,e,n){void 0===n&&(n=0),this.x=+t,this.y=+e,this.z=+n};Wc.fromLngLat=function(t,e){void 0===e&&(e=0);var n=Fc.convert(t);return new Wc(Nc(n.lng),Gc(n.lat),Vc(e,n.lat))},Wc.prototype.toLngLat=function(){return new Fc(360*this.x-180,Hc(this.y))},Wc.prototype.toAltitude=function(){return this.z*Uc(Hc(this.y))},Wc.prototype.meterInMercatorCoordinateUnits=function(){return 1/zc*(t=Hc(this.y),1/Math.cos(t*Math.PI/180));var t};var qc=function(t,e,n){this.z=t,this.x=e,this.y=n,this.key=Jc(0,t,t,e,n)};qc.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},qc.prototype.url=function(t,e){var n,r,i,o,a,s=(r=this.y,i=this.z,o=Lc(256*(n=this.x),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<this.canonical.z?new Zc(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Zc(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},Zc.prototype.calculateScaledKey=function(t,e){var n=this.canonical.z-t;return t>this.canonical.z?Jc(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):Jc(this.wrap*+e,t,t,this.canonical.x>>n,this.canonical.y>>n)},Zc.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>e&&t.canonical.y===this.canonical.y>>e},Zc.prototype.children=function(t){if(this.overscaledZ>=t)return[new Zc(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 Zc(e,this.wrap,e,n,r),new Zc(e,this.wrap,e,n+1,r),new Zc(e,this.wrap,e,n,r+1),new Zc(e,this.wrap,e,n+1,r+1)]},Zc.prototype.isLessThan=function(t){return this.wrapt.wrap)&&(this.overscaledZt.overscaledZ)&&(this.canonical.xt.canonical.x)&&this.canonical.y=this.dim+1||e<-1||e>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(e+1)*this.stride+(t+1)},Qc.prototype._unpackMapbox=function(t,e,n){return(256*t*256+256*e+n)/10-1e4},Qc.prototype._unpackTerrarium=function(t,e,n){return 256*t+e+n/256-32768},Qc.prototype.getPixels=function(){return new va({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Qc.prototype.backfillBorder=function(t,e,n){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");var 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=0&&l[3]>=0&&s.insert(a,l[0],l[1],l[2],l[3])}},el.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new _s.VectorTile(new Qs(this.rawTileData)).layers,this.sourceLayerCoder=new Kc(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},el.prototype.query=function(t,e,n,r){var o=this;this.loadVTLayers();for(var a=t.params||{},s=8192/t.tileSize/t.scale,u=ar(a.filter),c=t.queryGeometry,l=t.queryPadding*s,h=rl(c),f=this.grid.query(h.minX-l,h.minY-l,h.maxX+l,h.maxY+l),p=rl(t.cameraQueryGeometry),d=0,A=this.grid3D.query(p.minX-l,p.minY-l,p.maxX+l,p.maxY+l,(function(e,n,r,o){return function(t,e,n,r,o){for(var a=0,s=t;a=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=0)return!0;return!1}(o,h)){var p=this.sourceLayerCoder.decode(n),d=this.vtLayers[p].feature(r);if(i.needGeometry){var A=No(d,!0);if(!i.filter(new si(this.tileID.overscaledZ),A,this.tileID.canonical))return}else if(!i.filter(new si(this.tileID.overscaledZ),d))return;for(var g=this.getId(d,p),m=0;mr)i=!1;else if(e)if(this.expirationTimeut&&(t.getActor().send("enforceCacheSizeLimit",st),ft=0)},t.clamp=l,t.clearTileCache=function(t){var e=a.caches.delete("mapbox-tiles");t&&e.catch(t).then((function(){return t()}))},t.clipLine=qu,t.clone=function(t){var e=new aa(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},t.clone$1=b,t.clone$2=function(t){var e=new aa(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},t.collisionCircleLayout=Ws,t.config=z,t.create=function(){var t=new aa(16);return aa!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},t.create$1=function(){var t=new aa(9);return aa!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t},t.create$2=function(){var t=new aa(4);return aa!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},t.createCommonjsModule=e,t.createExpression=Xn,t.createLayout=Si,t.createStyleLayer=function(t){return"custom"===t.type?new Sc(t):new Tc[t.type](t)},t.cross=function(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],u=n[2];return t[0]=i*u-o*s,t[1]=o*a-r*u,t[2]=r*s-i*a,t},t.deepEqual=function t(e,n){if(Array.isArray(e)){if(!Array.isArray(n)||e.length!==n.length)return!1;for(var r=0;r0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t},t.number=He,t.offscreenCanvasSupported=pt,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 Qs(t).readFields(du,[])},t.pbf=Qs,t.performSymbolLayout=function(t,e,n,r,i,o,a){t.createArrays(),t.tilePixelRatio=8192/(512*t.overscaling),t.compareText={},t.iconsNeedLinear=!1;var s=t.layers[0].layout,u=t.layers[0]._unevaluatedLayout._values,c={};if("composite"===t.textSizeData.kind){var l=t.textSizeData,h=l.maxZoom;c.compositeTextSizes=[u["text-size"].possiblyEvaluate(new si(l.minZoom),a),u["text-size"].possiblyEvaluate(new si(h),a)]}if("composite"===t.iconSizeData.kind){var f=t.iconSizeData,p=f.maxZoom;c.compositeIconSizes=[u["icon-size"].possiblyEvaluate(new si(f.minZoom),a),u["icon-size"].possiblyEvaluate(new si(p),a)]}c.layoutTextSize=u["text-size"].possiblyEvaluate(new si(t.zoom+1),a),c.layoutIconSize=u["icon-size"].possiblyEvaluate(new si(t.zoom+1),a),c.textMaxSize=u["text-size"].possiblyEvaluate(new si(18));for(var d=24*s.get("text-line-height"),A="map"===s.get("text-rotation-alignment")&&"point"!==s.get("symbol-placement"),g=s.get("text-keep-upright"),m=s.get("text-size"),y=function(){var o=_[v],u=s.get("text-font").evaluate(o,{},a).join(","),l=m.evaluate(o,{},a),h=c.layoutTextSize.evaluate(o,{},a),f=c.layoutIconSize.evaluate(o,{},a),p={horizontal:{},vertical:void 0},y=o.text,b=[0,0];if(y){var x=y.toString(),E=24*s.get("text-letter-spacing").evaluate(o,{},a),O=function(t){for(var e=0,n=t;e=8192||h.y<0||h.y>=8192||function(t,e,n,r,i,o,a,s,u,c,l,h,f,p,d,A,g,m,y,v,_,b,x,E,O){var S,T,C,P,M,I=t.addToLineVertexArray(e,n),B=0,R=0,k=0,D=0,L=-1,j=-1,F={},z=fo(""),U=0,N=0;if(void 0===s._unevaluatedLayout.getValue("text-radial-offset")?(U=(S=s.layout.get("text-offset").evaluate(_,{},E).map((function(t){return 24*t})))[0],N=S[1]):(U=24*s.layout.get("text-radial-offset").evaluate(_,{},E),N=ic),t.allowVerticalPlacement&&r.vertical){var G=s.layout.get("text-rotate").evaluate(_,{},E)+90;P=new Yu(u,e,c,l,h,r.vertical,f,p,d,G),a&&(M=new Yu(u,e,c,l,h,a,g,m,d,G))}if(i){var V=s.layout.get("icon-rotate").evaluate(_,{}),H="none"!==s.layout.get("icon-text-fit"),W=Xu(i,V,x,H),q=a?Xu(a,V,x,H):void 0;C=new Yu(u,e,c,l,h,i,g,m,!1,V),B=4*W.length;var X=t.iconSizeData,Z=null;"source"===X.kind?(Z=[128*s.layout.get("icon-size").evaluate(_,{})])[0]>32640&&w(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):"composite"===X.kind&&((Z=[128*b.compositeIconSizes[0].evaluate(_,{},E),128*b.compositeIconSizes[1].evaluate(_,{},E)])[0]>32640||Z[1]>32640)&&w(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),t.addSymbols(t.icon,W,Z,v,y,_,!1,e,I.lineStartIndex,I.lineLength,-1,E),L=t.icon.placedSymbolArray.length-1,q&&(R=4*q.length,t.addSymbols(t.icon,q,Z,v,y,_,bu.vertical,e,I.lineStartIndex,I.lineLength,-1,E),j=t.icon.placedSymbolArray.length-1)}for(var J in r.horizontal){var Q=r.horizontal[J];if(!T){z=fo(Q.text);var K=s.layout.get("text-rotate").evaluate(_,{},E);T=new Yu(u,e,c,l,h,Q,f,p,d,K)}var Y=1===Q.positionedLines.length;if(k+=sc(t,e,Q,o,s,d,_,A,I,r.vertical?bu.horizontal:bu.horizontalOnly,Y?Object.keys(r.horizontal):[J],F,L,b,E),Y)break}r.vertical&&(D+=sc(t,e,r.vertical,o,s,d,_,A,I,bu.vertical,["vertical"],F,j,b,E));var $=T?T.boxStartIndex:t.collisionBoxArray.length,tt=T?T.boxEndIndex:t.collisionBoxArray.length,et=P?P.boxStartIndex:t.collisionBoxArray.length,nt=P?P.boxEndIndex:t.collisionBoxArray.length,rt=C?C.boxStartIndex:t.collisionBoxArray.length,it=C?C.boxEndIndex:t.collisionBoxArray.length,ot=M?M.boxStartIndex:t.collisionBoxArray.length,at=M?M.boxEndIndex:t.collisionBoxArray.length,st=-1,ut=function(t,e){return t&&t.circleDiameter?Math.max(t.circleDiameter,e):e};st=ut(T,st),st=ut(P,st),st=ut(C,st);var ct=(st=ut(M,st))>-1?1:0;ct&&(st*=O/24),t.glyphOffsetArray.length>=mc.MAX_GLYPHS&&w("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==_.sortKey&&t.addToSortKeyRanges(t.symbolInstances.length,_.sortKey),t.symbolInstances.emplaceBack(e.x,e.y,F.right>=0?F.right:-1,F.center>=0?F.center:-1,F.left>=0?F.left:-1,F.vertical||-1,L,j,z,$,tt,et,nt,rt,it,ot,at,c,k,D,B,R,ct,0,f,U,N,st)}(t,h,s,n,r,i,f,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,m,b,O,u,v,x,S,d,e,o,c,l,a)};if("line"===T)for(var I=0,B=qu(e.geometry,0,0,8192,8192);I1){var U=Hu(z,E,n.vertical||A,r,24,y);U&&M(z,U)}}else if("Polygon"===e.type)for(var N=0,G=rs(e.geometry,0);N=C.maxzoom||"none"!==C.visibility&&(a(T,this.zoom,r),(A[C.id]=C.createBucket({index:l.bucketLayerIDs.length,layers:T,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:_,sourceID:this.source})).populate(b,g,this.tileID.canonical),l.bucketLayerIDs.push(T.map((function(t){return t.id}))))}}}var P=t.mapObject(g.glyphDependencies,(function(t){return Object.keys(t).map(Number)}));Object.keys(P).length?o.send("getGlyphs",{uid:this.uid,stacks:P},(function(t,e){h||(h=t,f=e,B.call(u))})):f={};var M=Object.keys(g.iconDependencies);M.length?o.send("getImages",{icons:M,source:this.source,tileID:this.tileID,type:"icons"},(function(t,e){h||(h=t,p=e,B.call(u))})):p={};var I=Object.keys(g.patternDependencies);function B(){if(h)return s(h);if(f&&p&&d){var e=new i(f),n=new t.ImageAtlas(p,d);for(var o in A){var u=A[o];u instanceof t.SymbolBucket?(a(u.layers,this.zoom,r),t.performSymbolLayout(u,f,e.positions,p,n.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):u.hasPattern&&(u instanceof t.LineBucket||u instanceof t.FillBucket||u instanceof t.FillExtrusionBucket)&&(a(u.layers,this.zoom,r),u.addFeatures(g,this.tileID.canonical,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})}}I.length?o.send("getImages",{icons:I,source:this.source,tileID:this.tileID,type:"patterns"},(function(t,e){h||(h=t,d=e,B.call(u))})):d={},B.call(this)};var u=function(t,e,n,r){this.actor=t,this.layerIndex=e,this.availableImages=n,this.loadVectorData=r||s,this.loading={},this.loaded={}};u.prototype.loadTile=function(e,n){var r=this,i=e.uid;this.loading||(this.loading={});var a=!!(e&&e.request&&e.request.collectResourceTiming)&&new t.RequestPerformance(e.request),s=this.loading[i]=new o(e);s.abort=this.loadVectorData(e,(function(e,o){if(delete r.loading[i],e||!o)return s.status="done",r.loaded[i]=s,n(e);var u=o.rawData,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}))},u.prototype.reloadTile=function(t,e){var n=this,r=this.loaded,i=t.uid,o=this;if(r&&r[i]){var a=r[i];a.showCollisionBoxes=t.showCollisionBoxes;var s=function(t,r){var i=a.reloadCallback;i&&(delete a.reloadCallback,a.parse(a.vectorTile,o.layerIndex,n.availableImages,o.actor,i)),e(t,r)};"parsing"===a.status?a.reloadCallback=s:"done"===a.status&&(a.vectorTile?a.parse(a.vectorTile,this.layerIndex,this.availableImages,this.actor,s):s())}},u.prototype.abortTile=function(t,e){var n=this.loading,r=t.uid;n&&n[r]&&n[r].abort&&(n[r].abort(),delete n[r]),e()},u.prototype.removeTile=function(t,e){var n=this.loaded,r=t.uid;n&&n[r]&&delete n[r],e()};var c=t.window.ImageBitmap,l=function(){this.loaded={}};function h(t,e){if(0!==t.length){f(t[0],e);for(var n=1;n=Math.abs(s)?n-u+s:s-u+n,n=u}n+r>=0!=!!e&&t.reverse()}l.prototype.loadTile=function(e,n){var r=e.uid,i=e.encoding,o=e.rawImageData,a=c&&o instanceof c?this.getImageData(o):o,s=new t.DEMData(r,a,i);this.loaded=this.loaded||{},this.loaded[r]=s,n(null,s)},l.prototype.getImageData=function(e){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(e.width,e.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=e.width,this.offscreenCanvas.height=e.height,this.offscreenCanvasContext.drawImage(e,0,0,e.width,e.height);var n=this.offscreenCanvasContext.getImageData(-1,-1,e.width+2,e.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new t.RGBAImage({width:n.width,height:n.height},n.data)},l.prototype.removeTile=function(t){var e=this.loaded,n=t.uid;e&&e[n]&&delete e[n]};var p=t.vectorTile.VectorTileFeature.prototype.toGeoJSON,d=function(e){this._feature=e,this.extent=t.EXTENT,this.type=e.type,this.properties=e.tags,"id"in e&&!isNaN(e.id)&&(this.id=parseInt(e.id,10))};d.prototype.loadGeometry=function(){if(1===this._feature.type){for(var e=[],n=0,r=this._feature.geometry;n>31}function C(t,e){for(var n=t.loadGeometry(),r=t.type,i=0,o=0,a=n.length,s=0;s>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(M(e,n,i,r),n[2*o+a]>f&&M(e,n,i,o);pf;)d--}n[2*i+a]===f?M(e,n,i,d):M(e,n,++d,o),d<=r&&(i=d+1),r<=d&&(o=d-1)}}(e,n,s,i,o,a%2),t(e,n,r,i,s-1,a+1),t(e,n,r,s+1,o,a+1)}}(a,s,r,0,a.length-1,0)};D.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++)u=e[2*d+1],(s=e[2*d])>=n&&s<=i&&u>=r&&u<=o&&l.push(t[d]);else{var A=Math.floor((p+f)/2);u=e[2*A+1],(s=e[2*A])>=n&&s<=i&&u>=r&&u<=o&&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)},D.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++)B(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];B(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 L={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(t){return t}},j=function(t){this.options=H(Object.create(L),t),this.trees=new Array(this.options.maxZoom+1)};function F(t,e,n,r,i){return{x:t,y:e,zoom:1/0,id:n,parentId:-1,numPoints:r,properties:i}}function z(t,e){var n=t.geometry.coordinates,r=n[1];return{x:G(n[0]),y:V(r),zoom:1/0,index:e,parentId:-1}}function U(t){return{type:"Feature",id:t.id,properties:N(t),geometry:{type:"Point",coordinates:[(r=t.x,360*(r-.5)),(e=t.y,n=(180-360*e)*Math.PI/180,360*Math.atan(Math.exp(n))/Math.PI-90)]}};var e,n,r}function N(t){var e=t.numPoints,n=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return H(H({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:n})}function G(t){return t/360+.5}function V(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 H(t,e){for(var n in e)t[n]=e[n];return t}function W(t){return t.x}function q(t){return t.y}function X(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 Z(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)J(t,e);else if("Polygon"===n||"MultiLineString"===n)for(var r=0;r0&&(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;pa)o=p,a=d;else if(d===a){var A=Math.abs(p-s);Ai&&(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 $(t,e,n,r){for(var i=0;i1?1:n}function nt(t,e,n,r,i,o,a,s){if(r/=e,o>=(n/=e)&&a=r)return null;for(var u=[],c=0;c=n&&d=r)){var A=[];if("Point"===f||"MultiPoint"===f)rt(h,A,n,r,i);else if("LineString"===f)it(h,A,n,r,i,!1,s.lineMetrics);else if("MultiLineString"===f)at(h,A,n,r,i,!1);else if("Polygon"===f)at(h,A,n,r,i,!0);else if("MultiPolygon"===f)for(var g=0;g=n&&a<=r&&(e.push(t[o]),e.push(t[o+1]),e.push(t[o+2]))}}function it(t,e,n,r,i,o,a){for(var s,u,c=ot(t),l=0===i?ut:ct,h=t.start,f=0;fn&&(u=l(c,p,d,g,m,n),a&&(c.start=h+s*u)):y>r?v=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=ot(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&&st(c,p,d,A),b=c.length-3,o&&b>=3&&(c[b]!==c[0]||c[b+1]!==c[1])&&st(c,c[0],c[1],c[2]),c.length&&e.push(c)}function ot(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function at(t,e,n,r,i,o){for(var a=0;aa.maxX&&(a.maxX=l),h>a.maxY&&(a.maxY=h)}return a}function At(t,e,n,r){var i=e.geometry,o=e.type,a=[];if("Point"===o||"MultiPoint"===o)for(var s=0;s0&&e.size<(i?a:r))n.numPoints+=e.length/3;else{for(var s=[],u=0;ua)&&(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;r0===e)for(r=0,i=t.length;r24)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=r;c--){var l=+Date.now();s=this._cluster(s,c),this.trees[c]=new D(s,W,q,o,Float32Array),n&&console.log("z%d: %d clusters in %dms",c,s.length,+Date.now()-l)}return n&&console.timeEnd("total time"),this},j.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(G(n),V(o),G(i),V(r));le&&(f+=A.numPoints||1)}if(f>=o){for(var g=u.x*h,m=u.y*h,y=i&&h>1?this._map(u,!0):null,v=(s<<5)+(e+1)+this.points.length,_=0,b=l;_1)for(var E=0,O=l;E>5},j.prototype._getOriginZoom=function(t){return(t-this.points.length)%32},j.prototype._map=function(t,e){if(t.numPoints)return e?H({},t.properties):t.properties;var n=this.points[t.index].properties,r=this.options.map(n);return e&&r===n?H({},r):r},mt.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},mt.prototype.splitTile=function(t,e,n,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<1&&console.time("creation"),f=this.tiles[h]=dt(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<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=nt(t,l,n-b,n+w,0,f.minX,f.maxX,u),_=nt(t,l,n+x,n+E,0,f.minX,f.maxX,u),t=null,v&&(A=nt(v,l,r-b,r+w,1,f.minY,f.maxY,u),g=nt(v,l,r+x,r+E,1,f.minY,f.maxY,u),v=null),_&&(m=nt(_,l,r-b,r+w,1,f.minY,f.maxY,u),y=nt(_,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)}}},mt.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<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[yt(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]?ft(this.tiles[s],i):null):null};var _t=function(e){function n(t,n,r,i){e.call(this,t,n,r,vt),i&&(this.loadGeoJSON=i)}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.loadData=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=e,this._pendingLoadDataParams=t,this._state&&"Idle"!==this._state?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},n.prototype._loadData=function(){var e=this;if(this._pendingCallback&&this._pendingLoadDataParams){var n=this._pendingCallback,r=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var i=!!(r&&r.request&&r.request.collectResourceTiming)&&new t.RequestPerformance(r.request);this.loadGeoJSON(r,(function(o,a){if(o||!a)return n(o);if("object"!=typeof a)return n(new Error("Input data given to '"+r.source+"' is not a valid GeoJSON object."));!function t(e,n){var r,i=e&&e.type;if("FeatureCollection"===i)for(r=0;r=0?0:e.button},n.remove=function(t){t.parentNode&&t.parentNode.removeChild(t)};var f=function(e){function n(){e.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.RGBAImage({width:1,height:1}),this.dirty=!0}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.isLoaded=function(){return this.loaded},n.prototype.setLoaded=function(t){if(this.loaded!==t&&(this.loaded=t,t)){for(var e=0,n=this.requestors;e=0?1.2:1))}function m(t,e,n,r,i,o,a){for(var s=0;s65535)e(new Error("glyphs > 65535 not supported"));else if(o.ranges[s])e(null,{stack:n,id:i,glyph:a});else{var u=o.requests[s];u||(u=o.requests[s]=[],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]);o.ranges[s]=!0}for(var i=0,a=u;i1&&(s=t[++a]);var c=Math.abs(u-s.left),l=Math.abs(u-s.right),h=Math.min(c,l),f=void 0,p=i/n*(r+1);if(s.isDash){var d=r-Math.abs(p);f=Math.sqrt(h*h+d*d)}else f=r-Math.sqrt(h*h+p*p);this.data[o+u]=Math.max(0,Math.min(255,f+128))}},w.prototype.addRegularDash=function(t){for(var e=t.length-1;e>=0;--e){var n=t[e],r=t[e+1];n.zeroLength?t.splice(e,1):r&&r.isDash===n.isDash&&(r.left=n.left,t.splice(e,1))}var i=t[0],o=t[t.length-1];i.isDash===o.isDash&&(i.left=o.left-this.width,o.right=i.right+this.width);for(var a=this.width*this.nextRow,s=0,u=t[s],c=0;c1&&(u=t[++s]);var l=Math.abs(c-u.left),h=Math.abs(c-u.right),f=Math.min(l,h);this.data[a+c]=Math.max(0,Math.min(255,(u.isDash?f:-f)+128))}},w.prototype.addDash=function(e,n){var r=n?7:0,i=2*r+1;if(this.nextRow+i>this.height)return t.warnOnce("LineAtlas out of space"),null;for(var o=0,a=0;a=r&&e.x=i&&e.y0&&(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+10&&(r.resourceTiming=e._resourceTiming,e._resourceTiming=[]),e.fire(new t.Event("data",r))}}))},n.prototype.onAdd=function(t){this.map=t,this.load()},n.prototype.setData=function(e){var n=this;return this._data=e,this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(e){if(e)n.fire(new t.ErrorEvent(e));else{var r={dataType:"source",sourceDataType:"content"};n._collectResourceTiming&&n._resourceTiming&&n._resourceTiming.length>0&&(r.resourceTiming=n._resourceTiming,n._resourceTiming=[]),n.fire(new t.Event("data",r))}})),this},n.prototype.getClusterExpansionZoom=function(t,e){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},e),this},n.prototype.getClusterChildren=function(t,e){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id},e),this},n.prototype.getClusterLeaves=function(t,e,n,r){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:e,offset:n},r),this},n.prototype._updateWorkerData=function(e){var n=this;this._loaded=!1;var r=t.extend({},this.workerOptions),i=this._data;"string"==typeof i?(r.request=this.map._requestManager.transformRequest(t.browser.resolveURL(i),t.ResourceType.Source),r.request.collectResourceTiming=this._collectResourceTiming):r.data=JSON.stringify(i),this.actor.send(this.type+".loadData",r,(function(t,i){n._removed||i&&i.abandoned||(n._loaded=!0,i&&i.resourceTiming&&i.resourceTiming[n.id]&&(n._resourceTiming=i.resourceTiming[n.id].slice(0)),n.actor.send(n.type+".coalesce",{source:r.source},null),e(t))}))},n.prototype.loaded=function(){return this._loaded},n.prototype.loadTile=function(e,n){var r=this,i=e.actor?"reloadTile":"loadTile";e.actor=this.actor,e.request=this.actor.send(i,{type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},(function(t,o){return delete e.request,e.unloadVectorData(),e.aborted?n(null):t?n(t):(e.loadVectorData(o,r.map.painter,"reloadTile"===i),n(null))}))},n.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0},n.prototype.unloadTile=function(t){t.unloadVectorData(),this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id})},n.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},n.prototype.serialize=function(){return t.extend({},this._options,{type:this.type,data:this._data})},n.prototype.hasTransition=function(){return!1},n}(t.Evented),I=t.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),B=function(e){function n(t,n,r,i){e.call(this),this.id=t,this.dispatcher=r,this.coordinates=n.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(i),this.options=n}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.load=function(e,n){var r=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this.url=this.options.url,t.getImage(this.map._requestManager.transformRequest(this.url,t.ResourceType.Image),(function(i,o){r._loaded=!0,i?r.fire(new t.ErrorEvent(i)):o&&(r.image=o,e&&(r.coordinates=e),n&&n(),r._finishLoading())}))},n.prototype.loaded=function(){return this._loaded},n.prototype.updateImage=function(t){var e=this;return this.image&&t.url?(this.options.url=t.url,this.load(t.coordinates,(function(){e.texture=null})),this):this},n.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})))},n.prototype.onAdd=function(t){this.map=t,this.load()},n.prototype.setCoordinates=function(e){var n=this;this.coordinates=e;var r=e.map(t.MercatorCoordinate.fromLngLat);this.tileID=function(e){for(var n=1/0,r=1/0,i=-1/0,o=-1/0,a=0,s=e;an.end(0)?this.fire(new t.ErrorEvent(new t.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+n.start(0)+" and "+n.end(0)+"-second mark."))):this.video.currentTime=e}},n.prototype.getVideo=function(){return this.video},n.prototype.onAdd=function(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},n.prototype.prepare=function(){if(!(0===Object.keys(this.tiles).length||this.video.readyState<2)){var e=this.map.painter.context,n=e.gl;for(var r in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,I.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE),n.texSubImage2D(n.TEXTURE_2D,0,0,0,n.RGBA,n.UNSIGNED_BYTE,this.video)):(this.texture=new t.Texture(e,this.video,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE)),this.tiles){var i=this.tiles[r];"loaded"!==i.state&&(i.state="loaded",i.texture=this.texture)}}},n.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},n.prototype.hasTransition=function(){return this.video&&!this.video.paused},n}(B),k=function(e){function n(n,r,i,o){e.call(this,n,r,i,o),r.coordinates?Array.isArray(r.coordinates)&&4===r.coordinates.length&&!r.coordinates.some((function(t){return!Array.isArray(t)||2!==t.length||t.some((function(t){return"number"!=typeof t}))}))||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+n,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+n,null,'missing required property "coordinates"'))),r.animate&&"boolean"!=typeof r.animate&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+n,null,'optional "animate" property must be a boolean value'))),r.canvas?"string"==typeof r.canvas||r.canvas instanceof t.window.HTMLCanvasElement||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+n,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+n,null,'missing required property "canvas"'))),this.options=r,this.animate=void 0===r.animate||r.animate}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof t.window.HTMLCanvasElement?this.options.canvas:t.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new t.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())},n.prototype.getCanvas=function(){return this.canvas},n.prototype.onAdd=function(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()},n.prototype.onRemove=function(){this.pause()},n.prototype.prepare=function(){var e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),!this._hasInvalidDimensions()&&0!==Object.keys(this.tiles).length){var n=this.map.painter.context,r=n.gl;for(var i in this.boundsBuffer||(this.boundsBuffer=n.createVertexBuffer(this._boundsArray,I.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new t.Texture(n,this.canvas,r.RGBA,{premultiply:!0}),this.tiles){var o=this.tiles[i];"loaded"!==o.state&&(o.state="loaded",o.texture=this.texture)}}},n.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},n.prototype.hasTransition=function(){return this._playing},n.prototype._hasInvalidDimensions=function(){for(var t=0,e=[this.canvas.width,this.canvas.height];tthis.max){var a=this._getAndRemoveByKey(this.order[0]);a&&this.onRemove(a)}return this},z.prototype.has=function(t){return t.wrapped().key in this.data},z.prototype.getAndRemove=function(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null},z.prototype._getAndRemoveByKey=function(t){var e=this.data[t].shift();return e.timeout&&clearTimeout(e.timeout),0===this.data[t].length&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),e.value},z.prototype.getByKey=function(t){var e=this.data[t];return e?e[0].value:null},z.prototype.get=function(t){return this.has(t)?this.data[t.wrapped().key][0].value:null},z.prototype.remove=function(t,e){if(!this.has(t))return this;var n=t.wrapped().key,r=void 0===e?0:this.data[n].indexOf(e),i=this.data[n][r];return this.data[n].splice(r,1),i.timeout&&clearTimeout(i.timeout),0===this.data[n].length&&delete this.data[n],this.onRemove(i.value),this.order.splice(this.order.indexOf(n),1),this},z.prototype.setMaxSize=function(t){for(this.max=t;this.order.length>this.max;){var e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this},z.prototype.filter=function(t){var e=[];for(var n in this.data)for(var r=0,i=this.data[n];r1||(Math.abs(n)>1&&(1===Math.abs(n+i)?n+=i:1===Math.abs(n-i)&&(n-=i)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,n,r),t.neighboringTiles&&t.neighboringTiles[o]&&(t.neighboringTiles[o].backfilled=!0)))}},n.prototype.getTile=function(t){return this.getTileByID(t.key)},n.prototype.getTileByID=function(t){return this._tiles[t]},n.prototype._retainLoadedChildren=function(t,e,n,r){for(var i in this._tiles){var o=this._tiles[i];if(!(r[i]||!o.hasData()||o.tileID.overscaledZ<=e||o.tileID.overscaledZ>n)){for(var a=o.tileID;o&&o.tileID.overscaledZ>e+1;){var s=o.tileID.scaledTo(o.tileID.overscaledZ-1);(o=this._tiles[s.key])&&o.hasData()&&(a=s)}for(var u=a;u.overscaledZ>e;)if(t[(u=u.scaledTo(u.overscaledZ-1)).key]){r[a.key]=a;break}}}},n.prototype.findLoadedParent=function(t,e){if(t.key in this._loadedParentTiles){var n=this._loadedParentTiles[t.key];return n&&n.tileID.overscaledZ>=e?n:null}for(var r=t.overscaledZ-1;r>=e;r--){var i=t.scaledTo(r),o=this._getLoadedTile(i);if(o)return o}},n.prototype._getLoadedTile=function(t){var e=this._tiles[t.key];return e&&e.hasData()?e:this._cache.getByKey(t.wrapped().key)},n.prototype.updateCacheSize=function(t){var e=Math.ceil(t.width/this._source.tileSize)+1,n=Math.ceil(t.height/this._source.tileSize)+1,r=Math.floor(e*n*5),i="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,r):r;this._cache.setMaxSize(i)},n.prototype.handleWrapJump=function(t){var e=Math.round((t-(void 0===this._prevLng?t:this._prevLng))/360);if(this._prevLng=t,e){var n={};for(var r in this._tiles){var i=this._tiles[r];i.tileID=i.tileID.unwrapTo(i.tileID.wrap+e),n[i.tileID.key]=i}for(var o in this._tiles=n,this._timers)clearTimeout(this._timers[o]),delete this._timers[o];for(var a in this._tiles)this._setTileReloadTimer(a,this._tiles[a])}},n.prototype.update=function(e){var r=this;if(this.transform=e,this._sourceLoaded&&!this._paused){var i;this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?i=e.getVisibleUnwrappedCoordinates(this._source.tileID).map((function(e){return new t.OverscaledTileID(e.canonical.z,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y)})):(i=e.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(i=i.filter((function(t){return r._source.hasTile(t)})))):i=[];var o=e.coveringZoomLevel(this._source),a=Math.max(o-n.maxOverzooming,this._source.minzoom),s=Math.max(o+n.maxUnderzooming,this._source.minzoom),u=this._updateRetainedTiles(i,o);if(Bt(this._source.type)){for(var c={},l={},h=0,f=Object.keys(u);hthis._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._updateLoadedParentTileCache=function(){for(var t in this._loadedParentTiles={},this._tiles){for(var e=[],n=void 0,r=this._tiles[t].tileID;r.overscaledZ>0;){if(r.key in this._loadedParentTiles){n=this._loadedParentTiles[r.key];break}e.push(r.key);var i=r.scaledTo(r.overscaledZ-1);if(n=this._getLoadedTile(i))break;r=i}for(var o=0,a=e;o0||(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=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=t.browser.now())return!0}return!1},n.prototype.setFeatureState=function(t,e,n){this._state.updateState(t=t||"_geojsonTileLayer",e,n)},n.prototype.removeFeatureState=function(t,e,n){this._state.removeFeatureState(t=t||"_geojsonTileLayer",e,n)},n.prototype.getFeatureState=function(t,e){return this._state.getState(t=t||"_geojsonTileLayer",e)},n.prototype.setDependencies=function(t,e,n){var r=this._tiles[t];r&&r.setDependencies(e,n)},n.prototype.reloadTilesForDependencies=function(t,e){for(var n in this._tiles)this._tiles[n].hasDependency(t,e)&&this._reloadTile(n,"reloading");this._cache.filter((function(n){return!n.hasDependency(t,e)}))},n}(t.Evented);function It(t,e){var n=Math.abs(2*t.wrap)-+(t.wrap<0),r=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||r-n||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function Bt(t){return"raster"===t||"image"===t||"video"===t}function Rt(){return new t.window.Worker(Ji.workerUrl)}Mt.maxOverzooming=10,Mt.maxUnderzooming=3;var kt="mapboxgl_preloaded_worker_pool",Dt=function(){this.active={}};Dt.prototype.acquire=function(t){if(!this.workers)for(this.workers=[];this.workers.length0?(i-a)/s:0;return this.points[o].mult(1-u).add(this.points[n].mult(u))};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=-e[0]&&n<=e[0]&&r>=-e[1]&&r<=e[1]}function ne(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;mMath.abs(r.x-n.x)*i?{useVertical:!0}:(e===t.WritingMode.vertical?n.yr.x)?{needsFlipping:!0}:null}function oe(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=re(g,u,m,y,r,h,f,e,c,a,p);if(!x)return{notEnoughRoom:!0};var w=$t(x.first.point,s).point,E=$t(x.last.point,s).point;if(i&&!r){var O=ie(e.writingMode,w,E,d);if(O)return O}A=[x.first];for(var S=e.glyphStartIndex+1;S0?M.point:ae(f,P,T,1,o),B=ie(e.writingMode,T,I,d);if(B)return B}var R=se(g*u.getoffsetX(e.glyphStartIndex),m,y,r,h,f,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,c,a,p);if(!R)return{notEnoughRoom:!0};A=[R]}for(var k=0,D=A;k0?1:-1,A=0;i&&(d*=-1,A=Math.PI),d<0&&(A+=Math.PI);for(var g=d>0?u+s:u+s+1,m=o,y=o,v=0,_=0,b=Math.abs(p),x=[];v+_<=b;){if((g+=d)=c)return null;if(y=m,x.push(m),void 0===(m=f[g])){var w=new t.Point(l.getx(g),l.gety(g)),E=$t(w,h);if(E.signedDistanceFromCamera>0)m=f[g]=E.point;else{var O=g-d;m=ae(0===v?a:new t.Point(l.getx(O),l.gety(O)),w,y,b-v+1,h)}}v+=_,_=y.dist(m)}var S=(b-v)/_,T=m.sub(y),C=T.mult(S)._add(y);C._add(T._unit()._perp()._mult(r*d));var P=A+Math.atan2(m.y-y.y,m.x-y.x);return x.push(C),{point:C,angle:P,path:x}}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;s0: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=[];return this._forEachCell(o,s,a,u,this._queryCellCircle,c,{hitTest:r,circle:{x:t,y:e,radius:n},seenUids:{box:{},circle:{}}},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=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;ma*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 ue=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function ce(t,e){for(var n=0;n=1;I--)M.push(C.path[I]);for(var B=1;B0){for(var L=M[0].clone(),j=M[0].clone(),F=1;F=O.x&&j.x<=S.x&&L.y>=O.y&&j.y<=S.y?[M]:j.xS.x||j.yS.y?[]:t.clipLine([M],O.x,O.y,S.x,S.y)}for(var z=0,U=D;z=this.screenRightBoundary||r<100||e>this.screenBottomBoundary},he.prototype.isInsideGrid=function(t,e,n,r){return n>=0&&t=0&&e0?(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},be.prototype.placeLayerBucketPart=function(e,n,r){var i=this,o=e.parameters,a=o.bucket,s=o.layout,u=o.posMatrix,c=o.textLabelPlaneMatrix,l=o.labelToScreenMatrix,h=o.textPixelRatio,f=o.holdingForFade,p=o.collisionBoxArray,d=o.partiallyEvaluatedTextSize,A=o.collisionGroup,g=s.get("text-optional"),m=s.get("icon-optional"),y=s.get("text-allow-overlap"),v=s.get("icon-allow-overlap"),_="map"===s.get("text-rotation-alignment"),b="map"===s.get("text-pitch-alignment"),x="none"!==s.get("icon-text-fit"),w="viewport-y"===s.get("symbol-z-order"),E=y&&(v||!a.hasIconData()||m),O=v&&(y||!a.hasTextData()||g);!a.collisionArrays&&p&&a.deserializeCollisionBoxes(p);var S=function(e,o){if(!n[e.crossTileID])if(f)i.placements[e.crossTileID]=new Ae(!1,!1,!1);else{var p,w=!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,D=0;o.textFeatureIndex?R=o.textFeatureIndex:e.useRuntimeCollisionCircles&&(R=e.featureIndex),o.verticalTextFeatureIndex&&(k=o.verticalTextFeatureIndex);var L=o.textBox;if(L){var j=function(n){var r=t.WritingMode.horizontal;if(a.allowVerticalPlacement&&!n&&i.prevPlacement){var o=i.prevPlacement.placedOrientations[e.crossTileID];o&&(i.placedOrientations[e.crossTileID]=o,i.markUsedOrientation(a,r=o,e))}return r},F=function(n,r){if(a.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&o.verticalTextBox)for(var i=0,s=a.writingModes;i0&&(z=z.filter((function(t){return t!==U.anchor}))).unshift(U.anchor)}var N=function(t,n,r){for(var o=t.x2-t.x1,s=t.y2-t.y1,c=e.textBoxScale,l=x&&!v?n:null,f={box:[],offscreen:!1},p=y?2*z.length:z.length,d=0;d=z.length,e,a,r,l);if(g&&(f=g.placedGlyphBoxes)&&f.box&&f.box.length){w=!0,C=g.shift;break}}return f};F((function(){return N(L,o.iconBox,t.WritingMode.horizontal)}),(function(){var n=o.verticalTextBox;return a.allowVerticalPlacement&&!(P&&P.box&&P.box.length)&&e.numVerticalGlyphVertices>0&&n?N(n,o.verticalIconBox,t.WritingMode.vertical):{box:null,offscreen:null}})),P&&(w=P.box,T=P.offscreen);var G=j(P&&P.box);if(!w&&i.prevPlacement){var V=i.prevPlacement.variableOffsets[e.crossTileID];V&&(i.variableOffsets[e.crossTileID]=V,i.markUsedJustification(a,V.anchor,e,G))}}else{var H=function(t,n){var r=i.collisionIndex.placeCollisionBox(t,y,h,u,A.predicate);return r&&r.box&&r.box.length&&(i.markUsedOrientation(a,n,e),i.placedOrientations[e.crossTileID]=n),r};F((function(){return H(L,t.WritingMode.horizontal)}),(function(){var n=o.verticalTextBox;return a.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&n?H(n,t.WritingMode.vertical):{box:null,offscreen:null}})),j(P&&P.box&&P.box.length)}}if(w=(p=P)&&p.box&&p.box.length>0,T=p&&p.offscreen,e.useRuntimeCollisionCircles){var W=a.text.placedSymbolArray.get(e.centerJustifiedTextSymbolIndex),q=t.evaluateSizeForFeature(a.textSizeData,d,W),X=s.get("text-padding");I=i.collisionIndex.placeCollisionCircles(y,W,a.lineVertexArray,a.glyphOffsetArray,q,u,c,l,r,b,A.predicate,e.collisionCircleDiameter,X),w=y||I.circles.length>0&&!I.collisionDetected,T=T&&I.offscreen}if(o.iconFeatureIndex&&(D=o.iconFeatureIndex),o.iconBox){var Z=function(t){var e=x&&C?_e(t,C.x,C.y,_,b,i.transform.angle):t;return i.collisionIndex.placeCollisionBox(e,v,h,u,A.predicate)};S=M&&M.box&&M.box.length&&o.verticalIconBox?(B=Z(o.verticalIconBox)).box.length>0:(B=Z(o.iconBox)).box.length>0,T=T&&B.offscreen}var J=g||0===e.numHorizontalGlyphVertices&&0===e.numVerticalGlyphVertices,Q=m||0===e.numIconVertices;if(J||Q?Q?J||(S=S&&w):w=S&&w:S=w=S&&w,w&&p&&p.box&&i.collisionIndex.insertCollisionBox(p.box,s.get("text-ignore-placement"),a.bucketInstanceId,M&&M.box&&k?k:R,A.ID),S&&B&&i.collisionIndex.insertCollisionBox(B.box,s.get("icon-ignore-placement"),a.bucketInstanceId,D,A.ID),I&&(w&&i.collisionIndex.insertCollisionCircles(I.circles,s.get("text-ignore-placement"),a.bucketInstanceId,R,A.ID),r)){var K=a.bucketInstanceId,Y=i.collisionCircleArrays[K];void 0===Y&&(Y=i.collisionCircleArrays[K]=new ge);for(var $=0;$=0;--C){var P=T[C];S(a.symbolInstances.get(P),a.collisionArrays[P])}else for(var M=e.symbolInstanceStart;M=0&&(e.text.placedSymbolArray.get(u).crossTileID=o>=0&&u!==o?0:r.crossTileID)}},be.prototype.markUsedOrientation=function(e,n,r){for(var i=n===t.WritingMode.horizontal||n===t.WritingMode.horizontalOnly?n:0,o=n===t.WritingMode.vertical?n:0,a=0,s=[r.leftJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.rightJustifiedTextSymbolIndex];a0,y=i.placedOrientations[o.crossTileID],v=y===t.WritingMode.vertical,_=y===t.WritingMode.horizontal||y===t.WritingMode.horizontalOnly;if(s>0||u>0){var b=Me(g.text);d(e.text,s,v?Ie:b),d(e.text,u,_?Ie:b);var x=g.text.isHidden();[o.rightJustifiedTextSymbolIndex,o.centerJustifiedTextSymbolIndex,o.leftJustifiedTextSymbolIndex].forEach((function(t){t>=0&&(e.text.placedSymbolArray.get(t).hidden=x||v?1:0)})),o.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(o.verticalPlacedTextSymbolIndex).hidden=x||_?1:0);var w=i.variableOffsets[o.crossTileID];w&&i.markUsedJustification(e,w.anchor,o,y);var E=i.placedOrientations[o.crossTileID];E&&(i.markUsedJustification(e,"left",o,E),i.markUsedOrientation(e,E,o))}if(m){var O=Me(g.icon),S=!(f&&o.verticalPlacedIconSymbolIndex&&v);o.placedIconSymbolIndex>=0&&(d(e.icon,o.numIconVertices,S?O:Ie),e.icon.placedSymbolArray.get(o.placedIconSymbolIndex).hidden=g.icon.isHidden()),o.verticalPlacedIconSymbolIndex>=0&&(d(e.icon,o.numVerticalIconVertices,S?Ie:O),e.icon.placedSymbolArray.get(o.verticalPlacedIconSymbolIndex).hidden=g.icon.isHidden())}if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){var T=e.collisionArrays[r];if(T){var C=new t.Point(0,0);if(T.textBox||T.verticalTextBox){var P=!0;if(c){var M=i.variableOffsets[A];M?(C=ve(M.anchor,M.width,M.height,M.textOffset,M.textBoxScale),l&&C._rotate(h?i.transform.angle:-i.transform.angle)):P=!1}T.textBox&&xe(e.textCollisionBox.collisionVertexArray,g.text.placed,!P||v,C.x,C.y),T.verticalTextBox&&xe(e.textCollisionBox.collisionVertexArray,g.text.placed,!P||_,C.x,C.y)}var I=Boolean(!_&&T.verticalIconBox);T.iconBox&&xe(e.iconCollisionBox.collisionVertexArray,g.icon.placed,I,f?C.x:0,f?C.y:0),T.verticalIconBox&&xe(e.iconCollisionBox.collisionVertexArray,g.icon.placed,!I,f?C.x:0,f?C.y:0)}}},g=0;gt},be.prototype.setStale=function(){this.stale=!0};var we=Math.pow(2,25),Ee=Math.pow(2,24),Oe=Math.pow(2,17),Se=Math.pow(2,16),Te=Math.pow(2,9),Ce=Math.pow(2,8),Pe=Math.pow(2,1);function Me(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;var e=t.placed?1:0,n=Math.floor(127*t.opacity);return n*we+e*Ee+n*Oe+e*Se+n*Te+e*Ce+n*Pe+e}var Ie=0,Be=function(t){this._sortAcrossTiles="viewport-y"!==t.layout.get("symbol-z-order")&&void 0!==t.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};Be.prototype.continuePlacement=function(t,e,n,r,i){for(var o=this._bucketParts;this._currentTileIndex2};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 Be(s)),this._inProgressLayer.continuePlacement(r[s.source],this.placement,this._showCollisionBoxes,s,a))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},Re.prototype.commit=function(t){return this.placement.commit(t),this.placement};var ke=512/t.EXTENT/2,De=function(t,e,n){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=n;for(var r=0;rt.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;l1?"@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,this.map._requestManager,(function(e,r){if(n._spriteRequest=null,e)n.fire(new t.ErrorEvent(e));else if(r)for(var i in r)n.imageManager.addImage(i,r[i]);n.imageManager.setLoaded(!0),n._availableImages=n.imageManager.listImages(),n.dispatcher.broadcast("setImages",n._availableImages),n.fire(new t.Event("data",{dataType:"style"}))}))},n.prototype._validateLayer=function(e){var n=this.sourceCaches[e.source];if(n){var r=e.sourceLayer;if(r){var i=n.getSource();("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;n0)throw new Error("Unimplemented: "+i.map((function(t){return t.command})).join(", ")+".");return r.forEach((function(t){"setTransition"!==t.command&&n[t.command].apply(n,t.args)})),this.stylesheet=e,!0},n.prototype.addImage=function(e,n){if(this.getImage(e))return this.fire(new t.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(e,n),this._afterImageUpdated(e)},n.prototype.updateImage=function(t,e){this.imageManager.updateImage(t,e)},n.prototype.getImage=function(t){return this.imageManager.getImage(t)},n.prototype.removeImage=function(e){if(!this.getImage(e))return this.fire(new t.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(e),this._afterImageUpdated(e)},n.prototype._afterImageUpdated=function(e){this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new t.Event("data",{dataType:"style"}))},n.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},n.prototype.addSource=function(e,n,r){var i=this;if(void 0===r&&(r={}),this._checkLoaded(),void 0!==this.sourceCaches[e])throw new Error("There is already a source with this ID");if(!n.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(n).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(n.type)>=0&&this._validate(t.validateStyle.source,"sources."+e,n,null,r))){this.map&&this.map._collectResourceTiming&&(n.collectResourceTiming=!0);var o=this.sourceCaches[e]=new Mt(e,n,this.dispatcher);o.style=this,o.setEventedParent(this,(function(){return{isSourceLoaded:i.loaded(),source:o.serialize(),sourceId:e}})),o.onAdd(this.map),this._changed=!0}},n.prototype.removeSource=function(e){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error("There is no source with this ID");for(var n in this._layers)if(this._layers[n].source===e)return this.fire(new t.ErrorEvent(new Error('Source "'+e+'" cannot be removed while layer "'+n+'" is using it.')));var r=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],r.fire(new t.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),r.setEventedParent(null),r.clearTiles(),r.onRemove&&r.onRemove(this.map),this._changed=!0},n.prototype.setGeoJSONSourceData=function(t,e){this._checkLoaded(),this.sourceCaches[t].getSource().setData(e),this._changed=!0},n.prototype.getSource=function(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()},n.prototype.addLayer=function(e,n,r){void 0===r&&(r={}),this._checkLoaded();var i=e.id;if(this.getLayer(i))this.fire(new t.ErrorEvent(new Error('Layer with id "'+i+'" already exists on this map')));else{var o;if("custom"===e.type){if(ze(this,t.validateCustomStyleLayer(e)))return;o=t.createStyleLayer(e)}else{if("object"==typeof e.source&&(this.addSource(i,e.source),e=t.clone$1(e),e=t.extend(e,{source:i})),this._validate(t.validateStyle.layer,"layers."+i,e,{arrayIndex:-1},r))return;o=t.createStyleLayer(e),this._validateLayer(o),o.setEventedParent(this,{layer:{id:i}}),this._serializedLayers[o.id]=o.serialize()}var a=n?this._order.indexOf(n):this._order.length;if(n&&-1===a)this.fire(new t.ErrorEvent(new Error('Layer with id "'+n+'" does not exist on this map.')));else{if(this._order.splice(a,0,i),this._layerOrderChanged=!0,this._layers[i]=o,this._removedLayers[i]&&o.source&&"custom"!==o.type){var s=this._removedLayers[i];delete this._removedLayers[i],s.type!==o.type?this._updatedSources[o.source]="clear":(this._updatedSources[o.source]="reload",this.sourceCaches[o.source].pause())}this._updateLayer(o),o.onAdd&&o.onAdd(this.map)}}},n.prototype.moveLayer=function(e,n){if(this._checkLoaded(),this._changed=!0,this._layers[e]){if(e!==n){var r=this._order.indexOf(e);this._order.splice(r,1);var i=n?this._order.indexOf(n):this._order.length;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._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],n.onRemove&&n.onRemove(this.map)}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be removed.")))},n.prototype.getLayer=function(t){return this._layers[t]},n.prototype.hasLayer=function(t){return t in this._layers},n.prototype.setLayerZoomRange=function(e,n,r){this._checkLoaded();var i=this.getLayer(e);i?i.minzoom===n&&i.maxzoom===r||(null!=n&&(i.minzoom=n),null!=r&&(i.maxzoom=r),this._updateLayer(i)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot have zoom extent.")))},n.prototype.setFilter=function(e,n,r){void 0===r&&(r={}),this._checkLoaded();var i=this.getLayer(e);if(i){if(!t.deepEqual(i.filter,n))return null==n?(i.filter=void 0,void this._updateLayer(i)):void(this._validate(t.validateStyle.filter,"layers."+i.id+".filter",n,null,r)||(i.filter=t.clone$1(n),this._updateLayer(i)))}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be filtered.")))},n.prototype.getFilter=function(e){return t.clone$1(this.getLayer(e).filter)},n.prototype.setLayoutProperty=function(e,n,r,i){void 0===i&&(i={}),this._checkLoaded();var o=this.getLayer(e);o?t.deepEqual(o.getLayoutProperty(n),r)||(o.setLayoutProperty(n,r,i),this._updateLayer(o)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},n.prototype.getLayoutProperty=function(e,n){var r=this.getLayer(e);if(r)return r.getLayoutProperty(n);this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style.")))},n.prototype.setPaintProperty=function(e,n,r,i){void 0===i&&(i={}),this._checkLoaded();var o=this.getLayer(e);o?t.deepEqual(o.getPaintProperty(n),r)||(o.setPaintProperty(n,r,i)&&this._updateLayer(o),this._changed=!0,this._updatedPaintProps[e]=!0):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},n.prototype.getPaintProperty=function(t,e){return this.getLayer(t).getPaintProperty(e)},n.prototype.setFeatureState=function(e,n){this._checkLoaded();var r=e.source,i=e.sourceLayer,o=this.sourceCaches[r];if(void 0!==o){var a=o.getSource().type;"geojson"===a&&i?this.fire(new t.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==a||i?(void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),o.setFeatureState(i,e.id,n)):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+r+"' does not exist in the map's style.")))},n.prototype.removeFeatureState=function(e,n){this._checkLoaded();var r=e.source,i=this.sourceCaches[r];if(void 0!==i){var o=i.getSource().type,a="vector"===o?e.sourceLayer:void 0;"vector"!==o||a?n&&"string"!=typeof e.id&&"number"!=typeof e.id?this.fire(new t.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):i.removeFeatureState(a,e.id,n):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+r+"' does not exist in the map's style.")))},n.prototype.getFeatureState=function(e){this._checkLoaded();var n=e.source,r=e.sourceLayer,i=this.sourceCaches[n];if(void 0!==i){if("vector"!==i.getSource().type||r)return void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),i.getFeatureState(r,e.id);this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},n.prototype.getTransition=function(){return t.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},n.prototype.serialize=function(){return t.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:t.mapObject(this.sourceCaches,(function(t){return t.serialize()})),layers:this._serializeLayers(this._order)},(function(t){return void 0!==t}))},n.prototype._updateLayer=function(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&"raster"!==this.sourceCaches[t.source].getSource().type&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._changed=!0},n.prototype._flattenAndSortRenderedFeatures=function(t){for(var e=this,n=function(t){return"fill-extrusion"===e._layers[t].type},r={},i=[],o=this._order.length-1;o>=0;o--){var a=this._order[o];if(n(a)){r[a]=o;for(var s=0,u=t;s=0;p--){var d=this._order[p];if(n(d))for(var A=i.length-1;A>=0;A--){var g=i[A].feature;if(r[g.layer.id] 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),$e=yn("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),tn=yn("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,0,1);}"),en=yn("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"),nn=yn("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),rn=yn("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),on=yn("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}"),an=yn("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}"),sn=yn("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\n? a_pos\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}"),un=yn("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),cn=yn("uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;\n#define PI 3.141592653589793\nvoid main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),ln=yn("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),hn=yn("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),fn=yn("uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"),pn=yn("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}"),dn=yn("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),An=yn("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}"),gn=yn("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}"),mn=yn("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}");function yn(t,e){var n=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,r=e.match(/attribute ([\w]+) ([\w]+)/g),i=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),o=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),a=o?o.concat(i):i,s={};return{fragmentSource:t=t.replace(n,(function(t,e,n,r,i){return s[i]=!0,"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nvarying "+n+" "+r+" "+i+";\n#else\nuniform "+n+" "+r+" u_"+i+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+i+"\n "+n+" "+r+" "+i+" = u_"+i+";\n#endif\n"})),vertexSource:e=e.replace(n,(function(t,e,n,r,i){var o="float"===r?"vec2":"vec4",a=i.match(/color/)?"color":o;return s[i]?"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nuniform lowp float u_"+i+"_t;\nattribute "+n+" "+o+" a_"+i+";\nvarying "+n+" "+r+" "+i+";\n#else\nuniform "+n+" "+r+" u_"+i+";\n#endif\n":"vec4"===a?"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+i+" = a_"+i+";\n#else\n "+n+" "+r+" "+i+" = u_"+i+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+i+" = unpack_mix_"+a+"(a_"+i+", u_"+i+"_t);\n#else\n "+n+" "+r+" "+i+" = u_"+i+";\n#endif\n":"define"===e?"\n#ifndef HAS_UNIFORM_u_"+i+"\nuniform lowp float u_"+i+"_t;\nattribute "+n+" "+o+" a_"+i+";\n#else\nuniform "+n+" "+r+" u_"+i+";\n#endif\n":"vec4"===a?"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+n+" "+r+" "+i+" = a_"+i+";\n#else\n "+n+" "+r+" "+i+" = u_"+i+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+n+" "+r+" "+i+" = unpack_mix_"+a+"(a_"+i+", u_"+i+"_t);\n#else\n "+n+" "+r+" "+i+" = u_"+i+";\n#endif\n"})),staticAttributes:r,staticUniforms:a}}var vn=Object.freeze({__proto__:null,prelude:We,background:qe,backgroundPattern:Xe,circle:Ze,clippingMask:Je,heatmap:Qe,heatmapTexture:Ke,collisionBox:Ye,collisionCircle:$e,debug:tn,fill:en,fillOutline:nn,fillOutlinePattern:rn,fillPattern:on,fillExtrusion:an,fillExtrusionPattern:sn,hillshadePrepare:un,hillshade:cn,line:ln,lineGradient:hn,linePattern:fn,lineSDF:pn,raster:dn,symbolIcon:An,symbolSDF:gn,symbolTextAndIcon:mn}),_n=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};function bn(t){for(var e=[],n=0;n>16,s>>16],u_pixel_coord_lower:[65535&a,65535&s]}}xn.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();_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:Vn(i.paint.get("raster-hue-rotate"))};var o,a};function Vn(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 Hn,Wn=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}},qn=function(e,n,r,i,o,a,s,u,c,l,h){var f=o.transform;return t.extend(Wn(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})},Xn=function(e,n,r,i,o,a,s,u,c,l){return t.extend(qn(e,n,r,i,o,a,s,u,!0,c,!0),{u_texsize_icon:l,u_texture_icon:1})},Zn=function(t,e,n){return{u_matrix:t,u_opacity:e,u_color:n}},Jn=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/fe(r,1,n.transform.tileZoom),u_pixel_coord_upper:[h>>16,f>>16],u_pixel_coord_lower:[65535&h,65535&f]}}(i,a,r,o),{u_matrix:e,u_opacity:n})},Qn={fillExtrusion:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_lightpos:new t.Uniform3f(e,n.u_lightpos),u_lightintensity:new t.Uniform1f(e,n.u_lightintensity),u_lightcolor:new t.Uniform3f(e,n.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,n.u_vertical_gradient),u_opacity:new t.Uniform1f(e,n.u_opacity)}},fillExtrusionPattern:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_lightpos:new t.Uniform3f(e,n.u_lightpos),u_lightintensity:new t.Uniform1f(e,n.u_lightintensity),u_lightcolor:new t.Uniform3f(e,n.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,n.u_vertical_gradient),u_height_factor:new t.Uniform1f(e,n.u_height_factor),u_image:new t.Uniform1i(e,n.u_image),u_texsize:new t.Uniform2f(e,n.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,n.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,n.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,n.u_scale),u_fade:new t.Uniform1f(e,n.u_fade),u_opacity:new t.Uniform1f(e,n.u_opacity)}},fill:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix)}},fillPattern:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_image:new t.Uniform1i(e,n.u_image),u_texsize:new t.Uniform2f(e,n.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,n.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,n.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,n.u_scale),u_fade:new t.Uniform1f(e,n.u_fade)}},fillOutline:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_world:new t.Uniform2f(e,n.u_world)}},fillOutlinePattern:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_world:new t.Uniform2f(e,n.u_world),u_image:new t.Uniform1i(e,n.u_image),u_texsize:new t.Uniform2f(e,n.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,n.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,n.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,n.u_scale),u_fade:new t.Uniform1f(e,n.u_fade)}},circle:function(e,n){return{u_camera_to_center_distance:new t.Uniform1f(e,n.u_camera_to_center_distance),u_scale_with_map:new t.Uniform1i(e,n.u_scale_with_map),u_pitch_with_map:new t.Uniform1i(e,n.u_pitch_with_map),u_extrude_scale:new t.Uniform2f(e,n.u_extrude_scale),u_device_pixel_ratio:new t.Uniform1f(e,n.u_device_pixel_ratio),u_matrix:new t.UniformMatrix4f(e,n.u_matrix)}},collisionBox:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_camera_to_center_distance:new t.Uniform1f(e,n.u_camera_to_center_distance),u_pixels_to_tile_units:new t.Uniform1f(e,n.u_pixels_to_tile_units),u_extrude_scale:new t.Uniform2f(e,n.u_extrude_scale),u_overscale_factor:new t.Uniform1f(e,n.u_overscale_factor)}},collisionCircle:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_inv_matrix:new t.UniformMatrix4f(e,n.u_inv_matrix),u_camera_to_center_distance:new t.Uniform1f(e,n.u_camera_to_center_distance),u_viewport_size:new t.Uniform2f(e,n.u_viewport_size)}},debug:function(e,n){return{u_color:new t.UniformColor(e,n.u_color),u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_overlay:new t.Uniform1i(e,n.u_overlay),u_overlay_scale:new t.Uniform1f(e,n.u_overlay_scale)}},clippingMask:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix)}},heatmap:function(e,n){return{u_extrude_scale:new t.Uniform1f(e,n.u_extrude_scale),u_intensity:new t.Uniform1f(e,n.u_intensity),u_matrix:new t.UniformMatrix4f(e,n.u_matrix)}},heatmapTexture:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_world:new t.Uniform2f(e,n.u_world),u_image:new t.Uniform1i(e,n.u_image),u_color_ramp:new t.Uniform1i(e,n.u_color_ramp),u_opacity:new t.Uniform1f(e,n.u_opacity)}},hillshade:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_image:new t.Uniform1i(e,n.u_image),u_latrange:new t.Uniform2f(e,n.u_latrange),u_light:new t.Uniform2f(e,n.u_light),u_shadow:new t.UniformColor(e,n.u_shadow),u_highlight:new t.UniformColor(e,n.u_highlight),u_accent:new t.UniformColor(e,n.u_accent)}},hillshadePrepare:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_image:new t.Uniform1i(e,n.u_image),u_dimension:new t.Uniform2f(e,n.u_dimension),u_zoom:new t.Uniform1f(e,n.u_zoom),u_unpack:new t.Uniform4f(e,n.u_unpack)}},line:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_ratio:new t.Uniform1f(e,n.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,n.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,n.u_units_to_pixels)}},lineGradient:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_ratio:new t.Uniform1f(e,n.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,n.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,n.u_units_to_pixels),u_image:new t.Uniform1i(e,n.u_image),u_image_height:new t.Uniform1f(e,n.u_image_height)}},linePattern:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_texsize:new t.Uniform2f(e,n.u_texsize),u_ratio:new t.Uniform1f(e,n.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,n.u_device_pixel_ratio),u_image:new t.Uniform1i(e,n.u_image),u_units_to_pixels:new t.Uniform2f(e,n.u_units_to_pixels),u_scale:new t.Uniform3f(e,n.u_scale),u_fade:new t.Uniform1f(e,n.u_fade)}},lineSDF:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_ratio:new t.Uniform1f(e,n.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,n.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,n.u_units_to_pixels),u_patternscale_a:new t.Uniform2f(e,n.u_patternscale_a),u_patternscale_b:new t.Uniform2f(e,n.u_patternscale_b),u_sdfgamma:new t.Uniform1f(e,n.u_sdfgamma),u_image:new t.Uniform1i(e,n.u_image),u_tex_y_a:new t.Uniform1f(e,n.u_tex_y_a),u_tex_y_b:new t.Uniform1f(e,n.u_tex_y_b),u_mix:new t.Uniform1f(e,n.u_mix)}},raster:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_tl_parent:new t.Uniform2f(e,n.u_tl_parent),u_scale_parent:new t.Uniform1f(e,n.u_scale_parent),u_buffer_scale:new t.Uniform1f(e,n.u_buffer_scale),u_fade_t:new t.Uniform1f(e,n.u_fade_t),u_opacity:new t.Uniform1f(e,n.u_opacity),u_image0:new t.Uniform1i(e,n.u_image0),u_image1:new t.Uniform1i(e,n.u_image1),u_brightness_low:new t.Uniform1f(e,n.u_brightness_low),u_brightness_high:new t.Uniform1f(e,n.u_brightness_high),u_saturation_factor:new t.Uniform1f(e,n.u_saturation_factor),u_contrast_factor:new t.Uniform1f(e,n.u_contrast_factor),u_spin_weights:new t.Uniform3f(e,n.u_spin_weights)}},symbolIcon:function(e,n){return{u_is_size_zoom_constant:new t.Uniform1i(e,n.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,n.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,n.u_size_t),u_size:new t.Uniform1f(e,n.u_size),u_camera_to_center_distance:new t.Uniform1f(e,n.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,n.u_pitch),u_rotate_symbol:new t.Uniform1i(e,n.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,n.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,n.u_fade_change),u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,n.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,n.u_coord_matrix),u_is_text:new t.Uniform1i(e,n.u_is_text),u_pitch_with_map:new t.Uniform1i(e,n.u_pitch_with_map),u_texsize:new t.Uniform2f(e,n.u_texsize),u_texture:new t.Uniform1i(e,n.u_texture)}},symbolSDF:function(e,n){return{u_is_size_zoom_constant:new t.Uniform1i(e,n.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,n.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,n.u_size_t),u_size:new t.Uniform1f(e,n.u_size),u_camera_to_center_distance:new t.Uniform1f(e,n.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,n.u_pitch),u_rotate_symbol:new t.Uniform1i(e,n.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,n.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,n.u_fade_change),u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,n.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,n.u_coord_matrix),u_is_text:new t.Uniform1i(e,n.u_is_text),u_pitch_with_map:new t.Uniform1i(e,n.u_pitch_with_map),u_texsize:new t.Uniform2f(e,n.u_texsize),u_texture:new t.Uniform1i(e,n.u_texture),u_gamma_scale:new t.Uniform1f(e,n.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,n.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,n.u_is_halo)}},symbolTextAndIcon:function(e,n){return{u_is_size_zoom_constant:new t.Uniform1i(e,n.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,n.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,n.u_size_t),u_size:new t.Uniform1f(e,n.u_size),u_camera_to_center_distance:new t.Uniform1f(e,n.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,n.u_pitch),u_rotate_symbol:new t.Uniform1i(e,n.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,n.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,n.u_fade_change),u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,n.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,n.u_coord_matrix),u_is_text:new t.Uniform1i(e,n.u_is_text),u_pitch_with_map:new t.Uniform1i(e,n.u_pitch_with_map),u_texsize:new t.Uniform2f(e,n.u_texsize),u_texsize_icon:new t.Uniform2f(e,n.u_texsize_icon),u_texture:new t.Uniform1i(e,n.u_texture),u_texture_icon:new t.Uniform1i(e,n.u_texture_icon),u_gamma_scale:new t.Uniform1f(e,n.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,n.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,n.u_is_halo)}},background:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_opacity:new t.Uniform1f(e,n.u_opacity),u_color:new t.UniformColor(e,n.u_color)}},backgroundPattern:function(e,n){return{u_matrix:new t.UniformMatrix4f(e,n.u_matrix),u_opacity:new t.Uniform1f(e,n.u_opacity),u_image:new t.Uniform1i(e,n.u_image),u_pattern_tl_a:new t.Uniform2f(e,n.u_pattern_tl_a),u_pattern_br_a:new t.Uniform2f(e,n.u_pattern_br_a),u_pattern_tl_b:new t.Uniform2f(e,n.u_pattern_tl_b),u_pattern_br_b:new t.Uniform2f(e,n.u_pattern_br_b),u_texsize:new t.Uniform2f(e,n.u_texsize),u_mix:new t.Uniform1f(e,n.u_mix),u_pattern_size_a:new t.Uniform2f(e,n.u_pattern_size_a),u_pattern_size_b:new t.Uniform2f(e,n.u_pattern_size_b),u_scale_a:new t.Uniform1f(e,n.u_scale_a),u_scale_b:new t.Uniform1f(e,n.u_scale_b),u_pixel_coord_upper:new t.Uniform2f(e,n.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,n.u_pixel_coord_lower),u_tile_units_to_pixels:new t.Uniform1f(e,n.u_tile_units_to_pixels)}}};function Kn(e,n,r,i,o,a,s){for(var u=e.context,c=u.gl,l=e.useProgram("collisionBox"),h=[],f=0,p=0,d=0;d0){var b=t.create(),x=y;t.mul(b,m.placementInvProjMatrix,e.transform.glCoordMatrix),t.mul(b,b,m.placementViewportMatrix),h.push({circleArray:_,circleOffset:p,transform:x,invTransform:b}),p=f+=_.length/4}v&&l.draw(u,c.LINES,Ot.disabled,St.disabled,e.colorModeForRenderPass(),Ct.disabled,In(y,e.transform,g),r.id,v.layoutVertexBuffer,v.indexBuffer,v.segments,null,e.transform.zoom,null,null,v.collisionVertexBuffer)}}if(s&&h.length){var w=e.useProgram("collisionCircle"),E=new t.StructArrayLayout2f1f2i16;E.resize(4*f),E._trim();for(var O=0,S=0,T=h;S=0&&(A[m.associatedIconIndex]={shiftedAnchor:E,angle:O})}else ce(m.numGlyphs,p)}if(h){d.clear();for(var T=e.icon.placedSymbolArray,C=0;C0){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}}var cr=new t.Color(1,0,0,1),lr=new t.Color(0,1,0,1),hr=new t.Color(0,0,1,1),fr=new t.Color(1,0,1,1),pr=new t.Color(0,1,1,1);function dr(t,e,n,r){gr(t,0,e+n/2,t.transform.width,n,r)}function Ar(t,e,n,r){gr(t,e-n/2,0,n,t.transform.height,r)}function gr(e,n,r,i,o,a){var s=e.context,u=s.gl;u.enable(u.SCISSOR_TEST),u.scissor(n*t.browser.devicePixelRatio,r*t.browser.devicePixelRatio,i*t.browser.devicePixelRatio,o*t.browser.devicePixelRatio),s.clear({color:a}),u.disable(u.SCISSOR_TEST)}function mr(e,n,r){var i=e.context,o=i.gl,a=r.posMatrix,s=e.useProgram("debug"),u=Ot.disabled,c=St.disabled,l=e.colorModeForRenderPass();i.activeTexture.set(o.TEXTURE0),e.emptyTexture.bind(o.LINEAR,o.CLAMP_TO_EDGE),s.draw(i,o.LINE_STRIP,u,c,l,Ct.disabled,Rn(a,t.Color.red),"$debug",e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments);var h=n.getTileByID(r.key).latestRawTileData,f=Math.floor((h&&h.byteLength||0)/1024),p=n.getTile(r).tileSize,d=512/Math.min(p,512)*(r.overscaledZ/e.transform.zoom)*.5,A=r.canonical.toString();r.overscaledZ!==r.canonical.z&&(A+=" => "+r.overscaledZ),function(t,e){t.initDebugOverlayCanvas();var n=t.debugOverlayCanvas,r=t.context.gl,i=t.debugOverlayCanvas.getContext("2d");i.clearRect(0,0,n.width,n.height),i.shadowColor="white",i.shadowBlur=2,i.lineWidth=1.5,i.strokeStyle="white",i.textBaseline="top",i.font="bold 36px Open Sans, sans-serif",i.fillText(e,5,5),i.strokeText(e,5,5),t.debugOverlayTexture.update(n),t.debugOverlayTexture.bind(r.LINEAR,r.CLAMP_TO_EDGE)}(e,A+" "+f+"kb"),s.draw(i,o.TRIANGLES,u,c,Tt.alphaBlended,Ct.disabled,Rn(a,t.Color.transparent,d),"$debug",e.debugBuffer,e.quadTriangleIndexBuffer,e.debugSegments)}var yr={symbol:function(e,n,r,i,o){if("translucent"===e.renderPass){var a=St.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;h256&&this.clearStencil(),n.setColorMode(Tt.disabled),n.setDepthMode(Ot.disabled);var i=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var o=0,a=e;o256&&this.clearStencil();var t=this.nextStencilID++,e=this.context.gl;return new St({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)},vr.prototype.stencilModeForClipping=function(t){var e=this.context.gl;return new St({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)},vr.prototype.stencilConfigForOverlap=function(t){var e,n=this.context.gl,r=t.sort((function(t,e){return e.overscaledZ-t.overscaledZ})),i=r[r.length-1].overscaledZ,o=r[0].overscaledZ-i+1;if(o>1){this.currentStencilSource=void 0,this.nextStencilID+o>256&&this.clearStencil();for(var a={},s=0;s=0;this.currentLayer--){var _=this.style._layers[i[this.currentLayer]],b=o[_.source],x=l[_.source];this._renderTileClippingMasks(_,x),this.renderLayer(this,b,_,x)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer0?e.pop():null},vr.prototype.isPatternMissing=function(t){if(!t)return!1;if(!t.from||!t.to)return!0;var e=this.imageManager.getPattern(t.from.toString()),n=this.imageManager.getPattern(t.to.toString());return!e||!n},vr.prototype.useProgram=function(t,e){this.cache=this.cache||{};var n=""+t+(e?e.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[n]||(this.cache[n]=new xn(this.context,t,vn[t],e,Qn[t],this._showOverdrawInspector)),this.cache[n]},vr.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()},vr.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)},vr.prototype.initDebugOverlayCanvas=function(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=t.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new t.Texture(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))},vr.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var _r=function(t,e){this.points=t,this.planes=e};_r.fromInvProjectionMatrix=function(e,n,r){var i=Math.pow(2,r),o=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map((function(n){return t.transformMat4([],n,e)})).map((function(e){return t.scale$1([],e,1/e[3]/n*i)})),a=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((function(e){var n=t.sub([],o[e[0]],o[e[1]]),r=t.sub([],o[e[2]],o[e[1]]),i=t.normalize([],t.cross([],n,r)),a=-t.dot(i,o[e[1]]);return i.concat(a)}));return new _r(o,a)};var br=function(e,n){this.min=e,this.max=n,this.center=t.scale$2([],t.add([],this.min,this.max),.5)};br.prototype.quadrant=function(e){for(var n=[e%2==0,e<2],r=t.clone$2(this.min),i=t.clone$2(this.max),o=0;o=0;if(0===a)return 0;a!==n.length&&(r=!1)}if(r)return 2;for(var u=0;u<3;u++){for(var c=Number.MAX_VALUE,l=-Number.MAX_VALUE,h=0;hthis.max[u]-this.min[u])return 0}return 1};var xr=function(t,e,n,r){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===r&&(r=0),isNaN(t)||t<0||isNaN(e)||e<0||isNaN(n)||n<0||isNaN(r)||r<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=e,this.left=n,this.right=r};xr.prototype.interpolate=function(e,n,r){return null!=n.top&&null!=e.top&&(this.top=t.number(e.top,n.top,r)),null!=n.bottom&&null!=e.bottom&&(this.bottom=t.number(e.bottom,n.bottom,r)),null!=n.left&&null!=e.left&&(this.left=t.number(e.left,n.left,r)),null!=n.right&&null!=e.right&&(this.right=t.number(e.right,n.right,r)),this},xr.prototype.getCenter=function(e,n){var r=t.clamp((this.left+e-this.right)/2,0,e),i=t.clamp((this.top+n-this.bottom)/2,0,n);return new t.Point(r,i)},xr.prototype.equals=function(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right},xr.prototype.clone=function(){return new xr(this.top,this.bottom,this.left,this.right)},xr.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var wr=function(e,n,r,i,o){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===o||o,this._minZoom=e||0,this._maxZoom=n||22,this._minPitch=null==r?0:r,this._maxPitch=null==i?60:i,this.setMaxBounds(),this.width=0,this.height=0,this._center=new t.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new xr,this._posMatrixCache={},this._alignedPosMatrixCache={}},Er={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};wr.prototype.clone=function(){var t=new wr(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return t.tileSize=this.tileSize,t.latRange=this.latRange,t.width=this.width,t.height=this.height,t._center=this._center,t.zoom=this.zoom,t.angle=this.angle,t._fov=this._fov,t._pitch=this._pitch,t._unmodified=this._unmodified,t._edgeInsets=this._edgeInsets.clone(),t._calcMatrices(),t},Er.minZoom.get=function(){return this._minZoom},Er.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},Er.maxZoom.get=function(){return this._maxZoom},Er.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},Er.minPitch.get=function(){return this._minPitch},Er.minPitch.set=function(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))},Er.maxPitch.get=function(){return this._maxPitch},Er.maxPitch.set=function(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))},Er.renderWorldCopies.get=function(){return this._renderWorldCopies},Er.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t},Er.worldSize.get=function(){return this.tileSize*this.scale},Er.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},Er.size.get=function(){return new t.Point(this.width,this.height)},Er.bearing.get=function(){return-this.angle/Math.PI*180},Er.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))},Er.pitch.get=function(){return this._pitch/Math.PI*180},Er.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())},Er.fov.get=function(){return this._fov/Math.PI*180},Er.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())},Er.zoom.get=function(){return this._zoom},Er.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())},Er.center.get=function(){return this._center},Er.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},Er.padding.get=function(){return this._edgeInsets.toJSON()},Er.padding.set=function(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())},Er.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},wr.prototype.isPaddingEqual=function(t){return this._edgeInsets.equals(t)},wr.prototype.interpolatePadding=function(t,e,n){this._unmodified=!1,this._edgeInsets.interpolate(t,e,n),this._constrain(),this._calcMatrices()},wr.prototype.coveringZoomLevel=function(t){var e=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,e)},wr.prototype.getVisibleUnwrappedCoordinates=function(e){var n=[new t.UnwrappedTileID(0,e)];if(this._renderWorldCopies)for(var r=this.pointCoordinate(new t.Point(0,0)),i=this.pointCoordinate(new t.Point(this.width,0)),o=this.pointCoordinate(new t.Point(this.width,this.height)),a=this.pointCoordinate(new t.Point(0,this.height)),s=Math.floor(Math.min(r.x,i.x,o.x,a.x)),u=Math.floor(Math.max(r.x,i.x,o.x,a.x)),c=s-1;c<=u+1;c++)0!==c&&n.push(new t.UnwrappedTileID(c,e));return n},wr.prototype.coveringTiles=function(e){var n=this.coveringZoomLevel(e),r=n;if(void 0!==e.minzoom&&ne.maxzoom&&(n=e.maxzoom);var i=t.MercatorCoordinate.fromLngLat(this.center),o=Math.pow(2,n),a=[o*i.x,o*i.y,0],s=_r.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,n),u=e.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(u=n);var c=function(t){return{aabb:new br([t*o,0,0],[(t+1)*o,o,0]),zoom:0,x:0,y:0,wrap:t,fullyVisible:!1}},l=[],h=[],f=n,p=e.reparseOverscaled?r:n;if(this._renderWorldCopies)for(var d=1;d<=3;d++)l.push(c(-d)),l.push(c(d));for(l.push(c(0));l.length>0;){var A=l.pop(),g=A.x,m=A.y,y=A.fullyVisible;if(!y){var v=A.aabb.intersects(s);if(0===v)continue;y=2===v}var _=A.aabb.distanceX(a),b=A.aabb.distanceY(a),x=Math.max(Math.abs(_),Math.abs(b));if(A.zoom===f||x>3+(1<=u)h.push({tileID:new t.OverscaledTileID(A.zoom===f?p:A.zoom,A.wrap,A.zoom,g,m),distanceSq:t.sqrLen([a[0]-.5-g,a[1]-.5-m])});else for(var w=0;w<4;w++){var E=(g<<1)+w%2,O=(m<<1)+(w>>1);l.push({aabb:A.aabb.quadrant(w),zoom:A.zoom+1,x:E,y:O,wrap:A.wrap,fullyVisible:y})}}return h.sort((function(t,e){return t.distanceSq-e.distanceSq})).map((function(t){return t.tileID}))},wr.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()},Er.unmodified.get=function(){return this._unmodified},wr.prototype.zoomScale=function(t){return Math.pow(2,t)},wr.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},wr.prototype.project=function(e){var n=t.clamp(e.lat,-this.maxValidLatitude,this.maxValidLatitude);return new t.Point(t.mercatorXfromLng(e.lng)*this.worldSize,t.mercatorYfromLat(n)*this.worldSize)},wr.prototype.unproject=function(e){return new t.MercatorCoordinate(e.x/this.worldSize,e.y/this.worldSize).toLngLat()},Er.point.get=function(){return this.project(this.center)},wr.prototype.setLocationAtPoint=function(e,n){var r=this.pointCoordinate(n),i=this.pointCoordinate(this.centerPoint),o=this.locationCoordinate(e),a=new t.MercatorCoordinate(o.x-(r.x-i.x),o.y-(r.y-i.y));this.center=this.coordinateLocation(a),this._renderWorldCopies&&(this.center=this.center.wrap())},wr.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},wr.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},wr.prototype.locationCoordinate=function(e){return t.MercatorCoordinate.fromLngLat(e)},wr.prototype.coordinateLocation=function(t){return t.toLngLat()},wr.prototype.pointCoordinate=function(e){var n=[e.x,e.y,0,1],r=[e.x,e.y,1,1];t.transformMat4(n,n,this.pixelMatrixInverse),t.transformMat4(r,r,this.pixelMatrixInverse);var i=n[3],o=r[3],a=n[1]/i,s=r[1]/o,u=n[2]/i,c=r[2]/o,l=u===c?0:(0-u)/(c-u);return new t.MercatorCoordinate(t.number(n[0]/i,r[0]/o,l)/this.worldSize,t.number(a,s,l)/this.worldSize)},wr.prototype.coordinatePoint=function(e){var n=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(n,n,this.pixelMatrix),new t.Point(n[0]/n[3],n[1]/n[3])},wr.prototype.getBounds=function(){return(new t.LngLatBounds).extend(this.pointLocation(new t.Point(0,0))).extend(this.pointLocation(new t.Point(this.width,0))).extend(this.pointLocation(new t.Point(this.width,this.height))).extend(this.pointLocation(new t.Point(0,this.height)))},wr.prototype.getMaxBounds=function(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new t.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},wr.prototype.setMaxBounds=function(t){t?(this.lngRange=[t.getWest(),t.getEast()],this.latRange=[t.getSouth(),t.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},wr.prototype.calculatePosMatrix=function(e,n){void 0===n&&(n=!1);var r=e.key,i=n?this._alignedPosMatrixCache:this._posMatrixCache;if(i[r])return i[r];var o=e.canonical,a=this.worldSize/this.zoomScale(o.z),s=o.x+Math.pow(2,o.z)*e.wrap,u=t.identity(new Float64Array(16));return t.translate(u,u,[s*a,o.y*a,0]),t.scale(u,u,[a/t.EXTENT,a/t.EXTENT,1]),t.multiply(u,n?this.alignedProjMatrix:this.projMatrix,u),i[r]=new Float32Array(u),i[r]},wr.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},wr.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var e,n,r,i,o=-90,a=90,s=-180,u=180,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)-oa&&(i=a-g)}if(this.lngRange){var m=p.x,y=c.x/2;m-yu&&(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}},wr.prototype._calcMatrices=function(){if(this.height){var e=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var n=Math.PI/2+this._pitch,r=this._fov*(.5+e.y/this.height),i=Math.sin(r)*this.cameraToCenterDistance/Math.sin(t.clamp(Math.PI-n-r,.01,Math.PI-.01)),o=this.point,a=o.x,s=o.y,u=1.01*(Math.cos(Math.PI/2-this._pitch)*i+this.cameraToCenterDistance),c=this.height/50,l=new Float64Array(16);t.perspective(l,this._fov,this.width/this.height,c,u),l[8]=2*-e.x/this.width,l[9]=2*e.y/this.height,t.scale(l,l,[1,-1,1]),t.translate(l,l,[0,0,-this.cameraToCenterDistance]),t.rotateX(l,l,this._pitch),t.rotateZ(l,l,this.angle),t.translate(l,l,[-a,-s,0]),this.mercatorMatrix=t.scale([],l,[this.worldSize,this.worldSize,this.worldSize]),t.scale(l,l,[1,1,t.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=l,this.invProjMatrix=t.invert([],this.projMatrix);var h=this.width%2/2,f=this.height%2/2,p=Math.cos(this.angle),d=Math.sin(this.angle),A=a-Math.round(a)+p*h+d*f,g=s-Math.round(s)+p*f+d*h,m=new Float64Array(l);if(t.translate(m,m,[A>.5?A-1:A,g>.5?g-1:g,0]),this.alignedProjMatrix=m,l=t.create(),t.scale(l,l,[this.width/2,-this.height/2,1]),t.translate(l,l,[1,-1,0]),this.labelPlaneMatrix=l,l=t.create(),t.scale(l,l,[1,-1,1]),t.translate(l,l,[-1,-1,0]),t.scale(l,l,[2/this.width,2/this.height,1]),this.glCoordMatrix=l,this.pixelMatrix=t.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(l=t.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=l,this._posMatrixCache={},this._alignedPosMatrixCache={}}},wr.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var e=this.pointCoordinate(new t.Point(0,0)),n=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(n,n,this.pixelMatrix)[3]/this.cameraToCenterDistance},wr.prototype.getCameraPoint=function(){var e=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.Point(0,e))},wr.prototype.getCameraQueryGeometry=function(e){var n=this.getCameraPoint();if(1===e.length)return[e[0],n];for(var r=n.x,i=n.y,o=n.x,a=n.y,s=0,u=e;s=3&&!t.some((function(t){return isNaN(t)}))){var e=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:e,pitch:+(t[4]||0)}),!0}return!1},Or.prototype._updateHashUnthrottled=function(){var e=t.window.location.href.replace(/(#.+)?$/,this.getHashString());try{t.window.history.replaceState(t.window.history.state,null,e)}catch(t){}};var Sr={linearity:.3,easing:t.bezier(0,0,.3,1)},Tr=t.extend({deceleration:2500,maxSpeed:1400},Sr),Cr=t.extend({deceleration:20,maxSpeed:1400},Sr),Pr=t.extend({deceleration:1e3,maxSpeed:360},Sr),Mr=t.extend({deceleration:1e3,maxSpeed:90},Sr),Ir=function(t){this._map=t,this.clear()};function Br(t,e){(!t.duration||t.duration0&&n-e[0].time>160;)e.shift()},Ir.prototype._onMoveEnd=function(e){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var n={zoom:0,bearing:0,pitch:0,pan:new t.Point(0,0),pinchAround:void 0,around:void 0},r=0,i=this._inertiaBuffer;r=this._clickTolerance||this._map.fire(new kr(t.type,this._map,t))},jr.prototype.dblclick=function(t){return this._firePreventable(new kr(t.type,this._map,t))},jr.prototype.mouseover=function(t){this._map.fire(new kr(t.type,this._map,t))},jr.prototype.mouseout=function(t){this._map.fire(new kr(t.type,this._map,t))},jr.prototype.touchstart=function(t){return this._firePreventable(new Dr(t.type,this._map,t))},jr.prototype.touchmove=function(t){this._map.fire(new Dr(t.type,this._map,t))},jr.prototype.touchend=function(t){this._map.fire(new Dr(t.type,this._map,t))},jr.prototype.touchcancel=function(t){this._map.fire(new Dr(t.type,this._map,t))},jr.prototype._firePreventable=function(t){if(this._map.fire(t),t.defaultPrevented)return{}},jr.prototype.isEnabled=function(){return!0},jr.prototype.isActive=function(){return!1},jr.prototype.enable=function(){},jr.prototype.disable=function(){};var Fr=function(t){this._map=t};Fr.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},Fr.prototype.mousemove=function(t){this._map.fire(new kr(t.type,this._map,t))},Fr.prototype.mousedown=function(){this._delayContextMenu=!0},Fr.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new kr("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},Fr.prototype.contextmenu=function(t){this._delayContextMenu?this._contextMenuEvent=t:this._map.fire(new kr(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()},Fr.prototype.isEnabled=function(){return!0},Fr.prototype.isActive=function(){return!1},Fr.prototype.enable=function(){},Fr.prototype.disable=function(){};var zr=function(t,e){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=e.clickTolerance||1};function Ur(t,e){for(var n={},r=0;rthis.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=e.timeStamp),r.length===this.numTouches&&(this.centroid=function(e){for(var n=new t.Point(0,0),r=0,i=e;r30)&&(this.aborted=!0)}}},Nr.prototype.touchend=function(t,e,n){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),0===n.length){var r=!this.aborted&&this.centroid;if(this.reset(),r)return r}};var Gr=function(t){this.singleTap=new Nr(t),this.numTaps=t.numTaps,this.reset()};Gr.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},Gr.prototype.touchstart=function(t,e,n){this.singleTap.touchstart(t,e,n)},Gr.prototype.touchmove=function(t,e,n){this.singleTap.touchmove(t,e,n)},Gr.prototype.touchend=function(t,e,n){var r=this.singleTap.touchend(t,e,n);if(r){var i=t.timeStamp-this.lastTime<500,o=!this.lastTap||this.lastTap.dist(r)<30;if(i&&o||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=r,this.count===this.numTaps)return this.reset(),r}};var Vr=function(){this._zoomIn=new Gr({numTouches:1,numTaps:2}),this._zoomOut=new Gr({numTouches:2,numTaps:1}),this.reset()};Vr.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},Vr.prototype.touchstart=function(t,e,n){this._zoomIn.touchstart(t,e,n),this._zoomOut.touchstart(t,e,n)},Vr.prototype.touchmove=function(t,e,n){this._zoomIn.touchmove(t,e,n),this._zoomOut.touchmove(t,e,n)},Vr.prototype.touchend=function(t,e,n){var r=this,i=this._zoomIn.touchend(t,e,n),o=this._zoomOut.touchend(t,e,n);return i?(this._active=!0,t.preventDefault(),setTimeout((function(){return r.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()+1,around:e.unproject(i)},{originalEvent:t})}}):o?(this._active=!0,t.preventDefault(),setTimeout((function(){return r.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()-1,around:e.unproject(o)},{originalEvent:t})}}):void 0},Vr.prototype.touchcancel=function(){this.reset()},Vr.prototype.enable=function(){this._enabled=!0},Vr.prototype.disable=function(){this._enabled=!1,this.reset()},Vr.prototype.isEnabled=function(){return this._enabled},Vr.prototype.isActive=function(){return this._active};var Hr={0:1,2:2},Wr=function(t){this.reset(),this._clickTolerance=t.clickTolerance||1};Wr.prototype.blur=function(){this.reset()},Wr.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},Wr.prototype._correctButton=function(t,e){return!1},Wr.prototype._move=function(t,e){return{}},Wr.prototype.mousedown=function(t,e){if(!this._lastPoint){var r=n.mouseButton(t);this._correctButton(t,r)&&(this._lastPoint=e,this._eventButton=r)}},Wr.prototype.mousemoveWindow=function(t,e){var n=this._lastPoint;if(n)if(t.preventDefault(),function(t,e){var n=Hr[e];return void 0===t.buttons||(t.buttons&n)!==n}(t,this._eventButton))this.reset();else if(this._moved||!(e.dist(n)0&&(this._active=!0);var i=Ur(r,n),o=new t.Point(0,0),a=new t.Point(0,0),s=0;for(var u in i){var c=i[u],l=this._touches[u];l&&(o._add(c),a._add(c.sub(l)),s++,i[u]=c)}if(this._touches=i,!(sMath.abs(t.x)}var ri=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.reset=function(){t.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},e.prototype._start=function(t){this._lastPoints=t,ni(t[0].sub(t[1]))&&(this._valid=!1)},e.prototype._move=function(t,e,n){var r=t[0].sub(this._lastPoints[0]),i=t[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(r,i,n.timeStamp),this._valid)return this._lastPoints=t,this._active=!0,{pitchDelta:(r.y+i.y)/2*-.5}},e.prototype.gestureBeginsVertically=function(t,e,n){if(void 0!==this._valid)return this._valid;var r=t.mag()>=2,i=e.mag()>=2;if(r||i){if(!r||!i)return void 0===this._firstMove&&(this._firstMove=n),n-this._firstMove<100&&void 0;var o=t.y>0==e.y>0;return ni(t)&&ni(e)&&o}},e}(Qr),ii={panStep:100,bearingStep:15,pitchStep:10},oi=function(){var t=ii;this._panStep=t.panStep,this._bearingStep=t.bearingStep,this._pitchStep=t.pitchStep,this._rotationDisabled=!1};function ai(t){return t*(2-t)}oi.prototype.blur=function(){this.reset()},oi.prototype.reset=function(){this._active=!1},oi.prototype.keydown=function(t){var e=this;if(!(t.altKey||t.ctrlKey||t.metaKey)){var n=0,r=0,i=0,o=0,a=0;switch(t.keyCode){case 61:case 107:case 171:case 187:n=1;break;case 189:case 109:case 173:n=-1;break;case 37:t.shiftKey?r=-1:(t.preventDefault(),o=-1);break;case 39:t.shiftKey?r=1:(t.preventDefault(),o=1);break;case 38:t.shiftKey?i=1:(t.preventDefault(),a=-1);break;case 40:t.shiftKey?i=-1:(t.preventDefault(),a=1);break;default:return}return this._rotationDisabled&&(r=0,i=0),{cameraAnimation:function(s){var u=s.getZoom();s.easeTo({duration:300,easeId:"keyboardHandler",easing:ai,zoom:n?Math.round(u)+n*(t.shiftKey?2:1):u,bearing:s.getBearing()+r*e._bearingStep,pitch:s.getPitch()+i*e._pitchStep,offset:[-o*e._panStep,-a*e._panStep],center:s.getCenter()},{originalEvent:t})}}}},oi.prototype.enable=function(){this._enabled=!0},oi.prototype.disable=function(){this._enabled=!1,this.reset()},oi.prototype.isEnabled=function(){return this._enabled},oi.prototype.isActive=function(){return this._active},oi.prototype.disableRotation=function(){this._rotationDisabled=!0},oi.prototype.enableRotation=function(){this._rotationDisabled=!1};var si=function(e,n){this._map=e,this._el=e.getCanvasContainer(),this._handler=n,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,t.bindAll(["_onTimeout"],this)};si.prototype.setZoomRate=function(t){this._defaultZoomRate=t},si.prototype.setWheelZoomRate=function(t){this._wheelZoomRate=t},si.prototype.isEnabled=function(){return!!this._enabled},si.prototype.isActive=function(){return!!this._active||void 0!==this._finishTimeout},si.prototype.isZooming=function(){return!!this._zooming},si.prototype.enable=function(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},si.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},si.prototype.wheel=function(e){if(this.isEnabled()){var n=e.deltaMode===t.window.WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY,r=t.browser.now(),i=r-(this._lastWheelEventTime||0);this._lastWheelEventTime=r,0!==n&&n%4.000244140625==0?this._type="wheel":0!==n&&Math.abs(n)<4?this._type="trackpad":i>400?(this._type=null,this._lastValue=n,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(i*n)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,n+=this._lastValue)),e.shiftKey&&n&&(n/=4),this._type&&(this._lastWheelEvent=e,this._delta-=n,this._active||this._start(e)),e.preventDefault()}},si.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)},si.prototype._start=function(e){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var r=n.mousePos(this._el,e);this._around=t.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(r)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},si.prototype.renderFrame=function(){var e=this;if(this._frameId&&(this._frameId=null,this.isActive())){var n=this._map.transform;if(0!==this._delta){var r="wheel"===this._type&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,i=2/(1+Math.exp(-Math.abs(this._delta*r)));this._delta<0&&0!==i&&(i=1/i);var o="number"==typeof this._targetZoom?n.zoomScale(this._targetZoom):n.scale;this._targetZoom=Math.min(n.maxZoom,Math.max(n.minZoom,n.scaleZoom(o*i))),"wheel"===this._type&&(this._startZoom=n.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var a,s="number"==typeof this._targetZoom?this._targetZoom:n.zoom,u=this._startZoom,c=this._easing,l=!1;if("wheel"===this._type&&u&&c){var h=Math.min((t.browser.now()-this._lastWheelEventTime)/200,1),f=c(h);a=t.number(u,s,f),h<1?this._frameId||(this._frameId=!0):l=!0}else a=s,l=!0;return this._active=!0,l&&(this._active=!1,this._finishTimeout=setTimeout((function(){e._zooming=!1,e._handler._triggerRenderFrame(),delete e._targetZoom,delete e._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!l,zoomDelta:a-n.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},si.prototype._smoothOutEasing=function(e){var n=t.ease;if(this._prevEase){var r=this._prevEase,i=(t.browser.now()-r.start)/r.duration,o=r.easing(i+.01)-r.easing(i),a=.27/Math.sqrt(o*o+1e-4)*.01,s=Math.sqrt(.0729-a*a);n=t.bezier(a,s,.25,1)}return this._prevEase={start:t.browser.now(),duration:e,easing:n},n},si.prototype.blur=function(){this.reset()},si.prototype.reset=function(){this._active=!1};var ui=function(t,e){this._clickZoom=t,this._tapZoom=e};ui.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},ui.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},ui.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},ui.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var ci=function(){this.reset()};ci.prototype.reset=function(){this._active=!1},ci.prototype.blur=function(){this.reset()},ci.prototype.dblclick=function(t,e){return t.preventDefault(),{cameraAnimation:function(n){n.easeTo({duration:300,zoom:n.getZoom()+(t.shiftKey?-1:1),around:n.unproject(e)},{originalEvent:t})}}},ci.prototype.enable=function(){this._enabled=!0},ci.prototype.disable=function(){this._enabled=!1,this.reset()},ci.prototype.isEnabled=function(){return this._enabled},ci.prototype.isActive=function(){return this._active};var li=function(){this._tap=new Gr({numTouches:1,numTaps:1}),this.reset()};li.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},li.prototype.touchstart=function(t,e,n){this._swipePoint||(this._tapTime&&t.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?n.length>0&&(this._swipePoint=e[0],this._swipeTouch=n[0].identifier):this._tap.touchstart(t,e,n))},li.prototype.touchmove=function(t,e,n){if(this._tapTime){if(this._swipePoint){if(n[0].identifier!==this._swipeTouch)return;var r=e[0],i=r.y-this._swipePoint.y;return this._swipePoint=r,t.preventDefault(),this._active=!0,{zoomDelta:i/128}}}else this._tap.touchmove(t,e,n)},li.prototype.touchend=function(t,e,n){this._tapTime?this._swipePoint&&0===n.length&&this.reset():this._tap.touchend(t,e,n)&&(this._tapTime=t.timeStamp)},li.prototype.touchcancel=function(){this.reset()},li.prototype.enable=function(){this._enabled=!0},li.prototype.disable=function(){this._enabled=!1,this.reset()},li.prototype.isEnabled=function(){return this._enabled},li.prototype.isActive=function(){return this._active};var hi=function(t,e,n){this._el=t,this._mousePan=e,this._touchPan=n};hi.prototype.enable=function(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},hi.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},hi.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},hi.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var fi=function(t,e,n){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=e,this._mousePitch=n};fi.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},fi.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},fi.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},fi.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var pi=function(t,e,n,r){this._el=t,this._touchZoom=e,this._touchRotate=n,this._tapDragZoom=r,this._rotationDisabled=!1,this._enabled=!0};pi.prototype.enable=function(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},pi.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},pi.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},pi.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},pi.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},pi.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var di=function(t){return t.zoom||t.drag||t.pitch||t.rotate},Ai=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(t.Event);function gi(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta}var mi=function(e,r){this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Ir(e),this._bearingSnap=r.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(r),t.bindAll(["handleEvent","handleWindowEvent"],this);var i=this._el;this._listeners=[[i,"touchstart",{passive:!0}],[i,"touchmove",{passive:!1}],[i,"touchend",void 0],[i,"touchcancel",void 0],[i,"mousedown",void 0],[i,"mousemove",void 0],[i,"mouseup",void 0],[t.window.document,"mousemove",{capture:!0}],[t.window.document,"mouseup",void 0],[i,"mouseover",void 0],[i,"mouseout",void 0],[i,"dblclick",void 0],[i,"click",void 0],[i,"keydown",{capture:!1}],[i,"keyup",void 0],[i,"wheel",{passive:!1}],[i,"contextmenu",void 0],[t.window,"blur",void 0]];for(var o=0,a=this._listeners;oo?Math.min(2,b):Math.max(.5,b),x=Math.pow(g,1-e),w=i.unproject(v.add(_.mult(e*x)).mult(A));i.setLocationAtPoint(i.renderWorldCopies?w.wrap():w,d)}r._fireMoveEvents(n)}),(function(t){r._afterEase(n,t)}),e),this},n.prototype._prepareEase=function(e,n,r){void 0===r&&(r={}),this._moving=!0,n||r.moving||this.fire(new t.Event("movestart",e)),this._zooming&&!r.zooming&&this.fire(new t.Event("zoomstart",e)),this._rotating&&!r.rotating&&this.fire(new t.Event("rotatestart",e)),this._pitching&&!r.pitching&&this.fire(new t.Event("pitchstart",e))},n.prototype._fireMoveEvents=function(e){this.fire(new t.Event("move",e)),this._zooming&&this.fire(new t.Event("zoom",e)),this._rotating&&this.fire(new t.Event("rotate",e)),this._pitching&&this.fire(new t.Event("pitch",e))},n.prototype._afterEase=function(e,n){if(!this._easeId||!n||this._easeId!==n){delete this._easeId;var r=this._zooming,i=this._rotating,o=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,r&&this.fire(new t.Event("zoomend",e)),i&&this.fire(new t.Event("rotateend",e)),o&&this.fire(new t.Event("pitchend",e)),this.fire(new t.Event("moveend",e))}},n.prototype.flyTo=function(e,n){var r=this;if(!e.essential&&t.browser.prefersReducedMotion){var i=t.pick(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(i,n)}this.stop(),e=t.extend({offset:[0,0],speed:1.2,curve:1.42,easing:t.ease},e);var o=this.transform,a=this.getZoom(),s=this.getBearing(),u=this.getPitch(),c=this.getPadding(),l="zoom"in e?t.clamp(+e.zoom,o.minZoom,o.maxZoom):a,h="bearing"in e?this._normalizeBearing(e.bearing,s):s,f="pitch"in e?+e.pitch:u,p="padding"in e?e.padding:o.padding,d=o.zoomScale(l-a),A=t.Point.convert(e.offset),g=o.centerPoint.add(A),m=o.pointLocation(g),y=t.LngLat.convert(e.center||m);this._normalizeCenter(y);var v=o.project(m),_=o.project(y).sub(v),b=e.curve,x=Math.max(o.width,o.height),w=x/d,E=_.mag();if("minZoom"in e){var O=t.clamp(Math.min(e.minZoom,a,l),o.minZoom,o.maxZoom),S=x/o.zoomScale(O-a);b=Math.sqrt(S/E*2)}var T=b*b;function C(t){var e=(w*w-x*x+(t?-1:1)*T*T*E*E)/(2*(t?w:x)*T*E);return Math.log(Math.sqrt(e*e+1)-e)}function P(t){return(Math.exp(t)-Math.exp(-t))/2}function M(t){return(Math.exp(t)+Math.exp(-t))/2}var I=C(0),B=function(t){return M(I)/M(I+b*t)},R=function(t){return x*((M(I)*(P(e=I+b*t)/M(e))-P(I))/T)/E;var e},k=(C(1)-I)/b;if(Math.abs(E)<1e-6||!isFinite(k)){if(Math.abs(x-w)<1e-6)return this.easeTo(e,n);var D=we.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=s!==h,this._pitching=f!==u,this._padding=!o.isPaddingEqual(p),this._prepareEase(n,!1),this._ease((function(e){var i=e*k,d=1/B(i);o.zoom=1===e?l:a+o.scaleZoom(d),r._rotating&&(o.bearing=t.number(s,h,e)),r._pitching&&(o.pitch=t.number(u,f,e)),r._padding&&(o.interpolatePadding(c,p,e),g=o.centerPoint.add(A));var m=1===e?y:o.unproject(v.add(_.mult(R(i))).mult(d));o.setLocationAtPoint(o.renderWorldCopies?m.wrap():m,g),r._fireMoveEvents(n)}),(function(){return r._afterEase(n)}),e),this},n.prototype.isEasing=function(){return!!this._easeFrameId},n.prototype.stop=function(){return this._stop()},n.prototype._stop=function(t,e){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var n=this._onEaseEnd;delete this._onEaseEnd,n.call(this,e)}if(!t){var r=this.handlers;r&&r.stop(!1)}return this},n.prototype._ease=function(e,n,r){!1===r.animate||0===r.duration?(e(1),n()):(this._easeStart=t.browser.now(),this._easeOptions=r,this._onEaseFrame=e,this._onEaseEnd=n,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},n.prototype._renderFrameCallback=function(){var e=Math.min((t.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(e)),e<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},n.prototype._normalizeBearing=function(e,n){e=t.wrap(e,-180,180);var r=Math.abs(e-n);return Math.abs(e-360-n)180?-360:n<-180?360:0}},n}(t.Evented),vi=function(e){void 0===e&&(e={}),this.options=e,t.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};vi.prototype.getDefaultPosition=function(){return"bottom-right"},vi.prototype.onAdd=function(t){var e=this.options&&this.options.compact;return this._map=t,this._container=n.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=n.create("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=n.create("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),e&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===e&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},vi.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},vi.prototype._setElementTitle=function(t,e){var n=this._map._getUIString("AttributionControl."+e);t.title=n,t.setAttribute("aria-label",n)},vi.prototype._toggleAttribution=function(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","true"))},vi.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=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)}},vi.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var _i=function(){t.bindAll(["_updateLogo"],this),t.bindAll(["_updateCompact"],this)};_i.prototype.onAdd=function(t){this._map=t,this._container=n.create("div","mapboxgl-ctrl");var e=n.create("a","mapboxgl-ctrl-logo");return e.target="_blank",e.rel="noopener nofollow",e.href="https://www.mapbox.com/",e.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),e.setAttribute("rel","noopener nofollow"),this._container.appendChild(e),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},_i.prototype.onRemove=function(){n.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},_i.prototype.getDefaultPosition=function(){return"bottom-left"},_i.prototype._updateLogo=function(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")},_i.prototype._logoRequired=function(){if(this._map.style){var t=this._map.style.sourceCaches;for(var e in t)if(t[e].getSource().mapbox_logo)return!0;return!1}},_i.prototype._updateCompact=function(){var t=this._container.children;if(t.length){var e=t[0];this._map.getCanvasContainer().offsetWidth<250?e.classList.add("mapboxgl-compact"):e.classList.remove("mapboxgl-compact")}};var bi=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};bi.prototype.add=function(t){var e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e},bi.prototype.remove=function(t){for(var e=this._currentlyRunning,n=0,r=e?this._queue.concat(e):this._queue;ne.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=e.minPitch&&null!=e.maxPitch&&e.minPitch>e.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=e.minPitch&&e.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=e.maxPitch&&e.maxPitch>60)throw new Error("maxPitch must be less than or equal to 60");var i=new wr(e.minZoom,e.maxZoom,e.minPitch,e.maxPitch,e.renderWorldCopies);if(r.call(this,i,e),this._interactive=e.interactive,this._maxTileCacheSize=e.maxTileCacheSize,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=e.preserveDrawingBuffer,this._antialias=e.antialias,this._trackResize=e.trackResize,this._bearingSnap=e.bearingSnap,this._refreshExpiredTiles=e.refreshExpiredTiles,this._fadeDuration=e.fadeDuration,this._crossSourceCollisions=e.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=e.collectResourceTiming,this._renderTaskQueue=new bi,this._controls=[],this._mapId=t.uniqueId(),this._locale=t.extend({},xi,e.locale),this._clickTolerance=e.clickTolerance,this._requestManager=new t.RequestManager(e.transformRequest,e.accessToken),"string"==typeof e.container){if(this._container=t.window.document.getElementById(e.container),!this._container)throw new Error("Container '"+e.container+"' not found.")}else{if(!(e.container instanceof Ei))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container}if(e.maxBounds&&this.setMaxBounds(e.maxBounds),t.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",(function(){return n._update(!1)})),this.on("moveend",(function(){return n._update(!1)})),this.on("zoom",(function(){return n._update(!0)})),void 0!==t.window&&(t.window.addEventListener("online",this._onWindowOnline,!1),t.window.addEventListener("resize",this._onWindowResize,!1),t.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new mi(this,e),this._hash=e.hash&&new Or("string"==typeof e.hash&&e.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),e.bounds&&(this.resize(),this.fitBounds(e.bounds,t.extend({},e.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=e.localIdeographFontFamily,e.style&&this.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new vi({customAttribution:e.customAttribution})),this.addControl(new _i,e.logoPosition),this.on("style.load",(function(){n.transform.unmodified&&n.jumpTo(n.style.stylesheet)})),this.on("data",(function(e){n._update("style"===e.dataType),n.fire(new t.Event(e.dataType+"data",e))})),this.on("dataloading",(function(e){n.fire(new t.Event(e.dataType+"dataloading",e))}))}r&&(i.__proto__=r),(i.prototype=Object.create(r&&r.prototype)).constructor=i;var o={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return i.prototype._getMapId=function(){return this._mapId},i.prototype.addControl=function(e,n){if(void 0===n&&(n=e.getDefaultPosition?e.getDefaultPosition():"top-right"),!e||!e.onAdd)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var r=e.onAdd(this);this._controls.push(e);var i=this._controlPositions[n];return-1!==n.indexOf("bottom")?i.insertBefore(r,i.firstChild):i.appendChild(r),this},i.prototype.removeControl=function(e){if(!e||!e.onRemove)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var n=this._controls.indexOf(e);return n>-1&&this._controls.splice(n,1),e.onRemove(this),this},i.prototype.hasControl=function(t){return this._controls.indexOf(t)>-1},i.prototype.resize=function(e){var n=this._containerDimensions(),r=n[0],i=n[1];if(r===this.transform.width&&i===this.transform.height)return this;this._resizeCanvas(r,i),this.transform.resize(r,i),this.painter.resize(r,i);var o=!this._moving;return o&&this.fire(new t.Event("movestart",e)).fire(new t.Event("move",e)),this.fire(new t.Event("resize",e)),o&&this.fire(new t.Event("moveend",e)),this},i.prototype.getBounds=function(){return this.transform.getBounds()},i.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},i.prototype.setMaxBounds=function(e){return this.transform.setMaxBounds(t.LngLatBounds.convert(e)),this._update()},i.prototype.setMinZoom=function(t){if((t=null==t?-2:t)>=-2&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()=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()60)throw new Error("maxPitch must be less than or equal to 60");if(t>=this.transform.minPitch)return this.transform.maxPitch=t,this._update(),this.getPitch()>t&&this.setPitch(t),this;throw new Error("maxPitch must be greater than the current minPitch")},i.prototype.getMaxPitch=function(){return this.transform.maxPitch},i.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},i.prototype.setRenderWorldCopies=function(t){return this.transform.renderWorldCopies=t,this._update()},i.prototype.project=function(e){return this.transform.locationPoint(t.LngLat.convert(e))},i.prototype.unproject=function(e){return this.transform.pointLocation(t.Point.convert(e))},i.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},i.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},i.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},i.prototype._createDelegatedListener=function(t,e,n){var r,i=this;if("mouseenter"===t||"mouseover"===t){var o=!1;return{layer:e,listener:n,delegates:{mousemove:function(r){var a=i.getLayer(e)?i.queryRenderedFeatures(r.point,{layers:[e]}):[];a.length?o||(o=!0,n.call(i,new kr(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 kr(t,i,r.originalEvent)))},mouseout:function(e){a&&(a=!1,n.call(i,new kr(t,i,e.originalEvent)))}}}}return{layer:e,listener:n,delegates:(r={},r[t]=function(t){var r=i.getLayer(e)?i.queryRenderedFeatures(t.point,{layers:[e]}):[];r.length&&(t.features=r,n.call(i,t),delete t.features)},r)}},i.prototype.on=function(t,e,n){if(void 0===n)return r.prototype.on.call(this,t,e);var i=this._createDelegatedListener(t,e,n);for(var o in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(i),i.delegates)this.on(o,i.delegates[o]);return this},i.prototype.once=function(t,e,n){if(void 0===n)return r.prototype.once.call(this,t,e);var i=this._createDelegatedListener(t,e,n);for(var o in i.delegates)this.once(o,i.delegates[o]);return this},i.prototype.off=function(t,e,n){var i=this;return void 0===n?r.prototype.off.call(this,t,e):(this._delegatedListeners&&this._delegatedListeners[t]&&function(r){for(var o=r[t],a=0;a180;){var s=r.locationPoint(e);if(s.x>=0&&s.y>=0&&s.x<=r.width&&s.y<=r.height)break;e.lng>r.center.lng?e.lng-=360:e.lng+=360}return e}Ii.prototype.down=function(t,e){this.mouseRotate.mousedown(t,e),this.mousePitch&&this.mousePitch.mousedown(t,e),n.disableDrag()},Ii.prototype.move=function(t,e){var n=this.map,r=this.mouseRotate.mousemoveWindow(t,e);if(r&&r.bearingDelta&&n.setBearing(n.getBearing()+r.bearingDelta),this.mousePitch){var i=this.mousePitch.mousemoveWindow(t,e);i&&i.pitchDelta&&n.setPitch(n.getPitch()+i.pitchDelta)}},Ii.prototype.off=function(){var t=this.element;n.removeEventListener(t,"mousedown",this.mousedown),n.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),n.removeEventListener(t,"touchmove",this.touchmove),n.removeEventListener(t,"touchend",this.touchend),n.removeEventListener(t,"touchcancel",this.reset),this.offTemp()},Ii.prototype.offTemp=function(){n.enableDrag(),n.removeEventListener(t.window,"mousemove",this.mousemove),n.removeEventListener(t.window,"mouseup",this.mouseup)},Ii.prototype.mousedown=function(e){this.down(t.extend({},e,{ctrlKey:!0,preventDefault:function(){return e.preventDefault()}}),n.mousePos(this.element,e)),n.addEventListener(t.window,"mousemove",this.mousemove),n.addEventListener(t.window,"mouseup",this.mouseup)},Ii.prototype.mousemove=function(t){this.move(t,n.mousePos(this.element,t))},Ii.prototype.mouseup=function(t){this.mouseRotate.mouseupWindow(t),this.mousePitch&&this.mousePitch.mouseupWindow(t),this.offTemp()},Ii.prototype.touchstart=function(t){1!==t.targetTouches.length?this.reset():(this._startPos=this._lastPos=n.touchPos(this.element,t.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return t.preventDefault()}},this._startPos))},Ii.prototype.touchmove=function(t){1!==t.targetTouches.length?this.reset():(this._lastPos=n.touchPos(this.element,t.targetTouches)[0],this.move({preventDefault:function(){return t.preventDefault()}},this._lastPos))},Ii.prototype.touchend=function(t){0===t.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)=n}this._isDragging&&(this._pos=e.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new t.Event("dragstart"))),this.fire(new t.Event("drag")))},r.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new t.Event("dragend")),this._state="inactive"},r.prototype._addDragHandler=function(t){this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),this._pointerdownPos=t.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},r.prototype.setDraggable=function(t){return this._draggable=!!t,this._map&&(t?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},r.prototype.isDraggable=function(){return this._draggable},r.prototype.setRotation=function(t){return this._rotation=t||0,this._update(),this},r.prototype.getRotation=function(){return this._rotation},r.prototype.setRotationAlignment=function(t){return this._rotationAlignment=t||"auto",this._update(),this},r.prototype.getRotationAlignment=function(){return this._rotationAlignment},r.prototype.setPitchAlignment=function(t){return this._pitchAlignment=t&&"auto"!==t?t:this._rotationAlignment,this._update(),this},r.prototype.getPitchAlignment=function(){return this._pitchAlignment},r}(t.Evented),ji={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Fi=0,zi=!1,Ui=function(e){function r(n){e.call(this),this.options=t.extend({},ji,n),t.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.onAdd=function(e){var r;return this._map=e,this._container=n.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),r=this._setupUI,void 0!==Di?r(Di):void 0!==t.window.navigator.permissions?t.window.navigator.permissions.query({name:"geolocation"}).then((function(t){r(Di="denied"!==t.state)})):r(Di=!!t.window.navigator.geolocation),this._container},r.prototype.onRemove=function(){void 0!==this._geolocationWatchID&&(t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),n.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Fi=0,zi=!1},r.prototype._isOutOfMapMaxBounds=function(t){var e=this._map.getMaxBounds(),n=t.coords;return e&&(n.longitudee.getEast()||n.latitudee.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._map){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new t.Event("outofmaxbounds",e)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(e),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("geolocate",e)),this._finish()}},r.prototype._updateCamera=function(e){var n=new t.LngLat(e.coords.longitude,e.coords.latitude),r=e.coords.accuracy,i=this._map.getBearing(),o=t.extend({bearing:i},this.options.fitBoundsOptions);this._map.fitBounds(n.toBounds(r),o,{geolocateSource:!0})},r.prototype._updateMarker=function(e){if(e){var n=new t.LngLat(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(n).addTo(this._map),this._userLocationDotMarker.setLngLat(n).addTo(this._map),this._accuracy=e.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},r.prototype._updateCircleRadius=function(){var t=this._map._container.clientHeight/2,e=this._map.unproject([0,t]),n=this._map.unproject([1,t]),r=e.distanceTo(n),i=Math.ceil(2*this._accuracy/r);this._circleElement.style.width=i+"px",this._circleElement.style.height=i+"px"},r.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},r.prototype._onError=function(e){if(this._map){if(this.options.trackUserLocation)if(1===e.code){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var n=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=n,this._geolocateButton.setAttribute("aria-label",n),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===e.code&&zi)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("error",e)),this._finish()}},r.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},r.prototype._setupUI=function(e){var r=this;if(this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this._geolocateButton=n.create("button","mapboxgl-ctrl-geolocate",this._container),n.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",!1===e){t.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var i=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i)}else{var o=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=o,this._geolocateButton.setAttribute("aria-label",o)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=n.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Li(this._dotElement),this._circleElement=n.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Li({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",(function(e){e.geolocateSource||"ACTIVE_LOCK"!==r._watchState||e.originalEvent&&"resize"===e.originalEvent.type||(r._watchState="BACKGROUND",r._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),r._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),r.fire(new t.Event("trackuserlocationend")))}))},r.prototype.trigger=function(){if(!this._setup)return t.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new t.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Fi--,zi=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new t.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new t.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){var e;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++Fi>1?(e={maximumAge:6e5,timeout:0},zi=!0):(e=this.options.positionOptions,zi=!1),this._geolocationWatchID=t.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,e)}}else t.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},r.prototype._clearWatch=function(){t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},r}(t.Evented),Ni={maxWidth:100,unit:"metric"},Gi=function(e){this.options=t.extend({},Ni,e),t.bindAll(["_onMove","setUnit"],this)};function Vi(t,e,n){var r=n&&n.maxWidth||100,i=t._container.clientHeight/2,o=t.unproject([0,i]),a=t.unproject([r,i]),s=o.distanceTo(a);if(n&&"imperial"===n.unit){var u=3.2808*s;u>5280?Hi(e,r,u/5280,t._getUIString("ScaleControl.Miles")):Hi(e,r,u,t._getUIString("ScaleControl.Feet"))}else n&&"nautical"===n.unit?Hi(e,r,s/1852,t._getUIString("ScaleControl.NauticalMiles")):s>=1e3?Hi(e,r,s/1e3,t._getUIString("ScaleControl.Kilometers")):Hi(e,r,s,t._getUIString("ScaleControl.Meters"))}function Hi(t,e,n,r){var i,o,a,s=(i=n,(o=Math.pow(10,(""+Math.floor(i)).length-1))*(a=(a=i/o)>=10?10:a>=5?5:a>=3?3:a>=2?2:a>=1?1:function(t){var e=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*e)/e}(a)));t.style.width=e*(s/n)+"px",t.innerHTML=s+" "+r}Gi.prototype.getDefaultPosition=function(){return"bottom-left"},Gi.prototype._onMove=function(){Vi(this._map,this._container,this.options)},Gi.prototype.onAdd=function(t){return this._map=t,this._container=n.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},Gi.prototype.onRemove=function(){n.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},Gi.prototype.setUnit=function(t){this.options.unit=t,Vi(this._map,this._container,this.options)};var Wi=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")};Wi.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},Wi.prototype.onRemove=function(){n.remove(this._controlContainer),this._map=null,t.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},Wi.prototype._checkFullscreenSupport=function(){return!!(t.window.document.fullscreenEnabled||t.window.document.mozFullScreenEnabled||t.window.document.msFullscreenEnabled||t.window.document.webkitFullscreenEnabled)},Wi.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)},Wi.prototype._updateTitle=function(){var t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t},Wi.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},Wi.prototype._isFullscreen=function(){return this._fullscreen},Wi.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())},Wi.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 qi={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},Xi=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),Zi=function(e){function r(n){e.call(this),this.options=t.extend(Object.create(qi),n),t.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return e&&(r.__proto__=e),(r.prototype=Object.create(e&&e.prototype)).constructor=r,r.prototype.addTo=function(e){return this._map&&this.remove(),this._map=e,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new t.Event("open")),this},r.prototype.isOpen=function(){return!!this._map},r.prototype.remove=function(){return this._content&&n.remove(this._content),this._container&&(n.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new t.Event("close")),this},r.prototype.getLngLat=function(){return this._lngLat},r.prototype.setLngLat=function(e){return this._lngLat=t.LngLat.convert(e),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},r.prototype.trackPointer=function(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},r.prototype.getElement=function(){return this._container},r.prototype.setText=function(e){return this.setDOMContent(t.window.document.createTextNode(e))},r.prototype.setHTML=function(e){var n,r=t.window.document.createDocumentFragment(),i=t.window.document.createElement("body");for(i.innerHTML=e;n=i.firstChild;)r.appendChild(n);return this.setDOMContent(r)},r.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},r.prototype.setMaxWidth=function(t){return this.options.maxWidth=t,this._update(),this},r.prototype.setDOMContent=function(t){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=n.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(t),this._createCloseButton(),this._update(),this._focusFirstElement(),this},r.prototype.addClassName=function(t){this._container&&this._container.classList.add(t)},r.prototype.removeClassName=function(t){this._container&&this._container.classList.remove(t)},r.prototype.setOffset=function(t){return this.options.offset=t,this._update(),this},r.prototype.toggleClassName=function(t){if(this._container)return this._container.classList.toggle(t)},r.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=n.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))},r.prototype._onMouseUp=function(t){this._update(t.point)},r.prototype._onMouseMove=function(t){this._update(t.point)},r.prototype._onDrag=function(t){this._update(t.point)},r.prototype._update=function(e){var r=this;if(this._map&&(this._lngLat||this._trackPointer)&&this._content&&(this._container||(this._container=n.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=n.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach((function(t){return r._container.classList.add(t)})),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Bi(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||e)){var i=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat),o=this.options.anchor,a=function e(n){if(n){if("number"==typeof n){var r=Math.round(Math.sqrt(.5*Math.pow(n,2)));return{center:new t.Point(0,0),top:new t.Point(0,n),"top-left":new t.Point(r,r),"top-right":new t.Point(-r,r),bottom:new t.Point(0,-n),"bottom-left":new t.Point(r,-r),"bottom-right":new t.Point(-r,-r),left:new t.Point(n,0),right:new t.Point(-n,0)}}if(n instanceof t.Point||Array.isArray(n)){var i=t.Point.convert(n);return{center:i,top:i,"top-left":i,"top-right":i,bottom:i,"bottom-left":i,"bottom-right":i,left:i,right:i}}return{center:t.Point.convert(n.center||[0,0]),top:t.Point.convert(n.top||[0,0]),"top-left":t.Point.convert(n["top-left"]||[0,0]),"top-right":t.Point.convert(n["top-right"]||[0,0]),bottom:t.Point.convert(n.bottom||[0,0]),"bottom-left":t.Point.convert(n["bottom-left"]||[0,0]),"bottom-right":t.Point.convert(n["bottom-right"]||[0,0]),left:t.Point.convert(n.left||[0,0]),right:t.Point.convert(n.right||[0,0])}}return e(new t.Point(0,0))}(this.options.offset);if(!o){var s,u=this._container.offsetWidth,c=this._container.offsetHeight;s=i.y+a.bottom.ythis._map.transform.height-c?["bottom"]:[],i.xthis._map.transform.width-u/2&&s.push("right"),o=0===s.length?"bottom":s.join("-")}var l=i.add(a[o]).round();n.setTransform(this._container,Ri[o]+" translate("+l.x+"px,"+l.y+"px)"),ki(this._container,o,"popup")}},r.prototype._focusFirstElement=function(){if(this.options.focusAfterOpen&&this._container){var t=this._container.querySelector(Xi);t&&t.focus()}},r.prototype._onClose=function(){this.remove()},r}(t.Evented),Ji={version:t.version,supported:e,setRTLTextPlugin:t.setRTLTextPlugin,getRTLTextPluginStatus:t.getRTLTextPluginStatus,Map:Ti,NavigationControl:Mi,GeolocateControl:Ui,AttributionControl:vi,ScaleControl:Gi,FullscreenControl:Wi,Popup:Zi,Marker:Li,Style:Ve,LngLat:t.LngLat,LngLatBounds:t.LngLatBounds,Point:t.Point,MercatorCoordinate:t.MercatorCoordinate,Evented:t.Evented,config:t.config,prewarm:function(){Ft().acquire(kt)},clearPrewarmedResources:function(){var t=Lt;t&&(t.isPreloaded()&&1===t.numActive()?(t.release(kt),Lt=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get accessToken(){return t.config.ACCESS_TOKEN},set accessToken(e){t.config.ACCESS_TOKEN=e},get baseApiUrl(){return t.config.API_URL},set baseApiUrl(e){t.config.API_URL=e},get workerCount(){return Dt.workerCount},set workerCount(t){Dt.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 Ji})),n}()},function(t,e,n){var r=n(227);t.exports=function(t){if(Array.isArray(t))return r(t)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){var r=n(227);t.exports=function(t,e){if(t){if("string"==typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.__esModule=!0,t.exports.default=t.exports},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(1),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(230).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(198),y=n(224);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=.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.length89.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 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=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 L=function(t){a()(n,t);var e=D(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()(L,"layerName","S2Layer"),f()(L,"defaultProps",{getS2Token:{type:"accessor",value:function(t){return t.token}}});var j=n(19);function F(t){var e=function(t){for(var e=0,n=0,r=1<>=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(67),G=n(229),V=n(69),H=n.n(V),W=n(39),q=n.n(W),X=n(21),Z=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}(),J=n(40),Q=n.n(J),K=n(163),Y=n(86);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(84);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(26);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?$:r0?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(323);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,Dt=5,Lt=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[Dt])+Math.abs(i*r[Lt]+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(144),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 Zt{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===Zt.MASK_OUTSIDE||e===Zt.MASK_INSIDE)return e;let n=Zt.MASK_INSIDE;const r=this.planes;for(let i=0;is;)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=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*an&&(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;r4&&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);fn&&(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 Zt(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 De,Le=n(221),je=n(80);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);n0}),this._cache=new Map,this._tiles=[],this._dirty=!1,this._cacheByteSize=0,this._viewport=null,this._selectedTiles=null,this._frameNumber=0,this._modelMatrix=new Jt.a,this._modelMatrixInverse=new Jt.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 Jt.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.westi&&u.southo;var c=Math.min(u.top,u.bottom),l=Math.max(u.top,u.bottom);return u.lefti&&co}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||u.isSelected||(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 Z(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 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(117).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=J(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=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);)++i;if(i-e>16&&t.subarray&&d)return d.decode(t.subarray(e,i));for(var o="";e>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,D=0,L=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 Z="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>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|Dt(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|L(c)){e:do{if(1==(0|Dt(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|Lt(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|Dt(t,e)))break;i[r>>2]=1+(0|i[r>>2]);break}switch(127&o){case 8:case 118:break t}3!=(0|Dt(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 D(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 L(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>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 Z(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>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 J(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))>2]=1,s=c),(c=+ue(15936,u))>2]=2,s=c),(c=+ue(15960,u))>2]=3,s=c),(c=+ue(15984,u))>2]=4,s=c),(c=+ue(16008,u))>2]=5,s=c),(c=+ue(16032,u))>2]=6,s=c),(c=+ue(16056,u))>2]=7,s=c),(c=+ue(16080,u))>2]=8,s=c),(c=+ue(16104,u))>2]=9,s=c),(c=+ue(16128,u))>2]=10,s=c),(c=+ue(16152,u))>2]=11,s=c),(c=+ue(16176,u))>2]=12,s=c),(c=+ue(16200,u))>2]=13,s=c),(c=+ue(16224,u))>2]=14,s=c),(c=+ue(16248,u))>2]=15,s=c),(c=+ue(16272,u))>2]=16,s=c),(c=+ue(16296,u))>2]=17,s=c),(c=+ue(16320,u))>2]=18,s=c),(c=+ue(16344,u))>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,D=0,L=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),J(c),Q(c,_),D=+(0|i[f>>2]),o[b>>3]=3*D,o[p>>3]=0,L=-1.5*D,o[x>>3]=L,o[d>>3]=2.598076211353316*D,o[w>>3]=L,o[A>>3]=-2.598076211353316*D,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),J(e),i[n+16>>2]=i[t>>2],K(a,o+12|0,e=n+20|0),J(e),i[n+32>>2]=i[t>>2],K(a,o+24|0,e=n+36|0),J(e),i[n+48>>2]=i[t>>2],K(a,o+36|0,e=n+52|0),J(e),i[n+64>>2]=i[t>>2],K(a,o+48|0,n=n+68|0),J(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),J(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),J(e),i[n+16>>2]=i[t>>2],K(a,o+12|0,e=n+20|0),J(e),i[n+32>>2]=i[t>>2],K(a,o+24|0,e=n+36|0),J(e),i[n+48>>2]=i[t>>2],K(a,o+36|0,e=n+52|0),J(e),i[n+64>>2]=i[t>>2],K(a,o+48|0,e=n+68|0),J(e),i[n+80>>2]=i[t>>2],K(a,o+60|0,n=n+84|0),J(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|L(a))){s=0,r=13;break}r=1}if(7==(0|o)){s=0,r=13;break}if(!(i>>>0>>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|L(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>>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|L(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>>0)){n=0;break}r=r+1|0}else n=0}while(0);return 0|(i=0==(0|n)&1)}function Dt(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>>0)){n=0,r=5;break}r=r+1|0}return 5==(0|r)?0|n:0}function Lt(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>>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>>0)){n=1;break}n=n+1|0}}else n=1}while(0);if(!(s>>>0>>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>>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>>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>>0)){n=1;break}n=n+1|0}}else n=1}while(0);if(!(s>>>0>>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>>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),Z(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),J(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|L(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>>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>>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>>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>>0;)r=r+1|0}}while(0);if((0|s)>0){r=0;do{e=0|Lt(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|L(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>>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|L(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>>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>>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|L(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>>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|L(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|L(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>>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|L(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|L(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 Zt(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|Dt(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|L(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 Jt(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,D=0,L=0;if(0|i[(c=(t|=0)+8|0)>>2])return 0|(L=1);if(!(s=0|i[t>>2]))return 0|(L=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|(L=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){L=14;break}l+=(f-p)*(+o[r>>3]+ +o[c>>3])}while(!d);if(14==(0|L)){L=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):L=19}else L=19;if(19==(0|L)){L=0;do{if(!a){if(g){c=C,h=g+8|0,r=s,a=t;break}if(0|i[t>>2]){L=27;break t}c=C,h=t,r=s,a=t;break}if(0|i[(r=a+8|0)>>2]){L=21;break t}if(!(a=0|ve(1,12))){L=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>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&Sw?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){L=45;break}T=c,g=r}if(21==(0|L))E(22624,22646,35,22658);else if(23==(0|L))E(22678,22646,37,22658);else if(27==(0|L))E(22721,22646,61,22744);else if(45==(0|L)){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)L=73;else{if(!(T=0|me(I))){L=50;break}if(!(C=0|me(I))){L=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]){L=70;break}i[a>>2]=P,i[c>>2]=P}else L=73}if(73==(0|L)){if(L=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)){D=r;break t}}50==(0|L)?E(22863,22646,249,22882):52==(0|L)?E(22901,22646,252,22882):70==(0|L)&&E(22721,22646,61,22744)}else D=0}while(0);return ye(n),ye(e),0|(L=D)}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),rl;)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),rl;)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|L(A),u=0|L(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|Dt(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|Dt(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),J(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|Dt(t,e),h=0|Dt(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|L(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),J(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|L(l);e:do{if(u){if(o){if(c=21408+(28*(0|Dt(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|L(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|Dt(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|Lt(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|Dt(t,e))|0)+((0|Dt(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|Dt(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),ah;){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),ah;){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>3]=l,p=l),A>3]=A,d=A),l>g?o[e>>3]=l:l=g,A>h&&(o[c>>3]=A,h=A),m=A>0&Ay?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>3]=c,f=c),d>3]=d,p=d),c>A?o[e>>3]=c:c=A,d>l&&(o[b>>3]=d,l=d),g=d>0&dm?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>3]=c,f=c),A>3]=A,p=A),c>d?o[_>>3]=c:c=d,A>l&&(o[w>>3]=A,l=A),g=A>0&Am?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<>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<>>=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<>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<>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>>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<>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<>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<>>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>>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<>>=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>>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<>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<>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<>>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<>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>>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<>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<>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<>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<>>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<>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>>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<>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<>>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<>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>>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>>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<>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<>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<>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<>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<>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<>>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<>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<>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<>>(u>>>0))&(e=d>>31),e&=l>>>(u>>>0),a=h<<(A=64-u|0)&(c=f>>31),u=(l<>>(d>>>0))&c|h<>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<>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>>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-32|0)}function Oe(t,e,n){return t|=0,e|=0,(0|(n|=0))<32?(x(e<>>32-n|0),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|L(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>>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>>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|L(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>>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|L(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

>>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>>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,Zt(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,Zt(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,Zt(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:Zt,_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|L(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>>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|L(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>>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|Jt(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|L(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>>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,L=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|D(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|D((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,L=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=L,L=y,k=v,I=_,P=C,C=b}return ye(k),ye(L),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>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),D++,n.monitorRunDependencies&&n.monitorRunDependencies(D);var rt=function(t){t.byteLength&&(t=new Uint8Array(t)),y.set(t,8),n.memoryInitializerRequest&&delete n.memoryInitializerRequest.response,function(t){if(D--,n.monitorRunDependencies&&n.monitorRunDependencies(D),0==D&&(null!==L&&(clearInterval(L),L=null),j)){var e=j;j=null,e()}}()},it=function(){i(U,rt,(function(){throw"could not load memory initializer "+U}))},ot=J(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=J(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,D>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)}(),D>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=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);n180?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;c1&&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=Dn(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=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 Jt.a){return Er(this,"east","north","up",t,e)}localFrameToFixedFrame(t,e,n,r,i=new Jt.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),AYt);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(76),Rr=n(106),kr=n(20);class Dr{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 Lr{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 Dr(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 Lr,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 Zt([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 Zr=0,Jr=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 Jt.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 Jt.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 Jt.a,xi=new Jt.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=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=Zr,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 Jt.a,this.transform=new Jt.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===Zr}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===Zr)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=Jr;const t=await this.tileset._requestScheduler.scheduleRequest(this.id,this._getPriority.bind(this));if(!t)return this.contentState=Zr,!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=Zr,!0}updateVisibility(t,e){if(this._frameNumber===t.frameNumber)return;const n=this.parent,r=n?n._visibilityPlaneMask:Zt.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!==Zt.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 Jt.a(t.transform):new Jt.a;const e=this.parent,n=this.tileset,r=e&&e.computedTransform?e.computedTransform.clone():n.modelMatrix.clone();this.computedTransform=new Jt.a(r).multiplyRight(this.transform);const i=e&&e._initialTransform?e._initialTransform.clone():new Jt.a;this._initialTransform=new Jt.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=Zr,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=Zt.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 Jt.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 Di 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 Li={description:"",ellipsoid:Ir.WGS84,modelMatrix:new Jt.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={...Li,...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 Le.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;e0||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=Di;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 Jt.a(i);switch(n&&a.translate(n),r){case"Z":break;case"Y":const t=(new Jt.a).rotateX(Math.PI/2);a=a.multiplyRight(t);break;case"X":const e=(new Jt.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(185);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;tt[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;n0?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;tt,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{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;e255*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;nn||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;i12;){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(103);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 Do(t,e){return parseInt(t.toString(2)+e.toString(2),2)}function Lo(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(Lo(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 _=Do(r.mortonIndex,i),b=v+_,x=Do(r.x,g),w=Do(r.y,m),E=Do(r.z,y),O=!1;s+1>c&&(O=Ro(a.childSubtreeAvailability,_));const S=Do(o.x,x),T=Do(o.y,w),C=Do(o.z,E),P=s+o.level;if(O){const t=Lo("".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=Lo(h,P,S,T,C));const M=s+1,I={mortonIndex:_,x:x,y:w,z:E};for(let e=0;e0;){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;ee[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 Ze(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(37);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(t-c)/o),h=Object(ia.f)(u,l,o,e);for(let e=0,n=h.length;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>3}if(1===n||2===n)t.readSVarint(),t.readSVarint(),is&&i,oc&&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=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>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>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=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 Da(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>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 La{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 La(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{const i=r.layers[t];if(i)for(let r=0;r1)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;tt>=n&&t<=r),a=e.primitivePolygonIndices.value.filter(t=>t>=n&&t<=r);if(!(o.length>2)){const t=[];for(let e=0;e=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=o&&i[e]=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=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);ni&&(t.minZoom=e.minzoom),Number.isFinite(e.maxzoom)&&(!Number.isFinite(o)||e.maxzoom=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}(Ze);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=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 L})),n.d(e,"QuadkeyLayer",(function(){return U})),n.d(e,"TileLayer",(function(){return Ze})),n.d(e,"TripsLayer",(function(){return tn})),n.d(e,"H3ClusterLayer",(function(){return Jn})),n.d(e,"H3HexagonLayer",(function(){return Wn})),n.d(e,"Tile3DLayer",(function(){return Zo})),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 Z}))},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(8),u=n.n(s),c=n(5),l=n.n(c),h=n(6),f=n.n(h),p=n(1),d=n.n(p),A=n(0),g=n.n(A),m=n(21),y=n(189),v=n(7),_=n(251),b=n(206),x=n(186),w=n(322);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(162),B=n(217),R={SUM:1,MEAN:2,MIN:3,MAX:4};function k(t,e){return t+e}function D(t,e){return e>t?e:t}function L(t,e){return e1&&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(L,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(D,-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(107)),Z=n(74),J=(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?J: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 Z.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);n1&&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 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(60),ct=n(234),lt=n(164),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= 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;lc?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(138),xt=n(165),wt=n(198);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);n1&&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(33),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>>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);ne?1:t>=e?0:NaN},Kt={getValue:Xt,getPoints:Zt,getIndex:Jt,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?Zt:i,a=e.getIndex,s=void 0===a?Jt:a,u=e.filterData,c="function"==typeof u,l=t.length,h=[],f=0,p=0;pa.counts?e:a.counts,n=n>a.value?n:a.value,r=r1&&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(52),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;ca?n:a,s=ru?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=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);ns?n:s,u=rc?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=0&&M=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=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(223),we=n(28),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;e0&&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 Dt;case"linear":return Lt;case"quantile":return jt;case"ordinal":return Ut;default:return Dt}}(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}},De=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()(De,"layerName","CPUGridLayer"),g()(De,"defaultProps",ke);var Le=n(167),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);n1){var A=l-p,g=p+(ly*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=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 Zn(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 Jn(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);n0&&(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=Jn(n);try{for(p.s();!(e=p.n()).done;)for(var d=e.value,A=d.contour,g=A.threshold,m=-1;m= (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=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=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=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 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 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},Lr)),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 De})),n.d(e,"HexagonLayer",(function(){return Ze})),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(186),i=n(322),o=n(204),a=n(315),s=n(7),u=n(189),c=n(251),l=n(206),h=n(236),f=n(33),p=n(321),d=n(74),A=n(109),g=n(107),m=n(237),y=n(238),v=n(314),_=n(60),b=n(47);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;eo?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;t0&&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(297);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(84);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=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)),D=Math.atan2(B,I)+n,L=k/n,j=1-D/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]=L,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]=L}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;t0&&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;t85.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(174),i=n.n(r),o=n(88),a=n.n(o),s=n(89),u=n.n(s),c=n(140),l=n.n(c),h=n(119),f=n.n(h),p=n(120),d=n.n(p),A=n(56),g=n.n(A),m=n(141),y=n(128);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;e0&&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(2),i=n(142);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(97);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.7"),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{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(267)}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.7")},,,,,,,,,,,,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(142),i=n(175);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(7),i=n(38),o=n(33),a=n(47);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(121),i=n(13),o=n(23),a=n(34),s=n(55);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(49),i=n(133),o=n(51);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";(function(t,r){n.d(e,"a",(function(){return i}));"undefined"!=typeof self&&self,"undefined"!=typeof window&&window,"undefined"!=typeof document&&document;const i=Boolean("object"!=typeof r||"[object process]"!==String(r)||r.browser),o=void 0!==r&&r.version&&/v([0-9]*)/.exec(r.version);o&&parseFloat(o[1])}).call(this,n(71),n(44))},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(317);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(246);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=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];D(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}=J(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 D(e),this.json.extensions=this.json.extensions||{},this.json.extensions[t]=e,this.registerUsedExtension(t),e}addRequiredExtension(t,e={}){return D(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;D(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:Z(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.length96?r-71:r>64?r-65:r>47?r+4:r>46?63:62}let n=0;for(let r=0;r0)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");D(!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 Dt=[r,i,o,a,s,u,c];function Lt(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},Zt={[Gt]:9729,[Vt]:9986,[Ht]:qt,[Wt]:qt};class Jt{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 D(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}=J(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;a20);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),D("glTF"===i.type,"Invalid GLB magic string ".concat(i.type)),t._glb=i,t.json=i.json}else D(!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=Dt.filter(t=>Lt(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;aLt(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 Jt).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=L(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)}D(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(106),i=n(72);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(181);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(54),o=n(74),a=n(7),s=n(109),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{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;t1&&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;e1&&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;r0&&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(63),D=n(81);class L{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=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;rt.location-e.location)}_addAttribute(t,e,n,r){const{type:i,components:o}=Object(D.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(D.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(48);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 L(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(D.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;e1)for(let e=0;e0&&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(7),h=n(33),f=n(314),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(206),g=n(107),m=n(74),y=n(236);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(191);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;t0&&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(47),S=n(186);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(122),i=n(23),o=n(121),a=n(13),s=n(25),u=n(55);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(57),p=n(36);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(146);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 \ No newline at end of file