PageSourceSearch

https://www.risklayer-explorer.com/static/js/deckgl.js

js risklayer-explorer.com collected 2026-10-02 06:58:14 UTC 1,623,201 bytes, 4,968 lines download raw bytes

1(function webpackUniversalModuleDefinition(root, factory) {
2  if (typeof exports === 'object' && typeof module === 'object')
3    module.exports = factory();
4  else if (typeof define === 'function' && define.amd) define([], factory);
5        else if (typeof exports === 'object') exports['deck'] = factory();
6  else root['deck'] = factory();})(globalThis, function () {
7"use strict";var __exports__=(()=>{var hV=Object.create;var dp=Object.defineProperty;var dV=Object.getOwnPropertyDescriptor;var vV=Object.getOwnPropertyNames;var mV=Object.getPrototypeOf,gV=Object.prototype.hasOwnProperty;var OT=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(r,e)=>(typeof require<"u"?require:r)[e]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+t+'" is not supported')});var Ln=(t,r)=>()=>(t&&(r=t(t=0)),r);var yt=(t,r)=>()=>(r||t((r={exports:{}}).exports,r),r.exports),Lr=(t,r)=>{for(var e in r)dp(t,e,{get:r[e],enumerable:!0})},ET=(t,r,e,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of vV(r))!gV.call(t,i)&&i!==e&&dp(t,i,{get:()=>r[i],enumerable:!(n=dV(r,i))||n.enumerable});return t};var me=(t,r,e)=>(e=t!=null?hV(mV(t)):{},ET(r||!t||!t.__esModule?dp(e,"default",{value:t,enumerable:!0}):e,t)),yV=t=>ET(dp({},"__esModule",{value:!0}),t);function Hg(t){if(Array.isArray(t))return t}var CT=Ln(()=>{});function Wg(t,r){var e=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(e!=null){var n=[],i=!0,a=!1,o,s;try{for(e=e.call(t);!(i=(o=e.next()).done)&&(n.push(o.value),!(r&&n.length===r));i=!0);}catch(u){a=!0,s=u}finally{try{!i&&e.return!=null&&e.return()}finally{if(a)throw s}}return n}}var MT=Ln(()=>{});function bs(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var $g=Ln(()=>{});function jl(t,r){if(t){if(typeof t=="string")return bs(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return bs(t,r)}}var Xg=Ln(()=>{$g()});function qg(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
8In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var IT=Ln(()=>{});function W(t,r){return Hg(t)||Wg(t,r)||jl(t,r)||qg()}var be=Ln(()=>{CT();MT();Xg();IT()});function A(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}var F=Ln(()=>{});function LT(t,r){for(var e=0;e<r.length;e++){var n=r[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function T(t,r,e){return r&&LT(t.prototype,r),e&&LT(t,e),t}var j=Ln(()=>{});function ue(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ue=function(e){return typeof e}:ue=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ue(t)}var Ge=Ln(()=>{});function c(t,r,e){return r in t?Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[r]=e,t}var k=Ln(()=>{});var kT=yt((fve,Zg)=>{var Kg=function(t){"use strict";var r=Object.prototype,e=r.hasOwnProperty,n,i=typeof Symbol=="function"?Symbol:{},a=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(V,U,X){return Object.defineProperty(V,U,{value:X,enumerable:!0,configurable:!0,writable:!0}),V[U]}try{u({},"")}catch{u=function(U,X,K){return U[X]=K}}function l(V,U,X,K){var te=U&&U.prototype instanceof g?U:g,ie=Object.create(te.prototype),ce=new H(K||[]);return ie._invoke=I(V,X,ce),ie}t.wrap=l;function f(V,U,X){try{return{type:"normal",arg:V.call(U,X)}}catch(K){return{type:"throw",arg:K}}}var p="suspendedStart",h="suspendedYield",d="executing",v="completed",m={};function g(){}function y(){}function _(){}var b={};u(b,a,function(){return this});var x=Object.getPrototypeOf,w=x&&x(x($([])));w&&w!==r&&e.call(w,a)&&(b=w);var P=_.prototype=g.prototype=Object.create(b);y.prototype=_,u(P,"constructor",_),u(_,"constructor",y),y.displayName=u(_,s,"GeneratorFunction");function E(V){["next","throw","return"].forEach(function(U){u(V,U,function(X){return this._invoke(U,
8X)})})}t.isGeneratorFunction=function(V){var U=typeof V=="function"&&V.constructor;return U?U===y||(U.displayName||U.name)==="GeneratorFunction":!1},t.mark=function(V){return Object.setPrototypeOf?Object.setPrototypeOf(V,_):(V.__proto__=_,u(V,s,"GeneratorFunction")),V.prototype=Object.create(P),V},t.awrap=function(V){return{__await:V}};function C(V,U){function X(ie,ce,Te,Me){var Fe=f(V[ie],V,ce);if(Fe.type==="throw")Me(Fe.arg);else{var we=Fe.arg,Ne=we.value;return Ne&&typeof Ne=="object"&&e.call(Ne,"__await")?U.resolve(Ne.__await).then(function(Oe){X("next",Oe,Te,Me)},function(Oe){X("throw",Oe,Te,Me)}):U.resolve(Ne).then(function(Oe){we.value=Oe,Te(we)},function(Oe){return X("throw",Oe,Te,Me)})}}var K;function te(ie,ce){function Te(){return new U(function(Me,Fe){X(ie,ce,Me,Fe)})}return K=K?K.then(Te,Te):Te()}this._invoke=te}E(C.prototype),u(C.prototype,o,function(){return this}),t.AsyncIterator=C,t.async=function(V,U,X,K,te){te===void 0&&(te=Promise);var ie=new C(l(V,U,X,K),te);return t.isGeneratorFunction(U)?ie:ie.next().then(function(ce){return ce.done?ce.value:ie.next()})};function I(V,U,X){var K=p;return function(ie,ce){if(K===d)throw new Error("Generator is already running");if(K===v){if(ie==="throw")throw ce;return ee()}for(X.method=ie,X.arg=ce;;){var Te=X.delegate;if(Te){var Me=O(Te,X);if(Me){if(Me===m)continue;return Me}}if(X.method==="next")X.sent=X._sent=X.arg;else if(X.method==="throw"){if(K===p)throw K=v,X.arg;X.dispatchException(X.arg)}else X.method==="return"&&X.abrupt("return",X.arg);K=d;var Fe=f(V,U,X);if(Fe.type==="normal"){if(K=X.done?v:h,Fe.arg===m)continue;return{value:Fe.arg,done:X.done}}else Fe.type==="throw"&&(K=v,X.method="throw",X.arg=Fe.arg)}}}function O(V,U){var X=V.iterator[U.method];if(X===n){if(U.delegate=null,U.method==="throw"){if(V.iterator.return&&(U.method="return",U.arg=n,O(V,U),U.method==="throw"))return m;U.method="throw",U.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var K=f(X,V.iterator,U.arg);if(K.type==="throw")return U.method="throw",U.arg=K.arg,U.delegate=null,m;var te=K.arg;if(!te)return U.method="throw",U.arg=new TypeError("iterator result is not an object"),U.delegate=null,m;if(te.done)U[V.resultName]=te.value,U.next=V.nextLoc,U.method!=="return"&&(U.method="next",U.arg=n);else return te;return U.delegate=null,m}E(P),u(P,s,"Generator"),u(P,a,function(){return this}),u(P,"toString",function(){return"[object Generator]"});function D(V){var U={tryLoc:V[0]};1 in V&&(U.catchLoc=V[1]),2 in V&&(U.finallyLoc=V[2],U.afterLoc=V[3]),this.tryEntries.push(U)}function N(V){var U=V.completion||{};U.type="normal",delete U.arg,V.completion=U}function H(V){this.tryEntries=[{tryLoc:"root"}],V.forEach(D,this),this.reset(!0)}t.keys=function(V){var U=[];for(var X in V)U.push(X);return U.reverse(),function K(){for(;U.length;){var te=U.pop();if(te in V)return K.value=te,K.done=!1,K}return K.done=!0,K}};function $(V){if(V){var U=V[a];if(U)return U.call(V);if(typeof V.next=="function")return V;if(!isNaN(V.length)){var X=-1,K=function te(){for(;++X<V.length;)if(e.call(V,X))return te.value=V[X],te.done=!1,te;return te.value=n,te.done=!0,te};return K.next=K}}return{next:ee}}t.values=$;function ee(){return{value:n,done:!0}}return H.prototype={constructor:H,reset:function(V){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(N),!V)for(var U in this)U.charAt(0)==="t"&&e.call(this,U)&&!isNaN(+U.slice(1))&&(this[U]=n)},stop:function(){this.done=!0;var V=this.tryEntries[0],U=V.completion;if(U.type==="throw")throw U.arg;return this.rval},dispatchException:function(V){if(this.done)throw V;var U=this;function X(Me,Fe){return ie.type="throw",ie.arg=V,U.next=Me,Fe&&(U.method="next",U.arg=n),!!Fe}for(var K=this.tryEntries.length-1;K>=0;--K){var te=this.tryEntries[K],ie=te.completion;if(te.tryLoc==="root")return X("end");if(te.tryLoc<=this.prev){var ce=e.call(te,"catchLoc"),Te=e.call(te,"finallyLoc");if(ce&&Te){if(this.prev<te.catchLoc)return X(te.catchLoc,!0);if(this.prev<te.finallyLoc)return X(te.finallyLoc)}else if(ce){if(this.prev<te.catchLoc)return X(te.catchLoc,!0)}else if(Te){if(this.prev<te.finallyLoc)return X(te.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(V,U){for(var X=this.tryEntries.length-1;X>=0;--X){var K=this.tryEntries[X];if(K.tryLoc<=this.prev&&e.call(K,"finallyLoc")&&this.prev<K.finallyLoc){var te=K;break}}te&&(V==="break"||V==="continue")&&te.tryLoc<=U&&U<=te.finallyLoc&&(te=null);var ie=te?te.completion:{};return ie.type=V,ie.arg=U,te?(this.method="next",this.next=te.finallyLoc,m):this.complete(ie)},complete:function(V,U){if(V.type==="throw")throw V.arg;return V.type==="break"||V.type==="continue"?this.next=V.arg:V.type==="return"?(this.rval=this.arg=V.arg,this.method="return",this.next="end"):V.type==="normal"&&U&&(this.next=U),m},finish:function(V){for(var U=this.tryEntries.length-1;U>=0;--U){var X=this.tryEntries[U];if(X.finallyLoc===V)return this.complete(X.completion,X.afterLoc),N(X),m}},catch:function(V){for(var U=this.tryEntries.length-1;U>=0;--U){var X=this.tryEntries[U];if(X.tryLoc===V){var K=X.completion;if(K.type==="throw"){var te=K.arg;N(X)}return te}}throw new Error("illegal catch attempt")},delegateYield:function(V,U,X){return this.delegate={iterator:$(V),resultName:U,nextLoc:X},this.method==="next"&&(this.arg=n),m}},t}(typeof Zg=="object"?Zg.exports:{});try{regeneratorRuntime=Kg}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=Kg:Function("r","regeneratorRuntime = r")(Kg)}});var Ae=yt((cve,BT)=>{BT.exports=kT()});var JT=yt(()=>{});var P2=yt((INe,vd)=>{(function(t,r,e,n){"use strict";var i=["","webkit","Moz","MS","ms","o"],a=r.createElement("div"),o="function",s=Math.round,u=Math.abs,l=Date.now;function f(M,R,G){return setTimeout(_(M,G),R)}function p(M,R,G){return Array.isArray(M)?(h(M,G[R],G),!0):!1}function h(M,R,G){var Q;
vendor: 19,051 bytes, lines 8-10
8if(M)if(M.forEach)M.forEach(R,G);else if(M.length!==n)for(Q=0;Q<M.length;)R.call(G,M[Q],Q,M),Q++;else for(Q in M)M.hasOwnProperty(Q)&&R.call(G,M[Q],Q,M)}function d(M,R,G){var Q="DEPRECATED METHOD: "+R+`
9`+G+` AT 
10`;return function(){var oe=new Error("get-stack-trace"),xe=oe&&oe.stack?oe.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",ze=t.console&&(t.console.warn||t.console.log);return ze&&ze.call(t.console,Q,xe),M.apply(this,arguments)}}var v;typeof Object.assign!="function"?v=function(R){if(R===n||R===null)throw new TypeError("Cannot convert undefined or null to object");for(var G=Object(R),Q=1;Q<arguments.length;Q++){var oe=arguments[Q];if(oe!==n&&oe!==null)for(var xe in oe)oe.hasOwnProperty(xe)&&(G[xe]=oe[xe])}return G}:v=Object.assign;var m=d(function(R,G,Q){for(var oe=Object.keys(G),xe=0;xe<oe.length;)(!Q||Q&&R[oe[xe]]===n)&&(R[oe[xe]]=G[oe[xe]]),xe++;return R},"extend","Use `assign`."),g=d(function(R,G){return m(R,G,!0)},"merge","Use `assign`.");function y(M,R,G){var Q=R.prototype,oe;oe=M.prototype=Object.create(Q),oe.constructor=M,oe._super=Q,G&&v(oe,G)}function _(M,R){return function(){return M.apply(R,arguments)}}function b(M,R){return typeof M==o?M.apply(R&&R[0]||n,R):M}function x(M,R){return M===n?R:M}function w(M,R,G){h(I(R),function(Q){M.addEventListener(Q,G,!1)})}function P(M,R,G){h(I(R),function(Q){M.removeEventListener(Q,G,!1)})}function E(M,R){for(;M;){if(M==R)return!0;M=M.parentNode}return!1}function C(M,R){return M.indexOf(R)>-1}function I(M){return M.trim().split(/\s+/g)}function O(M,R,G){if(M.indexOf&&!G)return M.indexOf(R);for(var Q=0;Q<M.length;){if(G&&M[Q][G]==R||!G&&M[Q]===R)return Q;Q++}return-1}function D(M){return Array.prototype.slice.call(M,0)}function N(M,R,G){for(var Q=[],oe=[],xe=0;xe<M.length;){var ze=R?M[xe][R]:M[xe];O(oe,ze)<0&&Q.push(M[xe]),oe[xe]=ze,xe++}return G&&(R?Q=Q.sort(function(Zt,fr){return Zt[R]>fr[R]}):Q=Q.sort()),Q}function H(M,R){for(var G,Q,oe=R[0].toUpperCase()+R.slice(1),xe=0;xe<i.length;){if(G=i[xe],Q=G?G+oe:R,Q in M)return Q;xe++}return n}var $=1;function ee(){return $++}function V(M){var R=M.ownerDocument||M;return R.defaultView||R.parentWindow||t}var U=/mobile|tablet|ip(ad|hone|od)|android/i,X="ontouchstart"in t,K=H(t,"PointerEvent")!==n,te=X&&U.test(navigator.userAgent),ie="touch",ce="pen",Te="mouse",Me="kinect",Fe=25,we=1,Ne=2,Oe=4,ft=8,un=1,Rr=2,ea=4,Ct=8,Ht=16,Ke=Rr|ea,ln=Ct|Ht,fn=Ke|ln,cn=["x","y"],ys=["clientX","clientY"];function _r(M,R){var G=this;this.manager=M,this.callback=R,this.element=M.element,this.target=M.options.inputTarget,this.domHandler=function(Q){b(M.options.enable,[M])&&G.handler(Q)},this.init()}_r.prototype={handler:function(){},init:function(){this.evEl&&w(this.element,this.evEl,this.domHandler),this.evTarget&&w(this.target,this.evTarget,this.domHandler),this.evWin&&w(V(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&P(this.element,this.evEl,this.domHandler),this.evTarget&&P(this.target,this.evTarget,this.domHandler),this.evWin&&P(V(this.element),this.evWin,this.domHandler)}};function Bl(M){var R,G=M.options.inputClass;return G?R=G:K?R=Bg:te?R=up:X?R=Fg:R=sp,new R(M,Ig)}function Ig(M,R,G){var Q=G.pointers.length,oe=G.changedPointers.length,xe=R&we&&Q-oe===0,ze=R&(Oe|ft)&&Q-oe===0;G.isFirst=!!xe,G.isFinal=!!ze,xe&&(M.session={}),G.eventType=R,Rg(M,G),M.emit("hammer.input",G),M.recognize(G),M.session.prevInput=G}function Rg(M,R){var G=M.session,Q=R.pointers,oe=Q.length;G.firstInput||(G.firstInput=ap(R)),oe>1&&!G.firstMultiple?G.firstMultiple=ap(R):oe===1&&(G.firstMultiple=!1);var xe=G.firstInput,ze=G.firstMultiple,Wt=ze?ze.center:xe.center,Zt=R.center=op(Q);R.timeStamp=l(),R.deltaTime=R.timeStamp-xe.timeStamp,R.angle=qa(Wt,Zt),R.distance=li(Wt,Zt),Lg(G,R),R.offsetDirection=Xa(R.deltaX,R.deltaY);var fr=$a(R.deltaTime,R.deltaX,R.deltaY);R.overallVelocityX=fr.x,R.overallVelocityY=fr.y,R.overallVelocity=u(fr.x)>u(fr.y)?fr.x:fr.y,R.scale=ze?$z(ze.pointers,Q):1,R.rotation=ze?Wz(ze.pointers,Q):0,R.maxPointers=G.prevInput?R.pointers.length>G.prevInput.maxPointers?R.pointers.length:G.prevInput.maxPointers:R.pointers.length,kg(G,R);var Rn=M.element;E(R.srcEvent.target,Rn)&&(Rn=R.srcEvent.target),R.target=Rn}function Lg(M,R){var G=R.center,Q=M.offsetDelta||{},oe=M.prevDelta||{},xe=M.prevInput||{};(R.eventType===we||xe.eventType===Oe)&&(oe=M.prevDelta={x:xe.deltaX||0,y:xe.deltaY||0},Q=M.offsetDelta={x:G.x,y:G.y}),R.deltaX=oe.x+(G.x-Q.x),R.deltaY=oe.y+(G.y-Q.y)}function kg(M,R){var G=M.lastInterval||R,Q=R.timeStamp-G.timeStamp,oe,xe,ze,Wt;if(R.eventType!=ft&&(Q>Fe||G.velocity===n)){var Zt=R.deltaX-G.deltaX,fr=R.deltaY-G.deltaY,Rn=$a(Q,Zt,fr);xe=Rn.x,ze=Rn.y,oe=u(Rn.x)>u(Rn.y)?Rn.x:Rn.y,Wt=Xa(Zt,fr),M.lastInterval=R}else oe=G.velocity,xe=G.velocityX,ze=G.velocityY,Wt=G.direction;R.velocity=oe,R.velocityX=xe,R.velocityY=ze,R.direction=Wt}function ap(M){for(var R=[],G=0;G<M.pointers.length;)R[G]={clientX:s(M.pointers[G].clientX),clientY:s(M.pointers[G].clientY)},G++;return{timeStamp:l(),pointers:R,center:op(R),deltaX:M.deltaX,deltaY:M.deltaY}}function op(M){var R=M.length;if(R===1)return{x:s(M[0].clientX),y:s(M[0].clientY)};for(var G=0,Q=0,oe=0;oe<R;)G+=M[oe].clientX,Q+=M[oe].clientY,oe++;return{x:s(G/R),y:s(Q/R)}}function $a(M,R,G){return{x:R/M||0,y:G/M||0}}function Xa(M,R){return M===R?un:u(M)>=u(R)?M<0?Rr:ea:R<0?Ct:Ht}function li(M,R,G){G||(G=cn);var Q=R[G[0]]-M[G[0]],oe=R[G[1]]-M[G[1]];return Math.sqrt(Q*Q+oe*oe)}function qa(M,R,G){G||(G=cn);var Q=R[G[0]]-M[G[0]],oe=R[G[1]]-M[G[1]];return Math.atan2(oe,Q)*180/Math.PI}function Wz(M,R){return qa(R[1],R[0],ys)+qa(M[1],M[0],ys)}function $z(M,R){return li(R[0],R[1],ys)/li(M[0],M[1],ys)}var Xz={mousedown:we,mousemove:Ne,mouseup:Oe},qz="mousedown",Yz="mousemove mouseup";function sp(){this.evEl=qz,this.evWin=Yz,this.pressed=!1,_r.apply(this,arguments)}y(sp,_r,{handler:function(R){var G=Xz[R.type];G&we&&R.button===0&&(this.pressed=!0),G&Ne&&R.which!==1&&(G=Oe),this.pressed&&(G&Oe&&(this.pressed=!1),this.callback(this.manager,G,{pointers:[R],changedPointers:[R],pointerType:Te,srcEvent:R}))}});var Kz={pointerdown:we,pointermove:Ne,pointerup:Oe,pointercancel:ft,pointerout:ft},Zz={2:ie,3:ce,4:Te,5:Me},dT="pointerdown",vT="pointermove pointerup pointercancel";t.MSPointerEvent&&!t.PointerEvent&&(dT="MSPointerDown",vT="MSPointerMove MSPointerUp MSPointerCancel");function Bg(){this.evEl=dT,this.evWin=vT,_r.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}y(Bg,_r,{handler:function(R){var G=this.store,Q=!1,oe=R.type.toLowerCase().replace("ms",""),xe=Kz[oe],ze=Zz[R.pointerType]||R.pointerType,Wt=ze==ie,Zt=O(G,R.pointerId,"pointerId");xe&we&&(R.button===0||Wt)?Zt<0&&(G.push(R),Zt=G.length-1):xe&(Oe|ft)&&(Q=!0),!(Zt<0)&&(G[Zt]=R,this.callback(this.manager,xe,{pointers:G,changedPointers:[R],pointerType:ze,srcEvent:R}),Q&&G.splice(Zt,1))}});var Jz={touchstart:we,touchmove:Ne,touchend:Oe,touchcancel:ft},Qz="touchstart",eV="touchstart touchmove touchend touchcancel";function mT(){this.evTarget=Qz,this.evWin=eV,this.started=!1,_r.apply(this,arguments)}y(mT,_r,{handler:function(R){var G=Jz[R.type];if(G===we&&(this.started=!0),!!this.started){var Q=tV.call(this,R,G);G&(Oe|ft)&&Q[0].length-Q[1].length===0&&(this.started=!1),this.callback(this.manager,G,{pointers:Q[0],changedPointers:Q[1],pointerType:ie,srcEvent:R})}}});function tV(M,R){var G=D(M.touches),Q=D(M.changedTouches);return R&(Oe|ft)&&(G=N(G.concat(Q),"identifier",!0)),[G,Q]}var rV={touchstart:we,touchmove:Ne,touchend:Oe,touchcancel:ft},nV="touchstart touchmove touchend touchcancel";function up(){this.evTarget=nV,this.targetIds={},_r.apply(this,arguments)}y(up,_r,{handler:function(R){var G=rV[R.type],Q=iV.call(this,R,G);Q&&this.callback(this.manager,G,{pointers:Q[0],changedPointers:Q[1],pointerType:ie,srcEvent:R})}});function iV(M,R){var G=D(M.touches),Q=this.targetIds;if(R&(we|Ne)&&G.length===1)return Q[G[0].identifier]=!0,[G,G];var oe,xe,ze=D(M.changedTouches),Wt=[],Zt=this.target;if(xe=G.filter(function(fr){return E(fr.target,Zt)}),R===we)for(oe=0;oe<xe.length;)Q[xe[oe].identifier]=!0,oe++;for(oe=0;oe<ze.length;)Q[ze[oe].identifier]&&Wt.push(ze[oe]),R&(Oe|ft)&&delete Q[ze[oe].identifier],oe++;if(Wt.length)return[N(xe.concat(Wt),"identifier",!0),Wt]}var aV=2500,gT=25;function Fg(){_r.apply(this,arguments);var M=_(this.handler,this);this.touch=new up(this.manager,M),this.mouse=new sp(this.manager,M),this.primaryTouch=null,this.lastTouches=[]}y(Fg,_r,{handler:function(R,G,Q){var oe=Q.pointerType==ie,xe=Q.pointerType==Te;if(!(xe&&Q.sourceCapabilities&&Q.sourceCapabilities.firesTouchEvents)){if(oe)oV.call(this,G,Q);else if(xe&&sV.call(this,Q))return;this.callback(R,G,Q)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function oV(M,R){M&we?(this.primaryTouch=R.changedPointers[0].identifier,yT.call(this,R)):M&(Oe|ft)&&yT.call(this,R)}function yT(M){var R=M.changedPointers[0];if(R.identifier===this.primaryTouch){var G={x:R.clientX,y:R.clientY};this.lastTouches.push(G);var Q=this.lastTouches,oe=function(){var xe=Q.indexOf(G);xe>-1&&Q.splice(xe,1)};setTimeout(oe,aV)}}function sV(M){for(var R=M.srcEvent.clientX,G=M.srcEvent.clientY,Q=0;Q<this.lastTouches.length;Q++){var oe=this.lastTouches[Q],xe=Math.abs(R-oe.x),ze=Math.abs(G-oe.y);if(xe<=gT&&ze<=gT)return!0}return!1}var _T=H(a.style,"touchAction"),bT=_T!==n,xT="compute",AT="auto",Dg="manipulation",Ya="none",Fl="pan-x",Dl="pan-y",lp=lV();function Ng(M,R){this.manager=M,this.set(R)}Ng.prototype={set:function(M){M==xT&&(M=this.compute()),bT&&this.manager.element.style&&lp[M]&&(this.manager.element.style[_T]=M),this.actions=M.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var M=[];return h(this.manager.recognizers,function(R){b(R.options.enable,[R])&&(M=M.concat(R.getTouchAction()))}),uV(M.join(" "))},preventDefaults:function(M){var R=M.srcEvent,G=M.offsetDirection;if(this.manager.session.prevented){R.preventDefault();return}var Q=this.actions,oe=C(Q,Ya)&&!lp[Ya],xe=C(Q,Dl)&&!lp[Dl],ze=C(Q,Fl)&&!lp[Fl];if(oe){var Wt=M.pointers.length===1,Zt=M.distance<2,fr=M.deltaTime<250;if(Wt&&Zt&&fr)return}if(!(ze&&xe)&&(oe||xe&&G&Ke||ze&&G&ln))return this.preventSrc(R)},preventSrc:function(M){this.manager.session.prevented=!0,M.preventDefault()}};function uV(M){if(C(M,Ya))return Ya;var R=C(M,Fl),G=C(M,Dl);return R&&G?Ya:R||G?R?Fl:Dl:C(M,Dg)?Dg:AT}function lV(){if(!bT)return!1;var M={},R=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(G){M[G]=R?t.CSS.supports("touch-action",G):!0}),M}var fp=1,Ur=2,_s=4,ta=8,fi=ta,Nl=16,In=32;function ci(M){this.options=v({},this.defaults,M||{}),this.id=ee(),this.manager=null,this.options.enable=x(this.options.enable,!0),this.state=fp,this.simultaneous={},this.requireFail=[]}ci.prototype={defaults:{},set:function(M){return v(this.options,M),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(M){if(p(M,"recognizeWith",this))return this;var R=this.simultaneous;return M=cp(M,this),R[M.id]||(R[M.id]=M,M.recognizeWith(this)),this},dropRecognizeWith:function(M){return p(M,"dropRecognizeWith",this)?this:(M=cp(M,this),delete this.simultaneous[M.id],this)},requireFailure:function(M){if(p(M,"requireFailure",this))return this;var R=this.requireFail;return M=cp(M,this),O(R,M)===-1&&(R.push(M),M.requireFailure(this)),this},dropRequireFailure:function(M){if(p(M,"dropRequireFailure",this))return this;M=cp(M,this);var R=O(this.requireFail,M);return R>-1&&this.requireFail.splice(R,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(M){return!!this.simultaneous[M.id]},emit:function(M){var R=this,G=this.state;function Q(oe){R.manager.emit(oe,M)}G<ta&&Q(R.options.event+ST(G)),Q(R.options.event),M.additionalEvent&&Q(M.additionalEvent),G>=ta&&Q(R.options.event+ST(G))},tryEmit:function(M){if(this.canEmit())return this.emit(M);this.state=In},canEmit:function(){for(var M=0;M<this.requireFail.length;){if(!(this.requireFail[M].state&(In|fp)))return!1;M++}return!0},recognize:function(M){var R=v({},M);if(!b(this.options.enable,[this,R])){this.reset(),this.state=In;return}this.state&(fi|Nl|In)&&(this.state=fp),this.state=this.process(R),this.state&(Ur|_s|ta|Nl)&&this.tryEmit(R)},process:function(M){},getTouchAction:function(){},reset:function(){}};function ST(M){return M&Nl?"cancel":M&ta?"end":M&_s?"move":M&Ur?"start":""}function TT(M){return M==Ht?"down":M==Ct?"up":M==Rr?"left":M==ea?"right":""}function cp(M,R){var G=R.manager;return G?G.get(M):M}function pn(){ci.apply(this,arguments)}y(pn,ci,{defaults:{pointers:1},attrTest:function(M){var R=this.options.pointers;return R===0||M.pointers.length===R},process:function(M){var R=this.state,G=M.eventType,Q=R&(Ur|_s),oe=this.attrTest(M);return Q&&(G&ft||!oe)?R|Nl:Q||oe?G&Oe?R|ta:R&Ur?R|_s:Ur:In}});function pp(){pn.apply(this,arguments),this.pX=null,this.pY=null}y(pp,pn,{defaults:{event:"pan",threshold:10,pointers:1,direction:fn},getTouchAction:function(){var M=this.options.direction,R=[];return M&Ke&&R.push(Dl),M&ln&&R.push(Fl),R},directionTest:function(M){var R=this.options,G=!0,Q=M.distance,oe=M.direction,xe=M.deltaX,ze=M.deltaY;return oe&R.direction||(R.direction&Ke?(oe=xe===0?un:xe<0?Rr:ea,G=xe!=this.pX,Q=Math.abs(M.deltaX)):(oe=ze===0?un:ze<0?Ct:Ht,G=ze!=this.pY,Q=Math.abs(M.deltaY))),M.direction=oe,G&&Q>R.threshold&&oe&R.direction},attrTest:function(M){return pn.prototype.attrTest.call(this,M)&&(this.state&Ur||!(this.state&Ur)&&this.directionTest(M))},emit:function(M){this.pX=M.deltaX,this.pY=M.deltaY;var R=TT(M.direction);R&&(M.additionalEvent=this.options.event+R),this._super.emit.call(this,M)}});function jg(){pn.apply(this,arguments)}y(jg,pn,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Ya]},attrTest:function(M){return this._super.attrTest.call(this,M)&&(Math.abs(M.scale-1)>this.options.threshold||this.state&Ur)},emit:function(M){if(M.scale!==1){var R=M.scale<1?"in":"out";M.additionalEvent=this.options.event+R}this._super.emit.call(this,M)}});function Ug(){ci.apply(this,arguments),this._timer=null,this._input=null}y(Ug,ci,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[AT]},process:function(M){var R=this.options,G=M.pointers.length===R.pointers,Q=M.distance<R.threshold,oe=M.deltaTime>R.time;if(this._input=M,!Q||!G||M.eventType&(Oe|ft)&&!oe)this.reset();else if(M.eventType&we)this.reset(),this._timer=f(function(){this.state=fi,this.tryEmit()},R.time,this);else if(M.eventType&Oe)return fi;return In},reset:function(){clearTimeout(this._timer)},emit:function(M){this.state===fi&&(M&&M.eventType&Oe?this.manager.emit(this.options.event+"up",M):(this._input.timeStamp=l(),this.manager.emit(this.options.event,this._input)))}});function Gg(){pn.apply(this,arguments)}y(Gg,pn,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Ya]},attrTest:function(M){return this._super.attrTest.call(this,M)&&(Math.abs(M.rotation)>this.options.threshold||this.state&Ur)}});function zg(){pn.apply(this,arguments)}y(zg,pn,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Ke|ln,pointers:1},getTouchAction:function(){return pp.prototype.getTouchAction.call(this)},attrTest:function(M){var R=this.options.direction,G;return R&(Ke|ln)?G=M.overallVelocity:R&Ke?G=M.overallVelocityX:R&ln&&(G=M.overallVelocityY),this._super.attrTest.call(this,M)&&R&M.offsetDirection&&M.distance>this.options.threshold&&M.maxPointers==this.options.pointers&&u(G)>this.options.velocity&&M.eventType&Oe},emit:function(M){var R=TT(M.offsetDirection);R&&this.manager.emit(this.options.event+R,M),this.manager.emit(this.options.event,M)}});function hp(){ci.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}y(hp,ci,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Dg]},process:function(M){var R=this.options,G=M.pointers.length===R.pointers,Q=M.distance<R.threshold,oe=M.deltaTime<R.time;if(this.reset(),M.eventType&we&&this.count===0)return this.failTimeout();if(Q&&oe&&G){if(M.eventType!=Oe)return this.failTimeout();var xe=this.pTime?M.timeStamp-this.pTime<R.interval:!0,ze=!this.pCenter||li(this.pCenter,M.center)<R.posThreshold;this.pTime=M.timeStamp,this.pCenter=M.center,!ze||!xe?this.count=1:this.count+=1,this._input=M;var Wt=this.count%R.taps;if(Wt===0)return this.hasRequireFailures()?(this._timer=f(function(){this.state=fi,this.tryEmit()},R.interval,this),Ur):fi}return In},failTimeout:function(){return this._timer=f(function(){this.state=In},this.options.interval,this),In},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==fi&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function pi(M,R){return R=R||{},R.recognizers=x(R.recognizers,pi.defaults.preset),new Vg(M,R)}pi.VERSION="2.0.7",pi.defaults={domEvents:!1,touchAction:xT,enable:!0,inputTarget:null,inputClass:null,preset:[[Gg,{enable:!1}],[jg,{enable:!1},["rotate"]],[zg,{direction:Ke}],[pp,{direction:Ke},["swipe"]],[hp],[hp,{event:"doubletap",taps:2},["tap"]],[Ug]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var fV=1,wT=2;function Vg(M,R){this.options=v({},pi.defaults,R||{}),this.options.inputTarget=this.options.inputTarget||M,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=M,this.input=Bl(this),this.touchAction=new Ng(this,this.options.touchAction),PT(this,!0),h(this.options.recognizers,function(G){var Q=this.add(new G[0](G[1]));G[2]&&Q.recognizeWith(G[2]),G[3]&&Q.requireFailure(G[3])},this)}Vg.prototype={set:function(M){return v(this.options,M),M.touchAction&&this.touchAction.update(),M.inputTarget&&(this.input.destroy(),this.input.target=M.inputTarget,this.input.init()),this},stop:function(M){this.session.stopped=M?wT:fV},recognize:function(M){var R=this.session;if(!R.stopped){this.touchAction.preventDefaults(M);var G,Q=this.recognizers,oe=R.curRecognizer;(!oe||oe&&oe.state&fi)&&(oe=R.curRecognizer=null);for(var xe=0;xe<Q.length;)G=Q[xe],R.stopped!==wT&&(!oe||G==oe||G.canRecognizeWith(oe))?G.recognize(M):G.reset(),!oe&&G.state&(Ur|_s|ta)&&(oe=R.curRecognizer=G),xe++}},get:function(M){if(M instanceof ci)return M;for(var R=this.recognizers,G=0;G<R.length;G++)if(R[G].options.event==M)return R[G];return null},add:function(M){if(p(M,"add",this))return this;var R=this.get(M.options.event);return R&&this.remove(R),this.recognizers.push(M),M.manager=this,this.touchAction.update(),M},remove:function(M){if(p(M,"remove",this))return this;if(M=this.get(M),M){var R=this.recognizers,G=O(R,M);G!==-1&&(R.splice(G,1),this.touchAction.update())}return this},on:function(M,R){if(M!==n&&R!==n){var G=this.handlers;return h(I(M),function(Q){G[Q]=G[Q]||[],G[Q].push(R)}),this}},off:function(M,R){if(M!==n){var G=this.handlers;
10return h(I(M),function(Q){R?G[Q]&&G[Q].splice(O(G[Q],R),1):delete G[Q]}),this}},emit:function(M,R){this.options.domEvents&&cV(M,R);var G=this.handlers[M]&&this.handlers[M].slice();if(!(!G||!G.length)){R.type=M,R.preventDefault=function(){R.srcEvent.preventDefault()};for(var Q=0;Q<G.length;)G[Q](R),Q++}},destroy:function(){this.element&&PT(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function PT(M,R){var G=M.element;if(G.style){var Q;h(M.options.cssProps,function(oe,xe){Q=H(G.style,xe),R?(M.oldCssProps[Q]=G.style[Q],G.style[Q]=oe):G.style[Q]=M.oldCssProps[Q]||""}),R||(M.oldCssProps={})}}function cV(M,R){var G=r.createEvent("Event");G.initEvent(M,!0,!0),G.gesture=R,R.target.dispatchEvent(G)}v(pi,{INPUT_START:we,INPUT_MOVE:Ne,INPUT_END:Oe,INPUT_CANCEL:ft,STATE_POSSIBLE:fp,STATE_BEGAN:Ur,STATE_CHANGED:_s,STATE_ENDED:ta,STATE_RECOGNIZED:fi,STATE_CANCELLED:Nl,STATE_FAILED:In,DIRECTION_NONE:un,DIRECTION_LEFT:Rr,DIRECTION_RIGHT:ea,DIRECTION_UP:Ct,DIRECTION_DOWN:Ht,DIRECTION_HORIZONTAL:Ke,DIRECTION_VERTICAL:ln,DIRECTION_ALL:fn,Manager:Vg,Input:_r,TouchAction:Ng,TouchInput:up,MouseInput:sp,PointerEventInput:Bg,TouchMouseInput:Fg,SingleTouchInput:mT,Recognizer:ci,AttrRecognizer:pn,Tap:hp,Pan:pp,Swipe:zg,Pinch:jg,Rotate:Gg,Press:Ug,on:w,off:P,each:h,merge:g,extend:m,assign:v,inherit:y,bindFn:_,prefixed:H});var pV=typeof t<"u"?t:typeof self<"u"?self:{};pV.Hammer=pi,n==="function"&&define.amd?define(function(){return pi}):typeof vd<"u"&&vd.exports?vd.exports=pi:t[e]=pi})(window,document,"Hammer")});var JL=yt((ZWe,zb)=>{"use strict";zb.exports=Zd;zb.exports.default=Zd;function Zd(t,r,e){e=e||2;var n=r&&r.length,i=n?r[0]*e:t.length,a=YL(t,0,i,e,!0),o=[];if(!a||a.next===a.prev)return o;var s,u,l,f,p,h,d;if(n&&(a=TQ(t,r,a,e)),t.length>80*e){s=l=t[0],u=f=t[1];for(var v=e;v<i;v+=e)p=t[v],h=t[v+1],p<s&&(s=p),h<u&&(u=h),p>l&&(l=p),h>f&&(f=h);d=Math.max(l-s,f-u),d=d!==0?32767/d:0}return fc(a,o,e,s,u,d,0),o}function YL(t,r,e,n,i){var a,o;if(i===Gb(t,r,e,n)>0)for(a=r;a<e;a+=n)o=qL(a,t[a],t[a+1],o);else for(a=e-n;a>=r;a-=n)o=qL(a,t[a],t[a+1],o);return o&&Jd(o,o.next)&&(pc(o),o=o.next),o}function No(t,r){if(!t)return t;r||(r=t);var e=t,n;do if(n=!1,!e.steiner&&(Jd(e,e.next)||Tt(e.prev,e,e.next)===0)){if(pc(e),e=r=e.prev,e===e.next)break;n=!0}else e=e.next;while(n||e!==r);return r}function fc(t,r,e,n,i,a,o){if(t){!o&&a&&CQ(t,n,i,a);for(var s=t,u,l;t.prev!==t.next;){if(u=t.prev,l=t.next,a?xQ(t,n,i,a):bQ(t)){r.push(u.i/e|0),r.push(t.i/e|0),r.push(l.i/e|0),pc(t),t=l.next,s=l.next;continue}if(t=l,t===s){o?o===1?(t=AQ(No(t),r,e),fc(t,r,e,n,i,a,2)):o===2&&SQ(t,r,e,n,i,a):fc(No(t),r,e,n,i,a,1);break}}}}function bQ(t){var r=t.prev,e=t,n=t.next;if(Tt(r,e,n)>=0)return!1;for(var i=r.x,a=e.x,o=n.x,s=r.y,u=e.y,l=n.y,f=i<a?i<o?i:o:a<o?a:o,p=s<u?s<l?s:l:u<l?u:l,h=i>a?i>o?i:o:a>o?a:o,d=s>u?s>l?s:l:u>l?u:l,v=n.next;v!==r;){if(v.x>=f&&v.x<=h&&v.y>=p&&v.y<=d&&Iu(i,s,a,u,o,l,v.x,v.y)&&Tt(v.prev,v,v.next)>=0)return!1;v=v.next}return!0}function xQ(t,r,e,n){var i=t.prev,a=t,o=t.next;if(Tt(i,a,o)>=0)return!1;for(var s=i.x,u=a.x,l=o.x,f=i.y,p=a.y,h=o.y,d=s<u?s<l?s:l:u<l?u:l,v=f<p?f<h?f:h:p<h?p:h,m=s>u?s>l?s:l:u>l?u:l,g=f>p?f>h?f:h:p>h?p:h,y=jb(d,v,r,e,n),_=jb(m,g,r,e,n),b=t.prevZ,x=t.nextZ;b&&b.z>=y&&x&&x.z<=_;){if(b.x>=d&&b.x<=m&&b.y>=v&&b.y<=g&&b!==i&&b!==o&&Iu(s,f,u,p,l,h,b.x,b.y)&&Tt(b.prev,b,b.next)>=0||(b=b.prevZ,x.x>=d&&x.x<=m&&x.y>=v&&x.y<=g&&x!==i&&x!==o&&Iu(s,f,u,p,l,h,x.x,x.y)&&Tt(x.prev,x,x.next)>=0))return!1;x=x.nextZ}for(;b&&b.z>=y;){if(b.x>=d&&b.x<=m&&b.y>=v&&b.y<=g&&b!==i&&b!==o&&Iu(s,f,u,p,l,h,b.x,b.y)&&Tt(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;x&&x.z<=_;){if(x.x>=d&&x.x<=m&&x.y>=v&&x.y<=g&&x!==i&&x!==o&&Iu(s,f,u,p,l,h,x.x,x.y)&&Tt(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function AQ(t,r,e){var n=t;do{var i=n.prev,a=n.next.next;!Jd(i,a)&&KL(i,n,n.next,a)&&cc(i,a)&&cc(a,i)&&(r.push(i.i/e|0),r.push(n.i/e|0),r.push(a.i/e|0),pc(n),pc(n.next),n=t=a),n=n.next}while(n!==t);return No(n)}function SQ(t,r,e,n,i,a){var o=t;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&RQ(o,s)){var u=ZL(o,s);o=No(o,o.next),u=No(u,u.next),fc(o,r,e,n,i,a,0),fc(u,r,e,n,i,a,0);return}s=s.next}o=o.next}while(o!==t)}function TQ(t,r,e,n){var i=[],a,o,s,u,l;for(a=0,o=r.length;a<o;a++)s=r[a]*n,u=a<o-1?r[a+1]*n:t.length,l=YL(t,s,u,n,!1),l===l.next&&(l.steiner=!0),i.push(IQ(l));for(i.sort(wQ),a=0;a<i.length;a++)e=PQ(i[a],e);return e}function wQ(t,r){return t.x-r.x}function PQ(t,r){var e=OQ(t,r);if(!e)return r;var n=ZL(e,t);return No(n,n.next),No(e,e.next)}function OQ(t,r){var e=r,n=t.x,i=t.y,a=-1/0,o;
10do{if(i<=e.y&&i>=e.next.y&&e.next.y!==e.y){var s=e.x+(i-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(s<=n&&s>a&&(a=s,o=e.x<e.next.x?e:e.next,s===n))return o}e=e.next}while(e!==r);if(!o)return null;var u=o,l=o.x,f=o.y,p=1/0,h;e=o;do n>=e.x&&e.x>=l&&n!==e.x&&Iu(i<f?n:a,i,l,f,i<f?a:n,i,e.x,e.y)&&(h=Math.abs(i-e.y)/(n-e.x),cc(e,t)&&(h<p||h===p&&(e.x>o.x||e.x===o.x&&EQ(o,e)))&&(o=e,p=h)),e=e.next;while(e!==u);return o}function EQ(t,r){return Tt(t.prev,t,r.prev)<0&&Tt(r.next,t,t.next)<0}function CQ(t,r,e,n){var i=t;do i.z===0&&(i.z=jb(i.x,i.y,r,e,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,MQ(i)}function MQ(t){var r,e,n,i,a,o,s,u,l=1;do{for(e=t,t=null,a=null,o=0;e;){for(o++,n=e,s=0,r=0;r<l&&(s++,n=n.nextZ,!!n);r++);for(u=l;s>0||u>0&&n;)s!==0&&(u===0||!n||e.z<=n.z)?(i=e,e=e.nextZ,s--):(i=n,n=n.nextZ,u--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;e=n}a.nextZ=null,l*=2}while(o>1);return t}function jb(t,r,e,n,i){return t=(t-e)*i|0,r=(r-n)*i|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,t|r<<1}function IQ(t){var r=t,e=t;do(r.x<e.x||r.x===e.x&&r.y<e.y)&&(e=r),r=r.next;while(r!==t);return e}function Iu(t,r,e,n,i,a,o,s){return(i-o)*(r-s)>=(t-o)*(a-s)&&(t-o)*(n-s)>=(e-o)*(r-s)&&(e-o)*(a-s)>=(i-o)*(n-s)}function RQ(t,r){return t.next.i!==r.i&&t.prev.i!==r.i&&!LQ(t,r)&&(cc(t,r)&&cc(r,t)&&kQ(t,r)&&(Tt(t.prev,t,r.prev)||Tt(t,r.prev,r))||Jd(t,r)&&Tt(t.prev,t,t.next)>0&&Tt(r.prev,r,r.next)>0)}function Tt(t,r,e){return(r.y-t.y)*(e.x-r.x)-(r.x-t.x)*(e.y-r.y)}function Jd(t,r){return t.x===r.x&&t.y===r.y}function KL(t,r,e,n){var i=Kd(Tt(t,r,e)),a=Kd(Tt(t,r,n)),o=Kd(Tt(e,n,t)),s=Kd(Tt(e,n,r));return!!(i!==a&&o!==s||i===0&&Yd(t,e,r)||a===0&&Yd(t,n,r)||o===0&&Yd(e,t,n)||s===0&&Yd(e,r,n))}function Yd(t,r,e){return r.x<=Math.max(t.x,e.x)&&r.x>=Math.min(t.x,e.x)&&r.y<=Math.max(t.y,e.y)&&r.y>=Math.min(t.y,e.y)}function Kd(t){return t>0?1:t<0?-1:0}function LQ(t,r){var e=t;do{if(e.i!==t.i&&e.next.i!==t.i&&e.i!==r.i&&e.next.i!==r.i&&KL(e,e.next,t,r))return!0;e=e.next}while(e!==t);return!1}function cc(t,r){return Tt(t.prev,t,t.next)<0?Tt(t,r,t.next)>=0&&Tt(t,t.prev,r)>=0:Tt(t,r,t.prev)<0||Tt(t,t.next,r)<0}function kQ(t,r){var e=t,n=!1,i=(t.x+r.x)/2,a=(t.y+r.y)/2;do e.y>a!=e.next.y>a&&e.next.y!==e.y&&i<(e.next.x-e.x)*(a-e.y)/(e.next.y-e.y)+e.x&&(n=!n),e=e.next;while(e!==t);return n}function ZL(t,r){var e=new Ub(t.i,t.x,t.y),n=new Ub(r.i,r.x,r.y),i=t.next,a=r.prev;return t.next=r,r.prev=t,e.next=i,i.prev=e,n.next=e,e.prev=n,a.next=n,n.prev=a,n}function qL(t,r,e,n){var i=new Ub(t,r,e);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function pc(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 Ub(t,r,e){this.i=t,this.x=r,this.y=e,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}Zd.deviation=function(t,r,e,n){var i=r&&r.length,a=i?r[0]*e:t.length,o=Math.abs(Gb(t,0,a,e));if(i)for(var s=0,u=r.length;s<u;s++){var l=r[s]*e,f=s<u-1?r[s+1]*e:t.length;o-=Math.abs(Gb(t,l,f,e))}var p=0;for(s=0;s<n.length;s+=3){var h=n[s]*e,d=n[s+1]*e,v=n[s+2]*e;p+=Math.abs((t[h]-t[v])*(t[d+1]-t[h+1])-(t[h]-t[d])*(t[v+1]-t[h+1]))}return o===0&&p===0?0:Math.abs((p-o)/o)};function Gb(t,r,e,n){for(var i=0,a=r,o=e-n;a<e;a+=n)i+=(t[o]-t[a])*(t[a+1]+t[o+1]),o=a;return i}Zd.flatten=function(t){for(var r=t[0][0].length,e={vertices:[],holes:[],dimensions:r},n=0,i=0;i<t.length;i++){for(var a=0;a<t[i].length;a++)for(var o=0;o<r;o++)e.vertices.push(t[i][a][o]);i>0&&(n+=t[i-1].length,e.holes.push(n))}return e}});var cv=yt(Li=>{"use strict";var sB=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",Lee=sB+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",uB="["+sB+"]["+Lee+"]*",kee=new RegExp("^"+uB+"$"),Bee=function(r,e){for(var n=[],i=e.exec(r);i;){var a=[];a.startIndex=e.lastIndex-i[0].length;for(var o=i.length,s=0;s<o;s++)a.push(i[s]);n.push(a),i=e.exec(r)}return n},Fee=function(r){var e=kee.exec(r);return!(e===null||typeof e>"u")};Li.isExist=function(t){return typeof t<"u"};Li.isEmptyObject=function(t){return Object.keys(t).length===0};Li.merge=function(t,r,e){if(r)for(var n=Object.keys(r),i=n.length,a=0;a<i;a++)e==="strict"?t[n[a]]=[r[n[a]]]:t[n[a]]=r[n[a]]};Li.getValue=function(t){return Li.isExist(t)?t:""};Li.isName=Fee;Li.getAllMatches=Bee;Li.nameRegexp=uB});var Zb=yt(hB=>{"use strict";var Kb=cv(),Dee={allowBooleanAttributes:!1,unpairedTags:[]};hB.validate=function(t,r){r=Object.assign({},Dee,r);var e=[],n=!1,i=!1;t[0]==="\uFEFF"&&(t=t.substr(1));for(var a=0;a<t.length;a++)if(t[a]==="<"&&t[a+1]==="?"){if(a+=2,a=fB(t,a),a.err)return a}else if(t[a]==="<"){var o=a;if(a++,t[a]==="!"){a=cB(t,a);continue}else{var s=!1;t[a]==="/"&&(s=!0,a++);for(var u="";a<t.length&&t[a]!==">"&&t[a]!==" "&&t[a]!=="	"&&t[a]!==`
11`&&t[a]!=="\r";a++)u+=t[a];if(u=u.trim(),u[u.length-1]==="/"&&(u=u.substring(0,u.length-1),a--),!Wee(u)){var l=void 0;return u.trim().length===0?l="Invalid space after '<'.":l="Tag '"+u+"' is an invali
11d name.",Nt("InvalidTag",l,Pr(t,a))}var f=Uee(t,a);if(f===!1)return Nt("InvalidAttr","Attributes for '"+u+"' have open quote.",Pr(t,a));var p=f.value;if(a=f.index,p[p.length-1]==="/"){var h=a-p.length;p=p.substring(0,p.length-1);var d=pB(p,r);if(d===!0)n=!0;else return Nt(d.err.code,d.err.msg,Pr(t,h+d.err.line))}else if(s)if(f.tagClosed){if(p.trim().length>0)return Nt("InvalidTag","Closing tag '"+u+"' can't have attributes or invalid starting.",Pr(t,o));var v=e.pop();if(u!==v.tagName){var m=Pr(t,v.tagStartPos);return Nt("InvalidTag","Expected closing tag '"+v.tagName+"' (opened in line "+m.line+", col "+m.col+") instead of closing tag '"+u+"'.",Pr(t,o))}e.length==0&&(i=!0)}else return Nt("InvalidTag","Closing tag '"+u+"' doesn't have proper closing.",Pr(t,a));else{var g=pB(p,r);if(g!==!0)return Nt(g.err.code,g.err.msg,Pr(t,a-p.length+g.err.line));if(i===!0)return Nt("InvalidXml","Multiple possible root nodes found.",Pr(t,a));r.unpairedTags.indexOf(u)!==-1||e.push({tagName:u,tagStartPos:o}),n=!0}for(a++;a<t.length;a++)if(t[a]==="<")if(t[a+1]==="!"){a++,a=cB(t,a);continue}else if(t[a+1]==="?"){if(a=fB(t,++a),a.err)return a}else break;else if(t[a]==="&"){var y=Vee(t,a);if(y==-1)return Nt("InvalidChar","char '&' is not expected.",Pr(t,a));a=y}else if(i===!0&&!lB(t[a]))return Nt("InvalidXml","Extra text at the end",Pr(t,a));t[a]==="<"&&a--}}else{if(lB(t[a]))continue;return Nt("InvalidChar","char '"+t[a]+"' is not expected.",Pr(t,a))}if(n){if(e.length==1)return Nt("InvalidTag","Unclosed tag '"+e[0].tagName+"'.",Pr(t,e[0].tagStartPos));if(e.length>0)return Nt("InvalidXml","Invalid '"+JSON.stringify(e.map(function(_){return _.tagName}),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return Nt("InvalidXml","Start tag expected.",1);return!0};function lB(t){return t===" "||t==="	"||t===`
12`||t==="\r"}function fB(t,r){for(var e=r;r<t.length;r++)if(t[r]=="?"||t[r]==" "){var n=t.substr(e,r-e);if(r>5&&n==="xml")return Nt("InvalidXml","XML declaration allowed only at the start of the document.",Pr(t,r));if(t[r]=="?"&&t[r+1]==">"){r++;break}else continue}return r}function cB(t,r){if(t.length>r+5&&t[r+1]==="-"&&t[r+2]==="-"){for(r+=3;r<t.length;r++)if(t[r]==="-"&&t[r+1]==="-"&&t[r+2]===">"){r+=2;break}}else if(t.length>r+8&&t[r+1]==="D"&&t[r+2]==="O"&&t[r+3]==="C"&&t[r+4]==="T"&&t[r+5]==="Y"&&t[r+6]==="P"&&t[r+7]==="E"){var e=1;for(r+=8;r<t.length;r++)if(t[r]==="<")e++;else if(t[r]===">"&&(e--,e===0))break}else if(t.length>r+9&&t[r+1]==="["&&t[r+2]==="C"&&t[r+3]==="D"&&t[r+4]==="A"&&t[r+5]==="T"&&t[r+6]==="A"&&t[r+7]==="["){for(r+=8;r<t.length;r++)if(t[r]==="]"&&t[r+1]==="]"&&t[r+2]===">"){r+=2;break}}return r}var Nee='"',jee="'";function Uee(t,r){for(var e="",n="",i=!1;r<t.length;r++){if(t[r]===Nee||t[r]===jee)n===""?n=t[r]:n!==t[r]||(n="");else if(t[r]===">"&&n===""){i=!0;break}e+=t[r]}return n!==""?!1:{value:e,index:r,tagClosed:i}}var Gee=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function pB(t,r){for(var e=Kb.getAllMatches(t,Gee),n={},i=0;i<e.length;i++){if(e[i][1].length===0)return Nt("InvalidAttr","Attribute '"+e[i][2]+"' has no space in starting.",gc(e[i]));if(e[i][3]!==void 0&&e[i][4]===void 0)return Nt("InvalidAttr","Attribute '"+e[i][2]+"' is without value.",gc(e[i]));if(e[i][3]===void 0&&!r.allowBooleanAttributes)return Nt("InvalidAttr","boolean attribute '"+e[i][2]+"' is not allowed.",gc(e[i]));var a=e[i][2];if(!Hee(a))return Nt("InvalidAttr","Attribute '"+a+"' is an invalid name.",gc(e[i]));if(!n.hasOwnProperty(a))n[a]=1;else return Nt("InvalidAttr","Attribute '"+a+"' is repeated.",gc(e[i]))}return!0}function zee(t,r){var e=/\d/;for(t[r]==="x"&&(r++,e=/[\da-fA-F]/);r<t.length;r++){if(t[r]===";")return r;if(!t[r].match(e))break}return-1}function Vee(t,r){if(r++,t[r]===";")return-1;if(t[r]==="#")return r++,zee(t,r);for(var e=0;r<t.length;r++,e++)if(!(t[r].match(/\w/)&&e<20)){if(t[r]===";")break;return-1}return r}function Nt(t,r,e){return{err:{code:t,msg:r,line:e.line||e,col:e.col}}}function Hee(t){return Kb.isName(t)}function Wee(t){return Kb.isName(t)}function Pr(t,r){var e=t.substring(0,r).split(/\r?\n/);return{line:e.length,col:e[e.length-1].length+1}}function gc(t){return t.startIndex+t[1].length}});var vB=yt(Jb=>{var dB={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(r,e){return e},attributeValueProcessor:function(r,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:function(){return!1},commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(r,e,n){return r}},$ee=function(r){return Object.assign({},dB,r)};Jb.buildOptions=$ee;Jb.defaultOptions=dB});var gB=yt((WXe,mB)=>{"use strict";k();F();j();var Xee=function(){function t(r){A(this,t),this.tagname=r,this.child=[],this[":@"]={}}return T(t,[{key:"add",value:function(e,n){e==="__proto__"&&(e="#__proto__"),this.child.push(c({},e,n))}},{key:"addChild",value:function(e){if(e.tagname==="__proto__"&&(e.tagname="#__proto__"),e[":@"]&&Object.keys(e[":@"]).length>0){var n;this.child.push((n={},c(n,e.tagname,e.child),c(n,":@",e[":@"]),n))}else this.child.push(c({},e.tagname,e.child))}}]),t}();mB.exports=Xee});var _B=yt((XXe,yB)=>{be();var qee=cv();function Yee(t,r){var e={};
12if(t[r+3]==="O"&&t[r+4]==="C"&&t[r+5]==="T"&&t[r+6]==="Y"&&t[r+7]==="P"&&t[r+8]==="E"){r=r+9;for(var n=1,i=!1,a=!1,o="";r<t.length;r++)if(t[r]==="<"&&!a){if(i&&Jee(t,r)){r+=7;var s=Kee(t,r+1),u=W(s,3);entityName=u[0],val=u[1],r=u[2],val.indexOf("&")===-1&&(e[rte(entityName)]={regx:RegExp("&".concat(entityName,";"),"g"),val})}else if(i&&Qee(t,r))r+=8;else if(i&&ete(t,r))r+=8;else if(i&&tte(t,r))r+=9;else if(Zee)a=!0;else throw new Error("Invalid DOCTYPE");n++,o=""}else if(t[r]===">"){if(a?t[r-1]==="-"&&t[r-2]==="-"&&(a=!1,n--):n--,n===0)break}else t[r]==="["?i=!0:o+=t[r];if(n!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:e,i:r}}function Kee(t,r){for(var e="";r<t.length&&t[r]!=="'"&&t[r]!=='"';r++)e+=t[r];if(e=e.trim(),e.indexOf(" ")!==-1)throw new Error("External entites are not supported");for(var n=t[r++],i="";r<t.length&&t[r]!==n;r++)i+=t[r];return[e,i,r]}function Zee(t,r){return t[r+1]==="!"&&t[r+2]==="-"&&t[r+3]==="-"}function Jee(t,r){return t[r+1]==="!"&&t[r+2]==="E"&&t[r+3]==="N"&&t[r+4]==="T"&&t[r+5]==="I"&&t[r+6]==="T"&&t[r+7]==="Y"}function Qee(t,r){return t[r+1]==="!"&&t[r+2]==="E"&&t[r+3]==="L"&&t[r+4]==="E"&&t[r+5]==="M"&&t[r+6]==="E"&&t[r+7]==="N"&&t[r+8]==="T"}function ete(t,r){return t[r+1]==="!"&&t[r+2]==="A"&&t[r+3]==="T"&&t[r+4]==="T"&&t[r+5]==="L"&&t[r+6]==="I"&&t[r+7]==="S"&&t[r+8]==="T"}function tte(t,r){return t[r+1]==="!"&&t[r+2]==="N"&&t[r+3]==="O"&&t[r+4]==="T"&&t[r+5]==="A"&&t[r+6]==="T"&&t[r+7]==="I"&&t[r+8]==="O"&&t[r+9]==="N"}function rte(t){if(qee.isName(t))return t;throw new Error("Invalid entity name ".concat(t))}yB.exports=Yee});var xB=yt((qXe,bB)=>{var nte=/^[-+]?0x[a-fA-F0-9]+$/,ite=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt);!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);var ate={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};function ote(t,r={}){if(r=Object.assign({},ate,r),!t||typeof t!="string")return t;let e=t.trim();if(r.skipLike!==void 0&&r.skipLike.test(e))return t;if(r.hex&&nte.test(e))return Number.parseInt(e,16);{let n=ite.exec(e);if(n){let i=n[1],a=n[2],o=ste(n[3]),s=n[4]||n[6];if(!r.leadingZeros&&a.length>0&&i&&e[2]!==".")return t;if(!r.leadingZeros&&a.length>0&&!i&&e[1]!==".")return t;{let u=Number(e),l=""+u;return l.search(/[eE]/)!==-1||s?r.eNotation?u:t:e.indexOf(".")!==-1?l==="0"&&o===""||l===o||i&&l==="-"+o?u:t:a?o===l||i+o===l?u:t:e===l||e===i+l?u:t}}else return t}}function ste(t){return t&&t.indexOf(".")!==-1&&(t=t.replace(/0+$/,""),t==="."?t="0":t[0]==="."?t="0"+t:t[t.length-1]==="."&&(t=t.substr(0,t.length-1))),t}bB.exports=ote});var SB=yt((QXe,AB)=>{"use strict";k();Ge();F();var t1=cv(),yc=gB(),ute=_B(),lte=xB(),JXe="<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g,t1.nameRegexp),fte=function t(r){A(this,t),this.options=r,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"\xA2"},pound:{regex:/&(pound|#163);/g,val:"\xA3"},yen:{regex:/&(yen|#165);/g,val:"\xA5"},euro:{regex:/&(euro|#8364);/g,val:"\u20AC"},copyright:{regex:/&(copy|#169);/g,val:"\xA9"},reg:{regex:/&(reg|#174);/g,val:"\xAE"},inr:{regex:/&(inr|#8377);/g,val:"\u20B9"}},this.addExternalEntities=cte,this.parseXml=mte,this.parseTextData=pte,this.resolveNameSpace=hte,this.buildAttributesMap=vte,this.isItStopNode=bte,this.replaceEntitiesValue=yte,this.readStopNodeData=Ate,this.saveTextToParentTag=_te,this.addChild=gte};function cte(t){for(var r=Object.keys(t),e=0;e<r.length;e++){var n=r[e];this.lastEntities[n]={regex:new RegExp("&"+n+";","g"),val:t[n]}}}function pte(t,r,e,n,i,a,o){if(t!==void 0&&(this.options.trimValues&&!n&&(t=t.trim()),t.length>0)){o||(t=this.replaceEntitiesValue(t));var s=this.options.tagValueProcessor(r,t,e,i,a);if(s==null)return t;if(ue(s)!==ue(t)||s!==t)return s;if(this.options.trimValues)return e1(t,this.options.parseTagValue,this.options.numberParseOptions);var u=t.trim();return u===t?e1(t,this.options.parseTagValue,this.options.numberParseOptions):t}}function hte(t){if(this.options.removeNSPrefix){var r=t.split(":"),e=t.charAt(0)==="/"?"/":"";if(r[0]==="xmlns")return"";r.length===2&&(t=e+r[1])}return t}var dte=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function vte(t,r,e){if(!this.options.ignoreAttributes&&typeof t=="string"){for(var n=t1.getAllMatches(t,dte),i=n.length,a={},o=0;o<i;o++){var s=this.resolveNameSpace(n[o][1]),u=n[o][4],l=this.options.attributeNamePrefix+s;if(s.length)if(this.options.transformAttributeName&&(l=this.options.transformAttributeName(l)),l==="__proto__"&&(l="#__proto__"),u!==void 0){this.options.trimValues&&(u=u.trim()),u=this.replaceEntitiesValue(u);var f=this.options.attributeValueProcessor(s,u,r);f==null?a[l]=u:ue(f)!==ue(u)||f!==u?a[l]=f:a[l]=e1(u,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(a[l]=!0)}if(!Object.keys(a).length)return;if(this.options.attributesGroupName){var p={};return p[this.options.attributesGroupName]=a,p}return a}}var mte=function(r){r=r.replace(/\r\n?/g,`
13`);for(var e=new yc("!xml"),n=e,i="",a="",o=0;o<r.length;o++){var s=r[o];if(s==="<")if(r[o+1]==="/"){var u=Uo(r,">",o,"Closing Tag is not closed."),l=r.substring(o+2,u).trim();if(this.options.removeNSPrefix){var f=l.indexOf(":");f!==-1&&(l=l.substr(f+1))}this.options.transformTagName&&(l=this.options.transformTagName(l)),n&&(i=this.saveTextToParentTag(i,n,a));var p=a.substring(a.lastIndexOf(".")+1);if(l&&this.options.unpairedTags.indexOf(l)!==-1)throw new Error("Unpaired tag can not be used as closing tag: </".concat(l,">"));var h=0;p&&this.options.unpairedTags.indexOf(p)!==-1?(h=a.lastIndexOf(".",a.lastIndexOf(".")-1),this.tagsNodeStack.pop()):h=a.lastIndexOf("."),a=a.substring(0,h),n=this.tagsNodeStack.pop(),i="",o=u}else if(r[o+1]==="?"){var d=Qb(r,o,!1,"?>");if(!d)throw new Error("Pi Tag is not closed.");if(i=this.saveTextToParentTag(i,n,a),!(this.options.ignoreDeclaration&&d.tagName==="?xml"||this.options.ignorePiTags)){var v=new yc(d.tagName);v.add(this.options.textNodeName,""),d.tagName!==d.tagExp&&d.attrExpPresent&&(v["
13:@"]=this.buildAttributesMap(d.tagExp,a,d.tagName)),this.addChild(n,v,a)}o=d.closeIndex+1}else if(r.substr(o+1,3)==="!--"){var m=Uo(r,"-->",o+4,"Comment is not closed.");if(this.options.commentPropName){var g=r.substring(o+4,m-2);i=this.saveTextToParentTag(i,n,a),n.add(this.options.commentPropName,[c({},this.options.textNodeName,g)])}o=m}else if(r.substr(o+1,2)==="!D"){var y=ute(r,o);this.docTypeEntities=y.entities,o=y.i}else if(r.substr(o+1,2)==="!["){var _=Uo(r,"]]>",o,"CDATA is not closed.")-2,b=r.substring(o+9,_);if(i=this.saveTextToParentTag(i,n,a),this.options.cdataPropName)n.add(this.options.cdataPropName,[c({},this.options.textNodeName,b)]);else{var x=this.parseTextData(b,n.tagname,a,!0,!1,!0);x==null&&(x=""),n.add(this.options.textNodeName,x)}o=_+2}else{var w=Qb(r,o,this.options.removeNSPrefix),P=w.tagName,E=w.tagExp,C=w.attrExpPresent,I=w.closeIndex;this.options.transformTagName&&(P=this.options.transformTagName(P)),n&&i&&n.tagname!=="!xml"&&(i=this.saveTextToParentTag(i,n,a,!1));var O=n;if(O&&this.options.unpairedTags.indexOf(O.tagname)!==-1&&(n=this.tagsNodeStack.pop(),a=a.substring(0,a.lastIndexOf("."))),P!==e.tagname&&(a+=a?"."+P:P),this.isItStopNode(this.options.stopNodes,a,P)){var D="";if(E.length>0&&E.lastIndexOf("/")===E.length-1)o=w.closeIndex;else if(this.options.unpairedTags.indexOf(P)!==-1)o=w.closeIndex;else{var N=this.readStopNodeData(r,P,I+1);if(!N)throw new Error("Unexpected end of ".concat(P));o=N.i,D=N.tagContent}var H=new yc(P);P!==E&&C&&(H[":@"]=this.buildAttributesMap(E,a,P)),D&&(D=this.parseTextData(D,P,a,!0,C,!0,!0)),a=a.substr(0,a.lastIndexOf(".")),H.add(this.options.textNodeName,D),this.addChild(n,H,a)}else{if(E.length>0&&E.lastIndexOf("/")===E.length-1){P[P.length-1]==="/"?(P=P.substr(0,P.length-1),a=a.substr(0,a.length-1),E=P):E=E.substr(0,E.length-1),this.options.transformTagName&&(P=this.options.transformTagName(P));var $=new yc(P);P!==E&&C&&($[":@"]=this.buildAttributesMap(E,a,P)),this.addChild(n,$,a),a=a.substr(0,a.lastIndexOf("."))}else{var ee=new yc(P);this.tagsNodeStack.push(n),P!==E&&C&&(ee[":@"]=this.buildAttributesMap(E,a,P)),this.addChild(n,ee,a),n=ee}i="",o=I}}else i+=r[o]}return e.child};function gte(t,r,e){var n=this.options.updateTag(r.tagname,e,r[":@"]);n===!1||(typeof n=="string"&&(r.tagname=n),t.addChild(r))}var yte=function(r){if(this.options.processEntities){for(var e in this.docTypeEntities){var n=this.docTypeEntities[e];r=r.replace(n.regx,n.val)}for(var i in this.lastEntities){var a=this.lastEntities[i];r=r.replace(a.regex,a.val)}if(this.options.htmlEntities)for(var o in this.htmlEntities){var s=this.htmlEntities[o];r=r.replace(s.regex,s.val)}r=r.replace(this.ampEntity.regex,this.ampEntity.val)}return r};function _te(t,r,e,n){return t&&(n===void 0&&(n=Object.keys(r.child).length===0),t=this.parseTextData(t,r.tagname,e,!1,r[":@"]?Object.keys(r[":@"]).length!==0:!1,n),t!==void 0&&t!==""&&r.add(this.options.textNodeName,t),t=""),t}function bte(t,r,e){var n="*."+e;for(var i in t){var a=t[i];if(n===a||r===a)return!0}return!1}function xte(t,r){for(var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:">",n,i="",a=r;a<t.length;a++){var o=t[a];if(n)o===n&&(n="");else if(o==='"'||o==="'")n=o;else if(o===e[0])if(e[1]){if(t[a+1]===e[1])return{data:i,index:a}}else return{data:i,index:a};else o==="	"&&(o=" ");i+=o}}function Uo(t,r,e,n){var i=t.indexOf(r,e);if(i===-1)throw new Error(n);return i+r.length-1}function Qb(t,r,e){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:">",i=xte(t,r+1,n);if(i){var a=i.data,o=i.index,s=a.search(/\s/),u=a,l=!0;if(s!==-1&&(u=a.substr(0,s).replace(/\s\s*$/,""),a=a.substr(s+1)),e){var f=u.indexOf(":");f!==-1&&(u=u.substr(f+1),l=u!==i.data.substr(f+1))}return{tagName:u,tagExp:a,closeIndex:o,attrExpPresent:l}}}function Ate(t,r,e){for(var n=e,i=1;e<t.length;e++)if(t[e]==="<")if(t[e+1]==="/"){var a=Uo(t,">",e,"".concat(r," is not closed")),o=t.substring(e+2,a).trim();if(o===r&&(i--,i===0))return{tagContent:t.substring(n,e),i:a};e=a}else if(t[e+1]==="?"){var s=Uo(t,"?>",e+1,"StopNode is not closed.");e=s}else if(t.substr(e+1,3)==="!--"){var u=Uo(t,"-->",e+3,"StopNode is not closed.");e=u}else if(t.substr(e+1,2)==="!["){var l=Uo(t,"]]>",e,"StopNode is not closed.")-2;e=l}else{var f=Qb(t,e,">");if(f){var p=f&&f.tagName;p===r&&f.tagExp[f.tagExp.length-1]!=="/"&&i++,e=f.closeIndex}}}function e1(t,r,e){if(r&&typeof t=="string"){var n=t.trim();return n==="true"?!0:n==="false"?!1:lte(t,e)}else return t1.isExist(t)?t:""}AB.exports=fte});var PB=yt(wB=>{"use strict";function Ste(t,r){return TB(t,r)}function TB(t,r,e){for(var n,i={},a=0;a<t.length;a++){var o=t[a],s=Tte(o),u="";if(e===void 0?u=s:u=e+"."+s,s===r.textNodeName)n===void 0?n=o[s]:n+=""+o[s];else{if(s===void 0)continue;if(o[s]){var l=TB(o[s],r,u),f=Pte(l,r);o[":@"]?wte(l,o[":@"],u,r):Object.keys(l).length===1&&l[r.textNodeName]!==void 0&&!r.alwaysCreateTextNode?l=l[r.textNodeName]:Object.keys(l).length===0&&(r.alwaysCreateTextNode?l[r.textNodeName]="":l=""),i[s]!==void 0&&i.hasOwnProperty(s)?(Array.isArray(i[s])||(i[s]=[i[s]]),i[s].push(l)):r.isArray(s,u,f)?i[s]=[l]:i[s]=l}}}return typeof n=="string"?n.length>0&&(i[r.textNodeName]=n):n!==void 0&&(i[r.textNodeName]=n),i}function Tte(t){for(var r=Object.keys(t),e=0;e<r.length;e++){var n=r[e];if(n!==":@")return n}}function wte(t,r,e,n){if(r)for(var i=Object.keys(r),a=i.length,o=0;o<a;o++){var s=i[o];n.isArray(s,e+"."+s,!0,!0)?t[s]=[r[s]]:t[s]=r[s]}}function Pte(t,r){var e=r.textNodeName,n=Object.keys(t).length;return!!(n===0||n===1&&(t[e]||typeof t[e]=="boolean"||t[e]===0))}wB.prettify=Ste});var EB=yt((nqe,OB)=>{F();j();var Ote=vB(),Ete=Ote.buildOptions,Cte=SB(),Mte=PB(),Ite=Mte.prettify,Rte=Zb(),Lte=function(){function t(r){A(this,t),this.externalEntities={},this.options=Ete(r)}return T(t,[{key:"parse",value:function(e,n){if(typeof e!="string")if(e.toString)e=e.toString();else throw new Error("XML data is accepted in String or Bytes[] form.");if(n){n===!0&&(n={});var i=Rte.validate(e,n);if(i!==!0)throw Error("".concat(i.err.msg,":").concat(i.err.line,":").concat(i.err.col))}var a=new Cte(this.options);a.addExternalEntities(this.externalEntities);var o=a.parseXml(e);return this.options.preserveOrder||o===void 0?o:Ite(o,this.options)}},{key:"addEntity",value:function(e,n){if(n.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(e.indexOf("&")!==-1||e.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if(n==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[e]=n}}]),t}();OB.exports=Lte});var LB=yt((iqe,RB)=>{var kte=`
14`;function Bte(t,r){var e="";return r.format&&r.indentBy.length>0&&(e=kte),MB(t,r,"",e)}function MB(t,r,e,n){for(var i="",a=!1,o=0;o<t.length;o++){var s=t[o],u=Fte(s),l="";if(e.length===0?l=u:l="".concat(e,".").concat(u),u===r.textNodeName){var f=s[u];Dte(l,r)||(f=r.tagValueProcessor(u,f),f=IB(f,r)),a&&(i+=n),i+=f,a=!1;continue}else if(u===r.cdataPropName){a&&(i+=n),i+="<![CDATA[".concat(s[u][0][r.textNodeName],"]]>"),a=!1;continue}else if(u===r.commentPropName){i+=n+"<!--".concat(s[u][0][r.textNodeName],"-->"),a=!0;continue}else if(u[0]==="?"){var p=CB(s[":@"],r),h=u==="?xml"?"":n,d=s[u][0][r.textNodeName];
14d=d.length!==0?" "+d:"",i+=h+"<".concat(u).concat(d).concat(p,"?>"),a=!0;continue}var v=n;v!==""&&(v+=r.indentBy);var m=CB(s[":@"],r),g=n+"<".concat(u).concat(m),y=MB(s[u],r,l,v);r.unpairedTags.indexOf(u)!==-1?r.suppressUnpairedNode?i+=g+">":i+=g+"/>":(!y||y.length===0)&&r.suppressEmptyNode?i+=g+"/>":y&&y.endsWith(">")?i+=g+">".concat(y).concat(n,"</").concat(u,">"):(i+=g+">",y&&n!==""&&(y.includes("/>")||y.includes("</"))?i+=n+r.indentBy+y+n:i+=y,i+="</".concat(u,">")),a=!0}return i}function Fte(t){for(var r=Object.keys(t),e=0;e<r.length;e++){var n=r[e];if(n!==":@")return n}}function CB(t,r){var e="";if(t&&!r.ignoreAttributes)for(var n in t){var i=r.attributeValueProcessor(n,t[n]);i=IB(i,r),i===!0&&r.suppressBooleanAttributes?e+=" ".concat(n.substr(r.attributeNamePrefix.length)):e+=" ".concat(n.substr(r.attributeNamePrefix.length),'="').concat(i,'"')}return e}function Dte(t,r){t=t.substr(0,t.length-r.textNodeName.length-1);var e=t.substr(t.lastIndexOf(".")+1);for(var n in r.stopNodes)if(r.stopNodes[n]===t||r.stopNodes[n]==="*."+e)return!0;return!1}function IB(t,r){if(t&&t.length>0&&r.processEntities)for(var e=0;e<r.entities.length;e++){var n=r.entities[e];t=t.replace(n.regex,n.val)}return t}RB.exports=Bte});var BB=yt((sqe,kB)=>{"use strict";Ge();k();var Nte=LB(),jte={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:"  ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(r,e){return e},attributeValueProcessor:function(r,e){return e},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1};function Ma(t){this.options=Object.assign({},jte,t),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=zte),this.processTextOrObjNode=Ute,this.options.format?(this.indentate=Gte,this.tagEndChar=`>
15`,this.newLine=`
16`):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}Ma.prototype.build=function(t){return this.options.preserveOrder?Nte(t,this.options):(Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(t=c({},this.options.arrayNodeName,t)),this.j2x(t,0).val)};Ma.prototype.j2x=function(t,r){var e="",n="";for(var i in t)if(typeof t[i]>"u")this.isAttribute(i)&&(n+="");else if(t[i]===null)this.isAttribute(i)?n+="":i[0]==="?"?n+=this.indentate(r)+"<"+i+"?"+this.tagEndChar:n+=this.indentate(r)+"<"+i+"/"+this.tagEndChar;else if(t[i]instanceof Date)n+=this.buildTextValNode(t[i],i,"",r);else if(ue(t[i])!=="object"){var a=this.isAttribute(i);if(a)e+=this.buildAttrPairStr(a,""+t[i]);else if(i===this.options.textNodeName){var o=this.options.tagValueProcessor(i,""+t[i]);n+=this.replaceEntitiesValue(o)}else n+=this.buildTextValNode(t[i],i,"",r)}else if(Array.isArray(t[i])){for(var s=t[i].length,u="",l=0;l<s;l++){var f=t[i][l];typeof f>"u"||(f===null?i[0]==="?"?n+=this.indentate(r)+"<"+i+"?"+this.tagEndChar:n+=this.indentate(r)+"<"+i+"/"+this.tagEndChar:ue(f)==="object"?this.options.oneListGroup?u+=this.j2x(f,r+1).val:u+=this.processTextOrObjNode(f,i,r):u+=this.buildTextValNode(f,i,"",r))}this.options.oneListGroup&&(u=this.buildObjectNode(u,i,"",r)),n+=u}else if(this.options.attributesGroupName&&i===this.options.attributesGroupName)for(var p=Object.keys(t[i]),h=p.length,d=0;d<h;d++)e+=this.buildAttrPairStr(p[d],""+t[i][p[d]]);else n+=this.processTextOrObjNode(t[i],i,r);return{attrStr:e,val:n}};Ma.prototype.buildAttrPairStr=function(t,r){return r=this.options.attributeValueProcessor(t,""+r),r=this.replaceEntitiesValue(r),this.options.suppressBooleanAttributes&&r==="true"?" "+t:" "+t+'="'+r+'"'};function Ute(t,r,e){var n=this.j2x(t,e+1);return t[this.options.textNodeName]!==void 0&&Object.keys(t).length===1?this.buildTextValNo
16de(t[this.options.textNodeName],r,n.attrStr,e):this.buildObjectNode(n.val,r,n.attrStr,e)}Ma.prototype.buildObjectNode=function(t,r,e,n){if(t==="")return r[0]==="?"?this.indentate(n)+"<"+r+e+"?"+this.tagEndChar:this.indentate(n)+"<"+r+e+this.closeTag(r)+this.tagEndChar;var i="</"+r+this.tagEndChar,a="";return r[0]==="?"&&(a="?",i=""),(e||e==="")&&t.indexOf("<")===-1?this.indentate(n)+"<"+r+e+a+">"+t+i:this.options.commentPropName!==!1&&r===this.options.commentPropName&&a.length===0?this.indentate(n)+"<!--".concat(t,"-->")+this.newLine:this.indentate(n)+"<"+r+e+a+this.tagEndChar+t+this.indentate(n)+i};Ma.prototype.closeTag=function(t){var r="";return this.options.unpairedTags.indexOf(t)!==-1?this.options.suppressUnpairedNode||(r="/"):this.options.suppressEmptyNode?r="/":r="></".concat(t),r};Ma.prototype.buildTextValNode=function(t,r,e,n){if(this.options.cdataPropName!==!1&&r===this.options.cdataPropName)return this.indentate(n)+"<![CDATA[".concat(t,"]]>")+this.newLine;if(this.options.commentPropName!==!1&&r===this.options.commentPropName)return this.indentate(n)+"<!--".concat(t,"-->")+this.newLine;if(r[0]==="?")return this.indentate(n)+"<"+r+e+"?"+this.tagEndChar;var i=this.options.tagValueProcessor(r,t);return i=this.replaceEntitiesValue(i),i===""?this.indentate(n)+"<"+r+e+this.closeTag(r)+this.tagEndChar:this.indentate(n)+"<"+r+e+">"+i+"</"+r+this.tagEndChar};Ma.prototype.replaceEntitiesValue=function(t){if(t&&t.length>0&&this.options.processEntities)for(var r=0;r<this.options.entities.length;r++){var e=this.options.entities[r];t=t.replace(e.regex,e.val)}return t};function Gte(t){return this.options.indentBy.repeat(t)}function zte(t){return t.startsWith(this.options.attributeNamePrefix)&&t!==this.options.textNodeName?t.substr(this.attrPrefixLen):!1}kB.exports=Ma});var DB=yt((uqe,FB)=>{"use strict";var Vte=Zb(),Hte=EB(),Wte=BB();FB.exports={XMLParser:Hte,XMLValidator:Vte,XMLBuilder:Wte}});var g1=yt((p3,Tc)=>{(function(t,r){typeof define=="function"&&define.amd?define([],r):typeof OT=="function"&&typeof Tc=="object"&&Tc&&Tc.exports?Tc.exports=r():(t.dcodeIO=t.dcodeIO||{}).Long=r()})(p3,function(){"use strict";function t(I,O,D){this.low=I|0,this.high=O|0,this.unsigned=!!D}t.prototype.__isLong__,Object.defineProperty(t.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1});function r(I){return(I&&I.__isLong__)===!0}t.isLong=r;var e={},n={};function i(I,O){var D,N,H;return O?(I>>>=0,(H=0<=I&&I<256)&&(N=n[I],N)?N:(D=o(I,(I|0)<0?-1:0,!0),H&&(n[I]=D),D)):(I|=0,(H=-128<=I&&I<128)&&(N=e[I],N)?N:(D=o(I,I<0?-1:0,!1),H&&(e[I]=D),D))}t.fromInt=i;function a(I,O){if(isNaN(I)||!isFinite(I))return O?y:g;if(O){if(I<0)return y;if(I>=d)return P}else{if(I<=-v)return E;if(I+1>=v)return w}return I<0?a(-I,O).neg():o(I%h|0,I/h|0,O)}t.fromNumber=a;function o(I,O,D){return new t(I,O,D)}t.fromBits=o;var s=Math.pow;function u(I,O,D){if(I.length===0)throw Error("empty string");if(I==="NaN"||I==="Infinity"||I==="+Infinity"||I==="-Infinity")return g;if(typeof O=="number"?(D=O,O=!1):O=!!O,D=D||10,D<2||36<D)throw RangeError("radix");var N;if((N=I.indexOf("-"))>0)throw Error("interior hyphen");if(N===0)return u(I.substring(1),O,D).neg();for(var H=a(s(D,8)),$=g,ee=0;ee<I.length;ee+=8){var V=Math.min(8,I.length-ee),U=parseInt(I.substring(ee,ee+V),D);if(V<8){var X=a(s(D,V));$=$.mul(X).add(a(U))}else $=$.mul(H),$=$.add(a(U))}return $.unsigned=O,$}t.fromString=u;function l(I){return I instanceof t?I:typeof I=="number"?a(I):typeof I=="string"?u(I):o(I.low,I.high,I.unsigned)}t.fromValue=l;var f=1<<16,p=1<<24,h=f*f,d=h*h,v=d/2,m=i(p),g=i(0);t.ZERO=g;var y=i(0,!0);t.UZERO=y;var _=i(1);t.ONE=_;var b=i(1,!0);t.UONE=b;var x=i(-1);t.NEG_ONE=x;var w=o(-1,2147483647,!1);t.MAX_VALUE=w;var P=o(-1,-1,!0);t.MAX_UNSIGNED_VALUE=P;var E=o(0,-2147483648,!1);t.MIN_VALUE=E;var C=t.prototype;return C.toInt=function(){return this.unsigned?this.low>>>0:this.low},C.toNumber=function(){return this.unsigned?(this.high>>>0)*h+(this.low>>>0):this.high*h+(this.low>>>0)},C.toString=function(O){if(O=O||10,O<2||36<O)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(E)){var D=a(O),N=this.div(D),H=N.mul(D).sub(this);return N.toString(O)+H.toInt().toString(O)}else return"-"+this.neg().toString(O);for(var $=a(s(O,6),this.unsigned),ee=this,V="";;){var U=ee.div($),X=ee.sub(U.mul($)).toInt()>>>0,K=X.toString(O);if(ee=U,ee.isZero())return K+V;for(;K.length<6;)K="0"+K;V=""+K+V}},C.getHighBits=function(){return this.high},C.getHighBitsUnsigned=function(){return this.high>>>0},C.getLowBits=function(){return this.low},C.getLowBitsUnsigned=function(){return this.low>>>0},C.getNumBitsAbs=function(){if(this.isNegative())return this.eq(E)?64:this.neg().getNumBitsAbs();for(var O=this.high!=0?this.high:this.low,D=31;D>0&&!(O&1<<D);D--);return this.high!=0?D+33:D+1},C.isZero=function(){return this.high===0&&this.low===0},C.isNegative=function(){return!this.unsigned&&this.high<0},C.isPositive=function(){return this.unsigned||this.high>=0},C.isOdd=function(){return(this.low&1)===1},C.isEven=function(){return(this.low&1)===0},C.equals=function(O){return r(O)||(O=l(O)),this.unsigned!==O.unsigned&&this.high>>>31===1&&O.high>>>31===1?!1:this.high===O.high&&this.low===O.low},C.eq=C.equals,C.notEquals=function(O){return!this.eq(O)},C.neq=C.notEquals,C.lessThan=function(O){return this.comp(O)<0},C.lt=C.lessThan,C.lessThanOrEqual=function(O){return this.comp(O)<=0},C.lte=C.lessThanOrEqual,C.greaterThan=function(O){return this.comp(O)>0}
vendor: 17,199 bytes, line 16
16,C.gt=C.greaterThan,C.greaterThanOrEqual=function(O){return this.comp(O)>=0},C.gte=C.greaterThanOrEqual,C.compare=function(O){if(r(O)||(O=l(O)),this.eq(O))return 0;var D=this.isNegative(),N=O.isNegative();return D&&!N?-1:!D&&N?1:this.unsigned?O.high>>>0>this.high>>>0||O.high===this.high&&O.low>>>0>this.low>>>0?-1:1:this.sub(O).isNegative()?-1:1},C.comp=C.compare,C.negate=function(){return!this.unsigned&&this.eq(E)?E:this.not().add(_)},C.neg=C.negate,C.add=function(O){r(O)||(O=l(O));var D=this.high>>>16,N=this.high&65535,H=this.low>>>16,$=this.low&65535,ee=O.high>>>16,V=O.high&65535,U=O.low>>>16,X=O.low&65535,K=0,te=0,ie=0,ce=0;return ce+=$+X,ie+=ce>>>16,ce&=65535,ie+=H+U,te+=ie>>>16,ie&=65535,te+=N+V,K+=te>>>16,te&=65535,K+=D+ee,K&=65535,o(ie<<16|ce,K<<16|te,this.unsigned)},C.subtract=function(O){return r(O)||(O=l(O)),this.add(O.neg())},C.sub=C.subtract,C.multiply=function(O){if(this.isZero()||(r(O)||(O=l(O)),O.isZero()))return g;if(this.eq(E))return O.isOdd()?E:g;if(O.eq(E))return this.isOdd()?E:g;if(this.isNegative())return O.isNegative()?this.neg().mul(O.neg()):this.neg().mul(O).neg();if(O.isNegative())return this.mul(O.neg()).neg();if(this.lt(m)&&O.lt(m))return a(this.toNumber()*O.toNumber(),this.unsigned);var D=this.high>>>16,N=this.high&65535,H=this.low>>>16,$=this.low&65535,ee=O.high>>>16,V=O.high&65535,U=O.low>>>16,X=O.low&65535,K=0,te=0,ie=0,ce=0;return ce+=$*X,ie+=ce>>>16,ce&=65535,ie+=H*X,te+=ie>>>16,ie&=65535,ie+=$*U,te+=ie>>>16,ie&=65535,te+=N*X,K+=te>>>16,te&=65535,te+=H*U,K+=te>>>16,te&=65535,te+=$*V,K+=te>>>16,te&=65535,K+=D*X+N*U+H*V+$*ee,K&=65535,o(ie<<16|ce,K<<16|te,this.unsigned)},C.mul=C.multiply,C.divide=function(O){if(r(O)||(O=l(O)),O.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?y:g;var D,N,H;if(this.unsigned){if(O.unsigned||(O=O.toUnsigned()),O.gt(this))return y;if(O.gt(this.shru(1)))return b;H=y}else{if(this.eq(E)){if(O.eq(_)||O.eq(x))return E;if(O.eq(E))return _;var $=this.shr(1);return D=$.div(O).shl(1),D.eq(g)?O.isNegative()?_:x:(N=this.sub(O.mul(D)),H=D.add(N.div(O)),H)}else if(O.eq(E))return this.unsigned?y:g;if(this.isNegative())return O.isNegative()?this.neg().div(O.neg()):this.neg().div(O).neg();if(O.isNegative())return this.div(O.neg()).neg();H=g}for(N=this;N.gte(O);){D=Math.max(1,Math.floor(N.toNumber()/O.toNumber()));for(var ee=Math.ceil(Math.log(D)/Math.LN2),V=ee<=48?1:s(2,ee-48),U=a(D),X=U.mul(O);X.isNegative()||X.gt(N);)D-=V,U=a(D,this.unsigned),X=U.mul(O);U.isZero()&&(U=_),H=H.add(U),N=N.sub(X)}return H},C.div=C.divide,C.modulo=function(O){return r(O)||(O=l(O)),this.sub(this.div(O).mul(O))},C.mod=C.modulo,C.not=function(){return o(~this.low,~this.high,this.unsigned)},C.and=function(O){return r(O)||(O=l(O)),o(this.low&O.low,this.high&O.high,this.unsigned)},C.or=function(O){return r(O)||(O=l(O)),o(this.low|O.low,this.high|O.high,this.unsigned)},C.xor=function(O){return r(O)||(O=l(O)),o(this.low^O.low,this.high^O.high,this.unsigned)},C.shiftLeft=function(O){return r(O)&&(O=O.toInt()),(O&=63)===0?this:O<32?o(this.low<<O,this.high<<O|this.low>>>32-O,this.unsigned):o(0,this.low<<O-32,this.unsigned)},C.shl=C.shiftLeft,C.shiftRight=function(O){return r(O)&&(O=O.toInt()),(O&=63)===0?this:O<32?o(this.low>>>O|this.high<<32-O,this.high>>O,this.unsigned):o(this.high>>O-32,this.high>=0?0:-1,this.unsigned)},C.shr=C.shiftRight,C.shiftRightUnsigned=function(O){if(r(O)&&(O=O.toInt()),O&=63,O===0)return this;var D=this.high;if(O<32){var N=this.low;return o(N>>>O|D<<32-O,D>>>O,this.unsigned)}else return O===32?o(D,0,this.unsigned):o(D>>>O-32,0,this.unsigned)},C.shru=C.shiftRightUnsigned,C.toSigned=function(){return this.unsigned?o(this.low,this.high,!1):this},C.toUnsigned=function(){return this.unsigned?this:o(this.low,this.high,!0)},C.toBytes=function(I){return I?this.toBytesLE():this.toBytesBE()},C.toBytesLE=function(){var I=this.high,O=this.low;return[O&255,O>>>8&255,O>>>16&255,O>>>24&255,I&255,I>>>8&255,I>>>16&255,I>>>24&255]},C.toBytesBE=function(){var I=this.high,O=this.low;return[I>>>24&255,I>>>16&255,I>>>8&255,I&255,O>>>24&255,O>>>16&255,O>>>8&255,O&255]},t})});var Rv=yt((DQe,J3)=>{J3.exports=globalThis.h3||{}});var OU=yt(CS=>{CS.read=function(t,r,e,n,i){var a,o,s=i*8-n-1,u=(1<<s)-1,l=u>>1,f=-7,p=e?i-1:0,h=e?-1:1,d=t[r+p];for(p+=h,a=d&(1<<-f)-1,d>>=-f,f+=s;f>0;a=a*256+t[r+p],p+=h,f-=8);for(o=a&(1<<-f)-1,a>>=-f,f+=n;f>0;o=o*256+t[r+p],p+=h,f-=8);if(a===0)a=1-l;else{if(a===u)return o?NaN:(d?-1:1)*(1/0);o=o+Math.pow(2,n),a=a-l}return(d?-1:1)*o*Math.pow(2,a-n)};CS.write=function(t,r,e,n,i,a){var o,s,u,l=a*8-i-1,f=(1<<l)-1,p=f>>1,h=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,v=n?1:-1,m=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(s=isNaN(r)?1:0,o=f):(o=Math.floor(Math.log(r)/Math.LN2),r*(u=Math.pow(2,-o))<1&&(o--,u*=2),o+p>=1?r+=h/u:r+=h*Math.pow(2,1-p),r*u>=2&&(o++,u/=2),o+p>=f?(s=0,o=f):o+p>=1?(s=(r*u-1)*Math.pow(2,i),o=o+p):(s=r*Math.pow(2,p-1)*Math.pow(2,i),o=0));i>=8;t[e+d]=s&255,d+=v,s/=256,i-=8);for(o=o<<i|s,l+=i;l>0;t[e+d]=o&255,d+=v,o/=256,l-=8);t[e+d-v]|=m*128}});var LU=yt((_gt,RU)=>{"use strict";RU.exports=nt;var rg=OU();function nt(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}nt.Varint=0;nt.Fixed64=1;nt.Bytes=2;nt.Fixed32=5;var MS=(1<<16)*(1<<16),EU=1/MS,fce=12,IU=typeof TextDecoder>"u"?null:new TextDecoder("utf8");nt.prototype={destroy:function(){this.buf=null},readFields:function(t,r,e){for(e=e||this.length;this.pos<e;){var n=this.readVarint(),i=n>>3,a=this.pos;this.type=n&7,t(i,r,this),this.pos===a&&this.skip(n)}return r},readMessage:function(t,r){return this.readFields(t,r,this.readVarint()+this.pos)},readFixed32:function(){var t=ng(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=MU(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=ng(this.buf,this.pos)+ng(this.buf,this.pos+4)*MS;return this.pos+=8,t},readSFixed64:function(){var t=ng(this.buf,this.pos)+MU(this.buf,this.pos+4)*MS;return this.pos+=8,t},readFloat:function(){var t=rg.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=rg.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var r=this.buf,e,n;return n=r[this.pos++],e=n&127,n<128||(n=r[this.pos++],e|=(n&127)<<7,n<128)||(n=r[this.pos++],e|=(n&127)<<14,n<128)||(n=r[this.pos++],e|=(n&127)<<21,n<128)?e:(n=r[this.pos],e|=(n&15)<<28,cce(e,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,r=this.pos;return this.pos=t,t-r>=fce&&IU?wce(this.buf,r,t):Tce(this.buf,r,t)},readBytes:function(){var t=this.readVarint()+this.pos,r=this.buf.subarray(this.pos,t);return this.pos=t,r},readPackedVarint:function(t,r){if(this.type!==nt.Bytes)return t.push(this.readVarint(r));var e=Qi(this);for(t=t||[];this.pos<e;)t.push(this.readVarint(r));return t},readPackedSVarint:function(t){if(this.type!==nt.Bytes)return t.push(this.readSVarint());var r=Qi(this);for(t=t||[];this.pos<r;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==nt.Bytes)return t.push(this.readBoolean());var r=Qi(this);for(t=t||[];this.pos<r;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==nt.Bytes)return t.push(this.readFloat());var r=Qi(this);for(t=t||[];this.pos<r;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==nt.Bytes)return t.push(this.readDouble());var r=Qi(this);for(t=t||[];this.pos<r;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==nt.Bytes)return t.push(this.readFixed32());var r=Qi(this);for(t=t||[];this.pos<r;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==nt.Bytes)return t.push(this.readSFixed32());var r=Qi(this);for(t=t||[];this.pos<r;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==nt.Bytes)return t.push(this.readFixed64());var r=Qi(this);for(t=t||[];this.pos<r;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==nt.Bytes)return t.push(this.readSFixed64());var r=Qi(this);for(t=t||[];this.pos<r;)t.push(this.readSFixed64());return t},skip:function(t){var r=t&7;if(r===nt.Varint)for(;this.buf[this.pos++]>127;);else if(r===nt.Bytes)this.pos=this.readVarint()+this.pos;else if(r===nt.Fixed32)this.pos+=4;else if(r===nt.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+r)},writeTag:function(t,r){this.writeVarint(t<<3|r)},realloc:function(t){for(var r=this.length||16;r<this.pos+t;)r*=2;if(r!==this.length){var e=new Uint8Array(r);e.set(this.buf),this.buf=e,this.length=r}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),cl(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),cl(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),cl(this.buf,t&-1,this.pos),cl(this.buf,Math.floor(t*EU),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),cl(this.buf,t&-1,this.pos),cl(this.buf,Math.floor(t*EU),this.pos+4),this.pos+=8},writeVarint:function(t){if(t=+t||0,t>268435455||t<0){pce(t,this);return}this.realloc(4),this.buf[this.pos++]=t&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=t>>>7&127)))},writeSVarint:function(t){this.writeVarint(t<0?-t*2-1:t*2)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(t.length*4),this.pos++;var r=this.pos;this.pos=Pce(this.buf,t,this.pos);var e=this.pos-r;e>=128&&CU(r,e,this),this.pos=r-1,this.writeVarint(e),this.pos+=e},writeFloat:function(t){this.realloc(4),rg.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),rg.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var r=t.length;this.writeVarint(r),this.realloc(r);for(var e=0;e<r;e++)this.buf[this.pos++]=t[e]},writeRawMessage:function(t,r){this.pos++;var e=this.pos;t(r,this);var n=this.pos-e;n>=128&&CU(e,n,this),this.pos=e-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,r,e){this.writeTag(t,nt.Bytes),this.writeRawMessage(r,e)},writePackedVarint:function(t,r){r.length&&this.writeMessage(t,vce,r)},writePackedSVarint:function(t,r){r.length&&this.writeMessage(t,mce,r)},writePackedBoolean:function(t,r){r.length&&this.writeMessage(t,_ce,r)},writePackedFloat:function(t,r){r.length&&this.writeMessage(t,gce,r)},writePackedDouble:function(t,r){r.length&&this.writeMessage(t,yce,r)},writePackedFixed32:function(t,r){r.length&&this.writeMessage(t,bce,r)},writePackedSFixed32:function(t,r){r.length&&this.writeMessage(t,xce,r)},writePackedFixed64:function(t,r){r.length&&this.writeMessage(t,Ace,r)},writePackedSFixed64:function(t,r){r.length&&this.writeMessage(t,Sce,r)},writeBytesField:function(t,r){this.writeTag(t,nt.Bytes),this.writeBytes(r)},writeFixed32Field:function(t,r){this.writeTag(t,nt.Fixed32),this.writeFixed32(r)},writeSFixed32Field:function(t,r){this.writeTag(t,nt.Fixed32),this.writeSFixed32(r)},writeFixed64Field:function(t,r){this.writeTag(t,nt.Fixed64),this.writeFixed64(r)},writeSFixed64Field:function(t,r){this.writeTag(t,nt.Fixed64),this.writeSFixed64(r)},writeVarintField:function(t,r){this.writeTag(t,nt.Varint),this.writeVarint(r)},writeSVarintField:function(t,r){this.writeTag(t,nt.Varint),this.writeSVarint(r)},writeStringField:function(t,r){this.writeTag(t,nt.Bytes),this.writeString(r)},writeFloatField:function(t,r){this.writeTag(t,nt.Fixed32),this.writeFloat(r)},writeDoubleField:function(t,r){this.writeTag(t,nt.Fixed64),this.writeDouble(r)},writeBooleanField:function(t,r){this.writeVarintField(t,Boolean(r))}};function cce(t,r,e){var n=e.buf,i,a;if(a=n[e.pos++],i=(a&112)>>4,a<128||(a=n[e.pos++],i|=(a&127)<<3,a<128)||(a=n[e.pos++],i|=(a&127)<<10,a<128)||(a=n[e.pos++],i|=(a&127)<<17,a<128)||(a=n[e.pos++],i|=(a&127)<<24,a<128)||(a=n[e.pos++],i|=(a&1)<<31,a<128))return fl(t,i,r);throw new Error("Expected varint not more than 10 bytes")}function Qi(t){return t.type===nt.Bytes?t.readVarint()+t.pos:t.pos+1}function fl(t,r,e){return e?r*4294967296+(t>>>0):(r>>>0)*4294967296+(t>>>0)}function pce(t,r){var e,n;if(t>=0?(e=t%4294967296|0,n=t/4294967296|0):(e=~(-t%4294967296),n=~(-t/4294967296),e^4294967295?e=e+1|0:(e=0,n=n+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");r.realloc(10),hce(e,n,r),dce(n,r)}function hce(t,r,e){e.buf[e.pos++]=t&127|128,t>>>=7,e.buf[e.pos++]=t&127|128,t>>>=7,e.buf[e.pos++]=t&127|128,t>>>=7,e.buf[e.pos++]=t&127|128,t>>>=7,e.buf[e.pos]=t&127}function dce(t,r){var e=(t&7)<<4;r.buf[r.pos++]|=e|((t>>>=3)?128:0),t&&(r.buf[r.pos++]=t&127|((t>>>=7)?128:0),t&&(r.buf[r.pos++]=t&127|((t>>>=7)?128:0),t&&(r.buf[r.pos++]=t&127|((t>>>=7)?128:0),t&&(r.buf[r.pos++]=t&127|((t>>>=7)?128:0),t&&(r.buf[r.pos++]=t&127)))))}function CU(t,r,e){var n=r<=16383?1:r<=2097151?2:r<=268435455?3:Math.floor(Math.log(r)/(Math.LN2*7));e.realloc(n);for(var i=e.pos-1;i>=t;i--)e.buf[i+n]=e.buf[i]}function vce(t,r){for(var e=0;e<t.length;e++)r.writeVarint(t[e])}function mce(t,r){for(var e=0;e<t.length;e++)r.writeSVarint(t[e])}function gce(t,r){for(var e=0;e<t.length;e++)r.writeFloat(t[e])}function yce(t,r){for(var e=0;e<t.length;e++)r.writeDouble(t[e])}function _ce(t,r){for(var e=0;e<t.length;e++)r.writeBoolean(t[e])}function bce(t,r){for(var e=0;e<t.length;e++)r.writeFixed32(t[e])}function xce(t,r){for(var e=0;e<t.length;e++)r.writeSFixed32(t[e])}function Ace(t,r){for(var e=0;e<t.length;e++)r.writeFixed64(t[e])}function Sce(t,r){for(var e=0;e<t.length;e++)r.writeSFixed64(t[e])}function ng(t,r){return(t[r]|t[r+1]<<8|t[r+2]<<16)+t[r+3]*16777216}function cl(t,r,e){t[e]=r,t[e+1]=r>>>8,t[e+2]=r>>>16,t[e+3]=r>>>24}function MU(t,r){return(t[r]|t[r+1]<<8|t[r+2]<<16)+(t[r+3]<<24)}function Tce(t,r,e){for(var n="",i=r;i<e;){var a=t[i],o=null,s=a>239?4:a>223?3:a>191?2:1;if(i+s>e)break;var u,l,f;s===1?a<128&&(o=a):s===2?(u=t[i+1],(u&192)===128&&(o=(a&31)<<6|u&63,o<=127&&(o=null))):s===3?(u=t[i+1],l=t[i+2],(u&192)===128&&(l&192)===128&&(o=(a&15)<<12|(u&63)<<6|l&63,(o<=2047||o>=55296&&o<=57343)&&(o=null))):s===4&&(u=t[i+1],l=t[i+2],f=t[i+3],(u&192)===128&&(l&192)===128&&(f&192)===128&&(o=(a&15)<<18|(u&63)<<12|(l&63)<<6|f&63,(o<=65535||o>=1114112)&&(o=null))),o===null?(o=65533,s=1):o>65535&&(o-=65536,n+=String.fromCharCode(o>>>10&1023|55296),o=56320|o&1023),n+=String.fromCharCode(o),i+=s}return n}function wce(t,r,e){return IU.decode(t.subarray(r,e))}function Pce(t,r,e){for(var n=0,i,a;n<r.length;n++){if(i=r.charCodeAt(n),i>55295&&i<57344)if(a)if(i<56320){t[e++]=239,t[e++]=191,t[e++]=189,a=i;continue}else i=a-55296<<10|i-56320|65536,a=null;else{i>56319||n+1===r.length?(t[e++]=239,t[e++]=191,t[e++]=189):a=i;continue}else a&&(t[e++]=239,t[e++]=191,t[e++]=189,a=null);i<128?t[e++]=i:(i<2048?t[e++]=i>>6|192:(i<65536?t[e++]=i>>12|224:(t[e++]=i>>18|240,t[e++]=i>>12&63|128),t[e++]=i>>6&63|128),t[e++]=i&63|128)}return e}});var v6=yt((f0t,d6)=>{"use strict";var mpe="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";d6.exports=mpe});var _6=yt((c0t,y6)=>{"use strict";var gpe=v6();function m6(){}function g6(){}g6.resetWarningCache=m6;y6.exports=function(){function t(n,i,a,o,s,u){if(u!==gpe){var l=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 l.name="Invariant Violation",l}}t.isRequired=t;function r(){return t}var e={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:r,element:t,elementType:t,instanceOf:r,node:t,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:g6,resetWarningCache:m6};return e.PropTypes=e,e}});var x6=yt((d0t,b6)=>{b6.exports=_6()();var p0t,h0t});var kde={};Lr(kde,{AGGREGATION_OPERATION:()=>lt,AmbientLight:()=>Vh,ArcLayer:()=>Au,AttributeManager:()=>Sa,BitmapLayer:()=>Su,BrushingExtension:()=>Um,COORDINATE_SYSTEM:()=>de,CPUGridLayer:()=>hs,ClipExtension:()=>al,CollisionFilterExtension:()=>Xm,ColumnLayer:()=>Kn,CompositeLayer:()=>gt,ContourLayer:()=>Ag,Controller:()=>en,DataFilterExtension:()=>zm,Deck:()=>Nr,DeckGL:()=>P6,DeckRenderer:()=>pd,DirectionalLight:()=>So,FillStyleExtension:()=>Wm,FirstPersonController:()=>Dd,FirstPersonView:()=>Sb,FirstPersonViewport:()=>Bd,FlyToInterpolator:()=>MR,Fp64Extension:()=>xS,GPUGridLayer:()=>vs,GeoJsonLayer:()=>Ri,GeohashLayer:()=>ug,GoogleMapsOverlay:()=>kz,GreatCircleLayer:()=>yv,GridCellLayer:()=>Mu,GridLayer:()=>Tg,H3ClusterLayer:()=>kv,H3HexagonLayer:()=>ji,HeatmapLayer:()=>Pg,HexagonLayer:()=>gg,IconLayer:()=>Ta,Layer:()=>He,LayerExtension:()=>Et,LayerManager:()=>sd,LightingEffect:()=>Uf,LineLayer:()=>wu,LinearInterpolator:()=>Tr,MVTLayer:()=>sg,MapController:()=>fd,MapView:()=>ko,MapboxLayer:()=>Cg,MapboxOverlay:()=>Hz,MaskExtension:()=>qm,OPERATION:()=>SP,OrbitController:()=>Nd,OrbitView:()=>wb,OrbitViewport:()=>
16kd,OrthographicController:()=>jd,OrthographicView:()=>Pb,OrthographicViewport:()=>bu,PathLayer:()=>Zn,PathStyleExtension:()=>Hm,PointCloudLayer:()=>Pu,PointLight:()=>rd,PolygonLayer:()=>Qn,PostProcessEffect:()=>jM,QuadkeyLayer:()=>xv,S2Layer:()=>bv,ScatterplotLayer:()=>Ou,ScenegraphLayer:()=>Wu,ScreenGridLayer:()=>mg,SimpleMeshLayer:()=>Gi,SolidPolygonLayer:()=>Jn,TRANSITION_EVENTS:()=>Hf,TerrainLayer:()=>jm,Tesselator:()=>xu,TextLayer:()=>Fu,Tile3DLayer:()=>Im,TileLayer:()=>Ni,TransitionInterpolator:()=>fu,TripsLayer:()=>Iv,UNIT:()=>dt,VERSION:()=>Ip,View:()=>Qr,Viewport:()=>tr,WebMercatorViewport:()=>Sr,_AggregationLayer:()=>Cn,_BinSorter:()=>gl,_CPUAggregator:()=>_l,_CameraLight:()=>kM,_GPUGridAggregator:()=>lr,_GeoCellLayer:()=>rn,_GlobeController:()=>Ud,_GlobeView:()=>Ob,_GlobeViewport:()=>_u,_LayersPass:()=>br,_MultiIconLayer:()=>ku,_PickLayersPass:()=>_a,_SunLight:()=>FM,_TerrainExtension:()=>Jm,_TextBackgroundLayer:()=>Bu,_Tile2DHeader:()=>wc,_Tileset2D:()=>Mc,_WMSLayer:()=>gv,_compareProps:()=>mu,_count:()=>Cd,_deepEqual:()=>xt,_fillArray:()=>od,_flatten:()=>gr,_getURLFromTemplate:()=>ni,_memoize:()=>xr,_mergeShaders:()=>Ci,_registerLoggers:()=>Mp,assert:()=>Je,createIterable:()=>Ot,fp64LowPart:()=>An,gouraudLighting:()=>Dr,log:()=>ne,phongLighting:()=>xi,picking:()=>rt,project:()=>Ft,project32:()=>qe,project64:()=>Vm,shadow:()=>Co});be();function RT(t,r,e,n,i,a,o){try{var s=t[a](o),u=s.value}catch(l){e(l);return}s.done?r(u):Promise.resolve(u).then(n,i)}function Y(t){return function(){var r=this,e=arguments;return new Promise(function(n,i){var a=t.apply(r,e);function o(u){RT(a,n,i,o,s,"next",u)}function s(u){RT(a,n,i,o,s,"throw",u)}o(void 0)})}}F();j();function q(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function S(t){return S=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},S(t)}function Yg(t,r){for(;!Object.prototype.hasOwnProperty.call(t,r)&&(t=S(t),t!==null););return t}function Z(t,r,e){return typeof Reflect<"u"&&Reflect.get?Z=Reflect.get:Z=function(i,a,o){var s=Yg(i,a);if(s){var u=Object.getOwnPropertyDescriptor(s,a);return u.get?u.get.call(o):u.value}},Z(t,r,e||t)}function Ka(t,r){return Ka=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Ka(t,r)}function L(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),r&&Ka(t,r)}Ge();function B(t,r){if(r&&(ue(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return q(t)}k();var Ho=me(Ae());k();var Oy=me(Ae());function je(t,r){if(!t)throw new Error(r||"loader assertion failed.")}Ge();var kn={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},_V=kn.self||kn.window||kn.global||{},bV=kn.window||kn.self||kn.global||{},xV=kn.global||kn.self||kn.window||{},AV=kn.document||{};var hi=Boolean((typeof process>"u"?"undefined":ue(process))!=="object"||String(process)!=="[object process]"||process.browser);var FT=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),SV=FT&&parseFloat(FT[1])||0;Ge();be();k();function DT(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function TV(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?DT(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):DT(Object(e)).forEac
16h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function Jg(t,r){for(var e=TV({},t),n=0,i=Object.entries(r);n<i.length;n++){var a=W(i[n],2),o=a[0],s=a[1];s&&ue(s)==="object"?(e[o]=e[o]||{},Object.assign(e[o],r[o])):e[o]=r[o]}return e}var NT="3.4.13";function $t(t,r){if(!t)throw new Error(r||"loaders.gl assertion failed.")}Ge();var Bn={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},Ave=Bn.self||Bn.window||Bn.global||{},Sve=Bn.window||Bn.self||Bn.global||{},UT=Bn.global||Bn.self||Bn.window||{},Tve=Bn.document||{};var cr=(typeof process>"u"?"undefined":ue(process))!=="object"||String(process)!=="[object process]"||process.browser,Ul=typeof importScripts=="function",GT=typeof window<"u"&&typeof window.orientation<"u",jT=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),wve=jT&&parseFloat(jT[1])||0;F();j();k();var zT=function(){function t(r,e){var n=this;A(this,t),c(this,"name",void 0),c(this,"workerThread",void 0),c(this,"isRunning",!0),c(this,"result",void 0),c(this,"_resolve",function(){}),c(this,"_reject",function(){}),this.name=r,this.workerThread=e,this.result=new Promise(function(i,a){n._resolve=i,n._reject=a})}return T(t,[{key:"postMessage",value:function(e,n){this.workerThread.postMessage({source:"loaders.gl",type:e,payload:n})}},{key:"done",value:function(e){$t(this.isRunning),this.isRunning=!1,this._resolve(e)}},{key:"error",value:function(e){$t(this.isRunning),this.isRunning=!1,this._reject(e)}}]),t}();F();j();k();F();j();var vp=function(){function t(){A(this,t)}return T(t,[{key:"terminate",value:function(){}}]),t}();var Qg=new Map;function VT(t){$t(t.source&&!t.url||!t.source&&t.url);var r=Qg.get(t.source||t.url);return r||(t.url&&(r=wV(t.url),Qg.set(t.url,r)),t.source&&(r=HT(t.source),Qg.set(t.source,r))),$t(r),r}function wV(t){if(!t.startsWith("http"))return t;var r=PV(t);return HT(r)}function HT(t){var r=new Blob([t],{type:"application/javascript"});return URL.createObjectURL(r)}function PV(t){return`try {
17  importScripts('`.concat(t,`');
18} catch (error) {
19  console.error(error);
20  throw error;
21}`)}Ge();function ey(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,e=arguments.length>2?arguments[2]:void 0,n=e||new Set;if(t){if(WT(t))n.add(t);else if(WT(t.buffer))n.add(t.buffer);else if(!ArrayBuffer.isView(t)){if(r&&ue(t)==="object")for(var i in t)ey(t[i],r,n)}}return e===void 0?Array.from(n):[]}function WT(t){return t?t instanceof ArrayBuffer||typeof MessagePort<"u"&&t instanceof MessagePort||typeof ImageBitmap<"u"&&t instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas:!1}var ty=function(){},Gl=function(){function t(r){A(this,t),c(this,"name",void 0),c(this,"source",void 0),c(this,"url",void 0),c(this,"terminated",!1),c(this,"worker",void 0),c(this,"onMessage",void 0),c(this,"onError",void 0),c(this,"_loadableURL","");var e=r.name,n=r.source,i=r.url;$t(n||i),this.name=e,this.source=n,this.url=i,this.onMessage=ty,this.onError=function(a){return console.log(a)},this.worker=cr?this._createBrowserWorker():this._createNodeWorker()}return T(t,[{key:"destroy",value:function(){this.onMessage=ty,this.onError=ty,this.worker.terminate(),this.terminated=!0}},{key:"isRunning",get:function(){return Boolean(this.onMessage)}}
21,{key:"postMessage",value:function(e,n){n=n||ey(e),this.worker.postMessage(e,n)}},{key:"_getErrorFromErrorEvent",value:function(e){var n="Failed to load ";return n+="worker ".concat(this.name," from ").concat(this.url,". "),e.message&&(n+="".concat(e.message," in ")),e.lineno&&(n+=":".concat(e.lineno,":").concat(e.colno)),new Error(n)}},{key:"_createBrowserWorker",value:function(){var e=this;this._loadableURL=VT({source:this.source,url:this.url});var n=new Worker(this._loadableURL,{name:this.name});return n.onmessage=function(i){i.data?e.onMessage(i.data):e.onError(new Error("No data received"))},n.onerror=function(i){e.onError(e._getErrorFromErrorEvent(i)),e.terminated=!0},n.onmessageerror=function(i){return console.error(i)},n}},{key:"_createNodeWorker",value:function(){var e=this,n;if(this.url){var i=this.url.includes(":/")||this.url.startsWith("/"),a=i?this.url:"./".concat(this.url);n=new vp(a,{eval:!1})}else if(this.source)n=new vp(this.source,{eval:!0});else throw new Error("no worker");return n.on("message",function(o){e.onMessage(o)}),n.on("error",function(o){e.onError(o)}),n.on("exit",function(o){}),n}}],[{key:"isSupported",value:function(){return typeof Worker<"u"&&cr||typeof vp<"u"&&!cr}}]),t}();k();F();j();k();k();F();j();var zl=me(Ae());k();function $T(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function XT(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?$T(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):$T(Object(e)).forEac
21h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var qT=function(){function t(r){A(this,t),c(this,"name","unnamed"),c(this,"source",void 0),c(this,"url",void 0),c(this,"maxConcurrency",1),c(this,"maxMobileConcurrency",1),c(this,"onDebug",function(){}),c(this,"reuseWorkers",!0),c(this,"props",{}),c(this,"jobQueue",[]),c(this,"idleQueue",[]),c(this,"count",0),c(this,"isDestroyed",!1),this.source=r.source,this.url=r.url,this.setProps(r)}return T(t,[{key:"destroy",value:function(){this.idleQueue.forEach(function(e){return e.destroy()}),this.isDestroyed=!0}},{key:"setProps",value:function(e){this.props=XT(XT({},this.props),e),e.name!==void 0&&(this.name=e.name),e.maxConcurrency!==void 0&&(this.maxConcurrency=e.maxConcurrency),e.maxMobileConcurrency!==void 0&&(this.maxMobileConcurrency=e.maxMobileConcurrency),e.reuseWorkers!==void 0&&(this.reuseWorkers=e.reuseWorkers),e.onDebug!==void 0&&(this.onDebug=e.onDebug)}},{key:"startJob",value:function(){var r=Y(zl.default.mark(function n(i){var a=this,o,s,u,l=arguments;return zl.default.wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return o=l.length>1&&l[1]!==void 0?l[1]:function(h,d,v){return h.done(v)},s=l.length>2&&l[2]!==void 0?l[2]:function(h,d){return h.error(d)},u=new Promise(function(h){return a.jobQueue.push({name:i,onMessage:o,onError:s,onStart:h}),a}),this._startQueuedJob(),p.next=6,u;case 6:return p.abrupt("return",p.sent);case 7:case"end":return p.stop()}},n,this)}));function e(n){return r.apply(this,arguments)}return e}()},{key:"_startQueuedJob",value:function(){var r=Y(zl.default.mark(function n(){var i,a,o;return zl.default.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(this.jobQueue.length){u.next=2;break}return u.abrupt("return");case 2:if(i=this._getAvailableWorker(),i){u.next=5;break}return u.abrupt("return");case 5:if(a=this.jobQueue.shift(),!a){u.next=18;break}return this.onDebug({message:"Starting job",name:a.name,workerThread:i,backlog:this.jobQueue.length}),o=new zT(a.name,i),i.onMessage=function(l){return a.onMessage(o,l.type,l.payload)},i.onError=function(l){return a.onError(o,l)},a.onStart(o),u.prev=12,u.next=15,o.result;case 15:return u.prev=15,this.returnWorkerToQueue(i),u.finish(15);case 18:case"end":return u.stop()}},n,this,[[12,,15,18]])}));function e(){return r.apply(this,arguments)}return e}()},{key:"returnWorkerToQueue",value:function(e){var n=this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency();n?(e.destroy(),this.count--):this.idleQueue.push(e),this.isDestroyed||this._startQueuedJob()}},{key:"_getAvailableWorker",value:function(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count<this._getMaxConcurrency()){this.count++;var e="".concat(this.name.toLowerCase()," (#").concat(this.count," of ").concat(this.maxConcurrency,")");return new Gl({name:e,source:this.source,url:this.url})}return null}},{key:"_getMaxConcurrency",value:function(){return GT?this.maxMobileConcurrency:this.maxConcurrency}}],[{key:"isSupported",value:function(){return Gl.isSupported()}}]),t}();function YT(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=OV(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
22In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function OV(t,r){if(t){if(typeof t=="string")return KT(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return KT(t,r)}}function KT(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function ZT(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function ry(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};
22r%2?ZT(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):ZT(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var EV={maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:function(){}},Vl=function(){function t(r){A(this,t),c(this,"props",void 0),c(this,"workerPools",new Map),this.props=ry({},EV),this.setProps(r),this.workerPools=new Map}return T(t,[{key:"destroy",value:function(){var e=YT(this.workerPools.values()),n;try{for(e.s();!(n=e.n()).done;){var i=n.value;i.destroy()}}catch(a){e.e(a)}finally{e.f()}this.workerPools=new Map}},{key:"setProps",value:function(e){this.props=ry(ry({},this.props),e);var n=YT(this.workerPools.values()),i;try{for(n.s();!(i=n.n()).done;){var a=i.value;a.setProps(this._getWorkerPoolProps())}}catch(o){n.e(o)}finally{n.f()}}},{key:"getWorkerPool",value:function(e){var n=e.name,i=e.source,a=e.url,o=this.workerPools.get(n);return o||(o=new qT({name:n,source:i,url:a}),o.setProps(this._getWorkerPoolProps()),this.workerPools.set(n,o)),o}},{key:"_getWorkerPoolProps",value:function(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}}],[{key:"isSupported",value:function(){return Gl.isSupported()}},{key:"getWorkerFarm",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return t._workerFarm=t._workerFarm||new t({}),t._workerFarm.setProps(e),t._workerFarm}}]),t}();c(Vl,"_workerFarm",void 0);var CV="latest";function ny(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=r[t.id]||{},n="".concat(t.id,"-worker.js"),i=e.workerUrl;if(!i&&t.id==="compression"&&(i=r.workerUrl),r._workerType==="test"&&(i="modules/".concat(t.module,"/dist/").concat(n)),!i){var a=t.version;a==="latest"&&(a=CV);var o=a?"@".concat(a):"";i="https://unpkg.com/@loaders.gl/".concat(t.module).concat(o,"/dist/").concat(n)}return $t(i),i}function Za(t){var r;if(typeof Symbol<"u"&&(Symbol.asyncIterator&&(r=t[Symbol.asyncIterator]),r==null&&Symbol.iterator&&(r=t[Symbol.iterator])),r==null&&(r=t["@@asyncIterator"]),r==null&&(r=t["@@iterator"]),r==null)throw new TypeError("Object is not async iterable");return r.call(t)}function iy(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:NT;$t(t,"no worker provided");var e=t.version;return!(!r||!e)}var Hl=me(Ae());var Ja=me(JT());var MV="3.4.13",ay={};function Fn(t){return oy.apply(this,arguments)}function oy(){return oy=Y(Hl.default.mark(function t(r){var e,n,i=arguments;return Hl.default.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return e=i.length>1&&i[1]!==void 0?i[1]:null,n=i.length>2&&i[2]!==void 0?i[2]:{},e&&(r=QT(r,e,n)),ay[r]=ay[r]||IV(r),o.next=6,ay[r];case 6:return o.abrupt("return",o.sent);case 7:case"end":return o.stop()}},t)})),oy.apply(this,arguments)}function QT(t,r,e){if(t.startsWith("http"))return t;var n=e.modules||{};return n[t]?n[t]:cr?e.CDN?($t(e.CDN.startsWith("http")),"".concat(e.CDN,"/").concat(r,"@").concat(MV,"/dist/libs/").concat(t)):Ul?"../src/libs/".concat(t):"modules/".concat(r,"/src/libs/").concat(t):"modules/".concat(r,"/dist/libs/").concat(t)}function IV(t){return sy.apply(this,arguments)}function sy(){return sy=Y(Hl.default.mark(function t(r){var e,n,i;return Hl.default.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(!r.endsWith("wasm")){o.next=7;break}return o.next=3,fetch(r);case 3:return e=o.sent,o.next=6,e.arrayBuffer();case 6:return o.abrupt("return",o.sent);case 7:if(cr){o.next=20;break}if(o.prev=8,o.t0=Ja&&Ja.requireFromFile,!o.t0){o.next=14;break}return o.next=13,Ja.requireFromFile(r);case 13:o.t0=o.sent;case 14:return o.abrupt("return",o.t0);case 17:return o.prev=17,o.t1=o.catch(8),o.abrupt("return",null);case 20:if(!Ul){o.next=22;break}return o.abrupt("return",importScripts(r));case 22:return o.next=24,fetch(r);case 24:return n=o.sent,o.next=27,n.text();case 27:return i=o.sent,o.abrupt("return",RV(i,r));case 29:case"end":return o.stop()}},t,null,[[8,17]])})),sy.apply(this,arguments)}function RV(t,r){if(!cr)return Ja.requireFromString&&Ja.requireFromString(t,r);
22if(Ul)return eval.call(UT,t),null;var e=document.createElement("script");e.id=r;try{e.appendChild(document.createTextNode(t))}catch{e.text=t}return document.body.appendChild(e),null}var Wl=me(Ae());function fy(t,r){return!Vl.isSupported()||!cr&&!(r!=null&&r._nodeWorkers)?!1:t.worker&&r?.worker}function cy(t,r,e,n,i){return uy.apply(this,arguments)}function uy(){return uy=Y(Wl.default.mark(function t(r,e,n,i,a){var o,s,u,l,f,p;return Wl.default.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return o=r.id,s=ny(r,n),u=Vl.getWorkerFarm(n),l=u.getWorkerPool({name:o,url:s}),n=JSON.parse(JSON.stringify(n)),i=JSON.parse(JSON.stringify(i||{})),d.next=8,l.startJob("process-on-worker",LV.bind(null,a));case 8:return f=d.sent,f.postMessage("process",{input:e,options:n,context:i}),d.next=12,f.result;case 12:return p=d.sent,d.next=15,p.result;case 15:return d.abrupt("return",d.sent);case 16:case"end":return d.stop()}},t)})),uy.apply(this,arguments)}function LV(t,r,e,n){return ly.apply(this,arguments)}function ly(){return ly=Y(Wl.default.mark(function t(r,e,n,i){var a,o,s,u,l;return Wl.default.wrap(function(p){for(;;)switch(p.prev=p.next){case 0:p.t0=n,p.next=p.t0==="done"?3:p.t0==="error"?5:p.t0==="process"?7:20;break;case 3:return e.done(i),p.abrupt("break",21);case 5:return e.error(new Error(i.error)),p.abrupt("break",21);case 7:return a=i.id,o=i.input,s=i.options,p.prev=8,p.next=11,r(o,s);case 11:u=p.sent,e.postMessage("done",{id:a,result:u}),p.next=19;break;case 15:p.prev=15,p.t1=p.catch(8),l=p.t1 instanceof Error?p.t1.message:"unknown error",e.postMessage("error",{id:a,error:l});case 19:return p.abrupt("break",21);case 20:console.warn("parse-with-worker unknown message ".concat(n));case 21:case"end":return p.stop()}},t,null,[[8,15]])})),ly.apply(this,arguments)}function tw(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:5;if(typeof t=="string")return t.slice(0,r);if(ArrayBuffer.isView(t))return ew(t.buffer,t.byteOffset,r);if(t instanceof ArrayBuffer){var e=0;return ew(t,e,r)}return""}function ew(t,r,e){if(t.byteLength<=r+e)return"";for(var n=new DataView(t),i="",a=0;a<e;a++)i+=String.fromCharCode(n.getUint8(r+a));return i}function py(t){try{return JSON.parse(t)}catch{throw new Error('Failed to parse JSON from data starting with "'.concat(tw(t),'"'))}}function kV(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=BV(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
23In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function BV(t,r){if(t){if(typeof t=="string")return rw(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return rw(t,r)}}function rw(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function hy(t,r,e){if(e=e||t.byteLength,t.byteLength<e||r.byteLength<e)return!1;for(var n=new Uint8Array(t),i=new Uint8Array(r),a=0;a<n.length;++a)if(n[a]!==i[a])return!1;return!0}function dy(){for(var t=arguments.length,r=new Array(t),e=0;e<t;e++)r[e]=arguments[e];var n=r.map(function(f){return f instanceof ArrayBuffer?new Uint8Array(f):f}),i=n.reduce(function(f,p){return f+p.byteLength},0),a=new Uint8Array(i),o=0,s=kV(n),u;try{for(s.s();!(u=s.n()).done;){var l=u.value;a.set(l,o),o+=l.byteLength}}catch(f){s.e(f)}finally{s.f()}return a.buffer}function $l(){for(var t=arguments.length,r=new Array(t),e=0;e<t;e++)r[e]=arguments[e];var n=r,i=n&&n.length>1&&n[0].constructor||null;if(!i)throw new Error('"concatenateTypedArrays" - incorrect quantity of arguments or arguments have incompatible data types');for(var a=n.reduce(function(p,h){return p+h.length},0),o=new i(a),s=0,u=0,l=n;u<l.length;u++){var f=l[u];o.set(f,s),s+=f.length}return o}function Qa(t,r,e){var n=e!==void 0?new Uint8Array(t).subarray(r,r+e):new Uint8Array(t).subarray(r),i=new Uint8Array(n);return i.buffer}function ra(t,r){return je(t>=0),je(r>0),t+(r-1)&~(r-1)}function vy(t,r,e){var n;if(t instanceof ArrayBuffer)n=new Uint8Array(t);else{var i=t.byteOffset,a=t.byteLength;n=new Uint8Array(t.buffer||t.arrayBuffer,i,a)}return r.set(n,e),e+ra(n.byteLength,4)}function Xl(t){this.wrapped=t}function eo(t){return new Xl(t)}function to(t){var r,e;function n(o,s){return new Promise(function(u,l){var f={key:o,arg:s,resolve:u,reject:l,next:null};e?e=e.next=f:(r=e=f,i(o,s))})}function i(o,s){try{var u=t[o](s),l=u.value,f=l instanceof Xl;Promise.resolve(f?l.wrapped:l).then(function(p){if(f){i(o==="return"?"return":"next",p);return}a(u.done?"return":"normal",p)},function(p){i("throw",p)})}catch(p){a("throw",p)}}function a(o,s){switch(o){case"return":r.resolve({value:s,done:!0});break;case"throw":r.reject(s);break;default:r.resolve({value:s,done:!1});break}r=r.next,r?i(r.key,r.arg):e=null}this._invoke=n,typeof t.return!="function"&&(this.return=void 0)}to.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this};to.prototype.next=function(t){return this._invoke("next",t)};to.prototype.throw=function(t){return this._invoke("throw",t)};to.prototype.return=function(t){return this._invoke("return",t)};function xs(t){return function(){return new to(t.apply(this,arguments))}}var my=me(Ae());function yy(t){return gy.apply(this,arguments)}function gy(){return gy=Y(my.default.mark(function t(r){var e,n,i,a,o,s,u;return my.default.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:e=[],n=!1,i=!1,f.prev=3,o=Za(r);case 5:return f.next=7,o.next();case 7:if(!(n=!(s=f.sent).done)){f.next=13;break}u=s.value,e.push(u);case 10:n=!1,f.next=5;break;case 13:f.next=19;break;case 15:f.prev=15,f.t0=f.catch(3),i=!0,a=f.t0;case 19:if(f.prev=19,f.prev=20,!(n&&o.return!=null)){f.next=24;break}return f.next=24,o.return();case 24:if(f.prev=24,!i){f.next=27;break}throw a;case 27:return f.finish(24);case 28:return f.finish(19);case 29:return f.abrupt("return",dy.apply(void 0,e));case 30:case"end":return f.stop()}},t,null,[[3,15,19,29],[20,,24,28]])})),gy.apply(this,arguments)}k();F();j();k();k();k();function ql(){let t;if(typeof window<"u"&&window.performance)t=window.performance.now();else if(typeof process<"u"&&process.hrtime){let r=process.hrtime();t=r[0]*1e3+r[1]/1e6}else t=Date.now();return t}var ro=class{constructor(r,e){c(this,"name",void 0),c(this,"type",void 0),c(this,"sampleSize",1),c(this,"time",0),c(this,"count",0),c(this,"samples",0),c(this,"lastTiming",0),c(this,"lastSampleTime",0),c(this,"lastSampleCount",0),c(this,"_count",0),c(this,"_time",0),c(this,"_samples",0),c(this,"_startTime",0),c(this,"_timerPending",!1),this.name=r,this.type=e,this.reset()}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}setSampleSize(r){return this.sampleSize=r,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(r){return this._count+=r,this._samples++,this._checkSampling(),this}subtractCount(r){return this._count-=r,this._samples++,this._checkSampling(),this}addTime(r){return this._time+=r,this.lastTiming=r,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=ql(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(ql()-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}_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)}};var As=class{constructor(r){c(this,"id",void 0),c(this,"stats",{}),this.id=r.id,this.stats={},this._initializeStats(r.stats),Object.seal(this)}get(r){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"count";return this._getOrCreate({name:r,type:e})}get size(){return Object.keys(this.stats).length}reset(){for(let r of Object.values(this.stats))r.reset();return this}forEach(r){for(let e of Object.values(this.stats))r(e)}getTable(){let r={};
23return this.forEach(e=>{r[e.name]={time:e.time||0,count:e.count||0,average:e.getAverageTime()||0,hz:e.getHz()||0}}),r}_initializeStats(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).forEach(e=>this._getOrCreate(e))}_getOrCreate(r){let{name:e,type:n}=r,i=this.stats[e];return i||(r instanceof ro?i=r:i=new ro(e,n),this.stats[e]=i),i}};function nw(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function iw(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?nw(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):nw(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var FV="Queued Requests",DV="Active Requests",NV="Cancelled Requests",jV="Queued Requests Ever",UV="Active Requests Ever",GV={id:"request-scheduler",throttleRequests:!0,maxRequests:6},Yl=function(){function t(){A(this,t);var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};c(this,"props",void 0),c(this,"stats",void 0),c(this,"activeRequestCount",0),c(this,"requestQueue",[]),c(this,"requestMap",new Map),c(this,"deferredUpdate",null),this.props=iw(iw({},GV),r),this.stats=new As({id:this.props.id}),this.stats.get(FV),this.stats.get(DV),this.stats.get(NV),this.stats.get(jV),this.stats.get(UV)}return T(t,[{key:"scheduleRequest",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(){return 0};if(!this.props.throttleRequests)return Promise.resolve({done:function(){}});if(this.requestMap.has(e))return this.requestMap.get(e);var i={handle:e,priority:0,getPriority:n},a=new Promise(function(o){return i.resolve=o,i});return this.requestQueue.push(i),this.requestMap.set(e,a),this._issueNewRequests(),a}},{key:"_issueRequest",value:function(e){var n=this,i=e.handle,a=e.resolve,o=!1,s=function(){o||(o=!0,n.requestMap.delete(i),n.activeRequestCount--,n._issueNewRequests())};return this.activeRequestCount++,a?a({done:s}):Promise.resolve({done:s})}},{key:"_issueNewRequests",value:function(){var e=this;this.deferredUpdate||(this.deferredUpdate=setTimeout(function(){return e._issueNewRequestsAsync()},0))}},{key:"_issueNewRequestsAsync",value:function(){this.deferredUpdate=null;var e=Math.max(this.props.maxRequests-this.activeRequestCount,0);if(e!==0){this._updateAllRequests();for(var n=0;n<e;++n){var i=this.requestQueue.shift();i&&this._issueRequest(i)}}}},{key:"_updateAllRequests",value:function(){for(var e=this.requestQueue,n=0;n<e.length;++n){var i=e[n];this._updateRequest(i)||(e.splice(n,1),this.requestMap.delete(i.handle),n--)}e.sort(function(a,o){return a.priority-o.priority})}},{key:"_updateRequest",value:function(e){return e.priority=e.getPriority(e.handle),e.priority<0?(e.resolve(null),!1):!0}}]),t}();var zV="",aw={};function _y(t){for(var r in aw)if(t.startsWith(r)){var e=aw[r];t=t.replace(r,e)}return!t.startsWith("http://")&&!t.startsWith("https://")&&(t="".concat(zV).concat(t)),t}Ge();function ow(t){return t&&ue(t)==="object"&&t.isBuffer}function mp(t){if(ow(t))return t;if(t instanceof ArrayBuffer)return t;if(ArrayBuffer.isView(t))return t.byteOffset===0&&t.byteLength===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);if(typeof t=="string"){var r=t,e=new TextEncoder().encode(r);return e.buffer}if(t&&ue(t)==="object"&&t._toArrayBuffer)return t._toArrayBuffer();throw new Error("toArrayBuffer")}var hn={};Lr(hn,{dirname:()=>HV,filename:()=>VV,join:()=>WV,resolve:()=>$V});function sw(){var t;if(typeof process<"u"&&typeof process.cwd<"u")return process.cwd();var r=(t=window.location)===null||t===void 0?void 0:t.pathname;return r?.slice(0,r.lastIndexOf("/")+1)||""}function VV(t){var r=t?t.lastIndexOf("/"):-1;return r>=0?t.substr(r+1):""}function HV(t){var r=t?t.lastIndexOf("/"):-1;return r>=0?t.substr(0,r):""}function WV(){for(var t=arguments.length,r=new Array(t),e=0;e<t;e++)r[e]=arguments[e];var n="/";return r=r.map(function(i,a){return a&&(i=i.replace(new RegExp("^".concat(n)),"")),a!==r.length-1&&(i=i.replace(new RegExp("".concat(n,"$")),"")),i}),r.join(n)}function $V(){for(var t=[],r=0;r<arguments.length;r++)t[r]=r<0||arguments.length<=r?void 0:arguments[r];for(var e="",n=!1,i,a=t.length-1;a>=-1&&!n;a--){var o=void 0;a>=0?o=t[a]:(i===void 0&&(i=sw()),o=i),o.length!==0&&(e="".concat(o,"/").concat(e),n=o.charCo
23deAt(0)===Kl)}return e=XV(e,!n),n?"/".concat(e):e.length>0?e:"."}var Kl=47,by=46;function XV(t,r){for(var e="",n=-1,i=0,a,o=!1,s=0;s<=t.length;++s){if(s<t.length)a=t.charCodeAt(s);else{if(a===Kl)break;a=Kl}if(a===Kl){if(!(n===s-1||i===1))if(n!==s-1&&i===2){if(e.length<2||!o||e.charCodeAt(e.length-1)!==by||e.charCodeAt(e.length-2)!==by){if(e.length>2){for(var u=e.length-1,l=u;l>=0&&e.charCodeAt(l)!==Kl;--l);if(l!==u){e=l===-1?"":e.slice(0,l),n=s,i=0,o=!1;continue}}else if(e.length===2||e.length===1){e="",n=s,i=0,o=!1;continue}}r&&(e.length>0?e+="/..":e="..",o=!0)}else{var f=t.slice(n+1,s);e.length>0?e+="/".concat(f):e=f,o=!1}n=s,i=0}else a===by&&i!==-1?++i:i=-1}return e}var di=me(Ae());Ge();var qV=function(r){return typeof r=="boolean"},Zl=function(r){return typeof r=="function"},no=function(r){return r!==null&&ue(r)==="object"},xy=function(r){return no(r)&&r.constructor==={}.constructor};var uw=function(r){return r&&typeof r[Symbol.iterator]=="function"},lw=function(r){return r&&typeof r[Symbol.asyncIterator]=="function"};var Gr=function(r){return typeof Response<"u"&&r instanceof Response||r&&r.arrayBuffer&&r.text&&r.json};var zr=function(r){return typeof Blob<"u"&&r instanceof Blob},fw=function(r){return r&&ue(r)==="object"&&r.isBuffer};var YV=function(r){return typeof ReadableStream<"u"&&r instanceof ReadableStream||no(r)&&Zl(r.tee)&&Zl(r.cancel)&&Zl(r.getReader)};var KV=function(r){return no(r)&&Zl(r.read)&&Zl(r.pipe)&&qV(r.readable)},gp=function(r){return YV(r)||KV(r)};var ZV=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,JV=/^([-\w.]+\/[-\w.+]+)/;function cw(t){var r=JV.exec(t);return r?r[1]:t}function Ay(t){var r=ZV.exec(t);return r?r[1]:""}var pw=/\?.*/;function hw(t){var r=t.match(pw);return r&&r[0]}function Ss(t){return t.replace(pw,"")}function io(t){if(Gr(t)){var r=t;return r.url}if(zr(t)){var e=t;return e.name||""}return typeof t=="string"?t:""}function Jl(t){if(Gr(t)){var r=t,e=r.headers.get("content-type")||"",n=Ss(r.url);return cw(e)||Ay(n)}if(zr(t)){var i=t;return i.type||""}return typeof t=="string"?Ay(t):""}function dw(t){if(Gr(t)){var r=t;return r.headers["content-length"]||-1}if(zr(t)){var e=t;return e.size}return typeof t=="string"?t.length:t instanceof ArrayBuffer||ArrayBuffer.isView(t)?t.byteLength:-1}function yp(t){return Sy.apply(this,arguments)}function Sy(){return Sy=Y(di.default.mark(function t(r){var e,n,i,a,o,s;return di.default.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(!Gr(r)){l.next=2;break}return l.abrupt("return",r);case 2:return e={},n=dw(r),n>=0&&(e["content-length"]=String(n)),i=io(r),a=Jl(r),a&&(e["content-type"]=a),l.next=10,e8(r);case 10:return o=l.sent,o&&(e["x-first-bytes"]=o),typeof r=="string"&&(r=new TextEncoder().encode(r)),s=new Response(r,{headers:e}),Object.defineProperty(s,"url",{value:i}),l.abrupt("return",s);case 16:case"end":return l.stop()}},t)})),Sy.apply(this,arguments)}function vw(t){return Ty.apply(this,arguments)}function Ty(){return Ty=Y(di.default.mark(function t(r){var e;return di.default.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(r.ok){i.next=5;break}return i.next=3,QV(r);case 3:throw e=i.sent,new Error(e);case 5:case"end":return i.stop()}},t)})),Ty.apply(this,arguments)}function QV(t){return wy.apply(this,arguments)}function wy(){return wy=Y(di.default.mark(function t(r){var e,n,i;return di.default.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(e="Failed to fetch resource ".concat(r.url," (").concat(r.status,"): "),o.prev=1,n=r.headers.get("Content-Type"),i=r.statusText,!n.includes("application/json")){o.next=11;break}return o.t0=i,o.t1=" ",o.next=9,r.text();case 9:o.t2=o.sent,i=o.t0+=o.t1.concat.call(o.t1,o.t2);case 11:e+=i,e=e.length>60?"".concat(e.slice(0,60),"..."):e,o.next=17;break;case 15:o.prev=15,o.t3=o.catch(1);case 17:return o.abrupt("return",e);case 18:case"end":return o.stop()}},t,null,[[1,15]])})),wy.apply(this,arguments)}function e8(t){return Py.apply(this,arguments)}function Py(){return Py=Y(di.default.mark(function t(r){var e,n,i,a;return di.default.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(e=5,typeof r!="string"){s.next=3;break}return s.abrupt("return","data:,".concat(r.slice(0,e)));case 3:if(!(r instanceof Blob)){s.next=8;break}return n=r.slice(0,5),s.next=7,new Promise(function(u){var l=new FileReader;l.onload=function(f){var p;return u(f==null||(p=f.target)===null||p===void 0?void 0:p.result)}
23,l.readAsDataURL(n)});case 7:return s.abrupt("return",s.sent);case 8:if(!(r instanceof ArrayBuffer)){s.next=12;break}return i=r.slice(0,e),a=t8(i),s.abrupt("return","data:base64,".concat(a));case 12:return s.abrupt("return",null);case 13:case"end":return s.stop()}},t)})),Py.apply(this,arguments)}function t8(t){for(var r="",e=new Uint8Array(t),n=0;n<e.byteLength;n++)r+=String.fromCharCode(e[n]);return btoa(r)}function Ts(t,r){return Ey.apply(this,arguments)}function Ey(){return Ey=Y(Oy.default.mark(function t(r,e){var n;return Oy.default.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(typeof r!="string"){a.next=7;break}return r=_y(r),n=e,e!=null&&e.fetch&&typeof e?.fetch!="function"&&(n=e.fetch),a.next=6,fetch(r,n);case 6:return a.abrupt("return",a.sent);case 7:return a.next=9,yp(r);case 9:return a.abrupt("return",a.sent);case 10:case"end":return a.stop()}},t)})),Ey.apply(this,arguments)}k();F();j();k();k();function Cy(t){if(typeof window<"u"&&typeof window.process=="object"&&window.process.type==="renderer"||typeof process<"u"&&typeof process.versions=="object"&&Boolean(process.versions.electron))return!0;let r=typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent,e=t||r;return!!(e&&e.indexOf("Electron")>=0)}function dn(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||Cy()}var r8=globalThis.self||globalThis.window||globalThis.global,ws=globalThis.window||globalThis.self||globalThis.global,n8=globalThis.document||{},ao=globalThis.process||{},i8=globalThis.console,tye=globalThis.navigator||{};var _p=typeof __VERSION__<"u"?__VERSION__:"untranspiled source",iye=dn();k();function a8(t){try{let r=window[t],e="__storage_test__";return r.setItem(e,e),r.removeItem(e),r}catch{return null}}var bp=class{constructor(r,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"sessionStorage";c(this,"storage",void 0),c(this,"id",void 0),c(this,"config",void 0),this.storage=a8(n),this.id=r,this.config=e,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(r){if(Object.assign(this.config,r),this.storage){let e=JSON.stringify(this.config);this.storage.setItem(this.id,e)}}_loadConfiguration(){let r={};if(this.storage){let e=this.storage.getItem(this.id);r=e?JSON.parse(e):{}}return Object.assign(this.config,r),this}};function mw(t){let r;return t<10?r="".concat(t.toFixed(2),"ms"):t<100?r="".concat(t.toFixed(1),"ms"):t<1e3?r="".concat(t.toFixed(0),"ms"):r="".concat((t/1e3).toFixed(2),"s"),r}function gw(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:8,e=Math.max(r-t.length,0);return"".concat(" ".repeat(e)).concat(t)}function xp(t,r,e){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:600,i=t.src.replace(/\(/g,"%28").replace(/\)/g,"%29");t.width>n&&(e=Math.min(e,n/t.width));let a=t.width*e,o=t.height*e,s=["font-size:1px;","padding:".concat(Math.floor(o/2),"px ").concat(Math.floor(a/2),"px;"),"line-height:".concat(o,"px;"),"background:url(".concat(i,");"),"background-size:".concat(a,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(r," %c+"),s]}var Ap;(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"})(Ap||(Ap={}));var o8=10;function yw(t){return typeof t!="string"?t:(t=t.toUpperCase(),Ap[t]||Ap.WHITE)}function _w(t,r,e){if(!dn&&typeof t=="string"){if(r){let n=yw(r);t="\x1B[".concat(n,"m").concat(t,"\x1B[39m")}if(e){let n=yw(e);t="\x1B[".concat(n+o8,"m").concat(t,"\x1B[49m")}}return t}function bw(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["constructor"],e=Object.getPrototypeOf(t),n=Object.getOwnPropertyNames(e),i=t;for(let a of n){let o=i[a];typeof o=="function"&&(r.find(s=>
23a===s)||(i[a]=o.bind(t)))}}function Ps(t,r){if(!t)throw new Error(r||"Assertion failed")}function oo(){let t;if(dn()&&ws.performance){var r,e;t=ws===null||ws===void 0||(r=ws.performance)===null||r===void 0||(e=r.now)===null||e===void 0?void 0:e.call(r)}else if("hrtime"in ao){var n;let i=ao===null||ao===void 0||(n=ao.hrtime)===null||n===void 0?void 0:n.call(ao);t=i[0]*1e3+i[1]/1e6}else t=Date.now();return t}var Os={debug:dn()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},s8={enabled:!0,level:0};function Vr(){}var xw={},Aw={once:!0},Dn=class{constructor(){let{id:r}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};c(this,"id",void 0),c(this,"VERSION",_p),c(this,"_startTs",oo()),c(this,"_deltaTs",oo()),c(this,"_storage",void 0),c(this,"userData",{}),c(this,"LOG_THROTTLE_TIMEOUT",0),this.id=r,this.userData={},this._storage=new bp("__probe-".concat(this.id,"__"),s8),this.timeStamp("".concat(this.id," started")),bw(this),Object.seal(this)}set level(r){this.setLevel(r)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((oo()-this._startTs).toPrecision(10))}getDelta(){return Number((oo()-this._deltaTs).toPrecision(10))}set priority(r){this.level=r}get priority(){return this.level}getPriority(){return this.level}enable(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return this._storage.setConfiguration({enabled:r}),this}setLevel(r){return this._storage.setConfiguration({level:r}),this}get(r){return this._storage.config[r]}set(r,e){this._storage.setConfiguration({[r]:e})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(r,e){Ps(r,e)}warn(r){return this._getLogFunction(0,r,Os.warn,arguments,Aw)}error(r){return this._getLogFunction(0,r,Os.error,arguments)}deprecated(r,e){return this.warn("`".concat(r,"` is deprecated and will be removed in a later version. Use `").concat(e,"` instead"))}removed(r,e){return this.error("`".concat(r,"` has been removed. Use `").concat(e,"` instead"))}probe(r,e){return this._getLogFunction(r,e,Os.log,arguments,{time:!0,once:!0})}log(r,e){return this._getLogFunction(r,e,Os.debug,arguments)}info(r,e){return this._getLogFunction(r,e,console.info,arguments)}once(r,e){return this._getLogFunction(r,e,Os.debug||Os.info,arguments,Aw)}table(r,e,n){return e?this._getLogFunction(r,e,console.table||Vr,n&&[n],{tag:c8(e)}):Vr}image(r){let{logLevel:e,priority:n,image:i,message:a="",scale:o=1}=r;return this._shouldLog(e||n)?dn()?f8({image:i,message:a,scale:o}):l8({image:i,message:a,scale:o}):Vr}time(r,e){return this._getLogFunction(r,e,console.time?console.time:console.info)}timeEnd(r,e){return this._getLogFunction(r,e,console.timeEnd?console.timeEnd:console.info)}timeStamp(r,e){return this._getLogFunction(r,e,console.timeStamp||Vr)}group(r,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},i=Sw({logLevel:r,message:e,opts:n}),{collapsed:a}=n;return i.method=(a?console.groupCollapsed:console.group)||console.info,this._getLogFunction(i)}groupCollapsed(r,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.group(r,e,Object.assign({},n,{collapsed:!0}))}groupEnd(r){return this._getLogFunction(r,"",console.groupEnd||Vr)}withGroup(r,e,n){this.group(r,e)();try{n()}finally{this.groupEnd(r)()}}trace(){console.trace&&console.trace()}_shouldLog(r){return this.isEnabled()&&this.getLevel()>=Tw(r)}_getLogFunction(r,e,n,i,a){if(this._shouldLog(r)){a=Sw({logLevel:r,message:e,args:i,opts:a}),n=n||a.method,Ps(n),a.total=this.getTotal(),a.delta=this.getDelta(),this._deltaTs=oo();let o=a.tag||a.message;if(a.once&&o)if(!xw[o])xw[o]=oo();else return Vr;return e=u8(this.id,a.message,a),n.bind(console,e,...a.args)}return Vr}};c(Dn,"VERSION",_p);function Tw(t){if(!t)return 0;let r;switch(typeof t){case"number":r=t;break;case"object":r=t.logLevel||t.priority||0;break;default:return 0}return Ps(Number.isFinite(r)&&r>=0),r}function Sw(t){let{logLevel:r,message:e}=t;t.logLevel=Tw(r);let n=t.args?Array.from(t.args):[];for(;n.length&&n.shift()!==e;);switch(typeof r){case"string":case"function":e!==void 0&&n.unshift(e),t.message=r;break;case"object":Object.assign(t,r);break;default:}typeof t.message=="function"&&(t.message=t.message());let i=typeof t.message;return Ps(i==="string"||i==="object"),Object.assign(t,{args:n},t.opts)}function u8(t,r,e){if(typeof r=="string"){let n=e.time?gw(mw(e.total)):"";
23r=e.time?"".concat(t,": ").concat(n,"  ").concat(r):"".concat(t,": ").concat(r),r=_w(r,e.color,e.background)}return r}function l8(t){let{image:r,message:e="",scale:n=1}=t;return console.warn("removed"),Vr}function f8(t){let{image:r,message:e="",scale:n=1}=t;if(typeof r=="string"){let a=new Image;return a.onload=()=>{let o=xp(a,e,n);console.log(...o)},a.src=r,Vr}let i=r.nodeName||"";if(i.toLowerCase()==="img")return console.log(...xp(r,e,n)),Vr;if(i.toLowerCase()==="canvas"){let a=new Image;return a.onload=()=>console.log(...xp(a,e,n)),a.src=r.toDataURL(),Vr}return Vr}function c8(t){for(let r in t)for(let e in t[r])return e||"untitled";return"empty"}var Iye=new Dn({id:"@probe.gl/log"});var My=new Dn({id:"loaders.gl"}),ww=function(){function t(){A(this,t)}return T(t,[{key:"log",value:function(){return function(){}}},{key:"info",value:function(){return function(){}}},{key:"warn",value:function(){return function(){}}},{key:"error",value:function(){return function(){}}}]),t}(),Pw=function(){function t(){A(this,t),c(this,"console",void 0),this.console=console}return T(t,[{key:"log",value:function(){for(var e,n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return(e=this.console.log).bind.apply(e,[this.console].concat(i))}},{key:"info",value:function(){for(var e,n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return(e=this.console.info).bind.apply(e,[this.console].concat(i))}},{key:"warn",value:function(){for(var e,n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return(e=this.console.warn).bind.apply(e,[this.console].concat(i))}},{key:"error",value:function(){for(var e,n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];return(e=this.console.error).bind.apply(e,[this.console].concat(i))}}]),t}();var Iy={fetch:null,mimeType:void 0,nothrow:!1,log:new Pw,CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:hi,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},Ow={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 Rw(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=p8(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
24In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function p8(t,r){if(t){if(typeof t=="string")return Ew(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return Ew(t,r)}}function Ew(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function Cw(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function Sp(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?Cw(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Cw(Object(e)).forEac
24h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function Ry(){globalThis.loaders=globalThis.loaders||{};var t=globalThis.loaders;return t._state=t._state||{},t._state}var Ly=function(){var r=Ry();return r.globalOptions=r.globalOptions||Sp({},Iy),r.globalOptions};function Lw(t,r,e,n){return e=e||[],e=Array.isArray(e)?e:[e],h8(t,e),v8(r,t,n)}function h8(t,r){Mw(t,null,Iy,Ow,r);var e=Rw(r),n;try{for(e.s();!(n=e.n()).done;){var i=n.value,a=t&&t[i.id]||{},o=i.options&&i.options[i.id]||{},s=i.deprecatedOptions&&i.deprecatedOptions[i.id]||{};Mw(a,i.id,o,s,r)}}catch(u){e.e(u)}finally{e.f()}}function Mw(t,r,e,n,i){var a=r||"Top level",o=r?"".concat(r,"."):"";for(var s in t){var u=!r&&no(t[s]),l=s==="baseUri"&&!r,f=s==="workerUrl"&&r;if(!(s in e)&&!l&&!f){if(s in n)My.warn("".concat(a," loader option '").concat(o).concat(s,"' no longer supported, use '").concat(n[s],"'"))();else if(!u){var p=d8(s,i);My.warn("".concat(a," loader option '").concat(o).concat(s,"' not recognized. ").concat(p))()}}}}function d8(t,r){var e=t.toLowerCase(),n="",i=Rw(r),a;try{for(i.s();!(a=i.n()).done;){var o=a.value;for(var s in o.options){if(t===s)return"Did you mean '".concat(o.id,".").concat(s,"'?");var u=s.toLowerCase(),l=e.startsWith(u)||u.startsWith(e);l&&(n=n||"Did you mean '".concat(o.id,".").concat(s,"'?"))}}}catch(f){i.e(f)}finally{i.f()}return n}function v8(t,r,e){var n=t.options||{},i=Sp({},n);return m8(i,e),i.log===null&&(i.log=new ww),Iw(i,Ly()),Iw(i,r),i}function Iw(t,r){for(var e in r)if(e in r){var n=r[e];xy(n)&&xy(t[e])?t[e]=Sp(Sp({},t[e]),r[e]):t[e]=r[e]}}function m8(t,r){r&&!("baseUri"in t)&&(t.baseUri=r)}k();function kw(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function Tp(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?kw(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):kw(Object(e)).forEac
24h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function Ql(t){var r;if(!t)return!1;Array.isArray(t)&&(t=t[0]);var e=Array.isArray((r=t)===null||r===void 0?void 0:r.extensions);return e}function ef(t){var r,e;je(t,"null loader"),je(Ql(t),"invalid loader");var n;return Array.isArray(t)&&(n=t[1],t=t[0],t=Tp(Tp({},t),{},{options:Tp(Tp({},t.options),n)})),((r=t)!==null&&r!==void 0&&r.parseTextSync||(e=t)!==null&&e!==void 0&&e.parseText)&&(t.text=!0),t.text||(t.binary=!0),t}function g8(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=y8(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
25In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function y8(t,r){if(t){if(typeof t=="string")return Bw(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return Bw(t,r)}}function Bw(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var Fw=function(){var r=Ry();return r.loaderRegistry=r.loaderRegistry||[],r.loaderRegistry};function tf(t){var r=Fw();t=Array.isArray(t)?t:[t];var e=g8(t),n;try{var i=function(){var o=n.value,s=ef(o);r.find(function(u){return s===u})||r.unshift(s)};for(e.s();!(n=e.n()).done;)i()}catch(a){e.e(a)}finally{e.f()}}function Dw(){return Fw()}k();Ge();$g();function ky(t){if(Array.isArray(t))return bs(t)}function By(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}Xg();function Fy(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
26In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ae(t){return ky(t)||By(t)||jl(t)||Fy()}var Ny=me(Ae());var Nw=new Dn({id:"loaders.gl"});function jw(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function Uw(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?jw(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):jw(Object(e)).forEac
26h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function rf(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=_8(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
27In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function _8(t,r){if(t){if(typeof t=="string")return Gw(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return Gw(t,r)}}function Gw(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var b8=/\.([^.]+)$/;function Hw(t){return jy.apply(this,arguments)}function jy(){return jy=Y(Ny.default.mark(function t(r){var e,n,i,a,o=arguments;return Ny.default.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(e=o.length>1&&o[1]!==void 0?o[1]:[],n=o.length>2?o[2]:void 0,i=o.length>3?o[3]:void 0,Ww(r)){u.next=5;break}return u.abrupt("return",null);case 5:if(a=zw(r,e,Uw(Uw({},n),{},{nothrow:!0}),i),!a){u.next=8;break}return u.abrupt("return",a);case 8:if(!zr(r)){u.next=13;break}return u.next=11,r.slice(0,10).arrayBuffer();case 11:r=u.sent,a=zw(r,e,n,i);case 13:if(!(!a&&!(n!=null&&n.nothrow))){u.next=15;break}throw new Error($w(r));case 15:return u.abrupt("return",a);case 16:case"end":return u.stop()}},t)})),jy.apply(this,arguments)}function zw(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],e=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0;if(!Ww(t))return null;if(r&&!Array.isArray(r))return ef(r);var i=[];if(r&&(i=i.concat(r)),!(e!=null&&e.ignoreRegisteredLoaders)){var a;(a=i).push.apply(a,ae(Dw()))}A8(i);var o=x8(t,i,e,n);if(!o&&!(e!=null&&e.nothrow))throw new Error($w(t));return o}function x8(t,r,e,n){var i=io(t),a=Jl(t),o=Ss(i)||n?.url,s=null,u="";if(e!=null&&e.mimeType&&(s=Dy(r,e?.mimeType),u="match forced by supplied MIME type ".concat(e?.mimeType)),s=s||S8(r,o),u=u||(s?"matched url ".concat(o):""),s=s||Dy(r,a),u=u||(s?"matched MIME type ".concat(a):""),s=s||w8(r,t),u=u||(s?"matched initial data ".concat(Xw(t)):""),s=s||Dy(r,e?.fallbackMimeType),u=u||(s?"matched fallback MIME type ".concat(a):""),u){var l;Nw.log(1,"selectLoader selected ".concat((l=s)===null||l===void 0?void 0:l.name,": ").concat(u,"."))}return s}function Ww(t){return!(t instanceof Response&&t.status===204)}function $w(t){var r=io(t),e=Jl(t),n="No valid loader found (";n+=r?"".concat(hn.filename(r),", "):"no url provided, ",n+="MIME type: ".concat(e?'"'.concat(e,'"'):"not provided",", ");var i=t?Xw(t):"";return n+=i?' first bytes: "'.concat(i,'"'):"first bytes: not available",n+=")",n}function A8(t){var r=rf(t),e;try{for(r.s();!(e=r.n()).done;){var n=e.value;ef(n)}}catch(i){r.e(i)}finally{r.f()}}function S8(t,r){var e=r&&b8.exec(r),n=e&&e[1];return n?T8(t,n):null}function T8(t,r){r=r.toLowerCase();var e=rf(t),n;try{for(e.s();!(n=e.n()).done;){var i=n.value,a=rf(i.extensions),o;try{for(a.s();!(o=a.n()).done;){var s=o.value;if(s.toLowerCase()===r)return i}}catch(u){a.e(u)}finally{a.f()}}}catch(u){e.e(u)}finally{e.f()}return null}function Dy(t,r){var e=rf(t),n;try{for(e.s();!(n=e.n()).done;){var i=n.value;if(i.mimeTypes&&i.mimeTypes.includes(r)||r==="application/x.".concat(i.id))return i}}catch(a){e.e(a)}finally{e.f()}return null}function w8(t,r){if(!r)return null;var e=rf(t),n;try{for(e.s();!(n=e.n()).done;){var i=n.value;if(typeof r=="string"){if(P8(r,i))return i}else if(ArrayBuffer.isView(r)){if(Vw(r.buffer,r.byteOffset,i))return i}else if(r instanceof ArrayBuffer){var a=0;if(Vw(r,a,i))return i}}}catch(o){e.e(o)}finally{e.f()}return null}function P8(t,r){if(r.testText)return r.testText(t);var e=Array.isArray(r.tests)?r.tests:[r.tests];return e.some(function(n){return t.startsWith(n)})}function Vw(t,r,e){var n=Array.isArray(e.tests)?e.tests:[e.tests];return n.some(function(i){return O8(t,r,e,i)})}function O8(t,r,e,n){if(n instanceof ArrayBuffer)return hy(n,t,n.byteLength);switch(ue(n)){case"function":return n(t,e);case"string":var i=Uy(t,r,n.length);return n===i;default:return!1}}function Xw(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:5;if(typeof t=="string")return t.slice(0,r);if(ArrayBuffer.isView(t))return Uy(t.buffer,t.byteOffset,r);if(t instanceof ArrayBuffer){var e=0;return Uy(t,e,r)}return""}function Uy(t,r,e){if(t.byteLength<r+e)return"";for(var n=new DataView(t),i="",a=0;a<e;a++)i+=String.fromCharCode(n.getUint8(r+a));return i}Ge();var af=me(Ae());var Yy=me(Ae());var Gy=me(Ae()),E8=Gy.default.mark(zy),C8=256*1024;function zy(t,r){var e,n,i,a,o;return Gy.default.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:e=r?.chunkSize||C8,n=0,i=new TextEncoder;case 3:if(!(n<t.length)){u.next=11;break}return a=Math.min(t.length-n,e),o=t.slice(n,n+a),n+=a,u.next=9,i.encode(o);case 9:u.next=3;break;case 11:case"end":return u.stop()}},E8)}var Vy=me(Ae()),M8=256*1024;function qw(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Vy.default.mark(function e(){var n,i,a,o,s,u,l;return Vy.default.wrap(function(p){for(;;)switch(p.prev=p.next){case 0:n=r.chunkSize,i=n===void 0?M8:n,a=0;case 2:if(!(a<t.byteLength)){p.next=13;break}return o=Math.min(t.byteLength-a,i),s=new ArrayBuffer(o),u=new Uint8Array(t,a,o),l=new Uint8Array(s),l.set(u),a+=o,p.next=11,s;case 11:p.next=2;break;case 13:case"end":return p.stop()}},e)})()}var Hy=me(Ae()),I8=1024*1024;function Yw(t,r){return Wy.apply(this,arguments)}function Wy(){return Wy=xs(Hy.default.mark(function t(r,e){var n,i,a,o;return Hy.default.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:n=e?.chunkSize||I8,i=0;case 2:if(!(i<r.size)){u.next=12;break}return a=i+n,u.next=6,eo(r.slice(i,a).arrayBuffer());case 6:return o=u.sent,i=a,u.next=10,o;case 10:u.next=2;break;case 12:case"end":return u.stop()}},t)})),Wy.apply(this,arguments)}var nf=me(Ae());function qy(t,r){return hi?R8(t,r):L8(t,r)}function R8(t,r){return $y.apply(this,arguments)}function $y(){return $y=xs(nf.default.mark(function t(r,e){var n,i,a,o,s,u;return nf.default.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:n=r.getReader(),f.prev=1;case 2:return a=i||n.read(),e!=null&&e._streamReadAhead&&(i=n.read()),f.next=7,eo(a);case 7:if(o=f.sent,s=o.done,u=o.value,!s){f.next=12;break}return f.abrupt("return");case 12:return f.next=14,mp(u);case 14:f.next=2;break;case 16:f.next=21;break;case 18:f.prev=18,f.t0=f.catch(1),n.releaseLock();case 21:case"end":return f.stop()}}
27,t,null,[[1,18]])})),$y.apply(this,arguments)}function L8(t,r){return Xy.apply(this,arguments)}function Xy(){return Xy=xs(nf.default.mark(function t(r,e){var n,i,a,o,s,u;return nf.default.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:n=!1,i=!1,f.prev=2,o=Za(r);case 4:return f.next=6,eo(o.next());case 6:if(!(n=!(s=f.sent).done)){f.next=13;break}return u=s.value,f.next=10,mp(u);case 10:n=!1,f.next=4;break;case 13:f.next=19;break;case 15:f.prev=15,f.t0=f.catch(2),i=!0,a=f.t0;case 19:if(f.prev=19,f.prev=20,!(n&&o.return!=null)){f.next=24;break}return f.next=24,eo(o.return());case 24:if(f.prev=24,!i){f.next=27;break}throw a;case 27:return f.finish(24);case 28:return f.finish(19);case 29:case"end":return f.stop()}},t,null,[[2,15,19,29],[20,,24,28]])})),Xy.apply(this,arguments)}function Kw(t,r){if(typeof t=="string")return zy(t,r);if(t instanceof ArrayBuffer)return qw(t,r);if(zr(t))return Yw(t,r);if(gp(t))return qy(t,r);if(Gr(t)){var e=t;return qy(e.body,r)}throw new Error("makeIterator")}var Zw="Cannot convert supplied data type";function k8(t,r,e){if(r.text&&typeof t=="string")return t;if(fw(t)&&(t=t.buffer),t instanceof ArrayBuffer){var n=t;if(r.text&&!r.binary){var i=new TextDecoder("utf8");return i.decode(n)}return n}if(ArrayBuffer.isView(t)){if(r.text&&!r.binary){var a=new TextDecoder("utf8");return a.decode(t)}var o=t.buffer,s=t.byteLength||t.length;return(t.byteOffset!==0||s!==o.byteLength)&&(o=o.slice(t.byteOffset,t.byteOffset+s)),o}throw new Error(Zw)}function Jw(t,r,e){return Ky.apply(this,arguments)}function Ky(){return Ky=Y(Yy.default.mark(function t(r,e,n){var i,a;return Yy.default.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(i=r instanceof ArrayBuffer||ArrayBuffer.isView(r),!(typeof r=="string"||i)){s.next=3;break}return s.abrupt("return",k8(r,e,n));case 3:if(!zr(r)){s.next=7;break}return s.next=6,yp(r);case 6:r=s.sent;case 7:if(!Gr(r)){s.next=21;break}return a=r,s.next=11,vw(a);case 11:if(!e.binary){s.next=17;break}return s.next=14,a.arrayBuffer();case 14:s.t0=s.sent,s.next=20;break;case 17:return s.next=19,a.text();case 19:s.t0=s.sent;case 20:return s.abrupt("return",s.t0);case 21:if(gp(r)&&(r=Kw(r,n)),!(uw(r)||lw(r))){s.next=24;break}return s.abrupt("return",yy(r));case 24:throw new Error(Zw);case 25:case"end":return s.stop()}},t)})),Ky.apply(this,arguments)}k();function wp(t,r){var e=Ly(),n=t||e;return typeof n.fetch=="function"?n.fetch:no(n.fetch)?function(i){return Ts(i,n)}:r!=null&&r.fetch?r?.fetch:Ts}function Qw(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function B8(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?Qw(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Qw(Object(e)).forEac
27h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function eP(t,r,e){if(e)return e;var n=B8({fetch:wp(r,t)},t);if(n.url){var i=Ss(n.url);n.baseUrl=i,n.queryString=hw(n.url),n.filename=hn.filename(i),n.baseUrl=hn.dirname(i)}return Array.isArray(n.loaders)||(n.loaders=null),n}function tP(t,r){if(!r&&t&&!Array.isArray(t))return t;var e;if(t&&(e=Array.isArray(t)?t:[t]),r&&r.loaders){var n=Array.isArray(r.loaders)?r.loaders:[r.loaders];e=e?[].concat(ae(e),ae(n)):n}return e&&e.length?e:null}function so(t,r,e,n){return Zy.apply(this,arguments)}function Zy(){return Zy=Y(af.default.mark(function t(r,e,n,i){var a,o,s,u;return af.default.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return $t(!i||ue(i)==="object"),e&&!Array.isArray(e)&&!Ql(e)&&(i=void 0,n=e,e=void 0),f.next=4,r;case 4:return r=f.sent,n=n||{},a=io(r),o=e,s=tP(o,i),f.next=11,Hw(r,s,n);case 11:if(u=f.sent,u){f.next=14;break}return f.abrupt("return",null);case 14:return n=Lw(n,u,s,a),i=eP({url:a,parse:so,loaders:s},n,i||null),f.next=18,F8(u,r,n,i);case 18:return f.abrupt("return",f.sent);case 19:case"end":return f.stop()}},t)})),Zy.apply(this,arguments)}function F8(t,r,e,n){return Jy.apply(this,arguments)}function Jy(){return Jy=Y(af.default.mark(function t(r,e,n,i){var a,o,s,u,l,f,p,h;return af.default.wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return iy(r),Gr(e)&&(a=e,o=a.ok,s=a.redirected,u=a.status,l=a.statusText,f=a.type,p=a.url,h=Object.fromEntries(a.headers.entries()),i.response={headers:h,ok:o,redirected:s,status:u,statusText:l,type:f,url:p}),v.next=4,Jw(e,r,n);case 4:if(e=v.sent,!(r.parseTextSync&&typeof e=="string")){v.next=8;break}return n.dataType="text",v.abrupt("return",r.parseTextSync(e,n,i,r));case 8:if(!fy(r,n)){v.next=12;break}return v.next=11,cy(r,e,n,i,so);case 11:return v.abrupt("return",v.sent);case 12:if(!(r.parseText&&typeof e=="string")){v.next=16;break}return v.next=15,r.parseText(e,n,i,r);case 15:return v.abrupt("return",v.sent);case 16:if(!r.parse){v.next=20;break}return v.next=19,r.parse(e,n,i,r);case 19:return v.abrupt("return",v.sent);case 20:throw $t(!r.parseSync),new Error("".concat(r.id," loader - no parser found and worker is disabled"));case 22:case"end":return v.stop()}},t)})),Jy.apply(this,arguments)}var Qy=me(Ae());function Bt(t,r,e,n){return e0.apply(this,arguments)}function e0(){return e0=Y(Qy.default.mark(function t(r,e,n,i){var a,o;return Qy.default.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(!Array.isArray(e)&&!Ql(e)&&(i=void 0,n=e,e=void 0),a=wp(n),o=r,typeof r!="string"){u.next=7;break}return u.next=6,a(r);case 6:o=u.sent;case 7:if(!zr(r)){u.next=11;break}return u.next=10,a(r);case 10:o=u.sent;case 11:return u.next=13,so(o,e,n);case 13:return u.abrupt("return",u.sent);case 14:case"end":return u.stop()}},t)})),e0.apply(this,arguments)}var rP="3.4.13";var h0=me(Ae());var D8=globalThis._parseImageNode,t0=typeof Image<"u",r0=typeof ImageBitmap<"u",N8=Boolean(D8),n0=hi?!0:N8;function nP(t){switch(t){case"auto":return r0||t0||n0;case"imagebitmap":return r0;case"image":return t0;case"data":return n0;default:throw new Error("@loaders.gl/images: image ".concat(t," not supported in this environment"))}}function iP(){if(r0)return"imagebitmap";if(t0)return"image";if(n0)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}Ge();function j8(t){var r=U8(t);if(!r)throw new Error("Not an image");return r}function aP(t){switch(j8(t)){case"data":return t;case"image":case"imagebitmap":var r=document.createElement("canvas"),e=r.getContext("2d");if(!e)throw new Error("getImageData");return r.width=t.width,r.height=t.height,e.drawImage(t,0,0),e.getImageData(0,0,t.width,t.height);default:throw new Error("getImageData")}}function U8(t){return typeof ImageBitmap<"u"&&t instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&t instanceof Image?"image":t&&ue(t)==="object"&&t.data&&t.width&&t.height?"data":null}var of=me(Ae());var G8=/^data:image\/svg\+xml/,z8=/\.svg((\?|#).*)?$/;function Pp(t){return t&&(G8.test(t)||z8.test(t))}function oP(t,r){if(Pp(r)){var e=new TextDecoder,n=e.decode(t);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(n=unescape(encodeURIComponent(n)))}catch(a){throw new Error(a.message)}var i="data:image/svg+xml;base64,".concat(btoa(n));return i}return i0(t,r)}function i0(t,r){if(Pp(r))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(t)])}function sf(t,r,e){return a0.apply(this,arguments)}function a0(){return a0=Y(of.default.mark(function t(r,e,n){var i,a,o;return of.default.wrap(function(u){for(;;
27)switch(u.prev=u.next){case 0:return i=oP(r,n),a=self.URL||self.webkitURL,o=typeof i!="string"&&a.createObjectURL(i),u.prev=3,u.next=6,V8(o||i,e);case 6:return u.abrupt("return",u.sent);case 7:return u.prev=7,o&&a.revokeObjectURL(o),u.finish(7);case 10:case"end":return u.stop()}},t,null,[[3,,7,10]])})),a0.apply(this,arguments)}function V8(t,r){return o0.apply(this,arguments)}function o0(){return o0=Y(of.default.mark(function t(r,e){var n;return of.default.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(n=new Image,n.src=r,!(e.image&&e.image.decode&&n.decode)){a.next=6;break}return a.next=5,n.decode();case 5:return a.abrupt("return",n);case 6:return a.next=8,new Promise(function(o,s){try{n.onload=function(){return o(n)},n.onerror=function(u){return s(new Error("Could not load image ".concat(r,": ").concat(u)))}}catch(u){s(u)}});case 8:return a.abrupt("return",a.sent);case 9:case"end":return a.stop()}},t)})),o0.apply(this,arguments)}var uf=me(Ae());var H8={},sP=!0;function l0(t,r,e){return s0.apply(this,arguments)}function s0(){return s0=Y(uf.default.mark(function t(r,e,n){var i,a,o;return uf.default.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(!Pp(n)){u.next=7;break}return u.next=3,sf(r,e,n);case 3:a=u.sent,i=a,u.next=8;break;case 7:i=i0(r,n);case 8:return o=e&&e.imagebitmap,u.next=11,W8(i,o);case 11:return u.abrupt("return",u.sent);case 12:case"end":return u.stop()}},t)})),s0.apply(this,arguments)}function W8(t){return u0.apply(this,arguments)}function u0(){return u0=Y(uf.default.mark(function t(r){var e,n=arguments;return uf.default.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(e=n.length>1&&n[1]!==void 0?n[1]:null,($8(e)||!sP)&&(e=null),!e){a.next=13;break}return a.prev=3,a.next=6,createImageBitmap(r,e);case 6:return a.abrupt("return",a.sent);case 9:a.prev=9,a.t0=a.catch(3),console.warn(a.t0),sP=!1;case 13:return a.next=15,createImageBitmap(r);case 15:return a.abrupt("return",a.sent);case 16:case"end":return a.stop()}},t,null,[[3,9]])})),u0.apply(this,arguments)}function $8(t){for(var r in t||H8)return!1;return!0}var f0=me(Ae());function uP(t){return!K8(t,"ftyp",4)||!(t[8]&96)?null:X8(t)}function X8(t){var r=q8(t,8,12).replace("\0"," ").trim();switch(r){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function q8(t,r,e){return String.fromCharCode.apply(String,ae(t.slice(r,e)))}function Y8(t){return ae(t).map(function(r){return r.charCodeAt(0)})}function K8(t,r){for(var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=Y8(r),i=0;i<n.length;++i)if(n[i]!==t[i+e])return!1;return!0}var Nn=!1,lf=!0;function uo(t){var r=ff(t);return J8(r)||t5(r)||Q8(r)||e5(r)||Z8(r)}function Z8(t){var r=new Uint8Array(t instanceof DataView?t.buffer:t),e=uP(r);return e?{mimeType:e.mimeType,width:0,height:0}:null}function J8(t){var r=ff(t),e=r.byteLength>=24&&r.getUint32(0,Nn)===2303741511;return e?{mimeType:"image/png",width:r.getUint32(16,Nn),height:r.getUint32(20,Nn)}:null}function Q8(t){var r=ff(t),e=r.byteLength>=10&&r.getUint32(0,Nn)===1195984440;return e?{mimeType:"image/gif",width:r.getUint16(6,lf),height:r.getUint16(8,lf)}:null}function e5(t){var r=ff(t),e=r.byteLength>=14&&r.getUint16(0,Nn)===16973&&r.getUint32(2,lf)===r.byteLength;return e?{mimeType:"image/bmp",width:r.getUint32(18,lf),height:r.getUint32(22,lf)}:null}function t5(t){var r=ff(t),e=r.byteLength>=3&&r.getUint16(0,Nn)===65496&&r.getUint8(2)===255;if(!e)return null;for(var n=r5(),i=n.tableMarkers,a=n.sofMarkers,o=2;o+9<r.byteLength;){var s=r.getUint16(o,Nn);if(a.has(s))return{mimeType:"image/jpeg",height:r.getUint16(o+5,Nn),width:r.getUint16(o+7,Nn)};if(!i.has(s))return null;o+=2,o+=r.getUint16(o,Nn)}return null}function r5(){for(var t=new Set([65499,65476,65484,65501,65534]),r=65504;r<65520;++r)t.add(r);var e=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:t,sofMarkers:e}}function ff(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 p0(t,r){return c0.apply(this,arguments)}function c0(){return c0=Y(f0.default.mark(function t(r,e){var n,i,a;return f0.default.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return n=uo(r)||{},i=n.mimeType,a=globalThis._parseImageNode,je(a),s.next=5,a(r,i);case 5:return s.abrupt("return",s.sent);case 6:case"end":return s.stop()}},t)})),c0.apply(this,arguments)}function v0(t,r,e){return d0.apply(this,arguments)}function d0(){return d0=Y(h0.default.mark(function t(r,e,n){var i,a,o,s,u,l;return h0.default.wrap(function(p){for(;;)switch(p.prev=p.next){case 0:e=e||{},i=e.image||{},a=i.type||"auto",o=n||{},s=o.url,u=n5(a),p.t0=u,p.next=p.t0==="imagebitmap"?8:p.t0==="image"?12:p.t0==="data"?16:20;break;case 8:return p.next=10,l0(r,e,s);case 10:return l=p.sent,p.abrupt("break",21);case 12:return p.next=14,sf(r,e,s);case 14:return l=p.sent,p.abrupt("break",21);case 16:return p.next=18,p0(r,e);case 18:return l=p.sent,p.abrupt("break",21);case 20:je(!1);case 21:return a==="data"&&(l=aP(l)),p.abrupt("return",l);case 23:case"end":return p.stop()}},t)})),d0.apply(this,arguments)}function n5(t){switch(t){case"auto":case"data":return iP();default:return nP(t),t}}var i5=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],a5=["image/png","image/jpeg","image/gif","
27image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],o5={image:{type:"auto",decode:!0}},vn={id:"image",module:"images",name:"Images",version:rP,mimeTypes:a5,extensions:i5,parse:v0,tests:[function(t){return Boolean(uo(new DataView(t)))}],options:o5};var s5=me(Ae());var m0={};function g0(t){if(m0[t]===void 0){var r=hi?l5(t):u5(t);m0[t]=r}return m0[t]}function u5(t){var r=["image/png","image/jpeg","image/gif"],e=globalThis._parseImageNode,n=globalThis._imageFormatsNode,i=n===void 0?r:n;return Boolean(e)&&i.includes(t)}function l5(t){switch(t){case"image/avif":case"image/webp":return f5(t);default:return!0}}function f5(t){try{var r=document.createElement("canvas"),e=r.toDataURL(t);return e.indexOf("data:".concat(t))===0}catch{return!1}}Ge();k();F();j();k();Ge();Ge();function cf(t){if(typeof window<"u"&&ue(window.process)==="object"&&window.process.type==="renderer"||typeof process<"u"&&ue(process.versions)==="object"&&Boolean(process.versions.electron))return!0;var r=(typeof navigator>"u"?"undefined":ue(navigator))==="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent,e=t||r;return!!(e&&e.indexOf("Electron")>=0)}function jt(){var t=(typeof process>"u"?"undefined":ue(process))==="object"&&String(process)==="[object process]"&&!process.browser;return!t||cf()}Ge();var na={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document,process:(typeof process>"u"?"undefined":ue(process))==="object"&&process};var c5=na.self||na.window||na.global,Es=na.window||na.self||na.global,p5=na.document||{},lo=na.process||{};var Op="8.9.33",ybe=jt();var y0=globalThis;function Cs(t){if(!t&&!jt())return"Node";if(cf(t))return"Electron";var r=typeof navigator<"u"?navigator:{},e=t||r.userAgent||"";if(e.indexOf("Edge")>-1)return"Edge";var n=e.indexOf("MSIE ")!==-1,i=e.indexOf("Trident/")!==-1;return n||i?"IE":y0.chrome?"Chrome":y0.safari?"Safari":y0.mozInnerScreenX?"Firefox":"Unknown"}F();j();k();function h5(t){try{var r=window[t],e="__storage_test__";return r.setItem(e,e),r.removeItem(e),r}catch{return null}}var lP=function(){function t(r){A(this,t);var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"sessionStorage";c(this,"storage",void 0),c(this,"id",void 0),c(this,"config",{}),this.storage=h5(n),this.id=r,this.config={},Object.assign(this.config,e),this._loadConfiguration()}return T(t,[{key:"getConfiguration",value:function(){return this.config}},{key:"setConfiguration",value:function(e){return this.config={},this.updateConfiguration(e)}},{key:"updateConfiguration",value:function(e){if(Object.assign(this.config,e),this.storage){var n=JSON.stringify(this.config);this.storage.setItem(this.id,n)}return this}},{key:"_loadConfiguration",value:function(){var e={};if(this.storage){var n=this.storage.getItem(this.id);e=n?JSON.parse(n):{}}return Object.assign(this.config,e),this}}]),t}();function fP(t){var r;return t<10?r="".concat(t.toFixed(2),"ms"):t<100?r="".concat(t.toFixed(1),"ms"):t<1e3?r="".concat(t.toFixed(0),"ms"):r="".concat((t/1e3).toFixed(2),"s"),r}function cP(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:8,e=Math.max(r-t.length,0);return"".concat(" ".repeat(e)).concat(t)}function Ep(t,r,e){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:600,i=t.src.replace(/\(/g,"%28").replace(/\)/g,"%29");t.width>n&&(e=Math.min(e,n/t.width));var a=t.width*e,o=t.height*e,s=["font-size:1px;","padding:".concat(Math.floor(o/2),"px ").concat(Math.floor(a/2),"px;"),"line-height:".concat(o,"px;"),"background:url(".concat(i,");"),"background-size:".concat(a,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(r," %c+"),s]}var Cp;(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"})(Cp||(Cp={}));function pP(t){return typeof t=="string"?Cp[t.toUpperCase()]||Cp.WHITE:t}function hP(t,r,e){return!jt&&typeof t=="string"&&(r&&(r=pP(r),t="\x1B[".concat(r,"m").concat(t,"\x1B[39m")),e&&(r=pP(e),t="\x1B[".concat(e+10,"m").concat(t,"\x1B[49m"))),t}function d5(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=v5(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}
27}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
28In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function v5(t,r){if(t){if(typeof t=="string")return dP(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return dP(t,r)}}function dP(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function vP(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["constructor"],e=Object.getPrototypeOf(t),n=Object.getOwnPropertyNames(e),i=d5(n),a;try{var o=function(){var u=a.value;typeof t[u]=="function"&&(r.find(function(l){return u===l})||(t[u]=t[u].bind(t)))};for(i.s();!(a=i.n()).done;)o()}catch(s){i.e(s)}finally{i.f()}}function Ms(t,r){if(!t)throw new Error(r||"Assertion failed")}function fo(){var t;if(jt&&"performance"in Es){var r,e;t=Es===null||Es===void 0||(r=Es.performance)===null||r===void 0||(e=r.now)===null||e===void 0?void 0:e.call(r)}else if("hrtime"in lo){var n,i=lo===null||lo===void 0||(n=lo.hrtime)===null||n===void 0?void 0:n.call(lo);t=i[0]*1e3+i[1]/1e6}else t=Date.now();return t}var Is={debug:jt&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},m5={enabled:!0,level:0};function Hr(){}var mP={},gP={once:!0},ia=function(){function t(){A(this,t);var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""}
28,e=r.id;c(this,"id",void 0),c(this,"VERSION",Op),c(this,"_startTs",fo()),c(this,"_deltaTs",fo()),c(this,"_storage",void 0),c(this,"userData",{}),c(this,"LOG_THROTTLE_TIMEOUT",0),this.id=e,this._storage=new lP("__probe-".concat(this.id,"__"),m5),this.userData={},this.timeStamp("".concat(this.id," started")),vP(this),Object.seal(this)}return T(t,[{key:"level",get:function(){return this.getLevel()},set:function(e){this.setLevel(e)}},{key:"isEnabled",value:function(){return this._storage.config.enabled}},{key:"getLevel",value:function(){return this._storage.config.level}},{key:"getTotal",value:function(){return Number((fo()-this._startTs).toPrecision(10))}},{key:"getDelta",value:function(){return Number((fo()-this._deltaTs).toPrecision(10))}},{key:"priority",get:function(){return this.level},set:function(e){this.level=e}},{key:"getPriority",value:function(){return this.level}},{key:"enable",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return this._storage.updateConfiguration({enabled:e}),this}},{key:"setLevel",value:function(e){return this._storage.updateConfiguration({level:e}),this}},{key:"get",value:function(e){return this._storage.config[e]}},{key:"set",value:function(e,n){this._storage.updateConfiguration(c({},e,n))}},{key:"settings",value:function(){console.table?console.table(this._storage.config):console.log(this._storage.config)}},{key:"assert",value:function(e,n){Ms(e,n)}},{key:"warn",value:function(e){return this._getLogFunction(0,e,Is.warn,arguments,gP)}},{key:"error",value:function(e){return this._getLogFunction(0,e,Is.error,arguments)}},{key:"deprecated",value:function(e,n){return this.warn("`".concat(e,"` is deprecated and will be removed in a later version. Use `").concat(n,"` instead"))}},{key:"removed",value:function(e,n){return this.error("`".concat(e,"` has been removed. Use `").concat(n,"` instead"))}},{key:"probe",value:function(e,n){return this._getLogFunction(e,n,Is.log,arguments,{time:!0,once:!0})}},{key:"log",value:function(e,n){return this._getLogFunction(e,n,Is.debug,arguments)}},{key:"info",value:function(e,n){return this._getLogFunction(e,n,console.info,arguments)}},{key:"once",value:function(e,n){for(var i=arguments.length,a=new Array(i>2?i-2:0),o=2;o<i;o++)a[o-2]=arguments[o];return this._getLogFunction(e,n,Is.debug||Is.info,arguments,gP)}},{key:"table",value:function(e,n,i){return n?this._getLogFunction(e,n,console.table||Hr,i&&[i],{tag:b5(n)}):Hr}},{key:"image",value:function(e){var n=e.logLevel,i=e.priority,a=e.image,o=e.message,s=o===void 0?"":o,u=e.scale,l=u===void 0?1:u;return this._shouldLog(n||i)?jt?_5({image:a,message:s,scale:l}):y5({image:a,message:s,scale:l}):Hr}},{key:"time",value:function(e,n){return this._getLogFunction(e,n,console.time?console.time:console.info)}},{key:"timeEnd",value:function(e,n){return this._getLogFunction(e,n,console.timeEnd?console.timeEnd:console.info)}},{key:"timeStamp",value:function(e,n){return this._getLogFunction(e,n,console.timeStamp||Hr)}},{key:"group",value:function(e,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},a=yP({logLevel:e,message:n,opts:i}),o=i.collapsed;return a.method=(o?console.groupCollapsed:console.group)||console.info,this._getLogFunction(a)}},{key:"groupCollapsed",value:function(e,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.group(e,n,Object.assign({},i,{collapsed:!0}))}},{key:"groupEnd",value:function(e){return this._getLogFunction(e,"",console.groupEnd||Hr)}},{key:"withGroup",value:function(e,n,i){this.group(e,n)();try{i()}finally{this.groupEnd(e)()}}},{key:"trace",value:function(){console.trace&&console.trace()}},{key:"_shouldLog",value:function(e){return this.isEnabled()&&this.getLevel()>=_P(e)}},{key:"_getLogFunction",value:function(e,n,i,a,o){if(this._shouldLog(e)){var s;o=yP({logLevel:e,message:n,args:a,opts:o}),i=i||o.method,Ms(i),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=fo();var u=o.tag||o.message;if(o.once)if(!mP[u])mP[u]=fo();else return Hr;return n=g5(this.id,o.message,o),(s=i).bind.apply(s,[console,n].concat(ae(o.args)))}return Hr}}]),t}();c(ia,"VERSION",Op);function _P(t){if(!t)return 0;var r;switch(ue(t)){case"number":r=t;break;case"object":r=t.logLevel||t.priority||0;break;default:return 0}return Ms(Number.isFinite(r)&&r>=0),r}function yP(t){var r=t.logLevel,e=t.message;t.logLevel=_P(r);for(var n=t.args?Array.from(t.args):[];n.length&&n.shift()!==e;);switch(ue(r)){case"string":case"function":e!==void 0&&n.unshift(e),t.message=r;break;case"object":Object.assign(t,r);break;default:}typeof t.message=="function"&&(t.message=t.message());var i=ue(t.message);return Ms(i==="string"||i==="object"),Object.assign(t,{args:n},t.opts)}function g5(t,r,e){if(typeof r=="string"){var n=e.time?cP(fP(e.total)):"";
28r=e.time?"".concat(t,": ").concat(n,"  ").concat(r):"".concat(t,": ").concat(r),r=hP(r,e.color,e.background)}return r}function y5(t){var r=t.image,e=t.message,n=e===void 0?"":e,i=t.scale,a=i===void 0?1:i,o=null;try{o=module.require("asciify-image")}catch{}return o?function(){return o(r,{fit:"box",width:"".concat(Math.round(80*a),"%")}).then(function(s){return console.log(s)})}:Hr}function _5(t){var r=t.image,e=t.message,n=e===void 0?"":e,i=t.scale,a=i===void 0?1:i;if(typeof r=="string"){var o=new Image;return o.onload=function(){var f,p=Ep(o,n,a);(f=console).log.apply(f,ae(p))},o.src=r,Hr}var s=r.nodeName||"";if(s.toLowerCase()==="img"){var u;return(u=console).log.apply(u,ae(Ep(r,n,a))),Hr}if(s.toLowerCase()==="canvas"){var l=new Image;return l.onload=function(){var f;return(f=console).log.apply(f,ae(Ep(l,n,a)))},l.src=r.toDataURL(),Hr}return Hr}function b5(t){for(var r in t)for(var e in t[r])return e||"untitled";return"empty"}var i1e=new ia({id:"@probe.gl/log"});var ne=new ia({id:"deck"});var _0={};function Mp(t){_0=t}function wt(t,r,e,n){ne.level>0&&_0[t]&&_0[t].call(null,r,e,n)}function x5(t){var r=t[0],e=t[t.length-1];return r==="{"&&e==="}"||r==="["&&e==="]"}var bP={id:"JSON",name:"JSON",module:"",version:"",options:{},extensions:["json","geojson"],mimeTypes:["application/json","application/geo+json"],testText:x5,parseTextSync:JSON.parse};function xP(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function AP(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?xP(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):xP(Object(e)).forEac
28h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function A5(){var t="8.9.33",r=globalThis.deck&&globalThis.deck.VERSION;if(r&&r!==t)throw new Error("deck.gl - multiple versions detected: ".concat(r," vs ").concat(t));return r||(ne.log(1,"deck.gl ".concat(t))(),globalThis.deck=AP(AP({},globalThis.deck),{},{VERSION:t,version:t,log:ne,_registerLoggers:Mp}),tf([bP,[vn,{imagebitmap:{premultiplyAlpha:"none"}}]])),t}var Ip=A5();var de={DEFAULT:-1,LNGLAT:1,METER_OFFSETS:2,LNGLAT_OFFSETS:3,CARTESIAN:0};Object.defineProperty(de,"IDENTITY",{get:function(){return ne.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")(),0}});var rr={WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},dt={common:0,meters:1,pixels:2},b0={click:{handler:"onClick"},panstart:{handler:"onDragStart"},panmove:{handler:"onDrag"},panend:{handler:"onDragEnd"}},SP={DRAW:"draw",MASK:"mask",TERRAIN:"terrain"};F();j();k();var fe=new ia({id:"luma.gl"});function Mt(t,r){if(!t)throw new Error(r||"luma.gl: assertion failed.")}var S5="Invalid WebGLRenderingContext";var T5="Requires WebGL2";function vi(t){return typeof WebGLRenderingContext<"u"&&t instanceof WebGLRenderingContext||typeof WebGL2RenderingContext<"u"&&t instanceof WebGL2RenderingContext?!0:Boolean(t&&Number.isFinite(t._version))}function ge(t){return typeof WebGL2RenderingContext<"u"&&t instanceof WebGL2RenderingContext?!0:Boolean(t&&t._version===2)}function x0(t){return ge(t)?t:null}function mi(t){return Mt(vi(t),S5),t}function ct(t){return Mt(ge(t),T5),t}var pf={};function w5(t){globalThis.console&&globalThis.console.error&&globalThis.console.error(t)}function P5(t){globalThis.console&&globalThis.console.log&&globalThis.console.log(t)}function O5(t,r){pf[t]=!0,r!==void 0&&w5(r)}function E5(t){var r=t.getError;t.getError=function(){var n;do n=r.apply(t),n!==0&&(pf[n]=!0);while(n!==0);for(n in pf)if(pf[n])return delete pf[n],parseInt(n,10);return 0}}var hf=function t(r){var e=r.gl;this.ext=r,this.isAlive=!0,this.hasBeenBound=!1,this.elementArrayBuffer=null,this.attribs=new Array(r.maxVertexAttribs);for(var n=0;n<this.attribs.length;n++){var i=new t.VertexAttrib(e);this.attribs[n]=i}this.maxAttrib=0};hf.VertexAttrib=function(r){this.enabled=!1,this.buffer=null,this.size=4,this.type=5126,this.normalized=!1,this.stride=16,this.offset=0,this.cached="",this.recache()};hf.VertexAttrib.prototype.recache=function(){this.cached=[this.size,this.type,this.normalized,this.stride,this.offset].join(":")};var co=function(r){var e=this;this.gl=r,E5(r);var n=this.original={getParameter:r.getParameter,enableVertexAttribArray:r.enableVertexAttribArray,disableVertexAttribArray:r.disableVertexAttribArray,bindBuffer:r.bindBuffer,getVertexAttrib:r.getVertexAttrib,vertexAttribPointer:r.vertexAttribPointer};r.getParameter=function(a){return a===e.VERTEX_ARRAY_BINDING_OES?e.currentVertexArrayObject===e.defaultVertexArrayObject?null:e.currentVertexArrayObject:n.getParameter.apply(this,arguments)},r.enableVertexAttribArray=function(a){var o=e.currentVertexArrayObject;o.maxAttrib=Math.max(o.maxAttrib,a);var s=o.attribs[a];return s.enabled=!0,n.enableVertexAttribArray.apply(this,arguments)},r.disableVertexAttribArray=function(a){var o=e.currentVertexArrayObject;o.maxAttrib=Math.max(o.maxAttrib,a);var s=o.attribs[a];return s.enabled=!1,n.disableVertexAttribArray.apply(this,arguments)},r.bindBuffer=function(a,o){switch(a){case 34962:e.currentArrayBuffer=o;break;case 34963:e.currentVertexArrayObject.elementArrayBuffer=o;break;default:}return n.bindBuffer.apply(this,arguments)},r.getVertexAttrib=function(a,o){var s=e.currentVertexArrayObject,u=s.attribs[a];switch(o){case 34975:return u.buffer;case 34338:return u.enabled;case 34339:return u.size;case 34340:return u.stride;case 34341:return u.type;case 34922:return u.normalized;default:return n.getVertexAttrib.apply(this,arguments)}},r.vertexAttribPointer=function(a,o,s,u,l,f){var p=e.currentVertexArrayObject;p.maxAttrib=Math.max(p.maxAttrib,a);var h=p.attribs[a];return h.buffer=e.currentArrayBuffer,h.size=o,h.type=s,h.normalized=u,h.stride=l,h.offset=f,h.recache(),n.vertexAttribPointer.apply(this,arguments)},r.instrumentExtension&&r.instrumentExtension(this,"OES_vertex_array_object"),r.canvas&&r.canvas.addEventListener("webglcontextrestored",function(){P5("OESVertexArrayObject emulation library context restored"),e.reset_()},!0),this.reset_()};co.prototype.VERTEX_ARRAY_BINDING_OES=34229;co.prototype.reset_=function(){var r=this.vertexArrayObjects!==void 0;if(r)for(var e=0;e<this.vertexArrayObjects.length;++e)this.vertexArrayObjects.isAlive=!1;var n=this.gl;this.maxVertexAttribs=n.getParameter(34921),this.defaultVertexArrayObject=ne
28w hf(this),this.currentVertexArrayObject=null,this.currentArrayBuffer=null,this.vertexArrayObjects=[this.defaultVertexArrayObject],this.bindVertexArrayOES(null)};co.prototype.createVertexArrayOES=function(){var r=new hf(this);return this.vertexArrayObjects.push(r),r};co.prototype.deleteVertexArrayOES=function(r){r.isAlive=!1,this.vertexArrayObjects.splice(this.vertexArrayObjects.indexOf(r),1),this.currentVertexArrayObject===r&&this.bindVertexArrayOES(null)};co.prototype.isVertexArrayOES=function(r){return!!(r&&r instanceof hf&&r.hasBeenBound&&r.ext===this)};co.prototype.bindVertexArrayOES=function(r){var e=this.gl;if(r&&!r.isAlive){O5(1282,"bindVertexArrayOES: attempt to bind deleted arrayObject");return}var n=this.original,i=this.currentVertexArrayObject;this.currentVertexArrayObject=r||this.defaultVertexArrayObject,this.currentVertexArrayObject.hasBeenBound=!0;var a=this.currentVertexArrayObject;if(i!==a){(!i||a.elementArrayBuffer!==i.elementArrayBuffer)&&n.bindBuffer.call(e,34963,a.elementArrayBuffer);for(var o=this.currentArrayBuffer,s=Math.max(i?i.maxAttrib:0,a.maxAttrib),u=0;u<=s;u++){var l=a.attribs[u],f=i?i.attribs[u]:null;if((!i||l.enabled!==f.enabled)&&(l.enabled?n.enableVertexAttribArray.call(e,u):n.disableVertexAttribArray.call(e,u)),l.enabled){var p=!1;(!i||l.buffer!==f.buffer)&&(o!==l.buffer&&(n.bindBuffer.call(e,34962,l.buffer),o=l.buffer),p=!0),(p||l.cached!==f.cached)&&n.vertexAttribPointer.call(e,u,l.size,l.type,l.normalized,l.stride,l.offset)}}this.currentArrayBuffer!==o&&n.bindBuffer.call(e,34962,this.currentArrayBuffer)}};function TP(t){if(typeof t.createVertexArray!="function"){var r=t.getSupportedExtensions;t.getSupportedExtensions=function(){var i=r.call(this)||[];return i.indexOf("OES_vertex_array_object")<0&&i.push("OES_vertex_array_object"),i};var e=t.getExtension;t.getExtension=function(i){var a=e.call(this,i);return a||(i!=="OES_vertex_array_object"?null:(t.__OESVertexArrayObject||(this.__OESVertexArrayObject=new co(this)),this.__OESVertexArrayObject))}}}k();k();var Ue,wP="OES_element_index",PP="WEBGL_draw_buffers",C5="EXT_disjoint_timer_query",M5="EXT_disjoint_timer_query_webgl2",I5="EXT_texture_filter_anisotropic",OP="WEBGL_debug_renderer_info",R5=35723,L5=4352,k5=36795,B5=34047,F5=37445,D5=37446,pt=function(r){return ge(r)?void 0:0},N5=(Ue={},c(Ue,3074,function(r){return ge(r)?void 0:36064}),c(Ue,R5,function(t){return ge(t)?void 0:L5}),c(Ue,35977,pt),c(Ue,32937,pt),c(Ue,k5,function(t,r){var e=ge(t)?t.getExtension(M5):t.getExtension(C5);return e&&e.GPU_DISJOINT_EXT?r(e.GPU_DISJOINT_EXT):0}),c(Ue,F5,function(t,r){var e=t.getExtension(OP);return r(e&&e.UNMASKED_VENDOR_WEBGL||7936)}),c(Ue,D5,function(t,r){var e=t.getExtension(OP);return r(e&&e.UNMASKED_RENDERER_WEBGL||7937)}),c(Ue,B5,function(t,r){var e=t.luma.extensions[I5];return e?r(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1}),c(Ue,32883,pt),c(Ue,35071,pt),c(Ue,37447,pt),c(Ue,36063,function(r,e){if(!ge(r)){var n=r.getExtension(PP);return n?e(n.MAX_COLOR_ATTACHMENTS_WEBGL):0}}),c(Ue,35379,pt),c(Ue,35374,pt),c(Ue,35377,pt),c(Ue,34852,function(r){if(!ge(r)){var e=r.getExtension(PP);return e?e.MAX_DRAW_BUFFERS_WEBGL:0}}),c(Ue,36203,function(r){return r.getExtension(wP)?2147483647:65535}),c(Ue,33001,function(r){return r.getExtension(wP)?16777216:65535}),c(Ue,33e3,function(r){return 16777216}),c(Ue,37157,pt),c(Ue,35373,pt),c(Ue,35657,pt),c(Ue,36183,pt),c(Ue,37137,pt),c(Ue,34045,pt),c(Ue,35978,pt),c(Ue,35979,pt),c(Ue,35968,pt),c(Ue,35376,pt),c(Ue,35375,pt),c(Ue,35659,pt),c(Ue,37154,pt),c(Ue,35371,pt),c(Ue,35658,pt),c(Ue,35076,pt),c(Ue,35077,pt),c(Ue,35380,pt),Ue);function EP(t,r,e){var n=N5[e],i=typeof n=="function"?n(t,r,e):n,a=i!==void 0?i:r(e);return a}var Rs,j5="OES_vertex_array_object",CP="ANGLE_instanced_arrays",U5="WEBGL_draw_buffers",G5="EXT_disjoint_timer_query",z5="EXT_texture_filter_anisotropic",V5="VertexArray requires WebGL2 or OES_vertex_array_object extension";function H5(t,r){return{webgl2:ge(t),ext:t.getExtension(r)}}var A0=(Rs={},c(Rs,j5,{meta:{suffix:"OES"},createVertexArray:function(){Mt(!1,V5)},deleteVertexArray:function(){},bindVertexArray:function(){},isVertexArray:function(){return!1}}),c(Rs,CP,{meta:{suffix:"ANGLE"},vertexAttribDivisor:function(r,e){Mt(e===0,"WebGL instanced rendering not supported")},drawElementsInstanced:function(){},drawArraysInstanced:function(){}}),c(Rs,U5,{meta:{suffix:"WEBGL"},drawBuffers:function(){Mt(!1)}}),c(Rs,G5,{meta:{suffix:"EXT"}
28,createQuery:function(){Mt(!1)},deleteQuery:function(){Mt(!1)},beginQuery:function(){Mt(!1)},endQuery:function(){},getQuery:function(r,e){return this.getQueryObject(r,e)},getQueryParameter:function(r,e){return this.getQueryObject(r,e)},getQueryObject:function(){}}),Rs),Rp={readBuffer:function(r,e,n){ge(r)&&e(n)},getVertexAttrib:function(r,e,n,i){var a=H5(r,CP),o=a.webgl2,s=a.ext,u;switch(i){case 35069:u=o?void 0:!1;break;case 35070:u=!o&&!s?0:void 0;break;default:}return u!==void 0?u:e(n,i)},getProgramParameter:function(r,e,n,i){if(!ge(r))switch(i){case 35967:return 35981;case 35971:return 0;case 35382:return 0;default:}return e(n,i)},getInternalformatParameter:function(r,e,n,i,a){if(!ge(r))switch(a){case 32937:return new Int32Array([0]);default:}return r.getInternalformatParameter(n,i,a)},getTexParameter:function(r,e,n,i){switch(i){case 34046:var a=r.luma.extensions,o=a[z5];i=o&&o.TEXTURE_MAX_ANISOTROPY_EXT||34046;break;default:}return e(n,i)},getParameter:EP,hint:function(r,e,n,i){return e(n,i)}};function IP(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=W5(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
29In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function W5(t,r){if(t){if(typeof t=="string")return MP(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return MP(t,r)}}function MP(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function RP(t){t.luma=t.luma||{};var r=t.luma;return r.polyfilled||(TP(t),$5(t),q5(t,A0),X5(t,{target:r,target2:t}),r.polyfilled=!0),t}globalThis.polyfillContext=RP;function $5(t){t.luma.extensions={};var r=t.getSupportedExtensions()||[],e=IP(r),n;try{for(e.s();!(n=e.n()).done;){var i=n.value;t.luma[i]=t.getExtension(i)}}catch(a){e.e(a)}finally{e.f()}}function X5(t,r){var e=r.target,n=r.target2;Object.keys(Rp).forEach(function(i){if(typeof Rp[i]=="function"){var a=t[i]?t[i].bind(t):function(){},o=Rp[i].bind(null,t,a);e[i]=o,n[i]=o}})}function q5(t,r){var e=IP(Object.getOwnPropertyNames(r)),n;try{for(e.s();!(n=e.n()).done;){var i=n.value;i!=="overrides"&&Y5(t,{extension:i,target:t.luma,target2:t})}}catch(a){e.e(a)}finally{e.f()}}function Y5(t,r){var e=r.extension,n=r.target,i=r.target2,a=A0[e];Mt(a);for(var o=a.meta,s=o===void 0?{}:o,u=s.suffix,l=u===void 0?"":u,f=t.getExtension(e),p=function(){var m=d[h],g="".concat(m).concat(l),y=null;m==="meta"||typeof t[m]=="function"||(f&&typeof f[g]=="function"?y=function(){return f[g].apply(f,arguments)}:typeof a[m]=="function"&&(y=a[m].bind(n))),y&&(n[m]=y,i[m]=y)},h=0,d=Object.keys(a);h<d.length;h++)p()}be();k();var Se,se,Wr,vf=(Se={},c(Se,3042,!1),c(Se,32773,new Float32Array([0,0,0,0])),c(Se,32777,32774),c(Se,34877,32774),c(Se,32969,1),c(Se,32968,0),c(Se,32971,1),c(Se,32970,0),c(Se,3106,new Float32Array([0,0,0,0])),c(Se,3107,[!0,!0,!0,!0]),c(Se,2884,!1),c(Se,2885,1029),c(Se,2929,!1),c(Se,2931,1),c(Se,2932,513),c(Se,2928,new Float32Array([0,1])),c(Se,2930,!0),c(Se,3024,!0),c(Se,36006,null),c(Se,2886,2305),c(Se,33170,4352),c(Se,2849,1),c(Se,32823,!1),c(Se,32824,0),c(Se,10752,0),c(Se,32938,1),c(Se,32939,!1),c(Se,3089,!1),c(Se,3088,new Int32Array([0,0,1024,1024])),c(Se,2960,!1),c(Se,2961,0),c(Se,2968,4294967295),c(Se,36005,4294967295),c(Se,2962,519),c(Se,2967,0),c(Se,2963,4294967295),c(Se,34816,519),c(Se,36003,0),c(Se,36004,4294967295),c(Se,2964,7680),c(Se,2965,7680),c(Se,2966,7680),c(Se,34817,7680),c(Se,34818,7680),c(Se,34819,7680),c(Se,2978,[0,0,1024,1024]),c(Se,3333,4),c(Se,3317,4),c(Se,37440,!1),c(Se,37441,!1),c(Se,37443,37444),c(Se,35723,4352),c(Se,36010,null),
29c(Se,35977,!1),c(Se,3330,0),c(Se,3332,0),c(Se,3331,0),c(Se,3314,0),c(Se,32878,0),c(Se,3316,0),c(Se,3315,0),c(Se,32877,0),Se),aa=function(r,e,n){return e?r.enable(n):r.disable(n)},LP=function(r,e,n){return r.hint(n,e)},kr=function(r,e,n){return r.pixelStorei(n,e)},K5=function(r,e){var n=ge(r)?36009:36160;return r.bindFramebuffer(n,e)},Z5=function(r,e){return r.bindFramebuffer(36008,e)};function df(t){return Array.isArray(t)||ArrayBuffer.isView(t)}var kP=(se={},c(se,3042,aa),c(se,32773,function(r,e){return r.blendColor.apply(r,ae(e))}),c(se,32777,"blendEquation"),c(se,34877,"blendEquation"),c(se,32969,"blendFunc"),c(se,32968,"blendFunc"),c(se,32971,"blendFunc"),c(se,32970,"blendFunc"),c(se,3106,function(r,e){return r.clearColor.apply(r,ae(e))}),c(se,3107,function(r,e){return r.colorMask.apply(r,ae(e))}),c(se,2884,aa),c(se,2885,function(r,e){return r.cullFace(e)}),c(se,2929,aa),c(se,2931,function(r,e){return r.clearDepth(e)}),c(se,2932,function(r,e){return r.depthFunc(e)}),c(se,2928,function(r,e){return r.depthRange.apply(r,ae(e))}),c(se,2930,function(r,e){return r.depthMask(e)}),c(se,3024,aa),c(se,35723,LP),c(se,36006,K5),c(se,2886,function(r,e){return r.frontFace(e)}),c(se,33170,LP),c(se,2849,function(r,e){return r.lineWidth(e)}),c(se,32823,aa),c(se,32824,"polygonOffset"),c(se,10752,"polygonOffset"),c(se,35977,aa),c(se,32938,"sampleCoverage"),c(se,32939,"sampleCoverage"),c(se,3089,aa),c(se,3088,function(r,e){return r.scissor.apply(r,ae(e))}),c(se,2960,aa),c(se,2961,function(r,e){return r.clearStencil(e)}),c(se,2968,function(r,e){return r.stencilMaskSeparate(1028,e)}),c(se,36005,function(r,e){return r.stencilMaskSeparate(1029,e)}),c(se,2962,"stencilFuncFront"),c(se,2967,"stencilFuncFront"),c(se,2963,"stencilFuncFront"),c(se,34816,"stencilFuncBack"),c(se,36003,"stencilFuncBack"),c(se,36004,"stencilFuncBack"),c(se,2964,"stencilOpFront"),c(se,2965,"stencilOpFront"),c(se,2966,"stencilOpFront"),c(se,34817,"stencilOpBack"),c(se,34818,"stencilOpBack"),c(se,34819,"stencilOpBack"),c(se,2978,function(r,e){return r.viewport.apply(r,ae(e))}),c(se,3333,kr),c(se,3317,kr),c(se,37440,kr),c(se,37441,kr),c(se,37443,kr),c(se,3330,kr),c(se,3332,kr),c(se,3331,kr),c(se,36010,Z5),c(se,3314,kr),c(se,32878,kr),c(se,3316,kr),c(se,3315,kr),c(se,32877,kr),c(se,"framebuffer",function(r,e){var n=e&&"handle"in e?e.handle:e;return r.bindFramebuffer(36160,n)}),c(se,"blend",function(r,e){return e?r.enable(3042):r.disable(3042)}),c(se,"blendColor",function(r,e){return r.blendColor.apply(r,ae(e))}),c(se,"blendEquation",function(r,e){e=df(e)?e:[e,e],r.blendEquationSeparate.apply(r,ae(e))}),c(se,"blendFunc",function(r,e){e=df(e)&&e.length===2?[].concat(ae(e),ae(e)):e,r.blendFuncSeparate.apply(r,ae(e))}),c(se,"clearColor",function(r,e){return r.clearColor.apply(r,ae(e))}),c(se,"clearDepth",function(r,e){return r.clearDepth(e)}),c(se,"clearStencil",function(r,e){return r.clearStencil(e)}),c(se,"colorMask",function(r,e){return r.colorMask.apply(r,ae(e))}),c(se,"cull",function(r,e){return e?r.enable(2884):r.disable(2884)}),c(se,"cullFace",function(r,e){return r.cullFace(e)}),c(se,"depthTest",function(r,e){return e?r.enable(2929):r.disable(2929)}),c(se,"depthFunc",function(r,e){return r.depthFunc(e)}),c(se,"depthMask",function(r,e){return r.depthMask(e)}),c(se,"depthRange",function(r,e){return r.depthRange.apply(r,ae(e))}),c(se,"dither",function(r,e){return e?r.enable(3024):r.disable(3024)}),c(se,"derivativeHint",function(r,e){r.hint(35723,e)}),c(se,"frontFace",function(r,e){return r.frontFace(e)}),c(se,"mipmapHint",function(r,e){return r.hint(33170,e)}),c(se,"lineWidth",function(r,e){return r.lineWidth(e)}),c(se,"polygonOffsetFill",function(r,e){return e?r.enable(32823):r.disable(32823)}),c(se,"polygonOffset",function(r,e){return r.polygonOffset.apply(r,ae(e))}),c(se,"sampleCoverage",function(r,e){return r.sampleCoverage.apply(r,ae(e))}),c(se,"scissorTest",function(r,e){return e?r.enable(3089):r.disable(3089)}),c(se,"scissor",function(r,e){return r.scissor.apply(r,ae(e))}),c(se,"stencilTest",function(r,e){return e?r.enable(2960):r.disable(2960)}),c(se,"stencilMask",function(r,e){e=df(e)?e:[e,e];var n=e,i=W(n,2),a=i[0],o=i[1];r.stencilMaskSeparate(1028,a),r.stencilMaskSeparate(1029,o)}),c(se,"stencilFunc",function(r,e){e=df(e)&&e.length===3?[].concat(ae(e),ae(e)):e;var n=e,i=W(n,6),a=i[0],o=i[1],s=i[2],u=i[3],l=i[4],f=i[5];r.stencilFuncSeparate(1028,a,o,s),r.stencilFuncSeparate(1029,u,l,f)}),c(se,"stencilOp",function(r,e){e=df(e)&&e.length===3?[].concat(ae(e),ae(e)):e;var n=e,i=W(n,6),a=i[0],o=i[1],s=i[2],u=i[3],l=i[4],f=i[5];r.stencilOpSeparate(1028,a,o,s),r.stencilOpSeparate(1029,u,l,f)}),c(se,"viewport",function(r,e){return r.viewport.apply(r,ae(e))}),se);function Pt(t,r,e){return r[t]!==void 0?r[t]:e[t]}var BP={blendEquation:function(r,e,n){return r.blendEquationSeparate(Pt(32777,e,n),Pt(34877,e,n))},blendFunc:function(r,e,n){return r.blendFuncSeparate(Pt(32969,e,n),Pt(32968,e,n),Pt(32971,e,n),Pt(32970,e,n))},polygonOffset:function(r,e,n){return r.polygonOffset(Pt(32824,e,n),Pt(10752,e,n))}
29,sampleCoverage:function(r,e,n){return r.sampleCoverage(Pt(32938,e,n),Pt(32939,e,n))},stencilFuncFront:function(r,e,n){return r.stencilFuncSeparate(1028,Pt(2962,e,n),Pt(2967,e,n),Pt(2963,e,n))},stencilFuncBack:function(r,e,n){return r.stencilFuncSeparate(1029,Pt(34816,e,n),Pt(36003,e,n),Pt(36004,e,n))},stencilOpFront:function(r,e,n){return r.stencilOpSeparate(1028,Pt(2964,e,n),Pt(2965,e,n),Pt(2966,e,n))},stencilOpBack:function(r,e,n){return r.stencilOpSeparate(1029,Pt(34817,e,n),Pt(34818,e,n),Pt(34819,e,n))}},S0={enable:function(r,e){return r(c({},e,!0))},disable:function(r,e){return r(c({},e,!1))},pixelStorei:function(r,e,n){return r(c({},e,n))},hint:function(r,e,n){return r(c({},e,n))},bindFramebuffer:function(r,e,n){var i;switch(e){case 36160:return r((i={},c(i,36006,n),c(i,36010,n),i));case 36009:return r(c({},36006,n));case 36008:return r(c({},36010,n));default:return null}},blendColor:function(r,e,n,i,a){return r(c({},32773,new Float32Array([e,n,i,a])))},blendEquation:function(r,e){var n;return r((n={},c(n,32777,e),c(n,34877,e),n))},blendEquationSeparate:function(r,e,n){var i;return r((i={},c(i,32777,e),c(i,34877,n),i))},blendFunc:function(r,e,n){var i;return r((i={},c(i,32969,e),c(i,32968,n),c(i,32971,e),c(i,32970,n),i))},blendFuncSeparate:function(r,e,n,i,a){var o;return r((o={},c(o,32969,e),c(o,32968,n),c(o,32971,i),c(o,32970,a),o))},clearColor:function(r,e,n,i,a){return r(c({},3106,new Float32Array([e,n,i,a])))},clearDepth:function(r,e){return r(c({},2931,e))},clearStencil:function(r,e){return r(c({},2961,e))},colorMask:function(r,e,n,i,a){return r(c({},3107,[e,n,i,a]))},cullFace:function(r,e){return r(c({},2885,e))},depthFunc:function(r,e){return r(c({},2932,e))},depthRange:function(r,e,n){return r(c({},2928,new Float32Array([e,n])))},depthMask:function(r,e){return r(c({},2930,e))},frontFace:function(r,e){return r(c({},2886,e))},lineWidth:function(r,e){return r(c({},2849,e))},polygonOffset:function(r,e,n){var i;return r((i={},c(i,32824,e),c(i,10752,n),i))},sampleCoverage:function(r,e,n){var i;return r((i={},c(i,32938,e),c(i,32939,n),i))},scissor:function(r,e,n,i,a){return r(c({},3088,new Int32Array([e,n,i,a])))},stencilMask:function(r,e){var n;return r((n={},c(n,2968,e),c(n,36005,e),n))},stencilMaskSeparate:function(r,e,n){return r(c({},e===1028?2968:36005,n))},stencilFunc:function(r,e,n,i){var a;return r((a={},c(a,2962,e),c(a,2967,n),c(a,2963,i),c(a,34816,e),c(a,36003,n),c(a,36004,i),a))},stencilFuncSeparate:function(r,e,n,i,a){var o;return r((o={},c(o,e===1028?2962:34816,n),c(o,e===1028?2967:36003,i),c(o,e===1028?2963:36004,a),o))},stencilOp:function(r,e,n,i){var a;return r((a={},c(a,2964,e),c(a,2965,n),c(a,2966,i),c(a,34817,e),c(a,34818,n),c(a,34819,i),a))},stencilOpSeparate:function(r,e,n,i,a){var o;return r((o={}
29,c(o,e===1028?2964:34817,n),c(o,e===1028?2965:34818,i),c(o,e===1028?2966:34819,a),o))},viewport:function(r,e,n,i,a){return r(c({},2978,[e,n,i,a]))}},jn=function(r,e){return r.isEnabled(e)},T0=(Wr={},c(Wr,3042,jn),c(Wr,2884,jn),c(Wr,2929,jn),c(Wr,3024,jn),c(Wr,32823,jn),c(Wr,32926,jn),c(Wr,32928,jn),c(Wr,3089,jn),c(Wr,2960,jn),c(Wr,35977,jn),Wr);F();j();function w0(t){for(var r in t)return!1;return!0}function FP(t,r){if(t===r)return!0;var e=Array.isArray(t)||ArrayBuffer.isView(t),n=Array.isArray(r)||ArrayBuffer.isView(r);if(e&&n&&t.length===r.length){for(var i=0;i<t.length;++i)if(t[i]!==r[i])return!1;return!0}return!1}function DP(t,r){var e=t[r].bind(t);t[r]=function(){var i=arguments.length<=0?void 0:arguments[0];return i in t.state.cache&&t.state.enable?t.state.cache[i]:e.apply(void 0,arguments)},Object.defineProperty(t[r],"name",{value:"".concat(r,"-from-cache"),configurable:!1})}function J5(t,r,e){var n=t[r].bind(t);t[r]=function(){for(var a=arguments.length,o=new Array(a),s=0;s<a;s++)o[s]=arguments[s];var u=e.apply(void 0,[t.state._updateCache].concat(o)),l=u.valueChanged,f=u.oldValue;return l&&n.apply(void 0,o),f},Object.defineProperty(t[r],"name",{value:"".concat(r,"-to-cache"),configurable:!1})}function Q5(t){var r=t.useProgram.bind(t);t.useProgram=function(n){t.state.program!==n&&(r(n),t.state.program=n)}}var eH=function(){function t(r){A(this,t);var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.copyState,i=n===void 0?!1:n,a=e.log,o=a===void 0?function(){}:a;this.gl=r,this.program=null,this.stateStack=[],this.enable=!0,this.cache=i?Un(r):Object.assign({},vf),this.log=o,this._updateCache=this._updateCache.bind(this),Object.seal(this)}return T(t,[{key:"push",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.stateStack.push({})}},{key:"pop",value:function(){Mt(this.stateStack.length>0);var e=this.stateStack[this.stateStack.length-1];It(this.gl,e),this.stateStack.pop()}},{key:"_updateCache",value:function(e){var n=!1,i,a=this.stateStack.length>0&&this.stateStack[this.stateStack.length-1];for(var o in e){Mt(o!==void 0);var s=e[o],u=this.cache[o];FP(s,u)||(n=!0,i=u,a&&!(o in a)&&(a[o]=u),this.cache[o]=s)}return{valueChanged:n,oldValue:i}}}]),t}();function Lp(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=r.enable,n=e===void 0?!0:e,i=r.copyState;if(Mt(i!==void 0),!t.state){var a=globalThis.polyfillContext;a&&a(t),t.state=new eH(t,{copyState:i}),Q5(t);for(var o in S0){var s=S0[o];J5(t,o,s)}DP(t,"getParameter"),DP(t,"isEnabled")}return t.state.enable=n,t}function P0(t){t.state||Lp(t,{copyState:!1}),t.state.push()}function kp(t){Mt(t.state),t.state.pop()}function tH(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=rH(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
30In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function rH(t,r){if(t){if(typeof t=="string")return NP(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return NP(t,r)}}function NP(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function It(t,r){if(Mt(vi(t),"setParameters requires a WebGL context"),!w0(r)){var e={};for(var n in r){var i=Number(n),a=kP[n];a&&(typeof a=="string"?e[a]=!0:a(t,r[n],i))}var o=t.state&&t.state.cache;if(o)for(var s in e){var u=BP[s];u(t,r,o)}}}function Un(t,r){if(r=r||vf,typeof r=="number"){var e=r,n=T0[e];return n?n(t,e):t.getParameter(e)}var i=Array.isArray(r)?r:Object.keys(r),a={},o=tH(i),s;try{for(o.s();!(s=o.n()).done;){var u=s.value,l=T0[u];a[u]=l?l(t,Number(u)):t.getParameter(Number(u))}}catch(f){o.e(f)}finally{o.f()}return a}function Bp(t){It(t,vf)}function ke(t,r,e){if(w0(r))return e(t);var n=r.nocatch,i=n===void 0?!0:n;P0(t),It(t,r);var a;if(i)a=e(t),kp(t);else try{a=e(t)}finally{kp(t)}return a}function Jt(t){var r=t.luma;if(t.canvas&&r){var e=r.canvasSizeInfo,n="clientWidth"in e?e.clientWidth:t.canvas.clientWidth;return n?t.drawingBufferWidth/n:1}return 1}function Ls(t,r){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,n=Jt(t),i=t.drawingBufferWidth,a=t.drawingBufferHeight;return nH(r,n,i,a,e)}function GP(t){var r=typeof window>"u"?1:window.devicePixelRatio||1;return Number.isFinite(t)?t<=0?1:t:t?r:1}function nH(t,r,e,n,i){var a=jP(t[0],r,e),o=UP(t[1],r,n,i),s=jP(t[0]+1,r,e),u=s===e-1?s:s-1;s=UP(t[1]+1,r,n,i);var l;return i?(s=s===0?s:s+1,l=o,o=s):l=s===n-1?s:s-1,{x:a,y:o,width:Math.max(u-a+1,1),height:Math.max(l-o+1,1)}}function jP(t,r,e){var n=Math.min(Math.round(t*r),e-1);return n}function UP(t,r,e,n){return n?Math.max(0,e-1-Math.round(t*r)):Math.min(Math.round(t*r),e-1)}var O0=jt(),iH=O0&&typeof document<"u",zP={webgl2:!0,webgl1:!0,throwOnError:!0,manageState:!0,canvas:null,debug:!1,width:800,height:600};function ks(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Mt(O0,`createGLContext only available in the browser.
31Create your own headless context or use 'createHeadlessContext' from @luma.gl/test-utils`),t=Object.assign({},zP,t);var r=t,e=r.width,n=r.height;function i(l){if(t.throwOnError)throw new Error(l);return console.error(l),null}t.onError=i;var a,o=t,s=o.canvas,u=oH({canvas:s,width:e,height:n,onError:i});return a=aH(u,t),a?(a=gi(a,t),sH(a),a):null}function gi(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!t||t._instrumented)return t;t._version=t._version||uH(t),t.luma=t.luma||{},t.luma.canvasSizeInfo=t.luma.canvasSizeInfo||{},r=Object.assign({},zP,r);var e=r,n=e.manageState,i=e.debug;return n&&Lp(t,{copyState:!1,log:function(){for(var o=arguments.length,s=new Array(o),u=0;u<o;u++)s[u]=arguments[u];return fe.log.apply(fe,[1].concat(s))()}}),O0&&i&&(globalThis.makeDebugContext?(t=globalThis.makeDebugContext(t,r),fe.level=Math.max(fe.level,1)):fe.warn('WebGL debug mode not activated. import "@luma.gl/debug" to enable.')()),t._instrumented=!0,t}function VP(t){var r=t.getParameter(7936),e=t.getParameter(7937),n=t.getExtension("WEBGL_debug_renderer_info"),i=n&&t.getParameter(n.UNMASKED_VENDOR_WEBGL||7936),a=n&&t.getParameter(n.UNMASKED_RENDERER_WEBGL||7937);return{vendor:i||r,renderer:a||e,vendorMasked:r,rendererMasked:e,version:t.getParameter(7938),shadingLanguageVersion:t.getParameter(35724)}}function E0(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t.canvas){var e=GP(r.useDevicePixels);lH(t,e,r);return}var n=t.getExtension("STACKGL_resize_drawingbuffer");n&&"width"in r&&"height"in r&&n.resize(r.width,r.height)}function aH(t,r){var e=r.onError,n=null,i=function(p){return n=p.statusMessage||n};t.addEventListener("webglcontextcreationerror",i,!1);var a=r.webgl1,o=a===void 0?!0:a,s=r.webgl2,u=s===void 0?!0:s,l=null;return u&&(l=l||t.getContext("webgl2",r),l=l||t.getContext("experimental-webgl2",r)),o&&(l=l||t.getContext("webgl",r),l=l||t.getContext("experimental-webgl",r)),t.removeEventListener("webglcontextcreationerror",i,!1),l?(r.onContextLost&&t.addEventListener("webglcontextlost",r.onContextLost,!1),r.onContextRestored&&t.addEventListener("webglcontextrestored",r.onContextRestored,!1),l):e("Failed to create ".concat(u&&!o?"WebGL2":"WebGL"," context: ").concat(n||"Unknown error"))}function oH(t){var r=t.canvas,e=t.width,n=e===void 0?800:e,i=t.height,a=i===void 0?600:i,o=t.onError,s;if(typeof r=="string"){var u=iH&&document.readyState==="complete";
31u||o("createGLContext called on canvas '".concat(r,"' before page was loaded")),s=document.getElementById(r)}else r?s=r:(s=document.createElement("canvas"),s.id="lumagl-canvas",s.style.width=Number.isFinite(n)?"".concat(n,"px"):"100%",s.style.height=Number.isFinite(a)?"".concat(a,"px"):"100%",document.body.insertBefore(s,document.body.firstChild));return s}function sH(t){var r=ge(t)?"WebGL2":"WebGL1",e=VP(t),n=e?"(".concat(e.vendor,",").concat(e.renderer,")"):"",i=t.debug?" debug":"";fe.info(1,"".concat(r).concat(i," context ").concat(n))()}function uH(t){return typeof WebGL2RenderingContext<"u"&&t instanceof WebGL2RenderingContext?2:1}function lH(t,r,e){var n="width"in e?e.width:t.canvas.clientWidth,i="height"in e?e.height:t.canvas.clientHeight;(!n||!i)&&(fe.log(1,"Canvas clientWidth/clientHeight is 0")(),r=1,n=t.canvas.width||1,i=t.canvas.height||1),t.luma=t.luma||{},t.luma.canvasSizeInfo=t.luma.canvasSizeInfo||{};var a=t.luma.canvasSizeInfo;if(a.clientWidth!==n||a.clientHeight!==i||a.devicePixelRatio!==r){var o=r,s=Math.floor(n*o),u=Math.floor(i*o);t.canvas.width=s,t.canvas.height=u,(t.drawingBufferWidth!==s||t.drawingBufferHeight!==u)&&(fe.warn("Device pixel ratio clamped")(),o=Math.min(t.drawingBufferWidth/n,t.drawingBufferHeight/i),t.canvas.width=Math.floor(n*o),t.canvas.height=Math.floor(i*o)),Object.assign(t.luma.canvasSizeInfo,{clientWidth:n,clientHeight:i,devicePixelRatio:r})}}F();j();F();j();k();F();j();k();function mf(){var t;if(typeof window<"u"&&window.performance)t=window.performance.now();else if(typeof process<"u"&&process.hrtime){var r=process.hrtime();t=r[0]*1e3+r[1]/1e6}else t=Date.now();return t}var Fp=function(){function t(r,e){A(this,t),c(this,"name",void 0),c(this,"type",void 0),c(this,"sampleSize",1),c(this,"time",void 0),c(this,"count",void 0),c(this,"samples",void 0),c(this,"lastTiming",void 0),c(this,"lastSampleTime",void 0),c(this,"lastSampleCount",void 0),c(this,"_count",0),c(this,"_time",0),c(this,"_samples",0),c(this,"_startTime",0),c(this,"_timerPending",!1),this.name=r,this.type=e,this.reset()}return T(t,[{key:"setSampleSize",value:function(e){return this.sampleSize=e,this}},{key:"incrementCount",value:function(){return this.addCount(1),this}},{key:"decrementCount",value:function(){return this.subtractCount(1),this}},{key:"addCount",value:function(e){return this._count+=e,this._samples++,this._checkSampling(),this}},{key:"subtractCount",value:function(e){return this._count-=e,this._samples++,this._checkSampling(),this}},{key:"addTime",value:function(e){return this._time+=e,this.lastTiming=e,this._samples++,this._checkSampling(),this}},{key:"timeStart",value:function(){return this._startTime=mf(),this._timerPending=!0,this}},{key:"timeEnd",value:function(){return this._timerPending?(this.addTime(mf()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}},{key:"getSampleAverageCount",value:function(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}},{key:"getSampleAverageTime",value:function(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}},{key:"getSampleHz",value:function(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}},{key:"getAverageCount",value:function(){return this.samples>0?this.count/this.samples:0}},{key:"getAverageTime",value:function(){return this.samples>0?this.time/this.samples:0}},{key:"getHz",value:function(){return this.time>0?this.samples/(this.time/1e3):0}},{key:"reset",value:function(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}},{key:"_checkSampling",value:function(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}}]),t}();var po=function(){function t(r){A(this,t),c(this,"id",void 0),c(this,"stats",{}),this.id=r.id,this.stats={},this._initializeStats(r.stats),Object.seal(this)}return T(t,[{key:"get",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"count";return this._getOrCreate({name:e,type:n})}},{key:"size",get:function(){return Object.keys(this.stats).length}},{key:"reset",value:function(){for(var e in this.stats)this.stats[e].reset();return this}}
31,{key:"forEach",value:function(e){for(var n in this.stats)e(this.stats[n])}},{key:"getTable",value:function(){var e={};return this.forEach(function(n){e[n.name]={time:n.time||0,count:n.count||0,average:n.getAverageTime()||0,hz:n.getHz()||0}}),e}},{key:"_initializeStats",value:function(){var e=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];n.forEach(function(i){return e._getOrCreate(i)})}},{key:"_getOrCreate",value:function(e){if(!e||!e.name)return null;var n=e.name,i=e.type;return this.stats[n]||(e instanceof Fp?this.stats[n]=e:this.stats[n]=new Fp(n,i)),this.stats[n]}}]),t}();var gf="8.5.21",fH="set luma.log.level=1 (or higher) to trace rendering",cH=function(){function t(){A(this,t),this.stats=new Map}return T(t,[{key:"get",value:function(e){return this.stats.has(e)||this.stats.set(e,new po({id:e})),this.stats.get(e)}}]),t}(),$r=new cH;if(globalThis.luma&&globalThis.luma.VERSION!==gf)throw new Error("luma.gl - multiple VERSIONs detected: ".concat(globalThis.luma.VERSION," vs ").concat(gf));globalThis.luma||(jt()&&fe.log(1,"luma.gl ".concat(gf," - ").concat(fH))(),globalThis.luma=globalThis.luma||{VERSION:gf,version:gf,log:fe,stats:$r,globals:{modules:{},nodeIO:{}}});var Uxe=globalThis.luma;function C0(t){return typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame(t):setTimeout(t,1e3/60)}function M0(t){return typeof window<"u"&&window.cancelAnimationFrame?window.cancelAnimationFrame(t):clearTimeout(t)}k();F();j();be();F();j();F();j();function re(t,r){if(!t)throw new Error(r||"luma.gl: assertion failed.")}function Dp(t,r){if(typeof r!="string")return r;var e=Number(r);if(!isNaN(e))return e;r=r.replace(/^.*\./,"");var n=t[r];return re(n!==void 0,"Accessing undefined constant GL.".concat(r)),n}function Xr(t,r){r=Number(r);for(var e in t)if(t[e]===r)return"GL.".concat(e);return String(r)}var I0={};function $e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"id";I0[t]=I0[t]||1;var r=I0[t]++;return"".concat(t,"-").concat(r)}function R0(t){return re(typeof t=="number","Input must be a number"),t&&(t&t-1)===0}function Gn(t){var r=!0;for(var e in t){r=!1;break}return r}function Np(t,r,e,n){var i="See luma.gl ".concat(e," Upgrade Guide at https://luma.gl/docs/upgrade-guide"),a=Object.getPrototypeOf(t);n.forEach(function(o){a.methodName||(a[o]=function(){throw fe.removed("Calling removed method ".concat(r,".").concat(o,": "),i)(),new Error(o)})})}function pH(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=hH(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
32In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function hH(t,r){if(t){if(typeof t=="string")return HP(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return HP(t,r)}}function HP(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var Bs="Resource subclass must define virtual methods",Xt=function(t){function r(e){A(this,r);var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};mi(e);var i=n.id,a=n.userData,o=a===void 0?{}:a;this.gl=e,this.gl2=e,this.id=i||$e(this[Symbol.toStringTag]),this.userData=o,this._bound=!1,this._handle=n.handle,this._handle===void 0&&(this._handle=this._createHandle()),this.byteLength=0,this._addStats()}return T(r,[{key:t,get:function(){return"Resource"}},{key:"toString",value:function(){return"".concat(this[Symbol.toStringTag]||this.constructor.name,"(").concat(this.id,")")}},{key:"handle",get:function(){return this._handle}},{key:"delete",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.deleteChildren,a=i===void 0?!1:i,o=this._handle&&this._deleteHandle(this._handle);return this._handle&&this._removeStats(),this._handle=null,o&&a&&o.filter(
32Boolean).forEach(function(s){return s.delete()}),this}},{key:"bind",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.handle;if(typeof n!="function")return this._bindHandle(n),this;var i;return this._bound?i=n():(this._bindHandle(this.handle),this._bound=!0,i=n(),this._bound=!1,this._bindHandle(null)),i}},{key:"unbind",value:function(){this.bind(null)}},{key:"getParameter",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};n=Dp(this.gl,n),re(n);var a=this.constructor.PARAMETERS||{},o=a[n];if(o){var s=ge(this.gl),u=(!("webgl2"in o)||s)&&(!("extension"in o)||this.gl.getExtension(o.extension));if(!u){var l=o.webgl1,f="webgl2"in o?o.webgl2:o.webgl1,p=s?f:l;return p}}return this._getParameter(n,i)}},{key:"getParameters",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.parameters,a=n.keys,o=this.constructor.PARAMETERS||{},s=ge(this.gl),u={},l=i||Object.keys(o),f=pH(l),p;try{for(f.s();!(p=f.n()).done;){var h=p.value,d=o[h],v=d&&(!("webgl2"in d)||s)&&(!("extension"in d)||this.gl.getExtension(d.extension));if(v){var m=a?Xr(this.gl,h):h;u[m]=this.getParameter(h,n),a&&d.type==="GLenum"&&(u[m]=Xr(this.gl,u[m]))}}}catch(g){f.e(g)}finally{f.f()}return u}},{key:"setParameter",value:function(n,i){n=Dp(this.gl,n),re(n);var a=this.constructor.PARAMETERS||{},o=a[n];if(o){var s=ge(this.gl),u=(!("webgl2"in o)||s)&&(!("extension"in o)||this.gl.getExtension(o.extension));if(!u)throw new Error("Parameter not available on this platform");o.type==="GLenum"&&(i=Dp(i))}return this._setParameter(n,i),this}},{key:"setParameters",value:function(n){for(var i in n)this.setParameter(i,n[i]);return this}},{key:"stubRemovedMethods",value:function(n,i,a){return Np(this,n,i,a)}},{key:"initialize",value:function(n){}},{key:"_createHandle",value:function(){throw new Error(Bs)}},{key:"_deleteHandle",value:function(){throw new Error(Bs)}},{key:"_bindHandle",value:function(n){throw new Error(Bs)}},{key:"_getOptsFromHandle",value:function(){throw new Error(Bs)}},{key:"_getParameter",value:function(n,i){throw new Error(Bs)}},{key:"_setParameter",value:function(n,i){throw new Error(Bs)}},{key:"_context",value:function(){return this.gl.luma=this.gl.luma||{},this.gl.luma}},{key:"_addStats",value:function(){var n=this[Symbol.toStringTag],i=$r.get("Resource Counts");i.get("Resources Created").incrementCount(),i.get("".concat(n,"s Created")).incrementCount(),i.get("".concat(n,"s Active")).incrementCount()}},{key:"_removeStats",value:function(){var n=this[Symbol.toStringTag],i=$r.get("Resource Counts");i.get("".concat(n,"s Active")).decrementCount()}},{key:"_trackAllocatedMemory",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this[Symbol.toStringTag];this._trackAllocatedMemoryForContext(n,i),this._trackAllocatedMemoryForContext(n,i,this.gl.canvas&&this.gl.canvas.id),this.byteLength=n}},{key:"_trackAllocatedMemoryForContext",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this[Symbol.toStringTag],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"",o=$r.get("Memory Usage".concat(a));o.get("GPU Memory").addCount(n),o.get("".concat(i," Memory")).addCount(n)}},{key:"_trackDeallocatedMemory",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this[Symbol.toStringTag];this._trackDeallocatedMemoryForContext(n),this._trackDeallocatedMemoryForContext(n,this.gl.canvas&&this.gl.canvas.id),this.byteLength=0}},{key:"_trackDeallocatedMemoryForContext",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this[Symbol.toStringTag],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",a=$r.get("Memory Usage".concat(i));a.get("GPU Memory").subtractCount(this.byteLength),a.get("".concat(n," Memory")).subtractCount(this.byteLength)}}]),r}(Symbol.toStringTag);F();j();function L0(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Fs(t,r,e){return L0()?Fs=Reflect.construct:Fs=function(i,a,o){var s=[null];s.push.apply(s,a);var u=Function.bind.apply(i,s),l=new u;return o&&Ka(l,o.prototype),l},Fs.apply(null,arguments)}F();j();var dH="Failed to deduce GL constant from typed array";function yf(t){var r=ArrayBuffer.isView(t)?t.constructor:t;switch(r){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:return 5121;case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error(dH)}}function oa(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=r.clamped,n=e===void 0?!0:e;switch(t){case 5126:return Float32Array;case 5123:case 33635:case 32819:case 32820:return Uint16Array;case 5125:return Uint32Array;case 5121:return n?Uint8ClampedArray:Uint8Array;case 5120:return Int8Array;case 5122:return Int16Array;case 5124:return Int32Array;
32default:throw new Error("Failed to deduce typed array type from GL constant")}}function WP(t){var r=t.data,e=t.width,n=t.height,i=t.bytesPerPixel,a=i===void 0?4:i,o=t.temp,s=e*a;o=o||new Uint8Array(s);for(var u=0;u<n/2;++u){var l=u*s,f=(n-u-1)*s;o.set(r.subarray(l,l+s)),r.copyWithin(l,f,f+s),r.set(o,f)}}function $P(t){for(var r=t.data,e=t.width,n=t.height,i=Math.round(e/2),a=Math.round(n/2),o=new Uint8Array(i*a*4),s=0;s<a;s++)for(var u=0;u<i;u++)for(var l=0;l<4;l++)o[(s*i+u)*4+l]=r[(s*2*e+u*2)*4+l];return{data:o,width:i,height:a}}function _f(t,r,e){var n=e.removedProps,i=n===void 0?{}:n,a=e.deprecatedProps,o=a===void 0?{}:a,s=e.replacedProps,u=s===void 0?{}:s;for(var l in i)if(l in r){var f=i[l],p=f?"".concat(t,".").concat(i[l]):"N/A";fe.removed("".concat(t,".").concat(l),p)()}for(var h in o)if(h in r){var d=o[h];fe.deprecated("".concat(t,".").concat(h),"".concat(t,".").concat(d))()}var v=null;for(var m in u)if(m in r){var g=u[m];fe.deprecated("".concat(t,".").concat(m),"".concat(t,".").concat(g))(),v=v||Object.assign({},r),v[g]=r[m],delete v[m]}return v||r}var vH={offset:0,stride:0,type:5126,size:1,divisor:0,normalized:!1,integer:!1},mH={deprecatedProps:{instanced:"divisor",isInstanced:"divisor"}},pr=function(){function t(){var r=this;A(this,t);for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];n.forEach(function(a){return r._assign(a)}),Object.freeze(this)}return T(t,[{key:"toString",value:function(){return JSON.stringify(this)}},{key:"BYTES_PER_ELEMENT",get:function(){return t.getBytesPerElement(this)}},{key:"BYTES_PER_VERTEX",get:function(){return t.getBytesPerVertex(this)}},{key:"_assign",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return e=_f("Accessor",e,mH),e.type!==void 0&&(this.type=e.type,(e.type===5124||e.type===5125)&&(this.integer=!0)),e.size!==void 0&&(this.size=e.size),e.offset!==void 0&&(this.offset=e.offset),e.stride!==void 0&&(this.stride=e.stride),e.normalized!==void 0&&(this.normalized=e.normalized),e.integer!==void 0&&(this.integer=e.integer),e.divisor!==void 0&&(this.divisor=e.divisor),e.buffer!==void 0&&(this.buffer=e.buffer),e.index!==void 0&&(typeof e.index=="boolean"?this.index=e.index?1:0:this.index=e.index),e.instanced!==void 0&&(this.divisor=e.instanced?1:0),e.isInstanced!==void 0&&(this.divisor=e.isInstanced?1:0),this}}],[{key:"getBytesPerElement",value:function(e){var n=oa(e.type||5126);return n.BYTES_PER_ELEMENT}},{key:"getBytesPerVertex",value:function(e){re(e.size);var n=oa(e.type||5126);return n.BYTES_PER_ELEMENT*e.size}},{key:"resolve",value:function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return Fs(t,[vH].concat(n))}}]),t}();function gH(t){var r=yH();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function yH(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var XP=10,qP={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"},_H={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:qP},bH={removedProps:qP},Pe=function(t,r){L(n,t);var e=gH(n);function n(i){var a;A(this,n);var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return a=e.call(this,i,o),a.stubRemovedMethods("Buffer","v6.0",["layout","setLayout","getIndexedParameter"]),a.target=o.target||(a.gl.webgl2?36662:34962),a.initialize(o),Object.seal(q(a)),a}return T(n,[{key:r,get:function(){return"Buffer"}},{key:"getElementCount",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.accessor;return Math.round(this.byteLength/pr.getBytesPerElement(a))}},{key:"getVertexCount",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.accessor;return Math.round(this.byteLength/pr.getBytesPerVertex(a))}},{key:"initialize",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return ArrayBuffer.isView(a)&&(a={data:a}),Number.isFinite(a)&&(a={byteLength:a}),a=_f("Buffer",a,_H),this.usage=a.usage||35044,this.debugData=null,this.setAccessor(Object.assign({},a,a.accessor)),a.data?this._setData(a.data,a.offset,a.byteLength):this._setByteLength(a.byteLength||0),this}},{key:"setProps",value:function(a){return a=_f("Buffer",a,bH),"accessor"in a&&this.setAccessor(a.accessor),this}},{key:"setAccessor",value:function(a){return a=Object.assign({},a),delete a.buffer,this.accessor=new pr(a),this}},{key:"reallocate",value:function(a){return a>this.byteLength?(this._setByteLength(a),!0):(this.bytesUsed=a,!1)}},{key:"setData",value:function(a){return this.initialize(a)}},{key:"subData",value:function(a){ArrayBuffer.isView(a)&&(a={data:a});var o=a,s=o.data,u=o.offset,l=u===void 0?0:u,f=o.srcOffset,p=f===void 0?0:f,h=a.byteLength||a.length;re(s);var d=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(d,this.handle),p!==0||h!==void 0?(ct(this.gl),this.gl.bufferSubData(this.target,l,s,p,h)):this.gl.bufferSubData(d,l,s),this.gl.bindBuffer(d,null),this.debugData=null,this._inferType(s),this}},{key:"copyData",value:function(a){var o=a.sourceBuffer,s=a.readOffset,u=s===void 0?0:s,l=a.writeOffset,f=l===void 0?0:l,p=a.size,h=this.gl;return ct(h),h.bindBuffer(36662,o.handle),h.bindBuffer(36663,this.handle),h.copyBufferSubData(36662,36663,u,f,p),h.bindBuffer(36662,null),h.bindBuffer(36663,null),this.debugData=null,this}},{key:"getData",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=a.dstData,s=o===void 0?null:o,u=a.srcByteOffset,l=u===void 0?0:u,f=a.dstOffset,p=f===void 0?0:f,h=a.length,d=h===void 0?0:h;ct(this.gl);var v=oa(this.accessor.type||5126,{clamped:!1}),m=this._getAvailableElementCount(l),g=p,y,_;s?(_=s.length,y=_-g):(y=Math.min(m,d||m),_=g+y);var b=Math.min(m,y);return d=d||b,re(d<=b),s=s||new v(_),this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,l,s,p,d),this.gl.bindBuffer(36662,null),s}},{key:"bind",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=a.target,s=o===void 0?this.target:o,u=a.index,l=u===void 0?this.accessor&&this.accessor.index:u,f=a.offset,p=f===void 0?0:f,h=a.size;return s===35345||s===35982?h!==void 0?this.gl.bindBufferRange(s,l,this.handle,p,h):(re(p===0),this.gl.bindBufferBase(s,l,this.handle)):this.gl.bindBuffer(s,this.handle),this}},{key:"unbind",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=a.target,s=o===void 0?this.target:o,u=a.index,l=u===void 0?this.accessor&&this.accessor.index:u,f=s===35345||s===35982;return f?this.gl.bindBufferBase(s,l,null):this.gl.bindBuffer(s,null),this}},{key:"getDebugData",value:function(){return this.debugData?{data:this.debugData,changed:!1}:(this.debugData=this.getData({length:Math.min(XP,this.byteLength)}),{data:this.debugData,changed:!0})}},{key:"invalidateDebugData",value:function(){this.debugData=null}},{key:"_setData",value:function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:a.byteLength+o;re(ArrayBuffer.isView(a)),this._trackDeallocatedMemory();var u=this._getTarget();this.gl.bindBuffer(u,this.handle),this.gl.bufferData(u,s,this.usage),this.gl.bufferSubData(u,o,a),this.gl.bindBuffer(u,null),this.debugData=a.slice(0,XP),this.bytesUsed=s,this._trackAllocatedMemory(s);var l=yf(a);return re(l),this.setAccessor(new pr(this.accessor,{type:l})),this}},{key:"_setByteLength",value:function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.usage;re(a>=0),this._trackDeallocatedMemory();var s=a;a===0&&(s=new Float32Array(0));var u=this._getTarget();return this.gl.bindBuffer(u,this.handle),this.gl.bufferData(u,s,o),this.gl.bindBuffer(u,null),this.usage=o,this.debugData=null,this.bytesUsed=a,this._trackAllocatedMemory(a),this}},{key:"_getTarget",value:function(){return this.gl.webgl2?36663:this.target}},{key:"_getAvailableElementCount",value:function(a){var o=oa(this.accessor.type||5126,{clamped:!1}),s=a/o.BYTES_PER_ELEMENT;return this.getElementCount()-s}},{key:"_inferType",value:function(a){this.accessor.type||this.setAccessor(new pr(this.accessor,{type:yf(
32a)}))}},{key:"_createHandle",value:function(){return this.gl.createBuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteBuffer(this.handle),this._trackDeallocatedMemory()}},{key:"_getParameter",value:function(a){this.gl.bindBuffer(this.target,this.handle);var o=this.gl.getBufferParameter(this.target,a);return this.gl.bindBuffer(this.target,null),o}},{key:"type",get:function(){return fe.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}},{key:"bytes",get:function(){return fe.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}},{key:"setByteLength",value:function(a){return fe.deprecated("setByteLength","reallocate")(),this.reallocate(a)}},{key:"updateAccessor",value:function(a){return fe.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new pr(this.accessor,a),this}}]),n}(Xt,Symbol.toStringTag);k();var mn,hr,zn,jp=(mn={},c(mn,6407,{dataFormat:6407,types:[5121,33635]}),c(mn,6408,{dataFormat:6408,types:[5121,32819,32820]}),c(mn,6406,{dataFormat:6406,types:[5121]}),c(mn,6409,{dataFormat:6409,types:[5121]}),c(mn,6410,{dataFormat:6410,types:[5121]}),c(mn,33326,{dataFormat:6403,types:[5126],gl2:!0}),c(mn,33328,{dataFormat:33319,types:[5126],gl2:!0}),c(mn,34837,{dataFormat:6407,types:[5126],gl2:!0}),c(mn,34836,{dataFormat:6408,types:[5126],gl2:!0}),mn),Up=(hr={},c(hr,6403,1),c(hr,36244,1),c(hr,33319,2),c(hr,33320,2),c(hr,6407,3),c(hr,36248,3),c(hr,6408,4),c(hr,36249,4),c(hr,6402,1),c(hr,34041,1),c(hr,6406,1),c(hr,6409,1),c(hr,6410,2),hr),Gp=(zn={},c(zn,5126,4),c(zn,5125,4),c(zn,5124,4),c(zn,5123,2),c(zn,5122,2),c(zn,5131,2),c(zn,5120,1),c(zn,5121,1),zn);function YP(t,r){var e=jp[r];if(!e)return!1;if(e.gl1===void 0&&e.gl2===void 0)return!0;var n=ge(t)&&e.gl2||e.gl1;return typeof n=="string"?t.getExtension(n):n}function KP(t,r){var e=jp[r];switch(e&&e.types[0]){case 5126:return t.getExtension("OES_texture_float_linear");case 5131:return t.getExtension("OES_texture_half_float_linear");default:return!0}}function xH(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=AH(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
33In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function AH(t,r){if(t){if(typeof t=="string")return ZP(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return ZP(t,r)}}function ZP(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function SH(t){var r=TH();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function TH(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var wH=[9729,9728],JP=globalThis.WebGLBuffer||function(){},Br=function(t,r){L(n,t);var e=SH(n);function n(i,a){var o;A(this,n);var s=a.id,u=s===void 0?$e("texture"):s,l=a.handle,f=a.target;return o=e.call(this,i,{id:u,handle:l}),o.target=f,o.textureUnit=void 0,o.loaded=!1,o.width=void 0,o.height=void 0,o.depth=void 0,o.format=void 0,o.type=void 0,o.dataFormat=void 0,o.border=void 0,o.textureUnit=void 0,o.mipmaps=void 0,o}return T(n,[{key:r,get:function(){return"Texture"}},{key:"toString",value:function(){return"Texture(".concat(this.id,",").concat(this.width,"x").concat(this.height,")")}},{key:"initialize",value:function(){var a=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=o.data;if(s instanceof Promise)return s.then(function(X){return a.initialize(Object.assign({},o,{pixels:X,data:X}))}),this;var u=typeof HTMLVideoElement<"u"&&s instanceof HTMLVideoElement;if(u&&s.readyState<HTMLVideoElement.HAVE_METADATA)return this._video=null,s.addEventListener("loadeddata",function(){return a.initialize(o)}),this;var l=o.pixels,f=l===void 0?null:l,p=o.format,h=p===void 0?6408:p,d=o.border,v=d===void 0?0:d,m=o.recreate,g=m===void 0?!1:m,y=o.parameters,_=y===void 0?{}:y,b=o.pixelStore,x=b===void 0?{}:b,w=o.textureUnit,P=w===void 0?void 0:w;s||(s=f);var E=o.width,C=o.height,I=o.dataFormat,O=o.type,D=o.compressed,N=D===void 0?!1:D,H=o.mipmaps,$=H===void 0?!0:H,ee=o.depth,V=ee===void 0?0:ee,U=this._deduceParameters({format:h,type:O,dataFormat:I,compressed:N,data:s,width:E,height:C});return E=U.width,C=U.height,N=U.compressed,I=U.dataFormat,O=U.type,this.width=E,this.height=C,this.depth=V,this.format=h,this.type=O,this.dataFormat=I,this.border=v,this.textureUnit=P,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle)),$&&this._isNPOT()&&(fe.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),$=!1,this._updateForNPOT(_)),this.mipmaps=$,this.setImageData({data:s,width:E,height:C,depth:V,format:h,type:O,dataFormat:I,border:v,mipmaps:$,parameters:x,compressed:N}),$&&this.generateMipmap(),this.setParameters(_),g&&(this.data=s),u&&(this._video={video:s,parameters:_,lastTime:s.readyState>=HTMLVideoElement.HAVE_CURRENT_DATA?s.currentTime:-1}),this}},{key:"update",value:function(){if(this._video){var a=this._video,o=a.video,s=a.parameters,u=a.lastTime;if(u===o.currentTime||o.readyState<HTMLVideoElement.HAVE_CURRENT_DATA)return;this.setSubImageData({data:o,parameters:s}),this.mipmaps&&this.generateMipmap(),this._video.lastTime=o.currentTime}}},{key:"resize",value:function(a){var o=a.height,s=a.width,u=a.mipmaps,l=u===void 0?!1:u;return s!==this.width||o!==this.height?this.initialize({width:s,height:o,format:this.format,type:this.t
33ype,dataFormat:this.dataFormat,border:this.border,mipmaps:l}):this}},{key:"generateMipmap",value:function(){var a=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this._isNPOT()?(fe.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),this):(this.mipmaps=!0,this.gl.bindTexture(this.target,this.handle),ke(this.gl,o,function(){a.gl.generateMipmap(a.target)}),this.gl.bindTexture(this.target,null),this)}},{key:"setImageData",value:function(a){this._trackDeallocatedMemory("Texture");var o=a.target,s=o===void 0?this.target:o,u=a.pixels,l=u===void 0?null:u,f=a.level,p=f===void 0?0:f,h=a.format,d=h===void 0?this.format:h,v=a.border,m=v===void 0?this.border:v,g=a.offset,y=g===void 0?0:g,_=a.parameters,b=_===void 0?{}:_,x=a.data,w=x===void 0?null:x,P=a.type,E=P===void 0?this.type:P,C=a.width,I=C===void 0?this.width:C,O=a.height,D=O===void 0?this.height:O,N=a.dataFormat,H=N===void 0?this.dataFormat:N,$=a.compressed,ee=$===void 0?!1:$;w||(w=l);var V=this._deduceParameters({format:d,type:E,dataFormat:H,compressed:ee,data:w,width:I,height:D});E=V.type,H=V.dataFormat,ee=V.compressed,I=V.width,D=V.height;var U=this.gl;U.bindTexture(this.target,this.handle);var X=null,K=this._getDataType({data:w,compressed:ee});w=K.data,X=K.dataType;var te,ie=0;if(ke(this.gl,b,function(){switch(X){case"null":U.texImage2D(s,p,d,I,D,m,H,E,w);break;case"typed-array":U.texImage2D(s,p,d,I,D,m,H,E,w,y);break;case"buffer":te=ct(U),te.bindBuffer(35052,w.handle||w),te.texImage2D(s,p,d,I,D,m,H,E,y),te.bindBuffer(35052,null);break;case"browser-object":ge(U)?U.texImage2D(s,p,d,I,D,m,H,E,w):U.texImage2D(s,p,d,H,E,w);break;case"compressed":var Me=xH(w.entries()),Fe;try{for(Me.s();!(Fe=Me.n()).done;){var we=W(Fe.value,2),Ne=we[0],Oe=we[1];U.compressedTexImage2D(s,Ne,Oe.format,Oe.width,Oe.height,m,Oe.data),ie+=Oe.levelSize}}catch(ft){Me.e(ft)}finally{Me.f()}break;default:re(!1,"Unknown image data type")}}),X==="compressed")this._trackAllocatedMemory(ie,"Texture");else if(w&&w.byteLength)this._trackAllocatedMemory(w.byteLength,"Texture");else{var ce=Up[this.dataFormat]||4,Te=Gp[this.type]||1;this._trackAllocatedMemory(this.width*this.height*ce*Te,"Texture")}return this.loaded=!0,this}},{key:"setSubImageData",value:function(a){var o=this,s=a.target,u=s===void 0?this.target:s,l=a.pixels,f=l===void 0?null:l,p=a.data,h=p===void 0?null:p,d=a.x,v=d===void 0?0:d,m=a.y,g=m===void 0?0:m,y=a.width,_=y===void 0?this.width:y,b=a.height,x=b===void 0?this.height:b,w=a.level,P=w===void 0?0:w,E=a.format,C=E===void 0?this.format:E,I=a.type,O=I===void 0?this.type:I,D=a.dataFormat,N=D===void 0?this.dataFormat:D,H=a.compressed,$=H===void 0?!1:H,ee=a.offset,V=ee===void 0?0:ee,U=a.border,X=U===void 0?this.border:U,K=a.parameters,te=K===void 0?{}:K,ie=this._deduceParameters({format:C,type:O,dataFormat:N,compressed:$,data:h,width:_,height:x});if(O=ie.type,N=ie.dataFormat,$=ie.compressed,_=ie.width,x=ie.height,re(this.depth===0,"texSubImage not supported for 3D textures"),h||(h=f),h&&h.data){var ce=h;h=ce.data,_=ce.shape[0],x=ce.shape[1]}h instanceof Pe&&(h=h.handle),this.gl.bindTexture(this.target,this.handle),ke(this.gl,te,function(){if($)o.gl.compressedTexSubImage2D(u,P,v,g,_,x,C,h);else if(h===null)o.gl.texSubImage2D(u,P,v,g,_,x,N,O,null);else if(ArrayBuffer.isView(h))o.gl.texSubImage2D(u,P,v,g,_,x,N,O,h,V);else if(h instanceof JP){var Te=ct(o.gl);Te.bindBuffer(35052,h),Te.texSubImage2D(u,P,v,g,_,x,N,O,V),Te.bindBuffer(35052,null)}else if(ge(o.gl)){var Me=ct(o.gl);Me.texSubImage2D(u,P,v,g,_,x,N,O,h)}else o.gl.texSubImage2D(u,P,v,g,N,O,h)}),this.gl.bindTexture(this.target,null)}},{key:"copyFramebuffer",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return fe.error("Texture.copyFramebuffer({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}},{key:"getActiveUnit",value:function(){return this.gl.getParameter(34016)-33984}},{key:"bind",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.textureUnit,o=this.gl;return a!==void 0&&(this.textureUnit=a,o.activeTexture(33984+a)),o.bindTexture(this.target,this.handle),a}},{key:"unbind",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.textureUnit,o=this.gl;return a!==void 0&&(this.textureUnit=a,o.activeTexture(33984+a)),o.bindTexture(this.target,null),a}},{key:"_getDataType",value:function(a){var o=a.data,s=a.compressed,u=s===void 0?!1:s;return u?{data:o,dataType:"compressed"}:o===null?{data:o,dataType:"null"}:ArrayBuffer.isView(o)?{data:o,dataType:"typed-array"}:o instanceof Pe?{data:o.handle,dataType:"buffer"}:o instanceof JP?{data:o,dataType:"buffer"}:{data:o,dataType:"browser-object"}}},{key:"_deduceParameters",value:function(a){var o=a.format,s=a.data,u=a.width,l=a.height,f=a.dataFormat,p=a.type,h=a.compressed,d=jp[o];f=f||d&&d.dataFormat,p=p||d&&d.types[0],h=h||d&&d.compressed;var v=this._deduceImageSize(s,u,l);return u=v.width,l=v.height,{dataFormat:f,type:p,compressed:h,width:u,height:l,format:o,data:s}}},{key:"_deduceImageSize",value:function(a,o,s){var u;return typeof ImageData<"u"&&a instanceof ImageData?u={width:a.width,height:a.height}
33:typeof HTMLImageElement<"u"&&a instanceof HTMLImageElement?u={width:a.naturalWidth,height:a.naturalHeight}:typeof HTMLCanvasElement<"u"&&a instanceof HTMLCanvasElement?u={width:a.width,height:a.height}:typeof ImageBitmap<"u"&&a instanceof ImageBitmap?u={width:a.width,height:a.height}:typeof HTMLVideoElement<"u"&&a instanceof HTMLVideoElement?u={width:a.videoWidth,height:a.videoHeight}:a?u={width:o,height:s}:u={width:o>=0?o:1,height:s>=0?s:1},re(u,"Could not deduced texture size"),re(o===void 0||u.width===o,"Deduced texture width does not match supplied width"),re(s===void 0||u.height===s,"Deduced texture height does not match supplied height"),u}},{key:"_createHandle",value:function(){return this.gl.createTexture()}},{key:"_deleteHandle",value:function(){this.gl.deleteTexture(this.handle),this._trackDeallocatedMemory("Texture")}},{key:"_getParameter",value:function(a){switch(a){case 4096:return this.width;case 4097:return this.height;default:this.gl.bindTexture(this.target,this.handle);var o=this.gl.getTexParameter(this.target,a);return this.gl.bindTexture(this.target,null),o}}},{key:"_setParameter",value:function(a,o){switch(this.gl.bindTexture(this.target,this.handle),o=this._getNPOTParam(a,o),a){case 33082:case 33083:this.gl.texParameterf(this.handle,a,o);break;case 4096:case 4097:re(!1);break;default:this.gl.texParameteri(this.target,a,o);break}return this.gl.bindTexture(this.target,null),this}},{key:"_isNPOT",value:function(){return ge(this.gl)||!this.width||!this.height?!1:!R0(this.width)||!R0(this.height)}},{key:"_updateForNPOT",value:function(a){a[this.gl.TEXTURE_MIN_FILTER]===void 0&&(a[this.gl.TEXTURE_MIN_FILTER]=this.gl.LINEAR),a[this.gl.TEXTURE_WRAP_S]===void 0&&(a[this.gl.TEXTURE_WRAP_S]=this.gl.CLAMP_TO_EDGE),a[this.gl.TEXTURE_WRAP_T]===void 0&&(a[this.gl.TEXTURE_WRAP_T]=this.gl.CLAMP_TO_EDGE)}},{key:"_getNPOTParam",value:function(a,o){if(this._isNPOT())switch(a){case 10241:wH.indexOf(o)===-1&&(o=9729);break;case 10242:case 10243:o!==33071&&(o=33071);break;default:break}return o}}],[{key:"isSupported",value:function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=o.format,u=o.linearFiltering,l=!0;return s&&(l=l&&YP(a,s),l=l&&(!u||KP(a,s))),l}}]),n}(Xt,Symbol.toStringTag);var PH="";function QP(t,r){return re(typeof t=="string"),t=PH+t,new Promise(function(e,n){try{var i=new Image;i.onload=function(){return e(i)},i.onerror=function(){return n(new Error("Could not load image ".concat(t,".")))},i.crossOrigin=r&&r.crossOrigin||"anonymous",i.src=t}catch(a){n(a)}})}function OH(t){var r=EH();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function EH(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Ce=function(t,r){L(n,t);var e=OH(n);function n(i){var a;A(this,n);var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return mi(i),(o instanceof Promise||typeof o=="string")&&(o={data:o}),typeof o.data=="string"&&(o=Object.assign({},o,{data:QP(o.data)})),a=e.call(this,i,Object.assign({},o,{target:3553})),a.initialize(o),Object.seal(q(a)),a}return T(n,[{key:r,get:function(){return"Texture2D"}}],[{key:"isSupported",value:function(a,o){return Br.isSupported(a,o)}}]),n}(Br,Symbol.toStringTag);F();j();var k0=me(Ae());function CH(t){var r=MH();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function MH(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var B0=[34069,34070,34071,34072,34073,34074],ho=function(t,r){L(n,t);var e=CH(n);function n(i){var a;A(this,n);var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return mi(i),a=e.call(this,i,Object.assign({},o,{target:34067}
33)),a.initialize(o),Object.seal(q(a)),a}return T(n,[{key:r,get:function(){return"TextureCube"}},{key:"initialize",value:function(){var a=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=o.mipmaps,u=s===void 0?!0:s,l=o.parameters,f=l===void 0?{}:l;return this.opts=o,this.setCubeMapImageData(o).then(function(){a.loaded=!0,u&&a.generateMipmap(o),a.setParameters(f)}),this}},{key:"subImage",value:function(a){var o=a.face,s=a.data,u=a.x,l=u===void 0?0:u,f=a.y,p=f===void 0?0:f,h=a.mipmapLevel,d=h===void 0?0:h;return this._subImage({target:o,data:s,x:l,y:p,mipmapLevel:d})}},{key:"setCubeMapImageData",value:function(){var i=Y(k0.default.mark(function o(s){var u=this,l,f,p,h,d,v,m,g,y,_,b,x,w;return k0.default.wrap(function(E){for(;;)switch(E.prev=E.next){case 0:return l=s.width,f=s.height,p=s.pixels,h=s.data,d=s.border,v=d===void 0?0:d,m=s.format,g=m===void 0?6408:m,y=s.type,_=y===void 0?5121:y,b=this.gl,x=p||h,E.next=5,Promise.all(B0.map(function(C){var I=x[C];return Promise.all(Array.isArray(I)?I:[I])}));case 5:w=E.sent,this.bind(),B0.forEach(function(C,I){w[I].length>1&&u.opts.mipmaps!==!1&&fe.warn("".concat(u.id," has mipmap and multiple LODs."))(),w[I].forEach(function(O,D){l&&f?b.texImage2D(C,D,g,l,f,v,g,_,O):b.texImage2D(C,D,g,g,_,O)})}),this.unbind();case 9:case"end":return E.stop()}},o,this)}));function a(o){return i.apply(this,arguments)}return a}()},{key:"setImageDataForFace",value:function(a){var o=this,s=a.face,u=a.width,l=a.height,f=a.pixels,p=a.data,h=a.border,d=h===void 0?0:h,v=a.format,m=v===void 0?6408:v,g=a.type,y=g===void 0?5121:g,_=this.gl,b=f||p;return this.bind(),b instanceof Promise?b.then(function(x){return o.setImageDataForFace(Object.assign({},a,{face:s,data:x,pixels:x}))}):this.width||this.height?_.texImage2D(s,0,m,u,l,d,m,y,b):_.texImage2D(s,0,m,m,y,b),this}}]),n}(Br,Symbol.toStringTag);ho.FACES=B0;F();j();function IH(t){var r=RH();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function RH(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Ds=function(t,r){L(n,t);var e=IH(n);function n(i){var a;A(this,n);var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return ct(i),o=Object.assign({depth:1},o,{target:32879,unpackFlipY:!1}),a=e.call(this,i,o),a.initialize(o),Object.seal(q(a)),a}return T(n,[{key:r,get:function(){return"Texture3D"}},{key:"setImageData",value:function(a){var o=this,s=a.level,u=s===void 0?0:s,l=a.dataFormat,f=l===void 0?6408:l,p=a.width,h=a.height,d=a.depth,v=d===void 0?1:d,m=a.border,g=m===void 0?0:m,y=a.format,_=a.type,b=_===void 0?5121:_,x=a.offset,w=x===void 0?0:x,P=a.data,E=a.parameters,C=E===void 0?{}:E;if(this._trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle),ke(this.gl,C,function(){ArrayBuffer.isView(P)&&o.gl.texImage3D(o.target,u,f,p,h,v,g,y,b,P),P instanceof Pe&&(o.gl.bindBuffer(35052,P.handle),o.gl.texImage3D(o.target,u,f,p,h,v,g,y,b,w))}),P&&P.byteLength)this._trackAllocatedMemory(P.byteLength,"Texture");else{var I=Up[this.dataFormat]||4,O=Gp[this.type]||1;this._trackAllocatedMemory(this.width*this.height*this.depth*I*O,"Texture")}return this.loaded=!0,this}}],[{key:"isSupported",value:function(a){return ge(a)}}]),n}(Br,Symbol.toStringTag);k();be();F();j();F();j();k();var De,vo="EXT_color_buffer_float",F0=(De={},c(De,33189,{bpp:2}),c(De,33190,{gl2:!0,bpp:3}),c(De,36012,{gl2:!0,bpp:4}),c(De,36168,{bpp:1}),c(De,34041,{bpp:4}),c(De,35056,{gl2:!0,bpp:4}),c(De,36013,{gl2:!0,bpp:5}),c(De,32854,{bpp:2}),c(De,36194,{bpp:2}),c(De,32855,{bpp:2}),c(De,33321,{gl2:!0,bpp:1}),c(De,33330,{gl2:!0,bpp:1}),c(De,33329,{gl2:!0,bpp:1}),c(De,33332,{gl2:!0,bpp:2}),c(De,33331,{gl2:!0,bpp:2}),c(De,33334,{gl2:!0,bpp:4}),c(De,33333,{gl2:!0,bpp:4}),c(De,33323,{gl2:!0,bpp:2}),c(De,33336,{gl2:!0,bpp:2}),c(De,33335,{gl2:!0,bpp:2}),c(De,33338,{gl2:!0,bpp:4}),c(De,33337,{gl2:!0,bpp:4}),c(De,33340,{gl2:!0,bpp:8}),c(De,33339,{gl2:!0,bpp:8}),c(De,32849,{gl2:!0,bpp:3}),c(De,32856,{gl2:!0,bpp:4}),c(De,32857,{gl2:!0,bpp:4}),c(De,36220,{gl2:!0,bpp:4}),c(De,36238,{gl2:!0,bpp:4}),c(De,36975,{gl2:!0,bpp:4}),c(De,36214,{gl2:!0,bpp:8}),c(De,36232,{gl2:!0,bpp:8}),c(De,36226,{gl2:!0,bpp:16}),c(De,36208,{gl2:!0,bpp:16}),c(De,33325,{gl2:vo,bpp:2}),c(De,33327,{gl2:vo,bpp:4}),c(De,34842,{gl2:vo,bpp:8}),c(De,33326,{gl2:vo,bpp:4}),c(De,33328,{gl2:vo,bpp:8}),c(De,34836,{gl2:vo,bpp:16}),c(De,35898,{gl2:vo,bpp:4}),De);function LH(t){var r=kH();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function kH(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function BH(t,r,e){var n=e[r];if(!n)return!1;var i=ge(t)&&n.gl2||n.gl1;return typeof i=="string"?t.getExtension(i):i}var dr=function(t,r){L(n,t);var e=LH(n);function n(i){var a;A(this,n);var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return a=e.call(this,i,o),a.initialize(o),Object.seal(q(a)),a}
33return T(n,[{key:r,get:function(){return"Renderbuffer"}},{key:"initialize",value:function(a){var o=a.format,s=a.width,u=s===void 0?1:s,l=a.height,f=l===void 0?1:l,p=a.samples,h=p===void 0?0:p;return re(o,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),h!==0&&ge(this.gl)?this.gl.renderbufferStorageMultisample(36161,h,o,u,f):this.gl.renderbufferStorage(36161,o,u,f),this.format=o,this.width=u,this.height=f,this.samples=h,this._trackAllocatedMemory(this.width*this.height*(this.samples||1)*F0[this.format].bpp),this}},{key:"resize",value:function(a){var o=a.width,s=a.height;return o!==this.width||s!==this.height?this.initialize({width:o,height:s,format:this.format,samples:this.samples}):this}},{key:"_createHandle",value:function(){return this.gl.createRenderbuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteRenderbuffer(this.handle),this._trackDeallocatedMemory()}},{key:"_bindHandle",value:function(a){this.gl.bindRenderbuffer(36161,a)}},{key:"_syncHandle",value:function(a){this.format=this.getParameter(36164),this.width=this.getParameter(36162),this.height=this.getParameter(36163),this.samples=this.getParameter(36011)}},{key:"_getParameter",value:function(a){this.gl.bindRenderbuffer(36161,this.handle);var o=this.gl.getRenderbufferParameter(36161,a);return o}}],[{key:"isSupported",value:function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{format:null},s=o.format;return!s||BH(a,s,F0)}},{key:"getSamplesForFormat",value:function(a,o){var s=o.format;return a.getInternalformatParameter(36161,s,32937)}}]),n}(Xt,Symbol.toStringTag);be();var FH=256,DH=1024,NH=16384,eO=6144,tO=6145,rO=6146,nO=34041,iO="clear: bad arguments";function qr(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=r.framebuffer,n=e===void 0?null:e,i=r.color,a=i===void 0?null:i,o=r.depth,s=o===void 0?null:o,u=r.stencil,l=u===void 0?null:u,f={};n&&(f.framebuffer=n);var p=0;a&&(p|=NH,a!==!0&&(f.clearColor=a)),s&&(p|=FH,s!==!0&&(f.clearDepth=s)),l&&(p|=DH,s!==!0&&(f.clearStencil=s)),re(p!==0,iO),ke(t,f,function(){t.clear(p)})}function D0(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=r.framebuffer,n=e===void 0?null:e,i=r.buffer,a=i===void 0?eO:i,o=r.drawBuffer,s=o===void 0?0:o,u=r.value,l=u===void 0?[0,0,0,0]:u;ct(t),ke(t,{framebuffer:n},function(){switch(a){case eO:switch(l.constructor){case Int32Array:t.clearBufferiv(a,s,l);break;case Uint32Array:t.clearBufferuiv(a,s,l);break;case Float32Array:default:t.clearBufferfv(a,s,l)}break;case tO:t.clearBufferfv(tO,0,[l]);break;case rO:t.clearBufferiv(rO,0,[l]);break;case nO:var f=W(l,2),p=f[0],h=f[1];t.clearBufferfi(nO,0,p,h);break;default:re(!1,iO)}})}function N0(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 re(!1),0}}function aO(t){switch(t){case 5121:return 1;case 33635:case 32819:case 32820:return 2;case 5126:return 4;default:return re(!1),0}}function gn(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=r.sourceX,n=e===void 0?0:e,i=r.sourceY,a=i===void 0?0:i,o=r.sourceFormat,s=o===void 0?6408:o,u=r.sourceAttachment,l=u===void 0?36064:u,f=r.target,p=f===void 0?null:f,h=r.sourceWidth,d=r.sourceHeight,v=r.sourceType,m=j0(t),g=m.framebuffer,y=m.deleteFramebuffer;re(g);var _=g.gl,b=g.handle,x=g.attachments;h=h||g.width,d=d||g.height,l===36064&&b===null&&(l=1028),re(x[l]),v=v||x[l].type,p=jH(p,v,s,h,d),v=v||yf(p);var w=_.bindFramebuffer(36160,b);return _.readPixels(n,a,h,d,s,v,p),_.bindFramebuffer(36160,w||null),y&&g.delete(),p}function yi(t,r){var e=r.sourceX,n=e===void 0?0:e,i=r.sourceY,a=i===void 0?0:i,o=r.sourceFormat,s=o===void 0?6408:o,u=r.target,l=u===void 0?null:u,f=r.targetByteOffset,p=f===void 0?0:f,h=r.sourceWidth,d=r.sourceHeight,v=r.sourceType,m=j0(t),g=m.framebuffer,y=m.deleteFramebuffer;re(g),h=h||g.width,d=d||g.height;var _=ct(g.gl);if(v=v||(l?l.type:5121),!l){var b=N0(s),x=aO(v),w=p+h*d*b*x;l=new Pe(_,{byteLength:w,accessor:{type:v,size:b}})}return l.bind({target:35051}),ke(_,{framebuffer:g},function(){_.readPixels(n,a,h,d,s,v,p)}),l.unbind({target:35051}),y&&g.delete(),l}function zp(t){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=r.sourceAttachment,n=e===void 0?36064:e,i=r.targetMaxHeight,a=i===void 0?Number.MAX_SAFE_INTEGER:i,o=gn(t,{sourceAttachment:n}
33),s=t.width,u=t.height;u>a;){var l=$P({data:o,width:s,height:u});o=l.data,s=l.width,u=l.height}WP({data:o,width:s,height:u});var f=document.createElement("canvas");f.width=s,f.height=u;var p=f.getContext("2d"),h=p.createImageData(s,u);return h.data.set(o),p.putImageData(h,0,0),f.toDataURL()}function Ns(t,r){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=e.sourceX,i=n===void 0?0:n,a=e.sourceY,o=a===void 0?0:a,s=e.targetMipmaplevel,u=s===void 0?0:s,l=e.targetInternalFormat,f=l===void 0?6408:l,p=e.targetX,h=e.targetY,d=e.targetZ,v=e.width,m=e.height,g=j0(t),y=g.framebuffer,_=g.deleteFramebuffer;re(y);var b=y.gl,x=y.handle,w=typeof p<"u"||typeof h<"u"||typeof d<"u";p=p||0,h=h||0,d=d||0;var P=b.bindFramebuffer(36160,x);re(r);var E=null;if(r instanceof Br&&(E=r,v=Number.isFinite(v)?v:E.width,m=Number.isFinite(m)?m:E.height,E.bind(0),r=E.target),!w)b.copyTexImage2D(r,u,f,i,o,v,m,0);else switch(r){case 3553:case 34067:b.copyTexSubImage2D(r,u,p,h,i,o,v,m);break;case 35866:case 32879:var C=ct(b);C.copyTexSubImage3D(r,u,p,h,d,i,o,v,m);break;default:}return E&&E.unbind(),b.bindFramebuffer(36160,P||null),_&&y.delete(),E}function j0(t){return t instanceof Le?{framebuffer:t,deleteFramebuffer:!1}:{framebuffer:oO(t),deleteFramebuffer:!0}}function jH(t,r,e,n,i){if(t)return t;r=r||5121;var a=oa(r,{clamped:!1}),o=N0(e);return new a(n*i*o)}k();var _t,Ee={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"};function UH(t){var r=new Ce(t,{format:6408,type:5126,dataFormat:6408}),e=new Le(t,{id:"test-framebuffer",check:!1,attachments:c({},36064,r)}),n=e.getStatus();return r.delete(),e.delete(),n===36053}var U0=(_t={},c(_t,Ee.WEBGL2,[!1,!0]),c(_t,Ee.VERTEX_ARRAY_OBJECT,["OES_vertex_array_object",!0]),c(_t,Ee.TIMER_QUERY,["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"]),c(_t,Ee.INSTANCED_RENDERING,["ANGLE_instanced_arrays",!0]),c(_t,Ee.MULTIPLE_RENDER_TARGETS,["WEBGL_draw_buffers",!0]),c(_t,Ee.ELEMENT_INDEX_UINT32,["OES_element_index_uint",!0]),c(_t,Ee.BLEND_EQUATION_MINMAX,["EXT_blend_minmax",!0]),c(_t,Ee.FLOAT_BLEND,["EXT_float_blend"]),c(_t,Ee.COLOR_ENCODING_SRGB,["EXT_sRGB",!0]),c(_t,Ee.TEXTURE_DEPTH,["WEBGL_depth_texture",!0]),c(_t,Ee.TEXTURE_FLOAT,["OES_texture_float",!0]),c(_t,Ee.TEXTURE_HALF_FLOAT,["OES_texture_half_float",!0]),c(_t,Ee.TEXTURE_FILTER_LINEAR_FLOAT,["OES_texture_float_linear"]),c(_t,Ee.TEXTURE_FILTER_LINEAR_HALF_FLOAT,["OES_texture_half_float_linear"]),c(_t,Ee.TEXTURE_FILTER_ANISOTROPIC,["EXT_texture_filter_anisotropic"]),c(_t,Ee.COLOR_ATTACHMENT_RGBA32F,[UH,"EXT_color_buffer_float"]),c(_t,Ee.COLOR_ATTACHMENT_FLOAT,[!1,"EXT_color_buffer_float"]),c(_t,Ee.COLOR_ATTACHMENT_HALF_FLOAT,["EXT_color_buffer_half_float"]),c(_t,Ee.GLSL_FRAG_DATA,["WEBGL_draw_buffers",!0]),c(_t,Ee.GLSL_FRAG_DEPTH,["EXT_frag_depth",!0]),c(_t,Ee.GLSL_DERIVATIVES,["OES_standard_derivatives",!0]),c(_t,Ee.GLSL_TEXTURE_LOD,["EXT_shader_texture_lod",!0]),_t);function GH(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=zH(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
34In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function zH(t,r){if(t){if(typeof t=="string")return sO(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);
34if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return sO(t,r)}}function sO(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var VH=2;function yn(t,r){return qt(t,r)}function qt(t,r){return r=Array.isArray(r)?r:[r],r.every(function(e){return uO(t,e)})}function Vp(t){t.luma=t.luma||{},t.luma.caps=t.luma.caps||{};for(var r in U0)t.luma.caps[r]===void 0&&(t.luma.caps[r]=uO(t,r));return t.luma.caps}function uO(t,r){return t.luma=t.luma||{},t.luma.caps=t.luma.caps||{},t.luma.caps[r]===void 0&&(t.luma.caps[r]=HH(t,r)),t.luma.caps[r]||fe.log(VH,"Feature: ".concat(r," not supported"))(),t.luma.caps[r]}function HH(t,r){var e=U0[r];re(e,r);var n,i=ge(t)&&e[1]||e[0];if(typeof i=="function")n=i(t);else if(Array.isArray(i)){n=!0;var a=GH(i),o;try{for(a.s();!(o=a.n()).done;){var s=o.value;n=n&&Boolean(t.getExtension(s))}}catch(u){a.e(u)}finally{a.f()}}else typeof i=="string"?n=Boolean(t.getExtension(i)):typeof i=="boolean"?n=i:re(!1);return n}function lO(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=WH(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
35In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function WH(t,r){if(t){if(typeof t=="string")return fO(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return fO(t,r)}}function fO(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function $H(t){var r=XH();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function XH(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var cO="Multiple render targets not supported",Le=function(t,r){L(n,t);var e=$H(n);function n(i){var a;A(this,n);var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return a=e.call(this,i,o),a.width=null,a.height=null,a.attachments={},a.readBuffer=36064,a.drawBuffers=[36064],a.ownResources=[],a.initialize(o),Object.seal(q(a)),a}return T(n,[{key:r,get:function(){return"Framebuffer"}},{key:"MAX_COLOR_ATTACHMENTS",get:function(){var a=ct(this.gl);return a.getParameter(a.MAX_COLOR_ATTACHMENTS)}},{key:"MAX_DRAW_BUFFERS",get:function(){var a=ct(this.gl);return a.getParameter(a.MAX_DRAW_BUFFERS)}},{key:"color",get:function(){return this.attachments[36064]||null}},{key:"texture",get:function(){return this.attachments[36064]||null}},{key:"depth",get:function(){return this.attachments[36096]||this.attachments[33306]||null}},{key:"stencil",get:function(){return this.attachments[36128]||this.attachments[33306]||null}},{key:"initialize",value:function(a){var o=a.width,s=o===void 0?1:o,u=a.height,l=u===void 0?1:u,f=a.attachments,p=f===void 0?null:f,h=a.color,d=h===void 0?!0:h,v=a.depth,m=v===void 0?!0:v,g=a.stencil,y=g===void 0?!1:g,_=a.check,b=_===void 0?!0:_,x=a.readBuffer,w=x===void 0?void 0:x,P=a.drawBuffers,E=P===void 0?void 0:P;if(re(s>=0&&l>=0,"Width and height need to be integers"),this.width=s,this.height=l,p)for(var C in p){var I=p[C],O=Array.isArray(I)?I[0]:I;O.resize({width:s,height:l})}else p=this._createDefaultAttachments(d,m,y,s,l);this.update({clearAttachments:!0,attachments:p,readBuffer:w,drawBuffers:E}),p&&b&&this.checkStatus()}},{key:"delete",value:function(){var a=lO(this.ownResources),o;try{for(a.s();!(o=a.n()).done;){var s=o.value;s.delete()}}catch(u){a.e(u)}finally{a.f()}return Z(S(n.prototype),"delete",this).call(this),this}},{key:"update",value:function(a){var o=a.attachments,s=o===void 0?{}:o,u=a.readBuffer,l=a.drawBuffers,f=a.clearAttachments,p=f===void 0?!1:f,h=a.resizeAttachments,d=h===void 0?!0:h;this.attach(s,{clearAttachments:p,resizeAttachments:d});var v=this.gl,m=v.bindFramebuffer(36160,this.handle);return u&&this._setReadBuffer(u),l&&this._setDrawBuffers(l),v.bindFramebuffer(36160,m||null),this}},{key:"resize",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=a.width,s=a.height;if(this.handle===null)return re(o===void 0&&s===void 0),this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;o===void 0&&(o=this.gl.drawingBufferWidth),s===void 0&&(s=this.gl.drawingBufferHeight),o!==this.width&&s!==this.height&&fe.log(2,"Re
35sizing framebuffer ".concat(this.id," to ").concat(o,"x").concat(s))();for(var u in this.attachments)this.attachments[u].resize({width:o,height:s});return this.width=o,this.height=s,this}},{key:"attach",value:function(a){var o=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},u=s.clearAttachments,l=u===void 0?!1:u,f=s.resizeAttachments,p=f===void 0?!0:f,h={};l&&Object.keys(this.attachments).forEach(function(C){h[C]=null}),Object.assign(h,a);var d=this.gl.bindFramebuffer(36160,this.handle);for(var v in h){re(v!==void 0,"Misspelled framebuffer binding point?");var m=Number(v),g=h[m],y=g;if(!y)this._unattach(m);else if(y instanceof dr)this._attachRenderbuffer({attachment:m,renderbuffer:y});else if(Array.isArray(g)){var _=W(g,3),b=_[0],x=_[1],w=x===void 0?0:x,P=_[2],E=P===void 0?0:P;y=b,this._attachTexture({attachment:m,texture:b,layer:w,level:E})}else this._attachTexture({attachment:m,texture:y,layer:0,level:0});p&&y&&y.resize({width:this.width,height:this.height})}this.gl.bindFramebuffer(36160,d||null),Object.assign(this.attachments,a),Object.keys(this.attachments).filter(function(C){return!o.attachments[C]}).forEach(function(C){delete o.attachments[C]})}},{key:"checkStatus",value:function(){var a=this.gl,o=this.getStatus();if(o!==36053)throw new Error(YH(o));return this}},{key:"getStatus",value:function(){var a=this.gl,o=a.bindFramebuffer(36160,this.handle),s=a.checkFramebufferStatus(36160);return a.bindFramebuffer(36160,o||null),s}},{key:"clear",value:function(){var a=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=o.color,u=o.depth,l=o.stencil,f=o.drawBuffers,p=f===void 0?[]:f,h=this.gl.bindFramebuffer(36160,this.handle);return(s||u||l)&&qr(this.gl,{color:s,depth:u,stencil:l}),p.forEach(function(d,v){D0(a.gl,{drawBuffer:v,value:d})}),this.gl.bindFramebuffer(36160,h||null),this}},{key:"readPixels",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return fe.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}},{key:"readPixelsToBuffer",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return fe.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}},{key:"copyToDataUrl",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return fe.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}},{key:"copyToImage",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return fe.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}},{key:"copyToTexture",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return fe.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}},{key:"blit",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return fe.error("Framebuffer.blit({...}) is no logner supported, use blit(source, target, opts)")(),null}},{key:"invalidate",value:function(a){var o=a.attachments,s=o===void 0?[]:o,u=a.x,l=u===void 0?0:u,f=a.y,p=f===void 0?0:f,h=a.width,d=a.height,v=ct(this.gl),m=v.bindFramebuffer(36008,this.handle),g=l===0&&p===0&&h===void 0&&d===void 0;return g?v.invalidateFramebuffer(36008,s):v.invalidateFramebuffer(36008,s,l,p,h,d),v.bindFramebuffer(36008,m),this}},{key:"getAttachmentParameter",value:function(a,o,s){var u=this._getAttachmentParameterFallback(o);return u===null&&(this.gl.bindFramebuffer(36160,this.handle),u=this.gl.getFramebufferAttachmentParameter(36160,a,o),this.gl.bindFramebuffer(36160,null)),s&&u>1e3&&(u=Xr(this.gl,u)),u}},{key:"getAttachmentParameters",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:36064,o=arguments.length>1?arguments[1]:void 0,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.constructor.ATTACHMENT_PARAMETERS||[],u={},l=lO(s),f;try{for(l.s();!(f=l.n()).done;){var p=f.value,h=o?Xr(this.gl,p):p;u[h]=this.getAttachmentParameter(a,p,o)}}
35catch(d){l.e(d)}finally{l.f()}return u}},{key:"getParameters",value:function(){for(var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,o=Object.keys(this.attachments),s={},u=0,l=o;u<l.length;u++){var f=l[u],p=Number(f),h=a?Xr(this.gl,p):p;s[h]=this.getAttachmentParameters(p,a)}return s}},{key:"show",value:function(){return typeof window<"u"&&window.open(zp(this),"luma-debug-texture"),this}},{key:"log",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(a>fe.level||typeof window>"u")return this;o=o||"Framebuffer ".concat(this.id);var s=zp(this,{targetMaxHeight:100});return fe.image({logLevel:a,message:o,image:s},o)(),this}},{key:"bind",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=a.target,s=o===void 0?36160:o;return this.gl.bindFramebuffer(s,this.handle),this}},{key:"unbind",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=a.target,s=o===void 0?36160:o;return this.gl.bindFramebuffer(s,null),this}},{key:"_createDefaultAttachments",value:function(a,o,s,u,l){var f=null;if(a){var p;f=f||{},f[36064]=new Ce(this.gl,{id:"".concat(this.id,"-color0"),pixels:null,format:6408,type:5121,width:u,height:l,mipmaps:!1,parameters:(p={},c(p,10241,9729),c(p,10240,9729),c(p,10242,33071),c(p,10243,33071),p)}),this.ownResources.push(f[36064])}return o&&s?(f=f||{},f[33306]=new dr(this.gl,{id:"".concat(this.id,"-depth-stencil"),format:35056,width:u,height:111}),this.ownResources.push(f[33306])):o?(f=f||{},f[36096]=new dr(this.gl,{id:"".concat(this.id,"-depth"),format:33189,width:u,height:l}),this.ownResources.push(f[36096])):s&&re(!1),f}},{key:"_unattach",value:function(a){var o=this.attachments[a];o&&(o instanceof dr?this.gl.framebufferRenderbuffer(36160,a,36161,null):this.gl.framebufferTexture2D(36160,a,3553,null,0),delete this.attachments[a])}},{key:"_attachRenderbuffer",value:function(a){var o=a.attachment,s=o===void 0?36064:o,u=a.renderbuffer,l=this.gl;l.framebufferRenderbuffer(36160,s,36161,u.handle),this.attachments[s]=u}},{key:"_attachTexture",value:function(a){var o=a.attachment,s=o===void 0?36064:o,u=a.texture,l=a.layer,f=a.level,p=this.gl;switch(p.bindTexture(u.target,u.handle),u.target){case 35866:case 32879:var h=ct(p);h.framebufferTextureLayer(36160,s,u.target,f,l);break;case 34067:var d=qH(l);p.framebufferTexture2D(36160,s,d,u.handle,f);break;case 3553:p.framebufferTexture2D(36160,s,3553,u.handle,f);break;default:re(!1,"Illegal texture type")}p.bindTexture(u.target,null),this.attachments[s]=u}},{key:"_setReadBuffer",value:function(a){var o=x0(this.gl);o?o.readBuffer(a):re(a===36064||a===1029,cO),this.readBuffer=a}},{key:"_setDrawBuffers",value:function(a){var o=this.gl,s=ct(o);if(s)s.drawBuffers(a);else{var u=o.getExtension("WEBGL_draw_buffers");u?u.drawBuffersWEBGL(a):re(a.length===1&&(a[0]===36064||a[0]===1029),cO)}this.drawBuffers=a}},{key:"_getAttachmentParameterFallback",value:function(a){var o=Vp(this.gl);switch(a){case 36052:return o.WEBGL2?null:0;case 33298:case 33299:case 33300:case 33301:case 33302:case 33303:return o.WEBGL2?null:8;case 33297:return o.WEBGL2?null:5125;case 33296:return!o.WEBGL2&&!o.EXT_sRGB?9729:null;default:return null}}},{key:"_createHandle",value:function(){return this.gl.createFramebuffer()}},{key:"_deleteHandle",value:function(){this.gl.deleteFramebuffer(this.handle)}},{key:"_bindHandle",value:function(a){return this.gl.bindFramebuffer(36160,a)}}],[{key:"isSupported",value:function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=o.colorBufferFloat,u=o.colorBufferHalfFloat,l=!0;return s&&(l=Boolean(a.getExtension("EXT_color_buffer_float")||a.getExtension("WEBGL_color_buffer_float")||a.getExtension("OES_texture_float"))),u&&(l=l&&Boolean(a.getExtension("EXT_color_buffer_float")||a.getExtension("EXT_color_buffer_half_float"))),l}},{key:"getDefaultFramebuffer",value:function(a){return a.luma=a.luma||{},a.luma.defaultFramebuffer=a.luma.defaultFramebuffer||new n(a,{id:"default-framebuffer",handle:null,attachments:{}}
35),a.luma.defaultFramebuffer}}]),n}(Xt,Symbol.toStringTag);function qH(t){return t<34069?t+34069:t}function YH(t){var r=Le.STATUS||{};return r[t]||"Framebuffer error ".concat(t)}var KH=[36049,36048,33296,33298,33299,33300,33301,33302,33303];Le.ATTACHMENT_PARAMETERS=KH;function js(t,r){re(t instanceof Ce||t instanceof ho||t instanceof Ds);var e=t.constructor,n=t.gl,i=t.width,a=t.height,o=t.format,s=t.type,u=t.dataFormat,l=t.border,f=t.mipmaps,p=Object.assign({width:i,height:a,format:o,type:s,dataFormat:u,border:l,mipmaps:f},r);return new e(n,p)}function oO(t,r){var e=t.gl,n=t.width,i=t.height,a=t.id,o=new Le(e,Object.assign({},r,{id:"framebuffer-for-".concat(a),width:n,height:i,attachments:c({},36064,t)}));return o}F();j();function sa(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"unnamed",e=/#define[\s*]SHADER_NAME[\s*]([A-Za-z0-9_-]+)[\s*]/,n=t.match(e);return n?n[1]:r}var ZH=35632,JH=35633;function G0(t){switch(t){case ZH:return"fragment";case JH:return"vertex";default:return"unknown type"}}function z0(t,r,e,n){for(var i=t.split(/\r?\n/),a={},o={},s=n||sa(r)||"(unnamed)",u="".concat(G0(e)," shader ").concat(s),l=0;l<i.length;l++){var f=i[l];if(!(f.length<=1)){var p=f.split(":"),h=p[0],d=parseInt(p[2],10);if(isNaN(d))throw new Error("GLSL compilation error in ".concat(u,": ").concat(t));h!=="WARNING"?a[d]=f:o[d]=f}}var v=QH(r);return{shaderName:u,errors:pO(a,v),warnings:pO(o,v)}}function pO(t,r){for(var e="",n=0;n<r.length;n++){var i=r[n];if(!(!t[n+3]&&!t[n+2]&&!t[n+1])&&(e+="".concat(i,`
36`),t[n+1])){var a=t[n+1],o=a.split(":",3),s=o[0],u=parseInt(o[1],10)||0,l=a.substring(o.join(":").length+1).trim();e+=hO("^^^ ".concat(s,": ").concat(l,`
37
38`),u)}}return e}function QH(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:": ",n=t.split(/\r?\n/),i=String(n.length+r-1).length;return n.map(function(a,o){var s=String(o+r),u=s.length,l=hO(s,i-u);return l+e+a})}function hO(t,r){for(var e="",n=0;n<r;++n)e+=" ";return"".concat(e).concat(t)}function Us(t){var r=100,e=t.match(/[^\s]+/g);if(e.length>=2&&e[0]==="#version"){var n=parseInt(e[1],10);Number.isFinite(n)&&(r=n)}return r}function V0(t){var r=e9();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function e9(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var t9="Shader: GLSL source code must be a JavaScript string",dO=function(t,r){L(n,t);var e=V0(n);function n(i,a){var o;A(this,n),mi(i),re(typeof a.source=="string",t9);var s=sa(a.source,null)||a.id||$e("unnamed ".concat(n.getTypeName(a.shaderType)));return o=e.call(this,i,{id:s}),o.shaderType=a.shaderType,o.source=a.source,o.initialize(a),o}return T(n,[{key:r,get:function(){return"Shader"}},{key:"initialize",value:function(a){var o=a.source,s=sa(o,null);
38s&&(this.id=$e(s)),this._compile(o)}},{key:"getParameter",value:function(a){return this.gl.getShaderParameter(this.handle,a)}},{key:"toString",value:function(){return"".concat(n.getTypeName(this.shaderType),":").concat(this.id)}},{key:"getName",value:function(){return sa(this.source)||"unnamed-shader"}},{key:"getSource",value:function(){return this.gl.getShaderSource(this.handle)}},{key:"getTranslatedSource",value:function(){var a=this.gl.getExtension("WEBGL_debug_shaders");return a?a.getTranslatedShaderSource(this.handle):"No translated source available. WEBGL_debug_shaders not implemented"}},{key:"_compile",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.source;a.startsWith("#version ")||(a=`#version 100
39`.concat(a)),this.source=a,this.gl.shaderSource(this.handle,this.source),this.gl.compileShader(this.handle);var o=this.getParameter(35713);if(!o){var s=this.gl.getShaderInfoLog(this.handle),u=z0(s,this.source,this.shaderType,this.id),l=u.shaderName,f=u.errors,p=u.warnings;throw fe.error("GLSL compilation errors in ".concat(l,`
40`).concat(f))(),fe.warn("GLSL compilation warnings in ".concat(l,`
41`).concat(p))(),new Error("GLSL compilation errors in ".concat(l))}}},{key:"_deleteHandle",value:function(){this.gl.deleteShader(this.handle)}},{key:"_getOptsFromHandle",value:function(){return{type:this.getParameter(35663),source:this.getSource()}}}],[{key:"getTypeName",value:function(a){switch(a){case 35633:return"vertex-shader";case 35632:return"fragment-shader";default:return re(!1),"unknown"}}}]),n}(Xt,Symbol.toStringTag),bf=function(t,r){L(n,t);var e=V0(n);function n(i,a){return A(this,n),typeof a=="string"&&(a={source:a}),e.call(this,i,Object.assign({},a,{shaderType:35633}))}return T(n,[{key:r,get:function(){return"VertexShader"}},{key:"_createHandle",value:function(){return this.gl.createShader(35633)}}]),n}(dO,Symbol.toStringTag),xf=function(t,r){L(n,t);var e=V0(n);function n(i,a){return A(this,n),typeof a=="string"&&(a={source:a}),e.call(this,i,Object.assign({},a,{shaderType:35632}))}return T(n,[{key:r,get:function(){return"FragmentShader"}},{key:"_createHandle",value:function(){return this.gl.createShader(35632)}}]),n}(dO,Symbol.toStringTag);F();j();k();var Be,r9=(Be={},c(Be,5126,vt.bind(null,"uniform1fv",Fr,1,nr)),c(Be,35664,vt.bind(null,"uniform2fv",Fr,2,nr)),c(Be,35665,vt.bind(null,"uniform3fv",Fr,3,nr)),c(Be,35666,vt.bind(null,"uniform4fv",Fr,4,nr)),c(Be,5124,vt.bind(null,"uniform1iv",ua,1,nr)),c(Be,35667,vt.bind(null,"uniform2iv",ua,2,nr)),c(Be,35668,vt.bind(null,"uniform3iv",ua,3,nr)),c(Be,35669,vt.bind(null,"uniform4iv",ua,4,nr)),c(Be,35670,vt.bind(null,"uniform1iv",ua,1,nr)),c(Be,35671,vt.bind(null,"uniform2iv",ua,2,nr)),c(Be,35672,vt.bind(null,"uniform3iv",ua,3,nr)),c(Be,35673,vt.bind(null,"uniform4iv",ua,4,nr)),c(Be,35674,vt.bind(null,"uniformMatrix2fv",Fr,4,_i)),c(Be,35675,vt.bind(null,"uniformMatrix3fv",Fr,9,_i)),c(Be,35676,vt.bind(null,"uniformMatrix4fv",Fr,16,_i)),c(Be,35678,Qt),c(Be,35680,Qt),c(Be,5125,vt.bind(null,"uniform1uiv",Hp,1,nr)),c(Be,36294,vt.bind(null,"uniform2uiv",Hp,2,nr)),c(Be,36295,vt.bind(null,"uniform3uiv",Hp,3,nr)),c(Be,36296,vt.bind(null,"uniform4uiv",Hp,4,nr)),c(Be,35685,vt.bind(null,"uniformMatrix2x3fv",Fr,6,_i)),c(Be,35686,vt.bind(null,"uniformMatrix2x4fv",Fr,8,_i)),c(Be,35687,vt.bind(null,"uniformMatrix3x2fv",Fr,6,_i)),c(Be,35688,vt.bind(null,"uniformMatrix3x4fv",Fr,12,_i)),c(Be,35689,vt.bind(null,"uniformMatrix4x2fv",Fr,8,_i)),c(Be,35690,vt.bind(null,"uniformMatrix4x3fv",Fr,12,_i)),c(Be,35678,Qt),c(Be,35680,Qt),c(Be,35679,Qt),c(Be,35682,Qt),c(Be,36289,Qt),c(Be,36292,Qt),c(Be,36293,Qt),c(Be,36298,Qt),c(Be,36299,Qt),c(Be,36300,Qt),c(Be,36303,Qt),c(Be,36306,Qt),c(Be,36307,Qt),c(Be,36308,Qt),c(Be,36311,Qt),Be),n9={},i9={},a9={},vO=[0];function H0(t,r,e,n){r===1&&typeof t=="boolean"&&(t=t?1:0),Number.isFinite(t)&&(vO[0]=t,t=vO);var i=t.length;if(i%r&&fe.warn("Uniform size should be multiples of ".concat(r),t)(),t instanceof e)return t;var a=n[i];a||(a=new e(i),n[i]=a);for(var o=0;o<i;o++)a[o]=t[o];return a}function Fr(t,r){return H0(t,r,Float32Array,n9)}function ua(t,r){return H0(t,r,Int32Array,i9)}function Hp(t,r){return H0(t,r,Uint32Array,a9)}function W0(t,r,e){var n=r9[e.type];if(!n)throw new Error("Unknown GLSL uniform type ".concat(e.type));return n().bind(null,t,r)}function mO(t){if(t[t.length-1]!=="]")return{name:t,length:1,isArray:!1};var r=/([^[]*)(\[[0-9]+\])?/,e=t.match(r);if(!e||e.length<2)throw new Error("Failed to parse GLSL uniform name ".concat(t));return{name:e[1],length:e[2]||1,isArray:Boolean(e[2])}}function gO(t,r,e){for(var n in t){var i=t[n],a=!e||Boolean(e[n]);if(a&&!o9(i))throw r=r?"".concat(r," "):"",console.error("".concat(r," Bad uniform ").concat(n),i),new Error("".concat(r," Bad uniform ").concat(n))}return!0}function o9(t){return Array.isArray(t)||ArrayBuffer.isView(t)?s9(t):isFinite(t)||t===!0||t===!1||t instanceof Br||t instanceof dr?!0:t instanceof Le?Boolean(t.texture):!1}function yO(t,r,e){if(Array.isArray(e)||ArrayBuffer.isView(e))if(t[r])for(var n=t[r],i=0,a=e.length;i<a;++i)n[i]=e[i];else t[r]=e.slice();else t[r]=e}function s9(t){if(t.length===0)return!1;for(var r=Math.min(t.length,16),e=0;e<r;++e)if(!Number.isFinite(t[e]))return!1;return!0}function Qt(){var t=null;return function(r,e,n){var i=t!==n;return i&&(r.uniform1i(e,n),t=n),i}}function vt(t,r,e,n){var i=null,a=null;return function(o,s,u){var l=r(u,e),f=l.length,p=!1;if(i===null)i=new Float32Array(f),a=f,p=!0;else{re(a===f,"Uniform length cannot change.");for(var h=0;h<f;++h)if(l[h]!==i[h]){p=!0;break}}return p&&(n(o,t,s,l),i.set(l)),p}}function nr(t,r,e,n){t[r](e,n)}function _i(t,r,e,n){t[r](e,!1,n)}F();j();be();k();var ot,u9=5120,l9=5121,f9=5122,c9=5123,_O=0,Wp=1,p9=2,h9=3,$p=4,d9=5,v9=6,Ut=5126,m9=35664,g9=35665,y9=35666,Af=5124,_9=35667,b9=35668,x9=35669,Sf=5125,A9=36294,S9=36295,T9=36296,w9=35670,P9=35671,O9=35672,E9=35673,C9=35674,M9=35675,I9=35676,R9=35685,L9=35686,k9=35687,B9=35688,F9=35689,D9=35690,$0=(ot={},c(ot,Ut,[Ut,1,"float"]),c(ot,m9,[Ut,2,"vec2"]),c(ot,g9,[Ut,3,"vec3"]),c(ot,y9,[Ut,4,"vec4"]),c(ot,Af,[Af,1,"int"]),c(ot,_9,[Af,2,"ivec2"]),c(ot,b9,[Af,3,"ivec3"]),c(ot,x9,[Af,4,"ivec4"]),c(ot,Sf,[Sf,1,"uint"]),c(ot,A9,[Sf,2,"uvec2"]),c(ot,S9,[Sf,3,"uvec3"]),c(ot,T9,[Sf,4,"uvec4"]),c(ot,w9,[Ut,1,"bool"]),c(ot,P9,[Ut,2,"bvec2"]),c(ot,O9,[Ut,3,"bvec3"]),c(ot,E9,[Ut,4,"bvec4"]),c(ot,C9,[Ut,8,"mat2"]),c(ot,R9,[Ut,8,"mat2x3"]),c(ot,L9,[Ut,8,"mat2x4"]),c(ot,M9,[Ut,12,"mat3"]),c(ot,k9,[Ut,12,"mat3x2"]),c(ot,B9,[Ut,12,"mat3x4"]),c(ot,I9,[Ut,16,"mat4"]),c(ot,F9,[Ut,16,"mat4x2"]),c(ot,D9,[Ut,16,"mat4x3"]),ot);function bO(t){switch(t){case _O:return _O;case Wp:return Wp;case h9:return Wp;case p9:return Wp;case $p:return $p;case d9:return $p;case v9:return $p;default:return re(!1),0}}function X0(t){var r=$0[t];if(!r)return null;var e=W(r,2),n=e[0],i=e[1];return{type:n,components:i}}function Xp(t,r){switch(t){case u9:case l9:case f9:case c9:t=Ut;break;default:}
41for(var e in $0){var n=W($0[e],3),i=n[0],a=n[1],o=n[2];if(i===t&&a===r)return{glType:e,name:o}}return null}var xO=function(){function t(r){A(this,t),this.id=r.id,this.attributeInfos=[],this.attributeInfosByName={},this.attributeInfosByLocation=[],this.varyingInfos=[],this.varyingInfosByName={},Object.seal(this),this._readAttributesFromProgram(r),this._readVaryingsFromProgram(r)}return T(t,[{key:"getAttributeInfo",value:function(e){var n=Number(e);return Number.isFinite(n)?this.attributeInfosByLocation[n]:this.attributeInfosByName[e]||null}},{key:"getAttributeLocation",value:function(e){var n=this.getAttributeInfo(e);return n?n.location:-1}},{key:"getAttributeAccessor",value:function(e){var n=this.getAttributeInfo(e);return n?n.accessor:null}},{key:"getVaryingInfo",value:function(e){var n=Number(e);return Number.isFinite(n)?this.varyingInfos[n]:this.varyingInfosByName[e]||null}},{key:"getVaryingIndex",value:function(e){var n=this.getVaryingInfo();return n?n.location:-1}},{key:"getVaryingAccessor",value:function(e){var n=this.getVaryingInfo();return n?n.accessor:null}},{key:"_readAttributesFromProgram",value:function(e){for(var n=e.gl,i=n.getProgramParameter(e.handle,35721),a=0;a<i;a++){var o=n.getActiveAttrib(e.handle,a),s=o.name,u=o.type,l=o.size,f=n.getAttribLocation(e.handle,s);f>=0&&this._addAttribute(f,s,u,l)}this.attributeInfos.sort(function(p,h){return p.location-h.location})}},{key:"_readVaryingsFromProgram",value:function(e){var n=e.gl;if(ge(n)){for(var i=n.getProgramParameter(e.handle,35971),a=0;a<i;a++){var o=n.getTransformFeedbackVarying(e.handle,a),s=o.name,u=o.type,l=o.size;this._addVarying(a,s,u,l)}this.varyingInfos.sort(function(f,p){return f.location-p.location})}}},{key:"_addAttribute",value:function(e,n,i,a){var o=X0(i),s=o.type,u=o.components,l={type:s,size:a*u};this._inferProperties(e,n,l);var f={location:e,name:n,accessor:new pr(l)};this.attributeInfos.push(f),this.attributeInfosByLocation[e]=f,this.attributeInfosByName[f.name]=f}},{key:"_inferProperties",value:function(e,n,i){/instance/i.test(n)&&(i.divisor=1)}},{key:"_addVarying",value:function(e,n,i,a){var o=X0(i),s=o.type,u=o.components,l=new pr({type:s,size:a*u}),f={location:e,name:n,accessor:l};this.varyingInfos.push(f),this.varyingInfosByName[f.name]=f}}]),t}();function N9(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=j9(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
42In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function j9(t,r){if(t){if(typeof t=="string")return AO(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return AO(t,r)}}function AO(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function U9(t){var r=G9();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function G9(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var SO=4,z9=35981,V9=["setVertexArray","setAttributes","setBuffers","unsetBuffers","use","getUniformCount","getUniformInfo","getUniformLocation","getUniformValue","getVarying","getFragDataLocation","getAttachedShaders","getAttributeCount","getAttributeLocation","getAttributeInfo"],la=function(t,r){L(n,t);var e=U9(n);function n(i){var a;A(this,n);var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return a=e.call(this,i,o),a.stubRemovedMethods("Program","v6.0",V9),a._isCached=!1,a.initialize(o),Object.seal(q(a)),a._setId(o.id),a}return T(n,[{key:r,get:function(){return"Program"}},{key:"initialize",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=a.hash,s=a.vs,u=a.fs,l=a.varyings,f=a.bufferMode,p=f===void 0?z9:f;return this.hash=o||"",this.vs=typeof s=="string"?new bf(this.gl,{id:"".concat(a.id,"-vs"),source:s}):s,this.fs=typeof u=="string"?new xf(this.gl,{id:"".concat(a.id,"-fs"),source:u}):u,re(this.vs instanceof bf),re(this.fs instanceof xf),this.uniforms={},this._textureUniforms={},l&&l.length>0&&(ct(this.gl),this.varyings=l,this.gl2.transformFeedbackVaryings(this.handle,l,p)),this._compileAndLink(),this._readUniformLocationsFromLinkedProgram(),this.configuration=new xO(this),this.setProps(a)}},{key:"delete",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};
42return this._isCached?this:Z(S(n.prototype),"delete",this).call(this,a)}},{key:"setProps",value:function(a){return"uniforms"in a&&this.setUniforms(a.uniforms),this}},{key:"draw",value:function(a){var o=this,s=a.logPriority,u=a.drawMode,l=u===void 0?4:u,f=a.vertexCount,p=a.offset,h=p===void 0?0:p,d=a.start,v=a.end,m=a.isIndexed,g=m===void 0?!1:m,y=a.indexType,_=y===void 0?5123:y,b=a.instanceCount,x=b===void 0?0:b,w=a.isInstanced,P=w===void 0?x>0:w,E=a.vertexArray,C=E===void 0?null:E,I=a.transformFeedback,O=a.framebuffer,D=a.parameters,N=D===void 0?{}:D,H=a.uniforms,$=a.samplers;if((H||$)&&(fe.deprecated("Program.draw({uniforms})","Program.setUniforms(uniforms)")(),this.setUniforms(H||{})),fe.priority>=s){var ee=O?O.id:"default",V="mode=".concat(Xr(this.gl,l)," verts=").concat(f," ")+"instances=".concat(x," indexType=").concat(Xr(this.gl,_)," ")+"isInstanced=".concat(P," isIndexed=").concat(g," ")+"Framebuffer=".concat(ee);fe.log(s,V)()}return re(C),this.gl.useProgram(this.handle),!this._areTexturesRenderable()||f===0||P&&x===0?!1:(C.bindForDraw(f,x,function(){if(O!==void 0&&(N=Object.assign({},N,{framebuffer:O})),I){var U=bO(l);I.begin(U)}o._bindTextures(),ke(o.gl,N,function(){g&&P?o.gl2.drawElementsInstanced(l,f,_,h,x):g&&ge(o.gl)&&!isNaN(d)&&!isNaN(v)?o.gl2.drawRangeElements(l,d,v,f,_,h):g?o.gl.drawElements(l,f,_,h):P?o.gl2.drawArraysInstanced(l,h,f,x):o.gl.drawArrays(l,h,f)}),I&&I.end()}),!0)}},{key:"setUniforms",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};fe.priority>=2&&gO(a,this.id,this._uniformSetters),this.gl.useProgram(this.handle);for(var o in a){var s=a[o],u=this._uniformSetters[o];if(u){var l=s,f=!1;if(l instanceof Le&&(l=l.texture),l instanceof Br)if(f=this.uniforms[o]!==s,f){u.textureIndex===void 0&&(u.textureIndex=this._textureIndexCounter++);var p=l,h=u.textureIndex;p.bind(h),l=h,this._textureUniforms[o]=p}else l=u.textureIndex;else this._textureUniforms[o]&&delete this._textureUniforms[o];(u(l)||f)&&yO(this.uniforms,o,s)}}return this}},{key:"_areTexturesRenderable",value:function(){var a=!0;for(var o in this._textureUniforms){var s=this._textureUniforms[o];s.update(),a=a&&s.loaded}return a}},{key:"_bindTextures",value:function(){for(var a in this._textureUniforms){var o=this._uniformSetters[a].textureIndex;this._textureUniforms[a].bind(o)}}},{key:"_createHandle",value:function(){return this.gl.createProgram()}},{key:"_deleteHandle",value:function(){this.gl.deleteProgram(this.handle)}},{key:"_getOptionsFromHandle",value:function(a){var o=this.gl.getAttachedShaders(a),s={},u=N9(o),l;try{for(u.s();!(l=u.n()).done;){var f=l.value,p=this.gl.getShaderParameter(this.handle,35663);switch(p){case 35633:s.vs=new bf({handle:f});break;case 35632:s.fs=new xf({handle:f});break;default:}}}catch(h){u.e(h)}finally{u.f()}return s}},{key:"_getParameter",value:function(a){return this.gl.getProgramParameter(this.handle,a)}},{key:"_setId",value:function(a){if(!a){var o=this._getName();this.id=$e(o)}}},{key:"_getName",value:function(){var a=this.vs.getName()||this.fs.getName();return a=a.replace(/shader/i,""),a=a?"".concat(a,"-program"):"program",a}},{key:"_compileAndLink",value:function(){var a=this.gl;if(a.attachShader(this.handle,this.vs.handle),a.attachShader(this.handle,this.fs.handle),fe.time(SO,"linkProgram for ".concat(this._getName()))(),a.linkProgram(this.handle),fe.timeEnd(SO,"linkProgram for ".concat(this._getName()))(),a.debug||fe.level>0){var o=a.getProgramParameter(this.handle,35714);if(!o)throw new Error("Error linking: ".concat(a.getProgramInfoLog(this.handle)));a.validateProgram(this.handle);var s=a.getProgramParameter(this.handle,35715);if(!s)throw new Error("Error validating: ".concat(a.getProgramInfoLog(this.handle)))}}},{key:"_readUniformLocationsFromLinkedProgram",value:function(){var a=this.gl;this._uniformSetters={},this._uniformCount=this._getParameter(35718);for(var o=0;o<this._uniformCount;o++){var s=this.gl.getActiveUniform(this.handle,o),u=mO(s.name),l=u.name,f=a.getUniformLocation(this.handle,l);if(this._uniformSetters[l]=W0(a,f,s),s.size>1)for(var p=0;p<s.size;p++)f=a.getUniformLocation(this.handle,"".concat(l,"[").concat(p,"]")),this._uniformSetters["".concat(l,"[").concat(p,"]")]=W0(a,f,s)}this._textureIndexCounter=0}},{key:"getActiveUniforms",value:function(a,o){return this.gl2.getActiveUniforms(this.handle,a,o)}},{key:"getUniformBlockIndex",value:function(a){return this.gl2.getUniformBlockIndex(this.handle,a)}},{key:"getActiveUniformBlockParameter",value:function(a,o){return this.gl2.getActiveUniformBlockParameter(this.handle,a,o)}},{key:"uniformBlockBinding",value:function(a,o){this.gl2.uniformBlockBinding(this.handle,a,o)}}]),n}(Xt,Symbol.toStringTag);F();j();function H9(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=W9(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}
42}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
43In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function W9(t,r){if(t){if(typeof t=="string")return TO(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return TO(t,r)}}function TO(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function $9(t){var r=X9();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function X9(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var q9=34918,Y9=34919,K9=35007,Z9=36795,J9=35976,Q9=35887,eW=36202,qp=function(t,r){L(n,t);var e=$9(n);function n(i){var a;A(this,n);var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return a=e.call(this,i,o),a.target=null,a._queryPending=!1,a._pollingPromise=null,Object.seal(q(a)),a}return T(n,[{key:r,get:function(){return"Query"}},{key:"beginTimeElapsedQuery",value:function(){return this.begin(K9)}},{key:"beginOcclusionQuery",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=a.conservative,s=o===void 0?!1:o;return this.begin(s?eW:Q9)}},{key:"beginTransformFeedbackQuery",value:function(){return this.begin(J9)}},{key:"begin",value:function(a){return this._queryPending?this:(this.target=a,this.gl2.beginQuery(this.target,this.handle),this)}},{key:"end",value:function(){return this._queryPending?this:(this.target&&(this.gl2.endQuery(this.target),this.target=null,this._queryPending=!0),this)}},{key:"isResultAvailable",value:function(){if(!this._queryPending)return!1;var a=this.gl2.getQueryParameter(this.handle,Y9);return a&&(this._queryPending=!1),a}},{key:"isTimerDisjoint",value:function(){return this.gl2.getParameter(Z9)}},{key:"getResult",value:function(){return this.gl2.getQueryParameter(this.handle,q9)}},{key:"getTimerMilliseconds",value:function(){return this.getResult()/1e6}},{key:"createPoll",value:function(){var a=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Number.POSITIVE_INFINITY;if(this._pollingPromise)return this._pollingPromise;var s=0;return this._pollingPromise=new Promise(function(u,l){var f=function p(){a.isResultAvailable()?(u(a.getResult()),a._pollingPromise=null):s++>o?(l("Timed out"),a._pollingPromise=null):requestAnimationFrame(p)};requestAnimationFrame(f)}),this._pollingPromise}},{key:"_createHandle",value:function(){return n.isSupported(this.gl)?this.gl2.createQuery():null}},{key:"_deleteHandle",value:function(){this.gl2.deleteQuery(this.handle)}}],[{key:"isSupported",value:function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],s=ge(a),u=qt(a,Ee.TIMER_QUERY),l=s||u,f=H9(o),p;try{for(f.s();!(p=f.n()).done;){var h=p.value;switch(h){case"queries":l=l&&s;break;case"timers":l=l&&u;break;default:re(!1)}}}catch(d){f.e(d)}finally{f.f()}return l}}]),n}(Xt,Symbol.toStringTag);F();j();function tW(t){var r=rW();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function rW(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var fa=function(t,r){L(n,t);var e=tW(n);function n(i){var a;A(this,n);var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return ct(i),a=e.call(this,i,o),a.initialize(o),a.stubRemovedMethods("TransformFeedback","v6.0",["pause","resume"]),Object.seal(q(a)),a}return T(n,[{key:r,get:function(){return"TransformFeedback"}},{key:"initialize",value:function(){var a=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this.buffers={},this.unused={},this.configuration=null,this.bindOnUse=!0,Gn(this.buffers)||this.bind(function(){return a._unbindBuffers()}),this.setProps(o),this}},{key:"setProps",value:function(a){"program"in a&&(this.configuration=a.program&&a.program.configuration),"configuration"in a&&(this.configuration=a.configuration),"bindOnUse"in a&&(a=a.bindOnUse),"buffers"in a&&this.setBuffers(a.buffers)}},{key:"setBuffers",value:function(){var a=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this.bind(function(){for(var s in o)a.setBuffer(s,o[s])}),this}},{key:"setBuffer",value:function(a,o){var s=this._getVaryingIndex(a),u=this._getBufferParams(o),l=u.buffer,f=u.byteSize,p=u.byteOffset;return s<0?(this.unused[a]=l,fe.warn("".concat(this.id," unused varying buffer ").concat(a))(),this):(this.buffers[s]=o,this.bindOnUse||this._bindBuffer(s,l,p,f),this)}},{key:"begin",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return this.gl.bindTransformFeedback(36386,this.handle),this._bindBuffers(),this.gl.beginTransformFeedback(a),this}},{key:"end",value:function(){return this.gl.endTransformFeedback(),this._unbindBuffers(),this.gl.bindTransformFeedback(36386,null),this}},{key:"_getBufferParams",value:function(a){var o,s,u;return a instanceof Pe?u=a:(u=a.buffer,s=a.byteSize,o=a.byteOffset),(o!==void 0||s!==void 0)&&(o=o||0,s=s||u.byteLength-o),{buffer:u,byteOffset:o,byteSize:s}}},{key:"_getVaryingInfo",value:function(a){return this.configuration&&this.configuration.getVaryingInfo(a)}}
43,{key:"_getVaryingIndex",value:function(a){if(this.configuration)return this.configuration.getVaryingInfo(a).location;var o=Number(a);return Number.isFinite(o)?o:-1}},{key:"_bindBuffers",value:function(){if(this.bindOnUse)for(var a in this.buffers){var o=this._getBufferParams(this.buffers[a]),s=o.buffer,u=o.byteSize,l=o.byteOffset;this._bindBuffer(a,s,l,u)}}},{key:"_unbindBuffers",value:function(){if(this.bindOnUse)for(var a in this.buffers)this._bindBuffer(a,null)}},{key:"_bindBuffer",value:function(a,o){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,u=arguments.length>3?arguments[3]:void 0,l=o&&o.handle;return!l||u===void 0?this.gl.bindBufferBase(35982,a,l):this.gl.bindBufferRange(35982,a,l,s,u),this}},{key:"_createHandle",value:function(){return this.gl.createTransformFeedback()}},{key:"_deleteHandle",value:function(){this.gl.deleteTransformFeedback(this.handle)}},{key:"_bindHandle",value:function(a){this.gl.bindTransformFeedback(36386,this.handle)}}],[{key:"isSupported",value:function(a){return ge(a)}}]),n}(Xt,Symbol.toStringTag);F();j();var Yp=null;function nW(t){return(!Yp||Yp.byteLength<t)&&(Yp=new ArrayBuffer(t)),Yp}function wO(t,r){var e=nW(t.BYTES_PER_ELEMENT*r);return new t(e,0,r)}function PO(t){for(var r=t.target,e=t.source,n=t.start,i=n===void 0?0:n,a=t.count,o=a===void 0?1:a,s=e.length,u=o*s,l=0,f=i;l<s;l++)r[f++]=e[l];for(;l<u;)l<u-l?(r.copyWithin(i+l,i,i+l),l*=2):(r.copyWithin(i+l,i,i+u-l),l=u);return r}function iW(t){var r=aW();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function aW(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var oW="elements must be GL.ELEMENT_ARRAY_BUFFER",Kp=function(t,r){L(n,t);var e=iW(n);function n(i){var a;A(this,n);var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=o.id||o.program&&o.program.id;return a=e.call(this,i,Object.assign({},o,{id:s})),a.buffer=null,a.bufferValue=null,a.isDefaultArray=o.isDefaultArray||!1,a.gl2=i,a.initialize(o),Object.seal(q(a)),a}return T(n,[{key:r,get:function(){return"VertexArrayObject"}},{key:"delete",value:function(){return Z(S(n.prototype),"delete",this).call(this),this.buffer&&this.buffer.delete(),this}},{key:"MAX_ATTRIBUTES",get:function(){return n.getMaxAttributes(this.gl)}},{key:"initialize",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this.setProps(a)}},{key:"setProps",value:function(a){return this}},{key:"setElementBuffer",value:function(){var a=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return re(!o||o.target===34963,oW),this.bind(function(){a.gl.bindBuffer(34963,o?o.handle:null)}),this}},{key:"setBuffer",value:function(a,o,s){if(o.target===34963)return this.setElementBuffer(o,s);var u=s.size,l=s.type,f=s.stride,p=s.offset,h=s.normalized,d=s.integer,v=s.divisor,m=this.gl,g=this.gl2;return a=Number(a),this.bind(function(){m.bindBuffer(34962,o.handle),d?(re(ge(m)),g.vertexAttribIPointer(a,u,l,f,p)):m.vertexAttribPointer(a,u,l,h,f,p),m.enableVertexAttribArray(a),g.vertexAttribDivisor(a,v||0)}),this}},{key:"enable",value:function(a){var o=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,u=!s&&a===0&&!n.isSupported(this.gl,{constantAttributeZero:!0});return u||(a=Number(a),this.bind(function(){return s?o.gl.enableVertexAttribArray(a):o.gl.disableVertexAttribArray(a)})),this}},{key:"getConstantBuffer",value:function(a,o){var s=this._normalizeConstantArrayValue(o),u=s.byteLength*a,l=s.length*a,f=!this.buffer;if(this.buffer=this.buffer||new Pe(this.gl,u),f=f||this.buffer.reallocate(u),f=f||!this._compareConstantArrayValues(s,this.bufferValue),f){var p=wO(o.constructor,l);PO({target:p,source:s,start:0,count:l}),this.buffer.subData(p),this.bufferValue=o}return this.buffer}},{key:"_normalizeConstantArrayValue",value:function(a){return Array.isArray(a)?new Float32Array(a):a}},{key:"_compareConstantArrayValues",value:function(a,o){if(!a||!o||a.length!==o.length||a.constructor!==o.constructor)return!1;for(var s=0;s<a.length;++s)if(a[s]!==o[s])return!1;return!0}},{key:"_createHandle",value:function(){var a=this.gl;return a.createVertexArray()}},{key:"_deleteHandle",value:function(a){return this.gl2.deleteVertexArray(a),[this.elements]}},{key:"_bindHandle",value:function(a){this.gl2.bindVertexArray(a)}},{key:"_getParameter",value:function(a,o){var s=this,u=o.location;return re(Number.isFinite(u)),this.bind(function(){switch(a){case 34373:return s.gl.getVertexAttribOffset(u,a);default:return s.gl.getVertexAttrib(u,a)}})}}],[{key:"isSupported",value:function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return o.constantAttributeZero?ge(a)||Cs()==="Chrome":!0}},{key:"getDefaultArray",value:function(a){return a.luma=a.luma||{},a.luma.defaultVertexArray||(a.luma.defaultVertexArray=new n(a,{handle:null,isDefaultArray:!0})),a.luma.defaultVertexArray}},{key:"getMaxAttributes",value:function(a){return n.MAX_ATTRIBUTES=n.MAX_ATTRIBUTES||a.getParameter(34921),n.MAX_ATTRIBUTES}},{key:"setConstant",value:function(a,o,s){switch(s.constructor){case Float32Array:n._setConstantFloatArray(a,o,s);break;case Int32Array:n._setConstantIntArray(a,o,s);break;case Uint32Array:n._setConstantUintArray(a,o,s);break;default:re(!1)}}},{key:"_setConstantFloatArray",value:function(a,o,s){switch(s.length){case 1:a.vertexAttrib1fv(o,s);break;case 2:a.vertexAttrib2fv(o,s);break;case 3:a.vertexAttrib3fv(o,s);break;case 4:a.vertexAttrib4fv(o,s);break;default:re(!1)}}},{key:"_setConstantIntArray",value:function(a,o,s){switch(re(ge(a)),s.length){case 1:a.vertexAttribI1iv(o,s);break;case 2:a.vertexAttribI2iv(o,s);break;case 3:a.vertexAttribI3iv(o,s);break;case 4:a.vertexAttribI4iv(o,s);break;default:re(!1)}}},{key:"_setConstantUintArray",value:function(a,o,s){switch(re(ge(a)),s.length){case 1:a.vertexAttribI1uiv(o,s);break;case 2:a.vertexAttribI2uiv(o,s);break;case 3:a.vertexAttribI3uiv(o,s);break;case 4:a.vertexAttribI4uiv(o,s);break;default:re(!1)}}}]),n}(Xt,Symbol.toStringTag);F();j();var sW="VertexArray: attributes must be Buffers or constants (i.e. typed array)",uW=/^(.+)__LOCATION_([0-9]+)$/,lW=["setBuffers","setGeneric","clearBindings","setLocations","setGenericValues","setDivisor","enable","disable"],q0=function(){function t(r){A(this,t);var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.id||e.program&&e.program.id;this.id=n,this.gl=r,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={}
43,this.vertexArrayObject=new Kp(r),Np(this,"VertexArray","v6.0",lW),this.initialize(e),Object.seal(this)}return T(t,[{key:"delete",value:function(){this.buffer&&this.buffer.delete(),this.vertexArrayObject.delete()}},{key:"initialize",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this.reset(),this.configuration=null,this.bindOnUse=!1,this.setProps(e)}},{key:"reset",value:function(){this.elements=null,this.elementsAccessor=null;var e=this.vertexArrayObject.MAX_ATTRIBUTES;return this.values=new Array(e).fill(null),this.accessors=new Array(e).fill(null),this.unused={},this.drawParams=null,this}},{key:"setProps",value:function(e){return"program"in e&&(this.configuration=e.program&&e.program.configuration),"configuration"in e&&(this.configuration=e.configuration),"attributes"in e&&this.setAttributes(e.attributes),"elements"in e&&this.setElementBuffer(e.elements),"bindOnUse"in e&&(e=e.bindOnUse),this}},{key:"clearDrawParams",value:function(){this.drawParams=null}},{key:"getDrawParams",value:function(){return this.drawParams=this.drawParams||this._updateDrawParams(),this.drawParams}},{key:"setAttributes",value:function(e){var n=this;return Object.assign(this.attributes,e),this.vertexArrayObject.bind(function(){for(var i in e){var a=e[i];n._setAttribute(i,a)}n.gl.bindBuffer(34962,null)}),this}},{key:"setElementBuffer",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.elements=e,this.elementsAccessor=n,this.clearDrawParams(),this.vertexArrayObject.setElementBuffer(e,n),this}},{key:"setBuffer",value:function(e,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(n.target===34963)return this.setElementBuffer(n,i);var a=this._resolveLocationAndAccessor(e,n,n.accessor,i),o=a.location,s=a.accessor;return o>=0&&(this.values[o]=n,this.accessors[o]=s,this.clearDrawParams(),this.vertexArrayObject.setBuffer(o,n,s)),this}},{key:"setConstant",value:function(e,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=this._resolveLocationAndAccessor(e,n,Object.assign({size:n.length},i)),o=a.location,s=a.accessor;return o>=0&&(n=this.vertexArrayObject._normalizeConstantArrayValue(n),this.values[o]=n,this.accessors[o]=s,this.clearDrawParams(),this.vertexArrayObject.enable(o,!1)),this}},{key:"unbindBuffers",value:function(){var e=this;return this.vertexArrayObject.bind(function(){e.elements&&e.vertexArrayObject.setElementBuffer(null),e.buffer=e.buffer||new Pe(e.gl,{accessor:{size:4}});for(var n=0;n<e.vertexArrayObject.MAX_ATTRIBUTES;n++)e.values[n]instanceof Pe&&(e.gl.disableVertexAttribArray(n),e.gl.bindBuffer(34962,e.buffer.handle),e.gl.vertexAttribPointer(n,1,5126,!1,0,0))}),this}},{key:"bindBuffers",value:function(){var e=this;return this.vertexArrayObject.bind(function(){e.elements&&e.setElementBuffer(e.elements);for(var n=0;n<e.vertexArrayObject.MAX_ATTRIBUTES;n++){var i=e.values[n];i instanceof Pe&&e.setBuffer(n,i)}}),this}},{key:"bindForDraw",value:function(e,n,i){var a=this,o;return this.vertexArrayObject.bind(function(){a._setConstantAttributes(e,n),o=i()}),o}},{key:"_resolveLocationAndAccessor",value:function(e,n,i,a){var o=this,s={location:-1,accessor:null},u=this._getAttributeIndex(e),l=u.location,f=u.name;if(!Number.isFinite(l)||l<0)return this.unused[e]=n,fe.once(3,function(){return"unused value ".concat(e," in ").concat(o.id)})(),s;var p=this._getAttributeInfo(f||l);if(!p)return s;var h=this.accessors[l]||{},d=pr.resolve(p.accessor,h,i,a),v=d.size,m=d.type;return re(Number.isFinite(v)&&Number.isFinite(m)),{location:l,accessor:d}}},{key:"_getAttributeInfo",value:function(e){return this.configuration&&this.configuration.getAttributeInfo(e)}},{key:"_getAttributeIndex",value:function(e){var n=Number(e);if(Number.isFinite(n))return{location:n};var i=uW.exec(e),a=i?i[1]:e,o=i?Number(i[2]):0;return this.configuration?{location:this.configuration.getAttributeLocation(a)+o,name:a}:{location:-1}}},{key:"_setAttribute",value:function(e,n){if(n instanceof Pe)this.setBuffer(e,n);else if(Array.isArray(n)&&n.length&&n[0]instanceof Pe){var i=n[0],a=n[1];this.setBuffer(e,i,a)}else if(ArrayBuffer.isView(n)||Array.isArray(n)){var o=n;this.setConstant(e,o)}else if(n.buffer instanceof Pe){var s=n;this.setBuffer(e,s.buffer,s)}else throw new Error(sW)}},{key:"_setConstantAttributes",value:function(e,n){var i=Math.max(e|0,n|0),a=this.values[0];ArrayBuffer.isView(a)&&this._setConstantAttributeZero(a,i);for(var o=1;o<this.vertexArrayObject.MAX_ATTRIBUTES;o++)a=this.values[o],ArrayBuffer.isView(a)&&this._setConstantAttribute(o,a)}},{key:"_setConstantAttributeZero",value:function(e,n){if(Kp.isSupported(this.gl,{constantAttributeZero:!0})){this._setConstantAttribute(0,e);return}var i=this.vertexArrayObject.getConstantBuffer(n,e);
43this.vertexArrayObject.setBuffer(0,i,this.accessors[0])}},{key:"_setConstantAttribute",value:function(e,n){Kp.setConstant(this.gl,e,n)}},{key:"_updateDrawParams",value:function(){for(var e={isIndexed:!1,isInstanced:!1,indexCount:1/0,vertexCount:1/0,instanceCount:1/0},n=0;n<this.vertexArrayObject.MAX_ATTRIBUTES;n++)this._updateDrawParamsForLocation(e,n);return this.elements&&(e.elementCount=this.elements.getElementCount(this.elements.accessor),e.isIndexed=!0,e.indexType=this.elementsAccessor.type||this.elements.accessor.type,e.indexOffset=this.elementsAccessor.offset||0),e.indexCount===1/0&&(e.indexCount=0),e.vertexCount===1/0&&(e.vertexCount=0),e.instanceCount===1/0&&(e.instanceCount=0),e}},{key:"_updateDrawParamsForLocation",value:function(e,n){var i=this.values[n],a=this.accessors[n];if(i){var o=a.divisor,s=o>0;if(e.isInstanced=e.isInstanced||s,i instanceof Pe){var u=i;if(s){var l=u.getVertexCount(a);e.instanceCount=Math.min(e.instanceCount,l)}else{var f=u.getVertexCount(a);e.vertexCount=Math.min(e.vertexCount,f)}}}}},{key:"setElements",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return fe.deprecated("setElements","setElementBuffer")(),this.setElementBuffer(e,n)}}]),t}();k();function fW(t,r){for(var e=r.maxElts,n=e===void 0?16:e,i=r.size,a=i===void 0?1:i,o="[",s=0;s<t.length&&s<n;++s)s>0&&(o+=",".concat(s%a===0?" ":"")),o+=mo(t[s],r);var u=t.length>n?"...":"]";return"".concat(o).concat(u)}function mo(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=1e-16,n=r.isInteger,i=n===void 0?!1:n;if(Array.isArray(t)||ArrayBuffer.isView(t))return fW(t,r);if(!Number.isFinite(t))return String(t);if(Math.abs(t)<e)return i?"0":"0.";if(i||Math.abs(t)>100&&Math.abs(t)<1e4)return t.toFixed(0);var a=t.toPrecision(2),o=a.indexOf(".0");return o===a.length-2?a.slice(0,-1):a}function Y0(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=cW(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
44In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function cW(t,r){if(t){if(typeof t=="string")return OO(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return OO(t,r)}}function OO(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function Zp(t){var r=t.header,e=r===void 0?"Uniforms":r,n=t.program,i=t.uniforms,a=t.undefinedOnly,o=a===void 0?!1:a;re(n);var s=".*_.*",u=".*Matrix",l=n._uniformSetters,f={},p=Object.keys(l).sort(),h=0,d=Y0(p),v;try{for(d.s();!(v=d.n()).done;){var m=v.value;!m.match(s)&&!m.match(u)&&K0({table:f,header:e,uniforms:i,uniformName:m,undefinedOnly:o})&&h++}}catch(O){d.e(O)}finally{d.f()}var g=Y0(p),y;try{for(g.s();!(y=g.n()).done;){var _=y.value;_.match(u)&&K0({table:f,header:e,uniforms:i,uniformName:_,undefinedOnly:o})&&h++}}catch(O){g.e(O)}finally{g.f()}var b=Y0(p),x;try{for(b.s();!(x=b.n()).done;){var w=x.value;f[w]||K0({table:f,header:e,uniforms:i,uniformName:w,undefinedOnly:o})&&h++}}catch(O){b.e(O)}finally{b.f()}var P=0,E={};if(!o)for(var C in i){var I=i[C];f[C]||(P++,E[C]=c({Type:"NOT USED: ".concat(I)},e,mo(I)))}return{table:f,count:h,unusedTable:E,unusedCount:P}}function K0(t){var r=t.table,e=t.header,n=t.uniforms,i=t.uniformName,a=t.undefinedOnly,o=n[i],s=pW(o);if(!a||!s){var u;return r[i]=(u={},c(u,e,s?mo(o):"N/A"),c(u,"Uniform Type",s?o:"NOT PROVIDED"),u),!0}return!1}function pW(t){return t!=null}k();function Z0(t){var r=t.vertexArray,e=t.header,n=e===void 0?"Attributes":e;if(!r.configuration)return{};var i={};r.elements&&(i.ELEMENT_ARRAY_BUFFER=EO(r,r.elements,null,n));var a=r.values;for(var o in a){var s=r._getAttributeInfo(o);if(s){var u="".concat(o,": ").concat(s.name),l=r.accessors[s.location];l&&(u="".concat(o,": ").concat(hW(s.name,l))),i[u]=EO(r,a[o],l,n)}}return i}function EO(t,r,e,n){var i,a=t.gl;if(!r){var o;return o={},c(o,n,"null"),c(o,"Format ","N/A"),o}var s="NOT PROVIDED",u=1,l=0,f=0,p,h,d;if(e&&(s=e.type,u=e.size,s=String(s).replace("Array",""),p=s.indexOf("nt")!==-1),r instanceof Pe){var v,m=r,g=m.getDebugData(),y=g.data,_=g.changed;h=_?"*":"",d=y,f=m.byteLength,l=f/y.BYTES_PER_ELEMENT/u;var b;if(e){var x=e.divisor>0;b="".concat(x?"I ":"P "," ").concat(l," (x").concat(u,"=").concat(f," bytes ").concat(Xr(a,s),")")}else p=!0,b="".concat(f," bytes");return v={},c(v,n,"".concat(h).concat(mo(d,{size:u,isInteger:p}))),c(v,"Format ",b),v}return d=r,u=r.length,s=String(r.constructor.name).replace("Array",""),p=s.indexOf("nt")!==-1,i={},c(i,n,"".concat(mo(d,{size:u,isInteger:p})," (constant)")),c(i,"Format ","".concat(u,"x").concat(s," (constant)")),i}function hW(t,r){var e=r.type,n=r.size,i=Xp(e,n);return i?"".concat(t," (").concat(i.name,")"):t}k();function CO(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=dW(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}
44}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
45In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function dW(t,r){if(t){if(typeof t=="string")return MO(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return MO(t,r)}}function MO(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function J0(t){var r={},e="Accessors for ".concat(t.id),n=CO(t.attributeInfos),i;try{for(n.s();!(i=n.n()).done;){var a=i.value;if(a){var o=IO(a);r["in ".concat(o)]=c({},e,JSON.stringify(a.accessor))}}}catch(p){n.e(p)}finally{n.f()}var s=CO(t.varyingInfos),u;try{for(s.s();!(u=s.n()).done;){var l=u.value;if(l){var f=IO(l);r["out ".concat(f)]=c({},e,JSON.stringify(l.accessor))}}}catch(p){s.e(p)}finally{s.f()}return r}function IO(t){var r=t.accessor,e=r.type,n=r.size,i=Xp(e,n);return i?"".concat(i.name," ").concat(t.name):t.name}Ge();F();j();var Q0=me(Ae());var RO=jt()&&typeof document<"u",vW=0,Jp=function(){function t(){A(this,t);var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=r.onCreateContext,n=e===void 0?function(H){return ks(H)}:e,i=r.onAddHTML,a=i===void 0?null:i,o=r.onInitialize,s=o===void 0?function(){}:o,u=r.onRender,l=u===void 0?function(){}:u,f=r.onFinalize,p=f===void 0?function(){}:f,h=r.onError,d=r.gl,v=d===void 0?null:d,m=r.glOptions,g=m===void 0?{}:m,y=r.debug,_=y===void 0?!1:y,b=r.createFramebuffer,x=b===void 0?!1:b,w=r.autoResizeViewport,P=w===void 0?!0:w,E=r.autoResizeDrawingBuffer,C=E===void 0?!0:E,I=r.stats,O=I===void 0?$r.get("animation-loop-".concat(vW++)):I,D=r.useDevicePixels,N=D===void 0?!0:D;"useDevicePixelRatio"in r&&(fe.deprecated("useDevicePixelRatio","useDevicePixels")(),N=r.useDevicePixelRatio),this.props={onCreateContext:n,onAddHTML:a,onInitialize:s,onRender:l,onFinalize:p,onError:h,gl:v,glOptions:g,debug:_,createFramebuffer:x},this.gl=v,this.needsRedraw=null,this.timeline=null,this.stats=O,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:P,autoResizeDrawingBuffer:C,useDevicePixels:N}),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this._pageLoadPromise=null,this._onMousemove=this._onMousemove.bind(this),this._onMouseleave=this._onMouseleave.bind(this)}return T(t,[{key:"delete",value:function(){this.stop(),this._setDisplay(null)}},{key:"setNeedsRedraw",value:function(e){return re(typeof e=="string"),this.needsRedraw=this.needsRedraw||e,this}},{key:"setProps",value:function(e){return"autoResizeViewport"in e&&(this.autoResizeViewport=e.autoResizeViewport),"autoResizeDrawingBuffer"in e&&(this.autoResizeDrawingBuffer=e.autoResizeDrawingBuffer),"useDevicePixels"in e&&(this.useDevicePixels=e.useDevicePixels),this}},{key:"start",value:function(){var e=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(this._running)return this;this._running=!0;var i=this._getPageLoadPromise().then(function(){return!e._running||e._initialized?null:(e._createWebGLContext(n),e._createFramebuffer(),e._startEventHandling(),e._initializeCallbackData(),e._updateCallbackData(),e._resizeCanvasDrawingBuffer(),e._resizeViewport(),e._gpuTimeQuery=qp.isSupported(e.gl,["timers"])?new qp(e.gl):null,e._initialized=!0,e.onInitialize(e.animationProps))}).then(function(a){e._running&&(e._addCallbackData(a||{}),a!==!1&&e._startLoop())});return this.props.onError&&i.catch(this.props.onError),this}},{key:"redraw",value:function(){return this.isContextLost()?this:(this._beginTimers(),this._setupFrame(),this._updateCallbackData(),this._renderFrame(this.animationProps),this._clearNeedsRedraw(),this.offScreen&&this.gl.commit&&this.gl.commit(),this._resolveNextFrame&&(this._resolveNextFrame(this),this._nextFramePromise=null,this._resolveNextFrame=null),this._endTimers(),this)}},{key:"stop",value:function(){return this._running&&(this._finalizeCallbackData(),this._cancelAnimationFrame(this._animationFrameId),this._nextFramePromise=null,this._resolveNextFrame=null,this._animationFrameId=null,this._running=!1),this}},{key:"attachTimeline",value:function(e){return this.timeline=e,this.timeline}},{key:"detachTimeline",value:function(){this.timeline=null}},{key:"waitForRender",value:function(){var e=this;return this.setNeedsRedraw("waitForRender"),this._nextFramePromise||(this._nextFramePromise=new Promise(function(n){e._resolveNextFrame=n})),this._nextFramePromise}},{key:"toDataURL",value:function(){var r=Y(Q0.default.mark(function n(){return Q0.default.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return this.setNeedsRedraw("toDataURL"),a.next=3,this.waitForRender();case 3:return a.abrupt("return",this.gl.canvas.toDataURL());case 4:case"end":return a.stop()}},n,this)}));function e(){return r.apply(this,arguments)}return e}()},{key:"isContextLost",value:function(){return this.gl.isContextLost()}},{key:"onCreateContext",value:function(){var e;return(e=this.props).onCreateContext.apply(e,arguments)}},{key:"onInitialize",value:function(){var e;return(e=this.props).onInitialize.apply(e,arguments)}},{key:"onRender",value:function(){var e;return(e=this.props).onRender.apply(e,arguments)}},{key:"onFinalize",value:function(){var e;return(e=this.props).onFinalize.apply(e,arguments)}},{key:"getHTMLControlValue",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,i=document.getElementById(e);return i?Number(i.value):n}}
45,{key:"setViewParameters",value:function(){return fe.removed("AnimationLoop.setViewParameters","AnimationLoop.setProps")(),this}},{key:"_startLoop",value:function(){var e=this,n=function i(){e._running&&(e.redraw(),e._animationFrameId=e._requestAnimationFrame(i))};this._cancelAnimationFrame(this._animationFrameId),this._animationFrameId=this._requestAnimationFrame(n)}},{key:"_getPageLoadPromise",value:function(){return this._pageLoadPromise||(this._pageLoadPromise=RO?new Promise(function(e,n){if(RO&&document.readyState==="complete"){e(document);return}window.addEventListener("load",function(){e(document)})}):Promise.resolve({})),this._pageLoadPromise}},{key:"_setDisplay",value:function(e){this.display&&(this.display.delete(),this.display.animationLoop=null),e&&(e.animationLoop=this),this.display=e}},{key:"_cancelAnimationFrame",value:function(e){return this.display&&this.display.cancelAnimationFrame?this.display.cancelAnimationFrame(e):M0(e)}},{key:"_requestAnimationFrame",value:function(e){if(this._running)return this.display&&this.display.requestAnimationFrame?this.display.requestAnimationFrame(e):C0(e)}},{key:"_renderFrame",value:function(){if(this.display){var e;(e=this.display)._renderFrame.apply(e,arguments);return}this.onRender.apply(this,arguments)}},{key:"_clearNeedsRedraw",value:function(){this.needsRedraw=null}},{key:"_setupFrame",value:function(){this._resizeCanvasDrawingBuffer(),this._resizeViewport(),this._resizeFramebuffer()}},{key:"_initializeCallbackData",value:function(){this.animationProps={gl:this.gl,stop:this.stop,canvas:this.gl.canvas,framebuffer:this.framebuffer,useDevicePixels:this.useDevicePixels,needsRedraw:null,startTime:Date.now(),engineTime:0,tick:0,tock:0,time:0,_timeline:this.timeline,_loop:this,_animationLoop:this,_mousePosition:null}}},{key:"_updateCallbackData",value:function(){var e=this._getSizeAndAspect(),n=e.width,i=e.height,a=e.aspect;(n!==this.animationProps.width||i!==this.animationProps.height)&&this.setNeedsRedraw("drawing buffer resized"),a!==this.animationProps.aspect&&this.setNeedsRedraw("drawing buffer aspect changed"),this.animationProps.width=n,this.animationProps.height=i,this.animationProps.aspect=a,this.animationProps.needsRedraw=this.needsRedraw,this.animationProps.engineTime=Date.now()-this.animationProps.startTime,this.timeline&&this.timeline.update(this.animationProps.engineTime),this.animationProps.tick=Math.floor(this.animationProps.time/1e3*60),this.animationProps.tock++,this.animationProps.time=this.timeline?this.timeline.getTime():this.animationProps.engineTime,this.animationProps._offScreen=this.offScreen}},{key:"_finalizeCallbackData",value:function(){this.onFinalize(this.animationProps)}},{key:"_addCallbackData",value:function(e){ue(e)==="object"&&e!==null&&(this.animationProps=Object.assign({},this.animationProps,e))}},{key:"_createWebGLContext",value:function(e){if(this.offScreen=e.canvas&&typeof OffscreenCanvas<"u"&&e.canvas instanceof OffscreenCanvas,e=Object.assign({},e,this.props.glOptions),this.gl=this.props.gl?gi(this.props.gl,e):this.onCreateContext(e),!vi(this.gl))throw new Error("AnimationLoop.onCreateContext - illegal context returned");Bp(this.gl),this._createInfoDiv()}},{key:"_createInfoDiv",value:function(){if(this.gl.canvas&&this.props.onAddHTML){var e=document.createElement("div");document.body.appendChild(e),e.style.position="relative";var n=document.createElement("div");n.style.position="absolute",n.style.left="10px",n.style.bottom="10px",n.style.width="300px",n.style.background="white",e.appendChild(this.gl.canvas),e.appendChild(n);var i=this.props.onAddHTML(n);i&&(n.innerHTML=i)}}},{key:"_getSizeAndAspect",value:function(){var e=this.gl.drawingBufferWidth,n=this.gl.drawingBufferHeight,i=1,a=this.gl.canvas;return a&&a.clientHeight?i=a.clientWidth/a.clientHeight:e>0&&n>0&&(i=e/n),{width:e,height:n,aspect:i}}},{key:"_resizeViewport",value:function(){this.autoResizeViewport&&this.gl.viewport(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight)}},{key:"_resizeCanvasDrawingBuffer",value:function(){this.autoResizeDrawingBuffer&&E0(this.gl,{useDevicePixels:this.useDevicePixels})}},{key:"_createFramebuffer",value:function(){this.props.createFramebuffer&&(this.framebuffer=new Le(this.gl))}},{key:"_resizeFramebuffer",value:function(){this.framebuffer&&this.framebuffer.resize({width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight})}},{key:"_beginTimers",value:function(){this.frameRate.timeEnd(),this.frameRate.timeStart(),this._gpuTimeQuery&&this._gpuTimeQuery.isResultAvailable()&&!this._gpuTimeQuery.isTimerDisjoint(
45)&&this.stats.get("GPU Time").addTime(this._gpuTimeQuery.getTimerMilliseconds()),this._gpuTimeQuery&&this._gpuTimeQuery.beginTimeElapsedQuery(),this.cpuTime.timeStart()}},{key:"_endTimers",value:function(){this.cpuTime.timeEnd(),this._gpuTimeQuery&&this._gpuTimeQuery.end()}},{key:"_startEventHandling",value:function(){var e=this.gl.canvas;e&&(e.addEventListener("mousemove",this._onMousemove),e.addEventListener("mouseleave",this._onMouseleave))}},{key:"_onMousemove",value:function(e){this.animationProps._mousePosition=[e.offsetX,e.offsetY]}},{key:"_onMouseleave",value:function(e){this.animationProps._mousePosition=null}}]),t}();k();F();j();F();j();be();k();var go="vs",Tf="fs";F();j();function Rt(t,r){if(!t)throw new Error(r||"shadertools: assertion failed.")}Ge();var e_={number:{validate:function(r,e){return Number.isFinite(r)&&(!("max"in e)||r<=e.max)&&(!("min"in e)||r>=e.min)}},array:{validate:function(r,e){return Array.isArray(r)||ArrayBuffer.isView(r)}}};function kO(t){var r={};for(var e in t){var n=t[e],i=mW(n);r[e]=i}return r}function mW(t){var r=LO(t);return r==="object"?t?"type"in t?Object.assign({},t,e_[t.type]):"value"in t?(r=LO(t.value),Object.assign({type:r},t,e_[r])):{type:"object",value:t}:{type:"object",value:null}:Object.assign({type:r,value:t},e_[r])}function LO(t){return Array.isArray(t)||ArrayBuffer.isView(t)?"array":ue(t)}var gW="vs",yW="fs",Qp=function(){function t(r){A(this,t);var e=r.name,n=r.vs,i=r.fs,a=r.dependencies,o=a===void 0?[]:a,s=r.uniforms,u=r.getUniforms,l=r.deprecations,f=l===void 0?[]:l,p=r.defines,h=p===void 0?{}:p,d=r.inject,v=d===void 0?{}:d,m=r.vertexShader,g=r.fragmentShader;Rt(typeof e=="string"),this.name=e,this.vs=n||m,this.fs=i||g,this.getModuleUniforms=u,this.dependencies=o,this.deprecations=this._parseDeprecationDefinitions(f),this.defines=h,this.injections=_W(v),s&&(this.uniforms=kO(s))}return T(t,[{key:"getModuleSource",value:function(e){var n;switch(e){case gW:n=this.vs||"";break;case yW:n=this.fs||"";break;default:Rt(!1)}return"#define MODULE_".concat(this.name.toUpperCase().replace(/[^0-9a-z]/gi,"_"),`
46`).concat(n,"// END MODULE_").concat(this.name,`
47
48`)}},{key:"getUniforms",value:function(e,n){return this.getModuleUniforms?this.getModuleUniforms(e,n):this.uniforms?this._defaultGetUniforms(e):{}}},{key:"getDefines",value:function(){return this.defines}},{key:"checkDeprecations",value:function(e,n){this.deprecations.forEach(function(i){i.regex.test(e)&&(i.deprecated?n.deprecated(i.old,i.new)():n.removed(i.old,i.new)())})}},{key:"_parseDeprecationDefinitions",value:function(e){return e.forEach(function(n){switch(n.type){case"function":n.regex=new RegExp("\\b".concat(n.old,"\\("));break;default:n.regex=new RegExp("".concat(n.type," ").concat(n.old,";"))}}),e}},{key:"_defaultGetUniforms",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n={},i=this.uniforms;for(var a in i){var o=i[a];a in e&&!o.private?(o.validate&&Rt(o.validate(e[a],o),"".concat(this.name,": invalid ").concat(a)),n[a]=e[a]):n[a]=o.value}return n}}]),t}();function eh(t){if(!t.normalized&&(t.normalized=!0,t.uniforms&&!t.getUniforms)){var r=new Qp(t);t.getUniforms=r.getUniforms.bind(r)}return t}function _W(t){var r={vs:{},fs:{}};for(var e in t){var n=t[e],i=e.slice(0,2);typeof n=="string"&&(n={order:0,injection:n}),r[i][e]=n}return r}function BO(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=bW(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
49In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function bW(t,r){if(t){if(typeof t=="string")return FO(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return FO(t,r)}}function FO(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function DO(t){return xW(jO(t))}function xW(t){var r={},e={};return NO({modules:t,level:0,moduleMap:r,moduleDepth:e}),Object.keys(e).sort(function(n,i){return e[i]-e[n]}).map(function(n){return r[n]})}function NO(t){var r=t.modules,e=t.level,n=t.moduleMap,i=t.moduleDepth;if(e>=5)throw new Error("Possible loop in shader dependency graph");var a=BO(r),o;try{for(a.s();!(o=a.n()).done;){var s=o.value;n[s.name]=s,(i[s.name]===void 0||i[s.name]<e)&&(i[s.name]=e)}}catch(p){a.e(p)}finally{a.f()}var u=BO(r),l;try{for(u.s();!(l=u.n()).done;){var f=l.value;
49f.dependencies&&NO({modules:f.dependencies,level:e+1,moduleMap:n,moduleDepth:i})}}catch(p){u.e(p)}finally{u.f()}}function jO(t,r){return t.map(function(e){return e instanceof Qp||(Rt(typeof e!="string","Shader module use by name is deprecated. Import shader module '".concat(e,"' and use it directly.")),Rt(e.name,"shader module has no name"),e=new Qp(e),e.dependencies=jO(e.dependencies)),e})}function t_(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=typeof window<"u"?window.navigator||{}:{},e=t.userAgent||r.userAgent||"",n=e.indexOf("MSIE ")!==-1,i=e.indexOf("Trident/")!==-1;return n||i}var AW=7936,SW=7937,TW=7938,wW=35724,n_={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]},ca={};Object.keys(n_).forEach(function(t){ca[t]=t});function PW(t){return typeof WebGL2RenderingContext<"u"&&t instanceof WebGL2RenderingContext?!0:Boolean(t&&t._version===2)}function UO(t){var r=t.getExtension("WEBGL_debug_renderer_info"),e=t.getParameter(r&&r.UNMASKED_VENDOR_WEBGL||AW),n=t.getParameter(r&&r.UNMASKED_RENDERER_WEBGL||SW),i=OW(e,n),a={gpuVendor:i,vendor:e,renderer:n,version:t.getParameter(TW),shadingLanguageVersion:t.getParameter(wW)};return a}function OW(t,r){return t.match(/NVIDIA/i)||r.match(/NVIDIA/i)?"NVIDIA":t.match(/INTEL/i)||r.match(/INTEL/i)?"INTEL":t.match(/AMD/i)||r.match(/AMD/i)||t.match(/ATI/i)||r.match(/ATI/i)?"AMD":"UNKNOWN GPU"}var r_={};function i_(t,r){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=n_[r];if(Rt(n,r),!t_(e))return!0;if(r in r_)return r_[r];var i=n[0],a=e.behavior||"enable",o="#extension GL_".concat(i," : ").concat(a,`
50void main(void) {}`),s=t.createShader(35633);t.shaderSource(s,o),t.compileShader(s);var u=t.getShaderParameter(s,35713);return t.deleteShader(s),r_[r]=u,u}function EW(t,r){var e=n_[r];Rt(e,r);var n=PW(t)&&e[1]||e[0],i=typeof n=="string"?Boolean(t.getExtension(n)):n;return Rt(i===!1||i===!0),i}function wf(t,r){return r=Array.isArray(r)?r:[r],r.every(function(e){return EW(t,e)})}function GO(t){var r=UO(t);switch(r.gpuVendor.toLowerCase()){case"nvidia":return`#define NVIDIA_GPU
51// Nvidia optimizes away the calculation necessary for emulated fp64
52#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1
53`;case"intel":return`#define INTEL_GPU
54// Intel optimizes away the calculation necessary for emulated fp64
55#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1
56// Intel's built-in 'tan' function doesn't have acceptable precision
57#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1
58// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow
59#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1
60`;case"amd":return`#define AMD_GPU
61`;default:return`#define DEFAULT_GPU
62// Prevent driver from optimizing away the calculation necessary for emulated fp64
63#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1
64// Intel's built-in 'tan' function doesn't have acceptable precision
65#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1
66// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow
67#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1
68`}}function zO(t,r,e){var n=`#if (__VERSION__ > 120)
69
70# define FEATURE_GLSL_DERIVATIVES
71# define FEATURE_GLSL_DRAW_BUFFERS
72# define FEATURE_GLSL_FRAG_DEPTH
73# define FEATURE_GLSL_TEXTURE_LOD
74
75// DEPRECATED FLAGS, remove in v9
76# define FRAG_DEPTH
77# define DERIVATIVES
78# define DRAW_BUFFERS
79# define TEXTURE_LOD
80
81#endif // __VERSION
82`;return wf(t,ca.GLSL_FRAG_DEPTH)&&(n+=`
83// FRAG_DEPTH => gl_FragDepth is available
84#ifdef GL_EXT_frag_depth
85#extension GL_EXT_frag_depth : enable
86# define FEATURE_GLSL_FRAG_DEPTH
87# define FRAG_DEPTH
88# define gl_FragDepth gl_FragDepthEXT
89#endif
90`),wf(t,ca.GLSL_DERIVATIVES)&&i_(t,ca.GLSL_DERIVATIVES)&&(n+=`
91// DERIVATIVES => dxdF, dxdY and fwidth are available
92#ifdef GL_OES_standard_derivatives
93#extension GL_OES_standard_derivatives : enable
94# define FEATURE_GLSL_DERIVATIVES
95# define DERIVATIVES
96#endif
97`),wf(t,ca.GLSL_FRAG_DATA)&&i_(t,ca.GLSL_FRAG_DATA,{behavior:"require"})&&(n+=`
98// DRAW_BUFFERS => gl_FragData[] is available
99#ifdef GL_EXT_draw_buffers
100#extension GL_EXT_draw_buffers : require
101#define FEATURE_GLSL_DRAW_BUFFERS
102#define DRAW_BUFFERS
103#endif
104`),wf(t,ca.GLSL_TEXTURE_LOD)&&(n+=`// TEXTURE_LOD => texture2DLod etc are available
105#ifdef GL_EXT_shader_texture_lod
106#extension GL_EXT_shader_texture_lod : enable
107
108# define FEATURE_GLSL_TEXTURE_LOD
109# define TEXTURE_LOD
110
111#endif
112`),n}k();var VO=`#ifdef MODULE_LOGDEPTH
113  logdepth_adjustPosition(gl_Position);
114#endif
115`,HO=`#ifdef MODULE_MATERIAL
116  gl_FragColor = material_filterColor(gl_FragColor);
117#endif
118
119#ifdef MODULE_LIGHTING
120  gl_FragColor = lighting_filterColor(gl_FragColor);
121#endif
122
123#ifdef MODULE_FOG
124  gl_FragColor = fog_filterColor(gl_FragColor);
125#endif
126
127#ifdef MODULE_PICKING
128  gl_FragColor = picking_filterHighlightColor(gl_FragColor);
129  gl_FragColor = picking_filterPickingColor(gl_FragColor);
130#endif
131
132#ifdef MODULE_LOGDEPTH
133  logdepth_setFragDepth();
134#endif
135`;var th,CW=(th={},c(th,go,VO),c(th,Tf,HO),th),Pf="__LUMA_INJECT_DECLARATIONS__",WO=/void\s+main\s*\([^)]*\)\s*\{\n?/,$O=/}\n?[^{}]*$/,a_=[];function rh(t,r,e){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,i=r===go,a=function(u){var l=e[u];l.sort(function(d,v){return d.order-v.order}),a_.length=l.length;for(var f=0,p=l.length;f<p;++f)a_[f]=l[f].injection;var h="".concat(a_.join(`
136`),`
137`);switch(u){case"vs:#decl":i&&(t=t.replace(Pf,h));break;case"vs:#main-start":i&&(t=t.replace(WO,function(d){return d+h}));break;case"vs:#main-end":i&&(t=t.replace($O,function(d){return h+d}));break;case"fs:#decl":i||(t=t.replace(Pf,h));break;case"fs:#main-start":i||(t=t.replace(WO,function(d){return d+h}));break;case"fs:#main-end":i||(t=t.replace($O,function(d){return h+d}));break;default:t=t.replace(u,function(d){return d+h})}};for(var o in e)a(o);return t=t.replace(Pf,""),n&&(t=t.replace(/\}\s*$/,function(s){return s+CW[r]})),t}function Gs(t){var r={};return Rt(Array.isArray(t)&&t.length>1),t.forEach(function(e){for(var n in e)r[n]=r[n]?"".concat(r[n],`
138`).concat(e[n]):e[n]}),r}be();function MW(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=IW(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}
138}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
139In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function IW(t,r){if(t){if(typeof t=="string")return XO(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return XO(t,r)}}function XO(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function zs(t){return new RegExp("\\b".concat(t,"[ \\t]+(\\w+[ \\t]+\\w+(\\[\\w+\\])?;)"),"g")}var qO=[[/^(#version[ \t]+(100|300[ \t]+es))?[ \t]*\n/,`#version 300 es
140`],[/\btexture(2D|2DProj|Cube)Lod(EXT)?\(/g,"textureLod("],[/\btexture(2D|2DProj|Cube)(EXT)?\(/g,"texture("]],RW=[].concat(qO,[[zs("attribute"),"in $1"],[zs("varying"),"out $1"]]),LW=[].concat(qO,[[zs("varying"),"in $1"]]),YO=[[/^#version[ \t]+300[ \t]+es/,"#version 100"],[/\btexture(2D|2DProj|Cube)Lod\(/g,"texture$1LodEXT("],[/\btexture\(/g,"texture2D("],[/\btextureLod\(/g,"texture2DLodEXT("]],kW=[].concat(YO,[[zs("in"),"attribute $1"],[zs("out"),"varying $1"]]),BW=[].concat(YO,[[zs("in"),"varying $1"]]),o_="gl_FragColor",s_=/\bout[ \t]+vec4[ \t]+(\w+)[ \t]*;\n?/,FW=/void\s+main\s*\([^)]*\)\s*\{\n?/;function u_(t,r,e){switch(r){case 300:return e?nh(t,RW):DW(t);case 100:return e?nh(t,kW):NW(t);default:throw new Error("unknown GLSL version ".concat(r))}}function nh(t,r){var e=MW(r),n;try{for(e.s();!(n=e.n()).done;){var i=W(n.value,2),a=i[0],o=i[1];t=t.replace(a,o)}}catch(s){e.e(s)}finally{e.f()}return t}function DW(t){t=nh(t,LW);var r=t.match(s_);if(r){var e=r[1];t=t.replace(new RegExp("\\b".concat(o_,"\\b"),"g"),e)}else{var n="fragmentColor";t=t.replace(FW,function(i){return"out vec4 ".concat(n,`;
141`).concat(i)}).replace(new RegExp("\\b".concat(o_,"\\b"),"g"),n)}return t}function NW(t){t=nh(t,BW);var r=t.match(s_);if(r){var e=r[1];t=t.replace(s_,"").replace(new RegExp("\\b".concat(e,"\\b"),"g"),o_)}return t}var ih;function l_(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=jW(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
142In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function jW(t,r){if(t){if(typeof t=="string")return KO(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return KO(t,r)}}function KO(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var UW=`
143
144`.concat(Pf,`
145
146`),JO=(ih={},c(ih,go,"vertex"),c(ih,Tf,"fragment"),ih),GW=`precision highp float;
147
148`;function f_(t,r){var e=r.vs,n=r.fs,i=DO(r.modules||[]);return{gl:t,vs:ZO(t,Object.assign({},r,{source:e,type:go,modules:i})),fs:ZO(t,Object.assign({},r,{source:n,type:Tf,modules:i})),getUniforms:zW(i)}}function ZO(t,r){var e=r.id,n=r.source,i=r.type,a=r.modules,o=r.defines,s=o===void 0?{}:o,u=r.hookFunctions,l=u===void 0?[]:u,f=r.inject,p=f===void 0?{}:f,h=r.transpileToGLSL100,d=h===void 0?!1:h,v=r.prologue,m=v===void 0?!0:v,g=r.log;Rt(typeof n=="string","shader source must be a string");var y=i===go,_=n.split(`
149`),b=100,x="",w=n;_[0].indexOf("#version ")===0?(b=300,x=_[0],w=_.slice(1).join(`
150`)):x="#version ".concat(b);var P={};a.forEach(function(we){Object.assign(P,we.getDefines())}),Object.assign(P,s);var E=m?"".concat(x,`
151`).concat(HW({id:e,source:n,type:i}),`
152`).concat(VW({type:i}),`
153`).concat(GO(t),`
154`).concat(zO(t,b,!y),`
155`).concat(WW(P),`
156`).concat(y?"":GW,`
157`):"".concat(x,`
158`),C=XW(l),I={},O={},D={};for(var N in p){var H=typeof p[N]=="string"?{injection:p[N],order:0}:p[N],$=N.match(/^(v|f)s:(#)?([\w-]+)$/);if($){var ee=$[2],V=$[3];ee?V==="decl"?O[N]=[H]:D[N]=[H]:I[N]=[H]}else D[N]=[H]}var U=l_(a),X;try{for(U.s();!(X=U.n()).done;){var K=X.value;g&&K.checkDeprecations(w,g);var te=K.getModuleSource(i,b);E+=te;var ie=K.injections[i];
158for(var ce in ie){var Te=ce.match(/^(v|f)s:#([\w-]+)$/);if(Te){var Me=Te[2],Fe=Me==="decl"?O:D;Fe[ce]=Fe[ce]||[],Fe[ce].push(ie[ce])}else I[ce]=I[ce]||[],I[ce].push(ie[ce])}}}catch(we){U.e(we)}finally{U.f()}return E+=UW,E=rh(E,i,O),E+=$W(C[i],I),E+=w,E=rh(E,i,D),E=u_(E,d?100:b,y),E}function zW(t){return function(e){var n={},i=l_(t),a;try{for(i.s();!(a=i.n()).done;){var o=a.value,s=o.getUniforms(e,n);Object.assign(n,s)}}catch(u){i.e(u)}finally{i.f()}return n}}function VW(t){var r=t.type;return`
159#define SHADER_TYPE_`.concat(JO[r].toUpperCase(),`
160`)}function HW(t){var r=t.id,e=t.source,n=t.type,i=r&&typeof r=="string"&&e.indexOf("SHADER_NAME")===-1;return i?`
161#define SHADER_NAME `.concat(r,"_").concat(JO[n],`
162
163`):""}function WW(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=0,e="";for(var n in t){r===0&&(e+=`
164// APPLICATION DEFINES
165`),r++;var i=t[n];(i||Number.isFinite(i))&&(e+="#define ".concat(n.toUpperCase()," ").concat(t[n],`
166`))}return r===0&&(e+=`
167`),e}function $W(t,r){var e="";for(var n in t){var i=t[n];if(e+="void ".concat(i.signature,` {
168`),i.header&&(e+="  ".concat(i.header)),r[n]){var a=r[n];a.sort(function(l,f){return l.order-f.order});var o=l_(a),s;try{for(o.s();!(s=o.n()).done;){var u=s.value;e+="  ".concat(u.injection,`
169`)}}catch(l){o.e(l)}finally{o.f()}}i.footer&&(e+="  ".concat(i.footer)),e+=`}
170`}return e}function XW(t){var r={vs:{},fs:{}};return t.forEach(function(e){var n;typeof e!="string"?(n=e,e=n.hook):n={},e=e.trim();var i=e.split(":"),a=W(i,2),o=a[0],s=a[1],u=e.replace(/\(.+/,"");r[o][u]=Object.assign(n,{signature:s})}),r}be();var qW="void main() {gl_FragColor = vec4(0);}",QO=`out vec4 transform_output;
171void main() {
172  transform_output = vec4(0);
173}`,YW=`#version 300 es
174`.concat(QO);function ah(t,r){r=Array.isArray(r)?r:[r];var e=t.replace(/^\s+/,"").split(/\s+/),n=W(e,3),i=n[0],a=n[1],o=n[2];if(!r.includes(i)||!a||!o)return null;var s=o.split(";")[0];return{qualifier:i,type:a,name:s}}function Of(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=t.version,e=r===void 0?100:r,n=t.input,i=t.inputType,a=t.output;if(!n)return e===300?YW:e>300?"#version ".concat(e,`
175`).concat(QO):qW;var o=eE(n,i);return e>=300?"#version ".concat(e," ").concat(e===300?"es":"",`
176in `).concat(i," ").concat(n,`;
177out vec4 `).concat(a,`;
178void main() {
179  `).concat(a," = ").concat(o,`;
180}`):"varying ".concat(i," ").concat(n,`;
181void main() {
182  gl_FragColor = `).concat(o,`;
183}`)}function c_(t){switch(t){case"float":return"x";case"vec2":return"xy";case"vec3":return"xyz";case"vec4":return"xyzw";default:return Rt(!1),null}}function p_(t){switch(t){case"float":return 1;case"vec2":return 2;case"vec3":return 3;case"vec4":return 4;default:return Rt(!1),null}}function eE(t,r){switch(r){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 Rt(!1),null}}var KW=`#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND
184const float TWO_PI = 6.2831854820251465;
185const float PI_2 = 1.5707963705062866;
186const float PI_16 = 0.1963495463132858;
187
188const float SIN_TABLE_0 = 0.19509032368659973;
189const float SIN_TABLE_1 = 0.3826834261417389;
190const float SIN_TABLE_2 = 0.5555702447891235;
191const float SIN_TABLE_3 = 0.7071067690849304;
192
193const float COS_TABLE_0 = 0.9807852506637573;
194const float COS_TABLE_1 = 0.9238795042037964;
195const float COS_TABLE_2 = 0.8314695954322815;
196const float COS_TABLE_3 = 0.7071067690849304;
197
198const float INVERSE_FACTORIAL_3 = 1.666666716337204e-01;
199const float INVERSE_FACTORIAL_5 = 8.333333767950535e-03;
200const float INVERSE_FACTORIAL_7 = 1.9841270113829523e-04;
201const float INVERSE_FACTORIAL_9 = 2.75573188446287533e-06;
202
203float sin_taylor_fp32(float a) {
204  float r, s, t, x;
205
206  if (a == 0.0) {
207    return 0.0;
208  }
209
210  x = -a * a;
211  s = a;
212  r = a;
213
214  r = r * x;
215  t = r * INVERSE_FACTORIAL_3;
216  s = s + t;
217
218  r = r * x;
219  t = r * INVERSE_FACTORIAL_5;
220  s = s + t;
221
222  r = r * x;
223  t = r * INVERSE_FACTORIAL_7;
224  s = s + t;
225
226  r = r * x;
227  t = r * INVERSE_FACTORIAL_9;
228  s = s + t;
229
230  return s;
231}
232
233void sincos_taylor_fp32(float a, out float sin_t, out float cos_t) {
234  if (a == 0.0) {
235    sin_t = 0.0;
236    cos_t = 1.0;
237  }
238  sin_t = sin_taylor_fp32(a);
239  cos_t = sqrt(1.0 - sin_t * sin_t);
240}
241
242float tan_taylor_fp32(float a) {
243    float sin_a;
244    float cos_a;
245
246    if (a == 0.0) {
247        return 0.0;
248    }
249    float z = floor(a / TWO_PI);
250    float r = a - TWO_PI * z;
251
252    float t;
253    float q = floor(r / PI_2 + 0.5);
254    int j = int(q);
255
256    if (j < -2 || j > 2) {
257        return 1.0 / 0.0;
258    }
259
260    t = r - PI_2 * q;
261
262    q = floor(t / PI_16 + 0.5);
263    int k = int(q);
264    int abs_k = int(abs(float(k)));
265
266    if (abs_k > 4) {
267        return 1.0 / 0.0;
268    } else {
269        t = t - PI_16 * q;
270    }
271
272    float u = 0.0;
273    float v = 0.0;
274
275    float sin_t, cos_t;
276    float s, c;
277    sincos_taylor_fp32(t, sin_t, cos_t);
278
279    if (k == 0) {
280        s = sin_t;
281        c = cos_t;
282    } else {
283        if (abs(float(abs_k) - 1.0) < 0.5) {
284            u = COS_TABLE_0;
285            v = SIN_TABLE_0;
286        } else if (abs(float(abs_k) - 2.0) < 0.5) {
287            u = COS_TABLE_1;
288            v = SIN_TABLE_1;
289        } else if (abs(float(abs_k) - 3.0) < 0.5) {
290            u = COS_TABLE_2;
291            v = SIN_TABLE_2;
292        } else if (abs(float(abs_k) - 4.0) < 0.5) {
293            u = COS_TABLE_3;
294            v = SIN_TABLE_3;
295        }
296        if (k > 0) {
297            s = u * sin_t + v * cos_t;
298            c = u * cos_t - v * sin_t;
299        } else {
300            s = u * sin_t - v * cos_t;
301            c = u * cos_t + v * sin_t;
302        }
303    }
304
305    if (j == 0) {
306        sin_a = s;
307        cos_a = c;
308    } else if (j == 1) {
309        sin_a = c;
310        cos_a = -s;
311    } else if (j == -1) {
312        sin_a = -c;
313        cos_a = s;
314    } else {
315        sin_a = -s;
316        cos_a = -c;
317    }
318    return sin_a / cos_a;
319}
320#endif
321
322float tan_fp32(float a) {
323#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND
324  return tan_taylor_fp32(a);
325#else
326  return tan(a);
327#endif
328}
329`,oh={name:"fp32",vs:KW,fs:null};function sh(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=Math.fround(t),i=t-n;return r[e]=n,r[e+1]=i,r}function h_(t){return t-Math.fround(t)}function d_(t){for(var r=new Float32Array(32),e=0;e<4;++e)for(var n=0;n<4;++n){var i=e*4+n;sh(t[n*4+e],r,i*2)}return r}var tE=`uniform float ONE;
330vec2 split(float a) {
331  const float SPLIT = 4097.0;
332  float t = a * SPLIT;
333#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)
334  float a_hi = t * ONE - (t - a);
335  float a_lo = a * ONE - a_hi;
336#else
337  float a_hi = t - (t - a);
338  float a_lo = a - a_hi;
339#endif
340  return vec2(a_hi, a_lo);
341}
342vec2 split2(vec2 a) {
343  vec2 b = split(a.x);
344  b.y += a.y;
345  return b;
346}
347vec2 quickTwoSum(float a, float b) {
348#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)
349  float sum = (a + b) * ONE;
350  float err = b - (sum - a) * ONE;
351#else
352  float sum = a + b;
353  float err = b - (sum - a);
354#endif
355  return vec2(sum, err);
356}
357vec2 twoSum(float a, float b) {
358  float s = (a + b);
359#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)
360  float v = (s * ONE - a) * ONE;
361  float err = (a - (s - v) * ONE) * ONE * ONE * ONE + (b - v);
362#else
363  float v = s - a;
364  float err = (a - (s - v)) + (b - v);
365#endif
366  return vec2(s, err);
367}
368
369vec2 twoSub(float a, float b) {
370  float s = (a - b);
371#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)
372  float v = (s * ONE - a) * ONE;
373  float err = (a - (s - v) * ONE) * ONE * ONE * ONE - (b + v);
374#else
375  float v = s - a;
376  float err = (a - (s - v)) - (b + v);
377#endif
378  return vec2(s, err);
379}
380
381vec2 twoSqr(float a) {
382  float prod = a * a;
383  vec2 a_fp64 = split(a);
384#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)
385  float err = ((a_fp64.x * a_fp64.x - prod) * ONE + 2.0 * a_fp64.x *
386    a_fp64.y * ONE * ONE) + a_fp64.y * a_fp64.y * ONE * ONE * ONE;
387#else
388  float err = ((a_fp64.x * a_fp64.x - prod) + 2.0 * a_fp64.x * a_fp64.y) + a_fp64.y * a_fp64.y;
389#endif
390  return vec2(prod, err);
391}
392
393vec2 twoProd(float a, float b) {
394  float prod = a * b;
395  vec2 a_fp64 = split(a);
396  vec2 b_fp64 = split(b);
397  float err = ((a_fp64.x * b_fp64.x - prod) + a_fp64.x * b_fp64.y +
398    a_fp64.y * b_fp64.x) + a_fp64.y * b_fp64.y;
399  return vec2(prod, err);
400}
401
402vec2 sum_fp64(vec2 a, vec2 b) {
403  vec2 s, t;
404  s = twoSum(a.x, b.x);
405  t = twoSum(a.y, b.y);
406  s.y += t.x;
407  s = quickTwoSum(s.x, s.y);
408  s.y += t.y;
409  s = quickTwoSum(s.x, s.y);
410  return s;
411}
412
413vec2 sub_fp64(vec2 a, vec2 b) {
414  vec2 s, t;
415  s = twoSub(a.x, b.x);
416  t = twoSub(a.y, b.y);
417  s.y += t.x;
418  s = quickTwoSum(s.x, s.y);
419  s.y += t.y;
420  s = quickTwoSum(s.x, s.y);
421  return s;
422}
423
424vec2 mul_fp64(vec2 a, vec2 b) {
425  vec2 prod = twoProd(a.x, b.x);
426  prod.y += a.x * b.y;
427#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)
428  prod = split2(prod);
429#endif
430  prod = quickTwoSum(prod.x, prod.y);
431  prod.y += a.y * b.x;
432#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)
433  prod = split2(prod);
434#endif
435  prod = quickTwoSum(prod.x, prod.y);
436  return prod;
437}
438
439vec2 div_fp64(vec2 a, vec2 b) {
440  float xn = 1.0 / b.x;
441#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)
442  vec2 yn = mul_fp64(a, vec2(xn, 0));
443#else
444  vec2 yn = a * xn;
445#endif
446  float diff = (sub_fp64(a, mul_fp64(b, yn))).x;
447  vec2 prod = twoProd(xn, diff);
448  return sum_fp64(yn, prod);
449}
450
451vec2 sqrt_fp64(vec2 a) {
452  if (a.x == 0.0 && a.y == 0.0) return vec2(0.0, 0.0);
453  if (a.x < 0.0) return vec2(0.0 / 0.0, 0.0 / 0.0);
454
455  float x = 1.0 / sqrt(a.x);
456  float yn = a.x * x;
457#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)
458  vec2 yn_sqr = twoSqr(yn) * ONE;
459#else
460  vec2 yn_sqr = twoSqr(yn);
461#endif
462  float diff = sub_fp64(a, yn_sqr).x;
463  vec2 prod = twoProd(x * 0.5, diff);
464#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)
465  return sum_fp64(split(yn), prod);
466#else
467  return sum_fp64(vec2(yn, 0.0), prod);
468#endif
469}
470`;var rE=`const vec2 E_FP64 = vec2(2.7182817459106445e+00, 8.254840366817007e-08);
471const vec2 LOG2_FP64 = vec2(0.6931471824645996e+00, -1.9046542121259336e-09);
472const vec2 PI_FP64 = vec2(3.1415927410125732, -8.742278012618954e-8);
473const vec2 TWO_PI_FP64 = vec2(6.2831854820251465, -1.7484556025237907e-7);
474const vec2 PI_2_FP64 = vec2(1.5707963705062866, -4.371139006309477e-8);
475const vec2 PI_4_FP64 = vec2(0.7853981852531433, -2.1855695031547384e-8);
476const vec2 PI_16_FP64 = vec2(0.19634954631328583, -5.463923757886846e-9);
477const vec2 PI_16_2_FP64 = vec2(0.39269909262657166, -1.0927847515773692e-8);
478const vec2 PI_16_3_FP64 = vec2(0.5890486240386963, -1.4906100798128818e-9);
479const vec2 PI_180_FP64 = vec2(0.01745329238474369, 1.3519960498364902e-10);
480
481const vec2 SIN_TABLE_0_FP64 = vec2(0.19509032368659973, -1.6704714833615242e-9);
482const vec2 SIN_TABLE_1_FP64 = vec2(0.3826834261417389, 6.22335089017767e-9);
483const vec2 SIN_TABLE_2_FP64 = vec2(0.5555702447891235, -1.1769521357507529e-8);
484const vec2 SIN_TABLE_3_FP64 = vec2(0.7071067690849304, 1.2101617041793133e-8);
485
486const vec2 COS_TABLE_0_FP64 = vec2(0.9807852506637573, 2.9739473106360492e-8);
487const vec2 COS_TABLE_1_FP64 = vec2(0.9238795042037964, 2.8307490351764386e-8);
488const vec2 COS_TABLE_2_FP64 = vec2(0.8314695954322815, 1.6870263741530778e-8);
489const vec2 COS_TABLE_3_FP64 = vec2(0.7071067690849304, 1.2101617152815436e-8);
490
491const vec2 INVERSE_FACTORIAL_3_FP64 = vec2(1.666666716337204e-01, -4.967053879312289e-09);
492const vec2 INVERSE_FACTORIAL_4_FP64 = vec2(4.16666679084301e-02, -1.2417634698280722e-09);
493const vec2 INVERSE_FACTORIAL_5_FP64 = vec2(8.333333767950535e-03, -4.34617203337595e-10);
494const vec2 INVERSE_FACTORIAL_6_FP64 = vec2(1.3888889225199819e-03, -3.3631094437103215e-11);
495const vec2 INVERSE_FACTORIAL_7_FP64 = vec2(1.9841270113829523e-04,  -2.725596874933456e-12);
496const vec2 INVERSE_FACTORIAL_8_FP64 = vec2(2.4801587642286904e-05, -3.406996025904184e-13);
497const vec2 INVERSE_FACTORIAL_9_FP64 = vec2(2.75573188446287533e-06, 3.7935
497713937038186e-14);
498const vec2 INVERSE_FACTORIAL_10_FP64 = vec2(2.755731998149713e-07, -7.575112367869873e-15);
499
500float nint(float d) {
501    if (d == floor(d)) return d;
502    return floor(d + 0.5);
503}
504
505vec2 nint_fp64(vec2 a) {
506    float hi = nint(a.x);
507    float lo;
508    vec2 tmp;
509    if (hi == a.x) {
510        lo = nint(a.y);
511        tmp = quickTwoSum(hi, lo);
512    } else {
513        lo = 0.0;
514        if (abs(hi - a.x) == 0.5 && a.y < 0.0) {
515            hi -= 1.0;
516        }
517        tmp = vec2(hi, lo);
518    }
519    return tmp;
520}
521
522vec2 exp_fp64(vec2 a) {
523
524  const int k_power = 4;
525  const float k = 16.0;
526
527  const float inv_k = 1.0 / k;
528
529  if (a.x <= -88.0) return vec2(0.0, 0.0);
530  if (a.x >= 88.0) return vec2(1.0 / 0.0, 1.0 / 0.0);
531  if (a.x == 0.0 && a.y == 0.0) return vec2(1.0, 0.0);
532  if (a.x == 1.0 && a.y == 0.0) return E_FP64;
533
534  float m = floor(a.x / LOG2_FP64.x + 0.5);
535  vec2 r = sub_fp64(a, mul_fp64(LOG2_FP64, vec2(m, 0.0))) * inv_k;
536  vec2 s, t, p;
537
538  p = mul_fp64(r, r);
539  s = sum_fp64(r, p * 0.5);
540  p = mul_fp64(p, r);
541  t = mul_fp64(p, INVERSE_FACTORIAL_3_FP64);
542
543  s = sum_fp64(s, t);
544  p = mul_fp64(p, r);
545  t = mul_fp64(p, INVERSE_FACTORIAL_4_FP64);
546
547  s = sum_fp64(s, t);
548  p = mul_fp64(p, r);
549  t = mul_fp64(p, INVERSE_FACTORIAL_5_FP64);
550
551
552
553
554
555
556  s = sum_fp64(s, t);
557  for (int i = 0; i < k_power; i++) {
558    s = sum_fp64(s * 2.0, mul_fp64(s, s));
559  }
560
561#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)
562  s = sum_fp64(s, vec2(ONE, 0.0));
563#else
564  s = sum_fp64(s, vec2(1.0, 0.0));
565#endif
566
567  return s * pow(2.0, m);
568}
569
570vec2 log_fp64(vec2 a)
571{
572  if (a.x == 1.0 && a.y == 0.0) return vec2(0.0, 0.0);
573  if (a.x <= 0.0) return vec2(0.0 / 0.0, 0.0 / 0.0);
574  vec2 x = vec2(log(a.x), 0.0);
575  vec2 s;
576#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)
577  s = vec2(ONE, 0.0);
578#else
579  s = vec2(1.0, 0.0);
580#endif
581
582  x = sub_fp64(sum_fp64(x, mul_fp64(a, exp_fp64(-x))), s);
583  return x;
584}
585
586vec2 sin_taylor_fp64(vec2 a) {
587  vec2 r, s, t, x;
588
589  if (a.x == 0.0 && a.y == 0.0) {
590    return vec2(0.0, 0.0);
591  }
592
593  x = -mul_fp64(a, a);
594  s = a;
595  r = a;
596
597  r = mul_fp64(r, x);
598  t = mul_fp64(r, INVERSE_FACTORIAL_3_FP64);
599  s = sum_fp64(s, t);
600
601  r = mul_fp64(r, x);
602  t = mul_fp64(r, INVERSE_FACTORIAL_5_FP64);
603  s = sum_fp64(s, t);
604
605
606
607
608
609
610  return s;
611}
612
613vec2 cos_taylor_fp64(vec2 a) {
614  vec2 r, s, t, x;
615
616  if (a.x == 0.0 && a.y == 0.0) {
617    return vec2(1.0, 0.0);
618  }
619
620  x = -mul_fp64(a, a);
621  r = x;
622  s = sum_fp64(vec2(1.0, 0.0), r * 0.5);
623
624  r = mul_fp64(r, x);
625  t = mul_fp64(r, INVERSE_FACTORIAL_4_FP64);
626  s = sum_fp64(s, t);
627
628  r = mul_fp64(r, x);
629  t = mul_fp64(r, INVERSE_FACTORIAL_6_FP64);
630  s = sum_fp64(s, t);
631
632
633
634
635
636
637  return s;
638}
639
640void sincos_taylor_fp64(vec2 a, out vec2 sin_t, out vec2 cos_t) {
641  if (a.x == 0.0 && a.y == 0.0) {
642    sin_t = vec2(0.0, 0.0);
643    cos_t = vec2(1.0, 0.0);
644  }
645
646  sin_t = sin_taylor_fp64(a);
647  cos_t = sqrt_fp64(sub_fp64(vec2(1.0, 0.0), mul_fp64(sin_t, sin_t)));
648}
649
650vec2 sin_fp64(vec2 a) {
651    if (a.x == 0.0 && a.y == 0.0) {
652        return vec2(0.0, 0.0);
653    }
654    vec2 z = nint_fp64(div_fp64(a, TWO_PI_FP64));
655    vec2 r = sub_fp64(a, mul_fp64(TWO_PI_FP64, z));
656
657    vec2 t;
658    float q = floor(r.x / PI_2_FP64.x + 0.5);
659    int j = int(q);
660
661    if (j < -2 || j > 2) {
662        return vec2(0.0 / 0.0, 0.0 / 0.0);
663    }
664
665    t = sub_fp64(r, mul_fp64(PI_2_FP64, vec2(q, 0.0)));
666
667    q = floor(t.x / PI_16_FP64.x + 0.5);
668    int k = int(q);
669
670    if (k == 0) {
671        if (j == 0) {
672            return sin_taylor_fp64(t);
673        } else if (j == 1) {
674            return cos_taylor_fp64(t);
675        } else if (j == -1) {
676            return -cos_taylor_fp64(t);
677        } else {
678            return -sin_taylor_fp64(t);
679        }
680    }
681
682    int abs_k = int(abs(float(k)));
683
684    if (abs_k > 4) {
685        return vec2(0.0 / 0.0, 0.0 / 0.0);
686    } else {
687        t = sub_fp64(t, mul_fp64(PI_16_FP64, vec2(q, 0.0)));
688    }
689
690    vec2 u = vec2(0.0, 0.0);
691    vec2 v = vec2(0.0, 0.0);
692
693#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)
694    if (abs(float(abs_k) - 1.0) < 0.5) {
695        u = COS_TABLE_0_FP64;
696        v = SIN_TABLE_0_FP64;
697    } else if (abs(float(abs_k) - 2.0) < 0.5) {
698        u = COS_TABLE_1_FP64;
699        v = SIN_TABLE_1_FP64;
700    } else if (abs(float(abs_k) - 3.0) < 0.5) {
701        u = COS_TABLE_2_FP64;
702        v = SIN_TABLE_2_FP64;
703    } else if (abs(float(abs_k) - 4.0) < 0.5) {
704        u = COS_TABLE_3_FP64;
705        v = SIN_TABLE_3_FP64;
706    }
707#else
708    if (abs_k == 1) {
709        u = COS_TABLE_0_FP64;
710        v = SIN_TABLE_0_FP64;
711    } else if (abs_k == 2) {
712        u = COS_TABLE_1_FP64;
713        v = SIN_TABLE_1_FP64;
714    } else if (abs_k == 3) {
715        u = COS_TABLE_2_FP64;
716        v = SIN_TABLE_2_FP64;
717    } else if (abs_k == 4) {
718        u = COS_TABLE_3_FP64;
719        v = SIN_TABLE_3_FP64;
720    }
721#endif
722
723    vec2 sin_t, cos_t;
724    sincos_taylor_fp64(t, sin_t, cos_t);
725
726
727
728    vec2 result = vec2(0.0, 0.0);
729    if (j == 0) {
730        if (k > 0) {
731            result = sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));
732        } else {
733            result = sub_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));
734        }
735    } else if (j == 1) {
736        if (k > 0) {
737            result = sub_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));
738        } else {
739            result = sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));
740        }
741    } else if (j == -1) {
742        if (k > 0) {
743            result = sub_fp64(mul_fp64(v, sin_t), mul_fp64(u, cos_t));
744        } else {
745            result = -sum_fp64(mul_fp64(v, sin_t), mul_fp64(u, cos_t));
746        }
747    } else {
748        if (k > 0) {
749            result = -sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));
750        } else {
751            result = sub_fp64(mul_fp64(v, cos_t), mul_fp64(u, sin_t));
752        }
753    }
754
755    return result;
756}
757
758vec2 cos_fp64(vec2 a) {
759    if (a.x == 0.0 && a.y == 0.0) {
760        return vec2(1.0, 0.0);
761    }
762    vec2 z = nint_fp64(div_fp64(a, TWO_PI_FP64));
763    vec2 r = sub_fp64(a, mul_fp64(TWO_PI_FP64, z));
764
765    vec2 t;
766    float q = floor(r.x / PI_2_FP64.x + 0.5);
767    int j = int(q);
768
769    if (j < -2 || j > 2) {
770        return vec2(0.0 / 0.0, 0.0 / 0.0);
771    }
772
773    t = sub_fp64(r, mul_fp64(PI_2_FP64, vec2(q, 0.0)));
774
775    q = floor(t.x / PI_16_FP64.x + 0.5);
776    int k = int(q);
777
778    if (k == 0) {
779        if (j == 0) {
780            return cos_taylor_fp64(t);
781        } else if (j == 1) {
782            return -sin_taylor_fp64(t);
783        } else if (j == -1) {
784            return sin_taylor_fp64(t);
785        } else {
786            return -cos_taylor_fp64(t);
787        }
788    }
789
790    int abs_k = int(abs(float(k)));
791
792    if (abs_k > 4) {
793        return vec2(0.0 / 0.0, 0.0 / 0.0);
794    } else {
795        t = sub_fp64(t, mul_fp64(PI_16_FP64, vec2(q, 0.0)));
796    }
797
798    vec2 u = vec2(0.0, 0.0);
799    vec2 v = vec2(0.0, 0.0);
800
801#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)
802    if (abs(float(abs_k) - 1.0) < 0.5) {
803        u = COS_TABLE_0_FP64;
804        v = SIN_TABLE_0_FP64;
805    } else if (abs(float(abs_k) - 2.0) < 0.5) {
806        u = COS_TABLE_1_FP64;
807        v = SIN_TABLE_1_FP64;
808    } else if (abs(float(abs_k) - 3.0) < 0.5) {
809        u = COS_TABLE_2_FP64;
810        v = SIN_TABLE_2_FP64;
811    } else if (abs(float(abs_k) - 4.0) < 0.5) {
812        u = COS_TABLE_3_FP64;
813        v = SIN_TABLE_3_FP64;
814    }
815#else
816    if (abs_k == 1) {
817        u = COS_TABLE_0_FP64;
818        v = SIN_TABLE_0_FP64;
819    } else if (abs_k == 2) {
820        u = COS_TABLE_1_FP64;
821        v = SIN_TABLE_1_FP64;
822    } else if (abs_k == 3) {
823        u = COS_TABLE_2_FP64;
824        v = SIN_TABLE_2_FP64;
825    } else if (abs_k == 4) {
826        u = COS_TABLE_3_FP64;
827        v = SIN_TABLE_3_FP64;
828    }
829#endif
830
831    vec2 sin_t, cos_t;
832    sincos_taylor_fp64(t, sin_t, cos_t);
833
834    vec2 result = vec2(0.0, 0.0);
835    if (j == 0) {
836        if (k > 0) {
837            result = sub_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));
838        } else {
839            result = sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));
840        }
841    } else if (j == 1) {
842        if (k > 0) {
843            result = -sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));
844        } else {
845            result = sub_fp64(mul_fp64(v, cos_t), mul_fp64(u, sin_t));
846        }
847    } else if (j == -1) {
848        if (k > 0) {
849            result = sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));
850        } else {
851            result = sub_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));
852        }
853    } else {
854        if (k > 0) {
855            result = sub_fp64(mul_fp64(v, sin_t), mul_fp64(u, cos_t));
856        } else {
857            result = -sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));
858        }
859    }
860
861    return result;
862}
863
864vec2 tan_fp64(vec2 a) {
865    vec2 sin_a;
866    vec2 cos_a;
867
868    if (a.x == 0.0 && a.y == 0.0) {
869        return vec2(0.0, 0.0);
870    }
871    vec2 z = nint_fp64(div_fp64(a, TWO_PI_FP64));
872    vec2 r = sub_fp64(a, mul_fp64(TWO_PI_FP64, z));
873
874    vec2 t;
875    float q = floor(r.x / PI_2_FP64.x + 0.5);
876    int j = int(q);
877
878
879    if (j < -2 || j > 2) {
880        return vec2(0.0 / 0.0, 0.0 / 0.0);
881    }
882
883    t = sub_fp64(r, mul_fp64(PI_2_FP64, vec2(q, 0.0)));
884
885    q = floor(t.x / PI_16_FP64.x + 0.5);
886    int k = int(q);
887    int abs_k = int(abs(float(k)));
888
889    if (abs_k > 4) {
890        return vec2(0.0 / 0.0, 0.0 / 0.0);
891    } else {
892        t = sub_fp64(t, mul_fp64(PI_16_FP64, vec2(q, 0.0)));
893    }
894
895
896    vec2 u = vec2(0.0, 0.0);
897    vec2 v = vec2(0.0, 0.0);
898
899    vec2 sin_t, cos_t;
900    vec2 s, c;
901    sincos_taylor_fp64(t, sin_t, cos_t);
902
903    if (k == 0) {
904        s = sin_t;
905        c = cos_t;
906    } else {
907#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)
908        if (abs(float(abs_k) - 1.0) < 0.5) {
909            u = COS_TABLE_0_FP64;
910            v = SIN_TABLE_0_FP64;
911        } else if (abs(float(abs_k) - 2.0) < 0.5) {
912            u = COS_TABLE_1_FP64;
913            v = SIN_TABLE_1_FP64;
914        } else if (abs(float(abs_k) - 3.0) < 0.5) {
915            u = COS_TABLE_2_FP64;
916            v = SIN_TABLE_2_FP64;
917        } else if (abs(float(abs_k) - 4.0) < 0.5) {
918            u = COS_TABLE_3_FP64;
919            v = SIN_TABLE_3_FP64;
920        }
921#else
922        if (abs_k == 1) {
923            u = COS_TABLE_0_FP64;
924            v = SIN_TABLE_0_FP64;
925        } else if (abs_k == 2) {
926            u = COS_TABLE_1_FP64;
927            v = SIN_TABLE_1_FP64;
928        } else if (abs_k == 3) {
929            u = COS_TABLE_2_FP64;
930            v = SIN_TABLE_2_FP64;
931        } else if (abs_k == 4) {
932            u = COS_TABLE_3_FP64;
933            v = SIN_TABLE_3_FP64;
934        }
935#endif
936        if (k > 0) {
937            s = sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));
938            c = sub_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));
939        } else {
940            s = sub_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));
941            c = sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));
942        }
943    }
944
945    if (j == 0) {
946        sin_a = s;
947        cos_a = c;
948    } else if (j == 1) {
949        sin_a = c;
950        cos_a = -s;
951    } else if (j == -1) {
952        sin_a = -c;
953        cos_a = s;
954    } else {
955        sin_a = -s;
956        cos_a = -c;
957    }
958    return div_fp64(sin_a, cos_a);
959}
960
961vec2 radians_fp64(vec2 degree) {
962  return mul_fp64(degree, PI_180_FP64);
963}
964
965vec2 mix_fp64(vec2 a, vec2 b, float x) {
966  vec2 range = sub_fp64(b, a);
967  return sum_fp64(a, mul_fp64(range, vec2(x, 0.0)));
968}
969
970void vec2_sum_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {
971    out_val[0] = sum_fp64(a[0], b[0]);
972    out_val[1] = sum_fp64(a[1], b[1]);
973}
974
975void vec2_sub_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {
976    out_val[0] = sub_fp64(a[0], b[0]);
977    out_val[1] = sub_fp64(a[1], b[1]);
978}
979
980void vec2_mul_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {
981    out_val[0] = mul_fp64(a[0], b[0]);
982    out_val[1] = mul_fp64(a[1], b[1]);
983}
984
985void vec2_div_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {
986    out_val[0] = div_fp64(a[0], b[0]);
987    out_val[1] = div_fp64(a[1], b[1]);
988}
989
990void vec2_mix_fp64(vec2 x[2], vec2 y[2], float a, out vec2 out_val[2]) {
991  vec2 range[2];
992  vec2_sub_fp64(y, x, range);
993  vec2 portion[2];
994  portion[0] = range[0] * a;
995  portion[1] = range[1] * a;
996  vec2_sum_fp64(x, portion, out_val);
997}
998
999vec2 vec2_length_fp64(vec2 x[2]) {
1000  return sqrt_fp64(sum_fp64(mul_fp64(x[0], x[0]), mul_fp64(x[1], x[1])));
1001}
1002
1003void vec2_normalize_fp64(vec2 x[2], out vec2 out_val[2]) {
1004  vec2 length = vec2_length_fp64(x);
1005  vec2 length_vec2[2];
1006  length_vec2[0] = length;
1007  length_vec2[1] = length;
1008
1009  vec2_div_fp64(x, length_vec2, out_val);
1010}
1011
1012vec2 vec2_distance_fp64(vec2 x[2], vec2 y[2]) {
1013  vec2 diff[2];
1014  vec2_sub_fp64(x, y, diff);
1015  return vec2_length_fp64(diff);
1016}
1017
1018vec2 vec2_dot_fp64(vec2 a[2], vec2 b[2]) {
1019  vec2 v[2];
1020
1021  v[0] = mul_fp64(a[0], b[0]);
1022  v[1] = mul_fp64(a[1], b[1]);
1023
1024  return sum_fp64(v[0], v[1]);
1025}
1026void vec3_sub_fp64(vec2 a[3], vec2 b[3], out vec2 out_val[3]) {
1027  for (int i = 0; i < 3; i++) {
1028    out_val[i] = sum_fp64(a[i], b[i]);
1029  }
1030}
1031
1032void vec3_sum_fp64(vec2 a[3], vec2 b[3], out vec2 out_val[3]) {
1033  for (int i = 0; i < 3; i++) {
1034    out_val[i] = sum_fp64(a[i], b[i]);
1035  }
1036}
1037
1038vec2 vec3_length_fp64(vec2 x[3]) {
1039  return sqrt_fp64(sum_fp64(sum_fp64(mul_fp64(x[0], x[0]), mul_fp64(x[1], x[1])),
1040    mul_fp64(x[2], x[2])));
1041}
1042
1043vec2 vec3_distance_fp64(vec2 x[3], vec2 y[3]) {
1044  vec2 diff[3];
1045  vec3_sub_fp64(x, y, diff);
1046  return vec3_length_fp64(diff);
1047}
1048void vec4_fp64(vec4 a, out vec2 out_val[4]) {
1049  out_val[0].x = a[0];
1050  out_val[0].y = 0.0;
1051
1052  out_val[1].x = a[1];
1053  out_val[1].y = 0.0;
1054
1055  out_val[2].x = a[2];
1056  out_val[2].y = 0.0;
1057
1058  out_val[3].x = a[3];
1059  out_val[3].y = 0.0;
1060}
1061
1062void vec4_scalar_mul_fp64(vec2 a[4], vec2 b, out vec2 out_val[4]) {
1063  out_val[0] = mul_fp64(a[0], b);
1064  out_val[1] = mul_fp64(a[1], b);
1065  out_val[2] = mul_fp64(a[2], b);
1066  out_val[3] = mul_fp64(a[3], b);
1067}
1068
1069void vec4_sum_fp64(vec2 a[4], vec2 b[4], out vec2 out_val[4]) {
1070  for (int i = 0; i < 4; i++) {
1071    out_val[i] = sum_fp64(a[i], b[i]);
1072  }
1073}
1074
1075void vec4_dot_fp64(vec2 a[4], vec2 b[4], out vec2 out_val) {
1076  vec2 v[4];
1077
1078  v[0] = mul_fp64(a[0], b[0]);
1079  v[1] = mul_fp64(a[1], b[1]);
1080  v[2] = mul_fp64(a[2], b[2]);
1081  v[3] = mul_fp64(a[3], b[3]);
1082
1083  out_val = sum_fp64(sum_fp64(v[0], v[1]), sum_fp64(v[2], v[3]));
1084}
1085
1086void mat4_vec4_mul_fp64(vec2 b[16], vec2 a[4], out vec2 out_val[4]) {
1087  vec2 tmp[4];
1088
1089  for (int i = 0; i < 4; i++)
1090  {
1091    for (int j = 0; j < 4; j++)
1092    {
1093      tmp[j] = b[j + i * 4];
1094    }
1095    vec4_dot_fp64(a, tmp, out_val[i]);
1096  }
1097}
1098`;var ZW={ONE:1};function JW(){return ZW}var yo={name:"fp64-arithmetic",vs:tE,fs:null,getUniforms:JW,fp64ify:sh,fp64LowPart:h_,fp64ifyMatrix4:d_},Vs={name:"fp64",vs:rE,fs:null,dependencies:[yo],fp64ify:sh,fp64LowPart:h_,fp64ifyMatrix4:d_};F();j();F();j();F();j();Ge();function Xe(t,r){if(!t)throw new Error("math.gl assertion ".concat(r))}var QW=1/Math.PI*180,e7=1/180*Math.PI,it={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0};function Ef(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=r.precision,n=e===void 0?it.precision:e;return t=t7(t),"".concat(parseFloat(t.toPrecision(n)))}function vr(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function v_(t){return _o(t)}function m_(t){return Yt(t)}function _o(t,r){return g_(t,function(e){return e*e7},r)}function Yt(t,r){return g_(t,function(e){return e*QW},r)}function We(t,r,e){return g_(t,function(n){return Math.max(r,Math.min(e,n))})}function Gt(t,r,e){return vr(t)?t.map(function(n,i){return Gt(n,r[i],e)}):e*r+(1-e)*t}function Ze(t,r,e){var n=it.EPSILON;e&&(it.EPSILON=e);try{if(t===r)return!0;
1098if(vr(t)&&vr(r)){if(t.length!==r.length)return!1;for(var i=0;i<t.length;++i)if(!Ze(t[i],r[i]))return!1;return!0}return t&&t.equals?t.equals(r):r&&r.equals?r.equals(t):typeof t=="number"&&typeof r=="number"?Math.abs(t-r)<=it.EPSILON*Math.max(1,Math.abs(t),Math.abs(r)):!1}finally{it.EPSILON=n}}function t7(t){return Math.round(t/it.EPSILON)*it.EPSILON}function r7(t){return t.clone?t.clone():new Array(t.length)}function g_(t,r,e){if(vr(t)){var n=t;e=e||r7(n);for(var i=0;i<e.length&&i<n.length;++i)e[i]=r(t[i],i,e);return e}return r(t)}function n7(t){var r=i7();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function i7(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function a7(t){function r(){var e=Reflect.construct(t,Array.from(arguments));return Object.setPrototypeOf(e,Object.getPrototypeOf(this)),e}return r.prototype=Object.create(t.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(r,t):r.__proto__=t,r}var Hs=function(t){L(e,t);var r=n7(e);function e(){return A(this,e),r.apply(this,arguments)}return T(e,[{key:"clone",value:function(){return new this.constructor().copy(this)}},{key:"fromArray",value:function(i){for(var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=0;o<this.ELEMENTS;++o)this[o]=i[o+a];return this.check()}},{key:"toArray",value:function(){for(var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=0;o<this.ELEMENTS;++o)i[a+o]=this[o];return i}},{key:"from",value:function(i){return Array.isArray(i)?this.copy(i):this.fromObject(i)}},{key:"to",value:function(i){return i===this?this:vr(i)?this.toArray(i):this.toObject(i)}},{key:"toTarget",value:function(i){return i?this.to(i):this}},{key:"toFloat32Array",value:function(){return new Float32Array(this)}},{key:"toString",value:function(){return this.formatString(it)}},{key:"formatString",value:function(i){for(var a="",o=0;o<this.ELEMENTS;++o)a+=(o>0?", ":"")+Ef(this[o],i);return"".concat(i.printTypes?this.constructor.name:"","[").concat(a,"]")}},{key:"equals",value:function(i){if(!i||this.length!==i.length)return!1;for(var a=0;a<this.ELEMENTS;++a)if(!Ze(this[a],i[a]))return!1;return!0}},{key:"exactEquals",value:function(i){if(!i||this.length!==i.length)return!1;for(var a=0;a<this.ELEMENTS;++a)if(this[a]!==i[a])return!1;return!0}},{key:"negate",value:function(){for(var i=0;i<this.ELEMENTS;++i)this[i]=-this[i];return this.check()}},{key:"lerp",value:function(i,a,o){if(o===void 0)return this.lerp(this,i,a);for(var s=0;s<this.ELEMENTS;++s){var u=i[s];this[s]=u+o*(a[s]-u)}return this.check()}},{key:"min",value:function(i){for(var a=0;a<this.ELEMENTS;++a)this[a]=Math.min(i[a],this[a]);return this.check()}},{key:"max",value:function(i){for(var a=0;a<this.ELEMENTS;++a)this[a]=Math.max(i[a],this[a]);return this.check()}},{key:"clamp",value:function(i,a){for(var o=0;o<this.ELEMENTS;++o)this[o]=Math.min(Math.max(this[o],i[o]),a[o]);return this.check()}},{key:"add",value:function(){for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];for(var s=0,u=a;s<u.length;s++)for(var l=u[s],f=0;f<this.ELEMENTS;++f)this[f]+=l[f];return this.check()}},{key:"subtract",value:function(){for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];for(var s=0,u=a;s<u.length;s++)for(var l=u[s],f=0;f<this.ELEMENTS;++f)this[f]-=l[f];return this.check()}},{key:"scale",value:function(i){if(typeof i=="number")for(var a=0;a<this.ELEMENTS;++a)this[a]*=i;else for(var o=0;o<this.ELEMENTS&&o<i.length;++o)this[o]*=i[o];return this.check()}},{key:"multiplyByScalar",value:function(i){for(var a=0;a<this.ELEMENTS;++a)this[a]*=i;return this.check()}},{key:"check",value:function(){if(it.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invali
1098d numbers'"));return this}},{key:"validate",value:function(){for(var i=this.length===this.ELEMENTS,a=0;a<this.ELEMENTS;++a)i=i&&Number.isFinite(this[a]);return i}},{key:"sub",value:function(i){return this.subtract(i)}},{key:"setScalar",value:function(i){for(var a=0;a<this.ELEMENTS;++a)this[a]=i;return this.check()}},{key:"addScalar",value:function(i){for(var a=0;a<this.ELEMENTS;++a)this[a]+=i;return this.check()}},{key:"subScalar",value:function(i){return this.addScalar(-i)}},{key:"multiplyScalar",value:function(i){for(var a=0;a<this.ELEMENTS;++a)this[a]*=i;return this.check()}},{key:"divideScalar",value:function(i){return this.multiplyByScalar(1/i)}},{key:"clampScalar",value:function(i,a){for(var o=0;o<this.ELEMENTS;++o)this[o]=Math.min(Math.max(this[o],i),a);return this.check()}},{key:"elements",get:function(){return this}}]),e}(a7(Array));function o7(t,r){if(t.length!==r)return!1;for(var e=0;e<t.length;++e)if(!Number.isFinite(t[e]))return!1;return!0}function Ve(t){if(!Number.isFinite(t))throw new Error("Invalid number ".concat(t));return t}function pa(t,r){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";if(it.debug&&!o7(t,r))throw new Error("math.gl: ".concat(e," some fields set to invalid numbers'"));return t}function s7(t){var r=u7();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function u7(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Ws=function(t){L(e,t);var r=s7(e);function e(){return A(this,e),r.apply(this,arguments)}return T(e,[{key:"x",get:function(){return this[0]},set:function(i){this[0]=Ve(i)}},{key:"y",get:function(){return this[1]},set:function(i){this[1]=Ve(i)}},{key:"len",value:function(){return Math.sqrt(this.lengthSquared())}},{key:"magnitude",value:function(){return this.len()}},{key:"lengthSquared",value:function(){for(var i=0,a=0;a<this.ELEMENTS;++a)i+=this[a]*this[a];return i}},{key:"magnitudeSquared",value:function(){return this.lengthSquared()}},{key:"distance",value:function(i){return Math.sqrt(this.distanceSquared(i))}},{key:"distanceSquared",value:function(i){for(var a=0,o=0;o<this.ELEMENTS;++o){var s=this[o]-i[o];a+=s*s}return Ve(a)}},{key:"dot",value:function(i){for(var a=0,o=0;o<this.ELEMENTS;++o)a+=this[o]*i[o];return Ve(a)}},{key:"normalize",value:function(){var i=this.magnitude();if(i!==0)for(var a=0;a<this.ELEMENTS;++a)this[a]/=i;return this.check()}},{key:"multiply",value:function(){for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];for(var s=0,u=a;s<u.length;s++)for(var l=u[s],f=0;f<this.ELEMENTS;++f)this[f]*=l[f];return this.check()}},{key:"divide",value:function(){for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];for(var s=0,u=a;s<u.length;s++)for(var l=u[s],f=0;f<this.ELEMENTS;++f)this[f]/=l[f];return this.check()}},{key:"lengthSq",value:function(){return this.lengthSquared()}},{key:"distanceTo",value:function(i){return this.distance(i)}},{key:"distanceToSquared",value:function(i){return this.distanceSquared(i)}},{key:"getComponent",value:function(i){return Xe(i>=0&&i<this.ELEMENTS,"index is out of range"),Ve(this[i])}},{key:"setComponent",value:function(i,a){return Xe(i>=0&&i<this.ELEMENTS,"index is out of range"),this[i]=a,this.check()}},{key:"addVectors",value:function(i,a){return this.copy(i).add(a)}},{key:"subVectors",value:function(i,a){return this.copy(i).subtract(a)}},{key:"multiplyVectors",value:function(i,a){return this.copy(i).multiply(a)}},{key:"addScaledVector",value:function(i,a){return this.add(new this.constructor(i).multiplyScalar(a))}}]),e}(Hs);
1098var st=1e-6,er=typeof Float32Array<"u"?Float32Array:Array;var $Ee=Math.PI/180;Math.hypot||(Math.hypot=function(){for(var t=0,r=arguments.length;r--;)t+=arguments[r]*arguments[r];return Math.sqrt(t)});function l7(){var t=new er(2);return er!=Float32Array&&(t[0]=0,t[1]=0),t}function Cf(t,r,e){return t[0]=r[0]+e[0],t[1]=r[1]+e[1],t}function f7(t,r,e){return t[0]=r[0]-e[0],t[1]=r[1]-e[1],t}function nE(t,r,e){return t[0]=r[0]*e,t[1]=r[1]*e,t}function iE(t){var r=t[0],e=t[1];return Math.hypot(r,e)}function aE(t,r){return t[0]=-r[0],t[1]=-r[1],t}function uh(t,r,e,n){var i=r[0],a=r[1];return t[0]=i+n*(e[0]-i),t[1]=a+n*(e[1]-a),t}function oE(t,r,e){var n=r[0],i=r[1];return t[0]=e[0]*n+e[2]*i,t[1]=e[1]*n+e[3]*i,t}function sE(t,r,e){var n=r[0],i=r[1];return t[0]=e[0]*n+e[2]*i+e[4],t[1]=e[1]*n+e[3]*i+e[5],t}function lh(t,r,e){var n=r[0],i=r[1];return t[0]=e[0]*n+e[3]*i+e[6],t[1]=e[1]*n+e[4]*i+e[7],t}function fh(t,r,e){var n=r[0],i=r[1];return t[0]=e[0]*n+e[4]*i+e[12],t[1]=e[1]*n+e[5]*i+e[13],t}var uE=f7;var XEe=function(){var t=l7();return function(r,e,n,i,a,o){var s,u;for(e||(e=2),n||(n=0),i?u=Math.min(i*e+n,r.length):u=r.length,s=n;s<u;s+=e)t[0]=r[s],t[1]=r[s+1],a(t,t,o),r[s]=t[0],r[s+1]=t[1];return r}}();function ch(t,r,e){var n=r[0],i=r[1],a=e[3]*n+e[7]*i||1;return t[0]=(e[0]*n+e[4]*i)/a,t[1]=(e[1]*n+e[5]*i)/a,t}function ph(t,r,e){var n=r[0],i=r[1],a=r[2],o=e[3]*n+e[7]*i+e[11]*a||1;return t[0]=(e[0]*n+e[4]*i+e[8]*a)/o,t[1]=(e[1]*n+e[5]*i+e[9]*a)/o,t[2]=(e[2]*n+e[6]*i+e[10]*a)/o,t}function lE(t,r,e){var n=r[0],i=r[1];return t[0]=e[0]*n+e[2]*i,t[1]=e[1]*n+e[3]*i,t[2]=r[2],t}function fE(t,r,e){var n=r[0],i=r[1];return t[0]=e[0]*n+e[2]*i,t[1]=e[1]*n+e[3]*i,t[2]=r[2],t[3]=r[3],t}function hh(t,r,e){var n=r[0],i=r[1],a=r[2];return t[0]=e[0]*n+e[3]*i+e[6]*a,t[1]=e[1]*n+e[4]*i+e[7]*a,t[2]=e[2]*n+e[5]*i+e[8]*a,t[3]=r[3],t}function c7(t){var r=p7();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function p7(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var _n=function(t){L(e,t);var r=c7(e);function e(){var n,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return A(this,e),n=r.call(this,2),vr(i)&&arguments.length===1?n.copy(i):(it.debug&&(Ve(i),Ve(a)),n[0]=i,n[1]=a),n}return T(e,[{key:"set",value:function(i,a){return this[0]=i,this[1]=a,this.check()}},{key:"copy",value:function(i){return this[0]=i[0],this[1]=i[1],this.check()}},{key:"fromObject",value:function(i){return it.debug&&(Ve(i.x),Ve(i.y)),this[0]=i.x,this[1]=i.y,this.check()}},{key:"toObject",value:function(i){return i.x=this[0],i.y=this[1],i}},{key:"ELEMENTS",get:function(){return 2}},{key:"horizontalAngle",value:function(){return Math.atan2(this.y,this.x)}},{key:"verticalAngle",value:function(){return Math.atan2(this.x,this.y)}},{key:"transform",value:function(i){return this.transformAsPoint(i)}},{key:"transformAsPoint",value:function(i){return fh(this,this,i),this.check()}},{key:"transformAsVector",value:function(i){return ch(this,this,i),this.check()}},{key:"transformByMatrix3",value:function(i){return lh(this,this,i),this.check()}},{key:"transformByMatrix2x3",value:function(i){return sE(this,this,i),this.check()}},{key:"transformByMatrix2",value:function(i){return oE(this,this,i),this.check()}}]),e}(Ws);F();j();function __(){var t=new er(3);return er!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Mf(t){var r=t[0],e=t[1],n=t[2];return Math.hypot(r,e,n)}function b_(t,r,e){var n=new er(3);return n[0]=t,n[1]=r,n[2]=e,n}function cE(t,r,e){return t[0]=r[0]+e[0],t[1]=r[1]+e[1],t[2]=r[2]+e[2],t}function h7(t,r,e){return t[0]=r[0]*e[0],t[1]=r[1]*e[1],t[2]=r[2]*e[2],t}function d7(t,r){var e=r[0]-t[0],n=r[1]-t[1],i=r[2]-t[2];return Math.hypot(e,n,i)}function pE(t,r){return t[0]=-r[0],t[1]=-r[1],t[2]=-r[2],t}function hE(t,r){var e=r[0],n=r[1],i=r[2],a=e*e+n*n+i*i;return a>0&&(a=1/Math.sqrt(a)),t[0]=r[0]*a,t[1]=r[1]*a,t[2]=r[2]*a,t}function If(t,r){return t[0]*r[0]+t[1]*r[1]+t[2]*r[2]}function Xs(t,r,e){var n=r[0],i=r[1],a=r[2],o=e[0],s=e[1],u=e[2];return t[0]=i*u-a*s,t[1]=a*o-n*u,t[2]=n*s-i*o,t}function qs(t,r,e){var n=r[0],i=r[1],a=r[2],o=e[3]*n+e[7]*i+e[11]*a+e[15];return o=o||1,t[0]=(e[0]*n+e[4]*i+e[8]*a+e[12])/o,t[1]=(e[1]*n+e[5]*i+e[9]*a+e[13])/o,t[2]=(e[2]*n+e[6]*i+e[10]*a+e[14])/o,t}function dh(t,r,e){var n=r[0],i=r[1],a=r[2];return t[0]=n*e[0]+i*e[3]+a*e[6],t[1]=n*e[1]+i*e[4]+a*e[7],t[2]=n*e[2]+i*e[5]+a*e[8],t}function vh(t,r,e){var n=e[0],i=e[1],a=e[2],o=e[3],s=r[0],u=r[1],l=r[2],f=i*l-a*u,p=a*s-n*l,h=n*u-i*s,d=i*h-a*p,v=a*f-n*h,m=n*p-i*f,g=o*2;
1098return f*=g,p*=g,h*=g,d*=2,v*=2,m*=2,t[0]=s+f+d,t[1]=u+p+v,t[2]=l+h+m,t}function dE(t,r,e,n){var i=[],a=[];return i[0]=r[0]-e[0],i[1]=r[1]-e[1],i[2]=r[2]-e[2],a[0]=i[0],a[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),a[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),t[0]=a[0]+e[0],t[1]=a[1]+e[1],t[2]=a[2]+e[2],t}function vE(t,r,e,n){var i=[],a=[];return i[0]=r[0]-e[0],i[1]=r[1]-e[1],i[2]=r[2]-e[2],a[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),a[1]=i[1],a[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),t[0]=a[0]+e[0],t[1]=a[1]+e[1],t[2]=a[2]+e[2],t}function mE(t,r,e,n){var i=[],a=[];return i[0]=r[0]-e[0],i[1]=r[1]-e[1],i[2]=r[2]-e[2],a[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),a[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),a[2]=i[2],t[0]=a[0]+e[0],t[1]=a[1]+e[1],t[2]=a[2]+e[2],t}function gE(t,r){var e=t[0],n=t[1],i=t[2],a=r[0],o=r[1],s=r[2],u=Math.sqrt(e*e+n*n+i*i),l=Math.sqrt(a*a+o*o+s*s),f=u*l,p=f&&If(t,r)/f;return Math.acos(Math.min(Math.max(p,-1),1))}var yE=h7;var _E=d7;var bE=Mf;var aCe=function(){var t=__();return function(r,e,n,i,a,o){var s,u;for(e||(e=3),n||(n=0),i?u=Math.min(i*e+n,r.length):u=r.length,s=n;s<u;s+=e)t[0]=r[s],t[1]=r[s+1],t[2]=r[s+2],a(t,t,o),r[s]=t[0],r[s+1]=t[1],r[s+2]=t[2];return r}}();function v7(t){var r=m7();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function m7(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var x_=[0,0,0],mh,z=function(t){L(e,t);var r=v7(e);function e(){var n,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return A(this,e),n=r.call(this,-0,-0,-0),arguments.length===1&&vr(i)?n.copy(i):(it.debug&&(Ve(i),Ve(a),Ve(o)),n[0]=i,n[1]=a,n[2]=o),n}return T(e,[{key:"set",value:function(i,a,o){return this[0]=i,this[1]=a,this[2]=o,this.check()}},{key:"copy",value:function(i){return this[0]=i[0],this[1]=i[1],this[2]=i[2],this.check()}},{key:"fromObject",value:function(i){return it.debug&&(Ve(i.x),Ve(i.y),Ve(i.z)),this[0]=i.x,this[1]=i.y,this[2]=i.z,this.check()}},{key:"toObject",value:function(i){return i.x=this[0],i.y=this[1],i.z=this[2],i}},{key:"ELEMENTS",get:function(){return 3}},{key:"z",get:function(){return this[2]},set:function(i){this[2]=Ve(i)}},{key:"angle",value:function(i){return gE(this,i)}},{key:"cross",value:function(i){return Xs(this,this,i),this.check()}},{key:"rotateX",value:function(i){var a=i.radians,o=i.origin,s=o===void 0?x_:o;return dE(this,this,s,a),this.check()}},{key:"rotateY",value:function(i){var a=i.radians,o=i.origin,s=o===void 0?x_:o;return vE(this,this,s,a),this.check()}},{key:"rotateZ",value:function(i){var a=i.radians,o=i.origin,s=o===void 0?x_:o;return mE(this,this,s,a),this.check()}},{key:"transform",value:function(i){return this.transformAsPoint(i)}},{key:"transformAsPoint",value:function(i){return qs(this,this,i),this.check()}},{key:"transformAsVector",value:function(i){return ph(this,this,i),this.check()}},{key:"transformByMatrix3",value:function(i){return dh(this,this,i),this.check()}},{key:"transformByMatrix2",value:function(i){return lE(this,this,i),this.check()}},{key:"transformByQuaternion",value:function(i){return vh(this,this,i),this.check()}}],[{key:"ZERO",get:function(){return mh||(mh=new e(0,0,0),Object.freeze(mh)),mh}}]),e}(Ws);F();j();function g7(t){var r=y7();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function y7(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var gh,xE=function(t){L(e,t);var r=g7(e);function e(){var n,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;return A(this,e),n=r.call(this,-0,-0,-0,-0),vr(i)&&arguments.length===1?n.copy(i):(it.debug&&(Ve(i),Ve(a),Ve(o),Ve(s)),n[0]=i,n[1]=a,n[2]=o,n[3]=s),n}return T(e,[{key:"set",value:function(i,a,o,s){return this[0]=i,this[1]=a,this[2]=o,this[3]=s,this.check()}},{key:"copy",value:function(i){return this[0]=i[0],this[1]=i[1],this[2]=i[2],this[3]=i[3],this.check()}},{key:"fromObject",value:function(i){return it.debug&&(Ve(i.x),Ve(i.y),Ve(i.z),Ve(i.w)),this[0]=i.x,this[1]=i.y,this[2]=i.z,this[3]=i.w,this}},{key:"toObject",value:function(i){return i.x=this[0],i.y=this[1],i.z=this[2],i.w=this[3],i}},{key:"ELEMENTS",get:function(){return 4}},{key:"z",get:function(){return this[2]},set:function(i){this[2]=Ve(i)}},{key:"w",get:function(){return this[3]},set:function(i){this[3]=Ve(i)}},{key:"transform",value:function(i){return qs(this,this,i),this.check()}},{key:"transformByMatrix3",value:function(i){return hh(this,this,i),this.check()}},{key:"transformByMatrix2",value:function(i){return fE(this,this,i),this.check()}},{key:"transformByQuaternion",value:function(i){return vh(this,this,i),this.check()}},{key:"applyMatrix4",value:function(i){return i.transform(this,this),this}}],[{key:"ZERO",get:function(){return gh||(gh=new e(0,0,0,0),Object.freeze(gh)),gh}}]),e}(Ws);F();j();F();j();function _7(t){var r=b7();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function b7(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var yh=function(t){L(e,t);var r=_7(e);function e(){return A(this,e),r.apply(this,arguments)}return T(e,[{key:"toString",value:function(){var i="[";if(it.printRowMajor){i+="row-major:";for(var a=0;a<this.RANK;++a)for(var o=0;o<this.RANK;++o)i+=" ".concat(this[o*this.RANK+a])}else{i+="column-major:";for(var s=0;s<this.ELEMENTS;++s)i+=" ".concat(this[s])}return i+="]",i}},{key:"getElementIndex",value:function(i,a){return a*this.RANK+i}},{key:"getElement",value:function(i,a){return this[a*this.RANK+i]}},{key:"setElement",value:function(i,a,o){return this[a*this.RANK+i]=Ve(o),this}},{key:"getColumn",value:function(i){for(var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new Array(this.RANK).fill(-0),o=i*this.RANK,s=0;s<this.RANK;++s)a[s]=this[o+s];return a}},{key:"setColumn",value:function(i,a){for(var o=i*this.RANK,s=0;s<this.RANK;++s)this[o+s]=a[s];return this}}]),e}(Hs);function AE(){var t=new er(9);return er!=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 SE(t,r){if(t===r){var e=r[1],n=r[2],i=r[5];t[1]=r[3],t[2]=r[6],t[3]=e,t[5]=r[7],t[6]=n,t[7]=i}else t[0]=r[0],t[1]=r[3],t[2]=r[6],t[3]=r[1],t[4]=r[4],t[5]=r[7],t[6]=r[2],t[7]=r[5],t[8]=r[8];return t}function TE(t,r){var e=r[0],n=r[1],i=r[2],a=r[3],o=r[4],s=r[5],u=r[6],l=r[7],f=r[8],p=f*o-s*l,h=-f*a+s*u,d=l*a-o*u,v=e*p+n*h+i*d;return v?(v=1/v,t[0]=p*v,t[1]=(-f*n+i*l)*v,t[2]=(s*n-i*o)*v,t[3]=h*v,t[4]=(f*e-i*u)*v,t[5]=(-s*e+i*a)*v,t[6]=d*v,t[7]=(-l*e+n*u)*v,t[8]=(o*e-n*a
1098)*v,t):null}function wE(t){var r=t[0],e=t[1],n=t[2],i=t[3],a=t[4],o=t[5],s=t[6],u=t[7],l=t[8];return r*(l*a-o*u)+e*(-l*i+o*s)+n*(u*i-a*s)}function A_(t,r,e){var n=r[0],i=r[1],a=r[2],o=r[3],s=r[4],u=r[5],l=r[6],f=r[7],p=r[8],h=e[0],d=e[1],v=e[2],m=e[3],g=e[4],y=e[5],_=e[6],b=e[7],x=e[8];return t[0]=h*n+d*o+v*l,t[1]=h*i+d*s+v*f,t[2]=h*a+d*u+v*p,t[3]=m*n+g*o+y*l,t[4]=m*i+g*s+y*f,t[5]=m*a+g*u+y*p,t[6]=_*n+b*o+x*l,t[7]=_*i+b*s+x*f,t[8]=_*a+b*u+x*p,t}function PE(t,r,e){var n=r[0],i=r[1],a=r[2],o=r[3],s=r[4],u=r[5],l=r[6],f=r[7],p=r[8],h=e[0],d=e[1];return t[0]=n,t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=u,t[6]=h*n+d*o+l,t[7]=h*i+d*s+f,t[8]=h*a+d*u+p,t}function OE(t,r,e){var n=r[0],i=r[1],a=r[2],o=r[3],s=r[4],u=r[5],l=r[6],f=r[7],p=r[8],h=Math.sin(e),d=Math.cos(e);return t[0]=d*n+h*o,t[1]=d*i+h*s,t[2]=d*a+h*u,t[3]=d*o-h*n,t[4]=d*s-h*i,t[5]=d*u-h*a,t[6]=l,t[7]=f,t[8]=p,t}function S_(t,r,e){var n=e[0],i=e[1];return t[0]=n*r[0],t[1]=n*r[1],t[2]=n*r[2],t[3]=i*r[3],t[4]=i*r[4],t[5]=i*r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],t}function EE(t,r){var e=r[0],n=r[1],i=r[2],a=r[3],o=e+e,s=n+n,u=i+i,l=e*o,f=n*o,p=n*s,h=i*o,d=i*s,v=i*u,m=a*o,g=a*s,y=a*u;return t[0]=1-p-v,t[3]=f-y,t[6]=h+g,t[1]=f+y,t[4]=1-l-v,t[7]=d-m,t[2]=h-g,t[5]=d+m,t[8]=1-l-p,t}function x7(t){var r=A7();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function A7(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var T_;(function(t){t[t.COL0ROW0=0]="COL0ROW0",t[t.COL0ROW1=1]="COL0ROW1",t[t.COL0ROW2=2]="COL0ROW2",t[t.COL1ROW0=3]="COL1ROW0",t[t.COL1ROW1=4]="COL1ROW1",t[t.COL1ROW2=5]="COL1ROW2",t[t.COL2ROW0=6]="COL2ROW0",t[t.COL2ROW1=7]="COL2ROW1",t[t.COL2ROW2=8]="COL2ROW2"})(T_||(T_={}));var S7=Object.freeze([1,0,0,0,1,0,0,0,1]),at=function(t){L(e,t);var r=x7(e);function e(n){for(var i,a=arguments.length,o=new Array(a>1?a-1:0),s=1;s<a;s++)o[s-1]=arguments[s];return A(this,e),i=r.call(this,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(n)?i.copy(n):o.length>0?i.copy([n].concat(o)):i.identity(),i}return T(e,[{key:"ELEMENTS",get:function(){return 9}},{key:"RANK",get:function(){return 3}},{key:"INDICES",get:function(){return T_}},{key:"copy",value:function(i){return this[0]=i[0],this[1]=i[1],this[2]=i[2],this[3]=i[3],this[4]=i[4],this[5]=i[5],this[6]=i[6],this[7]=i[7],this[8]=i[8],this.check()}},{key:"identity",value:function(){return this.copy(S7)}},{key:"fromObject",value:function(i){return this.check()}},{key:"fromQuaternion",value:function(i){return EE(this,i),this.check()}},{key:"set",value:function(i,a,o,s,u,l,f,p,h){return this[0]=i,this[1]=a,this[2]=o,this[3]=s,this[4]=u,this[5]=l,this[6]=f,this[7]=p,this[8]=h,this.check()}},{key:"setRowMajor",value:function(i,a,o,s,u,l,f,p,h){return this[0]=i,this[1]=s,this[2]=f,this[3]=a,this[4]=u,this[5]=p,this[6]=o,this[7]=l,this[8]=h,this.check()}},{key:"determinant",value:function(){return wE(this)}},{key:"transpose",value:function(){return SE(this,this),this.check()}},{key:"invert",value:function(){return TE(this,this),this.check()}},{key:"multiplyLeft",value:function(i){return A_(this,i,this),this.check()}},{key:"multiplyRight",value:function(i){return A_(this,this,i),this.check()}},{key:"rotate",value:function(i){return OE(this,this,i),this.check()}},{key:"scale",value:function(i){return Array.isArray(i)?S_(this,this,i):S_(this,this,[i,i]),this.check()}},{key:"translate",value:function(i){return PE(this,this,i),this.check()}},{key:"transform",value:function(i,a){var o;switch(i.length){case 2:o=lh(a||[-0,-0],i,this);break;case 3:o=dh(a||[-0,-0,-0],i,this);break;case 4:o=hh(a||[-0,-0,-0,-0],i,this);break;default:throw new Error("Illegal vector")}return pa(o,i.length),o}},{key:"transformVector",value:function(i,a){return this.transform(i,a)}},{key:"transformVector2",value:function(i,a){return this.transform(i,a)}},{key:"transformVector3",value:function(i,a){return this.transform(i,a)}}],[{key:"IDENTITY",get:function(){return w7()}},{key:"ZERO",get:function(){return T7()}}]),e}
1098(yh);var _h,bh;function T7(){return _h||(_h=new at([0,0,0,0,0,0,0,0,0]),Object.freeze(_h)),_h}function w7(){return bh||(bh=new at,Object.freeze(bh)),bh}F();j();function P7(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 ME(t,r){if(t===r){var e=r[1],n=r[2],i=r[3],a=r[6],o=r[7],s=r[11];t[1]=r[4],t[2]=r[8],t[3]=r[12],t[4]=e,t[6]=r[9],t[7]=r[13],t[8]=n,t[9]=a,t[11]=r[14],t[12]=i,t[13]=o,t[14]=s}else t[0]=r[0],t[1]=r[4],t[2]=r[8],t[3]=r[12],t[4]=r[1],t[5]=r[5],t[6]=r[9],t[7]=r[13],t[8]=r[2],t[9]=r[6],t[10]=r[10],t[11]=r[14],t[12]=r[3],t[13]=r[7],t[14]=r[11],t[15]=r[15];return t}function xh(t,r){var e=r[0],n=r[1],i=r[2],a=r[3],o=r[4],s=r[5],u=r[6],l=r[7],f=r[8],p=r[9],h=r[10],d=r[11],v=r[12],m=r[13],g=r[14],y=r[15],_=e*s-n*o,b=e*u-i*o,x=e*l-a*o,w=n*u-i*s,P=n*l-a*s,E=i*l-a*u,C=f*m-p*v,I=f*g-h*v,O=f*y-d*v,D=p*g-h*m,N=p*y-d*m,H=h*y-d*g,$=_*H-b*N+x*D+w*O-P*I+E*C;return $?($=1/$,t[0]=(s*H-u*N+l*D)*$,t[1]=(i*N-n*H-a*D)*$,t[2]=(m*E-g*P+y*w)*$,t[3]=(h*P-p*E-d*w)*$,t[4]=(u*O-o*H-l*I)*$,t[5]=(e*H-i*O+a*I)*$,t[6]=(g*x-v*E-y*b)*$,t[7]=(f*E-h*x+d*b)*$,t[8]=(o*N-s*O+l*C)*$,t[9]=(n*O-e*N-a*C)*$,t[10]=(v*P-m*x+y*_)*$,t[11]=(p*x-f*P-d*_)*$,t[12]=(s*I-o*D-u*C)*$,t[13]=(e*D-n*I+i*C)*$,t[14]=(m*b-v*w-g*_)*$,t[15]=(f*w-p*b+h*_)*$,t):null}function IE(t){var r=t[0],e=t[1],n=t[2],i=t[3],a=t[4],o=t[5],s=t[6],u=t[7],l=t[8],f=t[9],p=t[10],h=t[11],d=t[12],v=t[13],m=t[14],g=t[15],y=r*o-e*a,_=r*s-n*a,b=r*u-i*a,x=e*s-n*o,w=e*u-i*o,P=n*u-i*s,E=l*v-f*d,C=l*m-p*d,I=l*g-h*d,O=f*m-p*v,D=f*g-h*v,N=p*g-h*m;return y*N-_*D+b*O+x*I-w*C+P*E}function xo(t,r,e){var n=r[0],i=r[1],a=r[2],o=r[3],s=r[4],u=r[5],l=r[6],f=r[7],p=r[8],h=r[9],d=r[10],v=r[11],m=r[12],g=r[13],y=r[14],_=r[15],b=e[0],x=e[1],w=e[2],P=e[3];return t[0]=b*n+x*s+w*p+P*m,t[1]=b*i+x*u+w*h+P*g,t[2]=b*a+x*l+w*d+P*y,t[3]=b*o+x*f+w*v+P*_,b=e[4],x=e[5],w=e[6],P=e[7],t[4]=b*n+x*s+w*p+P*m,t[5]=b*i+x*u+w*h+P*g,t[6]=b*a+x*l+w*d+P*y,t[7]=b*o+x*f+w*v+P*_,b=e[8],x=e[9],w=e[10],P=e[11],t[8]=b*n+x*s+w*p+P*m,t[9]=b*i+x*u+w*h+P*g,t[10]=b*a+x*l+w*d+P*y,t[11]=b*o+x*f+w*v+P*_,b=e[12],x=e[13],w=e[14],P=e[15],t[12]=b*n+x*s+w*p+P*m,t[13]=b*i+x*u+w*h+P*g,t[14]=b*a+x*l+w*d+P*y,t[15]=b*o+x*f+w*v+P*_,t}function Ao(t,r,e){var n=e[0],i=e[1],a=e[2],o,s,u,l,f,p,h,d,v,m,g,y;return r===t?(t[12]=r[0]*n+r[4]*i+r[8]*a+r[12],t[13]=r[1]*n+r[5]*i+r[9]*a+r[13],t[14]=r[2]*n+r[6]*i+r[10]*a+r[14],t[15]=r[3]*n+r[7]*i+r[11]*a+r[15]):(o=r[0],s=r[1],u=r[2],l=r[3],f=r[4],p=r[5],h=r[6],d=r[7],v=r[8],m=r[9],g=r[10],y=r[11],t[0]=o,t[1]=s,t[2]=u,t[3]=l,t[4]=f,t[5]=p,t[6]=h,t[7]=d,t[8]=v,t[9]=m,t[10]=g,t[11]=y,t[12]=o*n+f*i+v*a+r[12],t[13]=s*n+p*i+m*a+r[13],t[14]=u*n+h*i+g*a+r[14],t[15]=l*n+d*i+y*a+r[15]),t}function Ys(t,r,e){var n=e[0],i=e[1],a=e[2];return t[0]=r[0]*n,t[1]=r[1]*n,t[2]=r[2]*n,t[3]=r[3]*n,t[4]=r[4]*i,t[5]=r[5]*i,t[6]=r[6]*i,t[7]=r[7]*i,t[8]=r[8]*a,t[9]=r[9]*a,t[10]=r[10]*a,t[11]=r[11]*a,t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15],t}function RE(t,r,e,n){var i=n[0],a=n[1],o=n[2],s=Math.hypot(i,a,o),u,l,f,p,h,d,v,m,g,y,_,b,x,w,P,E,C,I,O,D,N,H,$,ee;return s<st?null:(s=1/s,i*=s,a*=s,o*=s,u=Math.sin(e),l=Math.cos(e),f=1-l,p=r[0],h=r[1],d=r[2],v=r[3],m=r[4],g=r[5],y=r[6],_=r[7],b=r[8],x=r[9],w=r[10],P=r[11],E=i*i*f+l,C=a*i*f+o*u,I=o*i*f-a*u,O=i*a*f-o*u,D=a*a*f+l,N=o*a*f+i*u,H=i*o*f+a*u,$=a*o*f-i*u,ee=o*o*f+l,t[0]=p*E+m*C+b*I,t[1]=h*E+g*C+x*I,t[2]=d*E+y*C+w*I,t[3]=v*E+_*C+P*I,t[4]=p*O+m*D+b*N,t[5]=h*O+g*D+x*N,t[6]=d*O+y*D+w*N,t[7]=v*O+_*D+P*N,t[8]=p*H+m*$+b*ee,t[9]=h*H+g*$+x*ee,t[10]=d*H+y*$+w*ee,t[11]=v*H+_*$+P*ee,r!==t&&(t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15]),t)}function Ah(t,r,e){var n=Math.sin(e),i=Math.cos(e),a=r[4],o=r[5],s=r[6],u=r[7],l=r[8],f=r[9],p=r[10],h=r[11];return r!==t&&(t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15]),t[4]=a*i+l*n,t[5]=o*i+f*n,t[6]=s*i+p*n,t[7]=u*i+h*n,t[8]=l*i-a*n,t[9]=f*i-o*n,t[10]=p*i-s*n,t[11]=h*i-u*n,t}function LE(t,r,e){var n=Math.sin(e),i=Math.cos(e),a=r[0],o=r[1],s=r[2],u=r[3],l=r[8],f=r[9],p=r[10],h=r[11];return r!==t&&(t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15]),t[0]=a*i-l*n,t[1]=o*i-f*n,t[2]=s*i-p*n,t[3]=u*i-h*n,t[8]=a*n+l*i,t[9]=o*n+f*i,t[10]=s*n+p*i,t[11]=u*n+h*i,t}function Sh(t,r,e){var n=Math.sin(e),i=Math.cos(e),a=r[0],o=r[1],s=r[2],u=r[3],l=r[4],f=r[5],p=r[6],h=r[7];return r!==t&&(t[8]=r[8],t[9]=r[9],t[10]=r[10],t[11]=r[11],t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15]),t[0]=a*i+l*n,t[1]=o*i+f*n,t[2]=s*i+p*n,t[3]=u*i+h*n,t[4]=l*i-a*n,t[5]=f*i-o*n,t[6]=p*i-s*n,t[7]=h*i-u*n,t}function kE(t,r){var e=r[0],n=r[1],i=r[2],a=r[4],o=r[5],s=r[6],u=r[8],l=r[9],f=r[10];return t[0]=Math.hypot(e,n,i),t[1]=Math.hypot(a,o,s),t[2]=Math.hypot(u,l,f),t}function BE(t,r){var e=r[0],n=r[1],i=r[2],a=r[3],o=e+e,s=n+n,u=i+i,l=e*o,f=n*o,p=n*s,h=i*o,d=i*s,v=i*u,m=a*o,g=a*s,y=a*u;return t[0]=1-p-v,t[1]=f+y,t[2]=h-g,t[3]=0,t[4]=f-y,t[5]=1-l-v,t[6]=d+m,t[7]=0,t[8]=h+g,t[9]=d-m,t[10]=1-l-p,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function FE(t,r,e,n,i,a,o){var s=1/(e-r),u=1/(i-n),l=1/(a-o);return t[0]=a*2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a*2*u,t[6]=0,t[7]=0,t[8]=(e+r)*s,t[9]=(i+n)*u,t[10]=(o+a)*l,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*a*2*l,t[15]=0,t}function O7(t,r,e,n,i){var a=1/Math.tan(r/2),o;return t[0]=a/e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,i!=null&&i!==1/0?(o=1/(n-i),t[10]=(i+n)*o,t[14]=2*i*n*o):(t[10]=-1,t[14]=-2*n),t}var Th=O7;function E7(t,r,e,n,i,a,o){var s=1/(r-e),u=1/(n-i),l=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(r+e)*s,t[13]=(i+n)*u,t[14]=(o+a)*l,t[15]=1,t}var DE=E7;function NE(t,r,e,n){var i,a,o,s,u,l,f,p,h,d,v=r[0],m=r[1],g=r[2],y=n[0],_=n[1],b=n[2],x=e[0],w=e[1],P=e[2];return Math.abs(v-x)<st&&Math.abs(m-w)<st&&Math.abs(g-P)<st?P7(t):(f=v-x,p=m-w,h=g-P,d=1/Math.hypot(f,p,h),f*=d,p*=d,h*=d,i=_*h-b*p,a=b*f-y*h,o=y*p-_*f,d=Math.hypot(i,a,o),d?(d=1/d,i*=d,a*=d,o*=d):(i=0,a=0,o=0),s=p*o-h*a,u=h*i-f*o,l=f*a-p*i,d=Math.hypot(s,u,l),d?(d=1/d,s*=d,u*=d,l*=d):(s=0,u=0,l=0),t[0]=i,t[1]=s,t[2]=f,t[3]=0,t[4]=a,t[5]=u,t[6]=p,t[7]=0,t[8]=o,t[9]=l,t[10]=h,t[11]=0,t[12]=-(i*v+a*m+o*g),t[13]=-(s*v+u*m+l*g),t[14]=-(f*v+p*m+h*g),t[15]=1,t)}function w_(t,r){var e=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],l=t[7],f=t[8],p=t[9],h=t[10],d=t[11],v=t[12],m=t[13],g=t[14],y=t[15],_=r[0],b=r[1],x=r[2],w=r[3],P=r[4],E=r[5],C=r[6],I=r[7],O=r[8],D=r[9],N=r[10],H=r[11],$=r[12],ee=r[13],V=r[14],U=r[15];return Math.abs(e-_)<=st*Math.max(1,Math.abs(e),Math.abs(_))&&Math.abs(n-b)<=st*Math.max(1,Math.abs(n),Math.abs(b))&&Math.abs(i-x)<=st*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(a-w)<=st*Math.max(1,Math.abs(a),Math.abs(w))&&Math.abs(o-P)<=st*Math.max(1,Math.abs(o),Math.abs(P))&&Math.abs(s-E)<=st*Math.max(1,Math.abs(s),Math.abs(E))&&Math.abs(u-C)<=st*Math.max(1,Math.abs(u),Math.abs(C))&&Math.abs(l-I)<=st*Math.max(1,Math.abs(l),Math.abs(I))&&Math.abs(f-O)<=st*Math.max(1,Math.abs(f),Math.abs(O))&&Math.abs(p-D)<=st*Math.max(1,Math.abs(p),Math.abs(D))&&Math.abs(h-N)<=st*Math.max(1,Math.abs(h),Math.abs(N))&&Math.abs(d-H)<=st*Math.max(1,Math.abs(d),Math.abs(H))&&Math.abs(v-$)<=st*Math.max(1,Math.abs(v),Math.abs($))&&Math.abs(m-ee)<=st*Math.max(1,Math.abs(m),Math.abs(ee))&&Math.abs(g-V)<=st*Math.max(1,Math.abs(g),Math.abs(V))&&Math.abs(y-U)<=st*Math.max(1,Math.abs(y),Math.abs(U))}function C7(){var t=new er(4);return er!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function jE(t,r,e){return t[0]=r[0]+e[0],t[1]=r[1]+e[1],t[2]=r[2]+e[2],t[3]=r[3]+e[3],t}function Ph(t,r,e){return t[0]=r[0]*e,t[1]=r[1]*e,t[2]=r[2]*e,t[3]=r[3]*e,t}function UE(t){var r=t[0],e=t[1],n=t[2],i=t[3];return Math.hypot(r,e,n,i)}function GE(t){var r=t[0],e=t[1],n=t[2],i=t[3];return r*r+e*e+n*n+i*i}function zE(t,r){var e=r[0],n=r[1],i=r[2],a=r[3],o=e*e+n*n+i*i+a*a;return o>0&&(o=1/Math.sqrt(o)),t[0]=e*o,t[1]=n*o,t[2]=i*o,t[3]=a*o,t}function VE(t,r){return t[0]*r[0]+t[1]*r[1]+t[2]*r[2]+t[3]*r[3]}function HE(t,r,e,n){var i=r[0],a=r[1],o=r[2],s=r[3];return t[0]=i+n*(e[0]-i),t[1]=a+n*(e[1]-a),t[2]=o+n*(e[2]-o),t[3]=s+n*(e[3]-s),t}function Oh(t,r,e){var n=r[0],i=r[1],a=r[2],o=r[3];return t[0]=e[0]*n+e[4]*i+e[8]*a+e[12]*o,t[1]=e[1]*n+e[5]*i+e[9]*a+e[13]*o,t[2]=e[2]*n+e[6]*i+e[10]*a+e[14]*o,t[3]=e[3]*n+e[7]*i+e[11]*a+e[15]*o,t}function WE(t,r,e){var n=r[0],i=r[1],a=r[2],o=e[0],s=e[1],u=e[2],l=e[3],f=l*n+s*a-u*i,p=l*i+u*n-o*a,h=l*a+o*i-s*n,d=-o*n-s*i-u*a;return t[0]=f*l+d*-o+p*-u-h*-s,t[1]=p*l+d*-s+h*-o-f*-u,t[2]=h*l+d*-u+f*-s-p*-o,t[3]=r[3],t}var HCe=function(){var t=C7();return function(r,e,n,i,a,o){var s,u;for(e||(e=4),n||(n=0),i?u=Math.min(i*e+n,r.length):u=r.length,s=n;s<u;s+=e)t[0]=r[s],t[1]=r[s+1],t[2]=r[s+2],t[3]=r[s+3],a(t,t,o),r[s]=t[0],r[s+1]=t[1],r[s+2]=t[2],r[s+3]=t[3];return r}}();function M7(t){var r=I7();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function I7(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var C_;(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"})(C_||(C_={}));var R7=45*Math.PI/180,L7=1,O_=.1,E_=500,k7=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),ye=function(t){L(e,t);var r=M7(e);function e(n){var i;return A(this,e),i=r.call(this,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(n)?i.copy(n):i.identity(),i}return T(e,[{key:"ELEMENTS",get:function(){return 16}},{key:"RANK",get:function(){return 4}},{key:"INDICES",get:function(){return C_}},{key:"copy",value:function(i){return this[0]=i[0],this[1]=i[1],this[2]=i[2],this[3]=i[3],this[4]=i[4],this[5
1098]=i[5],this[6]=i[6],this[7]=i[7],this[8]=i[8],this[9]=i[9],this[10]=i[10],this[11]=i[11],this[12]=i[12],this[13]=i[13],this[14]=i[14],this[15]=i[15],this.check()}},{key:"set",value:function(i,a,o,s,u,l,f,p,h,d,v,m,g,y,_,b){return this[0]=i,this[1]=a,this[2]=o,this[3]=s,this[4]=u,this[5]=l,this[6]=f,this[7]=p,this[8]=h,this[9]=d,this[10]=v,this[11]=m,this[12]=g,this[13]=y,this[14]=_,this[15]=b,this.check()}},{key:"setRowMajor",value:function(i,a,o,s,u,l,f,p,h,d,v,m,g,y,_,b){return this[0]=i,this[1]=u,this[2]=h,this[3]=g,this[4]=a,this[5]=l,this[6]=d,this[7]=y,this[8]=o,this[9]=f,this[10]=v,this[11]=_,this[12]=s,this[13]=p,this[14]=m,this[15]=b,this.check()}},{key:"toRowMajor",value:function(i){return i[0]=this[0],i[1]=this[4],i[2]=this[8],i[3]=this[12],i[4]=this[1],i[5]=this[5],i[6]=this[9],i[7]=this[13],i[8]=this[2],i[9]=this[6],i[10]=this[10],i[11]=this[14],i[12]=this[3],i[13]=this[7],i[14]=this[11],i[15]=this[15],i}},{key:"identity",value:function(){return this.copy(k7)}},{key:"fromObject",value:function(i){return this.check()}},{key:"fromQuaternion",value:function(i){return BE(this,i),this.check()}},{key:"frustum",value:function(i){var a=i.left,o=i.right,s=i.bottom,u=i.top,l=i.near,f=l===void 0?O_:l,p=i.far,h=p===void 0?E_:p;return h===1/0?D7(this,a,o,s,u,f):FE(this,a,o,s,u,f,h),this.check()}},{key:"lookAt",value:function(i){var a=i.eye,o=i.center,s=o===void 0?[0,0,0]:o,u=i.up,l=u===void 0?[0,1,0]:u;return NE(this,a,s,l),this.check()}},{key:"ortho",value:function(i){var a=i.left,o=i.right,s=i.bottom,u=i.top,l=i.near,f=l===void 0?O_:l,p=i.far,h=p===void 0?E_:p;return DE(this,a,o,s,u,f,h),this.check()}},{key:"orthographic",value:function(i){var a=i.fovy,o=a===void 0?R7:a,s=i.aspect,u=s===void 0?L7:s,l=i.focalDistance,f=l===void 0?1:l,p=i.near,h=p===void 0?O_:p,d=i.far,v=d===void 0?E_:d;$E(o);var m=o/2,g=f*Math.tan(m),y=g*u;return this.ortho({left:-y,right:y,bottom:-g,top:g,near:h,far:v})}},{key:"perspective",value:function(i){var a=i.fovy,o=a===void 0?45*Math.PI/180:a,s=i.aspect,u=s===void 0?1:s,l=i.near,f=l===void 0?.1:l,p=i.far,h=p===void 0?500:p;return $E(o),Th(this,o,u,f,h),this.check()}},{key:"determinant",value:function(){return IE(this)}},{key:"getScale",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[-0,-0,-0];return i[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),i[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),i[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),i}},{key:"getTranslation",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[-0,-0,-0];return i[0]=this[12],i[1]=this[13],i[2]=this[14],i}},{key:"getRotation",value:function(i,a){i=i||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],a=a||[-0,-0,-0];var o=this.getScale(a),s=1/o[0],u=1/o[1],l=1/o[2];return i[0]=this[0]*s,i[1]=this[1]*u,i[2]=this[2]*l,i[3]=0,i[4]=this[4]*s,i[5]=this[5]*u,i[6]=this[6]*l,i[7]=0,i[8]=this[8]*s,i[9]=this[9]*u,i[10]=this[10]*l,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i}},{key:"getRotationMatrix3",value:function(i,a){i=i||[-0,-0,-0,-0,-0,-0,-0,-0,-0],a=a||[-0,-0,-0];var o=this.getScale(a),s=1/o[0],u=1/o[1],l=1/o[2];return i[0]=this[0]*s,i[1]=this[1]*u,i[2]=this[2]*l,i[3]=this[4]*s,i[4]=this[5]*u,i[5]=this[6]*l,i[6]=this[8]*s,i[7]=this[9]*u,i[8]=this[10]*l,i}},{key:"transpose",value:function(){return ME(this,this),this.check()}},{key:"invert",value:function(){return xh(this,this),this.check()}},{key:"multiplyLeft",value:function(i){return xo(this,i,this),this.check()}},{key:"multiplyRight",value:function(i){return xo(this,this,i),this.check()}},{key:"rotateX",value:function(i){return Ah(this,this,i),this.check()}},{key:"rotateY",value:function(i){return LE(this,this,i),this.check()}},{key:"rotateZ",value:function(i){return Sh(this,this,i),this.check()}},{key:"rotateXYZ",value:function(i){return this.rotateX(i[0]).rotateY(i[1]).rotateZ(i[2])}},{key:"rotateAxis",value:function(i,a){return RE(this,this,i,a),this.check()}},{key:"scale",value:function(i){return Ys(this,this,Array.isArray(i)?i:[i,i,i]),this.check()}},{key:"translate",value:function(i){return Ao(this,this,i),this.check()}},{key:"transform",value:function(i,a){return i.length===4?(a=Oh(a||[-0,-0,-0,-0],i,this),pa(a,4),a):this.transformAsPoint(i,a)}},{key:"transformAsPoint",value:function(i,a){var o=i.length,s;switch(o){case 2:s=fh(a||[-0,-0],i,this);break;case 3:s=qs(a||[-0,-0,-0],i,this);break;default:throw new Error("Illegal vector")}return pa(s,i.length),s}},{key:"transformAsVector",value:function(i,a){var o;switch(i.length){case 2:o=ch(a||[-0,-0],i,this);break;case 3:o=ph(a||[-0,-0,-0],i,this);break;default:throw new Error("Illegal vector")}return pa(o,i.length),o}},{key:"transformPoint",value:function(i,a){return this.transformAsPoint(i,a)}},{key:"transformVector",value:function(i,a){return this.transformAsPoint(i,a)}},{key:"transformDirection",value:function(i,a){return this.transformAsVector(i,a)}},{key:"makeRotationX",value:function(i){return this.identity().rotateX(i)}},{key:"makeTranslation",value:function(i,a,o){return this.identity().translate([i,a,o])}}],[{key:"IDENTITY",get:function(){return F7()}},{key:"ZERO",get:function(){return B7()}}]),e}
1098(yh);var Eh,Ch;function B7(){return Eh||(Eh=new ye([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(Eh)),Eh}function F7(){return Ch||(Ch=new ye,Object.freeze(Ch)),Ch}function $E(t){if(t>Math.PI*2)throw Error("expected radians")}function D7(t,r,e,n,i,a){var o=2*a/(e-r),s=2*a/(i-n),u=(e+r)/(e-r),l=(i+n)/(i-n),f=-1,p=-1,h=-2*a;return t[0]=o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,t[6]=0,t[7]=0,t[8]=u,t[9]=l,t[10]=f,t[11]=p,t[12]=0,t[13]=0,t[14]=h,t[15]=0,t}F();j();function XE(){var t=new er(4);return er!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function qE(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function M_(t,r,e){e=e*.5;var n=Math.sin(e);return t[0]=n*r[0],t[1]=n*r[1],t[2]=n*r[2],t[3]=Math.cos(e),t}function I_(t,r,e){var n=r[0],i=r[1],a=r[2],o=r[3],s=e[0],u=e[1],l=e[2],f=e[3];return t[0]=n*f+o*s+i*l-a*u,t[1]=i*f+o*u+a*s-n*l,t[2]=a*f+o*l+n*u-i*s,t[3]=o*f-n*s-i*u-a*l,t}function YE(t,r,e){e*=.5;var n=r[0],i=r[1],a=r[2],o=r[3],s=Math.sin(e),u=Math.cos(e);return t[0]=n*u+o*s,t[1]=i*u+a*s,t[2]=a*u-i*s,t[3]=o*u-n*s,t}function KE(t,r,e){e*=.5;var n=r[0],i=r[1],a=r[2],o=r[3],s=Math.sin(e),u=Math.cos(e);return t[0]=n*u-a*s,t[1]=i*u+o*s,t[2]=a*u+n*s,t[3]=o*u-i*s,t}function ZE(t,r,e){e*=.5;var n=r[0],i=r[1],a=r[2],o=r[3],s=Math.sin(e),u=Math.cos(e);return t[0]=n*u+i*s,t[1]=i*u-n*s,t[2]=a*u+o*s,t[3]=o*u-a*s,t}function JE(t,r){var e=r[0],n=r[1],i=r[2];return t[0]=e,t[1]=n,t[2]=i,t[3]=Math.sqrt(Math.abs(1-e*e-n*n-i*i)),t}function Rf(t,r,e,n){var i=r[0],a=r[1],o=r[2],s=r[3],u=e[0],l=e[1],f=e[2],p=e[3],h,d,v,m,g;return d=i*u+a*l+o*f+s*p,d<0&&(d=-d,u=-u,l=-l,f=-f,p=-p),1-d>st?(h=Math.acos(d),v=Math.sin(h),m=Math.sin((1-n)*h)/v,g=Math.sin(n*h)/v):(m=1-n,g=n),t[0]=m*i+g*u,t[1]=m*a+g*l,t[2]=m*o+g*f,t[3]=m*s+g*p,t}function QE(t,r){var e=r[0],n=r[1],i=r[2],a=r[3],o=e*e+n*n+i*i+a*a,s=o?1/o:0;return t[0]=-e*s,t[1]=-n*s,t[2]=-i*s,t[3]=a*s,t}function eC(t,r){return t[0]=-r[0],t[1]=-r[1],t[2]=-r[2],t[3]=r[3],t}function R_(t,r){var e=r[0]+r[4]+r[8],n;if(e>0)n=Math.sqrt(e+1),t[3]=.5*n,n=.5/n,t[0]=(r[5]-r[7])*n,t[1]=(r[6]-r[2])*n,t[2]=(r[1]-r[3])*n;else{var i=0;r[4]>r[0]&&(i=1),r[8]>r[i*3+i]&&(i=2);var a=(i+1)%3,o=(i+2)%3;n=Math.sqrt(r[i*3+i]-r[a*3+a]-r[o*3+o]+1),t[i]=.5*n,n=.5/n,t[3]=(r[a*3+o]-r[o*3+a])*n,t[a]=(r[a*3+i]+r[i*3+a])*n,t[o]=(r[o*3+i]+r[i*3+o])*n}return t}var tC=jE;var rC=Ph,nC=VE,iC=HE,aC=UE;var oC=GE;var sC=zE;var uC=function(){var t=__(),r=b_(1,0,0),e=b_(0,1,0);return function(n,i,a){var o=If(i,a);return o<-.999999?(Xs(t,r,i),bE(t)<1e-6&&Xs(t,e,i),hE(t,t),M_(n,t,Math.PI),n):o>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(Xs(t,i,a),n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=1+o,sC(n,n))}}(),oMe=function(){var t=XE(),r=XE();return function(e,n,i,a,o,s){return Rf(t,n,o,s),Rf(r,i,a,s),Rf(e,t,r,2*s*(1-s)),e}}(),sMe=function(){var t=AE();return function(r,e,n,i){return t[0]=n[0],t[3]=n[1],t[6]=n[2],t[1]=i[0],t[4]=i[1],t[7]=i[2],t[2]=-e[0],t[5]=-e[1],t[8]=-e[2],sC(r,R_(r,t))}}();function j7(t){var r=U7();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function U7(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var G7=[0,0,0,1],Vn=function(t){L(e,t);var r=j7(e);function e(){var n,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;return A(this,e),n=r.call(this,-0,-0,-0,-0),Array.isArray(i)&&arguments.length===1?n.copy(i):n.set(i,a,o,s),n}return T(e,[{key:"copy",value:function(i){return this[0]=i[0],this[1]=i[1],this[2]=i[2],this[3]=i[3],this.check()}},{key:"set",value:function(i,a,o,s){return this[0]=i,this[1]=a,this[2]=o,this[3]=s,this.check()}},{key:"fromObject",value:function(i){return this[0]=i.x,this[1]=i.y,this[2]=i.z,this[3]=i.w,this.check()}},{key:"fromMatrix3",value:function(i){return R_(this,i),this.check()}},{key:"fromAxisRotation",value:function(i,a){return M_(this,i,a),this.check()}},{key:"identity",value:function(){return qE(this),this.check()}},{key:"setAxisAngle",value:function(i,a){return this.fromAxisRotation(i,a)}},{key:"ELEMENTS",get:function(){return 4}},{key:"x",get:function(){return this[0]},set:function(i){this[0]=Ve(i)}},{key:"y",get:function(){return this[1]},set:function(i){this[1]=Ve(i)}},{key:"z",get:function(){return this[2]},set:function(i){this[2]=Ve(i)}},{key:"w",get:function(){return this[3]},set:function(i){this[3]=Ve(i)}},{key:"len",value:function(){return aC(this)}},{key:"lengthSquared",value:function(){return oC(this)}},{key:"dot",value:function(i){return nC(this,i)}},{key:"rotationTo",value:function(i,a){return uC(this,i,a),this.check()}},{key:"add",value:function(i){return tC(this,this,i),this.check()}},{key:"calculateW",value:function(){return JE(this,this),this.check()}},{key:"conjugate",value:function(){return eC(this,this),this.check()}},{key:"invert",value:function(){return QE(this,this),this.check()}},{key:"lerp",value:function(i,a,o){return o===void 0?this.lerp(this,i,a):(iC(this,i,a,o),this.check())}},{key:"multiplyRight",value:function(i){return I_(this,this,i),this.check()}},{key:"multiplyLeft",value:function(i){return I_(this,i,this),this.check()}},{key:"normalize",value:function(){var i=this.len(),a=i>0?1/i:0;return this[0]=this[0]*a,this[1]=this[1]*a,this[2]=this[2]*a,this[3]=this[3]*a,i===0&&(this[3]=1),this.check()}},{key:"rotateX",value:function(i){return YE(this,this,i),this.check()}},{key:"rotateY",value:function(i){return KE(this,this,i),this.check()}},{key:"rotateZ",value:function(i){return ZE(this,this,i),this.check()}},{key:"scale",value:function(i){return rC(this,this,i),this.check()}},{key:"slerp",value:function(i,a,o){var s,u,l;switch(arguments.length){case 1:var f=i.start;s=f===void 0?G7:f,u=i.target,l=i.ratio;break;case 2:s=this,u=i,l=a;break;default:s=i,u=a,l=o}return Rf(this,s,u,l),this.check()}},{key:"transformVector4",value:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new xE;return WE(a,i,this),pa(a,4)}},{key:"lengthSq",value:function(){return this.lengthSquared()}},{key:"setFromAxisAngle",value:function(i,a){return this.setAxisAngle(i,a)}},{key:"premultiply",value:function(i){return this.multiplyLeft(i)}},{key:"multiply",value:function(i){return this.multiplyRight(i)}}]),e}(Hs);be();F();j();k();var lC=1e-6,z7=6371e3,Lf=function(){function t(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=r.phi,n=e===void 0?0:e,i=r.theta,a=i===void 0?0:i,o=r.radius,s=o===void 0?1:o,u=r.bearing,l=r.pitch,f=r.altitude,p=r.radiusScale,h=p===void 0?z7:p;A(this,t),c(this,"phi",void 0),c(this,"theta",void 0),c(this,"radiu
1098s",void 0),c(this,"radiusScale",void 0),this.phi=n,this.theta=a,this.radius=s||f||1,this.radiusScale=h||1,u!==void 0&&(this.bearing=u),l!==void 0&&(this.pitch=l),this.check()}return T(t,[{key:"toString",value:function(){return this.formatString(it)}},{key:"formatString",value:function(e){var n=e.printTypes,i=n===void 0?!1:n,a=Ef;return"".concat(i?"Spherical":"","[rho:").concat(a(this.radius),",theta:").concat(a(this.theta),",phi:").concat(a(this.phi),"]")}},{key:"equals",value:function(e){return Ze(this.radius,e.radius)&&Ze(this.theta,e.theta)&&Ze(this.phi,e.phi)}},{key:"exactEquals",value:function(e){return this.radius===e.radius&&this.theta===e.theta&&this.phi===e.phi}},{key:"bearing",get:function(){return 180-Yt(this.phi)},set:function(e){this.phi=Math.PI-_o(e)}},{key:"pitch",get:function(){return Yt(this.theta)},set:function(e){this.theta=_o(e)}},{key:"longitude",get:function(){return Yt(this.phi)}},{key:"latitude",get:function(){return Yt(this.theta)}},{key:"lng",get:function(){return Yt(this.phi)}},{key:"lat",get:function(){return Yt(this.theta)}},{key:"z",get:function(){return(this.radius-1)*this.radiusScale}},{key:"set",value:function(e,n,i){return this.radius=e,this.phi=n,this.theta=i,this.check()}},{key:"clone",value:function(){return new t().copy(this)}},{key:"copy",value:function(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this.check()}},{key:"fromLngLatZ",value:function(e){var n=W(e,3),i=n[0],a=n[1],o=n[2];return this.radius=1+o/this.radiusScale,this.phi=_o(a),this.theta=_o(i),this.check()}},{key:"fromVector3",value:function(e){return this.radius=Mf(e),this.radius>0&&(this.theta=Math.atan2(e[0],e[1]),this.phi=Math.acos(We(e[2]/this.radius,-1,1))),this.check()}},{key:"toVector3",value:function(){return new z(0,0,this.radius).rotateX({radians:this.theta}).rotateZ({radians:this.phi})}},{key:"makeSafe",value:function(){return this.phi=Math.max(lC,Math.min(Math.PI-lC,this.phi)),this}},{key:"check",value:function(){if(!Number.isFinite(this.phi)||!Number.isFinite(this.theta)||!(this.radius>0))throw new Error("SphericalCoordinates: some fields set to invalid numbers");return this}}]),t}();var Hn={EPSILON1:.1,EPSILON2:.01,EPSILON3:.001,EPSILON4:1e-4,EPSILON5:1e-5,EPSILON6:1e-6,EPSILON7:1e-7,EPSILON8:1e-8,EPSILON9:1e-9,EPSILON10:1e-10,EPSILON11:1e-11,EPSILON12:1e-12,EPSILON13:1e-13,EPSILON14:1e-14,EPSILON15:1e-15,EPSILON16:1e-16,EPSILON17:1e-17,EPSILON18:1e-18,EPSILON19:1e-19,EPSILON20:1e-20,PI_OVER_TWO:Math.PI/2,PI_OVER_FOUR:Math.PI/4,PI_OVER_SIX:Math.PI/6,TWO_PI:Math.PI*2};var L_=`#if (defined(SHADER_TYPE_FRAGMENT) && defined(LIGHTING_FRAGMENT)) || (defined(SHADER_TYPE_VERTEX) && defined(LIGHTING_VERTEX))
1099
1100struct AmbientLight {
1101 vec3 color;
1102};
1103
1104struct PointLight {
1105 vec3 color;
1106 vec3 position;
1107 vec3 attenuation;
1108};
1109
1110struct DirectionalLight {
1111  vec3 color;
1112  vec3 direction;
1113};
1114
1115uniform AmbientLight lighting_uAmbientLight;
1116uniform PointLight lighting_uPointLight[MAX_LIGHTS];
1117uniform DirectionalLight lighting_uDirectionalLight[MAX_LIGHTS];
1118uniform int lighting_uPointLightCount;
1119uniform int lighting_uDirectionalLightCount;
1120
1121uniform bool lighting_uEnabled;
1122
1123float getPointLightAttenuation(PointLight pointLight, float distance) {
1124  return pointLight.attenuation.x
1125       + pointLight.attenuation.y * distance
1126       + pointLight.attenuation.z * distance * distance;
1127}
1128
1129#endif
1130`;function V7(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=H7(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
1131In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function H7(t,r){if(t){if(typeof t=="string")return fC(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);
1131if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return fC(t,r)}}function fC(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var W7={lightSources:{}};function k_(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=t.color,e=r===void 0?[0,0,0]:r,n=t.intensity,i=n===void 0?1:n;return e.map(function(a){return a*i/255})}function $7(t){var r=t.ambientLight,e=t.pointLights,n=e===void 0?[]:e,i=t.directionalLights,a=i===void 0?[]:i,o={};return r?o["lighting_uAmbientLight.color"]=k_(r):o["lighting_uAmbientLight.color"]=[0,0,0],n.forEach(function(s,u){o["lighting_uPointLight[".concat(u,"].color")]=k_(s),o["lighting_uPointLight[".concat(u,"].position")]=s.position,o["lighting_uPointLight[".concat(u,"].attenuation")]=s.attenuation||[1,0,0]}),o.lighting_uPointLightCount=n.length,a.forEach(function(s,u){o["lighting_uDirectionalLight[".concat(u,"].color")]=k_(s),o["lighting_uDirectionalLight[".concat(u,"].direction")]=s.direction}),o.lighting_uDirectionalLightCount=a.length,o}function cC(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:W7;if("lightSources"in t){var r=t.lightSources||{},e=r.ambientLight,n=r.pointLights,i=r.directionalLights,a=e||n&&n.length>0||i&&i.length>0;return a?Object.assign({},$7({ambientLight:e,pointLights:n,directionalLights:i}),{lighting_uEnabled:!0}):{lighting_uEnabled:!1}}if("lights"in t){var o={pointLights:[],directionalLights:[]},s=V7(t.lights||[]),u;try{for(s.s();!(u=s.n()).done;){var l=u.value;switch(l.type){case"ambient":o.ambientLight=l;break;case"directional":o.directionalLights.push(l);break;case"point":o.pointLights.push(l);break;default:}}}catch(f){s.e(f)}finally{s.f()}return cC({lightSources:o})}return{}}var kf={name:"lights",vs:L_,fs:L_,getUniforms:cC,defines:{MAX_LIGHTS:3}};var X7=new Uint8Array([0,255,255,255]),q7={pickingSelectedColor:null,pickingHighlightColor:X7,pickingActive:!1,pickingAttribute:!1};function Y7(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:q7,r={};if(t.pickingSelectedColor!==void 0)if(!t.pickingSelectedColor)r.picking_uSelectedColorValid=0;else{var e=t.pickingSelectedColor.slice(0,3);r.picking_uSelectedColorValid=1,r.picking_uSelectedColor=e}if(t.pickingHighlightColor){var n=Array.from(t.pickingHighlightColor,function(i){return i/255});Number.isFinite(n[3])||(n[3]=1),r.picking_uHighlightColor=n}return t.pickingActive!==void 0&&(r.picking_uActive=Boolean(t.pickingActive),r.picking_uAttribute=Boolean(t.pickingAttribute)),r}var K7=`uniform bool picking_uActive;
1132uniform bool picking_uAttribute;
1133uniform vec3 picking_uSelectedColor;
1134uniform bool picking_uSelectedColorValid;
1135
1136out vec4 picking_vRGBcolor_Avalid;
1137
1138const float COLOR_SCALE = 1. / 255.;
1139
1140bool picking_isColorValid(vec3 color) {
1141  return dot(color, vec3(1.0)) > 0.001;
1142}
1143
1144bool isVertexPicked(vec3 vertexColor) {
1145  return
1146    picking_uSelectedColorValid &&
1147    !picking_isColorValid(abs(vertexColor - picking_uSelectedColor));
1148}
1149
1150void picking_setPickingColor(vec3 pickingColor) {
1151  if (picking_uActive) {
1152    picking_vRGBcolor_Avalid.a = float(picking_isColorValid(pickingColor));
1153
1154    if (!picking_uAttribute) {
1155      picking_vRGBcolor_Avalid.rgb = pickingColor * COLOR_SCALE;
1156    }
1157  } else {
1158    picking_vRGBcolor_Avalid.a = float(isVertexPicked(pickingColor));
1159  }
1160}
1161
1162void picking_setPickingAttribute(float value) {
1163  if (picking_uAttribute) {
1164    picking_vRGBcolor_Avalid.r = value;
1165  }
1166}
1167void picking_setPickingAttribute(vec2 value) {
1168  if (picking_uAttribute) {
1169    picking_vRGBcolor_Avalid.rg = value;
1170  }
1171}
1172void picking_setPickingAttribute(vec3 value) {
1173  if (picking_uAttribute) {
1174    picking_vRGBcolor_Avalid.rgb = value;
1175  }
1176}
1177`,Z7=`uniform bool picking_uActive;
1178uniform vec3 picking_uSelectedColor;
1179uniform vec4 picking_uHighlightColor;
1180
1181in vec4 picking_vRGBcolor_Avalid;
1182vec4 picking_filterHighlightColor(vec4 color) {
1183  if (picking_uActive) {
1184    return color;
1185  }
1186  bool selected = bool(picking_vRGBcolor_Avalid.a);
1187
1188  if (selected) {
1189    float highLightAlpha = picking_uHighlightColor.a;
1190    float blendedAlpha = highLightAlpha + color.a * (1.0 - highLightAlpha);
1191    float highLightRatio = highLightAlpha / blendedAlpha;
1192
1193    vec3 blendedRGB = mix(color.rgb, picking_uHighlightColor.rgb, highLightRatio);
1194    return vec4(blendedRGB, blendedAlpha);
1195  } else {
1196    return color;
1197  }
1198}
1199vec4 picking_filterPickingColor(vec4 color) {
1200  if (picking_uActive) {
1201    if (picking_vRGBcolor_Avalid.a == 0.0) {
1202      discard;
1203    }
1204    return picking_vRGBcolor_Avalid;
1205  }
1206  return color;
1207}
1208vec4 picking_filterColor(vec4 color) {
1209  vec4 highightColor = picking_filterHighlightColor(color);
1210  return picking_filterPickingColor(highightColor);
1211}
1212
1213`,Mh={name:"picking",vs:K7,fs:Z7,getUniforms:Y7};var B_=`
1214uniform float lighting_uAmbient;
1215uniform float lighting_uDiffuse;
1216uniform float lighting_uShininess;
1217uniform vec3  lighting_uSpecularColor;
1218
1219vec3 lighting_getLightColor(vec3 surfaceColor, vec3 light_direction, vec3 view_direction, vec3 normal_worldspace, vec3 color) {
1220    vec3 halfway_direction = normalize(light_direction + view_direction);
1221    float lambertian = dot(light_direction, normal_worldspace);
1222    float specular = 0.0;
1223    if (lambertian > 0.0) {
1224      float specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0);
1225      specular = pow(specular_angle, lighting_uShininess);
1226    }
1227    lambertian = max(lambertian, 0.0);
1228    return (lambertian * lighting_uDiffuse * surfaceColor + specular * lighting_uSpecularColor) * color;
1229}
1230
1231vec3 lighting_getLightColor(vec3 surfaceColor, vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {
1232  vec3 lightColor = surfaceColor;
1233
1234  if (lighting_uEnabled) {
1235    vec3 view_direction = normalize(cameraPosition - position_worldspace);
1236    lightColor = lighting_uAmbient * surfaceColor * lighting_uAmbientLight.color;
1237
1238    for (int i = 0; i < MAX_LIGHTS; i++) {
1239      if (i >= lighting_uPointLightCount) {
1240        break;
1241      }
1242      PointLight pointLight = lighting_uPointLight[i];
1243      vec3 light_position_worldspace = pointLight.position;
1244      vec3 light_direction = normalize(light_position_worldspace - position_worldspace);
1245      lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);
1246    }
1247
1248    for (int i = 0; i < MAX_LIGHTS; i++) {
1249      if (i >= lighting_uDirectionalLightCount) {
1250        break;
1251      }
1252      DirectionalLight directionalLight = lighting_uDirectionalLight[i];
1253      lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);
1254    }
1255  }
1256  return lightColor;
1257}
1258
1259vec3 lighting_getSpecularLightColor(vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {
1260  vec3 lightColor = vec3(0, 0, 0);
1261  vec3 surfaceColor = vec3(0, 0, 0);
1262
1263  if (lighting_uEnabled) {
1264    vec3 view_direction = normalize(cameraPosition - position_worldspace);
1265
1266    for (int i = 0; i < MAX_LIGHTS; i++) {
1267      if (i >= lighting_uPointLightCount) {
1268        break;
1269      }
1270      PointLight pointLight = lighting_uPointLight[i];
1271      vec3 light_position_worldspace = pointLight.position;
1272      vec3 light_direction = normalize(light_position_worldspace - position_worldspace);
1273      lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);
1274    }
1275
1276    for (int i = 0; i < MAX_LIGHTS; i++) {
1277      if (i >= lighting_uDirectionalLightCount) {
1278        break;
1279      }
1280      DirectionalLight directionalLight = lighting_uDirectionalLight[i];
1281      lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);
1282    }
1283  }
1284  return lightColor;
1285}
1286`;var J7={};function Q7(t){var r=t.ambient,e=r===void 0?.35:r,n=t.diffuse,i=n===void 0?.6:n,a=t.shininess,o=a===void 0?32:a,s=t.specularColor,u=s===void 0?[30,30,30]:s;return{lighting_uAmbient:e,lighting_uDiffuse:i,lighting_uShininess:o,lighting_uSpecularColor:u.map(function(l){return l/255})}}function pC(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:J7;if(!("material"in t))return{};var r=t.material;return r?Q7(r):{lighting_uEnabled:!1}}var Dr={name:"gouraud-lighting",dependencies:[kf],vs:B_,defines:{LIGHTING_VERTEX:1},getUniforms:pC},xi={name:"phong-lighting",dependencies:[kf],fs:B_,defines:{LIGHTING_FRAGMENT:1},getUniforms:pC};var hC=`uniform mat4 u_MVPMatrix;
1287uniform mat4 u_ModelMatrix;
1288uniform mat4 u_NormalMatrix;
1289
1290varying vec3 pbr_vPosition;
1291varying vec2 pbr_vUV;
1292
1293#ifdef HAS_NORMALS
1294# ifdef HAS_TANGENTS
1295varying mat3 pbr_vTBN;
1296# else
1297varying vec3 pbr_vNormal;
1298# endif
1299#endif
1300
1301void pbr_setPositionNormalTangentUV(vec4 position, vec4 normal, vec4 tangent, vec2 uv)
1302{
1303  vec4 pos = u_ModelMatrix * position;
1304  pbr_vPosition = vec3(pos.xyz) / pos.w;
1305
1306#ifdef HAS_NORMALS
1307#ifdef HAS_TANGENTS
1308  vec3 normalW = normalize(vec3(u_NormalMatrix * vec4(normal.xyz, 0.0)));
1309  vec3 tangentW = normalize(vec3(u_ModelMatrix * vec4(tangent.xyz, 0.0)));
1310  vec3 bitangentW = cross(normalW, tangentW) * tangent.w;
1311  pbr_vTBN = mat3(tangentW, bitangentW, normalW);
1312#else
1313  pbr_vNormal = normalize(vec3(u_ModelMatrix * vec4(normal.xyz, 0.0)));
1314#endif
1315#endif
1316
1317#ifdef HAS_UV
1318  pbr_vUV = uv;
1319#else
1320  pbr_vUV = vec2(0.,0.);
1321#endif
1322}
1323`;var dC=`#if defined(USE_TEX_LOD) && !defined(FEATURE_GLSL_TEXTURE_LOD)
1324# error PBR fragment shader: Texture LOD is not available
1325#endif
1326
1327#if !defined(HAS_TANGENTS) && !defined(FEATURE_GLSL_DERIVATIVES)
1328# error PBR fragment shader: Derivatives are not available
1329#endif
1330
1331
1332#if (__VERSION__ < 300)
1333  #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL1COND; INCR)
1334#else
1335  #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL2COND; INCR)
1336#endif
1337
1338precision highp float;
1339
1340uniform bool pbr_uUnlit;
1341
1342#ifdef USE_IBL
1343uniform samplerCube u_DiffuseEnvSampler;
1344uniform samplerCube u_SpecularEnvSampler;
1345uniform sampler2D u_brdfLUT;
1346uniform vec2 u_ScaleIBLAmbient;
1347#endif
1348
1349#ifdef HAS_BASECOLORMAP
1350uniform sampler2D u_BaseColorSampler;
1351#endif
1352#ifdef HAS_NORMALMAP
1353uniform sampler2D u_NormalSampler;
1354uniform float u_NormalScale;
1355#endif
1356#ifdef HAS_EMISSIVEMAP
1357uniform sampler2D u_EmissiveSampler;
1358uniform vec3 u_EmissiveFactor;
1359#endif
1360#ifdef HAS_METALROUGHNESSMAP
1361uniform sampler2D u_MetallicRoughnessSampler;
1362#endif
1363#ifdef HAS_OCCLUSIONMAP
1364uniform sampler2D u_OcclusionSampler;
1365uniform float u_OcclusionStrength;
1366#endif
1367
1368#ifdef ALPHA_CUTOFF
1369uniform float u_AlphaCutoff;
1370#endif
1371
1372uniform vec2 u_MetallicRoughnessValues;
1373uniform vec4 u_BaseColorFactor;
1374
1375uniform vec3 u_Camera;
1376#ifdef PBR_DEBUG
1377uniform vec4 u_ScaleDiffBaseMR;
1378uniform vec4 u_ScaleFGDSpec;
1379#endif
1380
1381varying vec3 pbr_vPosition;
1382
1383varying vec2 pbr_vUV;
1384
1385#ifdef HAS_NORMALS
1386#ifdef HAS_TANGENTS
1387varying mat3 pbr_vTBN;
1388#else
1389varying vec3 pbr_vNormal;
1390#endif
1391#endif
1392
1393
1394struct PBRInfo
1395{
1396  float NdotL;
1397  float NdotV;
1398  float NdotH;
1399  float LdotH;
1400  float VdotH;
1401  float perceptualRoughness;
1402  float metalness;
1403  vec3 reflectance0;
1404  vec3 reflectance90;
1405  float alphaRoughness;
1406  vec3 diffuseColor;
1407  vec3 specularColor;
1408  vec3 n;
1409  vec3 v;
1410};
1411
1412const float M_PI = 3.141592653589793;
1413const float c_MinRoughness = 0.04;
1414
1415vec4 SRGBtoLINEAR(vec4 srgbIn)
1416{
1417#ifdef MANUAL_SRGB
1418#ifdef SRGB_FAST_APPROXIMATION
1419  vec3 linOut = pow(srgbIn.xyz,vec3(2.2));
1420#else
1421  vec3 bLess = step(vec3(0.04045),srgbIn.xyz);
1422  vec3 linOut = mix( srgbIn.xyz/vec3(12.92), pow((srgbIn.xyz+vec3(0.055))/vec3(1.055),vec3(2.4)), bLess );
1423#endif
1424  return vec4(linOut,srgbIn.w);;
1425#else
1426  return srgbIn;
1427#endif
1428}
1429
1430vec3 getNormal()
1431{
1432#ifndef HAS_TANGENTS
1433  vec3 pos_dx = dFdx(pbr_vPosition);
1434  vec3 pos_dy = dFdy(pbr_vPosition);
1435  vec3 tex_dx = dFdx(vec3(pbr_vUV, 0.0));
1436  vec3 tex_dy = dFdy(vec3(pbr_vUV, 0.0));
1437  vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t);
1438
1439#ifdef HAS_NORMALS
1440  vec3 ng = normalize(pbr_vNormal);
1441#else
1442  vec3 ng = cross(pos_dx, pos_dy);
1443#endif
1444
1445  t = normalize(t - ng * dot(ng, t));
1446  vec3 b = normalize(cross(ng, t));
1447  mat3 tbn = mat3(t, b, ng);
1448#else
1449  mat3 tbn = pbr_vTBN;
1450#endif
1451
1452#ifdef HAS_NORMALMAP
1453  vec3 n = texture2D(u_NormalSampler, pbr_vUV).rgb;
1454  n = normalize(tbn * ((2.0 * n - 1.0) * vec3(u_NormalScale, u_NormalScale, 1.0)));
1455#else
1456  vec3 n = normalize(tbn[2].xyz);
1457#endif
1458
1459  return n;
1460}
1461
1462
1463#ifdef USE_IBL
1464vec3 getIBLContribution(PBRInfo pbrInputs, vec3 n, vec3 reflection)
1465{
1466  float mipCount = 9.0;
1467  float lod = (pbrInputs.perceptualRoughness * mipCount);
1468  vec3 brdf = SRGBtoLINEAR(texture2D(u_brdfLUT,
1469    vec2(pbrInputs.NdotV, 1.0 - pbrInputs.perceptualRoughness))).rgb;
1470  vec3 diffuseLight = SRGBtoLINEAR(textureCube(u_DiffuseEnvSampler, n)).rgb;
1471
1472#ifdef USE_TEX_LOD
1473  vec3 specularLight = SRGBtoLINEAR(textureCubeLod(u_SpecularEnvSampler, reflection, lod)).rgb;
1474#else
1475  vec3 specularLight = SRGBtoLINEAR(textureCube(u_SpecularEnvSampler, reflection)).rgb;
1476#endif
1477
1478  vec3 diffuse = diffuseLight * pbrInputs.diffuseColor;
1479  vec3 specular = specularLight * (pbrInputs.specularColor * brdf.x + brdf.y);
1480  diffuse *= u_ScaleIBLAmbient.x;
1481  specular *= u_ScaleIBLAmbient.y;
1482
1483  return diffuse + specular;
1484}
1485#endif
1486
1487
1488vec3 diffuse(PBRInfo pbrInputs)
1489{
1490  return pbrInputs.diffuseColor / M_PI;
1491}
1492
1493vec3 specularReflection(PBRInfo pbrInputs)
1494{
1495  return pbrInputs.reflectance0 +
1496    (pbrInputs.reflectance90 - pbrInputs.reflectance0) *
1497    pow(clamp(1.0 - pbrInputs.VdotH, 0.0, 1.0), 5.0);
1498}
1499
1500
1501
1502float geometricOcclusion(PBRInfo pbrInputs)
1503{
1504  float NdotL = pbrInputs.NdotL;
1505  float NdotV = pbrInputs.NdotV;
1506  float r = pbrInputs.alphaRoughness;
1507
1508  float attenuationL = 2.0 * NdotL / (NdotL + sqrt(r * r + (1.0 - r * r) * (NdotL * NdotL)));
1509  float attenuationV = 2.0 * NdotV / (NdotV + sqrt(r * r + (1.0 - r * r) * (NdotV * NdotV)));
1510  return attenuationL * attenuationV;
1511}
1512
1513
1514
1515
1516
1517float microfacetDistribution(PBRInfo pbrInputs)
1518{
1519  float roughnessSq = pbrInputs.alphaRoughness * pbrInputs.alphaRoughness;
1520  float f = (pbrInputs.NdotH * roughnessSq - pbrInputs.NdotH) * pbrInputs.NdotH + 1.0;
1521  return roughnessSq / (M_PI * f * f);
1522}
1523
1524void PBRInfo_setAmbientLight(inout PBRInfo pbrInputs) {
1525  pbrInputs.NdotL = 1.0;
1526  pbrInputs.NdotH = 0.0;
1527  pbrInputs.LdotH = 0.0;
1528  pbrInputs.VdotH = 1.0;
1529}
1530
1531void PBRInfo_setDirectionalLight(inout PBRInfo pbrInputs, vec3 lightDirection) {
1532  vec3 n = pbrInputs.n;
1533  vec3 v = pbrInputs.v;
1534  vec3 l = normalize(lightDirection);
1535  vec3 h = normalize(l+v);
1536
1537  pbrInputs.NdotL = clamp(dot(n, l), 0.001, 1.0);
1538  pbrInputs.NdotH = clamp(dot(n, h), 0.0, 1.0);
1539  pbrInputs.LdotH = clamp(dot(l, h), 0.0, 1.0);
1540  pbrInputs.VdotH = clamp(dot(v, h), 0.0, 1.0);
1541}
1542
1543void PBRInfo_setPointLight(inout PBRInfo pbrInputs, PointLight pointLight) {
1544  vec3 light_direction = normalize(pointLight.position - pbr_vPosition);
1545  PBRInfo_setDirectionalLight(pbrInputs, light_direction);
1546}
1547
1548vec3 calculateFinalColor(PBRInfo pbrInputs, vec3 lightColor) {
1549  vec3 F = specularReflection(pbrInputs);
1550  float G = geometricOcclusion(pbrInputs);
1551  float D = microfacetDistribution(pbrInputs);
1552  vec3 diffuseContrib = (1.0 - F) * diffuse(pbrInputs);
1553  vec3 specContrib = F * G * D / (4.0 * pbrInputs.NdotL * pbrInputs.NdotV);
1554  return pbrInputs.NdotL * lightColor * (diffuseContrib + specContrib);
1555}
1556
1557vec4 pbr_filterColor(vec4 colorUnused)
1558{
1559#ifdef HAS_BASECOLORMAP
1560  vec4 baseColor = SRGBtoLINEAR(texture2D(u_BaseColorSampler, pbr_vUV)) * u_BaseColorFactor;
1561#else
1562  vec4 baseColor = u_BaseColorFactor;
1563#endif
1564
1565#ifdef ALPHA_CUTOFF
1566  if (baseColor.a < u_AlphaCutoff) {
1567    discard;
1568  }
1569#endif
1570
1571  vec3 color = vec3(0, 0, 0);
1572
1573  if(pbr_uUnlit){
1574    color.rgb = baseColor.rgb;
1575  }
1576  else{
1577
1578
1579    float perceptualRoughness = u_MetallicRoughnessValues.y;
1580    float metallic = u_MetallicRoughnessValues.x;
1581#ifdef HAS_METALROUGHNESSMAP
1582
1583    vec4 mrSample = texture2D(u_MetallicRoughnessSampler, pbr_vUV);
1584    perceptualRoughness = mrSample.g * perceptualRoughness;
1585    metallic = mrSample.b * metallic;
1586#endif
1587    perceptualRoughness = clamp(perceptualRoughness, c_MinRoughness, 1.0
1587);
1588    metallic = clamp(metallic, 0.0, 1.0);
1589
1590    float alphaRoughness = perceptualRoughness * perceptualRoughness;
1591
1592    vec3 f0 = vec3(0.04);
1593    vec3 diffuseColor = baseColor.rgb * (vec3(1.0) - f0);
1594    diffuseColor *= 1.0 - metallic;
1595    vec3 specularColor = mix(f0, baseColor.rgb, metallic);
1596    float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b);
1597
1598
1599
1600    float reflectance90 = clamp(reflectance * 25.0, 0.0, 1.0);
1601    vec3 specularEnvironmentR0 = specularColor.rgb;
1602    vec3 specularEnvironmentR90 = vec3(1.0, 1.0, 1.0) * reflectance90;
1603
1604    vec3 n = getNormal();
1605    vec3 v = normalize(u_Camera - pbr_vPosition);
1606
1607    float NdotV = clamp(abs(dot(n, v)), 0.001, 1.0);
1608    vec3 reflection = -normalize(reflect(v, n));
1609
1610    PBRInfo pbrInputs = PBRInfo(
1611      0.0,
1612      NdotV,
1613      0.0,
1614      0.0,
1615      0.0,
1616      perceptualRoughness,
1617      metallic,
1618      specularEnvironmentR0,
1619      specularEnvironmentR90,
1620      alphaRoughness,
1621      diffuseColor,
1622      specularColor,
1623      n,
1624      v
1625    );
1626
1627#ifdef USE_LIGHTS
1628    PBRInfo_setAmbientLight(pbrInputs);
1629    color += calculateFinalColor(pbrInputs, lighting_uAmbientLight.color);
1630    SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uDirectionalLightCount, i++) {
1631      if (i < lighting_uDirectionalLightCount) {
1632        PBRInfo_setDirectionalLight(pbrInputs, lighting_uDirectionalLight[i].direction);
1633        color += calculateFinalColor(pbrInputs, lighting_uDirectionalLight[i].color);
1634      }
1635    }
1636    SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uPointLightCount, i++) {
1637      if (i < lighting_uPointLightCount) {
1638        PBRInfo_setPointLight(pbrInputs, lighting_uPointLight[i]);
1639        float attenuation = getPointLightAttenuation(lighting_uPointLight[i], distance(lighting_uPointLight[i].position, pbr_vPosition));
1640        color += calculateFinalColor(pbrInputs, lighting_uPointLight[i].color / attenuation);
1641      }
1642    }
1643#endif
1644#ifdef USE_IBL
1645    color += getIBLContribution(pbrInputs, n, reflection);
1646#endif
1647#ifdef HAS_OCCLUSIONMAP
1648    float ao = texture2D(u_OcclusionSampler, pbr_vUV).r;
1649    color = mix(color, color * ao, u_OcclusionStrength);
1650#endif
1651
1652#ifdef HAS_EMISSIVEMAP
1653    vec3 emissive = SRGBtoLINEAR(texture2D(u_EmissiveSampler, pbr_vUV)).rgb * u_EmissiveFactor;
1654    color += emissive;
1655#endif
1656
1657#ifdef PBR_DEBUG
1658
1659
1660
1661
1662
1663    color = mix(color, baseColor.rgb, u_ScaleDiffBaseMR.y);
1664    color = mix(color, vec3(metallic), u_ScaleDiffBaseMR.z);
1665    color = mix(color, vec3(perceptualRoughness), u_ScaleDiffBaseMR.w);
1666#endif
1667
1668  }
1669
1670  return vec4(pow(color,vec3(1.0/2.2)), baseColor.a);
1671}
1672`;var ha={name:"pbr",vs:hC,fs:dC,defines:{LIGHTING_FRAGMENT:1},dependencies:[kf]};var e$=`attribute float transform_elementID;
1673vec2 transform_getPixelSizeHalf(vec2 size) {
1674  return vec2(1.) / (2. * size);
1675}
1676
1677vec2 transform_getPixelIndices(vec2 texSize, vec2 pixelSizeHalf) {
1678  float yIndex = floor((transform_elementID / texSize[0]) + pixelSizeHalf[1]);
1679  float xIndex = transform_elementID - (yIndex * texSize[0]);
1680  return vec2(xIndex, yIndex);
1681}
1682vec2 transform_getTexCoord(vec2 size) {
1683  vec2 pixelSizeHalf = transform_getPixelSizeHalf(size);
1684  vec2 indices = transform_getPixelIndices(size, pixelSizeHalf);
1685  vec2 coord = indices / size + pixelSizeHalf;
1686  return coord;
1687}
1688vec2 transform_getPos(vec2 size) {
1689  vec2 texCoord = transform_getTexCoord(size);
1690  vec2 pos = (texCoord * (2.0, 2.0)) - (1., 1.);
1691  return pos;
1692}
1693vec4 transform_getInput(sampler2D texSampler, vec2 size) {
1694  vec2 texCoord = transform_getTexCoord(size);
1695  vec4 textureColor = texture2D(texSampler, texCoord);
1696  return textureColor;
1697}
1698`,F_={name:"transform",vs:e$,fs:null};function vC(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=t$(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
1699In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function t$(t,r){if(t){if(typeof t=="string")return mC(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);
1699if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return mC(t,r)}}function mC(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var Yr=function(){function t(r){A(this,t),this.gl=r,this._programCache={},this._getUniforms={},this._registeredModules={},this._hookFunctions=[],this._defaultModules=[],this._hashes={},this._hashCounter=0,this.stateHash=0,this._useCounts={}}return T(t,[{key:"addDefaultModule",value:function(e){this._defaultModules.find(function(n){return n.name===e.name})||this._defaultModules.push(e),this.stateHash++}},{key:"removeDefaultModule",value:function(e){var n=typeof e=="string"?e:e.name;this._defaultModules=this._defaultModules.filter(function(i){return i.name!==n}),this.stateHash++}},{key:"addShaderHook",value:function(e,n){n&&(e=Object.assign(n,{hook:e})),this._hookFunctions.push(e),this.stateHash++}},{key:"get",value:function(){var e=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.vs,a=i===void 0?"":i,o=n.fs,s=o===void 0?"":o,u=n.defines,l=u===void 0?{}:u,f=n.inject,p=f===void 0?{}:f,h=n.varyings,d=h===void 0?[]:h,v=n.bufferMode,m=v===void 0?35981:v,g=n.transpileToGLSL100,y=g===void 0?!1:g,_=this._getModuleList(n.modules),b=this._getHash(a),x=this._getHash(s),w=_.map(function(K){return e._getHash(K.name)}).sort(),P=d.map(function(K){return e._getHash(K)}),E=Object.keys(l).sort(),C=Object.keys(p).sort(),I=[],O=[],D=vC(E),N;try{for(D.s();!(N=D.n()).done;){var H=N.value;I.push(this._getHash(H)),I.push(this._getHash(l[H]))}}catch(K){D.e(K)}finally{D.f()}var $=vC(C),ee;
1699try{for($.s();!(ee=$.n()).done;){var V=ee.value;O.push(this._getHash(V)),O.push(this._getHash(p[V]))}}catch(K){$.e(K)}finally{$.f()}var U="".concat(b,"/").concat(x,"D").concat(I.join("/"),"M").concat(w.join("/"),"I").concat(O.join("/"),"V").concat(P.join("/"),"H").concat(this.stateHash,"B").concat(m).concat(y?"T":"");if(!this._programCache[U]){var X=f_(this.gl,{vs:a,fs:s,modules:_,inject:p,defines:l,hookFunctions:this._hookFunctions,transpileToGLSL100:y});this._programCache[U]=new la(this.gl,{hash:U,vs:X.vs,fs:X.fs,varyings:d,bufferMode:m}),this._getUniforms[U]=X.getUniforms||function(K){},this._useCounts[U]=0}return this._useCounts[U]++,this._programCache[U]}},{key:"getUniforms",value:function(e){return this._getUniforms[e.hash]||null}},{key:"release",value:function(e){var n=e.hash;this._useCounts[n]--,this._useCounts[n]===0&&(this._programCache[n].delete(),delete this._programCache[n],delete this._getUniforms[n],delete this._useCounts[n])}},{key:"_getHash",value:function(e){return this._hashes[e]===void 0&&(this._hashes[e]=this._hashCounter++),this._hashes[e]}},{key:"_getModuleList",value:function(){for(var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=new Array(this._defaultModules.length+e.length),i={},a=0,o=0,s=this._defaultModules.length;o<s;++o){var u=this._defaultModules[o],l=u.name;n[a++]=u,i[l]=!0}for(var f=0,p=e.length;f<p;++f){var h=e[f],d=h.name;i[d]||(n[a++]=h,i[d]=!0)}return n.length=a,n}}],[{key:"getDefaultProgramManager",value:function(e){return e.luma=e.luma||{},e.luma.defaultProgramManager=e.luma.defaultProgramManager||new t(e),e.luma.defaultProgramManager}}]),t}();k();function gC(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function r$(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?gC(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):gC(Object(e)).forEac
1699h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var n$={POSITION:"positions",NORMAL:"normals",COLOR_0:"colors",TEXCOORD_0:"texCoords",TEXCOORD_1:"texCoords1",TEXCOORD_2:"texCoords2"};function yC(t,r,e){var n={},i=r.indices;for(var a in r.attributes){var o=r.attributes[a],s=i$(a,e);if(a==="indices")i=o;else if(o.constant)n[s]=o.value;else{var u=o.value,l=r$({},o);delete l.value,n[s]=[new Pe(t,u),l],a$(a,l)}}if(i){var f=i.value||i;re(f instanceof Uint16Array||f instanceof Uint32Array,'attribute array for "indices" must be of integer type');var p={size:1,isIndexed:i.isIndexed===void 0?!0:i.isIndexed};n.indices=[new Pe(t,{data:f,target:34963}),p]}return n}function i$(t,r){var e=r||{},n=e.attributeMap,i=n===void 0?n$:n;return i&&i[t]||t}function a$(t,r){var e;switch(t){case"texCoords":case"texCoord1":case"texCoord2":case"texCoord3":e="uvs";break;case"vertices":case"positions":case"normals":case"pickingColors":e="vectors";break;default:}switch(e){case"vectors":r.size=r.size||3;break;case"uvs":r.size=r.size||2;break;default:}re(Number.isFinite(r.size),"attribute ".concat(t," needs size"))}var Ks=2,o$=1e4,s$="Model needs drawMode and vertexCount",_C=function(){},u$={},Ie=function(){function t(r){A(this,t);var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.id,i=n===void 0?$e("model"):n;re(vi(r)),this.id=i,this.gl=r,this.id=e.id||$e("Model"),this.lastLogTime=0,this.animated=!1,this.initialize(e)}return T(t,[{key:"initialize",value:function(e){this.props={},this.programManager=e.programManager||Yr.getDefaultProgramManager(this.gl),this._programManagerState=-1,this._managedProgram=!1;var n=e.program,i=n===void 0?null:n,a=e.vs,o=e.fs,s=e.modules,u=e.defines,l=e.inject,f=e.varyings,p=e.bufferMode,h=e.transpileToGLSL100;this.programProps={program:i,vs:a,fs:o,modules:s,defines:u,inject:l,varyings:f,bufferMode:p,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(e.moduleSettings))),this.drawMode=e.drawMode!==void 0?e.drawMode:4,this.vertexCount=e.vertexCount||0,this.geometryBuffers={},this.isInstanced=e.isInstanced||e.instanced||e.instanceCount>0,this._setModelProps(e),this.geometry={},re(this.drawMode!==void 0&&Number.isFinite(this.vertexCount),s$)}},{key:"setProps",value:function(e){this._setModelProps(e)}},{key:"delete",value:function(){for(var e in this._attributes)this._attributes[e]!==this.attributes[e]&&this._attributes[e].delete();this._managedProgram&&(this.programManager.release(this.program),this._managedProgram=!1),this.vertexArray.delete(),this._deleteGeometryBuffers()}},{key:"getDrawMode",value:function(){return this.drawMode}},{key:"getVertexCount",value:function(){return this.vertexCount}},{key:"getInstanceCount",value:function(){return this.instanceCount}},{key:"getAttributes",value:function(){return this.attributes}},{key:"getProgram",value:function(){return this.program}},{key:"setProgram",value:function(e){var n=e.program,i=e.vs,a=e.fs,o=e.modules,s=e.defines,u=e.inject,l=e.varyings,f=e.bufferMode,p=e.transpileToGLSL100;this.programProps={program:n,vs:i,fs:a,modules:o,defines:s,inject:u,varyings:l,bufferMode:f,transpileToGLSL100:p},this._programDirty=!0}},{key:"getUniforms",value:function(){return this.uniforms}},{key:"setDrawMode",value:function(e){return this.drawMode=e,this}},{key:"setVertexCount",value:function(e){return re(Number.isFinite(e)),this.vertexCount=e,this}},{key:"setInstanceCount",value:function(e){return re(Number.isFinite(e)),this.instanceCount=e,this}},{key:"setGeometry",value:function(e){return this.drawMode=e.drawMode,this.vertexCount=e.getVertexCount(),this._deleteGeometryBuffers(),this.geometryBuffers=yC(this.gl,e),this.vertexArray.setAttributes(this.geometryBuffers),this}},{key:"setAttributes",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Gn(e))return this;var n={};for(var i in e){var a=e[i];n[i]=a.getValue?a.getValue():a}return this.vertexArray.setAttributes(n),this}},{key:"setUniforms",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Object.assign(this.uniforms,e),this}},{key:"getModuleUniforms",value:function(e){this._checkProgram();var n=this.programManager.getUniforms(this.program);return n?n(e):{}}},{key:"updateModuleSettings",value:function(e){var n=this.getModuleUniforms(e||{});return this.setUniforms(n)}},{key:"clear",value:function(e){return qr(this.program.gl,e),this}},{key:"draw",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this._checkProgram();var n=e.moduleSettings,i=n===void 0?null:n,a=e.framebuffer,o=e.uniforms,s=o===void 0?{}:o,u=e.attributes,l=u===void 0?{}:u,f=e.transformFeedback,p=f===void 0?this.transformFeedback:f,h=e.parameters,d=h===void 0?{}:h,v=e.vertexArray,m=v===void 0?this.vertexArray:v;this.setAttributes(l),this.updateModuleSettings(i),this.setUniforms(s);var g;fe.priority>=Ks&&(g=this._logDrawCallStart(Ks));var y=this.vertexArray.getDrawParams(),_=this.props,b=_.isIndexed,x=b===void 0?y.isIndexed:b,w=_.indexType,P=w===void 0?y.indexType:w,E=_.indexOffset,C=E===void 0?y.indexOffset:E,I=_.vertexArrayInstanced,O=I===void 0?y.isInstanced:I;O&&!this.isInstanced&&fe.warn("Found instanced attributes on non-instanced model",this.id)();var D=this.isInstanced,N=this.instanceCount,H=this.props,$=H.onBeforeRender,ee=$===void 0?_C:$,V=H.onAfterRender,U=V===void 0?_C:V;ee(),this.program.setUniforms(this.uniforms);var X=this.program.draw(Object.assign(u$,e,{logPriority:g,uniforms:null,framebuffer:a,parameters:d,drawMode:this.getDrawMode(),vertexCount:this.getVertexCount(),vertexArray:m,transformFeedback:p,isIndexed:x,indexType:P,isInstanced:D,instanceCount:N,offset:x?C:0}));return U(),fe.priority>=Ks&&this._logDrawCallEnd(g,m,a),X}},{key:"transform",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.discard,i=n===void 0?!0:n,a=e.feedbackBuffers,o=e.unbindModels,s=o===void 0?[]:o,u=e.parameters;a&&this._setFeedbackBuffers(a),i&&(u=Object.assign({},u,c({}
1699,35977,i))),s.forEach(function(l){return l.vertexArray.unbindBuffers()});try{this.draw(Object.assign({},e,{parameters:u}))}finally{s.forEach(function(l){return l.vertexArray.bindBuffers()})}return this}},{key:"render",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return fe.warn("Model.render() is deprecated. Use Model.setUniforms() and Model.draw()")(),this.setUniforms(e).draw()}},{key:"_setModelProps",value:function(e){Object.assign(this.props,e),"uniforms"in e&&this.setUniforms(e.uniforms),"pickable"in e&&(this.pickable=e.pickable),"instanceCount"in e&&(this.instanceCount=e.instanceCount),"geometry"in e&&this.setGeometry(e.geometry),"attributes"in e&&this.setAttributes(e.attributes),"_feedbackBuffers"in e&&this._setFeedbackBuffers(e._feedbackBuffers)}},{key:"_checkProgram",value:function(){var e=this._programDirty||this.programManager.stateHash!==this._programManagerState;if(e){var n=this.programProps.program;if(n)this._managedProgram=!1;else{var i=this.programProps,a=i.vs,o=i.fs,s=i.modules,u=i.inject,l=i.defines,f=i.varyings,p=i.bufferMode,h=i.transpileToGLSL100;n=this.programManager.get({vs:a,fs:o,modules:s,inject:u,defines:l,varyings:f,bufferMode:p,transpileToGLSL100:h}),this.program&&this._managedProgram&&this.programManager.release(this.program),this._programManagerState=this.programManager.stateHash,this._managedProgram=!0}re(n instanceof la,"Model needs a program"),this._programDirty=!1,n!==this.program&&(this.program=n,this.vertexArray?this.vertexArray.setProps({program:this.program,attributes:this.vertexArray.attributes}):this.vertexArray=new q0(this.gl,{program:this.program}),this.setUniforms(Object.assign({},this.getModuleUniforms())))}}},{key:"_deleteGeometryBuffers",value:function(){for(var e in this.geometryBuffers){var n=this.geometryBuffers[e][0]||this.geometryBuffers[e];n instanceof Pe&&n.delete()}}},{key:"_setAnimationProps",value:function(e){this.animated&&re(e,"Model.draw(): animated uniforms but no animationProps")}},{key:"_setFeedbackBuffers",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Gn(e))return this;var n=this.program.gl;return this.transformFeedback=this.transformFeedback||new fa(n,{program:this.program}),this.transformFeedback.setBuffers(e),this}},{key:"_logDrawCallStart",value:function(e){var n=e>3?0:o$;if(!(Date.now()-this.lastLogTime<n))return this.lastLogTime=Date.now(),fe.group(Ks,">>> DRAWING MODEL ".concat(this.id),{collapsed:fe.level<=2})(),e}},{key:"_logDrawCallEnd",value:function(e,n,i,a){if(e!==void 0){var o=Z0({vertexArray:n,header:"".concat(this.id," attributes"),attributes:this._attributes}),s=Zp({header:"".concat(this.id," uniforms"),program:this.program,uniforms:Object.assign({},this.program.uniforms,i)}),u=s.table,l=s.unusedTable,f=s.unusedCount,p=Zp({header:"".concat(this.id," uniforms"),program:this.program,uniforms:Object.assign({},this.program.uniforms,i),undefinedOnly:!0}),h=p.table,d=p.count;d>0&&fe.log("MISSING UNIFORMS",Object.keys(h))(),f>0&&fe.log("UNUSED UNIFORMS",Object.keys(l))();var v=J0(this.vertexArray.configuration);fe.table(e,o)(),fe.table(e,u)(),fe.table(e+1,v)(),a&&a.log({logLevel:Ks,message:"Rendered to ".concat(a.id)}),fe.groupEnd(Ks)()}}}]),t}();F();j();F();j();function l$(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=f$(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
1700In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function f$(t,r){if(t){if(typeof t=="string")return bC(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return bC(t,r)}}function bC(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var xC=function(){function t(r){A(this,t);var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.gl=r,this.currentIndex=0,this.feedbackMap={},this.varyings=null,this.bindings=[],this.resources={},this._initialize(e),Object.seal(this)}return T(t,[{key:"setupResources",value:function(e){var n=l$(this.bindings),i;try{for(n.s();!(i=n.n()).done;){var a=i.value;this._setupTransformFeedback(a,e)}}catch(o){n.e(o)}finally{n.f()}}},{key:"updateModelProps",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=this.varyings;return n.length>0&&(e=Object.assign({},e,{varyings:n})),e}},{key:"getDrawOptions",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=this.bindings[this.currentIndex],i=n.sourceBuffers,a=n.transformFeedback,o=Object.assign({},i,e.attributes);return{attributes:o,transformFeedback:a}}},{key:"swap",value:function(){return this.feedbackMap?(this.currentIndex=this._getNextIndex(),!0):!1}},{key:"update",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this._setupBuffers(e)}},{key:"getBuffer",value:function(e){var n=this.bindings[this.currentIndex].feedbackBuffers,i=e?n[e]:null;return i?i instanceof Pe?i:i.buffer:null}},{key:"getData",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.varyingName,i=this.getBuffer(n);return i?i.getData():null}},{key:"delete",value:function(){for(var e in this.resources)this.resources[e].delete()}},{key:"_initialize",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this._setupBuffers(e),this.varyings=e.varyings||Object.keys(this.bindings[this.currentIndex].feedbackBuffers),this.varyings.length>0&&re(ge(this.gl))}},{key:"_getFeedbackBuffers",value:function(e){var n=e.sourceBuffers,i=n===void 0?{}:n,a={};if(this.bindings[this.currentIndex]&&Object.assign(a,this.bindings[this.currentIndex].feedbackBuffers),this.feedbackMap)for(var o in this.feedbackMap){var s=this.feedbackMap[o];o in i&&(a[s]=o)}Object.assign(a,e.feedbackBuffers);for(var u in a){var l=a[u];if(typeof l=="string"){var f=i[l],p=f.byteLength,h=f.usage,d=f.accessor;a[u]=this._createNewBuffer(u,{byteLength:p,usage:h,accessor:d})}}return a}},{key:"_setupBuffers",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.sourceBuffers,i=n===void 0?null:n;Object.assign(this.feedbackMap,e.feedbackMap);var a=this._getFeedbackBuffers(e);this._updateBindings({sourceBuffers:i,feedbackBuffers:a})}},{key:"_setupTransformFeedback",value:function(e,n){var i=n.model,a=i.program;e.transformFeedback=new fa(this.gl,{program:a,buffers:e.feedbackBuffers})}},{key:"_updateBindings",value:function(e){if(this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],e),this.feedbackMap){var n=this._swapBuffers(this.bindings[this.currentIndex]),i=n.sourceBuffers,a=n.feedbackBuffers,o=this._getNextIndex();this.bindings[o]=this._updateBinding(this.bindings[o],{sourceBuffers:i,feedbackBuffers:a})}}},{key:"_updateBinding",value:function(e,n){return e?(Object.assign(e.sourceBuffers,n.sourceBuffers),Object.assign(e.feedbackBuffers,n.feedbackBuffers),e.transformFeedback&&e.transformFeedback.setBuffers(e.feedbackBuffers),e):{sourceBuffers:Object.assign({},n.sourceBuffers),feedbackBuffers:Object.assign({},n.feedbackBuffers)}}},{key:"_swapBuffers",value:function(e){if(!this.feedbackMap)return null;var n=Object.assign({},e.sourceBuffers),i=Object.assign({},e.feedbackBuffers);for(var a in this.feedbackMap){var o=this.feedbackMap[a];n[a]=e.feedbackBuffers[o],i[o]=e.sourceBuffers[a],re(i[o]instanceof Pe)}return{sourceBuffers:n,feedbackBuffers:i}}},{key:"_createNewBuffer",value:function(e,n){var i=new Pe(this.gl,n);return this.resources[e]&&this.resources[e].delete(),this.resources[e]=i,i}},{key:"_getNextIndex",value:function(){return(this.currentIndex+1)%2}}]),t}();F();j();k();var c$="transform_uSampler_",Ih="transform_uSize_",AC="transform_position";function SC(t){var r=t.vs,e=t.sourceTextureMap,n=t.targetTextureVarying,i=t.targetTexture,a=Object.keys(e),o=a.length,s=null,u={}
1700,l=r,f={};if(o>0||n){var p=l.split(`
1701`),h=p.slice();if(p.forEach(function(y,_,b){if(o>0){var x=v$(y,e);if(x){var w=x.updatedLine,P=x.inject;h[_]=w,f=Gs([f,P]),Object.assign(u,x.samplerTextureMap),o--}}n&&!s&&(s=d$(y,n))}),n){re(i);var d="".concat(Ih).concat(n),v="uniform vec2 ".concat(d,`;
1702`),m="     vec2 ".concat(AC," = transform_getPos(").concat(d,`);
1703     gl_Position = vec4(`).concat(AC,`, 0, 1.);
1704`),g={"vs:#decl":v,"vs:#main-start":m};f=Gs([f,g])}l=h.join(`
1705`)}return{vs:l,targetTextureType:s,inject:f,samplerTextureMap:u}}function TC(t){var r=t.sourceTextureMap,e=t.targetTextureVarying,n=t.targetTexture,i={},a,o;e&&(a=n.width,o=n.height,i["".concat(Ih).concat(e)]=[a,o]);for(var s in r){var u=r[s];a=u.width,o=u.height,i["".concat(Ih).concat(s)]=[a,o]}return i}function p$(t){return ah(t,["attribute","in"])}function h$(t){var r="".concat(c$).concat(t),e="".concat(Ih).concat(t),n="  uniform sampler2D ".concat(r,`;
1706  uniform vec2 `).concat(e,";");return{samplerName:r,sizeName:e,uniformDeclerations:n}}function d$(t,r){var e=ah(t,["varying","out"]);return e&&e.name===r?e.type:null}function v$(t,r){var e={},n=p$(t);if(!n)return null;var i=n.type,a=n.name;if(a&&r[a]){var o="// ".concat(t," => Replaced by Transform with a sampler"),s=h$(a),u=s.samplerName,l=s.sizeName,f=s.uniformDeclerations,p=c_(i),h="  ".concat(i," ").concat(a," = transform_getInput(").concat(u,", ").concat(l,").").concat(p,`;
1707`);e[u]=a;var d={"vs:#decl":f,"vs:#main-start":h};return{updatedLine:o,inject:d,samplerTextureMap:e}}return null}var Zs,m$=(Zs={},c(Zs,10241,9728),c(Zs,10240,9728),c(Zs,10242,33071),c(Zs,10243,33071),Zs),g$="transform_output",wC=function(){function t(r){A(this,t);var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.gl=r,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)}return T(t,[{key:"updateModelProps",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=this._processVertexShader(e);return Object.assign({},e,n)}},{key:"getDrawOptions",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=this.bindings[this.currentIndex],i=n.sourceBuffers,a=n.sourceTextures,o=n.framebuffer,s=n.targetTexture,u=Object.assign({},i,e.attributes),l=Object.assign({},e.uniforms),f=Object.assign({},e.parameters),p=e.discard;if(this.hasSourceTextures||this.hasTargetTexture){u.transform_elementID=this.elementIDBuffer;for(var h in this.samplerTextureMap){var d=this.samplerTextureMap[h];l[h]=a[d]}this._setSourceTextureParameters();var v=TC({sourceTextureMap:a,targetTextureVarying:this.targetTextureVarying,targetTexture:s});Object.assign(l,v)}return this.hasTargetTexture&&(p=!1,f.viewport=[0,0,o.width,o.height]),{attributes:u,framebuffer:o,uniforms:l,discard:p,parameters:f}}},{key:"swap",value:function(){return this._swapTexture?(this.currentIndex=this._getNextIndex(),!0):!1}},{key:"update",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this._setupTextures(e)}},{key:"getTargetTexture",value:function(){var e=this.bindings[this.currentIndex].targetTexture;return e}},{key:"getData",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.packed,i=n===void 0?!1:n,a=this.bindings[this.currentIndex].framebuffer,o=gn(a);if(!i)return o;for(var s=o.constructor,u=p_(this.targetTextureType),l=new s(o.length*u/4),f=0,p=0;p<o.length;p+=4)for(var h=0;h<u;h++)l[f++]=o[p+h];return l}},{key:"getFramebuffer",value:function(){var e=this.bindings[this.currentIndex];return e.framebuffer}},{key:"delete",value:function(){this.ownTexture&&this.ownTexture.delete(),this.elementIDBuffer&&this.elementIDBuffer.delete()}},{key:"_initialize",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e._targetTextureVarying,i=e._swapTexture;this._swapTexture=i,this.targetTextureVarying=n,this.hasTargetTexture=n,this._setupTextures(e)}},{key:"_createTargetTexture",value:function(e){var n=e.sourceTextures,i=e.textureOrReference;if(i instanceof Ce)return i;var a=n[i];return a?(this._targetRefTexName=i,this._createNewTexture(a)):null}},{key:"_setupTextures",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.sourceBuffers,i=e._sourceTextures,a=i===void 0?{}:i,o=e._targetTexture,s=this._createTargetTexture({sourceTextures:a,textureOrReference:o});this.hasSourceTextures=this.hasSourceTextures||a&&Object.keys(a).length>0,this._updateBindings({sourceBuffers:n,sourceTextures:a,targetTexture:s}),"elementCount"in e&&this._updateElementIDBuffer(e.elementCount)}
1707},{key:"_updateElementIDBuffer",value:function(e){if(!(typeof e!="number"||this.elementCount>=e)){var n=new Float32Array(e);n.forEach(function(i,a,o){o[a]=a}),this.elementIDBuffer?this.elementIDBuffer.setData({data:n}):this.elementIDBuffer=new Pe(this.gl,{data:n,accessor:{size:1}}),this.elementCount=e}}},{key:"_updateBindings",value:function(e){if(this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],e),this._swapTexture){var n=this._swapTextures(this.bindings[this.currentIndex]),i=n.sourceTextures,a=n.targetTexture,o=this._getNextIndex();this.bindings[o]=this._updateBinding(this.bindings[o],{sourceTextures:i,targetTexture:a})}}},{key:"_updateBinding",value:function(e,n){var i=n.sourceBuffers,a=n.sourceTextures,o=n.targetTexture;if(e||(e={sourceBuffers:{},sourceTextures:{},targetTexture:null}),Object.assign(e.sourceTextures,a),Object.assign(e.sourceBuffers,i),o){e.targetTexture=o;var s=o.width,u=o.height,l=e,f=l.framebuffer;f?(f.update({attachments:c({},36064,o),resizeAttachments:!1}),f.resize({width:s,height:u})):e.framebuffer=new Le(this.gl,{id:"transform-framebuffer",width:s,height:u,attachments:c({},36064,o)})}return e}},{key:"_setSourceTextureParameters",value:function(){var e=this.currentIndex,n=this.bindings[e].sourceTextures;for(var i in n)n[i].setParameters(m$)}},{key:"_swapTextures",value:function(e){if(!this._swapTexture)return null;var n=Object.assign({},e.sourceTextures);n[this._swapTexture]=e.targetTexture;var i=e.sourceTextures[this._swapTexture];return{sourceTextures:n,targetTexture:i}}},{key:"_createNewTexture",value:function(e){var n,i=js(e,{parameters:(n={},c(n,10241,9728),c(n,10240,9728),c(n,10242,33071),c(n,10243,33071),n),pixelStore:c({},37440,!1)});return this.ownTexture&&this.ownTexture.delete(),this.ownTexture=i,i}},{key:"_getNextIndex",value:function(){return(this.currentIndex+1)%2}},{key:"_processVertexShader",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=this.bindings[this.currentIndex],i=n.sourceTextures,a=n.targetTexture,o=SC({vs:e.vs,sourceTextureMap:i,targetTextureVarying:this.targetTextureVarying,targetTexture:a}),s=o.vs,u=o.uniforms,l=o.targetTextureType,f=o.inject,p=o.samplerTextureMap,h=Gs([e.inject||{},f]);this.targetTextureType=l,this.samplerTextureMap=p;var d=e._fs||Of({version:Us(s),input:this.targetTextureVarying,inputType:l,output:g$}),v=this.hasSourceTextures||this.targetTextureVarying?[F_].concat(e.modules||[]):e.modules;return{vs:s,fs:d,modules:v,uniforms:u,inject:h}}}]),t}();function Bf(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=y$(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
1708In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function y$(t,r){if(t){if(typeof t=="string")return PC(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return PC(t,r)}}function PC(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var mr=function(){function t(r){A(this,t);var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.gl=r,this.model=null,this.elementCount=0,this.bufferTransform=null,this.textureTransform=null,this.elementIDBuffer=null,this._initialize(e),Object.seal(this)}return T(t,[{key:"delete",value:function(){var e=this.model,n=this.bufferTransform,i=this.textureTransform;e&&e.delete(),n&&n.delete(),i&&i.delete()}},{key:"run",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.clearRenderTarget,i=n===void 0?!0:n,a=this._updateDrawOptions(e);i&&a.framebuffer&&a.framebuffer.clear({color:!0}),this.model.transform(a)}},{key:"swap",value:function(){var e=!1,n=[this.bufferTransform,this.textureTransform].filter(
1708Boolean),i=Bf(n),a;try{for(i.s();!(a=i.n()).done;){var o=a.value;e=e||o.swap()}}catch(s){i.e(s)}finally{i.f()}re(e,"Nothing to swap")}},{key:"getBuffer",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return this.bufferTransform&&this.bufferTransform.getBuffer(e)}},{key:"getData",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=[this.bufferTransform,this.textureTransform].filter(Boolean),i=Bf(n),a;try{for(i.s();!(a=i.n()).done;){var o=a.value,s=o.getData(e);if(s)return s}}catch(u){i.e(u)}finally{i.f()}return null}},{key:"getFramebuffer",value:function(){return this.textureTransform&&this.textureTransform.getFramebuffer()}},{key:"update",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};"elementCount"in e&&this.model.setVertexCount(e.elementCount);var n=[this.bufferTransform,this.textureTransform].filter(Boolean),i=Bf(n),a;try{for(i.s();!(a=i.n()).done;){var o=a.value;o.update(e)}}catch(s){i.e(s)}finally{i.f()}}},{key:"_initialize",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=this.gl;this._buildResourceTransforms(n,e),e=this._updateModelProps(e),this.model=new Ie(n,Object.assign({},e,{fs:e.fs||Of({version:Us(e.vs)}),id:e.id||"transform-model",drawMode:e.drawMode||0,vertexCount:e.elementCount})),this.bufferTransform&&this.bufferTransform.setupResources({model:this.model})}},{key:"_updateModelProps",value:function(e){var n=Object.assign({},e),i=[this.bufferTransform,this.textureTransform].filter(Boolean),a=Bf(i),o;try{for(a.s();!(o=a.n()).done;){var s=o.value;n=s.updateModelProps(n)}}catch(u){a.e(u)}finally{a.f()}return n}},{key:"_buildResourceTransforms",value:function(e,n){_$(n)&&(this.bufferTransform=new xC(e,n)),b$(n)&&(this.textureTransform=new wC(e,n)),re(this.bufferTransform||this.textureTransform,"must provide source/feedback buffers or source/target textures")}},{key:"_updateDrawOptions",value:function(e){var n=Object.assign({},e),i=[this.bufferTransform,this.textureTransform].filter(Boolean),a=Bf(i),o;try{for(a.s();!(o=a.n()).done;){var s=o.value;n=Object.assign(n,s.getDrawOptions(n))}}catch(u){a.e(u)}finally{a.f()}return n}}],[{key:"isSupported",value:function(e){return ge(e)}}]),t}();function _$(t){return!!(!Gn(t.feedbackBuffers)||!Gn(t.feedbackMap)||t.varyings&&t.varyings.length>0)}function b$(t){return!!(!Gn(t._sourceTextures)||t._targetTexture||t._targetTextureVarying)}k();F();j();function OC(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function x$(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?OC(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):OC(Object(e)).forEac
1708h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var EC={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},Re=function(){function t(){A(this,t);var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=r.id,n=e===void 0?$e("geometry"):e,i=r.drawMode,a=i===void 0?EC.TRIANGLES:i,o=r.attributes,s=o===void 0?{}:o,u=r.indices,l=u===void 0?null:u,f=r.vertexCount,p=f===void 0?null:f;this.id=n,this.drawMode=a|0,this.attributes={},this.userData={},this._setAttributes(s,l),this.vertexCount=p||this._calculateVertexCount(this.attributes,this.indices)}return T(t,[{key:"mode",get:function(){return this.drawMode}},{key:"getVertexCount",value:function(){return this.vertexCount}},{key:"getAttributes",value:function(){return this.indices?x$({indices:this.indices},this.attributes):this.attributes}},{key:"_print",value:function(e){return"Geometry ".concat(this.id," attribute ").concat(e)}},{key:"_setAttributes",value:function(e,n){n&&(this.indices=ArrayBuffer.isView(n)?{value:n,size:1}:n);for(var i in e){var a=e[i];a=ArrayBuffer.isView(a)?{value:a}:a,re(ArrayBuffer.isView(a.value),"".concat(this._print(i),": must be typed array or object with value as typed array")),(i==="POSITION"||i==="positions")&&!a.size&&(a.size=3),i==="indices"?(re(!this.indices),this.indices=a):this.attributes[i]=a}return this.indices&&this.indices.isIndexed!==void 0&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed),this}},{key:"_calculateVertexCount",value:function(e,n){if(n)return n.value.length;var i=1/0;for(var a in e){var o=e[a],s=o.value,u=o.size,l=o.constant;!l&&s&&u>=1&&(i=Math.min(i,s.length/u))}return re(Number.isFinite(i)),i}}],[{key:"DRAW_MODE",get:function(){return EC}}]),t}();k();F();k();F();function CC(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function Rh(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?CC(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):CC(Object(e)).forEac
1708h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function A$(t){var r=S$();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function S$(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var T$={x:[2,0,1],y:[0,1,2],z:[1,2,0]},da=function(t){L(e,t);var r=A$(e);function e(){A(this,e);var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.id,a=i===void 0?$e("truncated-code-geometry"):i,o=w$(n),s=o.indices,u=o.attributes;return r.call(this,Rh(Rh({},n),{},{id:a,indices:s,attributes:Rh(Rh({},u),n.attributes)}))}return e}(Re);function w$(t){for(var r=t.bottomRadius,e=r===void 0?0:r,n=t.topRadius,i=n===void 0?0:n,a=t.height,o=a===void 0?1:a,s=t.nradial,u=s===void 0?10:s,l=t.nvertical,f=l===void 0?10:l,p=t.verticalAxis,h=p===void 0?"y":p,d=t.topCap,v=d===void 0?!1:d,m=t.bottomCap,g=m===void 0?!1:m,y=(v?2:0)+(g?2:0),_=(u+1)*(f+1+y),b=Math.atan2(e-i,o),x=Math.sin,w=Math.cos,P=Math.PI,E=w(b),C=x(b),I=v?-2:0,O=f+(g?2:0),D=u+1,N=new Uint16Array(u*(f+y)*6),H=T$[h],$=new Float32Array(_*3),ee=new Float32Array(_*3),V=new Float32Array(_*2),U=0,X=0,K=I;K<=O;K++){var te=K/f,ie=o*te,ce=void 0;K<0?(ie=0,te=1,ce=e):K>f?(ie=o,te=1,ce=i):ce=e+(i-e)*(K/f),(K===-2||K===f+2)&&(ce=0,te=0),ie-=o/2;for(var Te=0;Te<D;Te++){var Me=x(Te*P*2/u),Fe=w(Te*P*2/u);$[U+H[0]]=Me*ce,$[U+H[1]]=ie,$[U+H[2]]=Fe*ce,ee[U+H[0]]=K<0||K>f?0:Me*E,ee[U+H[1]]=K<0?-1:K>f?1:C,ee[U+H[2]]=K<0||K>f?0:Fe*E,V[X+0]=Te/u,V[X+1]=te,X+=2,U+=3}}for(var we=0;we<f+y;we++)for(var Ne=0;Ne<u;Ne++){var Oe=(we*u+Ne)*6;N[Oe+0]=D*(we+0)+0+Ne,N[Oe+1]=D*(we+0)+1+Ne,N[Oe+2]=D*(we+1)+1+Ne,N[Oe+3]=D*(we+0)+0+Ne,N[Oe+4]=D*(we+1)+1+Ne,N[Oe+5]=D*(we+1)+0+Ne}return{indices:N,attributes:{POSITION:{size:3,value:$},NORMAL:{size:3,value:ee},TEXCOORD_0:{size:2,value:V}}}}function MC(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function IC(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?MC(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):MC(Object(e)).forEac
1708h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function P$(t){var r=O$();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function O$(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Lh=function(t){L(e,t);var r=P$(e);function e(){A(this,e);var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.id,a=i===void 0?$e("cone-geometry"):i,o=n.radius,s=o===void 0?1:o,u=n.cap,l=u===void 0?!0:u;return r.call(this,IC(IC({},n),{},{id:a,topRadius:0,topCap:Boolean(l),bottomCap:Boolean(l),bottomRadius:s}))}return e}(da);k();F();function RC(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function kh(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?RC(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):RC(Object(e)).forEac
1708h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function E$(t){var r=C$();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function C$(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var M$=new Uint16Array([0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23]),I$=new Float32Array([-1,-1,1,1,-1,1,1,1,1,-1,1,1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,1,-1,-1,1,1,1,1,1,1,1,-1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,-1,1,-1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1]),R$=new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0]),L$=new Float32Array([0,0,1,0,1,1,0,1,1,0,1,1,0,1,0,0,0,1,0,0,1,0,1,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,0,0,0,1,0,1,1,0,1]),k$={POSITION:{size:3,value:new Float32Array(I$)},NORMAL:{size:3,value:new Float32Array(R$)},TEXCOORD_0:{size:2,value:new Float32Array(L$)}},va=function(t){L(e,t);var r=E$(e);function e(){A(this,e);var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.id,a=i===void 0?$e("cube-geometry"):i;return r.call(this,kh(kh({},n),{},{id:a,indices:{size:1,value:new Uint16Array(M$)},attributes:kh(kh({},k$),n.attributes)}))}return e}(Re);k();F();function LC(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function kC(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?LC(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):LC(Object(e)).forEac
1708h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function B$(t){var r=F$();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function F$(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Bh=function(t){L(e,t);var r=B$(e);function e(){A(this,e);var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.id,a=i===void 0?$e("cylinder-geometry"):i,o=n.radius,s=o===void 0?1:o;return r.call(this,kC(kC({},n),{},{id:a,bottomRadius:s,topRadius:s}))}return e}(da);k();F();function BC(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function Fh(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?BC(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):BC(Object(e)).forEac
1708h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function D$(t){var r=N$();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function N$(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var j$=[-1,0,0,0,1,0,0,0,-1,0,0,1,0,-1,0,1,0,0],U$=[3,4,5,3,5,1,3,1,0,3,0,4,4,0,2,4,2,5,2,0,1,5,2,1],Dh=function(t){L(e,t);var r=D$(e);function e(){A(this,e);var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.id,a=i===void 0?$e("ico-sphere-geometry"):i,o=G$(n),s=o.indices,u=o.attributes;return r.call(this,Fh(Fh({},n),{},{id:a,indices:s,attributes:Fh(Fh({},u),n.attributes)}))}return e}(Re);function G$(t){var r=t.iterations,e=r===void 0?0:r,n=Math.PI,i=n*2,a=[].concat(j$),o=[].concat(U$);a.push(),o.push();for(var s=function(){var ln={};return function(fn,cn){fn*=3,cn*=3;var ys=fn<cn?fn:cn,_r=fn>cn?fn:cn,Bl="".concat(ys,"|").concat(_r);if(Bl in ln)return ln[Bl];var Ig=a[fn],Rg=a[fn+1],Lg=a[fn+2],kg=a[cn],ap=a[cn+1],op=a[cn+2],$a=(Ig+kg)/2,Xa=(Rg+ap)/2,li=(Lg+op)/2,qa=Math.sqrt($a*$a+Xa*Xa+li*li);return $a/=qa,Xa/=qa,li/=qa,a.push($a,Xa,li),ln[Bl]=a.length/3-1}}(),u=0;u<e;u++){for(var l=[],f=0;f<o.length;f+=3){var p=s(o[f+0],o[f+1]),h=s(o[f+1],o[f+2]),d=s(o[f+2],o[f+0]);l.push(d,o[f+0],p,p,o[f+1],h,h,o[f+2],d,p,h,d)}o=l}for(var v=new Array(a.length),m=new Array(a.length/3*2),g=o.length,y=g-3;y>=0;y-=3){var _=o[y+0],b=o[y+1],x=o[y+2],w=_*3,P=b*3,E=x*3,C=_*2,I=b*2,O=x*2,D=a[w+0],N=a[w+1],H=a[w+2],$=Math.acos(H/Math.sqrt(D*D+N*N+H*H)),ee=Math.atan2(N,D)+n,V=$/n,U=1-ee/i,X=a[P+0],K=a[P+1],te=a[P+2],ie=Math.acos(te/Math.sqrt(X*X+K*K+te*te)),ce=Math.atan2(K,X)+n,Te=ie/n,Me=1-ce/i,Fe=a[E+0],we=a[E+1],Ne=a[E+2],Oe=Math.acos(Ne/Math.sqrt(Fe*Fe+we*we+Ne*Ne)),ft=Math.atan2(we,Fe)+n,un=Oe/n,Rr=1-ft/i,ea=[Fe-X,we-K,Ne-te],Ct=[D-X,N-K,H-te],Ht=new z(ea).cross(Ct).normalize(),Ke=void 0;(U===0||Me===0||Rr===0)&&(U===0||U>.5)&&(Me===0||Me>.5)&&(Rr===0||Rr>.5)&&(a.push(a[w+0],a[w+1],a[w+2]),Ke=a.length/3-1,o.push(Ke),m[Ke*2+0]=1,m[Ke*2+1]=V,v[Ke*3+0]=Ht.x,v[Ke*3+1]=Ht.y,v[Ke*3+2]=Ht.z,a.push(a[P+0],a[P+1],a[P+2]),Ke=a.length/3-1,o.push(Ke),m[Ke*2+0]=1,m[Ke*2+1]=Te,v[Ke*3+0]=Ht.x,v[Ke*3+1]=Ht.y,v[Ke*3+2]=Ht.z,a.push(a[E+0],a[E+1],a[E+2]),Ke=a.length/3-1,o.push(Ke),m[Ke*2+0]=1,m[Ke*2+1]=un,v[Ke*3+0]=Ht.x,v[Ke*3+1]=Ht.y,v[Ke*3+2]=Ht.z),v[w+0]=v[P+0]=v[E+0]=Ht.x,v[w+1]=v[P+1]=v[E+1]=Ht.y,v[w+2]=v[P+2]=v[E+2]=Ht.z,m[C+0]=U,m[C+1]=V,m[I+0]=Me,m[I+1]=Te,m[O+0]=Rr,m[O+1]=un}return{indices:{size:1,value:new Uint16Array(o)},attributes:{POSITION:{size:3,value:new Float32Array(a)},NORMAL:{size:3,value:new Float32Array(v)},TEXCOORD_0:{size:2,value:new Float32Array(m)}}}}k();F();function FC(t){var r=t.indices,e=t.attributes;if(!r)return t;var n=r.value.length,i={};for(var a in e){var o=e[a],s=o.constant,u=o.value,l=o.size;if(!(s||!l)){for(var f=new u.constructor(n*l),p=0;p<n;++p)for(var h=r.value[p],d=0;d<l;d++)f[p*l+d]=u[h*l+d];i[a]={size:l,value:f}}}return{attributes:Object.assign({},e,i)}}function DC(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function Nh(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?DC(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):DC(Object(e)).forEac
1708h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function z$(t){var r=V$();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function V$(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var jh=function(t){L(e,t);var r=z$(e);function e(){A(this,e);var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.id,a=i===void 0?$e("plane-geometry"):i,o=H$(n),s=o.indices,u=o.attributes;return r.call(this,Nh(Nh({},n),{},{id:a,indices:s,attributes:Nh(Nh({},u),n.attributes)}))}return e}(Re);function H$(t){var r=t.type,e=r===void 0?"x,y":r,n=t.offset,i=n===void 0?0:n,a=t.flipCull,o=a===void 0?!1:a,s=t.unpack,u=s===void 0?!1:s,l=e.split(","),f=t["".concat(l[0],"len")]||1,p=t["".concat(l[1],"len")]||1,h=t["n".concat(l[0])]||1,d=t["n".concat(l[1])]||1,v=(h+1)*(d+1),m=new Float32Array(v*3),g=new Float32Array(v*3),y=new Float32Array(v*2);o&&(f=-f);for(var _=0,b=0,x=0;x<=d;x++)for(var w=0;w<=h;w++){var P=w/h,E=x/d;switch(y[_+0]=o?1-P:P,y[_+1]=E,e){case"x,y":m[b+0]=f*P-f*.5,m[b+1]=p*E-p*.5,m[b+2]=i,g[b+0]=0,g[b+1]=0,g[b+2]=o?1:-1;break;case"x,z":m[b+0]=f*P-f*.5,m[b+1]=i,m[b+2]=p*E-p*.5,g[b+0]=0,g[b+1]=o?1:-1,g[b+2]=0;break;case"y,z":m[b+0]=i,m[b+1]=f*P-f*.5,m[b+2]=p*E-p*.5,g[b+0]=o?1:-1,g[b+1]=0,g[b+2]=0;break;default:throw new Error("PlaneGeometry: unknown type")}_+=2,b+=3}for(var C=h+1,I=new Uint16Array(h*d*6),O=0;O<d;O++)for(var D=0;D<h;D++){var N=(O*h+D)*6;I[N+0]=(O+0)*C+D,I[N+1]=(O+1)*C+D,I[N+2]=(O+0)*C+D+1,I[N+3]=(O+1)*C+D,I[N+4]=(O+1)*C+D+1,I[N+5]=(O+0)*C+D+1}var H={indices:{size:1,value:I},attributes:{POSITION:{size:3,value:m},NORMAL:{size:3,value:g},TEXCOORD_0:{size:2,value:y}}};return u?FC(H):H}k();F();function NC(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function Uh(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?NC(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):NC(Object(e)).forEac
1708h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function W$(t){var r=$$();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function $$(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Gh=function(t){L(e,t);var r=W$(e);function e(){A(this,e);var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.id,a=i===void 0?$e("sphere-geometry"):i,o=X$(n),s=o.indices,u=o.attributes;return r.call(this,Uh(Uh({},n),{},{id:a,indices:s,attributes:Uh(Uh({},u),n.attributes)}))}return e}(Re);function X$(t){var r=t.nlat,e=r===void 0?10:r,n=t.nlong,i=n===void 0?10:n,a=t.radius,o=a===void 0?1:a,s=0,u=Math.PI,l=u-s,f=0,p=2*Math.PI,h=p-f,d=(e+1)*(i+1);if(typeof o=="number"){var v=o;o=function(we,Ne,Oe,ft,un){return v}}for(var m=new Float32Array(d*3),g=new Float32Array(d*3),y=new Float32Array(d*2),_=d>65535?Uint32Array:Uint16Array,b=new _(e*i*6),x=0;x<=e;x++)for(var w=0;w<=i;w++){var P=w/i,E=x/e,C=w+x*(i+1),I=C*2,O=C*3,D=h*P,N=l*E,H=Math.sin(D),$=Math.cos(D),ee=Math.sin(N),V=Math.cos(N),U=$*ee,X=V,K=H*ee,te=o(U,X,K,P,E);m[O+0]=te*U,m[O+1]=te*X,m[O+2]=te*K,g[O+0]=U,g[O+1]=X,g[O+2]=K,y[I+0]=P,y[I+1]=1-E}for(var ie=i+1,ce=0;ce<i;ce++)for(var Te=0;Te<e;Te++){var Me=(ce*e+Te)*6;b[Me+0]=Te*ie+ce,b[Me+1]=Te*ie+ce+1,b[Me+2]=(Te+1)*ie+ce,b[Me+3]=(Te+1)*ie+ce,b[Me+4]=Te*ie+ce+1,b[Me+5]=(Te+1)*ie+ce+1}return{indices:{size:1,value:b},attributes:{POSITION:{size:3,value:m},NORMAL:{size:3,value:g},TEXCOORD_0:{size:2,value:y}}}}be();F();j();function D_(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=q$(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
1709In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function q$(t,r){if(t){if(typeof t=="string")return jC(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return jC(t,r)}}function jC(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var Y$=1,K$=1,ma=function(){function t(){A(this,t),this.time=0,this.channels=new Map,this.animations=new Map,this.playing=!1,this.lastEngineTime=-1}return T(t,[{key:"addChannel",value:function(e){var n=e.delay,i=n===void 0?0:n,a=e.duration,o=a===void 0?Number.POSITIVE_INFINITY:a,s=e.rate,u=s===void 0?1:s,l=e.repeat,f=l===void 0?1:l,p=Y$++,h={time:0,delay:i,duration:o,rate:u,repeat:f};return this._setChannelTime(h,this.time),this.channels.set(p,h),p}},{key:"removeChannel",value:function(e){this.channels.delete(e);var n=D_(this.animations),i;try{for(n.s();!(i=n.n()).done;){var a=W(i.value,2),o=a[0],s=a[1];s.channel===e&&this.detachAnimation(o)}}catch(u){n.e(u)}finally{n.f()}}},{key:"isFinished",value:function(e){var n=this.channels.get(e);return n===void 0?!1:this.time>=n.delay+n.duration*n.repeat}},{key:"getTime",value:function(e){if(e===void 0)return this.time;var n=this.channels.get(e);return n===void 0?-1:n.time}},{key:"setTime",value:function(e){this.time=Math.max(0,e);var n=this.channels.values(),i=D_(n),a;try{for(i.s();!(a=i.n()).done;){var o=a.value;this._setChannelTime(o,this.time)}}catch(d){i.e(d)}finally{i.f()}var s=this.animations.values(),u=D_(s),l;try{for(u.s();!(l=u.n()).done;){var f=l.value,p=f.animation,h=f.channel;p.setTime(this.getTime(h))}}catch(d){u.e(d)}finally{u.f()}}},{key:"play",value:function(){this.playing=!0}},{key:"pause",value:function(){this.playing=!1,this.lastEngineTime=-1}},{key:"reset",value:function(){this.setTime(0)}},{key:"attachAnimation",value:function(e,n){var i=K$++;return this.animations.set(i,{animation:e,channel:n}),e.setTime(this.getTime(n)),i}},{key:"detachAnimation",value:function(e){this.animations.delete(e)}},{key:"update",value:function(e){this.playing&&(this.lastEngineTime===-1&&(this.lastEngineTime=e),this.setTime(this.time+(e-this.lastEngineTime)),this.lastEngineTime=e)}},{key:"_setChannelTime",value:function(e,n){var i=n-e.delay,a=e.duration*e.repeat;i>=a?e.time=e.duration*e.rate:(e.time=Math.max(0,i)%e.duration,e.time*=e.rate)}}]),t}();F();function Z$(t){var r=J$();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}
1709function J$(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Q$=`attribute vec2 aClipSpacePosition;
1710attribute vec2 aTexCoord;
1711attribute vec2 aCoordinate;
1712
1713varying vec2 position;
1714varying vec2 coordinate;
1715varying vec2 uv;
1716
1717void main(void) {
1718  gl_Position = vec4(aClipSpacePosition, 0., 1.);
1719  position = aClipSpacePosition;
1720  coordinate = aCoordinate;
1721  uv = aTexCoord;
1722}
1723`,UC=[-1,-1,1,-1,-1,1,1,1],zh=function(t){L(e,t);var r=Z$(e);function e(n,i){var a;A(this,e);var o=UC.map(function(s){return s===-1?0:s});return a=r.call(this,n,Object.assign({},i,{vs:Q$,geometry:new Re({drawMode:5,vertexCount:4,attributes:{aClipSpacePosition:{size:2,value:new Float32Array(UC)},aTexCoord:{size:2,value:new Float32Array(o)},aCoordinate:{size:2,value:new Float32Array(o)}}})})),a.setVertexCount(4),a}return e}(Ie);F();k();var eX=[255,255,255],tX=1,rX=0,Vh=function t(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};A(this,t),c(this,"id",void 0),c(this,"color",void 0),c(this,"intensity",void 0),c(this,"type","ambient");var e=r.color,n=e===void 0?eX:e,i=r.intensity,a=i===void 0?tX:i;this.id=r.id||"ambient-".concat(rX++),this.color=n,this.intensity=a};F();j();k();var nX=[255,255,255],iX=1,aX=[0,0,-1],oX=0,So=function(){function t(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};A(this,t),c(this,"id",void 0),c(this,"color",void 0),c(this,"intensity",void 0),c(this,"type","directional"),c(this,"direction",void 0),c(this,"shadow",void 0);var e=r.color,n=e===void 0?nX:e,i=r.intensity,a=i===void 0?iX:i,o=r.direction,s=o===void 0?aX:o,u=r._shadow,l=u===void 0?!1:u;this.id=r.id||"directional-".concat(oX++),this.color=n,this.intensity=a,this.type="directional",this.direction=new z(s).normalize().toArray(),this.shadow=l}return T(t,[{key:"getProjectedLight",value:function(e){return this}}]),t}();F();j();k();F();j();k();F();j();k();function GC(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function sX(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?GC(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):GC(Object(e)).forEac
1723h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var Hh=function(){function t(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{id:"pass"};A(this,t),c(this,"id",void 0),c(this,"gl",void 0),c(this,"props",void 0);var n=e.id;this.id=n,this.gl=r,this.props=sX({},e)}return T(t,[{key:"setProps",value:function(e){Object.assign(this.props,e)}},{key:"render",value:function(e){}},{key:"cleanup",value:function(){}}]),t}();function N_(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=uX(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
1724In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function uX(t,r){if(t){if(typeof t=="string")return zC(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return zC(t,r)}}function zC(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function lX(t){var r=fX();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function fX(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var br=function(t){L(e,t);var r=lX(e);function e(){var n;A(this,e);for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return n=r.call.apply(r,[this].concat(a)),c(q(n),"_lastRenderIndex",-1),n}return T(e,[{key:"render",value:function(i){var a=this.gl;return It(a,{framebuffer:i.target}),this._drawLayers(i)}},{key:"_drawLayers",value:function(i){var a=i.target,o=i.moduleParameters,s=i.viewports,u=i.views,l=i.onViewportActive,f=i.clearStack,p=f===void 0?!0:f,h=i.clearCanvas,d=h===void 0?!0:h;i.pass=i.pass||"unknown";var v=this.gl;d&&pX(v,a),p&&(this._lastRenderIndex=-1);var m=[],g=N_(s),y;try{for(g.s();!(y=g.n()).done;){var _=y.value,b=u&&u[_.id];l?.(_);var x=this._getDrawLayerParams(_,i),w=_.subViewports||[_],P=N_(w),E;try{for(P.s();!(E=P.n()).done;){var C=E.value,I=this._drawLayersInViewport(v,{target:a,moduleParameters:o,viewport:C,view:b,pass:i.pass,layers:i.layers},x);m.push(I)}}catch(O){P.e(O)}finally{P.f()}}}catch(O){g.e(O)}finally{g.f()}return m}},{key:"_getDrawLayerParams",value:function(i,a){for(var o=a.layers,s=a.pass,u=a.isPicking,l=u===void 0?!1:u,f=a.layerFilter,p=a.cullRect,h=a.effects,d=a.moduleParameters,v=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,m=[],g=VC(this._lastRenderIndex+1),y={layer:o[0],viewport:i,isPicking:l,renderPass:s,cullRect:p},_={},b=0;b<o.length;b++){var x=o[b],w=this._shouldDrawLayer(x,y,f,_),P={shouldDrawLayer:w};w&&!v&&(P.layerRenderIndex=g(x,w),P.moduleParameters=this._getModuleParameters(x,h,s,d),P.layerParameters=this.getLayerParameters(x,b,i)),m[b]=P}return m}},{key:"_drawLayersInViewport",value:function(i,a,o){var s=a.layers,u=a.moduleParameters,l=a.pass,f=a.target,p=a.viewport,h=a.view,d=cX(i,{moduleParameters:u,target:f,viewport:p});if(h&&h.props.clear){var v=h.props.clear===!0?{color:!0,depth:!0}:h.props.clear;ke(i,{scissorTest:!0,scissor:d},function(){return qr(i,v)})}var m={totalCount:s.length,visibleCount:0,compositeCount:0,pickableCount:0};It(i,{viewport:d});for(var g=0;g<s.length;g++){var y=s[g],_=o[g],b=_.shouldDrawLayer,x=_.layerRenderIndex,w=_.moduleParameters,P=_.layerParameters;if(b&&y.props.pickable&&m.pickableCount++,y.isComposite)m.compositeCount++;else if(b){m.visibleCount++,this._lastRenderIndex=Math.max(this._lastRenderIndex,x),w.viewport=p;try{y._drawLayer({moduleParameters:w,uniforms:{layerIndex:x},parameters:P})}catch(E){y.raiseError(E,"drawing ".concat(y," to ").concat(l))}}}return m}},{key:"shouldDrawLayer",value:function(i){return!0}},{key:"getModuleParameters",value:function(i,a){return null}},{key:"getLayerParameters",value:function(i,a,o){return i.props.parameters}},{key:"_shouldDrawLayer",value:function(i,a,o,s){var u=i.props.visible&&this.shouldDrawLayer(i);if(!u)return!1;a.layer=i;for(var l=i.parent;l;){if(!l.props.visible||!l.filterSubLayer(a))return!1;a.layer=l,l=l.parent}if(o){var f=a.layer.id;if(f in s||(s[f]=o(a)),!s[f])return!1}return i.activateViewport(a.viewport),!0}},{key:"_getModuleParameters",value:function(i,a,o,s){var u,l=Object.assign(Object.create(((u=i.internalState)===null||u===void 0?void 0:u.propsInTransition)||i.props),{autoWrapLongitude:i.wrapLongitude,viewport:i.context.viewport,mousePosition:i.context.mousePosition,pickingActive:0,devicePixelRatio:Jt(this.gl)});if(a){var f=N_(a),p;try{for(f.s();!(p=f.n()).done;){var h,d=p.value;Object.assign(l,(h=d.getModuleParameters)===null||h===void 0?void 0:h.call(d,i))}}catch(v){f.e(v)}finally{f.f()}}return Object.assign(l,this.getModuleParameters(i,a),s)}}]),e}(Hh);function VC(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e={},n=function i(a,o){var s=a.props._offset,u=a.id,l=a.parent&&a.parent.id,f;if(l&&!(l in r)&&i(a.parent,!1),l in e){var p=e[l]=e[l]||VC(r[l],r);f=p(a,o),e[u]=p}else Number.isFinite(s)?(f=s+(r[l]||0),e[u]=null):f=t;return o&&f>=t&&(t=f+1),r[u]=f,f};return n}function cX(t,r){var e=r.moduleParameters,n=r.target,i=r.viewport,a=n&&n.id!=="default-framebuffer",o=e&&e.devicePixelRatio||Jt(t),s=a?n.height:t.drawingBufferHeight,u=i;return[u.x*o,s-(u.y+u.height)*o,u.width*o,u.height*o]}function pX(t,r){var e=r?r.width:t.drawingBufferWidth,n=r?r.height:t.drawingBufferHeight;It(t,{viewport:[0,0,e,n]}),t.clear(16640)}function HC(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function WC(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};
1724r%2?HC(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):HC(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function hX(t){var r=dX();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function dX(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var $C=function(t){L(e,t);var r=hX(e);function e(n,i){var a,o,s;return A(this,e),s=r.call(this,n,i),c(q(s),"shadowMap",void 0),c(q(s),"depthBuffer",void 0),c(q(s),"fbo",void 0),s.shadowMap=new Ce(n,{width:1,height:1,parameters:(a={},c(a,10241,9729),c(a,10240,9729),c(a,10242,33071),c(a,10243,33071),a)}),s.depthBuffer=new dr(n,{format:33189,width:1,height:1}),s.fbo=new Le(n,{id:"shadowmap",width:1,height:1,attachments:(o={},c(o,36064,s.shadowMap),c(o,36096,s.depthBuffer),o)}),s}return T(e,[{key:"render",value:function(i){var a=this,o=this.fbo;ke(this.gl,{depthRange:[0,1],depthTest:!0,blend:!1,clearColor:[1,1,1,1]},function(){var s=i.viewports[0],u=Jt(a.gl),l=s.width*u,f=s.height*u;(l!==o.width||f!==o.height)&&o.resize({width:l,height:f}),Z(S(e.prototype),"render",a).call(a,WC(WC({},i),{},{target:o,pass:"shadow"}))})}},{key:"shouldDrawLayer",value:function(i){return i.props.shadowEnabled!==!1}},{key:"getModuleParameters",value:function(){return{drawToShadowMap:!0}}},{key:"delete",value:function(){this.fbo&&(this.fbo.delete(),this.fbo=null),this.shadowMap&&(this.shadowMap.delete(),this.shadowMap=null),this.depthBuffer&&(this.depthBuffer.delete(),this.depthBuffer=null)}}]),e}(br);be();var XC="#define SMOOTH_EDGE_RADIUS 0.5",vX=`
1725`.concat(XC,`
1726
1727struct VertexGeometry {
1728  vec4 position;
1729  vec3 worldPosition;
1730  vec3 worldPositionAlt;
1731  vec3 normal;
1732  vec2 uv;
1733  vec3 pickingColor;
1734} geometry = VertexGeometry(
1735  vec4(0.0, 0.0, 1.0, 0.0),
1736  vec3(0.0),
1737  vec3(0.0),
1738  vec3(0.0),
1739  vec2(0.0),
1740  vec3(0.0)
1741);
1742`),mX=`
1743`.concat(XC,`
1744
1745struct FragmentGeometry {
1746  vec2 uv;
1747} geometry;
1748
1749float smoothedge(float edge, float x) {
1750  return smoothstep(edge - SMOOTH_EDGE_RADIUS, edge + SMOOTH_EDGE_RADIUS, x);
1751}
1752`),qC={name:"geometry",vs:vX,fs:mX};var gX=Object.keys(de).map(function(t){return"const int COORDINATE_SYSTEM_".concat(t," = ").concat(de[t],";")}).join(""),yX=Object.keys(rr).map(function(t){return"const int PROJECTION_MODE_".concat(t," = ").concat(rr[t],";")}).join(""),_X=Object.keys(dt).map(function(t){return"const int UNIT_".concat(t.toUpperCase()," = ").concat(dt[t],";")}).join(""),YC="".concat(gX,`
1753`).concat(yX,`
1754`).concat(_X,`
1755
1756uniform int project_uCoordinateSystem;
1757uniform int project_uProjectionMode;
1758uniform float project_uScale;
1759uniform bool project_uWrapLongitude;
1760uniform vec3 project_uCommonUnitsPerMeter;
1761uniform vec3 project_uCommonUnitsPerWorldUnit;
1762uniform vec3 project_uCommonUnitsPerWorldUnit2;
1763uniform vec4 project_uCenter;
1764uniform mat4 project_uModelMatrix;
1765uniform mat4 project_uViewProjectionMatrix;
1766uniform vec2 project_uViewportSize;
1767uniform float project_uDevicePixelRatio;
1768uniform float project_uFocalDistance;
1769uniform vec3 project_uCameraPosition;
1770uniform vec3 project_uCoordinateOrigin;
1771uniform vec3 project_uCommonOrigin;
1772uniform bool project_uPseudoMeters;
1773
1774const float TILE_SIZE = 512.0;
1775const float PI = 3.1415926536;
1776const float WORLD_SCALE = TILE_SIZE / (PI * 2.0);
1777const vec3 ZERO_64_LOW = vec3(0.0);
1778const float EARTH_RADIUS = 6370972.0;
1779const float GLOBE_RADIUS = 256.0;
1780float project_size_at_latitude(float lat) {
1781  float y = clamp(lat, -89.9, 89.9);
1782  return 1.0 / cos(radians(y));
1783}
1784
1785float project_size() {
1786  if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR &&
1787    project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT &&
1788    project_uPseudoMeters == false) {
1789    
1790    if (geometry.position.w == 0.0) {
1791      return project_size_at_latitude(geometry.worldPosition.y);
1792    }
1793  
1794    float y = geometry.position.y / TILE_SIZE * 2.0 - 1.0;
1795    float y2 = y * y;
1796    float y4 = y2 * y2;
1797    float y6 = y4 * y2;
1798    return 1.0 + 4.9348 * y2 + 4.0587 * y4 + 1.5642 * y6;
1799  }
1800  return 1.0;
1801}
1802
1803float project_size_at_latitude(float meters, float lat) {
1804  return meters * project_uCommonUnitsPerMeter.z * project_size_at_latitude(lat);
1805}
1806float project_size(float meters) {
1807  return meters * project_uCommonUnitsPerMeter.z * project_size();
1808}
1809
1810vec2 project_size(vec2 meters) {
1811  return meters * project_uCommonUnitsPerMeter.xy * project_size();
1812}
1813
1814vec3 project_size(vec3 meters) {
1815  return meters * project_uCommonUnitsPerMeter * project_size();
1816}
1817
1818vec4 project_size(vec4 meters) {
1819  return vec4(meters.xyz * project_uCommonUnitsPerMeter, meters.w);
1820}
1821mat3 project_get_orientation_matrix(vec3 up) {
1822  vec3 uz = normalize(up);
1823  vec3 ux = abs(uz.z) == 1.0 ? vec3(1.0, 0.0, 0.0) : normalize(vec3(uz.y, -uz.x, 0));
1824  vec3 uy = cross(uz, ux);
1825  return mat3(ux, uy, uz);
1826}
1827
1828bool project_needs_rotation(vec3 commonPosition, out mat3 transform) {
1829  if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {
1830    transform = project_get_orientation_matrix(commonPosition);
1831    return true;
1832  }
1833  return false;
1834}
1835vec3 project_normal(vec3 vector) {
1836  vec4 normal_modelspace = project_uModelMatrix * vec4(vector, 0.0);
1837  vec3 n = normalize(normal_modelspace.xyz * project_uCommonUnitsPerMeter);
1838  mat3 rotation;
1839  if (project_needs_rotation(geometry.position.xyz, rotation)) {
1840    n = rotation * n;
1841  }
1842  return n;
1843}
1844
1845vec4 project_offset_(vec4 offset) {
1846  float dy = offset.y;
1847  vec3 commonUnitsPerWorldUnit = project_uCommonUnitsPerWorldUnit + project_uCommonUnitsPerWorldUnit2 * dy;
1848  return vec4(offset.xyz * commonUnitsPerWorldUnit, offset.w);
1849}
1850vec2 project_mercator_(vec2 lnglat) {
1851  float x = lnglat.x;
1852  if (project_uWrapLongitude) {
1853    x = mod(x + 180., 360.0) - 180.;
1854  }
1855  float y = clamp(lnglat.y, -89.9, 89.9);
1856  return vec2(
1857    radians(x) + PI,
1858    PI + log(tan_fp32(PI * 0.25 + radians(y) * 0.5))
1859  ) * WORLD_SCALE;
1860}
1861
1862vec3 project_globe_(vec3 lnglatz) {
1863  float lambda = radians(lnglatz.x);
1864  float phi = radians(lnglatz.y);
1865  float cosPhi = cos(phi);
1866  float D = (lnglatz.z / EARTH_RADIUS + 1.0) * GLOBE_RADIUS;
1867
1868  return vec3(
1869    sin(lambda) * cosPhi,
1870    -cos(lambda) * cosPhi,
1871    sin(phi)
1872  ) * D;
1873}
1874vec4 project_position(vec4 position, vec3 position64Low) {
1875  vec4 position_world = project_uModelMatrix * position;
1876  if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR) {
1877    if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {
1878      return vec4(
1879        project_mercator_(position_world.xy),
1880        project_size_at_latitude(position_world.z, position_world.y),
1881        position_world.w
1882      );
1883    }
1884    if (project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN) {
1885      position_world.xyz += project_uCoordinateOrigin;
1886    }
1887  }
1888  if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {
1889    if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {
1890      return vec4(
1891        project_globe_(position_world.xyz),
1892        position_world.w
1893      );
1894    }
1895  }
1896  if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) {
1897    if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {
1898      if (abs(position_world.y - project_uCoordinateOrigin.y) > 0.25) {
1899        return vec4(
1900          project_mercator_(position_world.xy) - project_uCommonOrigin.xy,
1901          project_size(position_world.z),
1902          position_world.w
1903        );
1904      }
1905    }
1906  }
1907  if (project_uProjectionMode == PROJECTION_MODE_IDENTITY ||
1908    (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET &&
1909    (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT ||
1910     project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN))) {
1911    position_world.xyz -= project_uCoordinateOrigin;
1912  }
1913  return project_offset_(position_world + project_uModelMatrix * vec4(position64Low, 0.0));
1914}
1915
1916vec4 project_position(vec4 position) {
1917  return project_position(position, ZERO_64_LOW);
1918}
1919
1920vec3 project_position(vec3 position, vec3 position64Low) {
1921  vec4 projected_position = project_position(vec4(position, 1.0), position64Low);
1922  return projected_position.xyz;
1923}
1924
1925vec3 project_position(vec3 position) {
1926  vec4 projected_position = project_position(vec4(position, 1.0), ZERO_64_LOW);
1927  return projected_position.xyz;
1928}
1929
1930vec2 project_position(vec2 position) {
1931  vec4 projected_position = project_position(vec4(position, 0.0, 1.0), ZERO_64_LOW);
1932  return projected_position.xy;
1933}
1934
1935vec4 project_common_position_to_clipspace(vec4 position, mat4 viewProjectionMatrix, vec4 center) {
1936  return viewProjectionMatrix * position + center;
1937}
1938vec4 project_common_position_to_clipspace(vec4 position) {
1939  return project_common_position_to_clipspace(position, project_uViewProjectionMatrix, project_uCenter);
1940}
1941vec2 project_pixel_size_to_clipspace(vec2 pixels) {
1942  vec2 offset = pixels / project_uViewportSize * project_uDevicePixelRatio * 2.0;
1943  return offset * project_uFocalDistance;
1944}
1945
1946float project_size_to_pixel(float meters) {
1947  return project_size(meters) * project_uScale;
1948}
1949float project_size_to_pixel(float size, int unit) {
1950  if (unit == UNIT_METERS) return project_size_to_pixel(size);
1951  if (unit == UNIT_COMMON) return size * project_uScale;
1952  return size;
1953}
1954float project_pixel_size(float pixels) {
1955  return pixels / project_uScale;
1956}
1957vec2 project_pixel_size(vec2 pixels) {
1958  return pixels / project_uScale;
1959}
1960`);var Ai=typeof Float32Array<"u"?Float32Array:Array;var kLe=Math.PI/180;Math.hypot||(Math.hypot=function(){for(var t=0,r=arguments.length;r--;)t+=arguments[r]*arguments[r];return Math.sqrt(t)});function U_(t,r){var e=r[0],n=r[1],i=r[2],a=r[3],o=r[4],s=r[5],u=r[6],l=r[7],f=r[8],p=r[9],h=r[10],d=r[11],v=r[12],m=r[13],g=r[14],y=r[15],_=e*s-n*o,b=e*u-i*o,x=e*l-a*o,w=n*u-i*s,P=n*l-a*s,E=i*l-a*u,C=f*m-p*v,I=f*g-h*v,O=f*y-d*v,D=p*g-h*m,N=p*y-d*m,H=h*y-d*g,$=_*H-b*N+x*D+w*O-P*I+E*C;return $?($=1/$,t[0]=(s*H-u*N+l*D)*$,t[1]=(i*N-n*H-a*D)*$,t[2]=(m*E-g*P+y*w)*$,t[3]=(h*P-p*E-d*w)*$,t[4]=(u*O-o*H-l*I)*$,t[5]=(e*H-i*O+a*I)*$,t[6]=(g*x-v*E-y*b)*$,t[7]=(f*E-h*x+d*b)*$,t[8]=(o*N-s*O+l*C)*$,t[9]=(n*O-e*N-a*C)*$,t[10]=(v*P-m*x+y*_)*$,t[11]=(p*x-f*P-d*_)*$,t[12]=(s*I-o*D-u*C)*$,t[13]=(e*D-n*I+i*C)*$,t[14]=(m*b-v*w-g*_)*$,t[15]=(f*w-p*b+h*_)*$,t):null}function To(t,r,e){var n=r[0],i=r[1],a=r[2],o=r[3],s=r[4],u=r[5],l=r[6],f=r[7],p=r[8],h=r[9],d=r[10],v=r[11],m=r[12],g=r[13],y=r[14],_=r[15],b=e[0],x=e[1],w=e[2],P=e[3];return t[0]=b*n+x*s+w*p+P*m,t[1]=b*i+x*u+w*h+P*g,t[2]=b*a+x*l+w*d+P*y,t[3]=b*o+x*f+w*v+P*_,b=e[4],x=e[5],w=e[6],P=e[7],t[4]=b*n+x*s+w*p+P*m,t[5]=b*i+x*u+w*h+P*g,t[6]=b*a+x*l+w*d+P*y,t[7]=b*o+x*f+w*v+P*_,b=e[8],x=e[9],w=e[10],P=e[11],t[8]=b*n+x*s+w*p+P*m,t[9]=b*i+x*u+w*h+P*g,t[10]=b*a+x*l+w*d+P*y,t[11]=b*o+x*f+w*v+P*_,b=e[12],x=e[13],w=e[14],P=e[15],t[12]=b*n+x*s+w*p+P*m,t[13]=b*i+x*u+w*h+P*g,t[14]=b*a+x*l+w*d+P*y,t[15]=b*o+x*f+w*v+P*_,t}function KC(t,r,e){var n=e[0],i=e[1],a=e[2],o,s,u,l,f,p,h,d,v,m,g,y;return r===t?(t[12]=r[0]*n+r[4]*i+r[8]*a+r[12],t[13]=r[1]*n+r[5]*i+r[9]*a+r[13],t[14]=r[2]*n+r[6]*i+r[10]*a+r[14],t[15]=r[3]*n+r[7]*i+r[11]*a+r[15]):(o=r[0],s=r[1],u=r[2],l=r[3],f=r[4],p=r[5],h=r[6],d=r[7],v=r[8],m=r[9],g=r[10],y=r[11],t[0]=o,t[1]=s,t[2]=u,t[3]=l,t[4]=f,t[5]=p,t[6]=h,t[7]=d,t[8]=v,t[9]=m,t[10]=g,t[11]=y,t[12]=o*n+f*i+v*a+r[12],t[13]=s*n+p*i+m*a+r[13],t[14]=u*n+h*i+g*a+r[14],t[15]=l*n+d*i+y*a+r[15]),t}function ZC(t,r,e){var n=e[0],i=e[1],a=e[2];return t[0]=r[0]*n,t[1]=r[1]*n,t[2]=r[2]*n,t[3]=r[3]*n,t[4]=r[4]*i,t[5]=r[5]*i,t[6]=r[6]*i,t[7]=r[7]*i,t[8]=r[8]*a,t[9]=r[9]*a,t[10]=r[10]*a,t[11]=r[11]*a,t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15],t}function bX(){var t=new Ai(4);return Ai!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function tM(t,r,e){return t[0]=r[0]*e,t[1]=r[1]*e,t[2]=r[2]*e,t[3]=r[3]*e,t}function wo(t,r,e){var n=r[0],i=r[1],a=r[2],o=r[3];return t[0]=e[0]*n+e[4]*i+e[8]*a+e[12]*o,t[1]=e[1]*n+e[5]*i+e[9]*a+e[13]*o,t[2]=e[2]*n+e[6]*i+e[10]*a+e[14]*o,t[3]=e[3]*n+e[7]*i+e[11]*a+e[15]*o,t}var BLe=function(){var t=bX();return function(r,e,n,i,a,o){var s,u;for(e||(e=4),n||(n=0),i?u=Math.min(i*e+n,r.length):u=r.length,s=n;s<u;s+=e)t[0]=r[s],t[1]=r[s+1],t[2]=r[s+2],t[3]=r[s+3],a(t,t,o),r[s]=t[0],r[s+1]=t[1],r[s+2]=t[2],r[s+3]=t[3];return r}}();function xX(t,r){if(t===r)return!0;
1960if(Array.isArray(t)){var e=t.length;if(!r||r.length!==e)return!1;for(var n=0;n<e;n++)if(t[n]!==r[n])return!1;return!0}return!1}function xr(t){var r={},e;return function(n){for(var i in n)if(!xX(n[i],r[i])){e=t(n),r=n;break}return e}}var rM=[0,0,0,0],AX=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],nM=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],SX=[0,0,0],iM=[0,0,0],TX=xr(PX);function z_(t,r){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:iM;e.length<3&&(e=[e[0],e[1],0]);var n=e,i,a=!0;switch(r===de.LNGLAT_OFFSETS||r===de.METER_OFFSETS?i=e:i=t.isGeospatial?[Math.fround(t.longitude),Math.fround(t.latitude),0]:null,t.projectionMode){case rr.WEB_MERCATOR:(r===de.LNGLAT||r===de.CARTESIAN)&&(i=[0,0,0],a=!1);break;case rr.WEB_MERCATOR_AUTO_OFFSET:r===de.LNGLAT?n=i:r===de.CARTESIAN&&(n=[Math.fround(t.center[0]),Math.fround(t.center[1]),0],i=t.unprojectPosition(n),n[0]-=e[0],n[1]-=e[1],n[2]-=e[2]);break;case rr.IDENTITY:n=t.position.map(Math.fround),n[2]=n[2]||0;break;case rr.GLOBE:a=!1,i=null;break;default:a=!1}return{geospatialOrigin:i,shaderCoordinateOrigin:n,offsetMode:a}}function wX(t,r,e){var n=t.viewMatrixUncentered,i=t.projectionMatrix,a=t.viewMatrix,o=t.viewProjectionMatrix,s=rM,u=rM,l=t.cameraPosition,f=z_(t,r,e),p=f.geospatialOrigin,h=f.shaderCoordinateOrigin,d=f.offsetMode;return d&&(u=t.projectPosition(p||h),l=[l[0]-u[0],l[1]-u[1],l[2]-u[2]],u[3]=1,s=wo([],u,o),a=n||a,o=To([],i,a),o=To([],o,AX)),{viewMatrix:a,viewProjectionMatrix:o,projectionCenter:s,originCommon:u,cameraPosCommon:l,shaderCoordinateOrigin:h,geospatialOrigin:p}}function Wh(t){var r=t.viewport,e=t.devicePixelRatio,n=e===void 0?1:e,i=t.modelMatrix,a=i===void 0?null:i,o=t.coordinateSystem,s=o===void 0?de.DEFAULT:o,u=t.coordinateOrigin,l=u===void 0?iM:u,f=t.autoWrapLongitude,p=f===void 0?!1:f;s===de.DEFAULT&&(s=r.isGeospatial?de.LNGLAT:de.CARTESIAN);var h=TX({viewport:r,devicePixelRatio:n,coordinateSystem:s,coordinateOrigin:l});return h.project_uWrapLongitude=p,h.project_uModelMatrix=a||nM,h}function PX(t){var r=t.viewport,e=t.devicePixelRatio,n=t.coordinateSystem,i=t.coordinateOrigin,a=wX(r,n,i),o=a.projectionCenter,s=a.viewProjectionMatrix,u=a.originCommon,l=a.cameraPosCommon,f=a.shaderCoordinateOrigin,p=a.geospatialOrigin,h=r.getDistanceScales(),d=[r.width*e,r.height*e],v=wo([],[0,0,-r.focalDistance,1],r.projectionMatrix)[3]||1,m={project_uCoordinateSystem:n,project_uProjectionMode:r.projectionMode,project_uCoordinateOrigin:f,project_uCommonOrigin:u.slice(0,3),project_uCenter:o,project_uPseudoMeters:Boolean(r._pseudoMeters),project_uViewportSize:d,project_uDevicePixelRatio:e,project_uFocalDistance:v,project_uCommonUnitsPerMeter:h.unitsPerMeter,project_uCommonUnitsPerWorldUnit:h.unitsPerMeter,project_uCommonUnitsPerWorldUnit2:SX,project_uScale:r.scale,project_uWrapLongitude:!1,project_uViewProjectionMatrix:s,project_uModelMatrix:nM,project_uCameraPosition:l};if(p){var g=r.getDistanceScales(p);switch(n){case de.METER_OFFSETS:m.project_uCommonUnitsPerWorldUnit=g.unitsPerMeter,m.project_uCommonUnitsPerWorldUnit2=g.unitsPerMeter2;break;case de.LNGLAT:case de.LNGLAT_OFFSETS:r._pseudoMeters||(m.project_uCommonUnitsPerMeter=g.unitsPerMeter),m.project_uCommonUnitsPerWorldUnit=g.unitsPerDegree,m.project_uCommonUnitsPerWorldUnit2=g.unitsPerDegree2;break;case de.CARTESIAN:m.project_uCommonUnitsPerWorldUnit=[1,1,g.unitsPerMeter[2]],m.project_uCommonUnitsPerWorldUnit2=[0,0,g.unitsPerMeter2[2]];break;default:break}}return m}var OX={};function EX(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:OX;return"viewport"in t?Wh(t):{}}var Ft={name:"project",dependencies:[oh,qC],vs:YC,getUniforms:EX};be();F();j();k();function Js(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function ga(t,r){var e=Oh([],r,t);return Ph(e,e,1/e[3]),e}function V_(t,r){var e=t%r;return e<0?r+e:e}function aM(t,r,e){return e*r+(1-e)*t}function Ff(t,r,e){return t<r?r:t>e?e:t}function CX(t){return Math.log(t)*Math.LOG2E}var Qs=Math.log2||CX;be();function Kr(t,r){if(!t)throw new Error(r||"@math.gl/web-mercator: assertion failed.")}var bn=Math.PI,oM=bn/4,Zr=bn/180,H_=180/bn,eu=512,$h=4003e4,tu=85.051129,W_=1.5;function ru(t){return Math.pow(2,t)}function Xh(t){return Qs(t)}function mt(t){var r=W(t,2),e=r[0],n=r[1];Kr(Number.isFinite(e)),Kr(Number.isFinite(n)&&n>=-90&&n<=90,"invalid latitude");var i=e*Zr,a=n*Zr,o=eu*(i+bn)/(2*bn),s=eu*(bn+Math.log(Math.tan(oM+a*.5)))/(2*bn);return[o,s]}function Dt(t){var r=W(t,2),e=r[0],n=r[1],i=e/eu*(2*bn)-bn,a=2*(Math.atan(Math.exp(n/eu*(2*bn)-bn))-oM);return[i*H_,a*H_]}function Df(t){var r=t.latitude;Kr(Number.isFinite(r));var e=Math.cos(r*Zr);return Xh($h*e)-9}function Po(t){var r=Math.cos(t*Zr);return eu/$h/r}function Oo(t){var r=t.latitude,e=t.longitude,n=t.highPrecision,i=n===void 0?!1:n;Kr(Number.isFinite(r)&&Number.isFinite(e));var a=eu,o=Math.cos(r*Zr),s=a/360,u=s/o,l=a/$h/o,f={unitsPerMeter:[l,l,l],metersPerUnit:[1/l,1/l,1/l],unitsPerDegree:[s,u,l],degreesPerUnit:[1/s,1/u,1/l]};
1960if(i){var p=Zr*Math.tan(r*Zr)/o,h=s*p/2,d=a/$h*p,v=d/u*l;f.unitsPerDegree2=[0,h,d],f.unitsPerMeter2=[v,0,v]}return f}function Nf(t,r){var e=W(t,3),n=e[0],i=e[1],a=e[2],o=W(r,3),s=o[0],u=o[1],l=o[2],f=Oo({longitude:n,latitude:i,highPrecision:!0}),p=f.unitsPerMeter,h=f.unitsPerMeter2,d=mt(t);d[0]+=s*(p[0]+h[0]*u),d[1]+=u*(p[1]+h[1]*u);var v=Dt(d),m=(a||0)+(l||0);return Number.isFinite(a)||Number.isFinite(l)?[v[0],v[1],m]:v}function jf(t){var r=t.height,e=t.pitch,n=t.bearing,i=t.altitude,a=t.scale,o=t.center,s=Js();Ao(s,s,[0,0,-i]),Ah(s,s,-e*Zr),Sh(s,s,n*Zr);var u=a/r;return Ys(s,s,[u,u,u]),o&&Ao(s,s,pE([],o)),s}function qh(t){var r=t.width,e=t.height,n=t.altitude,i=t.pitch,a=i===void 0?0:i,o=t.offset,s=t.center,u=t.scale,l=t.nearZMultiplier,f=l===void 0?1:l,p=t.farZMultiplier,h=p===void 0?1:p,d=t.fovy,v=d===void 0?Si(W_):d;n!==void 0&&(v=Si(n));var m=v*Zr,g=a*Zr,y=ya(v),_=y;s&&(_+=s[2]*u/Math.cos(g)/e);var b=m*(.5+(o?o[1]:0)/e),x=Math.sin(b)*_/Math.sin(Ff(Math.PI/2-g-b,.01,Math.PI-.01)),w=Math.sin(g)*x+_,P=_*10,E=Math.min(w*h,P);return{fov:m,aspect:r/e,focalDistance:y,near:f,far:E}}function $_(t){var r=qh(t),e=r.fov,n=r.aspect,i=r.near,a=r.far,o=Th([],e,n,i,a);return o}function Si(t){return 2*Math.atan(.5/t)*H_}function ya(t){return .5/Math.tan(.5*t*Zr)}function Eo(t,r){var e=W(t,3),n=e[0],i=e[1],a=e[2],o=a===void 0?0:a;return Kr(Number.isFinite(n)&&Number.isFinite(i)&&Number.isFinite(o)),ga(r,[n,i,o,1])}function Ar(t,r){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=W(t,3),i=n[0],a=n[1],o=n[2];if(Kr(Number.isFinite(i)&&Number.isFinite(a),"invalid pixel coordinate"),Number.isFinite(o)){var s=ga(r,[i,a,o,1]);return s}var u=ga(r,[i,a,0,1]),l=ga(r,[i,a,1,1]),f=u[2],p=l[2],h=f===p?0:((e||0)-f)/(p-f);return uh([],u,l,h)}be();function nu(t){var r=t.width,e=t.height,n=t.bounds,i=t.minExtent,a=i===void 0?0:i,o=t.maxZoom,s=o===void 0?24:o,u=t.offset,l=u===void 0?[0,0]:u,f=W(n,2),p=W(f[0],2),h=p[0],d=p[1],v=W(f[1],2),m=v[0],g=v[1],y=MX(t.padding),_=mt([h,Ff(g,-tu,tu)]),b=mt([m,Ff(d,-tu,tu)]),x=[Math.max(Math.abs(b[0]-_[0]),a),Math.max(Math.abs(b[1]-_[1]),a)],w=[r-y.left-y.right-Math.abs(l[0])*2,e-y.top-y.bottom-Math.abs(l[1])*2];Kr(w[0]>0&&w[1]>0);var P=w[0]/x[0],E=w[1]/x[1],C=(y.right-y.left)/2/P,I=(y.bottom-y.top)/2/E,O=[(b[0]+_[0])/2+C,(b[1]+_[1])/2+I],D=Dt(O),N=Math.min(s,Qs(Math.abs(Math.min(P,E))));return Kr(Number.isFinite(N)),{longitude:D[0],latitude:D[1],zoom:N}}function MX(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return typeof t=="number"?{top:t,bottom:t,left:t,right:t}:(Kr(Number.isFinite(t.top)&&Number.isFinite(t.bottom)&&Number.isFinite(t.left)&&Number.isFinite(t.right)),t)}var sM=Math.PI/180;function iu(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,e=t.width,n=t.height,i=t.unproject,a={targetZ:r},o=i([0,n],a),s=i([e,n],a),u,l,f=t.fovy?.5*t.fovy*sM:Math.atan(.5/t.altitude),p=(90-t.pitch)*sM;return f>p-.01?(u=uM(t,0,r),l=uM(t,e,r)):(u=i([0,0],a),l=i([e,0],a)),[o,s,l,u]}function uM(t,r,e){var n=t.pixelUnprojectionMatrix,i=ga(n,[r,0,1,1]),a=ga(n,[r,t.height,1,1]),o=e*t.distanceScales.unitsPerMeter[2],s=(o-i[2])/(a[2]-i[2]),u=uh([],i,a,s),l=Dt(u);return l.push(e),l}var lM=function(){function t(){var r=this,e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{width:1,height:1};A(this,t),c(this,"latitude",void 0),c(this,"longitude",void 0),c(this,"zoom",void 0),c(this,"pitch",void 0),c(this,"bearing",void 0),c(this,"altitude",void 0),c(this,"fovy",void 0),c(this,"meterOffset",void 0),c(this,"center",void 0),c(this,"width",void 0),c(this,"height",void 0),c(this,"scale",void 0),c(this,"distanceScales",void 0),c(this,"viewMatrix",void 0),c(this,"projectionMatrix",void 0),c(this,"viewProjectionMatrix",void 0),c(this,"pixelProjectionMatrix",void 0),c(this,"pixelUnprojectionMatrix",void 0),c(this,"equals",function(N){return N instanceof t?N.width===r.width&&N.height===r.height&&w_(N.projectionMatrix,r.projectionMatrix)&&w_(N.viewMatrix,r.viewMatrix):!1}),c(this,"project",function(N){var H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},$=H.topLeft,ee=$===void 0?!0:$,V=r.projectPosition(N),U=Eo(V,r.pixelProjectionMatrix),X=W(U,2),K=X[0],te=X[1],ie=ee?te:r.height-te;return N.length===2?[K,ie]:[K,ie,U[2]]}),c(this,"unproject",function(N){var H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},$=H.topLeft,ee=$===void 0?!0:$,V=H.targetZ,U=V===void 0?void 0:V,X=W(N,3),K=X[0],te=X[1],ie=X[2],ce=ee?te:r.height-te,Te=U&&U*r.distanceScales.unitsPerMeter[2],Me=Ar([K,ce,ie],r.pixelUnprojectionMatrix,Te),Fe=r.unprojectPosition(Me),we=W(Fe,3),Ne=we[0],Oe=we[1],ft=we[2];return Number.isFinite(ie)?[Ne,Oe,ft]:Number.isFinite(U)?[Ne,Oe,U]:[Ne,Oe]}),c(this,"projectPosition",function(N){var H=mt(N),$=W(H,2),ee=$[0],V=$[1],U=(N[2]||0)*r.distanceScales.unitsPerMeter[2];return[ee,V,U]}),c(this,"unprojectPosition",function(N){var H=Dt(N),$=W(H,2),ee=$[0],V=$[1],U=(N[2]||0)*r.distanceScales.metersPerUnit[2];return[ee,V,U]});
1960var n=e.width,i=e.height,a=e.altitude,o=a===void 0?null:a,s=e.fovy,u=s===void 0?null:s,l=e.latitude,f=l===void 0?0:l,p=e.longitude,h=p===void 0?0:p,d=e.zoom,v=d===void 0?0:d,m=e.pitch,g=m===void 0?0:m,y=e.bearing,_=y===void 0?0:y,b=e.position,x=b===void 0?null:b,w=e.nearZMultiplier,P=w===void 0?.02:w,E=e.farZMultiplier,C=E===void 0?1.01:E;n=n||1,i=i||1,u===null&&o===null?(o=W_,u=Si(o)):u===null?u=Si(o):o===null&&(o=ya(u));var I=ru(v);o=Math.max(.75,o);var O=Oo({longitude:h,latitude:f}),D=mt([h,f]);D.push(0),x&&cE(D,D,yE([],x,O.unitsPerMeter)),this.projectionMatrix=$_({width:n,height:i,scale:I,center:D,pitch:g,fovy:u,nearZMultiplier:P,farZMultiplier:C}),this.viewMatrix=jf({height:i,scale:I,center:D,pitch:g,bearing:_,altitude:o}),this.width=n,this.height=i,this.scale=I,this.latitude=f,this.longitude=h,this.zoom=v,this.pitch=g,this.bearing=_,this.altitude=o,this.fovy=u,this.center=D,this.meterOffset=x||[0,0,0],this.distanceScales=O,this._initMatrices(),Object.freeze(this)}return T(t,[{key:"_initMatrices",value:function(){var e=this.width,n=this.height,i=this.projectionMatrix,a=this.viewMatrix,o=Js();xo(o,o,i),xo(o,o,a),this.viewProjectionMatrix=o;var s=Js();Ys(s,s,[e/2,-n/2,1]),Ao(s,s,[1,-1,0]),xo(s,s,o);var u=xh(Js(),s);if(!u)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=s,this.pixelUnprojectionMatrix=u}},{key:"projectFlat",value:function(e){return mt(e)}},{key:"unprojectFlat",value:function(e){return Dt(e)}},{key:"getMapCenterByLngLatPosition",value:function(e){var n=e.lngLat,i=e.pos,a=Ar(i,this.pixelUnprojectionMatrix),o=mt(n),s=Cf([],o,aE([],a)),u=Cf([],this.center,s);return Dt(u)}},{key:"fitBounds",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=this.width,a=this.height,o=nu(Object.assign({width:i,height:a,bounds:e},n)),s=o.longitude,u=o.latitude,l=o.zoom;return new t({width:i,height:a,longitude:s,latitude:u,zoom:l})}},{key:"getBounds",value:function(e){var n=this.getBoundingRegion(e),i=Math.min.apply(Math,ae(n.map(function(u){return u[0]}))),a=Math.max.apply(Math,ae(n.map(function(u){return u[0]}))),o=Math.min.apply(Math,ae(n.map(function(u){return u[1]}))),s=Math.max.apply(Math,ae(n.map(function(u){return u[1]})));return[[i,o],[a,s]]}},{key:"getBoundingRegion",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return iu(this,e.z||0)}},{key:"getLocationAtPoint",value:function(e){var n=e.lngLat,i=e.pos;return this.getMapCenterByLngLatPosition({lngLat:n,pos:i})}}]),t}();var fM=512;function Yh(t){var r=t.width,e=t.height,n=t.pitch,i=n===void 0?0:n,a=t.longitude,o=t.latitude,s=t.zoom,u=t.bearing,l=u===void 0?0:u;(a<-180||a>180)&&(a=V_(a+180,360)-180),(l<-180||l>180)&&(l=V_(l+180,360)-180);var f=Qs(e/fM);if(s<=f)s=f,o=0;else{var p=e/2/Math.pow(2,s),h=Dt([0,p])[1];if(o<h)o=h;else{var d=Dt([0,fM-p])[1];o>d&&(o=d)}}return{width:r,height:e,longitude:a,latitude:o,zoom:s,pitch:i,bearing:l}}k();function cM(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function pM(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?cM(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):cM(Object(e)).forEac
1960h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function IX(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=RX(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
1961In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function RX(t,r){if(t){if(typeof t=="string")return hM(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return hM(t,r)}}function hM(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var dM=.01,LX=["longitude","latitude","zoom"],vM={curve:1.414,speed:1.2};function Kh(t,r,e,n){var i=mM(t,r,n),a=i.startZoom,o=i.startCenterXY,s=i.uDelta,u=i.w0,l=i.u1,f=i.S,p=i.rho,h=i.rho2,d=i.r0;if(l<dM){var v={},m=IX(LX),g;try{for(m.s();!(g=m.n()).done;){var y=g.value,_=t[y],b=r[y];v[y]=aM(_,b,e)}}catch(D){m.e(D)}finally{m.f()}return v}var x=e*f,w=Math.cosh(d)/Math.cosh(d+p*x),P=u*((Math.cosh(d)*Math.tanh(d+p*x)-Math.sinh(d))/h)/l,E=1/w,C=a+Xh(E),I=nE([],s,P);Cf(I,I,o);var O=Dt(I);return{longitude:O[0],latitude:O[1],zoom:C}}function X_(t,r,e){var n=pM(pM({},vM),e),i=n.screenSpeed,a=n.speed,o=n.maxDuration,s=mM(t,r,n),u=s.S,l=s.rho,f=1e3*u,p;return Number.isFinite(i)?p=f/(i/l):p=f/a,Number.isFinite(o)&&p>o?0:p}function mM(t,r,e){e=Object.assign({},vM,e);var n=e.curve,i=t.zoom,a=[t.longitude,t.latitude],o=ru(i),s=r.zoom,u=[r.longitude,r.latitude],l=ru(s-i),f=mt(a),p=mt(u),h=uE([],p,f),d=Math.max(t.width,t.height),v=d/l,m=iE(h)*o,g=Math.max(m,dM),y=n*n,_=(v*v-d*d+y*y*g*g)/(2*d*y*g),b=(v*v-d*d-y*y*g*g)/(2*v*y*g),x=Math.log(Math.sqrt(_*_+1)-_),w=Math.log(Math.sqrt(b*b+1)-b),P=(w-x)/n;return{startZoom:i,startCenterXY:f,uDelta:h,w0:d,u1:m,S:P,rho:n,rho2:y,r0:x,r1:w}}function kX(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=BX(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
1962In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function BX(t,r){if(t){if(typeof t=="string")return gM(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return gM(t,r)}}function gM(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var FX=`
1963const int max_lights = 2;
1964uniform mat4 shadow_uViewProjectionMatrices[max_lights];
1965uniform vec4 shadow_uProjectCenters[max_lights];
1966uniform bool shadow_uDrawShadowMap;
1967uniform bool shadow_uUseShadowMap;
1968uniform int shadow_uLightId;
1969uniform float shadow_uLightCount;
1970
1971varying vec3 shadow_vPosition[max_lights];
1972
1973vec4 shadow_setVertexPosition(vec4 position_commonspace) {
1974  if (shadow_uDrawShadowMap) {
1975    return project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[shadow_uLightId], shadow_uProjectCenters[shadow_uLightId]);
1976  }
1977  if (shadow_uUseShadowMap) {
1978    for (int i = 0; i < max_lights; i++) {
1979      if(i < int(shadow_uLightCount)) {
1980        vec4 shadowMap_position = project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[i], shadow_uProjectCenters[i]);
1981        shadow_vPosition[i] = (shadowMap_position.xyz / shadowMap_position.w + 1.0) / 2.0;
1982      }
1983    }
1984  }
1985  return gl_Position;
1986}
1987`,DX=`
1988const int max_lights = 2;
1989uniform bool shadow_uDrawShadowMap;
1990uniform bool shadow_uUseShadowMap;
1991uniform sampler2D shadow_uShadowMap0;
1992uniform sampler2D shadow_uShadowMap1;
1993uniform vec4 shadow_uColor;
1994uniform float shadow_uLightCount;
1995
1996varying vec3 shadow_vPosition[max_lights];
1997
1998const vec4 bitPackShift = vec4(1.0, 255.0, 65025.0, 16581375.0);
1999const vec4 bitUnpackShift = 1.0 / bitPackShift;
2000const vec4 bitMask = vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0,  0.0);
2001
2002float shadow_getShadowWeight(vec3 position, sampler2D shadowMap) {
2003  vec4 rgbaDepth = texture2D(shadowMap, position.xy);
2004
2005  float z = dot(rgbaDepth, bitUnpackShift);
2006  return smoothstep(0.001, 0.01, position.z - z);
2007}
2008
2009vec4 shadow_filterShadowColor(vec4 color) {
2010  if (shadow_uDrawShadowMap) {
2011    vec4 rgbaDepth = fract(gl_FragCoord.z * bitPackShift);
2012    rgbaDepth -= rgbaDepth.gbaa * bitMask;
2013    return rgbaDepth;
2014  }
2015  if (shadow_uUseShadowMap) {
2016    float shadowAlpha = 0.0;
2017    shadowAlpha += shadow_getShadowWeight(shadow_vPosition[0], shadow_uShadowMap0);
2018    if(shadow_uLightCount > 1.0) {
2019      shadowAlpha += shadow_getShadowWeight(shadow_vPosition[1], shadow_uShadowMap1);
2020    }
2021    shadowAlpha *= shadow_uColor.a / shadow_uLightCount;
2022    float blendedAlpha = shadowAlpha + color.a * (1.0 - shadowAlpha);
2023
2024    return vec4(
2025      mix(color.rgb, shadow_uColor.rgb, shadowAlpha / blendedAlpha),
2026      blendedAlpha
2027    );
2028  }
2029  return color;
2030}
2031`,NX=xr(VX),jX=xr(HX),UX=[0,0,0,1],GX=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0];function zX(t,r){var e=W(t,3),n=e[0],i=e[1],a=e[2],o=Ar([n,i,a],r);return Number.isFinite(a)?o:[o[0],o[1],0]}function VX(t){var r=t.viewport,e=t.center;return new ye(r.viewProjectionMatrix).invert().transform(e)}function HX(t){var r=t.viewport,e=t.shadowMatrices,n=[],i=r.pixelUnprojectionMatrix,a=r.isGeospatial?void 0:1,o=[[0,0,a],[r.width,0,a],[0,r.height,a],[r.width,r.height,a],[0,0,-1],[r.width,0,-1],[0,r.height,-1],[r.width,r.height,-1]].map(function(f){return zX(f,i)}),s=kX(e),u;try{var l=function(){var p=u.value,h=p.clone().translate(new z(r.center).negate()),d=o.map(function(m){return h.transform(m)}),v=new ye().ortho({left:Math.min.apply(Math,ae(d.map(function(m){return m[0]}))),right:Math.max.apply(Math,ae(d.map(function(m){return m[0]}))),bottom:Math.min.apply(Math,ae(d.map(function(m){return m[1]}))),top:Math.max.apply(Math,ae(d.map(function(m){return m[1]}))),near:Math.min.apply(Math,ae(d.map(function(m){return-m[2]}))),far:Math.max.apply(Math,ae(d.map(function(m){return-m[2]})))});n.push(v.multiplyRight(p))};for(s.s();!(u=s.n()).done;)l()}catch(f){s.e(f)}finally{s.f()}return n}function WX(t,r){var e=t.shadowEnabled,n=e===void 0?!0:e;if(!n||!t.shadowMatrices||!t.shadowMatrices.length)return{shadow_uDrawShadowMap:!1,shadow_uUseShadowMap:!1};for(var i={shadow_uDrawShadowMap:Boolean(t.drawToShadowMap),shadow_uUseShadowMap:t.shadowMaps?t.shadowMaps.length>0:!1,shadow_uColor:t.shadowColor||UX,shadow_uLightId:t.shadowLightId||0,shadow_uLightCount:t.shadowMatrices.length},a=NX({viewport:t.viewport,center:r.project_uCenter}),o=[],s=jX({shadowMatrices:t.shadowMatrices,viewport:t.viewport}).slice(),u=0;u<t.shadowMatrices.length;u++){var l=s[u],f=l.clone().translate(new z(t.viewport.center).negate());r.project_uCoordinateSystem===de.LNGLAT&&r.project_uProjectionMode===rr.WEB_MERCATOR?(s[u]=f,o[u]=a):(s[u]=l.clone().multiplyRight(G
2031X),o[u]=f.transform(a))}for(var p=0;p<s.length;p++)i["shadow_uViewProjectionMatrices[".concat(p,"]")]=s[p],i["shadow_uProjectCenters[".concat(p,"]")]=o[p],t.shadowMaps&&t.shadowMaps.length>0?i["shadow_uShadowMap".concat(p)]=t.shadowMaps[p]:i["shadow_uShadowMap".concat(p)]=t.dummyShadowMap;return i}var Co={name:"shadow",dependencies:[Ft],vs:FX,fs:DX,inject:{"vs:DECKGL_FILTER_GL_POSITION":`
2032    position = shadow_setVertexPosition(geometry.position);
2033    `,"fs:DECKGL_FILTER_COLOR":`
2034    color = shadow_filterShadowColor(color);
2035    `},getUniforms:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return"viewport"in r&&(r.drawToShadowMap||r.shadowMaps&&r.shadowMaps.length>0)?WX(r,e):{}}};function yM(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=$X(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2036In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function $X(t,r){if(t){if(typeof t=="string")return _M(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return _M(t,r)}}function _M(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var XX={color:[255,255,255],intensity:1},bM=[{color:[255,255,255],intensity:1,direction:[-1,3,-1]},{color:[255,255,255],intensity:.9,direction:[1,-8,-2.5]}],qX=[0,0,0,200/255],Uf=function(){function t(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};A(this,t),c(this,"id","lighting-effect"),c(this,"props",void 0),c(this,"shadowColor",qX),c(this,"shadow",void 0),c(this,"ambientLight",void 0),c(this,"directionalLights",void 0),c(this,"pointLights",void 0),c(this,"shadowPasses",[]),c(this,"shadowMaps",[]),c(this,"dummyShadowMap",null),c(this,"programManager",void 0),c(this,"shadowMatrices",void 0),this.setProps(r)}return T(t,[{key:"setProps",value:function(e){this.ambientLight=null,this.directionalLights=[],this.pointLights=[];for(var n in e){var i=e[n];switch(i.type){case"ambient":this.ambientLight=i;break;case"directional":this.directionalLights.push(i);break;case"point":this.pointLights.push(i);break;default:}}this._applyDefaultLights(),this.shadow=this.directionalLights.some(function(a){return a.shadow}),this.props=e}},{key:"preRender",value:function(e,n){var i=n.layers,a=n.layerFilter,o=n.viewports,s=n.onViewportActive,u=n.views;if(this.shadow){this.shadowMatrices=this._calculateMatrices(),this.shadowPasses.length===0&&this._createShadowPasses(e),this.programManager||(this.programManager=Yr.getDefaultProgramManager(e),Co&&this.programManager.addDefaultModule(Co)),this.dummyShadowMap||(this.dummyShadowMap=new Ce(e,{width:1,height:1}));for(var l=0;l<this.shadowPasses.length;l++){var f=this.shadowPasses[l];f.render({layers:i,layerFilter:a,viewports:o,onViewportActive:s,views:u,moduleParameters:{shadowLightId:l,dummyShadowMap:this.dummyShadowMap,shadowMatrices:this.shadowMatrices}})}}}},{key:"getModuleParameters",value:function(e){var n=this.shadow?{shadowMaps:this.shadowMaps,dummyShadowMap:this.dummyShadowMap,shadowColor:this.shadowColor,shadowMatrices:this.shadowMatrices}:{};return n.lightSources={ambientLight:this.ambientLight,directionalLights:this.directionalLights.map(function(i){return i.getProjectedLight({layer:e})}),pointLights:this.pointLights.map(function(i){return i.getProjectedLight({layer:e})})},n}},{key:"cleanup",value:function(){var e=yM(this.shadowPasses),n;try{for(e.s();!(n=e.n()).done;){var i=n.value;i.delete()}}catch(a){e.e(a)}finally{e.f()}this.shadowPasses.length=0,this.shadowMaps.length=0,this.dummyShadowMap&&(this.dummyShadowMap.delete(),this.dummyShadowMap=null),this.shadow&&this.programManager&&(this.programManager.removeDefaultModule(Co),this.programManager=null)}},{key:"_calculateMatrices",value:function(){var e=[],n=yM(this.directionalLights),i;try{for(n.s();!(i=n.n()).done;){var a=i.value,o=new ye().lookAt({eye:new z(a.direction).negate()});e.push(o)}}catch(s){n.e(s)}finally{n.f()}return e}},{key:"_createShadowPasses",value:function(e){for(var n=0;n<this.directionalLights.length;n++){var i=new $C(e);this.shadowPasses[n]=i,this.shadowMaps[n]=i.shadowMap}}},{key:"_applyDefaultLights",value:function(){var e=this.ambientLight,n=this.pointLights,i=this.directionalLights;!e&&n.length===0&&i.length===0&&(this.ambientLight=new Vh(XX),this.directionalLights.push(new So(bM[0]),new So(bM[1])))}}]),t}();F();j();k();be();be();F();j();k();be();F();j();k();F();j();k();var YX=function(){function t(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};A(this,t),c(this,"_pool",[]),c(this,"opts",{overAlloc:2,poolSize:100}),this.setOptions(r)}return T(t,[{key:"setOptions",value:function(e){Object.assign(this.opts,e)}},{key:"allocate",value:function(e,n,i){var a=i.size,o=a===void 0?1:a,s=i.type,u=i.padding,l=u===void 0?0:u,f=i.copy,p=f===void 0?!1:f,h=i.initialize,d=h===void 0?!1:h,v=i.maxCount,m=s||e&&e.constructor||Float32Array,g=n*o+l;if(ArrayBuffer.isView(e)){if(g<=e.length)return e;if(g*e.BYTES_PER_ELEMENT<=e.buffer.byteLength)return new m(e.buffer,0,g)}var y=1/0;v&&(y=v*o+l);var _=this._allocate(m,g,d,y);return e&&p?_.set(e):d||_.fill(0,0,4),this._release(e),_}},{key:"release",value:function(e){this._release(e)}},{key:"_allocate",value:function(e,n,i,a){var o=Math.max(Math.ceil(n*this.opts.overAlloc),1);o>a&&(o=a);var s=this._pool,u=e.BYTES_PER_ELEMENT*o,l=s.findIndex(function(p){return p.byteLength>=u});if(l>=0){var f=new e(s.splice(l,1)[0],0,o);return i&&f.fill(0),f}return new e(o)}},{key:"_release",value:function(e){if(ArrayBuffer.isView(e)){var n=this._pool,i=e.buffer,a=i.byteLength,o=n.findIndex(function(s){return s.byteLength>=a});o<0?n.push(i):(o>0||n.length<this.opts.poolSize)&&n.splice(o,0,i),n.length>this.opts.poolSize&&n.shift()}}}]),t}(),xn=new YX;function KX(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=ZX(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}
2036}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2037In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function ZX(t,r){if(t){if(typeof t=="string")return xM(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return xM(t,r)}}function xM(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function ou(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function Mo(t,r){var e=t%r;return e<0?r+e:e}function SM(t){return[t[12],t[13],t[14]]}function TM(t){return{left:au(t[3]+t[0],t[7]+t[4],t[11]+t[8],t[15]+t[12]),right:au(t[3]-t[0],t[7]-t[4],t[11]-t[8],t[15]-t[12]),bottom:au(t[3]+t[1],t[7]+t[5],t[11]+t[9],t[15]+t[13]),top:au(t[3]-t[1],t[7]-t[5],t[11]-t[9],t[15]-t[13]),near:au(t[3]+t[2],t[7]+t[6],t[11]+t[10],t[15]+t[14]),far:au(t[3]-t[2],t[7]-t[6],t[11]-t[10],t[15]-t[14])}}var AM=new z;function au(t,r,e,n){AM.set(t,r,e);var i=AM.len();return{distance:n/i,normal:new z(-t/i,-r/i,-e/i)}}function An(t){return t-Math.fround(t)}var Gf;function Zh(t,r){var e=r.size,n=e===void 0?1:e,i=r.startIndex,a=i===void 0?0:i,o=r.endIndex!==void 0?r.endIndex:t.length,s=(o-a)/n;Gf=xn.allocate(Gf,s,{type:Float32Array,size:n*2});for(var u=a,l=0;u<o;){for(var f=0;f<n;f++){var p=t[u++];Gf[l+f]=p,Gf[l+f+n]=An(p)}l+=n*2}return Gf.subarray(0,s*n*2)}function wM(t){var r=null,e=!1,n=KX(t),i;try{for(n.s();!(i=n.n()).done;){var a=i.value;a&&(r?(e||(r=[[r[0][0],r[0][1]],[r[1][0],r[1][1]]],e=!0),r[0][0]=Math.min(r[0][0],a[0][0]),r[0][1]=Math.min(r[0][1],a[0][1]),r[1][0]=Math.max(r[1][0],a[1][0]),r[1][1]=Math.max(r[1][1],a[1][1])):r=a)}}catch(o){n.e(o)}finally{n.f()}return r}var JX=Math.PI/180,QX=ou(),PM=[0,0,0],eq={unitsPerMeter:[1,1,1],metersPerUnit:[1,1,1]};function tq(t){var r=t.width,e=t.height,n=t.orthographic,i=t.fovyRadians,a=t.focalDistance,o=t.padding,s=t.near,u=t.far,l=r/e,f=n?new ye().orthographic({fovy:i,aspect:l,focalDistance:a,near:s,far:u}):new ye().perspective({fovy:i,aspect:l,near:s,far:u});if(o){var p=o.left,h=p===void 0?0:p,d=o.right,v=d===void 0?0:d,m=o.top,g=m===void 0?0:m,y=o.bottom,_=y===void 0?0:y,b=We((h+r-v)/2,0,r)-r/2,x=We((g+e-_)/2,0,e)-e/2;f[8]-=b*2/r,f[9]+=x*2/e}return f}var tr=function(){function t(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};A(this,t),c(this,"id",void 0),c(this,"x",void 0),c(this,"y",void 0),c(this,"width",void 0),c(this,"height",void 0),c(this,"padding",void 0),c(this,"isGeospatial",void 0),c(this,"zoom",void 0),c(this,"focalDistance",void 0),c(this,"position",void 0),c(this,"modelMatrix",void 0),c(this,"distanceScales",void 0),c(this,"scale",void 0),c(this,"center",void 0),c(this,"cameraPosition",void 0),c(this,"projectionMatrix",void 0),c(this,"viewMatrix",void 0),c(this,"viewMatrixUncentered",void 0),c(this,"viewMatrixInverse",void 0),c(this,"viewProjectionMatrix",void 0),c(this,"pixelProjectionMatrix",void 0),c(this,"pixelUnprojectionMatrix",void 0),c(this,"resolution",void 0),c(this,"_frustumPlanes",{}),this.id=r.id||this.constructor.displayName||"viewport",this.x=r.x||0,this.y=r.y||0,this.width=r.width||1,this.height=r.height||1,this.zoom=r.zoom||0,this.padding=r.padding,this.distanceScales=r.distanceScales||eq,this.focalDistance=r.focalDistance||1,this.position=r.position||PM,this.modelMatrix=r.modelMatrix||null;var e=r.longitude,n=r.latitude;this.isGeospatial=Number.isFinite(n)&&Number.isFinite(e),this._initProps(r),this._initMatrices(r),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 T(t,[{key:"subViewports",get:function(){return null}},{key:"metersPerPixel",get:function(){return this.distanceScales.metersPerUnit[2]/this.scale}},{key:"projectionMode",get:function(){return this.isGeospatial?this.zoom<12?rr.WEB_MERCATOR:rr.WEB_MERCATOR_AUTO_OFFSET:rr.IDENTITY}},{key:"equals",value:function(e){return e instanceof t?this===e?!0:e.width===this.width&&e.height===this.height&&e.scale===this.scale&&Ze(e.projectionMatrix,this.projectionMatrix)&&Ze(e.viewMatrix,this.viewMatrix):!1}},{key:"project",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.topLeft,a=i===void 0?!0:i,o=this.projectPosition(e),s=Eo(o,this.pixelProjectionMatrix),u=W(s,2),l=u[0],f=u[1],p=a?f:this.height-f;return e.length===2?[l,p]:[l,p,s[2]]}},{key:"unproject",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.topLeft,a=i===void 0?!0:i,o=n.targetZ,s=W(e,3),u=s[0],l=s[1],f=s[2],p=a?l:this.height-l,h=o&&o*this.distanceScales.unitsPerMeter[2],d=Ar([u,p,f],this.pixelUnprojectionMatrix,h),v=this.unprojectPosition(d),m=W(v,3),g=m[0],y=m[1],_=m[2];return Number.isFinite(f)?[g,y,_]:Number.isFinite(o)?[g,y,o]:[g,y]}},{key:"projectPosition",value:function(e){var n=this.projectFlat(e),i=W(n,2),a=i[0],o=i[1],s=(e[2]||0)*this.distanceScales.unitsPerMeter[2];return[a,o,s]}},{key:"unprojectPosition",value:function(e){var n=this.unprojectFlat(e),i=W(n,2),a=i[0],o=i[1],s=(e[2]||0)*this.distanceScales.metersPerUnit[2];return[a,o,s]}},{key:"projectFlat",value:function(e){if(this.isGeospatial){var n=mt(e);return n[1]=We(n[1],-318,830),n}return e}},{key:"unprojectFlat",value:function(e){return this.isGeospatial?Dt(e):e}},{key:"getBounds",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n={targetZ:e.z||0},i=this.unproject([0,0],n),a=this.unproject([this.width,0],n),o=this.unproject([0,this.height],n),s=this.unproject([this.width,this.height],n);return[Math.min(i[0],a[0],o[0],s[0]),Math.min(i[1],a[1],o[1],s[1]),Math.max(i[0],a[0],o[0],s[0]),Math.max(i[1],a[1],o[1],s[1])]}},{key:"getDistanceScales",value:function(e){return e?Oo({longitude:e[0],latitude:e[1],highPrecision:!0}):this.distanceScales}},{key:"containsPixel",value:function(e){var n=e.x,i=e.y,a=e.width,o=a===void 0?1:a,s=e.height,u=s===void 0?1:s;return n<this.x+this.width&&this.x<n+o&&i<this.y+this.height&&this.y<i+u}},{key:"getFrustumPlanes",value:function(){return this._frustumPlanes.near?this._frustumPlanes:(Object.assign(this._frustumPlanes,TM(this.viewProjectionMatrix)),this._frustumPlanes)}},{key:"panByPosition",value:function(e,n){return null}},{key:"_initProps",value:function(e){var n=e.longitude,i=e.latitude;this.isGeospatial&&(Number.isFinite(e.zoom)||(this.zoom=Df({latitude:i})+Math.log2(this.focalDistance)),this.distanceScales=e.distanceScales||Oo({latitude:i,longitude:n}));var a=Math.pow(2,this.zoom);this.scale=a;var o=e.position,s=e.modelMatrix,u=PM;if(o&&(u=s?new ye(s).transformAsVector(o,[]):o),this.isGeospatial){var l=this.projectPosition([n,i,0]);this.center=new z(u).scale(this.distanceScales.unitsPerMeter).add(l)}else this.center=this.projectPosition(u)}},{key:"_initMatrices",value:function(e){var n=e.viewMatrix,i=n===void 0?QX:n,a=e.projectionMatrix,o=a===void 0?null:a,s=e.orthographic,u=s===void 0?!1:s,l=e.fovyRadians,f=e.fovy,p=f===void 0?75:f,h=e.near,d=h===void 0?.1:h,v=e.far,m=v===void 0?1e3:v,g=e.padding,y=g===void 0?null:g,_=e.focalDistance,b=_===void 0?1:_;this.viewMatrixUncentered=i,this.viewMatrix=new ye().multiplyRight(i).translate(new z(this.center).negate()),this.projectionMatrix=o||tq({width:this.width,height:this.height,orthographic:u,fovyRadians:l||p*JX,focalDistance:b,padding:y,near:d,far:m});var x=ou();To(x,x,this.projectionMatrix),To(x,x,this.viewMatrix),this.viewProjectionMatrix=x,this.viewMatrixInverse=U_([],this.viewMatrix)||this.viewMatrix,this.cameraPosition=SM(this.viewMatrixInverse);var w=ou(),P=ou();ZC(w,w,[this.width/2,-this.height/2,1]),KC(w,w,[1,-1,0]),To(P,w,this.viewProjectionMatrix),this.pixelProjectionMatrix=P,this.pixelUnprojectionMatrix=U_(ou(),this.pixelProjectionMatrix),this.pixelUnprojectionMatrix||ne.warn("Pixel project matrix not invertible")()}}]),t}();c(tr,"displayName","Viewport");function rq(){var t=new Ai(2);return Ai!=Float32Array&&(t[0]=0,t[1]=0),t}function su(t,r,e){return t[0]=r[0]+e[0],t[1]=r[1]+e[1],t}function Jh(t,r){return t[0]=-r[0],t[1]=-r[1],t}var pBe=function(){var t=rq();return function(r,e,n,i,a,o){var s,u;for(e||(e=2),n||(n=0),i?u=Math.min(i*e+n,r.length):u=r.length,s=n;s<u;s+=e)t[0]=r[s],t[1]=r[s+1],a(t,t,o),r[s]=t[0],r[s+1]=t[1];return r}}();function EM(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function uu(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};
2037r%2?EM(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):EM(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function nq(t){var r=iq();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function iq(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Sr=function(t){L(e,t);var r=nq(e);function e(){var n,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};A(this,e);var a=i.latitude,o=a===void 0?0:a,s=i.longitude,u=s===void 0?0:s,l=i.zoom,f=l===void 0?0:l,p=i.pitch,h=p===void 0?0:p,d=i.bearing,v=d===void 0?0:d,m=i.nearZMultiplier,g=m===void 0?.1:m,y=i.farZMultiplier,_=y===void 0?1.01:y,b=i.nearZ,x=i.farZ,w=i.orthographic,P=w===void 0?!1:w,E=i.projectionMatrix,C=i.repeat,I=C===void 0?!1:C,O=i.worldOffset,D=O===void 0?0:O,N=i.position,H=i.padding,$=i.legacyMeterSizes,ee=$===void 0?!1:$,V=i.width,U=i.height,X=i.altitude,K=X===void 0?1.5:X,te=Math.pow(2,f);V=V||1,U=U||1;var ie,ce=null;if(E)K=E[5]/2,ie=Si(K);else{i.fovy?(ie=i.fovy,K=ya(ie)):ie=Si(K);var Te;if(H){var Me=H.top,Fe=Me===void 0?0:Me,we=H.bottom,Ne=we===void 0?0:we;Te=[0,We((Fe+U-Ne)/2,0,U)-U/2]}ce=qh({width:V,height:U,scale:te,center:N&&[0,0,N[2]*Po(o)],offset:Te,pitch:h,fovy:ie,nearZMultiplier:g,farZMultiplier:_}),Number.isFinite(b)&&(ce.near=b),Number.isFinite(x)&&(ce.far=x)}var Oe=jf({height:U,pitch:h,bearing:v,scale:te,altitude:K});if(D){var ft=new ye().translate([512*D,0,0]);Oe=ft.multiplyLeft(Oe)}return n=r.call(this,uu(uu(uu({},i),{},{width:V,height:U,viewMatrix:Oe,longitude:u,latitude:o,zoom:f},ce),{},{fovy:ie,focalDistance:K})),c(q(n),"longitude",void 0),c(q(n),"latitude",void 0),c(q(n),"pitch",void 0),c(q(n),"bearing",void 0),c(q(n),"altitude",void 0),c(q(n),"fovy",void 0),c(q(n),"orthographic",void 0),c(q(n),"_subViewports",void 0),c(q(n),"_pseudoMeters",void 0),n.latitude=o,n.longitude=u,n.zoom=f,n.pitch=h,n.bearing=v,n.altitude=K,n.fovy=ie,n.orthographic=P,n._subViewports=I?[]:null,n._pseudoMeters=ee,Object.freeze(q(n)),n}return T(e,[{key:"subViewports",get:function(){if(this._subViewports&&!this._subViewports.length)for(var i=this.getBounds(),a=Math.floor((i[0]+180)/360),o=Math.ceil((i[2]-180)/360),s=a;s<=o;s++){var u=s?new e(uu(uu({},this),{},{worldOffset:s})):this;this._subViewports.push(u)}return this._subViewports}},{key:"projectPosition",value:function(i){if(this._pseudoMeters)return Z(S(e.prototype),"projectPosition",this).call(this,i);var a=this.projectFlat(i),o=W(a,2),s=o[0],u=o[1],l=(i[2]||0)*Po(i[1]);return[s,u,l]}},{key:"unprojectPosition",value:function(i){if(this._pseudoMeters)return Z(S(e.prototype),"unprojectPosition",this).call(this,i);var a=this.unprojectFlat(i),o=W(a,2),s=o[0],u=o[1],l=(i[2]||0)/Po(u);return[s,u,l]}},{key:"addMetersToLngLat",value:function(i,a){return Nf(i,a)}},{key:"panByPosition",value:function(i,a){var o=Ar(a,this.pixelUnprojectionMatrix),s=this.projectFlat(i),u=su([],s,Jh([],o)),l=su([],this.center,u),f=this.unprojectFlat(l),p=W(f,2),h=p[0],d=p[1];return{longitude:h,latitude:d}}},{key:"getBounds",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=iu(this,i.z||0);return[Math.min(a[0][0],a[1][0],a[2][0],a[3][0]),Math.min(a[0][1],a[1][1],a[2][1],a[3][1]),Math.max(a[0][0],a[1][0],a[2][0],a[3][0]),Math.max(a[0][1],a[1][1],a[2][1],a[3][1])]}},{key:"fitBounds",value:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=this.width,s=this.height,u=nu(uu({width:o,height:s,bounds:i},a)),l=u.longitude,f=u.latitude,p=u.zoom;return new e({width:o,height:s,longitude:l,latitude:f,zoom:p})}}]),e}(tr);c(Sr,"displayName","WebMercatorViewport");function aq(){var t=new Ai(3);return Ai!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function oq(t){var r=t[0],e=t[1],n=t[2];return Math.hypot(r,e,n)}function sq(t,r,e){return t[0]=r[0]-e[0],t[1]=r[1]-e[1],t[2]=r[2]-e[2],t}function uq(t){var r=t[0],e=t[1],n=t[2];return r*r+e*e+n*n}function CM(t,r,e,n){var i=r[0],a=r[1],o=r[2];return t[0]=i+n*(e[0]-i),t[1]=a+n*(e[1]-a),t[2]=o+n*(e[2]-o),t}var Qh=sq;var MM=oq,ed=uq,PBe=function(){var t=aq();return function(r,e,n,i,a,o){var s,u;for(e||(e=3),n||(n=0),i?u=Math.min(i*e+n,r.length):u=r.length,s=n;s<u;s+=e)t[0]=r[s],t[1]=r[s+1],t[2]=r[s+2],a(t,t,o),r[s]=t[0],r[s+1]=t[1],r[s+2]=t[2];return r}}();var RM=[0,0,0];function q_(t,r){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=r.projectPosition(t);
2037if(e&&r instanceof Sr){var i=W(t,3),a=i[0],o=i[1],s=i[2],u=s===void 0?0:s,l=r.getDistanceScales([a,o]);n[2]=u*l.unitsPerMeter[2]}return n}function lq(t){var r=t.viewport,e=t.modelMatrix,n=t.coordinateOrigin,i=t.coordinateSystem,a=t.fromCoordinateSystem,o=t.fromCoordinateOrigin;return i===de.DEFAULT&&(i=r.isGeospatial?de.LNGLAT:de.CARTESIAN),a===void 0&&(a=i),o===void 0&&(o=n),{viewport:r,coordinateSystem:i,coordinateOrigin:n,modelMatrix:e,fromCoordinateSystem:a,fromCoordinateOrigin:o}}function Y_(t,r){var e=r.viewport,n=r.modelMatrix,i=r.coordinateSystem,a=r.coordinateOrigin,o=r.offsetMode,s=W(t,3),u=s[0],l=s[1],f=s[2],p=f===void 0?0:f;if(n){var h=wo([],[u,l,p,1],n),d=W(h,3);u=d[0],l=d[1],p=d[2]}switch(i){case de.LNGLAT:return q_([u,l,p],e,o);case de.LNGLAT_OFFSETS:return q_([u+a[0],l+a[1],p+(a[2]||0)],e,o);case de.METER_OFFSETS:return q_(Nf(a,[u,l,p]),e,o);case de.CARTESIAN:default:return e.isGeospatial?[u+a[0],l+a[1],p+a[2]]:e.projectPosition([u,l,p])}}function td(t,r){var e=lq(r),n=e.viewport,i=e.coordinateSystem,a=e.coordinateOrigin,o=e.modelMatrix,s=e.fromCoordinateSystem,u=e.fromCoordinateOrigin,l=r.autoOffset,f=l===void 0?!0:l,p=f?z_(n,i,a):{},h=p.geospatialOrigin,d=h===void 0?RM:h,v=p.shaderCoordinateOrigin,m=v===void 0?RM:v,g=p.offsetMode,y=g===void 0?!1:g,_=Y_(t,{viewport:n,modelMatrix:o,coordinateSystem:s,coordinateOrigin:u,offsetMode:y});if(y){var b=n.projectPosition(d||m);Qh(_,_,b)}return _}function LM(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function fq(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?LM(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):LM(Object(e)).forEac
2037h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var cq=[255,255,255],pq=1,hq=[0,0,1],dq=[0,0,1],vq=0,rd=function(){function t(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};A(this,t),c(this,"id",void 0),c(this,"color",void 0),c(this,"intensity",void 0),c(this,"type","point"),c(this,"position",void 0),c(this,"attenuation",void 0),c(this,"projectedLight",void 0);var e=r.color,n=e===void 0?cq:e,i=r.intensity,a=i===void 0?pq:i,o=r.position,s=o===void 0?dq:o;this.id=r.id||"point-".concat(vq++),this.color=n,this.intensity=a,this.type="point",this.position=s,this.attenuation=mq(r),this.projectedLight=fq({},this)}return T(t,[{key:"getProjectedLight",value:function(e){var n=e.layer,i=this.projectedLight,a=n.context.viewport,o=n.props,s=o.coordinateSystem,u=o.coordinateOrigin,l=td(this.position,{viewport:a,coordinateSystem:s,coordinateOrigin:u,fromCoordinateSystem:a.isGeospatial?de.LNGLAT:de.CARTESIAN,fromCoordinateOrigin:[0,0,0]});return i.color=this.color,i.intensity=this.intensity,i.position=l,i}}]),t}();function mq(t){return t.attenuation?t.attenuation:"intensity"in t?[0,0,t.intensity||0]:hq}F();j();function gq(t){var r=yq();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function yq(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var kM=function(t){L(e,t);var r=gq(e);function e(){return A(this,e),r.apply(this,arguments)}return T(e,[{key:"getProjectedLight",value:function(i){var a=i.layer,o=this.projectedLight,s=a.context.viewport,u=a.props,l=u.coordinateSystem,f=u.coordinateOrigin,p=u.modelMatrix,h=Wh({viewport:s,modelMatrix:p,coordinateSystem:l,coordinateOrigin:f}),d=h.project_uCameraPosition;return o.color=this.color,o.intensity=this.intensity,o.position=d,o}}]),e}(rd);be();F();j();k();var Io=Math.PI/180,_q=1e3*60*60*24,bq=2440588,xq=2451545,nd=Io*23.4397,Aq=357.5291,Sq=.98560028,Tq=280.147,wq=360.9856235;function BM(t,r,e){var n=Io*-e,i=Io*r,a=Oq(t),o=Bq(a),s=Rq(a,n)-o.rightAscension;return{azimuth:Mq(s,i,o.declination),altitude:Iq(s,i,o.declination)}}function id(t,r,e){var n=BM(t,r,e),i=n.azimuth,a=n.altitude;return[Math.sin(i)*Math.cos(a),Math.cos(i)*Math.cos(a),-Math.sin(a)]}function Pq(t){var r=typeof t=="number"?t:t.getTime();return r/_q-.5+bq}function Oq(t){return Pq(t)-xq}function Eq(t,r){var e=t;return Math.atan2(Math.sin(e)*Math.cos(nd)-Math.tan(r)*Math.sin(nd),Math.cos(e))}function Cq(t,r){var e=t;return Math.asin(Math.sin(r)*Math.cos(nd)+Math.cos(r)*Math.sin(nd)*Math.sin(e))}function Mq(t,r,e){var n=t,i=r,a=e;return Math.atan2(Math.sin(n),Math.cos(n)*Math.sin(i)-Math.tan(a)*Math.cos(i))}function Iq(t,r,e){var n=t,i=r,a=e;return Math.asin(Math.sin(i)*Math.sin(a)+Math.cos(i)*Math.cos(a)*Math.cos(n))}function Rq(t,r){return Io*(Tq+wq*t)-r}function Lq(t){return Io*(Aq+Sq*t)}function kq(t){var r=t,e=Io*(1.9148*Math.sin(r)+.02*Math.sin(2*r)+3e-4*Math.sin(3*r)),n=Io*102.9372;return r+e+n+Math.PI}function Bq(t){var r=Lq(t),e=kq(r);return{declination:Cq(e,0),rightAscension:Eq(e,0)}}function Fq(t){var r=Dq();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function Dq(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var FM=function(t){L(e,t);var r=Fq(e);function e(n){var i;return A(this,e),i=r.call(this,n),c(q(i),"timestamp",void 0),i.timestamp=n.timestamp,i}return T(e,[{key:"getProjectedLight",value:function(i){var a=i.layer,o=a.context.viewport,s=o.resolution&&o.resolution>0;if(s){var u=id(this.timestamp,0,0),l=W(u,3),f=l[0],p=l[1],h=l[2];this.direction=[f,-h,p]}else{var d=o.latitude,v=o.longitude;this.direction=id(this.timestamp,d,v)}return this}}]),e}(So);F();j();k();F();j();k();function Nq(t){var r=jq();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function jq(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var K_=function(t){L(e,t);var r=Nq(e);function e(n,i){var a;A(this,e),a=r.call(this,n,i),c(q(a),"model",void 0);var o=i.module,s=i.fs,u=i.id;return a.model=new zh(n,{id:u,fs:s,modules:[o]}),a}return T(e,[{key:"render",value:function(i){var a=this,o=this.gl;It(o,{viewport:[0,0,o.drawingBufferWidth,o.drawingBufferHeight]}),ke(o,{framebuffer:i.outputBuffer,clearColor:[0,0,0,0]},function(){return a._renderPass(o,i)})}},{key:"delete",value:function(){this.model.delete(),this.model=null}},{key:"_renderPass",value:function(i,a){var o=a.inputBuffer;qr(i,{color:!0}),this.model.draw({moduleSettings:a.moduleSettings,uniforms:{texture:o,texSize:[o.width,o.height]},parameters:{depthWrite:!1,depthTest:!1}})}}]),e}(Hh);function Uq(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=Gq(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}
2037}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2038In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function Gq(t,r){if(t){if(typeof t=="string")return DM(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return DM(t,r)}}function DM(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var jM=function(){function t(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};A(this,t),c(this,"id",void 0),c(this,"props",void 0),c(this,"module",void 0),c(this,"passes",void 0),this.id="".concat(r.name,"-pass"),this.props=e,eh(r),this.module=r}return T(t,[{key:"setProps",value:function(e){this.props=e}},{key:"preRender",value:function(){}},{key:"postRender",value:function(e,n){var i=this.passes||zq(e,this.module,this.id);this.passes=i;for(var a=n.target,o=n.inputBuffer,s=n.swapBuffer,u=0;u<this.passes.length;u++){a&&u===this.passes.length-1&&(s=a),this.passes[u].render({inputBuffer:o,outputBuffer:s,moduleSettings:this.props});var l=s;s=o,o=l}return o}},{key:"cleanup",value:function(){if(this.passes){var e=Uq(this.passes),n;try{for(e.s();!(n=e.n()).done;){var i=n.value;i.delete()}}catch(a){e.e(a)}finally{e.f()}this.passes=void 0}}}]),t}();function zq(t,r,e){if(!r.passes){var n=NM(r),i=new K_(t,{id:e,module:r,fs:n});return[i]}return r.passes.map(function(a,o){var s=NM(r,a),u="".concat(e,"-").concat(o);return new K_(t,{id:u,module:r,fs:s})})}var Vq=function(r){return`uniform sampler2D texture;
2039uniform vec2 texSize;
2040
2041varying vec2 position;
2042varying vec2 coordinate;
2043varying vec2 uv;
2044
2045void main() {
2046  vec2 texCoord = coordinate;
2047
2048  gl_FragColor = texture2D(texture, texCoord);
2049  gl_FragColor = `.concat(r,`(gl_FragColor, texSize, texCoord);
2050}
2051`)},Hq=function(r){return`uniform sampler2D texture;
2052uniform vec2 texSize;
2053
2054varying vec2 position;
2055varying vec2 coordinate;
2056varying vec2 uv;
2057
2058void main() {
2059  vec2 texCoord = coordinate;
2060
2061  gl_FragColor = `.concat(r,`(texture, texSize, texCoord);
2062}
2063`)};function NM(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t;if(r.filter){var e=typeof r.filter=="string"?r.filter:"".concat(t.name,"_filterColor");return Vq(e)}if(r.sampler){var n=typeof r.sampler=="string"?r.sampler:"".concat(t.name,"_sampleColor");return Hq(n)}return null}F();j();k();function UM(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function Z_(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?UM(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):UM(Object(e)).forEac
2063h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function Wq(t){var r=$q();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function $q(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var GM={blendFunc:[1,0,32771,0],blendEquation:32774},_a=function(t){L(e,t);var r=Wq(e);function e(){var n;A(this,e);for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return n=r.call.apply(r,[this].concat(a)),c(q(n),"pickZ",void 0),c(q(n),"_colorEncoderState",null),n}return T(e,[{key:"render",value:function(i){return"pickingFBO"in i?this._drawPickingBuffer(i):Z(S(e.prototype),"render",this).call(this,i)}},{key:"_drawPickingBuffer",value:function(i){var a=this,o=i.layers,s=i.layerFilter,u=i.views,l=i.viewports,f=i.onViewportActive,p=i.pickingFBO,h=i.deviceRect,d=h.x,v=h.y,m=h.width,g=h.height,y=i.cullRect,_=i.effects,b=i.pass,x=b===void 0?"picking":b,w=i.pickZ,P=i.moduleParameters,E=this.gl;this.pickZ=w;var C=this._resetColorEncoder(w),I=ke(E,Z_(Z_({scissorTest:!0,scissor:[d,v,m,g],clearColor:[0,0,0,0],depthMask:!0,depthTest:!0,depthRange:[0,1],colorMask:[!0,!0,!0,!0]},GM),{},{blend:!w}),function(){return Z(S(e.prototype),"render",a).call(a,{target:p,layers:o,layerFilter:s,views:u,viewports:l,onViewportActive:f,cullRect:y,effects:_?.filter(function(D){return D.useInPicking}),pass:x,isPicking:!0,moduleParameters:P})});this._colorEncoderState=null;var O=C&&qq.bind(null,C);return{decodePickingColor:O,stats:I}}},{key:"shouldDrawLayer",value:function(i){var a=i.props,o=a.pickable,s=a.operation;return o&&s.includes("draw")||s.includes("terrain")||s.includes("mask")}},{key:"getModuleParameters",value:function(){return{pickingActive:1,pickingAttribute:this.pickZ,lightSources:{}}}},{key:"getLayerParameters",value:function(i,a,o){var s=Z_({},i.props.parameters),u=i.props,l=u.pickable,f=u.operation;return this._colorEncoderState?l&&f.includes("draw")&&(Object.assign(s,GM),s.blend=!0,s.blendColor=Xq(this._colorEncoderState,i,o)):s.blend=!1,f.includes("terrain")&&(s.blend=!1),s}},{key:"_resetColorEncoder",value:function(i){return this._colorEncoderState=i?null:{byLayer:new Map,byAlpha:[]},this._colorEncoderState}}]),e}(br);function Xq(t,r,e){var n=t.byLayer,i=t.byAlpha,a,o=n.get(r);return o?(o.viewports.push(e),a=o.a):(a=n.size+1,a<=255?(o={a,layer:r,viewports:[e]},n.set(r,o),i[a]=o):(ne.warn("Too many pickable layers, only picking the first 255")(),a=0)),[0,0,0,a/255]}function qq(t,r){var e=t.byAlpha[r[3]];return e&&{pickedLayer:e.layer,pickedViewports:e.viewports,pickedObjectIndex:e.layer.decodePickingColor(r)}}F();j();k();F();j();k();var ba={NO_STATE:"Awaiting state",MATCHED:"Matched. State transferred from previous layer",INITIALIZED:"Initialized",AWAITING_GC:"Discarded. Awaiting garbage collection",AWAITING_FINALIZATION:"No longer matched. Awaiting garbage collection",FINALIZED:"Finalized! Awaiting garbage collection"},lu=Symbol.for("component"),Jr=Symbol.for("propTypes"),ad=Symbol.for("deprecatedProps"),Ti=Symbol.for("asyncPropDefaults"),Wn=Symbol.for("asyncPropOriginal"),Sn=Symbol.for("asyncPropResolved");function gr(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(){return!0};return Array.isArray(t)?zM(t,r,[]):r(t)?[t]:[]}function zM(t,r,e){for(var n=-1;++n<t.length;){var i=t[n];Array.isArray(i)?zM(i,r,e):r(i)&&e.push(i)}return e}function od(t){for(var r=t.target,e=t.source,n=t.start,i=n===void 0?0:n,a=t.count,o=a===void 0?1:a,s=e.length,u=o*s,l=0,f=i;l<s;l++)r[f++]=e[l];for(;l<u;)l<u-l?(r.copyWithin(i+l,i,i+l),l*=2):(r.copyWithin(i+l,i,i+u-l),l=u);return r}F();j();k();F();j();k();function Yq(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=Kq(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}
2063}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2064In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function Kq(t,r){if(t){if(typeof t=="string")return VM(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return VM(t,r)}}function VM(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var HM=function(){function t(r,e,n){A(this,t),c(this,"id",void 0),c(this,"context",void 0),c(this,"isLoaded",void 0),c(this,"persistent",void 0),c(this,"_loadCount",0),c(this,"_subscribers",new Set),c(this,"_data",void 0),c(this,"_loader",void 0),c(this,"_error",void 0),c(this,"_content",void 0),this.id=r,this.context=n,this.setData(e)}return T(t,[{key:"subscribe",value:function(e){this._subscribers.add(e)}},{key:"unsubscribe",value:function(e){this._subscribers.delete(e)}},{key:"inUse",value:function(){return this._subscribers.size>0}},{key:"delete",value:function(){}},{key:"getData",value:function(){var e=this;return this.isLoaded?this._error?Promise.reject(this._error):this._content:this._loader.then(function(){return e.getData()})}},{key:"setData",value:function(e,n){var i=this;if(!(e===this._data&&!n)){this._data=e;var a=++this._loadCount,o=e;typeof e=="string"&&(o=Bt(e)),o instanceof Promise?(this.isLoaded=!1,this._loader=o.then(function(f){i._loadCount===a&&(i.isLoaded=!0,i._error=void 0,i._content=f)}).catch(function(f){i._loadCount===a&&(i.isLoaded=!0,i._error=f||!0)})):(this.isLoaded=!0,this._error=void 0,this._content=e);var s=Yq(this._subscribers),u;try{for(s.s();!(u=s.n()).done;){var l=u.value;l.onChange(this.getData())}}catch(f){s.e(f)}finally{s.f()}}}}]),t}();var WM=function(){function t(r){var e=r.gl,n=r.protocol;A(this,t),c(this,"protocol",void 0),c(this,"_context",void 0),c(this,"_resources",void 0),c(this,"_consumers",void 0),c(this,"_pruneRequest",void 0),this.protocol=n||"resource://",this._context={gl:e,resourceManager:this},this._resources={},this._consumers={},this._pruneRequest=null}return T(t,[{key:"contains",value:function(e){return e.startsWith(this.protocol)?!0:e in this._resources}},{key:"add",value:function(e){var n=e.resourceId,i=e.data,a=e.forceUpdate,o=a===void 0?!1:a,s=e.persistent,u=s===void 0?!0:s,l=this._resources[n];l?l.setData(i,o):(l=new HM(n,i,this._context),this._resources[n]=l),l.persistent=u}},{key:"remove",value:function(e){var n=this._resources[e];n&&(n.delete(),delete this._resources[e])}},{key:"unsubscribe",value:function(e){var n=e.consumerId,i=this._consumers[n];if(i){for(var a in i){var o=i[a],s=this._resources[o.resourceId];s&&s.unsubscribe(o)}delete this._consumers[n],this.prune()}}},{key:"subscribe",value:function(e){var n=e.resourceId,i=e.onChange,a=e.consumerId,o=e.requestId,s=o===void 0?"default":o,u=this._resources,l=this.protocol;n.startsWith(l)&&(n=n.replace(l,""),u[n]||this.add({resourceId:n,data:null,persistent:!1}));var f=u[n];if(this._track(a,s,f,i),f)return f.getData()}},{key:"prune",value:function(){var e=this;this._pruneRequest||(this._pruneRequest=setTimeout(function(){return e._prune()},0))}},{key:"finalize",value:function(){for(var e in this._resources)this._resources[e].delete()}},{key:"_track",value:function(e,n,i,a){var o=this._consumers,s=o[e]=o[e]||{},u=s[n]||{},l=u.resourceId&&this._resources[u.resourceId];l&&(l.unsubscribe(u),this.prune()),i&&(s[n]=u,u.onChange=a,u.resourceId=i.id,i.subscribe(u))}},{key:"_prune",value:function(){this._pruneRequest=null;for(var e=0,n=Object.keys(this._resources);e<n.length;e++){var i=n[e],a=this._resources[i];!a.persistent&&!a.inUse()&&(a.delete(),delete this._resources[i])}}}]),t}();var Zq=`
2065vec4 project_position_to_clipspace(
2066  vec3 position, vec3 position64Low, vec3 offset, out vec4 commonPosition
2067) {
2068  vec3 projectedPosition = project_position(position, position64Low);
2069  mat3 rotation;
2070  if (project_needs_rotation(projectedPosition, rotation)) {
2071    // offset is specified as ENU
2072    // when in globe projection, rotate offset so that the ground alighs with the surface of the globe
2073    offset = rotation * offset;
2074  }
2075  commonPosition = vec4(projectedPosition + offset, 1.0);
2076  return project_common_position_to_clipspace(commonPosition);
2077}
2078
2079vec4 project_position_to_clipspace(
2080  vec3 position, vec3 position64Low, vec3 offset
2081) {
2082  vec4 commonPosition;
2083  return project_position_to_clipspace(position, position64Low, offset, commonPosition);
2084}
2085`,qe={name:"project32",dependencies:[Ft],vs:Zq};k();function $M(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function Jq(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?$M(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):$M(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var rt=Jq({inject:{"vs:DECKGL_FILTER_GL_POSITION":`
2086    // for picking depth values
2087    picking_setPickingAttribute(position.z / position.w);
2088  `,"vs:DECKGL_FILTER_COLOR":`
2089  picking_setPickingColor(geometry.pickingColor);
2090  `,"fs:#decl":`
2091uniform bool picking_uAttribute;
2092  `,"fs:DECKGL_FILTER_COLOR":{order:99,injection:`
2093  // use highlight color if this fragment belongs to the selected object.
2094  color = picking_filterHighlightColor(color);
2095
2096  // use picking color if rendering to picking FBO.
2097  color = picking_filterPickingColor(color);
2098    `}}},Mh);function XM(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=Qq(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2099In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function Qq(t,r){if(t){if(typeof t=="string")return qM(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return qM(t,r)}}function qM(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var eY=[Ft],tY=["vs:DECKGL_FILTER_SIZE(inout vec3 size, VertexGeometry geometry)","vs:DECKGL_FILTER_GL_POSITION(inout vec4 position, VertexGeometry geometry)","vs:DECKGL_FILTER_COLOR(inout vec4 color, VertexGeometry geometry)","fs:DECKGL_FILTER_COLOR(inout vec4 color, FragmentGeometry geometry)"];function YM(t){var r=Yr.getDefaultProgramManager(t),e=XM(eY),n;try{for(e.s();!(n=e.n()).done;){var i=n.value;r.addDefaultModule(i)}}catch(u){e.e(u)}finally{e.f()}var a=XM(tY),o;try{for(a.s();!(o=a.n()).done;){var s=o.value;r.addShaderHook(s)}}catch(u){a.e(u)}finally{a.f()}return r}function zf(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=rY(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2100In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function rY(t,r){if(t){if(typeof t=="string")return KM(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return KM(t,r)}}function KM(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var nY="layerManager.setLayers",iY="layerManager.activateViewport",sd=function(){function t(r){var e=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.deck,a=n.stats,o=n.viewport,s=n.timeline;A(this,t),c(this,"layers",void 0),c(this,"context",void 0),c(this,"resourceManager",void 0),c(this,"_lastRenderedLayers",[]),c(this,"_needsRedraw",!1),c(this,"_needsUpdate",!1),c(this,"_nextLayers",null),c(this,"_debug",!1),c(this,"activateViewport",function(u){wt(iY,e,u),u&&(e.context.viewport=u)}),this.layers=[],this.resourceManager=new WM({gl:r,protocol:"deck://"}),this.context={mousePosition:null,userData:{},layerManager:this,gl:r,deck:i,programManager:r&&YM(r),stats:a||new po({id:"deck.gl"}),viewport:o||new tr({id:"DEFAULT-INITIAL-VIEWPORT"}),timeline:s||new ma,resourceManager:this.resourceManager,onError:void 0},Object.seal(this)}return T(t,[{key:"finalize",value:function(){this.resourceManager.finalize();var e=zf(this.layers),n;try{for(e.s();!(n=e.n()).done;){var i=n.value;this._finalizeLayer(i)}}catch(a){e.e(a)}finally{e.f()}}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{clearRedrawFlags:!1},n=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);var i=zf(this.layers),a;try{for(i.s();!(a=i.n()).done;){var o=a.value,s=o.getNeedsRedraw(e);n=n||s}}catch(u){i.e(u)}finally{i.f()}return n}},{key:"needsUpdate",value:function(){return this._nextLayers&&this._nextLayers!==this._lastRenderedLayers?"layers changed":this._needsUpdate}},{key:"setNeedsRedraw",value:function(e){this._needsRedraw=this._needsRedraw||e}},{key:"setNeedsUpdate",value:function(e){this._needsUpdate=this._needsUpdate||e}},{key:"getLayers",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.layerIds;return n?this.layers.filter(function(i){return n.find(function(a){return i.id.indexOf(a)===0})}):this.layers}},{key:"setProps",value:function(e){"debug"in e&&(this._debug=e.debug),"userData"in e&&(this.context.userData=e.userData),"layers"in e&&(this._nextLayers=e.layers
2100),"onError"in e&&(this.context.onError=e.onError)}},{key:"setLayers",value:function(e,n){wt(nY,this,n,e),this._lastRenderedLayers=e;var i=gr(e,Boolean),a=zf(i),o;try{for(a.s();!(o=a.n()).done;){var s=o.value;s.context=this.context}}catch(u){a.e(u)}finally{a.f()}this._updateLayers(this.layers,i)}},{key:"updateLayers",value:function(){var e=this.needsUpdate();e&&(this.setNeedsRedraw("updating layers: ".concat(e)),this.setLayers(this._nextLayers||this._lastRenderedLayers,e)),this._nextLayers=null}},{key:"_handleError",value:function(e,n,i){i.raiseError(n,"".concat(e," of ").concat(i))}},{key:"_updateLayers",value:function(e,n){var i={},a=zf(e),o;try{for(a.s();!(o=a.n()).done;){var s=o.value;i[s.id]?ne.warn("Multiple old layers with same id ".concat(s.id))():i[s.id]=s}}catch(d){a.e(d)}finally{a.f()}var u=[];this._updateSublayersRecursively(n,i,u),this._finalizeOldLayers(i);for(var l=!1,f=0,p=u;f<p.length;f++){var h=p[f];if(h.hasUniformTransition()){l="Uniform transition in ".concat(h);break}}this._needsUpdate=l,this.layers=u}},{key:"_updateSublayersRecursively",value:function(e,n,i){var a=zf(e),o;try{for(a.s();!(o=a.n()).done;){var s=o.value;s.context=this.context;var u=n[s.id];u===null&&ne.warn("Multiple new layers with same id ".concat(s.id))(),n[s.id]=null;var l=null;try{this._debug&&u!==s&&s.validateProps(),u?(this._transferLayerState(u,s),this._updateLayer(s)):this._initializeLayer(s),i.push(s),l=s.isComposite?s.getSubLayers():null}catch(f){this._handleError("matching",f,s)}l&&this._updateSublayersRecursively(l,n,i)}}catch(f){a.e(f)}finally{a.f()}}},{key:"_finalizeOldLayers",value:function(e){for(var n in e){var i=e[n];i&&this._finalizeLayer(i)}}},{key:"_initializeLayer",value:function(e){try{e._initialize(),e.lifecycle=ba.INITIALIZED}catch(n){this._handleError("initialization",n,e)}}}
2100,{key:"_transferLayerState",value:function(e,n){n._transferState(e),n.lifecycle=ba.MATCHED,n!==e&&(e.lifecycle=ba.AWAITING_GC)}},{key:"_updateLayer",value:function(e){try{e._update()}catch(n){this._handleError("update",n,e)}}},{key:"_finalizeLayer",value:function(e){this._needsRedraw=this._needsRedraw||"finalized ".concat(e),e.lifecycle=ba.AWAITING_FINALIZATION;try{e._finalize(),e.lifecycle=ba.FINALIZED}catch(n){this._handleError("finalization",n,e)}}}]),t}();F();j();k();Ge();function xt(t,r,e){if(t===r)return!0;if(!e||!t||!r)return!1;if(Array.isArray(t)){if(!Array.isArray(r)||t.length!==r.length)return!1;for(var n=0;n<t.length;n++)if(!xt(t[n],r[n],e-1))return!1;return!0}if(Array.isArray(r))return!1;if(ue(t)==="object"&&ue(r)==="object"){var i=Object.keys(t),a=Object.keys(r);if(i.length!==a.length)return!1;for(var o=0,s=i;o<s.length;o++){var u=s[o];if(!r.hasOwnProperty(u)||!xt(t[u],r[u],e-1))return!1}return!0}return!1}function ZM(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function Vf(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?ZM(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):ZM(Object(e)).forEac
2100h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var JM=function(){function t(r){A(this,t),c(this,"width",void 0),c(this,"height",void 0),c(this,"views",void 0),c(this,"viewState",void 0),c(this,"controllers",void 0),c(this,"timeline",void 0),c(this,"_viewports",void 0),c(this,"_viewportMap",void 0),c(this,"_isUpdating",void 0),c(this,"_needsRedraw",void 0),c(this,"_needsUpdate",void 0),c(this,"_eventManager",void 0),c(this,"_eventCallbacks",void 0),this.views=[],this.width=100,this.height=100,this.viewState={},this.controllers={},this.timeline=r.timeline,this._viewports=[],this._viewportMap={},this._isUpdating=!1,this._needsRedraw="First render",this._needsUpdate="Initialize",this._eventManager=r.eventManager,this._eventCallbacks={onViewStateChange:r.onViewStateChange,onInteractionStateChange:r.onInteractionStateChange},Object.seal(this),this.setProps(r)}return T(t,[{key:"finalize",value:function(){for(var e in this.controllers){var n=this.controllers[e];n&&n.finalize()}this.controllers={}}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{clearRedrawFlags:!1},n=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),n}},{key:"setNeedsUpdate",value:function(e){this._needsUpdate=this._needsUpdate||e,this._needsRedraw=this._needsRedraw||e}},{key:"updateViewStates",value:function(){for(var e in this.controllers){var n=this.controllers[e];n&&n.updateTransition()}}},{key:"getViewports",value:function(e){return e?this._viewports.filter(function(n){return n.containsPixel(e)}):this._viewports}},{key:"getViews",value:function(){var e={};return this.views.forEach(function(n){e[n.id]=n}),e}},{key:"getView",value:function(e){return this.views.find(function(n){return n.id===e})}},{key:"getViewState",value:function(e){var n=typeof e=="string"?this.getView(e):e,i=n&&this.viewState[n.getViewStateId()]||this.viewState;return n?n.filterViewState(i):i}},{key:"getViewport",value:function(e){return this._viewportMap[e]}},{key:"unproject",value:function(e,n){for(var i=this.getViewports(),a={x:e[0],y:e[1]},o=i.length-1;o>=0;--o){var s=i[o];if(s.containsPixel(a)){var u=e.slice();return u[0]-=s.x,u[1]-=s.y,s.unproject(u,n)}}return null}},{key:"setProps",value:function(e){e.views&&this._setViews(e.views),e.viewState&&this._setViewState(e.viewState),("width"in e||"height"in e)&&this._setSize(e.width,e.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(e,n){(e!==this.width||n!==this.height)&&(this.width=e,this.height=n,this.setNeedsUpdate("Size changed"))}},{key:"_setViews",value:function(e){e=gr(e,Boolean);var n=this._diffViews(e,this.views);n&&this.setNeedsUpdate("views changed"),this.views=e}},{key:"_setViewState",value:function(e){if(e){var n=!xt(e,this.viewState,3);n&&this.setNeedsUpdate("viewState changed"),this.viewState=e}else ne.warn("missing `viewState` or `initialViewState`")()}},{key:"_onViewStateChange",value:function(e,n){this._eventCallbacks.onViewStateChange&&this._eventCallbacks.onViewStateChange(Vf(Vf({},n),{},{viewId:e}))}},{key:"_createController",value:function(e,n){var i=this,a=n.type,o=new a({timeline:this.timeline,eventManager:this._eventManager,onViewStateChange:this._onViewStateChange.bind(this,n.id),onStateChange:this._eventCallbacks.onInteractionStateChange,makeViewport:function(u){var l;return(l=i.getView(e.id))===null||l===void 0?void 0:l.makeViewport({viewState:u,width:i.width,height:i.height})}});return o}},{key:"_updateController",value:function(e,n,i,a){var o=e.controller;if(o&&i){var s=Vf(Vf(Vf({},n),o),{},{id:e.id,x:i.x,y:i.y,width:i.width,height:i.height});return(!a||a.constructor!==o.type)&&(a=this._createController(e,s)),a&&a.setProps(s),a}return null}},{key:"_rebuildViewports",value:function(){var e=this.views,n=this.controllers;this._viewports=[],this.controllers={};for(var i=!1,a=e.length;a--;){var o=e[a],s=this.getViewState(o),u=o.makeViewport({viewState:s,width:this.width,height:this.height}),l=n[o.id],f=Boolean(o.controller);f&&!l&&(i=!0),(i||!f)&&l&&(l.finalize(),l=null),this.controllers[o.id]=this._updateController(o,s,u,l),u&&this._viewports.unshift(u)}for(var p in n){var h=n[p];h&&!this.controllers[p]&&h.finalize()}this._buildViewportMap()}},{key:"_buildViewportMap",value:function(){var e=this;this._viewportMap={}
2100,this._viewports.forEach(function(n){n.id&&(e._viewportMap[n.id]=e._viewportMap[n.id]||n)})}},{key:"_diffViews",value:function(e,n){return e.length!==n.length?!0:e.some(function(i,a){return!e[a].equals(n[a])})}}]),t}();F();j();k();Ge();F();j();k();Ge();var aY=/([0-9]+\.?[0-9]*)(%|px)/;function wi(t){switch(ue(t)){case"number":return{position:t,relative:!1};case"string":var r=aY.exec(t);if(r&&r.length>=3){var e=r[2]==="%",n=parseFloat(r[1]);return{position:e?n/100:n,relative:e}}default:throw new Error("Could not parse position string ".concat(t))}}function Pi(t,r){return t.relative?Math.round(t.position*r):t.position}function Je(t,r){if(!t)throw new Error(r||"deck.gl: assertion failed.")}function QM(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function Ro(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?QM(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):QM(Object(e)).forEac
2100h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var Qr=function(){function t(r){A(this,t),c(this,"id",void 0),c(this,"viewportInstance",void 0),c(this,"_x",void 0),c(this,"_y",void 0),c(this,"_width",void 0),c(this,"_height",void 0),c(this,"_padding",void 0),c(this,"props",void 0);var e=r||{},n=e.id,i=e.x,a=i===void 0?0:i,o=e.y,s=o===void 0?0:o,u=e.width,l=u===void 0?"100%":u,f=e.height,p=f===void 0?"100%":f,h=e.padding,d=h===void 0?null:h,v=e.viewportInstance;Je(!v||v instanceof tr),this.viewportInstance=v,this.id=n||this.constructor.displayName||"view",this.props=Ro(Ro({},r),{},{id:this.id}),this._x=wi(a),this._y=wi(s),this._width=wi(l),this._height=wi(p),this._padding=d&&{left:wi(d.left||0),right:wi(d.right||0),top:wi(d.top||0),bottom:wi(d.bottom||0)},this.equals=this.equals.bind(this),Object.seal(this)}return T(t,[{key:"equals",value:function(e){return this===e?!0:this.viewportInstance?e.viewportInstance?this.viewportInstance.equals(e.viewportInstance):!1:this.ViewportType===e.ViewportType&&xt(this.props,e.props,2)}},{key:"makeViewport",value:function(e){var n=e.width,i=e.height,a=e.viewState;if(this.viewportInstance)return this.viewportInstance;a=this.filterViewState(a);var o=this.getDimensions({width:n,height:i});return!o.height||!o.width?null:new this.ViewportType(Ro(Ro(Ro({},a),this.props),o))}},{key:"getViewStateId",value:function(){var e=this.props.viewState;return typeof e=="string"?e:e?.id||this.id}},{key:"filterViewState",value:function(e){if(this.props.viewState&&ue(this.props.viewState)==="object"){if(!this.props.viewState.id)return this.props.viewState;var n=Ro({},e);for(var i in this.props.viewState)i!=="id"&&(n[i]=this.props.viewState[i]);return n}return e}},{key:"getDimensions",value:function(e){var n=e.width,i=e.height,a={x:Pi(this._x,n),y:Pi(this._y,i),width:Pi(this._width,n),height:Pi(this._height,i)};return this._padding&&(a.padding={left:Pi(this._padding.left,n),top:Pi(this._padding.top,i),right:Pi(this._padding.right,n),bottom:Pi(this._padding.bottom,i)}),a}},{key:"controller",get:function(){var e=this.props.controller;return e?e===!0?{type:this.ControllerType}:typeof e=="function"?{type:e}:Ro({type:this.ControllerType},e):null}}]),t}();F();j();k();F();j();k();F();j();k();F();j();k();var $n=function(){function t(r){A(this,t),c(this,"_inProgress",void 0),c(this,"_handle",void 0),c(this,"_timeline",void 0),c(this,"time",void 0),c(this,"settings",void 0),this._inProgress=!1,this._handle=null,this._timeline=r,this.time=0,this.settings={duration:0}}return T(t,[{key:"inProgress",get:function(){return this._inProgress}},{key:"start",value:function(e){var n,i;this.cancel(),this.settings=e,this._inProgress=!0,(n=(i=this.settings).onStart)===null||n===void 0||n.call(i,this)}},{key:"end",value:function(){if(this._inProgress){var e,n;this._timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1,(e=(n=this.settings).onEnd)===null||e===void 0||e.call(n,this)}}},{key:"cancel",value:function(){if(this._inProgress){var e,n;(e=(n=this.settings).onInterrupt)===null||e===void 0||e.call(n,this),this._timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1}}},{key:"update",value:function(){var e,n;if(!this._inProgress)return!1;if(this._handle===null){var i=this._timeline,a=this.settings;this._handle=i.addChannel({delay:i.getTime(),duration:a.duration})}return this.time=this._timeline.getTime(this._handle),this._onUpdate(),(e=(n=this.settings).onUpdate)===null||e===void 0||e.call(n,this),this._timeline.isFinished(this._handle)&&this.end(),!0}},{key:"_onUpdate",value:function(){}}]),t}();function e2(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function ud(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?e2(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):e2(Object(e)).forEac
2100h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var t2=function(){},Hf={BREAK:1,SNAP_TO_END:2,IGNORE:3},oY=function(r){return r},sY=Hf.BREAK,r2=function(){function t(r){var e=this;A(this,t),c(this,"getControllerState",void 0),c(this,"props",void 0),c(this,"propsInTransition",void 0),c(this,"transition",void 0),c(this,"onViewStateChange",void 0),c(this,"onStateChange",void 0),c(this,"_onTransitionUpdate",function(n){var i=n.time,a=n.settings,o=a.interpolator,s=a.startProps,u=a.endProps,l=a.duration,f=a.easing,p=f(i/l),h=o.interpolateProps(s,u,p);e.propsInTransition=e.getControllerState(ud(ud({},e.props),h)).getViewportProps(),e.onViewStateChange({viewState:e.propsInTransition,oldViewState:e.props})}),this.getControllerState=r.getControllerState,this.propsInTransition=null,this.transition=new $n(r.timeline),this.onViewStateChange=r.onViewStateChange||t2,this.onStateChange=r.onStateChange||t2}return T(t,[{key:"finalize",value:function(){this.transition.cancel()}},{key:"getViewportInTransition",value:function(){return this.propsInTransition}},{key:"processViewStateChange",value:function(e){var n=!1,i=this.props;if(this.props=e,!i||this._shouldIgnoreViewportChange(i,e))return!1;if(this._isTransitionEnabled(e)){var a=i;if(this.transition.inProgress){var o=this.transition.settings,s=o.interruption,u=o.endProps;a=ud(ud({},i),s===Hf.SNAP_TO_END?u:this.propsInTransition||i)}this._triggerTransition(a,e),n=!0}else this.transition.cancel();return n}},{key:"updateTransition",value:function(){this.transition.update()}},{key:"_isTransitionEnabled",value:function(e){var n=e.transitionDuration,i=e.transitionInterpolator;return(n>0||n==="auto")&&Boolean(i)}},{key:"_isUpdateDueToCurrentTransition",value:function(e){return this.transition.inProgress&&this.propsInTransition?this.transition.settings.interpolator.arePropsEqual(e,this.propsInTransition):!1}},{key:"_shouldIgnoreViewportChange",value:function(e,n){return this.transition.inProgress?this.transition.settings.interruption===Hf.IGNORE||this._isUpdateDueToCurrentTransition(n):this._isTransitionEnabled(n)?n.transitionInterpolator.arePropsEqual(e,n):!0}},{key:"_triggerTransition",value:function(e,n){var i=this.getControllerState(e),a=this.getControllerState(n).shortestPathFrom(i),o=n.transitionInterpolator,s=o.getDuration?o.getDuration(e,n):n.transitionDuration;if(s!==0){var u=o.initializeProps(e,a);this.propsInTransition={};var l={duration:s,easing:n.transitionEasing||oY,interpolator:o,interruption:n.transitionInterruption||sY,startProps:u.start,endProps:u.end,onStart:n.onTransitionStart,onUpdate:this._onTransitionUpdate,onInterrupt:this._onTransitionEnd(n.onTransitionInterrupt),onEnd:this._onTransitionEnd(n.onTransitionEnd)};this.transition.start(l),this.onStateChange({inTransition:!0}),this.updateTransition()}}},{key:"_onTransitionEnd",value:function(e){var n=this;return function(i){n.propsInTransition=null,n.onStateChange({inTransition:!1,isZooming:!1,isPanning:!1,isRotating:!1}),e?.(i)}}}]),t}();F();j();k();F();j();k();function n2(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=uY(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2101In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function uY(t,r){if(t){if(typeof t=="string")return i2(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return i2(t,r)}}function i2(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var fu=function(){function t(r){A(this,t),c(this,"_propsToCompare",void 0),c(this,"_propsToExtract",void 0),c(this,"_requiredProps",void 0);var e=r.compare,n=r.extract,i=r.required;this._propsToCompare=e,this._propsToExtract=n||e,this._requiredProps=i}return T(t,[{key:"arePropsEqual",value:function(e,n){var i=n2(this._propsToCompare),a;try{for(i.s();!(a=i.n()).done;){var o=a.value;if(!(o in e)||!(o in n)||!Ze(e[o],n[o]))return!1}}catch(s){i.e(s)}finally{i.f()}return!0}},{key:"initializeProps",value:function(e,n){var i={},a={},o=n2(this._propsToExtract),s;try{for(o.s();!(s=o.n()).done;){var u=s.value;(u in e||u in n)&&(i[u]=e[u],a[u]=n[u])}}catch(l){o.e(l)}finally{o.f()}return this._checkRequiredProps(i),this._checkRequiredProps(a),{start:i,end:a}}},{key:"getDuration",value:function(e,n){return n.transitionDuration}},{key:"_checkRequiredProps",value:function(e){this._requiredProps&&this._requiredProps.forEach(function(n){var i=e[n];Je(Number.isFinite(i)||Array.isArray(i),"".concat(n," is required for transition"))})}}]),t}();function a2(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function o2(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};
2101r%2?a2(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):a2(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function lY(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=fY(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2102In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function fY(t,r){if(t){if(typeof t=="string")return s2(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return s2(t,r)}}function s2(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function cY(t){var r=pY();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function pY(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var hY=["longitude","latitude","zoom","bearing","pitch"],dY=["longitude","latitude","zoom"],Tr=function(t){L(e,t);var r=cY(e);function e(){var n,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};A(this,e);var a=Array.isArray(i)?i:i.transitionProps,o=Array.isArray(i)?{}:i;return o.transitionProps=Array.isArray(a)?{compare:a,required:a}:a||{compare:hY,required:dY},n=r.call(this,o.transitionProps),c(q(n),"opts",void 0),n.opts=o,n}return T(e,[{key:"initializeProps",value:function(i,a){var o=Z(S(e.prototype),"initializeProps",this).call(this,i,a),s=this.opts,u=s.makeViewport,l=s.around;if(u&&l){var f=u(i),p=u(a),h=f.unproject(l);o.start.around=l,Object.assign(o.end,{around:p.project(h),aroundPosition:h,width:a.width,height:a.height})}return o}},{key:"interpolateProps",value:function(i,a,o){var s={},u=lY(this._propsToExtract),l;try{for(u.s();!(l=u.n()).done;){var f=l.value;s[f]=Gt(i[f]||0,a[f]||0,o)}}catch(h){u.e(h)}finally{u.f()}if(a.aroundPosition&&this.opts.makeViewport){var p=this.opts.makeViewport(o2(o2({},a),s));Object.assign(s,p.panByPosition(a.aroundPosition,Gt(i.around,a.around,o)))}return s}}]),e}(fu);function u2(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function At(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?u2(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):u2(Object(e)).forEac
2102h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var xa={transitionDuration:0},vY=300,ld=function(r){return 1-(1-r)*(1-r)},cu={WHEEL:["wheel"],PAN:["panstart","panmove","panend"],PINCH:["pinchstart","pinchmove","pinchend"],TRIPLE_PAN:["tripanstart","tripanmove","tripanend"],DOUBLE_TAP:["doubletap"],KEYBOARD:["keydown"]},Lo={},en=function(){function t(r){var e=this;A(this,t),c(this,"props",void 0),c(this,"state",{}),c(this,"transitionManager",void 0),c(this,"eventManager",void 0),c(this,"onViewStateChange",void 0),c(this,"onStateChange",void 0),c(this,"makeViewport",void 0),c(this,"_controllerState",void 0),c(this,"_events",{}),c(this,"_interactionState",{isDragging:!1}),c(this,"_customEvents",[]),c(this,"_eventStartBlocked",null),c(this,"_panMove",!1),c(this,"invertPan",!1),c(this,"dragMode","rotate"),c(this,"inertia",0),c(this,"scrollZoom",!0),c(this,"dragPan",!0),c(this,"dragRotate",!0),c(this,"doubleClickZoom",!0),c(this,"touchZoom",!0),c(this,"touchRotate",!1),c(this,"keyboard",!0),this.transitionManager=new r2(At(At({},r),{},{getControllerState:function(i){return new e.ControllerState(i)},onViewStateChange:this._onTransition.bind(this),onStateChange:this._setInteractionState.bind(this)})),this.handleEvent=this.handleEvent.bind(this),this.eventManager=r.eventManager,this.onViewStateChange=r.onViewStateChange||function(){},this.onStateChange=r.onStateChange||function(){},this.makeViewport=r.makeViewport}return T(t,[{key:"events",set:function(e){this.toggleEvents(this._customEvents,!1),this.toggleEvents(e,!0),this._customEvents=e,this.props&&this.setProps(this.props)}},{key:"finalize",value:function(){for(var e in this._events)if(this._events[e]){var n;(n=this.eventManager)===null||n===void 0||n.off(e,this.handleEvent)}this.transitionManager.finalize()}},{key:"handleEvent",value:function(e){this._controllerState=void 0;var n=this._eventStartBlocked;switch(e.type){case"panstart":return n?!1:this._onPanStart(e);case"panmove":return this._onPan(e);case"panend":return this._onPanEnd(e);case"pinchstart":return n?!1:this._onPinchStart(e);case"pinchmove":return this._onPinch(e);case"pinchend":return this._onPinchEnd(e);case"tripanstart":return n?!1:this._onTriplePanStart(e);case"tripanmove":return this._onTriplePan(e);case"tripanend":return this._onTriplePanEnd(e);case"doubletap":return this._onDoubleTap(e);case"wheel":return this._onWheel(e);case"keydown":return this._onKeyDown(e);default:return!1}}},{key:"controllerState",get:function(){return this._controllerState=this._controllerState||new this.ControllerState(At(At({makeViewport:this.makeViewport},this.props),this.state)),this._controllerState}},{key:"getCenter",value:function(e){var n=this.props,i=n.x,a=n.y,o=e.offsetCenter;return[o.x-i,o.y-a]}},{key:"isPointInBounds",value:function(e,n){var i=this.props,a=i.width,o=i.height;if(n&&n.handled)return!1;var s=e[0]>=0&&e[0]<=a&&e[1]>=0&&e[1]<=o;return s&&n&&n.stopPropagation(),s}},{key:"isFunctionKeyPressed",value:function(e){var n=e.srcEvent;return Boolean(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}},{key:"isDragging",value:function(){return this._interactionState.isDragging||!1}},{key:"blockEvents",value:function(e){var n=this,i=setTimeout(function(){n._eventStartBlocked===i&&(n._eventStartBlocked=null)},e);this._eventStartBlocked=i}},{key:"setProps",value:function(e){e.dragMode&&(this.dragMode=e.dragMode),this.props=e,"transitionInterpolator"in e||(e.transitionInterpolator=this._getTransitionProps().transitionInterpolator),this.transitionManager.processViewStateChange(e);var n=e.inertia;this.inertia=Number.isFinite(n)?n:n===!0?vY:0;var i=e.scrollZoom,a=i===void 0?!0:i,o=e.dragPan,s=o===void 0?!0:o,u=e.dragRotate,l=u===void 0?!0:u,f=e.doubleClickZoom,p=f===void 0?!0:f,h=e.touchZoom,d=h===void 0?!0:h,v=e.touchRotate,m=v===void 0?!1:v,g=e.keyboard,y=g===void 0?!0:g,_=Boolean(this.onViewStateChange);this.toggleEvents(cu.WHEEL,_&&a),this.toggleEvents(cu.PAN,_),this.toggleEvents(cu.PINCH,_&&(d||m)),this.toggleEvents(cu.TRIPLE_PAN,_&&m),this.toggleEvents(cu.DOUBLE_TAP,_&&p),this.toggleEvents(cu.KEYBOARD,_&&y),this.scrollZoom=a,this.dragPan=s,this.dragRotate=l,this.doubleClickZoom=p,this.touchZoom=d,this.touchRotate=m,this.keyboard=y}},{key:"updateTransition",value:function(){this.transitionManager.updateTransition()}},{key:"toggleEvents",value:function(e,n){var i=this;this.eventManager&&e.forEach(function(a){i._events[a]!==n&&(i._events[a]=n,n?i.eventManager.on(a,i.handleEvent):i.eventManager.off(a,i.handleEvent))})}},{key:"updateViewport",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=At(At({},e.getViewportProps()),n),o=this.controllerState!==e;if(this.state=e.getState(),this._setInteractionState(i),o){var s=this.controllerState&&this.controllerState.getViewportProps();this.onViewStateChange&&this.onViewStateChange({viewState:a,interactionState:this._interactionState,oldViewState:s})}}},{key:"_onTransition",value:function(e){this.onViewStateChange(At(At({},e),{},{interactionState:this._interactionState}))}},{key:"_setInteractionState",value:function(e){Object.assign(this._interactionState,e),this.onStateChange(this._interactionState)}},{key:"_onPanStart",value:function(e){var n=this.getCenter(e);if(!this.isPointInBounds(n,e))return!1;var i=this.isFunctionKeyPressed(e)||e.rightButton||!1;(this.invertPan||this.dragMode==="pan")&&(i=!i);var a=this.controllerState[i?"panStart":"rotateStart"]({pos:n});return this._panMove=i,this.updateViewport(a,xa,{isDragging:!0}),!0}},{key:"_onPan",value:function(e){return this.isDragging()?this._panMove?this._onPanMove(e):this._onPanRotate(e):!1}},{key:"_onPanEnd",value:function(e){return this.isDragging()?this._panMove?this._onPanMoveEnd(e):this._onPanRotateEnd(e):!1}},{key:"_onPanMove",value:function(e){if(!this.dragPan)return!1;var n=this.getCenter(e),i=this.controllerState.pan({pos:n});return this.updateViewport(i,xa,{isDragging:!0,isPanning:!0}),!0}},{key:"_onPanMoveEnd",value:function(e){var n=this.inertia;if(this.dragPan&&n&&e.velocity){var i=this.getCenter(e),a=[i[0]+e.velocityX*n/2,i[1]+e.velocityY*n/2],o=this.controllerState.pan({pos:a}).panEnd();this.updateViewport(o,At(At({},this._getTransitionProps()),{},{transitionDuration:n,transitionEasing:ld}
2102),{isDragging:!1,isPanning:!0})}else{var s=this.controllerState.panEnd();this.updateViewport(s,null,{isDragging:!1,isPanning:!1})}return!0}},{key:"_onPanRotate",value:function(e){if(!this.dragRotate)return!1;var n=this.getCenter(e),i=this.controllerState.rotate({pos:n});return this.updateViewport(i,xa,{isDragging:!0,isRotating:!0}),!0}},{key:"_onPanRotateEnd",value:function(e){var n=this.inertia;if(this.dragRotate&&n&&e.velocity){var i=this.getCenter(e),a=[i[0]+e.velocityX*n/2,i[1]+e.velocityY*n/2],o=this.controllerState.rotate({pos:a}).rotateEnd();this.updateViewport(o,At(At({},this._getTransitionProps()),{},{transitionDuration:n,transitionEasing:ld}),{isDragging:!1,isRotating:!0})}else{var s=this.controllerState.rotateEnd();this.updateViewport(s,null,{isDragging:!1,isRotating:!1})}return!0}},{key:"_onWheel",value:function(e){if(!this.scrollZoom)return!1;var n=this.getCenter(e);if(!this.isPointInBounds(n,e))return!1;e.srcEvent.preventDefault();var i=this.scrollZoom===!0?{}:this.scrollZoom,a=i.speed,o=a===void 0?.01:a,s=i.smooth,u=s===void 0?!1:s,l=e.delta,f=2/(1+Math.exp(-Math.abs(l*o)));l<0&&f!==0&&(f=1/f);var p=this.controllerState.zoom({pos:n,scale:f});return this.updateViewport(p,At(At({},this._getTransitionProps({around:n})),{},{transitionDuration:u?250:1}),{isZooming:!0,isPanning:!0}),!0}},{key:"_onTriplePanStart",value:function(e){var n=this.getCenter(e);if(!this.isPointInBounds(n,e))return!1;var i=this.controllerState.rotateStart({pos:n});return this.updateViewport(i,xa,{isDragging:!0}),!0}},{key:"_onTriplePan",value:function(e){if(!this.touchRotate||!this.isDragging())return!1;var n=this.getCenter(e);n[0]-=e.deltaX;var i=this.controllerState.rotate({pos:n});return this.updateViewport(i,xa,{isDragging:!0,isRotating:!0}),!0}},{key:"_onTriplePanEnd",value:function(e){if(!this.isDragging())return!1;var n=this.inertia;if(this.touchRotate&&n&&e.velocityY){var i=this.getCenter(e),a=[i[0],i[1]+=e.velocityY*n/2],o=this.controllerState.rotate({pos:a});this.updateViewport(o,At(At({},this._getTransitionProps()),{},{transitionDuration:n,transitionEasing:ld}),{isDragging:!1,isRotating:!0}),this.blockEvents(n)}else{var s=this.controllerState.rotateEnd();this.updateViewport(s,null,{isDragging:!1,isRotating:!1})}return!0}},{key:"_onPinchStart",value:function(e){var n=this.getCenter(e);if(!this.isPointInBounds(n,e))return!1;var i=this.controllerState.zoomStart({pos:n}).rotateStart({pos:n});return Lo._startPinchRotation=e.rotation,Lo._lastPinchEvent=e,this.updateViewport(i,xa,{isDragging:!0}),!0}},{key:"_onPinch",value:function(e){if(!this.touchZoom&&!this.touchRotate||!this.isDragging())return!1;var n=this.controllerState;if(this.touchZoom){var i=e.scale,a=this.getCenter(e);n=n.zoom({pos:a,scale:i})}if(this.touchRotate){var o=e.rotation;n=n.rotate({deltaAngleX:Lo._startPinchRotation-o})}return this.updateViewport(n,xa,{isDragging:!0,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:this.touchRotate}),Lo._lastPinchEvent=e,!0}},{key:"_onPinchEnd",value:function(e){if(!this.isDragging())return!1;var n=this.inertia,i=Lo._lastPinchEvent;if(this.touchZoom&&n&&i&&e.scale!==i.scale){var a=this.getCenter(e),o=this.controllerState.rotateEnd(),s=Math.log2(e.scale),u=(s-Math.log2(i.scale))/(e.deltaTime-i.deltaTime),l=Math.pow(2,s+u*n/2);o=o.zoom({pos:a,scale:l}).zoomEnd(),this.updateViewport(o,At(At({},this._getTransitionProps({around:a})),{},{transitionDuration:n,transitionEasing:ld}),{isDragging:!1,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:!1}),this.blockEvents(n)}else{var f=this.controllerState.zoomEnd().rotateEnd();this.updateViewport(f,null,{isDragging:!1,isPanning:!1,isZooming:!1,isRotating:!1})}return Lo._startPinchRotation=null,Lo._lastPinchEvent=null,!0}},{key:"_onDoubleTap",value:function(e){if(!this.doubleClickZoom)return!1;var n=this.getCenter(e);if(!this.isPointInBounds(n,e))return!1;var i=this.isFunctionKeyPressed(e),a=this.controllerState.zoom({pos:n,scale:i?.5:2});return this.updateViewport(a,this._getTransitionProps({around:n}),{isZooming:!0,isPanning:!0}),this.blockEvents(100),!0}},{key:"_onKeyDown",value:function(e){if(!this.keyboard)return!1;var n=this.isFunctionKeyPressed(e),i=this.keyboard===!0?{}:this.keyboard,a=i.zoomSpeed,o=i.moveSpeed,s=i.rotateSpeedX,u=i.rotateSpeedY,l=this.controllerState,f,p={};switch(e.srcEvent.code){case"Minus":f=n?l.zoomOut(a).zoomOut(a):l.zoomOut(a),p.isZooming=!0;break;case"Equal":f=n?l.zoomIn(a).zoomIn(a):l.zoomIn(a),p.isZooming=!0;break;case"ArrowLeft":n?(f=l.rotateLeft(s),p.isRotating=!0):(f=l.moveLeft(o),p.isPanning=!0);break;case"ArrowRight":n?(f=l.rotateRight(s),p.isRotating=!0):(f=l.moveRight(o),p.isPanning=!0);break;case"ArrowUp":n?(f=l.rotateUp(u),p.isRotating=!0):(f=l.moveUp(o),p.isPanning=!0);break;case"ArrowDown":n?(f=l.rotateDown(u),p.isRotating=!0):(f=l.moveDown(o),p.isPanning=!0);break;default:return!1}return this.updateViewport(f,this._getTransitionProps(),p),!0}},{key:"_getTransitionProps",value:function(e){var n=this.transition;return!n||!n.transitionInterpolator?xa:e?At(At({},n),{},{transitionInterpolator:new Tr(At(At(At({},e),n.transitionInterpolator.opts),{},{makeViewport:this.controllerState.makeViewport}))}):n}}]),t}();F();j();k();var pu=function(){function t(r,e){A(this,t),c(this,"_viewportProps",void 0),c(this,"_state",void 0),this._viewportProps=this.applyConstraints(r),this._state=e}return T(t,[{key:"getViewportProps",value:function(){return this._viewportProps}},{key:"getState",value:function(){return this._state}}]),t}();function l2(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function Oi(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};
2102r%2?l2(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):l2(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function c2(t){var r=mY();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function mY(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var f2=5,gY=1.2,J_=function(t){L(e,t);var r=c2(e);function e(n){var i;A(this,e);var a=n.width,o=n.height,s=n.latitude,u=n.longitude,l=n.zoom,f=n.bearing,p=f===void 0?0:f,h=n.pitch,d=h===void 0?0:h,v=n.altitude,m=v===void 0?1.5:v,g=n.position,y=g===void 0?[0,0,0]:g,_=n.maxZoom,b=_===void 0?20:_,x=n.minZoom,w=x===void 0?0:x,P=n.maxPitch,E=P===void 0?60:P,C=n.minPitch,I=C===void 0?0:C,O=n.startPanLngLat,D=n.startZoomLngLat,N=n.startRotatePos,H=n.startBearing,$=n.startPitch,ee=n.startZoom,V=n.normalize,U=V===void 0?!0:V;return Je(Number.isFinite(u)),Je(Number.isFinite(s)),Je(Number.isFinite(l)),i=r.call(this,{width:a,height:o,latitude:s,longitude:u,zoom:l,bearing:p,pitch:d,altitude:m,maxZoom:b,minZoom:w,maxPitch:E,minPitch:I,normalize:U,position:y},{startPanLngLat:O,startZoomLngLat:D,startRotatePos:N,startBearing:H,startPitch:$,startZoom:ee}),c(q(i),"makeViewport",void 0),i.makeViewport=n.makeViewport,i}return T(e,[{key:"panStart",value:function(i){var a=i.pos;return this._getUpdatedState({startPanLngLat:this._unproject(a)})}},{key:"pan",value:function(i){var a=i.pos,o=i.startPos,s=this.getState().startPanLngLat||this._unproject(o);if(!s)return this;var u=this.makeViewport(this.getViewportProps()),l=u.panByPosition(s,a);return this._getUpdatedState(l)}},{key:"panEnd",value:function(){return this._getUpdatedState({startPanLngLat:null})}},{key:"rotateStart",value:function(i){var a=i.pos;return this._getUpdatedState({startRotatePos:a,startBearing:this.getViewportProps().bearing,startPitch:this.getViewportProps().pitch})}},{key:"rotate",value:function(i){var a=i.pos,o=i.deltaAngleX,s=o===void 0?0:o,u=i.deltaAngleY,l=u===void 0?0:u,f=this.getState(),p=f.startRotatePos,h=f.startBearing,d=f.startPitch;if(!p||h===void 0||d===void 0)return this;var v;return a?v=this._getNewRotation(a,p,d,h):v={bearing:h+s,pitch:d+l},this._getUpdatedState(v)}},{key:"rotateEnd",value:function(){return this._getUpdatedState({startBearing:null,startPitch:null})}},{key:"zoomStart",value:function(i){var a=i.pos;return this._getUpdatedState({startZoomLngLat:this._unproject(a),startZoom:this.getViewportProps().zoom})}},{key:"zoom",value:function(i){var a=i.pos,o=i.startPos,s=i.scale,u=this.getState(),l=u.startZoom,f=u.startZoomLngLat;if(f||(l=this.getViewportProps().zoom,f=this._unproject(o)||this._unproject(a)),!f)return this;var p=this.getViewportProps(),h=p.maxZoom,d=p.minZoom,v=l+Math.log2(s);v=We(v,d,h);var m=this.makeViewport(Oi(Oi({},this.getViewportProps()),{},{zoom:v}));return this._getUpdatedState(Oi({zoom:v},m.panByPosition(f,a)))}},{key:"zoomEnd",value:function(){return this._getUpdatedState({startZoomLngLat:null,startZoom:null})}},{key:"zoomIn",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:2;return this._zoomFromCenter(i)}},{key:"zoomOut",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:2;return this._zoomFromCenter(1/i)}},{key:"moveLeft",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:100;return this._panFromCenter([i,0])}},{key:"moveRight",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:100;return this._panFromCenter([-i,0])}},{key:"moveUp",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:100;return this._panFromCenter([0,i])}},{key:"moveDown",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:100;return this._panFromCenter([0,-i])}},{key:"rotateLeft",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:15;
2102return this._getUpdatedState({bearing:this.getViewportProps().bearing-i})}},{key:"rotateRight",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:15;return this._getUpdatedState({bearing:this.getViewportProps().bearing+i})}},{key:"rotateUp",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10;return this._getUpdatedState({pitch:this.getViewportProps().pitch+i})}},{key:"rotateDown",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10;return this._getUpdatedState({pitch:this.getViewportProps().pitch-i})}},{key:"shortestPathFrom",value:function(i){var a=i.getViewportProps(),o=Oi({},this.getViewportProps()),s=o.bearing,u=o.longitude;return Math.abs(s-a.bearing)>180&&(o.bearing=s<0?s+360:s-360),Math.abs(u-a.longitude)>180&&(o.longitude=u<0?u+360:u-360),o}},{key:"applyConstraints",value:function(i){var a=i.maxZoom,o=i.minZoom,s=i.zoom;i.zoom=We(s,o,a);var u=i.maxPitch,l=i.minPitch,f=i.pitch;i.pitch=We(f,l,u);var p=i.normalize,h=p===void 0?!0:p;return h&&Object.assign(i,Yh(i)),i}},{key:"_zoomFromCenter",value:function(i){var a=this.getViewportProps(),o=a.width,s=a.height;return this.zoom({pos:[o/2,s/2],scale:i})}},{key:"_panFromCenter",value:function(i){var a=this.getViewportProps(),o=a.width,s=a.height;return this.pan({startPos:[o/2,s/2],pos:[o/2+i[0],s/2+i[1]]})}},{key:"_getUpdatedState",value:function(i){return new this.constructor(Oi(Oi(Oi({makeViewport:this.makeViewport},this.getViewportProps()),this.getState()),i))}},{key:"_unproject",value:function(i){var a=this.makeViewport(this.getViewportProps());return i&&a.unproject(i)}},{key:"_getNewRotation",value:function(i,a,o,s){var u=i[0]-a[0],l=i[1]-a[1],f=i[1],p=a[1],h=this.getViewportProps(),d=h.width,v=h.height,m=u/d,g=0;l>0?Math.abs(v-p)>f2&&(g=l/(p-v)*gY):l<0&&p>f2&&(g=1-f/p),g=We(g,-1,1);var y=this.getViewportProps(),_=y.minPitch,b=y.maxPitch,x=s+180*m,w=o;return g>0?w=o+g*(b-o):g<0&&(w=o-g*(_-o)),{pitch:w,bearing:x}}}]),e}(pu),fd=function(t){L(e,t);var r=c2(e);function e(){var n;A(this,e);for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return n=r.call.apply(r,[this].concat(a)),c(q(n),"ControllerState",J_),c(q(n),"transition",{transitionDuration:300,transitionInterpolator:new Tr({transitionProps:{compare:["longitude","latitude","zoom","bearing","pitch","position"],required:["longitude","latitude","zoom"]}})}),c(q(n),"dragMode","pan"),n}return T(e,[{key:"setProps",value:function(i){i.position=i.position||[0,0,0];var a=this.props;Z(S(e.prototype),"setProps",this).call(this,i);var o=!a||a.height!==i.height;o&&this.updateViewport(new this.ControllerState(Oi(Oi({makeViewport:this.makeViewport},i),this.state)))}}]),e}(en);function yY(t){var r=_Y();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function _Y(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var ko=function(t){L(e,t);var r=yY(e);function e(){return A(this,e),r.apply(this,arguments)}return T(e,[{key:"ViewportType",get:function(){return Sr}},{key:"ControllerType",get:function(){return fd}}]),e}(Qr);c(ko,"displayName","MapView");F();j();k();function Q_(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=bY(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2103In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function bY(t,r){if(t){if(typeof t=="string")return p2(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);
2103if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return p2(t,r)}}function p2(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var xY=new Uf;function AY(t,r){var e,n,i=(e=t.order)!==null&&e!==void 0?e:1/0,a=(n=r.order)!==null&&n!==void 0?n:1/0;return i-a}var h2=function(){function t(){A(this,t),c(this,"effects",void 0),c(this,"_resolvedEffects",[]),c(this,"_defaultEffects",[]),c(this,"_needsRedraw",void 0),this.effects=[],this._needsRedraw="Initial render",this._setEffects([])}return T(t,[{key:"addDefaultEffect",value:function(e){var n=this._defaultEffects;if(!n.find(function(a){return a.id===e.id})){var i=n.findIndex(function(a){return AY(a,e)>0});i<0?n.push(e):n.splice(i,0,e),this._setEffects(this.effects)}}},{key:"setProps",value:function(e){"effects"in e&&(xt(e.effects,this.effects,1)||this._setEffects(e.effects))}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{clearRedrawFlags:!1},n=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),n}},{key:"getEffects",value:function(){return this._resolvedEffects}},{key:"_setEffects",value:function(e){var n={},i=Q_(this.effects),a;try{for(i.s();!(a=i.n()).done;){var o=a.value;n[o.id]=o}}catch(d){i.e(d)}finally{i.f()}var s=[],u=Q_(e),l;try{for(u.s();!(l=u.n()).done;){var f=l.value,p=n[f.id];p&&p!==f?p.setProps?(p.setProps(f.props),s.push(p)):(p.cleanup(),s.push(f)):s.push(f),delete n[f.id]}}catch(d){u.e(d)}finally{u.f()}for(var h in n)n[h].cleanup();this.effects=s,this._resolvedEffects=s.concat(this._defaultEffects),e.some(function(d){return d instanceof Uf})||this._resolvedEffects.push(xY),this._needsRedraw="effects changed"}},{key:"finalize",value:function(){var e=Q_(this._resolvedEffects),n;try{for(e.s();!(n=e.n()).done;){var i=n.value;i.cleanup()}}catch(a){e.e(a)}finally{e.f()}this.effects.length=0,this._resolvedEffects.length=0,this._defaultEffects.length=0}}]),t}();F();j();k();F();j();function SY(t){var r=TY();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function TY(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var d2=function(t){L(e,t);var r=SY(e);function e(){return A(this,e),r.apply(this,arguments)}return T(e,[{key:"shouldDrawLayer",value:function(i){var a=i.props.operation;return a.includes("draw")||a.includes("terrain")}}]),e}(br);function cd(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=wY(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2104In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function wY(t,r){if(t){if(typeof t=="string")return v2(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return v2(t,r)}}function v2(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function m2(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function hu(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};
2104r%2?m2(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):m2(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var PY="deckRenderer.renderLayers",pd=function(){function t(r){A(this,t),c(this,"gl",void 0),c(this,"layerFilter",void 0),c(this,"drawPickingColors",void 0),c(this,"drawLayersPass",void 0),c(this,"pickLayersPass",void 0),c(this,"renderCount",void 0),c(this,"_needsRedraw",void 0),c(this,"renderBuffers",void 0),c(this,"lastPostProcessEffect",void 0),this.gl=r,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new d2(r),this.pickLayersPass=new _a(r),this.renderCount=0,this._needsRedraw="Initial render",this.renderBuffers=[],this.lastPostProcessEffect=null}return T(t,[{key:"setProps",value:function(e){this.layerFilter!==e.layerFilter&&(this.layerFilter=e.layerFilter,this._needsRedraw="layerFilter changed"),this.drawPickingColors!==e.drawPickingColors&&(this.drawPickingColors=e.drawPickingColors,this._needsRedraw="drawPickingColors changed")}},{key:"renderLayers",value:function(e){if(e.viewports.length){var n=this.drawPickingColors?this.pickLayersPass:this.drawLayersPass,i=hu(hu({layerFilter:this.layerFilter,isPicking:this.drawPickingColors},e),{},{target:e.target||Le.getDefaultFramebuffer(this.gl)});i.effects&&this._preRender(i.effects,i);var a=this.lastPostProcessEffect?this.renderBuffers[0]:i.target,o=n.render(hu(hu({},i),{},{target:a}));i.effects&&this._postRender(i.effects,i),this.renderCount++,wt(PY,this,o,e)}}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{clearRedrawFlags:!1},n=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),n}},{key:"finalize",value:function(){var e=this.renderBuffers,n=cd(e),i;try{for(n.s();!(i=n.n()).done;){var a=i.value;a.delete()}}catch(o){n.e(o)}finally{n.f()}e.length=0}},{key:"_preRender",value:function(e,n){this.lastPostProcessEffect=null,n.preRenderStats=n.preRenderStats||{};var i=cd(e),a;try{for(i.s();!(a=i.n()).done;){var o=a.value;n.preRenderStats[o.id]=o.preRender(this.gl,n),o.postRender&&(this.lastPostProcessEffect=o.id)}}catch(s){i.e(s)}finally{i.f()}this.lastPostProcessEffect&&this._resizeRenderBuffers()}},{key:"_resizeRenderBuffers",value:function(){var e=this.renderBuffers;e.length===0&&e.push(new Le(this.gl),new Le(this.gl));var n=cd(e),i;try{for(n.s();!(i=n.n()).done;){var a=i.value;a.resize()}}catch(o){n.e(o)}finally{n.f()}}},{key:"_postRender",value:function(e,n){var i=this.renderBuffers,a=hu(hu({},n),{},{inputBuffer:i[0],swapBuffer:i[1],target:null}),o=cd(e),s;try{for(o.s();!(s=o.n()).done;){var u=s.value;if(u.postRender){if(u.id===this.lastPostProcessEffect){a.target=n.target,u.postRender(this.gl,a);break}var l=u.postRender(this.gl,a);a.inputBuffer=l,a.swapBuffer=l===i[0]?i[1]:i[0]}}}catch(f){o.e(f)}finally{o.f()}}}]),t}();F();j();k();k();function g2(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function hd(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?g2(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):g2(Object(e)).forEac
2104h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var OY={pickedColor:null,pickedObjectIndex:-1};function y2(t){for(var r=t.pickedColors,e=t.decodePickingColor,n=t.deviceX,i=t.deviceY,a=t.deviceRadius,o=t.deviceRect,s=o.x,u=o.y,l=o.width,f=o.height,p=a*a,h=-1,d=0,v=0;v<f;v++){var m=v+u-i,g=m*m;if(g>p)d+=4*l;else for(var y=0;y<l;y++){var _=r[d+3]-1;if(_>=0){var b=y+s-n,x=b*b+g;x<=p&&(p=x,h=d)}d+=4}}if(h>=0){var w=r.slice(h,h+4),P=e(w);if(P){var E=Math.floor(h/4/l),C=h/4-E*l;return hd(hd({},P),{},{pickedColor:w,pickedX:s+C,pickedY:u+E})}ne.error("Picked non-existent layer. Is picking buffer corrupt?")()}return OY}function _2(t){var r=t.pickedColors,e=t.decodePickingColor,n=new Map;if(r)for(var i=0;i<r.length;i+=4){var a=r[i+3]-1;if(a>=0){var o=r.slice(i,i+4),s=o.join(",");if(!n.has(s)){var u=e(o);u?n.set(s,hd(hd({},u),{},{color:o})):ne.error("Picked non-existent layer. Is picking buffer corrupt?")()}}}return Array.from(n.values())}k();function b2(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function EY(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?b2(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):b2(Object(e)).forEac
2104h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function eb(t){var r=t.pickInfo,e=t.viewports,n=t.pixelRatio,i=t.x,a=t.y,o=t.z,s=e[0];e.length>1&&(s=CY(r?.pickedViewports||e,{x:i,y:a}));var u;if(s){var l=[i-s.x,a-s.y];o!==void 0&&(l[2]=o),u=s.unproject(l)}return{color:null,layer:null,viewport:s,index:-1,picked:!1,x:i,y:a,pixel:[i,a],coordinate:u,devicePixel:r&&"pickedX"in r?[r.pickedX,r.pickedY]:void 0,pixelRatio:n}}function x2(t){var r=t.pickInfo,e=t.lastPickedInfo,n=t.mode,i=t.layers,a=r.pickedColor,o=r.pickedLayer,s=r.pickedObjectIndex,u=o?[o]:[];if(n==="hover"){var l=e.index,f=e.layerId,p=o?o.props.id:null;if(p!==f||s!==l){if(p!==f){var h=i.find(function(m){return m.props.id===f});h&&u.unshift(h)}e.layerId=p,e.index=s,e.info=null}}var d=eb(t),v=new Map;return v.set(null,d),u.forEach(function(m){var g=EY({},d);m===o&&(g.color=a,g.index=s,g.picked=!0),g=tb({layer:m,info:g,mode:n});var y=g.layer;m===o&&n==="hover"&&(e.info=g),v.set(y.id,g),n==="hover"&&y.updateAutoHighlight(g)}),v}function tb(t){for(var r=t.layer,e=t.info,n=t.mode;r&&e;){var i=e.layer||null;e.sourceLayer=i,e.layer=r,e=r.getPickingInfo({info:e,mode:n,sourceLayer:i}),r=r.parent}return e}function CY(t,r){for(var e=t.length-1;e>=0;e--){var n=t[e];if(n.containsPixel(r))return n}return t[0]}function rb(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=MY(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2105In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function MY(t,r){if(t){if(typeof t=="string")return A2(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return A2(t,r)}}function A2(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function S2(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function dd(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?S2(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):S2(Object(e)).forEac
2105h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var T2=function(){function t(r){A(this,t),c(this,"gl",void 0),c(this,"pickingFBO",void 0),c(this,"depthFBO",void 0),c(this,"pickLayersPass",void 0),c(this,"layerFilter",void 0),c(this,"lastPickedInfo",void 0),c(this,"_pickable",!0),this.gl=r,this.pickLayersPass=new _a(r),this.lastPickedInfo={index:-1,layerId:null,info:null}}return T(t,[{key:"setProps",value:function(e){"layerFilter"in e&&(this.layerFilter=e.layerFilter),"_pickable"in e&&(this._pickable=e._pickable)}},{key:"finalize",value:function(){this.pickingFBO&&this.pickingFBO.delete(),this.depthFBO&&(this.depthFBO.color.delete(),this.depthFBO.delete())}},{key:"pickObject",value:function(e){return this._pickClosestObject(e)}},{key:"pickObjects",value:function(e){return this._pickVisibleObjects(e)}},{key:"getLastPickedObject",value:function(e){var n=e.x,i=e.y,a=e.layers,o=e.viewports,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.lastPickedInfo.info,u=s&&s.layer&&s.layer.id,l=s&&s.viewport&&s.viewport.id,f=u?a.find(function(v){return v.id===u}):null,p=l&&o.find(function(v){return v.id===l})||o[0],h=p&&p.unproject([n-p.x,i-p.y]),d={x:n,y:i,viewport:p,coordinate:h,layer:f};return dd(dd({},s),d)}},{key:"_resizeBuffer",value:function(){var e,n,i=this.gl;if(!this.pickingFBO&&(this.pickingFBO=new Le(i),Le.isSupported(i,{colorBufferFloat:!0}))){var a=new Le(i);a.attach(c({},36064,new Ce(i,{format:ge(i)?34836:6408,type:5126}))),this.depthFBO=a}(e=this.pickingFBO)===null||e===void 0||e.resize({width:i.canvas.width,height:i.canvas.height}),(n=this.depthFBO)===null||n===void 0||n.resize({width:i.canvas.width,height:i.canvas.height})}},{key:"_getPickable",value:function(e){var n=this;if(this._pickable===!1)return null;var i=e.filter(function(a){return n.pickLayersPass.shouldDrawLayer(a)&&!a.isComposite});return i.length?i:null}},{key:"_pickClosestObject",value:function(e){var n=e.layers,i=e.views,a=e.viewports,o=e.x,s=e.y,u=e.radius,l=u===void 0?0:u,f=e.depth,p=f===void 0?1:f,h=e.mode,d=h===void 0?"query":h,v=e.unproject3D,m=e.onViewportActive,g=e.effects,y=this._getPickable(n),_=Jt(this.gl);if(!y)return{result:[],emptyInfo:eb({viewports:a,x:o,y:s,pixelRatio:_})};this._resizeBuffer();for(var b=Ls(this.gl,[o,s],!0),x=[b.x+Math.floor(b.width/2),b.y+Math.floor(b.height/2)],w=Math.round(l*_),P=this.pickingFBO,E=P.width,C=P.height,I=this._getPickingRect({deviceX:x[0],deviceY:x[1],deviceRadius:w,deviceWidth:E,deviceHeight:C}),O={x:o-l,y:s-l,width:l*2+1,height:l*2+1},D,N=[],H=new Set,$=0;$<p;$++){var ee=void 0;if(I){var V=this._drawAndSample({layers:y,views:i,viewports:a,onViewportActive:m,deviceRect:I,cullRect:O,effects:g,pass:"picking:".concat(d)});ee=y2(dd(dd({},V),{},{deviceX:x[0],deviceY:x[1],deviceRadius:w,deviceRect:I}))}else ee={pickedColor:null,pickedObjectIndex:-1};var U=void 0;if(ee.pickedLayer&&v&&this.depthFBO){var X=this._drawAndSample({layers:[ee.pickedLayer],views:i,viewports:a,onViewportActive:m,deviceRect:{x:ee.pickedX,y:ee.pickedY,width:1,height:1},cullRect:O,effects:g,pass:"picking:".concat(d,":z")},!0),K=X.pickedColors;K[3]&&(U=K[0])}ee.pickedLayer&&$+1<p&&(H.add(ee.pickedLayer),ee.pickedLayer.disablePickingIndex(ee.pickedObjectIndex)),D=x2({pickInfo:ee,lastPickedInfo:this.lastPickedInfo,mode:d,layers:y,viewports:a,x:o,y:s,z:U,pixelRatio:_});var te=rb(D.values()),ie;try{for(te.s();!(ie=te.n()).done;){var ce=ie.value;ce.layer&&N.push(ce)}}catch(we){te.e(we)}finally{te.f()}if(!ee.pickedColor)break}var Te=rb(H),Me;try{for(Te.s();!(Me=Te.n()).done;){var Fe=Me.value;Fe.restorePickingColors()}}catch(we){Te.e(we)}finally{Te.f()}return{result:N,emptyInfo:D.get(null)}}},{key:"_pickVisibleObjects",value:function(e){var n=e.layers,i=e.views,a=e.viewports,o=e.x,s=e.y,u=e.width,l=u===void 0?1:u,f=e.height,p=f===void 0?1:f,h=e.mode,d=h===void 0?"query":h,v=e.maxObjects,m=v===void 0?null:v,g=e.onViewportActive,y=e.effects,_=this._getPickable(n);if(!_)return[];this._resizeBuffer();for(var b=Jt(this.gl),x=Ls(this.gl,[o,s],!0),w=x.x,P=x.y+x.height,E=Ls(this.gl,[o+l,s+p],!0),C=E.x+E.width,I=E.y,O={x:w,y:I,width:C-w,height:P-I},D=this._drawAndSample({layers:_,views:i,viewports:a,onViewportActive:g,deviceRect:O,cullRect:{x:o,y:s,width:l,height:p},effects:y,pass:"picking:".concat(d)}),N=_2(D),H=new Map,$=Number.isFinite(m),ee=0;ee<N.length;ee++){var V;if($&&m&&H.size>=m)break;var U=N[ee],X={color:U.pickedColor,layer:null,index:U.pickedObjectIndex,picked:!0,x:o,y:s,pixelRatio:b};X=tb({layer:U.pickedLayer,info:X,mode:d});var K=(V=X.object)!==null&&V!==void 0?V:"".concat(X.layer.id,"[").concat(X.index,"]");H.has(K)||H.set(K,X)}return Array.from(H.values())}},{key:"_drawAndSample",value:function(e){var n=e.layers,i=e.views,a=e.viewports,o=e.onViewportActive,s=e.deviceRect,u=e.cullRect,l=e.effects,f=e.pass,p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,h=p?this.depthFBO:this.pickingFBO,d={layers:n,layerFilter:this.layerFilter,views:i,viewports:a,onViewportActive:o,pickingFBO:h,deviceRect:s,cullRect:u,effects:l,pass:f,pickZ:p,preRenderStats:{}},v=rb(l),m;try{for(v.s();!(m=v.n()).done;){var g=m.value;g.useInPicking&&(d.preRenderStats[g.id]=g.preRender(this.gl,d))}}catch(C){v.e(C)}finally{v.f()}var y=this.pickLayersPass.render(d),_=y.decodePickingColor,b=s.x,x=s.y,w=s.width,P=s.height,E=new(p?Float32Array:Uint8Array)(w*P*4);return gn(h,{sourceX:b,sourceY:x,sourceWidth:w,sourceHeight:P,target:E}),{pickedColors:E,decodePickingColor:_}}},{key:"_getPickingRect",value:function(e){var n=e.deviceX,i=e.deviceY,a=e.deviceRadius,o=e.deviceWidth,s=e.deviceHeight,u=Math.max(0,n-a),l=Math.max(0,i-a),f=Math.min(o,n+a+1)-u,p=Math.min(s,i+a+1)-l;return f<=0||p<=0?null:{x:u,y:l,width:f,height:p}}}]),t}();
2105Ge();F();j();k();var IY={zIndex:"1",position:"absolute",pointerEvents:"none",color:"#a0a7b4",backgroundColor:"#29323c",padding:"10px",top:"0",left:"0",display:"none"},w2=function(){function t(r){A(this,t),c(this,"el",null),c(this,"isVisible",!1);var e=r.parentElement;e&&(this.el=document.createElement("div"),this.el.className="deck-tooltip",Object.assign(this.el.style,IY),e.appendChild(this.el))}return T(t,[{key:"setTooltip",value:function(e,n,i){var a=this.el;if(a){if(typeof e=="string")a.innerText=e;else if(e)e.text&&(a.innerText=e.text),e.html&&(a.innerHTML=e.html),e.className&&(a.className=e.className);else{this.isVisible=!1,a.style.display="none";return}this.isVisible=!0,a.style.display="block",a.style.transform="translate(".concat(n,"px, ").concat(i,"px)"),e&&ue(e)==="object"&&"style"in e&&Object.assign(a.style,e.style)}}},{key:"remove",value:function(){this.el&&(this.el.remove(),this.el=null)}}]),t}();be();k();F();j();var Wf=me(P2());var O2=1,E2=2,nb=4,RY={mousedown:O2,mousemove:E2,mouseup:nb};function LY(t,r){for(var e=0;e<t.length;e++)if(r(t[e]))return!0;return!1}function C2(t){var r=t.prototype.handler;t.prototype.handler=function(n){var i=this.store;n.button>0&&n.type==="pointerdown"&&(LY(i,function(a){return a.pointerId===n.pointerId})||i.push(n)),r.call(this,n)}}function M2(t){t.prototype.handler=function(e){var n=RY[e.type];n&O2&&e.button>=0&&(this.pressed=!0),n&E2&&e.which===0&&(n=nb),this.pressed&&(n&nb&&(this.pressed=!1),this.callback(this.manager,n,{pointers:[e],changedPointers:[e],pointerType:"mouse",srcEvent:e}))}}C2(Wf.default.PointerEventInput);M2(Wf.default.MouseInput);var I2=Wf.default.Manager,Tn=Wf.default;F();j();k();F();function R2(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function kY(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?R2(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):R2(Object(e)).forEac
2105h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var Aa=function t(r,e,n){A(this,t),this.element=r,this.callback=e,this.options=kY({enable:!0},n)};var L2=Tn?[[Tn.Pan,{event:"tripan",pointers:3,threshold:0,enable:!1}],[Tn.Rotate,{enable:!1}],[Tn.Pinch,{enable:!1}],[Tn.Swipe,{enable:!1}],[Tn.Pan,{threshold:0,enable:!1}],[Tn.Press,{enable:!1}],[Tn.Tap,{event:"doubletap",taps:2,enable:!1}],[Tn.Tap,{event:"anytap",enable:!1}],[Tn.Tap,{enable:!1}]]:null,ib={tripan:["rotate","pinch","pan"],rotate:["pinch"],pinch:["pan"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},k2={doubletap:["tap"]},B2={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},du={KEY_EVENTS:["keydown","keyup"],MOUSE_EVENTS:["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],WHEEL_EVENTS:["wheel","mousewheel"]},F2={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"},ab={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"};var N2=typeof navigator<"u"&&navigator.userAgent?navigator.userAgent.toLowerCase():"",Bo=typeof window<"u"?window:global;var md=!1;try{D2={get passive(){return md=!0,!0}},Bo.addEventListener("test",null,D2),Bo.removeEventListener("test",null)}catch{md=!1}var D2;function BY(t){var r=FY();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function FY(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var DY=N2.indexOf("firefox")!==-1,NY=du.WHEEL_EVENTS,j2="wheel",U2=4.000244140625,jY=40,UY=.25,G2=function(t){L(e,t);var r=BY(e);function e(n,i,a){var o;return A(this,e),o=r.call(this,n,i,a),o.handleEvent=function(s){if(o.options.enable){var u=s.deltaY;Bo.WheelEvent&&(DY&&s.deltaMode===Bo.WheelEvent.DOM_DELTA_PIXEL&&(u/=Bo.devicePixelRatio),s.deltaMode===Bo.WheelEvent.DOM_DELTA_LINE&&(u*=jY)),u!==0&&u%U2===0&&(u=Math.floor(u/U2)),s.shiftKey&&u&&(u=u*UY),o.callback({type:j2,center:{x:s.clientX,y:s.clientY},delta:-u,srcEvent:s,pointerType:"mouse",target:s.target})}},o.events=(o.options.events||[]).concat(NY),o.events.forEach(function(s){return n.addEventListener(s,o.handleEvent,md?{passive:!1}:!1)}),o}return T(e,[{key:"destroy",value:function(){var i=this;this.events.forEach(function(a){return i.element.removeEventListener(a,i.handleEvent)})}},{key:"enableEventType",value:function(i,a){i===j2&&(this.options.enable=a)}}]),e}(Aa);F();j();function GY(t){var r=zY();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function zY(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var VY=du.MOUSE_EVENTS,z2="pointermove",V2="pointerover",H2="pointerout",W2="pointerenter",$2="pointerleave",X2=function(t){L(e,t);var r=GY(e);function e(n,i,a){var o;A(this,e),o=r.call(this,n,i,a),o.handleEvent=function(u){o.handleOverEvent(u),o.handleOutEvent(u),o.handleEnterEvent(u),o.handleLeaveEvent(u),o.handleMoveEvent(u)},o.pressed=!1;var s=o.options.enable;return o.enableMoveEvent=s,o.enableLeaveEvent=s,o.enableEnterEvent=s,o.enableOutEvent=s,o.enableOverEvent=s,o.events=(o.options.events||[]).concat(VY),o.events.forEac
2105h(function(u){return n.addEventListener(u,o.handleEvent)}),o}return T(e,[{key:"destroy",value:function(){var i=this;this.events.forEach(function(a){return i.element.removeEventListener(a,i.handleEvent)})}},{key:"enableEventType",value:function(i,a){i===z2&&(this.enableMoveEvent=a),i===V2&&(this.enableOverEvent=a),i===H2&&(this.enableOutEvent=a),i===W2&&(this.enableEnterEvent=a),i===$2&&(this.enableLeaveEvent=a)}},{key:"handleOverEvent",value:function(i){this.enableOverEvent&&i.type==="mouseover"&&this._emit(V2,i)}},{key:"handleOutEvent",value:function(i){this.enableOutEvent&&i.type==="mouseout"&&this._emit(H2,i)}},{key:"handleEnterEvent",value:function(i){this.enableEnterEvent&&i.type==="mouseenter"&&this._emit(W2,i)}},{key:"handleLeaveEvent",value:function(i){this.enableLeaveEvent&&i.type==="mouseleave"&&this._emit($2,i)}},{key:"handleMoveEvent",value:function(i){if(this.enableMoveEvent)switch(i.type){case"mousedown":i.button>=0&&(this.pressed=!0);break;case"mousemove":i.which===0&&(this.pressed=!1),this.pressed||this._emit(z2,i);break;case"mouseup":this.pressed=!1;break;default:}}},{key:"_emit",value:function(i,a){this.callback({type:i,center:{x:a.clientX,y:a.clientY},srcEvent:a,pointerType:"mouse",target:a.target})}}]),e}(Aa);F();j();function HY(t){var r=WY();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function WY(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var $Y=du.KEY_EVENTS,q2="keydown",Y2="keyup",K2=function(t){L(e,t);var r=HY(e);function e(n,i,a){var o;return A(this,e),o=r.call(this,n,i,a),o.handleEvent=function(s){var u=s.target||s.srcElement;u.tagName==="INPUT"&&u.type==="text"||u.tagName==="TEXTAREA"||(o.enableDownEvent&&s.type==="keydown"&&o.callback({type:q2,srcEvent:s,key:s.key,target:s.target}),o.enableUpEvent&&s.type==="keyup"&&o.callback({type:Y2,srcEvent:s,key:s.key,target:s.target}))},o.enableDownEvent=o.options.enable,o.enableUpEvent=o.options.enable,o.events=(o.options.events||[]).concat($Y),n.tabIndex=o.options.tabIndex||0,n.style.outline="none",o.events.forEach(function(s){return n.addEventListener(s,o.handleEvent)}),o}return T(e,[{key:"destroy",value:function(){var i=this;this.events.forEach(function(a){return i.element.removeEventListener(a,i.handleEvent)})}},{key:"enableEventType",value:function(i,a){i===q2&&(this.enableDownEvent=a),i===Y2&&(this.enableUpEvent=a)}}]),e}(Aa);F();j();function XY(t){var r=qY();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function qY(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Z2="contextmenu",J2=function(t){L(e,t);var r=XY(e);function e(n,i,a){var o;return A(this,e),o=r.call(this,n,i,a),o.handleEvent=function(s){o.options.enable&&o.callback({type:Z2,center:{x:s.clientX,y:s.clientY},srcEvent:s,pointerType:"mouse",target:s.target})},n.addEventListener("contextmenu",o.handleEvent),o}return T(e,[{key:"destroy",value:function(){this.element.removeEventListener("contextmenu",this.handleEvent)}},{key:"enableEventType",value:function(i,a){i===Z2&&(this.options.enable=a)}}]),e}(Aa);k();F();j();var ob=1,gd=2,sb=4,YY={pointerdown:ob,pointermove:gd,pointerup:sb,mousedown:ob,mousemove:gd,mouseup:sb},KY=1,ZY=2,JY=3,QY=0,eK=1,tK=2,rK=1,nK=2,iK=4;function Q2(t){var r=YY[t.srcEvent.type];if(!r)return null;var e=t.srcEvent,n=e.buttons,i=e.button,a=e.which,o=!1,s=!1,u=!1;return r===sb||r===gd&&!Number.isFinite(n)?(o=a===KY,s=a===ZY,u=a===JY):r===gd?(o=Boolean(n&rK),s=Boolean(n&iK),u=Boolean(n&nK)):r===ob&&(o=i===QY,s=i===eK,u=i===tK),{leftButton:o,middleButton:s,rightButton:u}}function eI(t,r){var e=t.center;if(!e)return null;var n=r.getBoundingClientRect(),i=n.width/r.offsetWidth||1,a=n.height/r.offsetHeight||1,o={x:(e.x-n.left-r.clientLeft)/i,y:(e.y-n.top-r.clientTop)/a};return{center:e,offsetCenter:o}}function tI(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function Xn(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};
2105r%2?tI(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):tI(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var ub={srcElement:"root",priority:0},rI=function(){function t(r){var e=this;A(this,t),this.handleEvent=function(n){if(!e.isEmpty()){for(var i=e._normalizeEvent(n),a=n.srcEvent.target;a&&a!==i.rootElement;){if(e._emit(i,a),i.handled)return;a=a.parentNode}e._emit(i,"root")}},this.eventManager=r,this.handlers=[],this.handlersByElement=new Map,this._active=!1}return T(t,[{key:"isEmpty",value:function(){return!this._active}},{key:"add",value:function(e,n,i){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,s=this.handlers,u=this.handlersByElement,l=ub;typeof i=="string"||i&&i.addEventListener?l=Xn(Xn({},ub),{},{srcElement:i}):i&&(l=Xn(Xn({},ub),i));var f=u.get(l.srcElement);f||(f=[],u.set(l.srcElement,f));var p={type:e,handler:n,srcElement:l.srcElement,priority:l.priority};a&&(p.once=!0),o&&(p.passive=!0),s.push(p),this._active=this._active||!p.passive;for(var h=f.length-1;h>=0&&!(f[h].priority>=p.priority);)h--;f.splice(h+1,0,p)}},{key:"remove",value:function(e,n){for(var i=this.handlers,a=this.handlersByElement,o=i.length-1;o>=0;o--){var s=i[o];if(s.type===e&&s.handler===n){i.splice(o,1);var u=a.get(s.srcElement);u.splice(u.indexOf(s),1),u.length===0&&a.delete(s.srcElement)}}this._active=i.some(function(l){return!l.passive})}},{key:"_emit",value:function(e,n){var i=this.handlersByElement.get(n);if(i){for(var a=!1,o=function(){e.handled=!0},s=function(){e.handled=!0,a=!0},u=[],l=0;l<i.length;l++){var f=i[l],p=f.type,h=f.handler,d=f.once;if(h(Xn(Xn({},e),{},{type:p,stopPropagation:o,stopImmediatePropagation:s})),d&&u.push(i[l]),a)break}for(var v=0;v<u.length;v++){var m=u[v],g=m.type,y=m.handler;this.remove(g,y)}}}},{key:"_normalizeEvent",value:function(e){var n=this.eventManager.getElement();return Xn(Xn(Xn(Xn({},e),Q2(e)),eI(e,n)),{},{preventDefault:function(){e.srcEvent.preventDefault()},stopImmediatePropagation:null,stopPropagation:null,handled:!1,rootElement:n})}}]),t}();function nI(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=aK(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2106In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function aK(t,r){if(t){if(typeof t=="string")return iI(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return iI(t,r)}}function iI(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function aI(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function oI(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?aI(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):aI(Object(e)).forEac
2106h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var oK={events:null,recognizers:null,recognizerOptions:{},Manager:I2,touchAction:"none",tabIndex:0},lb=function(){function t(){var r=this,e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,n=arguments.length>1?arguments[1]:void 0;A(this,t),this._onBasicInput=function(a){var o=a.srcEvent,s=B2[o.type];s&&r.manager.emit(s,a)},this._onOtherEvent=function(a){r.manager.emit(a.type,a)},this.options=oI(oI({},oK),n),this.events=new Map,this.setElement(e);var i=this.options.events;i&&this.on(i)}return T(t,[{key:"getElement",value:function(){return this.element}},{key:"setElement",value:function(e){var n=this;if(this.element&&this.destroy(),this.element=e,!!e){var i=this.options,a=i.Manager;this.manager=new a(e,{touchAction:i.touchAction,recognizers:i.recognizers||L2}).on("hammer.input",this._onBasicInput),i.recognizers||Object.keys(ib).forEach(function(v){var m=n.manager.get(v);m&&ib[v].forEach(function(g){m.recognizeWith(g)})});for(var o in i.recognizerOptions){var s=this.manager.get(o);if(s){var u=i.recognizerOptions[o];delete u.enable,s.set(u)}}this.wheelInput=new G2(e,this._onOtherEvent,{enable:!1}),this.moveInput=new X2(e,this._onOtherEvent,{enable:!1}),this.keyInput=new K2(e,this._onOtherEvent,{enable:!1,tabIndex:i.tabIndex}),this.contextmenuInput=new J2(e,this._onOtherEvent,{enable:!1});var l=nI(this.events),f;try{for(l.s();!(f=l.n()).done;){var p=W(f.value,2),h=p[0],d=p[1];d.isEmpty()||(this._toggleRecognizer(d.recognizerName,!0),this.manager.on(h,d.handleEvent))}}catch(v){l.e(v)}finally{l.f()}}}},{key:"destroy",value:function(){this.element&&(this.wheelInput.destroy(),this.moveInput.destroy(),this.keyInput.destroy(),this.contextmenuInput.destroy(),this.manager.destroy(),this.wheelInput=null,this.moveInput=null,this.keyInput=null,this.contextmenuInput=null,this.manager=null,this.element=null)}},{key:"on",value:function(e,n,i){this._addEventHandler(e,n,i,!1)}},{key:"once",value:function(e,n,i){this._addEventHandler(e,n,i,!0)}},{key:"watch",value:function(e,n,i){this._addEventHandler(e,n,i,!1,!0)}},{key:"off",value:function(e,n){this._removeEventHandler(e,n)}},{key:"_toggleRecognizer",value:function(e,n){var i=this.manager;if(i){var a=i.get(e);if(a&&a.options.enable!==n){a.set({enable:n});var o=k2[e];o&&!this.options.recognizers&&o.forEach(function(s){var u=i.get(s);n?(u.requireFailure(e),a.dropRequireFailure(s)):u.dropRequireFailure(e)})}this.wheelInput.enableEventType(e,n),this.moveInput.enableEventType(e,n),this.keyInput.enableEventType(e,n),this.contextmenuInput.enableEventType(e,n)}}},{key:"_addEventHandler",value:function(e,n,i,a,o){if(typeof e!="string"){i=n;for(var s in e)this._addEventHandler(s,e[s],i,a,o);return}var u=this.manager,l=this.events,f=ab[e]||e,p=l.get(f);p||(p=new rI(this),l.set(f,p),p.recognizerName=F2[f]||f,u&&u.on(f,p.handleEvent)),p.add(e,n,i,a,o),p.isEmpty()||this._toggleRecognizer(p.recognizerName,!0)}},{key:"_removeEventHandler",value:function(e,n){if(typeof e!="string"){for(var i in e)this._removeEventHandler(i,e[i]);return}var a=this.events,o=ab[e]||e,s=a.get(o);if(s&&(s.remove(e,n),s.isEmpty())){var u=s.recognizerName,l=!1,f=nI(a.values()),p;try{for(f.s();!(p=f.n()).done;){var h=p.value;if(h.recognizerName===u&&!h.isEmpty()){l=!0;break}}}catch(d){f.e(d)}finally{f.f()}l||this._toggleRecognizer(u,!1)}}}]),t}();function sI(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=sK(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2107In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function sK(t,r){if(t){if(typeof t=="string")return uI(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);
2107if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return uI(t,r)}}function uI(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function lI(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function Ei(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?lI(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):lI(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function Fo(){}var uK=function(r){var e=r.isDragging;return e?"grabbing":"grab"},fI={id:"",width:"100%",height:"100%",style:null,viewState:null,initialViewState:null,pickingRadius:0,layerFilter:null,glOptions:{},parameters:{},parent:null,gl:null,canvas:null,layers:[],effects:[],views:null,controller:null,useDevicePixels:!0,touchAction:"none",eventRecognizerOptions:{},_framebuffer:null,_animate:!1,_pickable:!0,_typedArrayManagerProps:{},_customRender:null,onWebGLInitialized:Fo,onResize:Fo,onViewStateChange:Fo,onInteractionStateChange:Fo,onBeforeRender:Fo,onAfterRender:Fo,onLoad:Fo,onError:function(r){return ne.error(r.message,r.cause)()},onHover:null,onClick:null,onDragStart:null,onDrag:null,onDragEnd:null,_onMetrics:null,getCursor:uK,getTooltip:null,debug:!1,drawPickingColors:!1},Nr=function(){function t(r){var e=this;A(this,t),c(this,"props",void 0),c(this,"width",0),c(this,"height",0),c(this,"userData",{}),c(this,"canvas",null),c(this,"viewManager",null),c(this,"layerManager",null),c(this,"effectManager",null),c(this,"deckRenderer",null),c(this,"deckPicker",null),c(this,"eventManager",null),c(this,"tooltip",null),c(this,"metrics",void 0),c(this,"animationLoop",void 0),c(this,"stats",void 0),c(this,"viewState",void 0),c(this,"cursorState",void 0),c(this,"_needsRedraw",void 0),c(this,"_pickRequest",void 0),c(this,"_lastPointerDownInfo",null),c(this,"_metricsCounter",void 0),c(this,"_onPointerMove",function(n){var i=e._pickRequest;if(n.type==="pointerleave")i.x=-1,i.y=-1,i.radius=0;else{if(n.leftButton||n.rightButton)return;var a=n.offsetCenter;if(!a)return;i.x=a.x,i.y=a.y,i.radius=e.props.pickingRadius}e.layerManager&&(e.layerManager.context.mousePosition={x:i.x,y:i.y}),i.event=n}),c(this,"_onEvent",function(n){var i=b0[n.type],a=n.offsetCenter;if(!(!i||!a||!e.layerManager)){var o=e.layerManager.getLayers(),s=e.deckPicker.getLastPickedObject({x:a.x,y:a.y,layers:o,viewports:e.getViewports(a)},e._lastPointerDownInfo),u=s.layer,l=u&&(u[i.handler]||u.props[i.handler]),f=e.props[i.handler],p=!1;l&&(p=l.call(u,s,n)),!p&&f&&f(s,n)}}),c(this,"_onPointerDown",function(n){var i=n.offsetCenter,a=e._pick("pickObject","pickObject Time",{x:i.x,y:i.y,radius:e.props.pickingRadius});e._lastPointerDownInfo=a.result[0]||a.emptyInfo}),this.props=Ei(Ei({},fI),r),r=this.props,this._needsRedraw="Initial render",this._pickRequest={mode:"hover",x:-1,y:-1,radius:0,event:null},this.cursorState={isHovering:!1,isDragging:!1},r.viewState&&r.initialViewState&&ne.warn("View state tracking is disabled. Use either `initialViewState` for auto update or `viewState` for manual update.")(),Cs()==="IE"&&ne.warn("IE 11 is not supported")(),this.viewState=r.initialViewState,r.gl||typeof document<"u"&&(this.canvas=this._createCanvas(r)),this.animationLoop=this._createAnimationLoop(r),this.stats=new po({id:"deck.gl"}),this.metrics={fps:0,setPropsTime:0,updateAttributesTime:0,framesRedrawn:0,pickTime:0,pickCount:0,gpuTime:0,gpuTimePerFrame:0,cpuTime:0,cpuTimePerFrame:0,bufferMemory:0,textureMemory:0,renderbufferMemory:0,gpuMemory:0},this._metricsCounter=0,this.setProps(r),r._typedArrayManagerProps&&xn.setOptions(r._typedArrayManagerProps),this.animationLoop.start()}return T(t,[{key:"finalize",value:function(){var e,n,i,a,o,s,u,l;if((e=this.animationLoop)===null||e===void 0||e.stop(),this.animationLoop=null,this._lastPointerDownInfo=null,(n=this.layerManager)===null||n===void 0||n.finalize(),this.layerManager=null,(i=this.viewManager)===null||i===void 0||i.finalize(),this.viewManager=null,(a=this.effectManager)===null||a===void 0||a.finalize(),this.effectManager=null,(o=this.deckRenderer)===null||o===void 0||o.finalize(),this.deckRenderer=null,(s=this.deckPicker)===null||s===void 0||s.finalize(),this.deckPicker=null,(u=this.eventManager)===null||u===void 0||u.destroy(),this.eventManager=null,(l=this.tooltip)===null||l===void 0||l.remove(),this.tooltip=null,!this.props.canvas&&!this.props.gl&&this.canvas){var f;(f=this.canvas.parentElement)===null||f===void 0||f.removeChild(this.canvas),this.canvas=null}}},{key:"setProps",value:function(e){this.stats.get("setProps Time").timeStart(),"onLayerHover"in e&&ne.removed("onLayerHover","onHover")(),"onLayerClick"in e&&ne.removed("onLayerClick","onClick")(),e.initialViewState&&!xt(this.props.initialViewState,e.initialViewState,3)&&(this.viewState=e.initialViewState),Object.assign(this.props,e),this._setCanvasSize(this.props);var n=Object.create(this.props);Object.assign(n,{views:this._getViews(),width:this.width,height:this.height,viewState:this._getViewState()}),this.animationLoop.setProps(n),this.layerManager&&(this.viewManager.setProps(n),this.layerManager.activateViewport(this.getViewports()[0]),this.layerManager.setProps(n),this.effectManager.setProps(n),this.deckRenderer.setProps(n),this.deckPicker.setProps(n)),this.stats.get("setProps Time").timeEnd()}},{key:"needsRedraw",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{clearRedrawFlags:!1};if(!this.layerManager)return!1;if(this.props._animate)return"Deck._animate";var n=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);var i=this.viewManager.needsRedraw(e),a=this.layerManager.needsRedraw(e),o=this.effectManager.needsRedraw(e),s=this.deckRenderer.needsRedraw(e);return n=n||i||a||o||s,n}},{key:"redraw",value:function(e){if(this.layerManager){var n=this.needsRedraw({clearRedrawFlags:!0});n=e||n,n&&(this.stats.get("Redraw Count").incrementCount(),this.props._customRender?this.props._customRender(n):this._drawLayers(n))}}},{key:"isInitialized",get:function(){return this.viewManager!==null}},{key:"getViews",value:function(){return Je(this.viewManager),this.viewManager.views}},{key:"getViewports",value:function(e){return Je(this.viewManager),this.viewManager.getViewports(e)}},{key:"getCanvas",value:function(){return this.canvas}},{key:"pickObject",value:function(e){var n=this._pick("pickObject","pickObject Time",e).result;return n.length?n[0]:null}},{key:"pickMultipleObjects",value:function(e){return e.depth=e.depth||10,this._pick("pickObject","pickMultipleObjects Time",e).result}},{key:"pickObjects",value:function(e){return this._pick("pickObjects","pickObjects Time",e)}
2107},{key:"_addResources",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;for(var i in e)this.layerManager.resourceManager.add({resourceId:i,data:e[i],forceUpdate:n})}},{key:"_removeResources",value:function(e){var n=sI(e),i;try{for(n.s();!(i=n.n()).done;){var a=i.value;this.layerManager.resourceManager.remove(a)}}catch(o){n.e(o)}finally{n.f()}}},{key:"_addDefaultEffect",value:function(e){this.effectManager.addDefaultEffect(e)}},{key:"_pick",value:function(e,n,i){Je(this.deckPicker);var a=this.stats;a.get("Pick Count").incrementCount(),a.get(n).timeStart();var o=this.deckPicker[e](Ei({layers:this.layerManager.getLayers(i),views:this.viewManager.getViews(),viewports:this.getViewports(i),onViewportActive:this.layerManager.activateViewport,effects:this.effectManager.getEffects()},i));return a.get(n).timeEnd(),o}},{key:"_createCanvas",value:function(e){var n=e.canvas;if(typeof n=="string"&&(n=document.getElementById(n),Je(n)),!n){n=document.createElement("canvas"),n.id=e.id||"deckgl-overlay";var i=e.parent||document.body;i.appendChild(n)}return Object.assign(n.style,e.style),n}},{key:"_setCanvasSize",value:function(e){if(this.canvas){var n=e.width,i=e.height;if(n||n===0){var a=Number.isFinite(n)?"".concat(n,"px"):n;this.canvas.style.width=a}if(i||i===0){var o,s=Number.isFinite(i)?"".concat(i,"px"):i;this.canvas.style.position=((o=e.style)===null||o===void 0?void 0:o.position)||"absolute",this.canvas.style.height=s}}}},{key:"_updateCanvasSize",value:function(){var e,n,i=this.canvas;if(i){var a=(e=i.clientWidth)!==null&&e!==void 0?e:i.width,o=(n=i.clientHeight)!==null&&n!==void 0?n:i.height;if(a!==this.width||o!==this.height){var s,u;this.width=a,this.height=o,(s=this.viewManager)===null||s===void 0||s.setProps({width:a,height:o}),(u=this.layerManager)===null||u===void 0||u.activateViewport(this.getViewports()[0]),this.props.onResize({width:a,height:o})}}}},{key:"_createAnimationLoop",value:function(e){var n=this,i=e.width,a=e.height,o=e.gl,s=e.glOptions,u=e.debug,l=e.onError,f=e.onBeforeRender,p=e.onAfterRender,h=e.useDevicePixels;return new Jp({width:i,height:a,useDevicePixels:h,autoResizeDrawingBuffer:!o,autoResizeViewport:!1,gl:o,onCreateContext:function(v){return ks(Ei(Ei(Ei({},s),v),{},{canvas:n.canvas,debug:u,onContextLost:function(){return n._onContextLost()}}))},onInitialize:function(v){return n._setGLContext(v.gl)},onRender:this._onRenderFrame.bind(this),onBeforeRender:f,onAfterRender:p,onError:l})}},{key:"_getViewState",value:function(){return this.props.viewState||this.viewState}},{key:"_getViews",value:function(){var e=this.props.views||[new ko({id:"default-view"})];return e=Array.isArray(e)?e:[e],e.length&&this.props.controller&&(e[0].props.controller=this.props.controller),e}},{key:"_onContextLost",value:function(){var e=this.props.onError;this.animationLoop&&e&&e(new Error("WebGL context is lost"))}},{key:"_pickAndCallback",value:function(){var e=this._pickRequest;if(e.event){var n=this._pick("pickObject","pickObject Time",e),i=n.result,a=n.emptyInfo;this.cursorState.isHovering=i.length>0;var o=a,s=!1,u=sI(i),l;try{for(u.s();!(l=u.n()).done;){var f,p=l.value;o=p,s=((f=p.layer)===null||f===void 0?void 0:f.onHover(p,e.event))||s}}catch(d){u.e(d)}finally{u.f()}if(!s&&this.props.onHover&&this.props.onHover(o,e.event),this.props.getTooltip&&this.tooltip){var h=this.props.getTooltip(o);this.tooltip.setTooltip(h,o.x,o.y)}e.event=null}}},{key:"_updateCursor",value:function(){var e=this.props.parent||this.canvas;e&&(e.style.cursor=this.props.getCursor(this.cursorState))}},{key:"_setGLContext",value:function(e){if(!this.layerManager){this.canvas||(this.canvas=e.canvas,gi(e,{enable:!0,copyState:!0})),this.tooltip=new w2(this.canvas),It(e,{blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onWebGLInitialized(e);var n=new ma;n.play(),this.animationLoop.attachTimeline(n),this.eventManager=new lb(this.props.parent||e.canvas,{touchAction:this.props.touchAction,recognizerOptions:this.props.eventRecognizerOptions,events:{pointerdown:this._onPointerDown,pointermove:this._onPointerMove,pointerleave:this._onPointerMove}});for(var i in b0)this.eventManager.on(i,this._onEvent);this.viewManager=new JM({timeline:n,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 a=this.viewManager.getViewports()[0];this.layerManager=new sd(e,{deck:this,stats:this.stats,viewport:
2107a,timeline:n}),this.effectManager=new h2,this.deckRenderer=new pd(e),this.deckPicker=new T2(e),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}}},{key:"_drawLayers",value:function(e,n){var i=this.layerManager.context.gl;It(i,this.props.parameters),this.props.onBeforeRender({gl:i}),this.deckRenderer.renderLayers(Ei({target:this.props._framebuffer,layers:this.layerManager.getLayers(),viewports:this.viewManager.getViewports(),onViewportActive:this.layerManager.activateViewport,views:this.viewManager.getViews(),pass:"screen",effects:this.effectManager.getEffects()},n)),this.props.onAfterRender({gl:i})}},{key:"_onRenderFrame",value:function(e){this._getFrameStats(),this._metricsCounter++%60===0&&(this._getMetrics(),this.stats.reset(),ne.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(e){var n=this.props.onViewStateChange(e)||e.viewState;this.viewState&&(this.viewState=Ei(Ei({},this.viewState),{},c({},e.viewId,n)),this.props.viewState||this.viewManager&&this.viewManager.setProps({viewState:this.viewState}))}},{key:"_onInteractionStateChange",value:function(e){this.cursorState.isDragging=e.isDragging||!1,this.props.onInteractionStateChange(e)}},{key:"_getFrameStats",value:function(){var e=this.stats;e.get("frameRate").timeEnd(),e.get("frameRate").timeStart();var n=this.animationLoop.stats;e.get("GPU Time").addTime(n.get("GPU Time").lastTiming),e.get("CPU Time").addTime(n.get("CPU Time").lastTiming)}},{key:"_getMetrics",value:function(){var e=this.metrics,n=this.stats;e.fps=n.get("frameRate").getHz(),e.setPropsTime=n.get("setProps Time").time,e.updateAttributesTime=n.get("Update Attributes").time,e.framesRedrawn=n.get("Redraw Count").count,e.pickTime=n.get("pickObject Time").time+n.get("pickMultipleObjects Time").time+n.get("pickObjects Time").time,e.pickCount=n.get("Pick Count").count,e.gpuTime=n.get("GPU Time").time,e.cpuTime=n.get("CPU Time").time,e.gpuTimePerFrame=n.get("GPU Time").getAverageTime(),e.cpuTimePerFrame=n.get("CPU Time").getAverageTime();var i=$r.get("Memory Usage");e.bufferMemory=i.get("Buffer Memory").count,e.textureMemory=i.get("Texture Memory").count,e.renderbufferMemory=i.get("Renderbuffer Memory").count,e.gpuMemory=i.get("GPU Memory").count}}]),t}();c(Nr,"defaultProps",fI);c(Nr,"VERSION",Ip);F();j();k();be();F();j();k();F();j();k();F();j();k();function cI(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function pI(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?cI(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):cI(Object(e)).forEac
2107h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var yd=function(){function t(r,e){A(this,t),c(this,"opts",void 0),c(this,"source",void 0),this.opts=e,this.source=r}return T(t,[{key:"value",get:function(){return this.source.value}},{key:"getValue",value:function(){var e=this.source.getBuffer(),n=this.getAccessor();if(e)return[e,n];var i=this.source.value,a=n.size,o=i;if(i&&i.length!==a){o=new Float32Array(a);for(var s=n.elementOffset||0,u=0;u<a;++u)o[u]=i[s+u]}return o}},{key:"getAccessor",value:function(){return pI(pI({},this.source.getAccessor()),this.opts)}}]),t}();function hI(t){switch(t){case 5126:return Float32Array;case 5130:return Float64Array;case 5123:case 33635:case 32819:case 32820:return Uint16Array;case 5125:return Uint32Array;case 5121:return Uint8ClampedArray;case 5120:return Int8Array;case 5122:return Int16Array;case 5124:return Int32Array;default:throw new Error("Unknown GL type")}}function dI(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function qn(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?dI(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):dI(Object(e)).forEac
2107h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function _d(t){return t.stride||t.size*t.bytesPerElement}function vI(t,r){r.offset&&ne.removed("shaderAttribute.offset","vertexOffset, elementOffset")();var e=_d(t),n=r.vertexOffset!==void 0?r.vertexOffset:t.vertexOffset||0,i=r.elementOffset||0,a=n*e+i*t.bytesPerElement+(t.offset||0);return qn(qn({},r),{},{offset:a,stride:e})}function lK(t,r){var e=vI(t,r);return{high:e,low:qn(qn({},e),{},{offset:e.offset+t.size*4})}}var mI=function(){function t(r,e,n){A(this,t),c(this,"gl",void 0),c(this,"id",void 0),c(this,"size",void 0),c(this,"settings",void 0),c(this,"value",void 0),c(this,"doublePrecision",void 0),c(this,"_buffer",void 0),c(this,"state",void 0),this.gl=r,this.id=e.id||"",this.size=e.size||1;var i=e.logicalType||e.type,a=i===5130,o=e.defaultValue;o=Number.isFinite(o)?[o]:o||new Array(this.size).fill(0);var s;a?s=5126:!i&&e.isIndexed?s=r&&yn(r,Ee.ELEMENT_INDEX_UINT32)?5125:5123:s=i||5126;var u=hI(i||s||5126);this.doublePrecision=a,a&&e.fp64===!1&&(u=Float32Array),this.value=null,this.settings=qn(qn({},e),{},{defaultType:u,defaultValue:o,logicalType:i,type:s,size:this.size,bytesPerElement:u.BYTES_PER_ELEMENT}),this.state=qn(qn({},n),{},{externalBuffer:null,bufferAccessor:this.settings,allocatedValue:null,numInstances:0,bounds:null,constant:!1}),this._buffer=null}return T(t,[{key:"isConstant",get:function(){return this.state.constant}},{key:"buffer",get:function(){if(!this._buffer){var e=this.settings,n=e.isIndexed,i=e.type;this._buffer=new Pe(this.gl,{id:this.id,target:n?34963:34962,accessor:{type:i}})}return this._buffer}},{key:"byteOffset",get:function(){var e=this.getAccessor();return e.vertexOffset?e.vertexOffset*_d(e):0}},{key:"numInstances",get:function(){return this.state.numInstances},set:function(e){this.state.numInstances=e}},{key:"delete",value:function(){this._buffer&&(this._buffer.delete(),this._buffer=null),xn.release(this.state.allocatedValue)}},{key:"getShaderAttributes",value:function(e,n){if(this.doublePrecision){var i={},a=this.value instanceof Float64Array,o=lK(this.getAccessor(),n||{});return i[e]=new yd(this,o.high),i["".concat(e,"64Low")]=a?new yd(this,o.low):new Float32Array(this.size),i}if(n){var s=vI(this.getAccessor(),n);return c({},e,new yd(this,s))}return c({},e,this)}},{key:"getBuffer",value:function(){return this.state.constant?null:this.state.externalBuffer||this._buffer}},{key:"getValue",value:function(){return this.state.constant?this.value:[this.getBuffer(),this.getAccessor()]}},{key:"getAccessor",value:function(){return this.state.bufferAccessor}},{key:"getBounds",value:function(){if(this.state.bounds)return this.state.bounds;var e=null;if(this.state.constant&&this.value){var n=Array.from(this.value);e=[n,n]}else{var i=this.value,a=this.numInstances,o=this.size,s=a*o;if(i&&s&&i.length>=s){for(var u=new Array(o).fill(1/0),l=new Array(o).fill(-1/0),f=0;f<s;)for(var p=0;p<o;p++){var h=i[f++];h<u[p]&&(u[p]=h),h>l[p]&&(l[p]=h)}e=[u,l]}}return this.state.bounds=e,e}},{key:"setData",value:function(e){var n=this.state,i;ArrayBuffer.isView(e)?i={value:e}:e instanceof Pe?i={buffer:e}:i=e;var a=qn(qn({},this.settings),i);if(n.bufferAccessor=a,n.bounds=null,i.constant){var o=i.value;o=this._normalizeValue(o,[],0),this.settings.normalized&&(o=this.normalizeConstant(o));var s=!n.constant||!this._areValuesEqual(o,this.value);if(!s)return!1;n.externalBuffer=null,n.constant=!0,this.value=o}else if(i.buffer){var u=i.buffer;n.externalBuffer=u,n.constant=!1,this.value=i.value||null;var l=i.value instanceof Float64Array;a.type=i.type||u.accessor.type,a.bytesPerElement=u.accessor.BYTES_PER_ELEMENT*(l?2:1),a.stride=_d(a)}else if(i.value){this._checkExternalBuffer(i);var f=i.value;n.externalBuffer=null,n.constant=!1,this.value=f,a.bytesPerElement=f.BYTES_PER_ELEMENT,a.stride=_d(a);var p=this.buffer,h=this.byteOffset;this.doublePrecision&&f instanceof Float64Array&&(f=Zh(f,a));var d=f.byteLength+h+a.stride*2;p.byteLength<d&&p.reallocate(d),p.setAccessor(null),p.subData({data:f,offset:h}),a.type=i.type||p.accessor.type}return!0}},{key:"updateSubBuffer",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.state.bounds=null;var n=this.value,i=e.startOffset,a=i===void 0?0:i,o=e.endOffset;this.buffer.subData({data:this.doublePrecision&&n instanceof Float64Array?Zh(n,{size:this.size,startIndex:a,endIndex:o}):n.subarray(a,o),offset:a*n.BYTES_PER_ELEMENT+this.byteOffset})}},{key:"allocate",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=this.state,a=i.allocatedValue,o=xn.allocate(a,e+1,{size:this.size,type:this.settings.defaultType,copy:n});this.value=o;var s=this.buffer,u=this.byteOffset;return s.byteLength<o.byteLength+u&&(s.reallocate(o.byteLength+u),n&&a&&s.subData({data:a instanceof Float64Array?Zh(a,this):a,offset:u})),i.allocatedValue=o,i.constant=!1,i.externalBuffer=null,i.bufferAccessor=this.settings,!0}},{key:"_checkExternalBuffer",value:function(e){var n=e.value;if(!ArrayBuffer.isView(n))throw new Error("Attribute ".concat(this.id," value is not TypedArray"));var i=this.settings.defaultType,a=!1;if(this.doublePrecision&&(a=n.BYTES_PER_ELEMENT<4),a)throw new Error("Attribute ".concat(this.id," does not support ").concat(n.constructor.name));!(n instanceof i)&&this.settings.normalized&&!("normalized"in e)&&ne.warn("Attribute ".concat(this.id," is normalized"))()}},{key:"normalizeConstant",value:function(e){switch(this.settings.type){case 5120:return new Float32Array(e).map(function(n){return(n+128)/255*2-1});case 5122:return new Float32Array(e).map(function(n){return(n+32768)/65535*2-1});case 5121:return new Float32Array(e).map(function(n){return n/255});case 5123:return new Float32Array(e).map(function(n){return n/65535});default:return e}}},{key:"_normalizeValue",value:function(e,n,i){var a=this.settings,o=a.defaultValue,s=a.size;if(Number.isFinite(e))return n[i]=e,n;if(!e){for(var u=s;--u>=0;)n[i+u]=o[u];return n}switch(s){case 4:n[i+3]=Number.isFinite(e[3])?e[3]:o[3];case 3:n[i+2]=Number.isFinite(e[2])?e[2]:o[2];case 2:n[i+1]=Number.isFinite(e[1])?e[1]:o[1];case 1:n[i+0]=Number.isFinite(e[0])?e[0]:o[0];break;default:for(var l=s;--l>=0;)n[i+l]=Number.isFinite(e[l])?e[l]:o[l]}return n}},{key:"_areValuesEqual",value:function(e,n){if(!e||!n)return!1;for(var i=this.size,a=0;a<i;a++)if(e[a]!==n[a])return!1;return!0}}]),t}();var gI=[],yI=[];function Ot(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1/0,n=gI,i={index:-1,data:t,target:[]};return t?typeof t[Symbol.iterator]=="function"?n=t:t.length>0&&(yI.length=t.length,n=yI):n=gI,(r>0||Number.isFinite(e))&&(n=(Array.isArray(n)?n:Array.from(n)).slice(r,e),i.index=r-1),{iterable:n,objectInfo:i}}function bd(t){return t&&t[Symbol.asyncIterator]}function xd(t,r){var e=r.size,n=r.stride,i=r.offset,a=r.startIndices,o=r.nested,s=t.BYTES_PER_ELEMENT,u=n?n/s:e,l=i?
2107i/s:0,f=Math.floor((t.length-l)/u);return function(p,h){var d=h.index,v=h.target;if(!a){for(var m=d*u+l,g=0;g<e;g++)v[g]=t[m+g];return v}var y=a[d],_=a[d+1]||f,b;if(o){b=new Array(_-y);for(var x=y;x<_;x++){var w=x*u+l;v=new Array(e);for(var P=0;P<e;P++)v[P]=t[w+P];b[x-y]=v}}else if(u===e)b=t.subarray(y*e+l,_*e+l);else{b=new t.constructor((_-y)*e);for(var E=0,C=y;C<_;C++)for(var I=C*u+l,O=0;O<e;O++)b[E++]=t[I+O]}return b}}var _I=[],$f=[[0,1/0]];function bI(t,r){if(t===$f||(r[0]<0&&(r[0]=0),r[0]>=r[1]))return t;for(var e=[],n=t.length,i=0,a=0;a<n;a++){var o=t[a];o[1]<r[0]?(e.push(o),i=a+1):o[0]>r[1]?e.push(o):r=[Math.min(o[0],r[0]),Math.max(o[1],r[1])]}return e.splice(i,0,r),e}k();function fb(t){var r=t.source,e=t.target,n=t.start,i=n===void 0?0:n,a=t.size,o=t.getData,s=t.end||e.length,u=r.length,l=s-i;if(u>l){e.set(r.subarray(0,l),i);return}if(e.set(r,i),!!o)for(var f=u;f<l;)for(var p=o(f,r),h=0;h<a;h++)e[i+f]=p[h]||0,f++}function xI(t){var r=t.source,e=t.target,n=t.size,i=t.getData,a=t.sourceStartIndices,o=t.targetStartIndices;if(!Array.isArray(o))return fb({source:r,target:e,size:n,getData:i}),e;for(var s=0,u=0,l=i&&function(v,m){return i(v+u,m)},f=Math.min(a.length,o.length),p=1;p<f;p++){var h=a[p]*n,d=o[p]*n;fb({source:r.subarray(s,h),target:e,start:u,end:d,size:n,getData:l}),s=h,u=d}return u<e.length&&fb({source:[],target:e,start:u,size:n,getData:l}),e}function AI(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function Ad(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?AI(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):AI(Object(e)).forEac
2107h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var cK={interpolation:{duration:0,easing:function(r){return r}},spring:{stiffness:.05,damping:.5}};function Sd(t,r){if(!t)return null;Number.isFinite(t)&&(t={type:"interpolation",duration:t});var e=t.type||"interpolation";return Ad(Ad(Ad(Ad({},cK[e]),r),t),{},{type:e})}function Td(t,r){var e=r.getBuffer();return e?[e,{divisor:0,size:r.size,normalized:r.settings.normalized}]:r.value}function wd(t){switch(t){case 1:return"float";case 2:return"vec2";case 3:return"vec3";case 4:return"vec4";default:throw new Error('No defined attribute type for size "'.concat(t,'"'))}}function Pd(t){t.push(t.shift())}function Xf(t,r){var e=t.doublePrecision,n=t.settings,i=t.value,a=t.size,o=e&&i instanceof Float64Array?2:1;return(n.noAlloc?i.length:r*a)*o}function Od(t){var r=t.buffer,e=t.numInstances,n=t.attribute,i=t.fromLength,a=t.fromStartIndices,o=t.getData,s=o===void 0?function(x){return x}:o,u=n.doublePrecision&&n.value instanceof Float64Array?2:1,l=n.size*u,f=n.byteOffset,p=n.startIndices,h=a&&p,d=Xf(n,e),v=n.isConstant;if(!(!h&&i>=d)){var m=v?n.value:n.getBuffer().getData({srcByteOffset:f});if(n.settings.normalized&&!v){var g=s;s=function(w,P){return n.normalizeConstant(g(w,P))}}var y=v?function(x,w){return s(m,w)}:function(x,w){return s(m.subarray(x,x+l),w)},_=r.getData({length:i}),b=new Float32Array(d);xI({source:_,target:b,sourceStartIndices:a,targetStartIndices:p,size:l,getData:y}),r.byteLength<b.byteLength+f&&r.reallocate(b.byteLength+f),r.subData({data:b,offset:f})}}function Ed(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=pK(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2108In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function pK(t,r){if(t){if(typeof t=="string")return SI(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return SI(t,r)}}function SI(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function hK(t){var r=dK();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function dK(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var vu=function(t){L(e,t);var r=hK(e);function e(n,i){var a;return A(this,e),a=r.call(this,n,i,{startIndices:null,lastExternalBuffer:null,binaryValue:null,binaryAccessor:null,needsUpdate:!0,needsRedraw:!1,updateRanges:$f}),c(q(a),"constant",!1),a.settings.update=i.update||(i.accessor?a._autoUpdater:void 0),Object.seal(a.settings),Object.seal(a.state),a._validateAttributeUpdaters(),a}return T(e,[{key:"startIndices",get:function(){return this.state.startIndices},set:function(i){this.state.startIndices=i}},{key:"needsUpdate",value:function(){return this.state.needsUpdate}},{key:"needsRedraw",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=i.clearChangedFlags,o=a===void 0?!1:a,s=this.state.needsRedraw;return this.state.needsRedraw=s&&!o,s}},{key:"getUpdateTriggers",value:function(){var i=this.settings.accessor;return[this.id].concat(typeof i!="function"&&i||[])}},{key:"supportsTransition",value:function(){return Boolean(this.settings.transition)}},{key:"getTransitionSetting",value:function(i){if(!i||!this.supportsTransition())return null;var a=this.settings.accessor,o=this.settings.transition,s=Array.isArray(a)?i[a.find(function(u){return i[u]})]:i[a];return Sd(s,o)}},{key:"setNeedsUpdate",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.id,a=arguments.length>1?arguments[1]:void 0;if(this.state.needsUpdate=this.state.needsUpdate||i,this.setNeedsRedraw(i),a){var o=a.startRow,s=o===void 0?0:o,u=a.endRow,l=u===void 0?1/0:u;this.state.updateRanges=bI(this.state.updateRanges,[s,l])}else this.state.updateRanges=$f}},{key:"clearNeedsUpdate",value:function(){this.state.needsUpdate=!1,this.state.updateRanges=_I}},{key:"setNeedsRedraw",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.id;this.state.needsRedraw=this.state.needsRedraw||i}},{key:"allocate",value:function(i){var a=this.state,o=this.settings;return o.noAlloc?!1:o.update?(Z(S(e.prototype),"allocate",this).call(this,i,a.updateRanges!==$f),!0):!1}},{key:"updateBuffer",value:function(i){var a=i.numInstances,o=i.data,s=i.props,u=i.context;if(!this.needsUpdate())return!1;var l=this.state.updateRanges,f=this.settings,p=f.update,h=f.noAlloc,d=!0;if(p){var v=Ed(l),m;
2108try{for(v.s();!(m=v.n()).done;){var g=W(m.value,2),y=g[0],_=g[1];p.call(u,this,{data:o,startRow:y,endRow:_,props:s,numInstances:a})}}catch(O){v.e(O)}finally{v.f()}if(this.value)if(this.constant||this.buffer.byteLength<this.value.byteLength+this.byteOffset)this.setData({value:this.value,constant:this.constant}),this.constant=!1;else{var b=Ed(l),x;try{for(b.s();!(x=b.n()).done;){var w=W(x.value,2),P=w[0],E=w[1],C=Number.isFinite(P)?this.getVertexOffset(P):0,I=Number.isFinite(E)?this.getVertexOffset(E):h||!Number.isFinite(a)?this.value.length:a*this.size;Z(S(e.prototype),"updateSubBuffer",this).call(this,{startOffset:C,endOffset:I})}}catch(O){b.e(O)}finally{b.f()}}this._checkAttributeArray()}else d=!1;return this.clearNeedsUpdate(),this.setNeedsRedraw(),d}},{key:"setConstantValue",value:function(i){if(i===void 0||typeof i=="function")return!1;var a=this.setData({constant:!0,value:i});return a&&this.setNeedsRedraw(),this.clearNeedsUpdate(),!0}},{key:"setExternalBuffer",value:function(i){var a=this.state;return i?(this.clearNeedsUpdate(),a.lastExternalBuffer===i||(a.lastExternalBuffer=i,this.setNeedsRedraw(),this.setData(i)),!0):(a.lastExternalBuffer=null,!1)}},{key:"setBinaryValue",value:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,o=this.state,s=this.settings;if(!i)return o.binaryValue=null,o.binaryAccessor=null,!1;if(s.noAlloc)return!1;if(o.binaryValue===i)return this.clearNeedsUpdate(),!0;o.binaryValue=i,this.setNeedsRedraw();var u=s.transform||a!==this.startIndices;if(u){ArrayBuffer.isView(i)&&(i={value:i});var l=i;Je(ArrayBuffer.isView(l.value),"invalid ".concat(s.accessor));var f=Boolean(l.size)&&l.size!==this.size;return o.binaryAccessor=xd(l.value,{size:l.size||this.size,stride:l.stride,offset:l.offset,startIndices:a,nested:f}),!1}return this.clearNeedsUpdate(),this.setData(i),!0}},{key:"getVertexOffset",value:function(i){var a=this.startIndices,o=a?i<a.length?a[i]:this.numInstances:i;return o*this.size}},{key:"getShaderAttributes",value:function(){var i=this.settings.shaderAttributes||c({},this.id,null),a={};for(var o in i)Object.assign(a,Z(S(e.prototype),"getShaderAttributes",this).call(this,o,i[o]));return a}},{key:"_autoUpdater",value:function(i,a){var o=a.data,s=a.startRow,u=a.endRow,l=a.props,f=a.numInstances;if(!i.constant){var p=i.settings,h=i.state,d=i.value,v=i.size,m=i.startIndices,g=p.accessor,y=p.transform,_=h.binaryAccessor||(typeof g=="function"?g:l[g]);Je(typeof _=="function",'accessor "'.concat(g,'" is not a function'));var b=i.getVertexOffset(s),x=Ot(o,s,u),w=x.iterable,P=x.objectInfo,E=Ed(w),C;try{for(E.s();!(C=E.n()).done;){var I=C.value;P.index++;var O=_(I,P);if(y&&(O=y.call(this,O)),m){var D=(P.index<m.length-1?m[P.index+1]:f)-m[P.index];if(O&&Array.isArray(O[0])){var N=b,H=Ed(O),$;try{for(H.s();!($=H.n()).done;){var ee=$.value;i._normalizeValue(ee,d,N),N+=v}}catch(V){H.e(V)}finally{H.f()}}else O&&O.length>v?d.set(O,b):(i._normalizeValue(O,P.target,0),od({target:d,source:P.target,start:b,count:D}));b+=D*v}else i._normalizeValue(O,d,b),b+=v}}catch(V){E.e(V)}finally{E.f()}}}},{key:"_validateAttributeUpdaters",value:function(){var i=this.settings,a=i.noAlloc||typeof i.update=="function";if(!a)throw new Error("Attribute ".concat(this.id," missing update or accessor"))}},{key:"_checkAttributeArray",value:function(){var i=this.value,a=Math.min(4,this.size);if(i&&i.length>=a){var o=!0;switch(a){case 4:o=o&&Number.isFinite(i[3]);case 3:o=o&&Number.isFinite(i[2]);case 2:o=o&&Number.isFinite(i[1]);case 1:o=o&&Number.isFinite(i[0]);break;default:o=!1}if(!o)throw new Error("Illegal attribute generated for ".concat(this.id))}}}]),e}(mI);F();j();k();F();j();k();function TI(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function vK(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?TI(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):TI(Object(e)).forEac
2108h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function wI(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=mK(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2109In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function mK(t,r){if(t){if(typeof t=="string")return PI(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return PI(t,r)}}function PI(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var OI=function(){function t(r){var e=r.gl,n=r.attribute,i=r.timeline;A(this,t),c(this,"gl",void 0),c(this,"type","interpolation"),c(this,"attributeInTransition",void 0),c(this,"settings",void 0),c(this,"attribute",void 0),c(this,"transition",void 0),c(this,"currentStartIndices",void 0),c(this,"currentLength",void 0),c(this,"transform",void 0),c(this,"buffers",void 0),this.gl=e,this.transition=new $n(i),this.attribute=n,this.attributeInTransition=new vu(e,n.settings),this.currentStartIndices=n.startIndices,this.currentLength=0,this.transform=yK(e,n);var a={byteLength:0,usage:35050};this.buffers=[new Pe(e,a),new Pe(e,a)]}return T(t,[{key:"inProgress",get:function(){return this.transition.inProgress}},{key:"start",value:function(e,n){if(e.duration<=0){this.transition.cancel();return}this.settings=e;var i=this.gl,a=this.buffers,o=this.attribute;Pd(a);var s={numInstances:n,attribute:o,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:e.enter},u=wI(a),l;try{for(u.s();!(l=u.n()).done;){var f=l.value;Od(vK({buffer:f},s))}}catch(p){u.e(p)}finally{u.f()}this.currentStartIndices=o.startIndices,this.currentLength=Xf(o,n),this.attributeInTransition.setData({buffer:a[1],value:o.value}),this.transition.start(e),this.transform.update({elementCount:Math.floor(this.currentLength/o.size),sourceBuffers:{aFrom:a[0],aTo:Td(i,o)},feedbackBuffers:{vCurrent:a[1]}})}},{key:"update",value:function(){var e=this.transition.update();if(e){var n=this.settings,i=n.duration,a=n.easing,o=this.transition.time,s=o/i;a&&(s=a(s)),this.transform.run({uniforms:{time:s}})}return e}},{key:"cancel",value:function(){this.transition.cancel(),this.transform.delete();var e=wI(this.buffers),n;try{for(e.s();!(n=e.n()).done;){var i=n.value;i.delete()}}catch(a){e.e(a)}finally{e.f()}this.buffers.length=0}}]),t}();var gK=`
2110#define SHADER_NAME interpolation-transition-vertex-shader
2111
2112uniform float time;
2113attribute ATTRIBUTE_TYPE aFrom;
2114attribute ATTRIBUTE_TYPE aTo;
2115varying ATTRIBUTE_TYPE vCurrent;
2116
2117void main(void) {
2118  vCurrent = mix(aFrom, aTo, time);
2119  gl_Position = vec4(0.0);
2120}
2121`;function yK(t,r){var e=wd(r.size);return new mr(t,{vs:gK,defines:{ATTRIBUTE_TYPE:e},varyings:["vCurrent"]})}F();j();k();function EI(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=_K(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2122In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function _K(t,r){if(t){if(typeof t=="string")return CI(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);
2122if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return CI(t,r)}}function CI(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function MI(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function qf(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?MI(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):MI(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var II=function(){function t(r){var e=r.gl,n=r.attribute,i=r.timeline;A(this,t),c(this,"gl",void 0),c(this,"type","spring"),c(this,"attributeInTransition",void 0),c(this,"settings",void 0),c(this,"attribute",void 0),c(this,"transition",void 0),c(this,"currentStartIndices",void 0),c(this,"currentLength",void 0),c(this,"texture",void 0),c(this,"framebuffer",void 0),c(this,"transform",void 0),c(this,"buffers",void 0),this.gl=e,this.type="spring",this.transition=new $n(i),this.attribute=n,this.attributeInTransition=new vu(e,qf(qf({},n.settings),{},{normalized:!1})),this.currentStartIndices=n.startIndices,this.currentLength=0,this.texture=xK(e),this.framebuffer=AK(e,this.texture),this.transform=bK(e,n,this.framebuffer);var a={byteLength:0,usage:35050};this.buffers=[new Pe(e,a),new Pe(e,a),new Pe(e,a)]}return T(t,[{key:"inProgress",get:function(){return this.transition.inProgress}},{key:"start",value:function(e,n){var i=this.gl,a=this.buffers,o=this.attribute,s={numInstances:n,attribute:o,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:e.enter},u=EI(a),l;try{for(u.s();!(l=u.n()).done;){var f=l.value;Od(qf({buffer:f},s))}}catch(p){u.e(p)}finally{u.f()}this.settings=e,this.currentStartIndices=o.startIndices,this.currentLength=Xf(o,n),this.attributeInTransition.setData({buffer:a[1],value:o.value}),this.transition.start(qf(qf({},e),{},{duration:1/0})),this.transform.update({elementCount:Math.floor(this.currentLength/o.size),sourceBuffers:{aTo:Td(i,o)}})}},{key:"update",value:function(){var e=this.buffers,n=this.transform,i=this.framebuffer,a=this.transition,o=a.update();if(!o)return!1;var s=this.settings;n.update({sourceBuffers:{aPrev:e[0],aCur:e[1]},feedbackBuffers:{vNext:e[2]}}),n.run({framebuffer:i,discard:!1,clearRenderTarget:!0,uniforms:{stiffness:s.stiffness,damping:s.damping},parameters:{depthTest:!1,blend:!0,viewport:[0,0,1,1],blendFunc:[1,1],blendEquation:[32776,32776]}}),Pd(e),this.attributeInTransition.setData({buffer:e[1],value:this.attribute.value});var u=gn(i)[0]>0;return u||a.end(),!0}},{key:"cancel",value:function(){this.transition.cancel(),this.transform.delete();var e=EI(this.buffers),n;try{for(e.s();!(n=e.n()).done;){var i=n.value;i.delete()}}catch(a){e.e(a)}finally{e.f()}this.buffers.length=0,this.texture.delete(),this.framebuffer.delete()}}]),t}();function bK(t,r,e){var n=wd(r.size);return new mr(t,{framebuffer:e,vs:`
2123#define SHADER_NAME spring-transition-vertex-shader
2124
2125#define EPSILON 0.00001
2126
2127uniform float stiffness;
2128uniform float damping;
2129attribute ATTRIBUTE_TYPE aPrev;
2130attribute ATTRIBUTE_TYPE aCur;
2131attribute ATTRIBUTE_TYPE aTo;
2132varying ATTRIBUTE_TYPE vNext;
2133varying float vIsTransitioningFlag;
2134
2135ATTRIBUTE_TYPE getNextValue(ATTRIBUTE_TYPE cur, ATTRIBUTE_TYPE prev, ATTRIBUTE_TYPE dest) {
2136  ATTRIBUTE_TYPE velocity = cur - prev;
2137  ATTRIBUTE_TYPE delta = dest - cur;
2138  ATTRIBUTE_TYPE spring = delta * stiffness;
2139  ATTRIBUTE_TYPE damper = velocity * -1.0 * damping;
2140  return spring + damper + velocity + cur;
2141}
2142
2143void main(void) {
2144  bool isTransitioning = length(aCur - aPrev) > EPSILON || length(aTo - aCur) > EPSILON;
2145  vIsTransitioningFlag = isTransitioning ? 1.0 : 0.0;
2146
2147  vNext = getNextValue(aCur, aPrev, aTo);
2148  gl_Position = vec4(0, 0, 0, 1);
2149  gl_PointSize = 100.0;
2150}
2151`,fs:`
2152#define SHADER_NAME spring-transition-is-transitioning-fragment-shader
2153
2154varying float vIsTransitioningFlag;
2155
2156void main(void) {
2157  if (vIsTransitioningFlag == 0.0) {
2158    discard;
2159  }
2160  gl_FragColor = vec4(1.0);
2161}`,defines:{ATTRIBUTE_TYPE:n},varyings:["vNext"]})}function xK(t){return new Ce(t,{data:new Uint8Array(4),format:6408,type:5121,border:0,mipmaps:!1,dataFormat:6408,width:1,height:1})}function AK(t,r){return new Le(t,{id:"spring-transition-is-transitioning-framebuffer",width:1,height:1,attachments:c({},36064,r)})}var SK={interpolation:OI,spring:II},RI=function(){function t(r,e){var n=e.id,i=e.timeline;A(this,t),c(this,"id",void 0),c(this,"isSupported",void 0),c(this,"gl",void 0),c(this,"timeline",void 0),c(this,"transitions",void 0),c(this,"needsRedraw",void 0),c(this,"numInstances",void 0),this.id=n,this.gl=r,this.timeline=i,this.transitions={},this.needsRedraw=!1,this.numInstances=1,this.isSupported=mr.isSupported(r)}return T(t,[{key:"finalize",value:function(){for(var e in this.transitions)this._removeTransition(e)}},{key:"update",value:function(e){var n=e.attributes,i=e.transitions,a=e.numInstances;this.numInstances=a||1;for(var o in n){var s=n[o],u=s.getTransitionSetting(i);u&&this._updateAttribute(o,s,u)}for(var l in this.transitions){var f=n[l];(!f||!f.getTransitionSetting(i))&&this._removeTransition(l)}}},{key:"hasAttribute",value:function(e){var n=this.transitions[e];return n&&n.inProgress}},{key:"getAttributes",value:function(){var e={};for(var n in this.transitions){var i=this.transitions[n];i.inProgress&&(e[n]=i.attributeInTransition)}return e}},{key:"run",value:function(){if(!this.isSupported||this.numInstances===0)return!1;for(var e in this.transitions){var n=this.transitions[e].update();n&&(this.needsRedraw=!0)}var i=this.needsRedraw;return this.needsRedraw=!1,i}},{key:"_removeTransition",value:function(e){this.transitions[e].cancel(),delete this.transitions[e]}},{key:"_updateAttribute",value:function(e,n,i){var a=this.transitions[e],o=!a||a.type!==i.type;if(o){if(!this.isSupported){ne.warn("WebGL2 not supported by this browser. Transition for ".concat(e," is disabled."))();return}a&&this._removeTransition(e);var s=SK[i.type];s?this.transitions[e]=new s({attribute:n,timeline:this.timeline,gl:this.gl}):(ne.error("unsupported transition type '".concat(i.type,"'"))(),o=!1)}(o||n.needsRedraw())&&(this.needsRedraw=!0,this.transitions[e].start(i,this.numInstances))}}]),t}();function LI(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function cb(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};
2161r%2?LI(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):LI(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function TK(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=wK(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2162In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function wK(t,r){if(t){if(typeof t=="string")return kI(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return kI(t,r)}}function kI(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var BI="attributeManager.invalidate",PK="attributeManager.updateStart",OK="attributeManager.updateEnd",EK="attribute.updateStart",CK="attribute.allocate",MK="attribute.updateEnd",Sa=function(){function t(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.id,i=n===void 0?"attribute-manager":n,a=e.stats,o=e.timeline;A(this,t),c(this,"id",void 0),c(this,"gl",void 0),c(this,"attributes",void 0),c(this,"updateTriggers",void 0),c(this,"needsRedraw",void 0),c(this,"userData",void 0),c(this,"stats",void 0),c(this,"attributeTransitionManager",void 0),c(this,"mergeBoundsMemoized",xr(wM)),this.id=i,this.gl=r,this.attributes={},this.updateTriggers={},this.needsRedraw=!0,this.userData={},this.stats=a,this.attributeTransitionManager=new RI(r,{id:"".concat(i,"-transitions"),timeline:o}),Object.seal(this)}return T(t,[{key:"finalize",value:function(){for(var e in this.attributes)this.attributes[e].delete();this.attributeTransitionManager.finalize()}},{key:"getNeedsRedraw",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{clearRedrawFlags:!1},n=this.needsRedraw;return this.needsRedraw=this.needsRedraw&&!e.clearRedrawFlags,n&&this.id}},{key:"setNeedsRedraw",value:function(){this.needsRedraw=!0}},{key:"add",value:function(e){this._add(e)}},{key:"addInstanced",value:function(e){this._add(e,{instanced:1})}},{key:"remove",value:function(e){var n=TK(e),i;try{for(n.s();!(i=n.n()).done;){var a=i.value;this.attributes[a]!==void 0&&(this.attributes[a].delete(),delete this.attributes[a])}}catch(o){n.e(o)}finally{n.f()}}},{key:"invalidate",value:function(e,n){var i=this._invalidateTrigger(e,n);wt(BI,this,e,i)}},{key:"invalidateAll",value:function(e){for(var n in this.attributes)this.attributes[n].setNeedsUpdate(n,e);wt(BI,this,"all")}},{key:"update",value:function(e){var n=e.data,i=e.numInstances,a=e.startIndices,o=a===void 0?null:a,s=e.transitions,u=e.props,l=u===void 0?{}:u,f=e.buffers,p=f===void 0?{}:f,h=e.context,d=h===void 0?{}:h,v=!1;wt(PK,this),this.stats&&this.stats.get("Update Attributes").timeStart();for(var m in this.attributes){var g=this.attributes[m],y=g.settings.accessor;g.startIndices=o,g.numInstances=i,l[m]&&ne.removed("props.".concat(m),"data.attributes.".concat(m))(),g.setExternalBuffer(p[m])||g.setBinaryValue(typeof y=="string"?p[y]:void 0,n.startIndices)||typeof y=="string"&&!p[y]&&g.setConstantValue(l[y])||g.needsUpdate()&&(v=!0,this._updateAttribute({attribute:g,numInstances:i,data:n,props:l,context:d})),this.needsRedraw=this.needsRedraw||g.needsRedraw()}v&&wt(OK,this,i),this.stats&&this.stats.get("Update Attributes").timeEnd(),this.attributeTransitionManager.update({attributes:this.attributes,numInstances:i,transitions:s})}},{key:"updateTransition",value:function(){var e=this.attributeTransitionManager,n=e.run();return this.needsRedraw=this.needsRedraw||n,n}},{key:"getAttributes",value:function(){return this.attributes}},{key:"getBounds",value:function(e){var n=this,i=e.map(function(a){var o;return(o=n.attributes[a])===null||o===void 0?void 0:o.getBounds()});return this.mergeBoundsMemoized(i)}},{key:"getChangedAttributes",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{clearChangedFlags:!1},n=this.attributes,i=this.attributeTransitionManager,a=cb({},i.getAttributes());for(var o in n){var s=n[o];s.needsRedraw(e)&&!i.hasAttribute(o)&&(a[o]=s)}return a}},{key:"getShaderAttributes",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};e||(e=this.getAttributes());var i={};for(var a in e)n[a]||Object.assign(i,e[a].getShaderAttributes());return i}},{key:"_add",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};for(var i in e){var a=e[i];this.attributes[i]=this._createAttribute(i,a,n)}this._mapUpdateTriggersToAttributes()}},{key:"_createAttribute",value:function(e,n,i){var a=cb(cb({},n),{},{id:e,size:n.isIndexed&&1||n.size||1,divisor:i.instanced?1:n.divisor||0});return new vu(this.gl,a)}},{key:"_mapUpdateTriggersToAttributes",value:function(){var e=this,n={},i=function(s){var u=e.attributes[s];
2162u.getUpdateTriggers().forEach(function(l){n[l]||(n[l]=[]),n[l].push(s)})};for(var a in this.attributes)i(a);this.updateTriggers=n}},{key:"_invalidateTrigger",value:function(e,n){var i=this.attributes,a=this.updateTriggers,o=a[e];return o&&o.forEach(function(s){var u=i[s];u&&u.setNeedsUpdate(u.id,n)}),o}},{key:"_updateAttribute",value:function(e){var n=e.attribute,i=e.numInstances;if(wt(EK,n),n.constant){n.setConstantValue(n.value);return}n.allocate(i)&&wt(CK,n,i);var a=n.updateBuffer(e);a&&(this.needsRedraw=!0,wt(MK,n,i))}}]),t}();be();F();j();k();be();k();F();j();F();j();function IK(t){var r=RK();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function RK(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var FI=function(t){L(e,t);var r=IK(e);function e(){return A(this,e),r.apply(this,arguments)}return T(e,[{key:"value",get:function(){return this._value}},{key:"_onUpdate",value:function(){var i=this.time,a=this.settings,o=a.fromValue,s=a.toValue,u=a.duration,l=a.easing,f=l(i/u);this._value=Gt(o,s,f)}}]),e}($n);F();j();function LK(t){var r=kK();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function kK(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var DI=1e-5;function NI(t,r,e,n,i){var a=r-t,o=e-r,s=o*i,u=-a*n;return s+u+a+r}function BK(t,r,e,n,i){if(Array.isArray(e)){for(var a=[],o=0;o<e.length;o++)a[o]=NI(t[o],r[o],e[o],n,i);return a}return NI(t,r,e,n,i)}function jI(t,r){if(Array.isArray(t)){for(var e=0,n=0;n<t.length;n++){var i=t[n]-r[n];e+=i*i}return Math.sqrt(e)}return Math.abs(t-r)}var UI=function(t){L(e,t);var r=LK(e);function e(){return A(this,e),r.apply(this,arguments)}return T(e,[{key:"value",get:function(){return this._currValue}},{key:"_onUpdate",value:function(){var i=this.settings,a=i.fromValue,o=i.toValue,s=i.damping,u=i.stiffness,l=this._prevValue,f=l===void 0?a:l,p=this._currValue,h=p===void 0?a:p,d=BK(f,h,o,s,u),v=jI(d,o),m=jI(d,h);v<DI&&m<DI&&(d=o,this.end()),this._prevValue=h,this._currValue=d}}]),e}($n);function GI(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=FK(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2163In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function FK(t,r){if(t){if(typeof t=="string")return zI(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return zI(t,r)}}function zI(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function VI(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function HI(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?VI(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):VI(Object(e)).forEac
2163h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var DK={interpolation:FI,spring:UI},WI=function(){function t(r){A(this,t),this.transitions=new Map,this.timeline=r}return T(t,[{key:"active",get:function(){return this.transitions.size>0}},{key:"add",value:function(e,n,i,a){var o=this.transitions;if(o.has(e)){var s=o.get(e),u=s.value,l=u===void 0?s.settings.fromValue:u;n=l,this.remove(e)}if(a=Sd(a),!!a){var f=DK[a.type];if(!f){ne.error("unsupported transition type '".concat(a.type,"'"))();return}var p=new f(this.timeline);p.start(HI(HI({},a),{},{fromValue:n,toValue:i})),o.set(e,p)}}},{key:"remove",value:function(e){var n=this.transitions;n.has(e)&&(n.get(e).cancel(),n.delete(e))}},{key:"update",value:function(){var e={},n=GI(this.transitions),i;try{for(n.s();!(i=n.n()).done;){var a=W(i.value,2),o=a[0],s=a[1];s.update(),e[o]=s.value,s.inProgress||this.remove(o)}}catch(u){n.e(u)}finally{n.f()}return e}},{key:"clear",value:function(){var e=GI(this.transitions.keys()),n;try{for(e.s();!(n=e.n()).done;){var i=n.value;this.remove(i)}}catch(a){e.e(a)}finally{e.f()}}}]),t}();Ge();function XI(t){var r=t[Jr];for(var e in r){var n=r[e],i=n.validate;if(i&&!i(t[e],n))throw new Error("Invalid prop ".concat(e,": ").concat(t[e]))}}function qI(t,r){var e=mu({newProps:t,oldProps:r,propTypes:t[Jr],ignoreProps:{data:null,updateTriggers:null,extensions:null,transitions:null}}),n=jK(t,r),i=!1;return n||(i=UK(t,r)),{dataChanged:n,propsChanged:e,updateTriggersChanged:i,extensionsChanged:GK(t,r),transitionsChanged:NK(t,r)}}function NK(t,r){if(!t.transitions)return!1;var e={},n=t[Jr],i=!1;for(var a in t.transitions){var o=n[a],s=o&&o.type,u=s==="number"||s==="color"||s==="array";u&&pb(t[a],r[a],o)&&(e[a]=!0,i=!0)}return i?e:!1}function mu(t){var r=t.newProps,e=t.oldProps,n=t.ignoreProps,i=n===void 0?{}:n,a=t.propTypes,o=a===void 0?{}:a,s=t.triggerName,u=s===void 0?"props":s;if(e===r)return!1;if(ue(r)!=="object"||r===null||ue(e)!=="object"||e===null)return"".concat(u," changed shallowly");for(var l=0,f=Object.keys(r);l<f.length;l++){var p=f[l];if(!(p in i)){if(!(p in e))return"".concat(u,".").concat(p," added");var h=pb(r[p],e[p],o[p]);if(h)return"".concat(u,".").concat(p," ").concat(h)}}for(var d=0,v=Object.keys(e);d<v.length;d++){var m=v[d];if(!(m in i)){if(!(m in r))return"".concat(u,".").concat(m," dropped");if(!Object.hasOwnProperty.call(r,m)){var g=pb(r[m],e[m],o[m]);if(g)return"".concat(u,".").concat(m," ").concat(g)}}}return!1}function pb(t,r,e){var n=e&&e.equal;return n&&!n(t,r,e)||!n&&(n=t&&r&&t.equals,n&&!n.call(t,r))?"changed deeply":!n&&r!==t?"changed shallowly":null}function jK(t,r){if(r===null)return"oldProps is null, initial diff";var e=!1,n=t.dataComparator,i=t._dataDiff;return n?n(t.data,r.data)||(e="Data comparator detected a change"):t.data!==r.data&&(e="A new data container was supplied"),e&&i&&(e=i(t.data,r.data)||e),e}function UK(t,r){if(r===null)return{all:!0};if("all"in t.updateTriggers){var e=$I(t,r,"all");if(e)return{all:!0}}var n={},i=!1;for(var a in t.updateTriggers)if(a!=="all"){var o=$I(t,r,a);o&&(n[a]=!0,i=!0)}return i?n:!1}function GK(t,r){if(r===null)return!0;var e=r.extensions,n=t.extensions;if(n===e)return!1;if(!e||!n||n.length!==e.length)return!0;for(var i=0;i<n.length;i++)if(!n[i].equals(e[i]))return!0;return!1}function $I(t,r,e){var n=t.updateTriggers[e];n=n??{};var i=r.updateTriggers[e];i=i??{};var a=mu({oldProps:i,newProps:n,triggerName:e});return a}Ge();var zK="count(): argument not an object",VK="count(): argument not a container";function Cd(t){if(!WK(t))throw new Error(zK);if(typeof t.count=="function")return t.count();if(Number.isFinite(t.size))return t.size;if(Number.isFinite(t.length))return t.length;if(HK(t))return Object.keys(t).length;throw new Error(VK)}function HK(t){return t!==null&&ue(t)==="object"&&t.constructor===Object}function WK(t){return t!==null&&ue(t)==="object"}k();function YI(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function Yf(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};
2163r%2?YI(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):YI(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function Ci(t,r){if(!r)return t;var e=Yf(Yf({},t),r);if("defines"in r&&(e.defines=Yf(Yf({},t.defines),r.defines)),"modules"in r&&(e.modules=(t.modules||[]).concat(r.modules),r.modules.some(function(o){return o.name==="project64"}))){var n=e.modules.findIndex(function(o){return o.name==="project32"});n>=0&&e.modules.splice(n,1)}if("inject"in r)if(!t.inject)e.inject=r.inject;else{var i=Yf({},t.inject);for(var a in r.inject)i[a]=(i[a]||"")+r.inject[a];e.inject=i}return e}F();j();k();Ge();be();k();k();var gu;function KI(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function Kf(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?KI(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):KI(Object(e)).forEac
2163h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var $K=(gu={},c(gu,10241,9987),c(gu,10240,9729),c(gu,10242,33071),c(gu,10243,33071),gu),hb={};function ZI(t,r,e,n){if(e instanceof Ce)return e;e.constructor&&e.constructor.name!=="Object"&&(e={data:e});var i=null;e.compressed&&(i=c({},10241,e.data.length>1?9985:9729));var a=new Ce(r,Kf(Kf({},e),{},{parameters:Kf(Kf(Kf({},$K),i),n)}));return hb[a.id]=t,a}function JI(t,r){!r||!(r instanceof Ce)||hb[r.id]===t&&(r.delete(),delete hb[r.id])}function QI(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function Jf(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?QI(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):QI(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var XK={boolean:{validate:function(r,e){return!0},equal:function(r,e,n){return Boolean(r)===Boolean(e)}},number:{validate:function(r,e){return Number.isFinite(r)&&(!("max"in e)||r<=e.max)&&(!("min"in e)||r>=e.min)}},color:{validate:function(r,e){return e.optional&&!r||db(r)&&(r.length===3||r.length===4)},equal:function(r,e,n){return xt(r,e,1)}},accessor:{validate:function(r,e){var n=Md(r);return n==="function"||n===Md(e.value)},equal:function(r,e,n){return typeof e=="function"?!0:xt(r,e,1)}},array:{validate:function(r,e){return e.optional&&!r||db(r)},equal:function(r,e,n){var i=n.compare,a=Number.isInteger(i)?i:i?1:0;return i?xt(r,e,a):r===e}},object:{equal:function(r,e,n){if(n.ignore)return!0;var i=n.compare,a=Number.isInteger(i)?i:i?1:0;return i?xt(r,e,a):r===e}},function:{validate:function(r,e){return e.optional&&!r||typeof r=="function"},equal:function(r,e,n){var i=!n.compare&&n.ignore!==!1;return i||r===e}},data:{transform:function(r,e,n){var i=n.props.dataTransform;return i&&r?i(r):r}},image:{transform:function(r,e,n){var i=n.context;return!i||!i.gl?null:ZI(n.id,i.gl,r,Jf(Jf({},e.parameters),n.props.textureParameters))},release:function(r,e,n){JI(n.id,r)}}};function eR(t){for(var r={},e={},n={},i=0,a=Object.entries(t);i<a.length;i++){var o=W(a[i],2),s=o[0],u=o[1],l=u?.deprecatedFor;if(l)n[s]=Array.isArray(l)?l:[l];else{var f=qK(s,u);r[s]=f,e[s]=f.value}}return{propTypes:r,defaultProps:e,deprecatedProps:n}}function qK(t,r){switch(Md(r)){case"object":return Zf(t,r);case"array":return Zf(t,{type:"array",value:r,compare:!1});case"boolean":return Zf(t,{type:"boolean",value:r});case"number":return Zf(t,{type:"number",value:r});case"function":return Zf(t,{type:"function",value:r,compare:!0});default:return{name:t,type:"unknown",value:r}}}function Zf(t,r){return"type"in r?Jf(Jf({name:t},XK[r.type]),r):"value"in r?Jf({name:t,type:Md(r.value)},r):{name:t,type:"object",value:r}}function db(t){return Array.isArray(t)||ArrayBuffer.isView(t)}function Md(t){return db(t)?"array":t===null?"null":ue(t)}function mb(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=YK(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2164In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function YK(t,r){if(t){if(typeof t=="string")return tR(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return tR(t,r)}}function tR(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function rR(t,r){for(var e,n=r.length-1;n>=0;n--){var i=r[n];"extensions"in i&&(e=i.extensions)}var a=vb(t.constructor,e),o=Object.create(a);o[lu]=t,o[Wn]={},o[Sn]={};for(var s=0;s<r.length;++s){var u=r[s];for(var l in u)o[l]=u[l]}return Object.freeze(o),o}var KK="_mergedDefaultProps";function vb(t,r){var e=KK;if(r){var n=mb(r),i;try{for(n.s();!(i=n.n()).done;){var a=i.value,o=a.constructor;o&&(e+=":".concat(o.extensionName||o.name))}}catch(u){n.e(u)}finally{n.f()}}var s=nR(t,e);return s||(t[e]=ZK(t,r||[]))}function ZK(t,r){var e=t.prototype;if(!e)return null;var n=Object.getPrototypeOf(t),i=vb(n),a=nR(t,"defaultProps")||{},o=eR(a),s=Object.assign(Object.create(null),i,o.defaultProps),u=Object.assign(Object.create(null),i?.[Jr],o.propTypes),l=Object.assign(Object.create(null),i?.[ad],o.deprecatedProps),f=mb(r),p;try{for(f.s();!(p=f.n()).done;){var h=p.value,d=vb(h.constructor);d&&(Object.assign(s,d),Object.assign(u,d[Jr]),Object.assign(l,d[ad]))}}catch(v){f.e(v)}finally{f.f()}return JK(s,t),eZ(s,u),QK(s,l),s[Jr]=u,s[ad]=l,r.length===0&&!gb(t,"_propTypes")&&(t._propTypes=u),s}function JK(t,r){var e=rZ(r);Object.defineProperties(t,{id:{writable:!0,value:e}})}function QK(t,r){var e=function(a){Object.defineProperty(t,a,{enumerable:!1,set:function(s){var u="".concat(this.id,": ").concat(a),l=mb(r[a]),f;try{for(l.s();!(f=l.n()).done;){var p=f.value;gb(this,p)||(this[p]=s)}}catch(h){l.e(h)}finally{l.f()}ne.deprecated(u,r[a].join("/"))()}})};for(var n in r)e(n)}function eZ(t,r){var e={},n={};for(var i in r){var a=r[i],o=a.name,s=a.value;a.async&&(e[o]=s,n[o]=tZ(o))}t[Ti]=e,t[Wn]={},Object.defineProperties(t,n)}function tZ(t){return{enumerable:!0,set:function(e){typeof e=="string"||e instanceof Promise||bd(e)?this[Wn][t]=e:this[Sn][t]=e}
2164,get:function(){if(this[Sn]){if(t in this[Sn]){var e=this[Sn][t];return e||this[Ti][t]}if(t in this[Wn]){var n=this[lu]&&this[lu].internalState;if(n&&n.hasAsyncProp(t))return n.getAsyncProp(t)||this[Ti][t]}}return this[Ti][t]}}}function gb(t,r){return Object.prototype.hasOwnProperty.call(t,r)}function nR(t,r){return gb(t,r)&&t[r]}function rZ(t){var r=t.componentName;return r||ne.warn("".concat(t.name,".componentName not specified"))(),r||t.name}function iR(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function yb(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?iR(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):iR(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var nZ=0,Id=function(){function t(){A(this,t),c(this,"id",void 0),c(this,"props",void 0),c(this,"count",void 0);for(var r=arguments.length,e=new Array(r),n=0;n<r;n++)e[n]=arguments[n];this.props=rR(this,e),this.id=this.props.id,this.count=nZ++}return T(t,[{key:"clone",value:function(e){var n=this.props,i={};for(var a in n[Ti])a in n[Sn]?i[a]=n[Sn][a]:a in n[Wn]&&(i[a]=n[Wn][a]);return new this.constructor(yb(yb(yb({},n),i),e))}}]),t}();c(Id,"componentName","Component");c(Id,"defaultProps",{});F();j();k();F();j();k();var _b=me(Ae());var iZ=Object.freeze({}),aR=function(){function t(r){A(this,t),c(this,"component",void 0),c(this,"onAsyncPropUpdated",void 0),c(this,"asyncProps",void 0),c(this,"oldProps",void 0),c(this,"oldAsyncProps",void 0),this.component=r,this.asyncProps={},this.onAsyncPropUpdated=function(){},this.oldProps=null,this.oldAsyncProps=null}return T(t,[{key:"finalize",value:function(){for(var e in this.asyncProps){var n=this.asyncProps[e];n&&n.type&&n.type.release&&n.type.release(n.resolvedValue,n.type,this.component)}this.asyncProps={},this.component=null,this.resetOldProps()}},{key:"getOldProps",value:function(){return this.oldAsyncProps||this.oldProps||iZ}},{key:"resetOldProps",value:function(){this.oldAsyncProps=null,this.oldProps=this.component?this.component.props:null}},{key:"hasAsyncProp",value:function(e){return e in this.asyncProps}},{key:"getAsyncProp",value:function(e){var n=this.asyncProps[e];return n&&n.resolvedValue}},{key:"isAsyncPropLoading",value:function(e){if(e){var n=this.asyncProps[e];return Boolean(n&&n.pendingLoadCount>0&&n.pendingLoadCount!==n.resolvedLoadCount)}for(var i in this.asyncProps)if(this.isAsyncPropLoading(i))return!0;return!1}},{key:"reloadAsyncProp",value:function(e,n){this._watchPromise(e,Promise.resolve(n))}},{key:"setAsyncProps",value:function(e){this.component=e[lu]||this.component;var n=e[Sn]||{},i=e[Wn]||e,a=e[Ti]||{};for(var o in n){var s=n[o];this._createAsyncPropData(o,a[o]),this._updateAsyncProp(o,s),n[o]=this.getAsyncProp(o)}for(var u in i){var l=i[u];this._createAsyncPropData(u,a[u]),this._updateAsyncProp(u,l)}}},{key:"_fetch",value:function(e,n){return null}},{key:"_onResolve",value:function(e,n){}},{key:"_onError",value:function(e,n){}},{key:"_updateAsyncProp",value:function(e,n){if(this._didAsyncInputValueChange(e,n)){if(typeof n=="string"&&(n=this._fetch(e,n)),n instanceof Promise){this._watchPromise(e,n);return}if(bd(n)){this._resolveAsyncIterable(e,n);return}this._setPropValue(e,n)}}},{key:"_freezeAsyncOldProps",value:function(){if(!this.oldAsyncProps&&this.oldProps){this.oldAsyncProps=Object.create(this.oldProps);for(var e in this.asyncProps)Object.defineProperty(this.oldAsyncProps,e,{enumerable:!0,value:this.oldProps[e]})}}},{key:"_didAsyncInputValueChange",value:function(e,n){var i=this.asyncProps[e];return n===i.resolvedValue||n===i.lastValue?!1:(i.lastValue=n,!0)}},{key:"_setPropValue",value:function(e,n){this._freezeAsyncOldProps();var i=this.asyncProps[e];i&&(n=this._postProcessValue(i,n),i.resolvedValue=n,i.pendingLoadCount++,i.resolvedLoadCount=i.pendingLoadCount)}},{key:"_setAsyncPropValue",value:function(e,n,i){var a=this.asyncProps[e];a&&i>=a.resolvedLoadCount&&n!==void 0&&(this._freezeAsyncOldProps(),a.resolvedValue=n,a.resolvedLoadCount=i,this.onAsyncPropUpdated(e,n))}},{key:"_watchPromise",value:function(e,n){var i=this,a=this.asyncProps[e];if(a){a.pendingLoadCount++;var o=a.pendingLoadCount;n.then(function(s){i.component&&(s=i._postProcessValue(a,s),i._setAsyncPropValue(e,s,o),i._onResolve(e,s))}).catch(function(s){i._onError(e,s)})}}},{key:"_resolveAsyncIterable",value:function(){var r=Y(_b.default.mark(function n(i,a){var o,s,u,l,f,p,h,d,v,m,g;return _b.default.wrap(function(_){for(;;)switch(_.prev=_.next){case 0:if(i==="data"){_.next=3;break}return this._setPropValue(i,a),_.abrupt("return");case 3:if(o=this.asyncProps[i],o){_.next=6;break}return _.abrupt("return");case 6:o.pendingLoadCount++,s=o.pendingLoadCount,u=[],l=0,f=!1,p=!1,_.prev=12,d=Za(a);case 14:return _.next=16,d.next();case 16:if(!(f=!(v=_.sent).done)){_.next=28;break}if(m=v.value,this.component){_.next=20;break}return _.abrupt("return");case 20:g=this.component.props.dataTransform,g?u=g(m,u):u=u.concat(m),Object.defineProperty(u,"__diff",{enumerable:!1,value:[{startRow:l,endRow:u.length}]}),l=u.length,this._setAsyncPropValue(i,u,s);case 25:f=!1,_.next=14;break;case 28:_.next=34;break;case 30:_.prev=30,_.t0=_.catch(12),p=!0,h=_.t0;case 34:if(_.prev=34,_.prev=35,!(f&&d.return!=null)){_.next=39;break}return _.next=39,d.return();
2164case 39:if(_.prev=39,!p){_.next=42;break}throw h;case 42:return _.finish(39);case 43:return _.finish(34);case 44:this._onResolve(i,u);case 45:case"end":return _.stop()}},n,this,[[12,30,34,44],[35,,39,43]])}));function e(n,i){return r.apply(this,arguments)}return e}()},{key:"_postProcessValue",value:function(e,n){var i=e.type;return i&&this.component&&(i.release&&i.release(e.resolvedValue,i,this.component),i.transform)?i.transform(n,i,this.component):n}},{key:"_createAsyncPropData",value:function(e,n){var i=this.asyncProps[e];if(!i){var a=this.component&&this.component.props[Jr];this.asyncProps[e]={type:a&&a[e],lastValue:null,resolvedValue:n,pendingLoadCount:0,resolvedLoadCount:0}}}}]),t}();function aZ(t){var r=oZ();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function oZ(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var oR=function(t){L(e,t);var r=aZ(e);function e(n){var i,a=n.attributeManager,o=n.layer;return A(this,e),i=r.call(this,o),c(q(i),"attributeManager",void 0),c(q(i),"needsRedraw",void 0),c(q(i),"needsUpdate",void 0),c(q(i),"subLayers",void 0),c(q(i),"usesPickingColorCache",void 0),c(q(i),"hasPickingBuffer",void 0),c(q(i),"changeFlags",void 0),c(q(i),"viewport",void 0),c(q(i),"uniformTransitions",void 0),c(q(i),"propsInTransition",void 0),i.attributeManager=a,i.needsRedraw=!0,i.needsUpdate=!0,i.subLayers=null,i.usesPickingColorCache=!1,i}return T(e,[{key:"layer",get:function(){return this.component}},{key:"_fetch",value:function(i,a){var o=this.layer,s=o?.props.fetch;return s?s(a,{propName:i,layer:o}):Z(S(e.prototype),"_fetch",this).call(this,i,a)}},{key:"_onResolve",value:function(i,a){var o=this.layer;if(o){var s=o.props.onDataLoad;i==="data"&&s&&s(a,{propName:i,layer:o})}}},{key:"_onError",value:function(i,a){var o=this.layer;o&&o.raiseError(a,"loading ".concat(i," of ").concat(this.layer))}}]),e}(aR);function wn(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=sZ(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2165In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function sZ(t,r){if(t){if(typeof t=="string")return sR(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return sR(t,r)}}function sR(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function uZ(t){var r=lZ();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function lZ(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function uR(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function Qf(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?uR(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):uR(Object(e)).forEac
2165h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var fZ="layer.changeFlag",cZ="layer.initialize",pZ="layer.update",hZ="layer.finalize",dZ="layer.matched",lR=Math.pow(2,24)-1,vZ=Object.freeze([]),mZ=xr(function(t){var r=t.oldViewport,e=t.viewport;return r.equals(e)}),Yn=new Uint8ClampedArray(0),gZ={data:{type:"data",value:vZ,async:!0},dataComparator:{type:"function",value:null,optional:!0},_dataDiff:{type:"function",value:function(r){return r&&r.__diff},optional:!0},dataTransform:{type:"function",value:null,optional:!0},onDataLoad:{type:"function",value:null,optional:!0},onError:{type:"function",value:null,optional:!0},fetch:{type:"function",value:function(r,e){var n=e.propName,i=e.layer,a=e.loaders,o=e.loadOptions,s=e.signal,u=i.context.resourceManager;if(o=o||i.getLoadOptions(),a=a||i.props.loaders,s){var l;o=Qf(Qf({},o),{},{fetch:Qf(Qf({},(l=o)===null||l===void 0?void 0:l.fetch),{},{signal:s})})}var f=u.contains(r);return!f&&!o&&(u.add({resourceId:r,data:Bt(r,a),persistent:!1}),f=!0),f?u.subscribe({resourceId:r,onChange:function(h){var d;return(d=i.internalState)===null||d===void 0?void 0:d.reloadAsyncProp(n,h)},consumerId:i.id,requestId:n}):Bt(r,a,o)}},updateTriggers:{},visible:!0,pickable:!1,opacity:{type:"number",min:0,max:1,value:1},operation:"draw",onHover:{type:"function",value:null,optional:!0},onClick:{type:"function",value:null,optional:!0},onDragStart:{type:"function",value:null,optional:!0},onDrag:{type:"function",value:null,optional:!0},onDragEnd:{type:"function",value:null,optional:!0},coordinateSystem:de.DEFAULT,coordinateOrigin:{type:"array",value:[0,0,0],compare:!0},modelMatrix:{type:"array",value:null,compare:!0,optional:!0},wrapLongitude:!1,positionFormat:"XYZ",colorFormat:"RGBA",parameters:{type:"object",value:{},optional:!0,compare:2},loadOptions:{type:"object",value:null,optional:!0,ignore:!0},transitions:null,extensions:[],loaders:{type:"array",value:[],optional:!0,ignore:!0},getPolygonOffset:{type:"function",value:function(r){var e=r.layerIndex;return[0,-e*100]}},highlightedObjectIndex:null,autoHighlight:!1,highlightColor:{type:"accessor",value:[0,0,128,128]}},He=function(t){L(e,t);var r=uZ(e);function e(){var n;A(this,e);for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return n=r.call.apply(r,[this].concat(a)),c(q(n),"internalState",null),c(q(n),"lifecycle",ba.NO_STATE),c(q(n),"context",void 0),c(q(n),"state",void 0),c(q(n),"parent",null),n}return T(e,[{key:"root",get:function(){for(var i=this;i.parent;)i=i.parent;return i}},{key:"toString",value:function(){var i=this.constructor.layerName||this.constructor.name;return"".concat(i,"({id: '").concat(this.props.id,"'})")}},{key:"project",value:function(i){Je(this.internalState);var a=this.internalState.viewport||this.context.viewport,o=Y_(i,{viewport:a,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),s=Eo(o,a.pixelProjectionMatrix),u=W(s,3),l=u[0],f=u[1],p=u[2];return i.length===2?[l,f]:[l,f,p]}},{key:"unproject",value:function(i){Je(this.internalState);var a=this.internalState.viewport||this.context.viewport;return a.unproject(i)}},{key:"projectPosition",value:function(i,a){Je(this.internalState);var o=this.internalState.viewport||this.context.viewport;return td(i,Qf({viewport:o,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem},a))}},{key:"isComposite",get:function(){return!1}},{key:"setState",value:function(i){this.setChangeFlags({stateChanged:!0}),Object.assign(this.state,i),this.setNeedsRedraw()}},{key:"setNeedsRedraw",value:function(){this.internalState&&(this.internalState.needsRedraw=!0)}},{key:"setNeedsUpdate",value:function(){this.internalState&&(this.context.layerManager.setNeedsUpdate(String(this)),this.internalState.needsUpdate=!0)}},{key:"isLoaded",get:function(){return this.internalState?!this.internalState.isAsyncPropLoading():!1}},{key:"wrapLongitude",get:function(){return this.props.wrapLongitude}},{key:"isPickable",value:function(){return this.props.pickable&&this.props.visible}},{key:"getModels",value:function(){return this.state&&(this.state.models||this.state.model&&[this.state.model])||[]}},{key:"setModuleParameters",value:function(i){var a=wn(this.getModels()),o;try{for(a.s();!(o=a.n()).done;){var s=o.value;s.updateModuleSettings(i)}}catch(u){a.e(u)}finally{a.f()}}},{key:"getAttributeManager",value:function(){return this.internalState&&this.internalState.attributeManager}},{key:"getCurrentLayer",value:function(){return this.internalState&&this.internalState.layer}},{key:"getLoadOptions",value:function(){return this.props.loadOptions}},{key:"use64bitPositions",value:function(){var i=this.props.coordinateSystem;return i===de.DEFAULT||i===de.LNGLAT||i===de.CARTESIAN}},{key:"onHover",value:function(i,a){return this.props.onHover&&this.props.onHover(i,a)||!1}},{key:"onClick",value:function(i,a){return this.props.onClick&&this.props.onClick(i,a)||!1}},{key:"nullPickingColor",value:function(){return[0,0,0]}},{key:"encodePickingColor",value:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return a[0]=i+1&255,a[1]=i+1>>8&255,a[2]=i+1>>8>>8&255,a}},{key:"decodePickingColor",value:function(i){Je(i instanceof Uint8Array);var a=W(i,3),o=a[0],s=a[1],u=a[2],l=o+s*256+u*65536-1;return l}},{key:"getNumInstances",value:function(){return Number.isFinite(this.props.numInstances)?this.props.numInstances:this.state&&this.state.numInstances!==void 0?this.state.numInstances:Cd(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 i;return(i=this.getAttributeManager())===null||i===void 0?void 0:i.getBounds(["positions","instancePositions"])}},{key:"getShaders",value:function(i){var a=wn(this.props.extensions),o;try{for(a.s();!(o=a.n()).done;){var s=o.value;i=Ci(i,s.getShaders.call(this,s))}}catch(u){a.e(u)}finally{a.f()}return i}},{key:"shouldUpdateState",value:function(i){return i.changeFlags.propsOrDataChanged}},{key:"updateState",value:function(i){var a=this,o=this.getAttributeManager(),s=i.changeFlags.dataChanged;if(s&&o)if(Array.isArray(s)){var u=wn(s),l;
2165try{for(u.s();!(l=u.n()).done;){var f=l.value;o.invalidateAll(f)}}catch(_){u.e(_)}finally{u.f()}}else o.invalidateAll();if(o){var p=i.props,h=this.internalState.hasPickingBuffer,d=Number.isInteger(p.highlightedObjectIndex)||p.pickable||p.extensions.some(function(_){return _.getNeedsPickingBuffer.call(a,_)});if(h!==d){this.internalState.hasPickingBuffer=d;var v=o.attributes,m=v.pickingColors,g=v.instancePickingColors,y=m||g;y&&(d&&y.constant&&(y.constant=!1,o.invalidate(y.id)),!y.value&&!d&&(y.constant=!0,y.value=[0,0,0]))}}}},{key:"finalizeState",value:function(i){var a=wn(this.getModels()),o;try{for(a.s();!(o=a.n()).done;){var s=o.value;s.delete()}}catch(l){a.e(l)}finally{a.f()}var u=this.getAttributeManager();u&&u.finalize(),this.context&&this.context.resourceManager.unsubscribe({consumerId:this.id}),this.internalState&&(this.internalState.uniformTransitions.clear(),this.internalState.finalize())}},{key:"draw",value:function(i){var a=wn(this.getModels()),o;try{for(a.s();!(o=a.n()).done;){var s=o.value;s.draw(i)}}catch(u){a.e(u)}finally{a.f()}}},{key:"getPickingInfo",value:function(i){var a=i.info,o=i.mode,s=i.sourceLayer,u=a.index;return u>=0&&Array.isArray(this.props.data)&&(a.object=this.props.data[u]),a}},{key:"raiseError",value:function(i,a){var o,s;if(a&&(i=new Error("".concat(a,": ").concat(i.message),{cause:i})),!((o=(s=this.props).onError)!==null&&o!==void 0&&o.call(s,i))){var u,l;(u=this.context)===null||u===void 0||(l=u.onError)===null||l===void 0||l.call(u,i,this)}}},{key:"getNeedsRedraw",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{clearRedrawFlags:!1};return this._getNeedsRedraw(i)}},{key:"needsUpdate",value:function(){return this.internalState?this.internalState.needsUpdate||this.hasUniformTransition()||this.shouldUpdateState(this._getUpdateParams()):!1}},{key:"hasUniformTransition",value:function(){var i;return((i=this.internalState)===null||i===void 0?void 0:i.uniformTransitions.active)||!1}},{key:"activateViewport",value:function(i){if(this.internalState){var a=this.internalState.viewport;this.internalState.viewport=i,(!a||!mZ({oldViewport:a,viewport:i}))&&(this.setChangeFlags({viewportChanged:!0}),this.isComposite?this.needsUpdate()&&this.setNeedsUpdate():this._update())}}},{key:"invalidateAttribute",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"all",a=this.getAttributeManager();a&&(i==="all"?a.invalidateAll():a.invalidate(i))}},{key:"updateAttributes",value:function(i){var a=wn(this.getModels()),o;try{for(a.s();!(o=a.n()).done;){var s=o.value;this._setModelAttributes(s,i)}}catch(u){a.e(u)}finally{a.f()}}},{key:"_updateAttributes",value:function(){var i=this.getAttributeManager();if(i){var a=this.props,o=this.getNumInstances(),s=this.getStartIndices();i.update({data:a.data,numInstances:o,startIndices:s,props:a,transitions:a.transitions,buffers:a.data.attributes,context:this});var u=i.getChangedAttributes({clearChangedFlags:!0});this.updateAttributes(u)}}},{key:"_updateAttributeTransition",value:function(){var i=this.getAttributeManager();i&&i.updateTransition()}},{key:"_updateUniformTransition",value:function(){var i=this.internalState.uniformTransitions;if(i.active){var a=i.update(),o=Object.create(this.props);for(var s in a)Object.defineProperty(o,s,{value:a[s]});return o}return this.props}},{key:"calculateInstancePickingColors",value:function(i,a){var o=a.numInstances;if(!i.constant){var s=Math.floor(Yn.length/3);if(this.internalState.usesPickingColorCache=!0,s<o){o>lR&&ne.warn("Layer has too many data objects. Picking might not be able to distinguish all objects.")(),Yn=xn.allocate(Yn,o,{size:3,copy:!0,maxCount:Math.max(o,lR)});for(var u=Math.floor(Yn.length/3),l=[],f=s;f<u;f++)this.encodePickingColor(f,l),Yn[f*3+0]=l[0],Yn[f*3+1]=l[1],Yn[f*3+2]=l[2]}i.value=Yn.subarray(0,o*3)}}},{key:"_setModelAttributes",value:function(i,a){var o=this.getAttributeManager(),s=i.userData.excludeAttributes||{},u=o.getShaderAttributes(a,s);i.setAttributes(u)}},{key:"disablePickingIndex",value:function(i){var a=this.props.data;if(!("attributes"in a)){this._disablePickingIndex(i);return}var o=this.getAttributeManager().attributes,s=o.pickingColors,u=o.instancePickingColors,l=s||u,f=l&&a.attributes&&a.attributes[l.id];if(f&&f.value)for(var p=f.value,h=this.encodePickingColor(i),d=0;d<a.length;d++){var v=l.getVertexOffset(d);p[v]===h[0]&&p[v+1]===h[1]&&p[v+2]===h[2]&&this._disablePickingIndex(d)}else this._disablePickingIndex(i)}},{key:"_disablePickingIndex",value:function(i){var a=this.getAttributeManager().attributes,o=a.pickingColors,s=a.instancePickingColors,u=o||s;if(u){var l=u.getVertexOffset(i),f=u.getVertexOffset(i+1);u.buffer.subData({data:new Uint8Array(f-l),offset:l})}}},{key:"restorePickingColors",value:function(){var i=this.getAttributeManager().attributes,a=i.pickingColors,o=i.instancePickingColors,s=a||o;s&&(this.internalState.usesPickingColorCache&&s.value.buffer!==Yn.buffer&&(s.value=Yn.subarray(0,s.value.length)),s.updateSubBuffer({startOffset:0}))}},{key:"_initialize",value:function(){Je(!this.internalState),Je(Number.isFinite(this.props.coordinateSystem)),wt(cZ,this);var i=this._getAttributeManager();i&&i.addInstanced({instancePickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateInstancePickingColors}}),this.internalState=new oR({attributeManager:i,layer:this}),this._clearChangeFlags(),this.state={},Object.defineProperty(this.state,"attributeManager",{get:function(){return ne.deprecated("layer.state.attributeManager","layer.getAttributeManager()")(),i}}),this.internalState.uniformTransitions=new WI(this.context.timeline),this.internalState.onAsyncPropUpdated=this._onAsyncPropUpdated.bind(this),this.internalState.setAsyncProps(this.props),this.initializeState(this.context);var a=wn(this.props.extensions),o;try{for(a.s();!(o=a.n()).done;){var s=o.value;s.initializeState.call(this,this.context,s)}}catch(u){a.e(u)}finally{a.f()}this.setChangeFlags({dataChanged:"init",propsChanged:"init",viewportChanged:!0,extensionsChanged:!0}),this._update()}},{key:"_transferState",value:function(i){wt(dZ,this,this===i);var a=i.state,o=i.internalState;this!==i&&(this.internalState=o,this.state=a,this.internalState.setAsyncProps(this.props),this._diffProps(this.props,this.internalState.getOldProps()))}},{key:"_update",value:function(){var i=this.needsUpdate();if(wt(pZ,this,i),!!i){var a=this.props,o=this.context,s=this.internalState,u=o.viewport,l=this._updateUniformTransition();s.propsInTransition=l,o.viewport=s.viewport||u,this.props=l;
2165try{var f=this._getUpdateParams(),p=this.getModels();if(o.gl)this.updateState(f);else try{this.updateState(f)}catch{}var h=wn(this.props.extensions),d;try{for(h.s();!(d=h.n()).done;){var v=d.value;v.updateState.call(this,f,v)}}catch(g){h.e(g)}finally{h.f()}var m=this.getModels()[0]!==p[0];this._postUpdate(f,m)}finally{o.viewport=u,this.props=a,this._clearChangeFlags(),s.needsUpdate=!1,s.resetOldProps()}}}},{key:"_finalize",value:function(){wt(hZ,this),this.finalizeState(this.context);var i=wn(this.props.extensions),a;try{for(i.s();!(a=i.n()).done;){var o=a.value;o.finalizeState.call(this,this.context,o)}}catch(s){i.e(s)}finally{i.f()}}},{key:"_drawLayer",value:function(i){var a=this,o=i.moduleParameters,s=o===void 0?null:o,u=i.uniforms,l=u===void 0?{}:u,f=i.parameters,p=f===void 0?{}:f;this._updateAttributeTransition();var h=this.props,d=this.context;this.props=this.internalState.propsInTransition||h;var v=this.props.opacity;l.opacity=Math.pow(v,1/2.2);try{s&&this.setModuleParameters(s);var m=this.props.getPolygonOffset,g=m&&m(l)||[0,0];It(d.gl,{polygonOffset:g}),ke(d.gl,p,function(){var y={moduleParameters:s,uniforms:l,parameters:p,context:d},_=wn(a.props.extensions),b;try{for(_.s();!(b=_.n()).done;){var x=b.value;x.draw.call(a,y,x)}}catch(w){_.e(w)}finally{_.f()}a.draw(y)})}finally{this.props=h}}},{key:"getChangeFlags",value:function(){var i;return(i=this.internalState)===null||i===void 0?void 0:i.changeFlags}},{key:"setChangeFlags",value:function(i){if(this.internalState){var a=this.internalState.changeFlags;for(var o in i)if(i[o]){var s=!1;switch(o){case"dataChanged":var u=i[o],l=a[o];u&&Array.isArray(l)&&(a.dataChanged=Array.isArray(u)?l.concat(u):u,s=!0);default:a[o]||(a[o]=i[o],s=!0)}s&&wt(fZ,this,o,i)}var f=Boolean(a.dataChanged||a.updateTriggersChanged||a.propsChanged||a.extensionsChanged);a.propsOrDataChanged=f,a.somethingChanged=f||a.viewportChanged||a.stateChanged}}},{key:"_clearChangeFlags",value:function(){this.internalState.changeFlags={dataChanged:!1,propsChanged:!1,updateTriggersChanged:!1,viewportChanged:!1,stateChanged:!1,extensionsChanged:!1,propsOrDataChanged:!1,somethingChanged:!1}}},{key:"_diffProps",value:function(i,a){var o=qI(i,a);if(o.updateTriggersChanged)for(var s in o.updateTriggersChanged)o.updateTriggersChanged[s]&&this.invalidateAttribute(s);if(o.transitionsChanged)for(var u in o.transitionsChanged){var l;this.internalState.uniformTransitions.add(u,a[u],i[u],(l=i.transitions)===null||l===void 0?void 0:l[u])}return this.setChangeFlags(o)}},{key:"validateProps",value:function(){XI(this.props)}},{key:"updateAutoHighlight",value:function(i){this.props.autoHighlight&&!Number.isInteger(this.props.highlightedObjectIndex)&&this._updateAutoHighlight(i)}},{key:"_updateAutoHighlight",value:function(i){var a={pickingSelectedColor:i.picked?i.color:null},o=this.props.highlightColor;i.picked&&typeof o=="function"&&(a.pickingHighlightColor=o(i)),this.setModuleParameters(a),this.setNeedsRedraw()}},{key:"_getAttributeManager",value:function(){var i=this.context;return new Sa(i.gl,{id:this.props.id,stats:i.stats,timeline:i.timeline})}},{key:"_postUpdate",value:function(i,a){var o=i.props,s=i.oldProps;this.setNeedsRedraw(),this._updateAttributes();var u=this.state.model;u?.setInstanceCount(this.getNumInstances());var l=o.autoHighlight,f=o.highlightedObjectIndex,p=o.highlightColor;if(a||s.autoHighlight!==l||s.highlightedObjectIndex!==f||s.highlightColor!==p){var h={};l||(h.pickingSelectedColor=null),Array.isArray(p)&&(h.pickingHighlightColor=p),(a||f!==s.highlightedObjectIndex)&&(h.pickingSelectedColor=Number.isFinite(f)&&f>=0?this.encodePickingColor(f):null),this.setModuleParameters(h)}}},{key:"_getUpdateParams",value:function(){return{props:this.props,oldProps:this.internalState.getOldProps(),context:this.context,changeFlags:this.internalState.changeFlags}}},{key:"_getNeedsRedraw",value:function(i){if(!this.internalState)return!1;var a=!1;a=a||this.internalState.needsRedraw&&this.id;var o=this.getAttributeManager(),s=o?o.getNeedsRedraw(i):!1;if(a=a||s,a){var u=wn(this.props.extensions),l;
2165try{for(u.s();!(l=u.n()).done;){var f=l.value;f.onNeedsRedraw.call(this,f)}}catch(p){u.e(p)}finally{u.f()}}return this.internalState.needsRedraw=this.internalState.needsRedraw&&!i.clearRedrawFlags,a}},{key:"_onAsyncPropUpdated",value:function(){this._diffProps(this.props,this.internalState.getOldProps()),this.setNeedsUpdate()}}],[{key:"componentName",get:function(){return Object.prototype.hasOwnProperty.call(this,"layerName")?this.layerName:""}}]),e}(Id);c(He,"defaultProps",gZ);c(He,"layerName","Layer");F();j();k();function bb(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=yZ(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2166In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function yZ(t,r){if(t){if(typeof t=="string")return fR(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return fR(t,r)}}function fR(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function cR(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function pR(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?cR(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):cR(Object(e)).forEac
2166h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function _Z(t){var r=bZ();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function bZ(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var xZ="compositeLayer.renderLayers",gt=function(t){L(e,t);var r=_Z(e);function e(){return A(this,e),r.apply(this,arguments)}return T(e,[{key:"isComposite",get:function(){return!0}},{key:"isLoaded",get:function(){return Z(S(e.prototype),"isLoaded",this)&&this.getSubLayers().every(function(i){return i.isLoaded})}},{key:"getSubLayers",value:function(){return this.internalState&&this.internalState.subLayers||[]}},{key:"initializeState",value:function(i){}},{key:"setState",value:function(i){Z(S(e.prototype),"setState",this).call(this,i),this.setNeedsUpdate()}},{key:"getPickingInfo",value:function(i){var a=i.info,o=a.object,s=o&&o.__source&&o.__source.parent&&o.__source.parent.id===this.id;return s&&(a.object=o.__source.object,a.index=o.__source.index),a}},{key:"filterSubLayer",value:function(i){return!0}},{key:"shouldRenderSubLayer",value:function(i,a){return a&&a.length}},{key:"getSubLayerClass",value:function(i,a){var o=this.props._subLayerProps;return o&&o[i]&&o[i].type||a}},{key:"getSubLayerRow",value:function(i,a,o){return i.__source={parent:this,object:a,index:o},i}},{key:"getSubLayerAccessor",value:function(i){if(typeof i=="function"){var a={index:-1,data:this.props.data,target:[]};return function(o,s){return o&&o.__source?(a.index=o.__source.index,i(o.__source.object,a)):i(o,s)}}return i}},{key:"getSubLayerProps",value:function(){var i,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=this.props,s=o.opacity,u=o.pickable,l=o.visible,f=o.parameters,p=o.getPolygonOffset,h=o.highlightedObjectIndex,d=o.autoHighlight,v=o.highlightColor,m=o.coordinateSystem,g=o.coordinateOrigin,y=o.wrapLongitude,_=o.positionFormat,b=o.modelMatrix,x=o.extensions,w=o.fetch,P=o.operation,E=o._subLayerProps,C={id:"",updateTriggers:{},opacity:s,pickable:u,visible:l,parameters:f,getPolygonOffset:p,highlightedObjectIndex:h,autoHighlight:d,highlightColor:v,coordinateSystem:m,coordinateOrigin:g,wrapLongitude:y,positionFormat:_,modelMatrix:b,extensions:x,fetch:w,operation:P},I=E&&a.id&&E[a.id],O=I&&I.updateTriggers,D=a.id||"sublayer";if(I){var N=this.props[Jr],H=a.type?a.type._propTypes:{};for(var $ in I){var ee=H[$]||N[$];ee&&ee.type==="accessor"&&(I[$]=this.getSubLayerAccessor(I[$]))}}Object.assign(C,a,I),C.id="".concat(this.props.id,"-").concat(D),C.updateTriggers=pR(pR({all:(i=this.props.updateTriggers)===null||i===void 0?void 0:i.all},a.updateTriggers),O);var V=bb(x),U;try{for(V.s();!(U=V.n()).done;){var X=U.value,K=X.getSubLayerProps.call(this,X);K&&Object.assign(C,K,{updateTriggers:Object.assign(C.updateTriggers,K.updateTriggers)})}}catch(te){V.e(te)}finally{V.f()}return C}},{key:"_updateAutoHighlight",value:function(i){var a=bb(this.getSubLayers()),o;try{for(a.s();!(o=a.n()).done;){var s=o.value;s.updateAutoHighlight(i)}}catch(u){a.e(u)}finally{a.f()}}},{key:"_getAttributeManager",value:function(){return null}},{key:"_postUpdate",value:function(i,a){var o=this.internalState.subLayers,s=!o||this.needsUpdate();if(s){var u=this.renderLayers();o=gr(u,Boolean),this.internalState.subLayers=o}wt(xZ,this,s,o);var l=bb(o),f;try{for(l.s();!(f=l.n()).done;){var p=f.value;p.parent=this}}catch(h){l.e(h)}finally{l.f()}}}]),e}(He);c(gt,"layerName","CompositeLayer");be();F();j();k();function hR(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function dR(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?hR(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):hR(Object(e)).forEac
2166h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function AZ(t){var r=SZ();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function SZ(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Rd=Math.PI/180,vR=180/Math.PI,Ld=6370972,yu=256;function TZ(){var t=yu/Ld,r=Math.PI/180*yu;return{unitsPerMeter:[t,t,t],unitsPerMeter2:[0,0,0],metersPerUnit:[1/t,1/t,1/t],unitsPerDegree:[r,r,t],unitsPerDegree2:[0,0,0],degreesPerUnit:[1/r,1/r,1/t]}}var _u=function(t){L(e,t);var r=AZ(e);function e(){var n,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};A(this,e);var a=i.latitude,o=a===void 0?0:a,s=i.longitude,u=s===void 0?0:s,l=i.zoom,f=l===void 0?0:l,p=i.nearZMultiplier,h=p===void 0?.1:p,d=i.farZMultiplier,v=d===void 0?2:d,m=i.resolution,g=m===void 0?10:m,y=i.height,_=i.altitude,b=_===void 0?1.5:_;y=y||1,b=Math.max(.75,b);var x=new ye().lookAt({eye:[0,-b,0],up:[0,0,1]}),w=Math.pow(2,f);x.rotateX(o*Rd),x.rotateZ(-u*Rd),x.scale(w/y);var P=Math.atan(.5/b),E=yu*2*w/y;return n=r.call(this,dR(dR({},i),{},{height:y,viewMatrix:x,longitude:u,latitude:o,zoom:f,distanceScales:TZ(),fovyRadians:P*2,focalDistance:b,near:h,far:Math.min(2,1/E+1)*b*v})),c(q(n),"longitude",void 0),c(q(n),"latitude",void 0),c(q(n),"resolution",void 0),n.latitude=o,n.longitude=u,n.resolution=g,n}return T(e,[{key:"projectionMode",get:function(){return rr.GLOBE}},{key:"getDistanceScales",value:function(){return this.distanceScales}},{key:"getBounds",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a={targetZ:i.z||0},o=this.unproject([0,this.height/2],a),s=this.unproject([this.width/2,0],a),u=this.unproject([this.width,this.height/2],a),l=this.unproject([this.width/2,this.height],a);return u[0]<this.longitude&&(u[0]+=360),o[0]>this.longitude&&(o[0]-=360),[Math.min(o[0],u[0],s[0],l[0]),Math.min(o[1],u[1],s[1],l[1]),Math.max(o[0],u[0],s[0],l[0]),Math.max(o[1],u[1],s[1],l[1])]}},{key:"unproject",value:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=a.topLeft,s=o===void 0?!0:o,u=a.targetZ,l=W(i,3),f=l[0],p=l[1],h=l[2],d=s?p:this.height-p,v=this.pixelUnprojectionMatrix,m;if(Number.isFinite(h))m=xb(v,[f,d,h,1]);else{var g=xb(v,[f,d,-1,1]),y=xb(v,[f,d,1,1]),_=((u||0)/Ld+1)*yu,b=ed(Qh([],g,y)),x=ed(g),w=ed(y),P=(4*x*w-Math.pow(b-x-w,2))/16,E=4*P/b,C=Math.sqrt(x-E),I=Math.sqrt(Math.max(0,_*_-E)),O=(C-I)/Math.sqrt(b);m=CM([],g,y,O)}var D=this.unprojectPosition(m),N=W(D,3),H=N[0],$=N[1],ee=N[2];return Number.isFinite(h)?[H,$,ee]:Number.isFinite(u)?[H,$,u]:[H,$]}},{key:"projectPosition",value:function(i){var a=W(i,3),o=a[0],s=a[1],u=a[2],l=u===void 0?0:u,f=o*Rd,p=s*Rd,h=Math.cos(p),d=(l/Ld+1)*yu;return[Math.sin(f)*h*d,-Math.cos(f)*h*d,Math.sin(p)*d]}},{key:"unprojectPosition",value:function(i){var a=W(i,3),o=a[0],s=a[1],u=a[2],l=MM(i),f=Math.asin(u/l),p=Math.atan2(o,-s),h=p*vR,d=f*vR,v=(l/yu-1)*Ld;return[h,d,v]}},{key:"projectFlat",value:function(i){return i}},{key:"unprojectFlat",value:function(i){return i}},{key:"panByPosition",value:function(i,a){var o=this.unproject(a);return{longitude:i[0]-o[0]+this.longitude,latitude:i[1]-o[1]+this.latitude}}}]),e}(tr);function xb(t,r){var e=wo([],r,t);return tM(e,e,1/e[3]),e}be();F();j();k();function mR(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function gR(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?mR(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):mR(Object(e)).forEac
2166h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function wZ(t){var r=PZ();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function PZ(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Ab=Math.PI/180;function OZ(t){var r=t.height,e=t.focalDistance,n=t.orbitAxis,i=t.rotationX,a=t.rotationOrbit,o=t.zoom,s=n==="Z"?[0,0,1]:[0,1,0],u=n==="Z"?[0,-e,0]:[0,0,e],l=new ye().lookAt({eye:u,up:s});l.rotateX(i*Ab),n==="Z"?l.rotateZ(a*Ab):l.rotateY(a*Ab);var f=Math.pow(2,o)/r;return l.scale(f),l}var kd=function(t){L(e,t);var r=wZ(e);function e(n){var i;A(this,e);var a=n.height,o=n.projectionMatrix,s=n.fovy,u=s===void 0?50:s,l=n.orbitAxis,f=l===void 0?"Z":l,p=n.target,h=p===void 0?[0,0,0]:p,d=n.rotationX,v=d===void 0?0:d,m=n.rotationOrbit,g=m===void 0?0:m,y=n.zoom,_=y===void 0?0:y,b=o?o[5]/2:ya(u);return i=r.call(this,gR(gR({},n),{},{longitude:void 0,viewMatrix:OZ({height:a||1,focalDistance:b,orbitAxis:f,rotationX:v,rotationOrbit:g,zoom:_}),fovy:u,focalDistance:b,position:h,zoom:_})),c(q(i),"projectedCenter",void 0),i.projectedCenter=i.project(i.center),i}return T(e,[{key:"unproject",value:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=a.topLeft,s=o===void 0?!0:o,u=W(i,3),l=u[0],f=u[1],p=u[2],h=p===void 0?this.projectedCenter[2]:p,d=s?f:this.height-f,v=Ar([l,d,h],this.pixelUnprojectionMatrix),m=W(v,3),g=m[0],y=m[1],_=m[2];return[g,y,_]}},{key:"panByPosition",value:function(i,a){var o=this.project(i),s=[this.width/2+o[0]-a[0],this.height/2+o[1]-a[1],this.projectedCenter[2]];return{target:this.unproject(s)}}}]),e}(tr);be();k();F();j();function yR(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function _R(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?yR(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):yR(Object(e)).forEac
2166h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function EZ(t){var r=CZ();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function CZ(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var MZ=new ye().lookAt({eye:[0,0,1]});function IZ(t){var r=t.width,e=t.height,n=t.near,i=t.far,a=t.padding,o=-r/2,s=r/2,u=-e/2,l=e/2;if(a){var f=a.left,p=f===void 0?0:f,h=a.right,d=h===void 0?0:h,v=a.top,m=v===void 0?0:v,g=a.bottom,y=g===void 0?0:g,_=We((p+r-d)/2,0,r)-r/2,b=We((m+e-y)/2,0,e)-e/2;o-=_,s-=_,u+=b,l+=b}return new ye().ortho({left:o,right:s,bottom:u,top:l,near:n,far:i})}var bu=function(t){L(e,t);var r=EZ(e);function e(n){A(this,e);var i=n.width,a=n.height,o=n.near,s=o===void 0?.1:o,u=n.far,l=u===void 0?1e3:u,f=n.zoom,p=f===void 0?0:f,h=n.target,d=h===void 0?[0,0,0]:h,v=n.padding,m=v===void 0?null:v,g=n.flipY,y=g===void 0?!0:g,_=Array.isArray(p)?p[0]:p,b=Array.isArray(p)?p[1]:p,x=Math.min(_,b),w=Math.pow(2,x),P;if(_!==b){var E=Math.pow(2,_),C=Math.pow(2,b);P={unitsPerMeter:[E/w,C/w,1],metersPerUnit:[w/E,w/C,1]}}return r.call(this,_R(_R({},n),{},{longitude:void 0,position:d,viewMatrix:MZ.clone().scale([w,w*(y?-1:1),w]),projectionMatrix:IZ({width:i||1,height:a||1,padding:m,near:s,far:l}),zoom:x,distanceScales:P}))}return T(e,[{key:"projectFlat",value:function(i){var a=W(i,2),o=a[0],s=a[1],u=this.distanceScales.unitsPerMeter;return[o*u[0],s*u[1]]}},{key:"unprojectFlat",value:function(i){var a=W(i,2),o=a[0],s=a[1],u=this.distanceScales.metersPerUnit;return[o*u[0],s*u[1]]}},{key:"panByPosition",value:function(i,a){var o=Ar(a,this.pixelUnprojectionMatrix),s=this.projectFlat(i),u=su([],s,Jh([],o)),l=su([],this.center,u);return{target:this.unprojectFlat(l)}}}]),e}(tr);F();k();function bR(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function xR(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?bR(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):bR(Object(e)).forEac
2166h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function RZ(t){var r=LZ();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function LZ(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Bd=function(t){L(e,t);var r=RZ(e);function e(n){var i;A(this,e);var a=n.longitude,o=n.latitude,s=n.modelMatrix,u=n.bearing,l=u===void 0?0:u,f=n.pitch,p=f===void 0?0:f,h=n.up,d=h===void 0?[0,0,1]:h,v=new Lf({bearing:l,pitch:p===-90?1e-4:90+p}),m=v.toVector3().normalize(),g=s?new ye(s).transformAsVector(m):m,y=Number.isFinite(o)?Df({latitude:o}):0,_=Math.pow(2,y),b=new ye().lookAt({eye:[0,0,0],center:g,up:d}).scale(_);return i=r.call(this,xR(xR({},n),{},{zoom:y,viewMatrix:b})),c(q(i),"longitude",void 0),c(q(i),"latitude",void 0),i.latitude=o,i.longitude=a,i}return e}(tr);F();j();k();k();F();j();function AR(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function Fd(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?AR(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):AR(Object(e)).forEac
2166h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function SR(t){var r=kZ();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function kZ(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var ec=20,BZ=function(t){L(e,t);var r=SR(e);function e(n){A(this,e);var i=n.width,a=n.height,o=n.position,s=o===void 0?[0,0,0]:o,u=n.bearing,l=u===void 0?0:u,f=n.pitch,p=f===void 0?0:f,h=n.longitude,d=h===void 0?null:h,v=n.latitude,m=v===void 0?null:v,g=n.maxPitch,y=g===void 0?90:g,_=n.minPitch,b=_===void 0?-90:_,x=n.startRotatePos,w=n.startBearing,P=n.startPitch,E=n.startZoomPosition;return r.call(this,{width:i,height:a,position:s,bearing:l,pitch:p,longitude:d,latitude:m,maxPitch:y,minPitch:b},{startRotatePos:x,startBearing:w,startPitch:P,startZoomPosition:E})}return T(e,[{key:"panStart",value:function(){return this}},{key:"pan",value:function(){return this}},{key:"panEnd",value:function(){return this}},{key:"rotateStart",value:function(i){var a=i.pos;return this._getUpdatedState({startRotatePos:a,startBearing:this.getViewportProps().bearing,startPitch:this.getViewportProps().pitch})}},{key:"rotate",value:function(i){var a=i.pos,o=i.deltaAngleX,s=o===void 0?0:o,u=i.deltaAngleY,l=u===void 0?0:u,f=this.getState(),p=f.startRotatePos,h=f.startBearing,d=f.startPitch,v=this.getViewportProps(),m=v.width,g=v.height;if(!p||h===void 0||d===void 0)return this;var y;if(a){var _=(a[0]-p[0])/m,b=(a[1]-p[1])/g;y={bearing:h-_*180,pitch:d-b*90}}else y={bearing:h-s,pitch:d-l};return this._getUpdatedState(y)}},{key:"rotateEnd",value:function(){return this._getUpdatedState({startRotatePos:null,startBearing:null,startPitch:null})}},{key:"zoomStart",value:function(){return this._getUpdatedState({startZoomPosition:this.getViewportProps().position})}},{key:"zoom",value:function(i){var a=i.scale,o=this.getState(),s=o.startZoomPosition;s||(s=this.getViewportProps().position);var u=this.getDirection();return this._move(u,Math.log2(a)*ec,s)}},{key:"zoomEnd",value:function(){return this._getUpdatedState({startZoomPosition:null})}},{key:"moveLeft",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ec,a=this.getDirection(!0);return this._move(a.rotateZ({radians:Math.PI/2}),i)}},{key:"moveRight",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ec,a=this.getDirection(!0);return this._move(a.rotateZ({radians:-Math.PI/2}),i)}},{key:"moveUp",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ec,a=this.getDirection(!0);return this._move(a,i)}},{key:"moveDown",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ec,a=this.getDirection(!0);return this._move(a.negate(),i)}},{key:"rotateLeft",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:15;return this._getUpdatedState({bearing:this.getViewportProps().bearing-i})}},{key:"rotateRight",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:15;return this._getUpdatedState({bearing:this.getViewportProps().bearing+i})}},{key:"rotateUp",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10;return this._getUpdatedState({pitch:this.getViewportProps().pitch+i})}},{key:"rotateDown",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10;return this._getUpdatedState({pitch:this.getViewportProps().pitch-i})}},{key:"zoomIn",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:2;return this.zoom({scale:i})}},{key:"zoomOut",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:2;return this.zoom({scale:1/i})}},{key:"shortestPathFrom",value:function(i){var a=i.getViewportProps(),o=Fd({},this.getViewportProps()),s=o.bearing,u=o.longitude;return Math.abs(s-a.bearing)>180&&(o.bearing=s<0?s+360:s-360),u!==null&&a.longitude!==null&&Math.abs(u-a.longitude)>
2166180&&(o.longitude=u<0?u+360:u-360),o}},{key:"_move",value:function(i,a){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.getViewportProps().position,s=i.scale(a);return this._getUpdatedState({position:new z(o).add(s)})}},{key:"getDirection",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,a=new Lf({bearing:this.getViewportProps().bearing,pitch:i?90:90+this.getViewportProps().pitch}),o=a.toVector3().normalize();return o}},{key:"_getUpdatedState",value:function(i){return new e(Fd(Fd(Fd({},this.getViewportProps()),this.getState()),i))}},{key:"applyConstraints",value:function(i){var a=i.pitch,o=i.maxPitch,s=i.minPitch,u=i.longitude,l=i.bearing;return i.pitch=We(a,s,o),u!==null&&(u<-180||u>180)&&(i.longitude=Mo(u+180,360)-180),(l<-180||l>180)&&(i.bearing=Mo(l+180,360)-180),i}}]),e}(pu),Dd=function(t){L(e,t);var r=SR(e);function e(){var n;A(this,e);for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return n=r.call.apply(r,[this].concat(a)),c(q(n),"ControllerState",BZ),c(q(n),"transition",{transitionDuration:300,transitionInterpolator:new Tr(["position","pitch","bearing"])}),n}return e}(en);function FZ(t){var r=DZ();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function DZ(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Sb=function(t){L(e,t);var r=FZ(e);function e(){return A(this,e),r.apply(this,arguments)}return T(e,[{key:"ViewportType",get:function(){return Bd}},{key:"ControllerType",get:function(){return Dd}}]),e}(Qr);c(Sb,"displayName","FirstPersonView");F();j();k();F();j();k();function TR(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function Do(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?TR(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):TR(Object(e)).forEac
2166h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function wR(t){var r=NZ();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function NZ(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Tb=function(t){L(e,t);var r=wR(e);function e(n){var i;A(this,e);var a=n.width,o=n.height,s=n.rotationX,u=s===void 0?0:s,l=n.rotationOrbit,f=l===void 0?0:l,p=n.target,h=p===void 0?[0,0,0]:p,d=n.zoom,v=d===void 0?0:d,m=n.minRotationX,g=m===void 0?-90:m,y=n.maxRotationX,_=y===void 0?90:y,b=n.minZoom,x=b===void 0?-1/0:b,w=n.maxZoom,P=w===void 0?1/0:w,E=n.startPanPosition,C=n.startRotatePos,I=n.startRotationX,O=n.startRotationOrbit,D=n.startZoomPosition,N=n.startZoom;return i=r.call(this,{width:a,height:o,rotationX:u,rotationOrbit:f,target:h,zoom:v,minRotationX:g,maxRotationX:_,minZoom:x,maxZoom:P},{startPanPosition:E,startRotatePos:C,startRotationX:I,startRotationOrbit:O,startZoomPosition:D,startZoom:N}),c(q(i),"makeViewport",void 0),i.makeViewport=n.makeViewport,i}return T(e,[{key:"panStart",value:function(i){var a=i.pos;return this._getUpdatedState({startPanPosition:this._unproject(a)})}},{key:"pan",value:function(i){var a=i.pos,o=i.startPosition,s=this.getState().startPanPosition||o;if(!s)return this;var u=this.makeViewport(this.getViewportProps()),l=u.panByPosition(s,a);return this._getUpdatedState(l)}},{key:"panEnd",value:function(){return this._getUpdatedState({startPanPosition:null})}},{key:"rotateStart",value:function(i){var a=i.pos;return this._getUpdatedState({startRotatePos:a,startRotationX:this.getViewportProps().rotationX,startRotationOrbit:this.getViewportProps().rotationOrbit})}},{key:"rotate",value:function(i){var a=i.pos,o=i.deltaAngleX,s=o===void 0?0:o,u=i.deltaAngleY,l=u===void 0?0:u,f=this.getState(),p=f.startRotatePos,h=f.startRotationX,d=f.startRotationOrbit,v=this.getViewportProps(),m=v.width,g=v.height;if(!p||h===void 0||d===void 0)return this;var y;if(a){var _=(a[0]-p[0])/m,b=(a[1]-p[1])/g;(h<-90||h>90)&&(_*=-1),y={rotationX:h+b*180,rotationOrbit:d+_*180}}else y={rotationX:h+l,rotationOrbit:d+s};return this._getUpdatedState(y)}},{key:"rotateEnd",value:function(){return this._getUpdatedState({startRotationX:null,startRotationOrbit:null})}},{key:"shortestPathFrom",value:function(i){var a=i.getViewportProps(),o=Do({},this.getViewportProps()),s=o.rotationOrbit;return Math.abs(s-a.rotationOrbit)>180&&(o.rotationOrbit=s<0?s+360:s-360),o}},{key:"zoomStart",value:function(i){var a=i.pos;return this._getUpdatedState({startZoomPosition:this._unproject(a),startZoom:this.getViewportProps().zoom})}},{key:"zoom",value:function(i){var a=i.pos,o=i.startPos,s=i.scale,u=this.getState(),l=u.startZoom,f=u.startZoomPosition;if(f||(l=this.getViewportProps().zoom,f=this._unproject(o)||this._unproject(a)),!f)return this;var p=this._calculateNewZoom({scale:s,startZoom:l}),h=this.makeViewport(Do(Do({},this.getViewportProps()),{},{zoom:p}));return this._getUpdatedState(Do({zoom:p},h.panByPosition(f,a)))}},{key:"zoomEnd",value:function(){return this._getUpdatedState({startZoomPosition:null,startZoom:null})}},{key:"zoomIn",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:2;return this._getUpdatedState({zoom:this._calculateNewZoom({scale:i})})}},{key:"zoomOut",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:2;return this._getUpdatedState({zoom:this._calculateNewZoom({scale:1/i})})}},{key:"moveLeft",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:50;return this._panFromCenter([-i,0])}},{key:"moveRight",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:50;return this._panFromCenter([i,0])}},{key:"moveUp",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:50;return this._panFromCenter([0,-i])}},{key:"moveDown",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:50;return this._panFromCenter([0,i])}},{key:"rotateLeft",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:15;
2166return this._getUpdatedState({rotationOrbit:this.getViewportProps().rotationOrbit-i})}},{key:"rotateRight",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:15;return this._getUpdatedState({rotationOrbit:this.getViewportProps().rotationOrbit+i})}},{key:"rotateUp",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10;return this._getUpdatedState({rotationX:this.getViewportProps().rotationX-i})}},{key:"rotateDown",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10;return this._getUpdatedState({rotationX:this.getViewportProps().rotationX+i})}},{key:"_unproject",value:function(i){var a=this.makeViewport(this.getViewportProps());return i&&a.unproject(i)}},{key:"_calculateNewZoom",value:function(i){var a=i.scale,o=i.startZoom,s=this.getViewportProps(),u=s.maxZoom,l=s.minZoom;o===void 0&&(o=this.getViewportProps().zoom);var f=o+Math.log2(a);return We(f,l,u)}},{key:"_panFromCenter",value:function(i){var a=this.getViewportProps(),o=a.width,s=a.height,u=a.target;return this.pan({startPosition:u,pos:[o/2+i[0],s/2+i[1]]})}},{key:"_getUpdatedState",value:function(i){return new this.constructor(Do(Do(Do({makeViewport:this.makeViewport},this.getViewportProps()),this.getState()),i))}},{key:"applyConstraints",value:function(i){var a=i.maxZoom,o=i.minZoom,s=i.zoom,u=i.maxRotationX,l=i.minRotationX,f=i.rotationOrbit;return i.zoom=Array.isArray(s)?[We(s[0],o,a),We(s[1],o,a)]:We(s,o,a),i.rotationX=We(i.rotationX,l,u),(f<-180||f>180)&&(i.rotationOrbit=Mo(f+180,360)-180),i}}]),e}(pu),Nd=function(t){L(e,t);var r=wR(e);function e(){var n;A(this,e);for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return n=r.call.apply(r,[this].concat(a)),c(q(n),"ControllerState",Tb),c(q(n),"transition",{transitionDuration:300,transitionInterpolator:new Tr({transitionProps:{compare:["target","zoom","rotationX","rotationOrbit"],required:["target","zoom"]}})}),n}return e}(en);function jZ(t){var r=UZ();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function UZ(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var wb=function(t){L(e,t);var r=jZ(e);function e(){var n,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return A(this,e),n=r.call(this,i),n.props.orbitAxis=i.orbitAxis||"Z",n}return T(e,[{key:"ViewportType",get:function(){return kd}},{key:"ControllerType",get:function(){return Nd}}]),e}(Qr);c(wb,"displayName","OrbitView");F();j();k();be();F();j();k();function PR(t){var r=GZ();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function GZ(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var zZ=function(t){L(e,t);var r=PR(e);function e(n){var i;return A(this,e),i=r.call(this,n),c(q(i),"zoomAxis",void 0),i.zoomAxis=n.zoomAxis||"all",i}return T(e,[{key:"_calculateNewZoom",value:function(i){var a=i.scale,o=i.startZoom,s=this.getViewportProps(),u=s.maxZoom,l=s.minZoom;o===void 0&&(o=this.getViewportProps().zoom);var f=Math.log2(a);if(Array.isArray(o)){var p=o,h=W(p,2),d=h[0],v=h[1];switch(this.zoomAxis){case"X":d=We(d+f,l,u);break;case"Y":v=We(v+f,l,u);break;default:var m=Math.min(d+f,v+f);m<l&&(f+=l-m),m=Math.max(d+f,v+f),m>u&&(f+=u-m),d+=f,v+=f}return[d,v]}return We(o+f,l,u)}}]),e}(Tb),jd=function(t){L(e,t);var r=PR(e);function e(){var n;A(this,e);for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return n=r.call.apply(r,[this].concat(a)),c(q(n),"ControllerState",zZ),c(q(n),"transition",{transitionDuration:300,transitionInterpolator:new Tr(["target","zoom"])}),c(q(n),"dragMode","pan"),n}return T(e,[{key:"_onPanRotate",value:function(){return!1}}]),e}(en);function VZ(t){var r=HZ();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function HZ(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Pb=function(t){L(e,t);var r=VZ(e);function e(){return A(this,e),r.apply(this,arguments)}return T(e,[{key:"ViewportType",get:function(){return bu}},{key:"ControllerType",get:function(){return jd}}]),e}(Qr);
2166c(Pb,"displayName","OrthographicView");F();j();k();k();F();j();function OR(t){var r=WZ();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function WZ(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var $Z=function(t){L(e,t);var r=OR(e);function e(){return A(this,e),r.apply(this,arguments)}return T(e,[{key:"applyConstraints",value:function(i){var a=i.maxZoom,o=i.minZoom,s=i.zoom;i.zoom=We(s,o,a);var u=i.longitude,l=i.latitude;return(u<-180||u>180)&&(i.longitude=Mo(u+180,360)-180),i.latitude=We(l,-89,89),i}}]),e}(J_),Ud=function(t){L(e,t);var r=OR(e);function e(){var n;A(this,e);for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return n=r.call.apply(r,[this].concat(a)),c(q(n),"ControllerState",$Z),c(q(n),"transition",{transitionDuration:300,transitionInterpolator:new Tr(["longitude","latitude","zoom"])}),c(q(n),"dragMode","pan"),n}return T(e,[{key:"setProps",value:function(i){Z(S(e.prototype),"setProps",this).call(this,i),this.dragRotate=!1,this.touchRotate=!1}}]),e}(en);function XZ(t){var r=qZ();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function qZ(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Ob=function(t){L(e,t);var r=XZ(e);function e(){return A(this,e),r.apply(this,arguments)}return T(e,[{key:"ViewportType",get:function(){return _u}},{key:"ControllerType",get:function(){return Ud}}]),e}(Qr);c(Ob,"displayName","GlobeView");F();j();k();var Et=function(){function t(r){A(this,t),c(this,"opts",void 0),r&&(this.opts=r)}return T(t,[{key:"equals",value:function(e){return this===e?!0:this.constructor===e.constructor&&xt(this.opts,e.opts,1)}},{key:"getShaders",value:function(e){return null}},{key:"getSubLayerProps",value:function(e){var n=e.constructor,i=n.defaultProps,a={updateTriggers:{}};for(var o in i)if(o in this.props){var s=i[o],u=this.props[o];a[o]=u,s&&s.type==="accessor"&&(a.updateTriggers[o]=this.props.updateTriggers[o],typeof u=="function"&&(a[o]=this.getSubLayerAccessor(u)))}return a}},{key:"initializeState",value:function(e,n){}},{key:"updateState",value:function(e,n){}},{key:"onNeedsRedraw",value:function(e){}},{key:"getNeedsPickingBuffer",value:function(e){return!1}},{key:"draw",value:function(e,n){}},{key:"finalizeState",value:function(e,n){}}],[{key:"componentName",get:function(){return Object.prototype.hasOwnProperty.call(this,"extensionName")?this.extensionName:""}}]),t}();c(Et,"defaultProps",{});c(Et,"extensionName","LayerExtension");F();j();k();function ER(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function CR(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?ER(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):ER(Object(e)).forEac
2166h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function YZ(t){var r=KZ();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function KZ(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Eb={bearing:0,pitch:0,position:[0,0,0]},ZZ={speed:1.2,curve:1.414},MR=function(t){L(e,t);var r=YZ(e);function e(){var n,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return A(this,e),n=r.call(this,{compare:["longitude","latitude","zoom","bearing","pitch","position"],extract:["width","height","longitude","latitude","zoom","bearing","pitch","position"],required:["width","height","latitude","longitude","zoom"]}),c(q(n),"opts",void 0),n.opts=CR(CR({},ZZ),i),n}return T(e,[{key:"interpolateProps",value:function(i,a,o){var s=Kh(i,a,o,this.opts);for(var u in Eb)s[u]=Gt(i[u]||Eb[u],a[u]||Eb[u],o);return s}},{key:"getDuration",value:function(i,a){var o=a.transitionDuration;return o==="auto"&&(o=X_(i,a,this.opts)),o}}]),e}(fu);F();j();k();function IR(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=JZ(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2167In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function JZ(t,r){if(t){if(typeof t=="string")return RR(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return RR(t,r)}}function RR(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var xu=function(){function t(r){A(this,t),c(this,"opts",void 0),c(this,"typedArrayManager",void 0),c(this,"indexStarts",[0]),c(this,"vertexStarts",[0]),c(this,"vertexCount",0),c(this,"instanceCount",0),c(this,"attributes",void 0),c(this,"_attributeDefs",void 0),c(this,"data",void 0),c(this,"getGeometry",void 0),c(this,"geometryBuffer",void 0),c(this,"buffers",void 0),c(this,"positionSize",void 0),c(this,"normalize",void 0);var e=r.attributes,n=e===void 0?{}:e;this.typedArrayManager=xn,this.attributes={},this._attributeDefs=n,this.opts=r,this.updateGeometry(r)}return T(t,[{key:"updateGeometry",value:function(e){Object.assign(this.opts,e);var n=this.opts,i=n.data,a=n.buffers,o=a===void 0?{}:a,s=n.getGeometry,u=n.geometryBuffer,l=n.positionFormat,f=n.dataChanged,p=n.normalize,h=p===void 0?!0:p;if(this.data=i,this.getGeometry=s,this.positionSize=u&&u.size||(l==="XY"?2:3),this.buffers=o,this.normalize=h,u&&(Je(i.startIndices),this.getGeometry=this.getGeometryFromBuffer(u),h||(o.positions=u)),this.geometryBuffer=o.positions,Array.isArray(f)){var d=IR(f),v;try{for(d.s();!(v=d.n()).done;){var m=v.value;this._rebuildGeometry(m)}}catch(g){d.e(g)}finally{d.f()}}else this._rebuildGeometry()}},{key:"updatePartialGeometry",value:function(e){var n=e.startRow,i=e.endRow;this._rebuildGeometry({startRow:n,endRow:i})}},{key:"getGeometryFromBuffer",value:function(e){var n=e.value||e;return ArrayBuffer.isView(n)?xd(n,{size:this.positionSize,offset:e.offset,stride:e.stride,startIndices:this.data.startIndices}):null}},{key:"_allocate",value:function(e,n){var i=this.attributes,a=this.buffers,o=this._attributeDefs,s=this.typedArrayManager;for(var u in o)if(u in a)s.release(i[u]),i[u]=null;else{var l=o[u];l.copy=n,i[u]=s.allocate(i[u],e,l)}}},{key:"_forEachGeometry",value:function(e,n,i){var a=this.data,o=this.getGeometry,s=Ot(a,n,i),u=s.iterable,l=s.objectInfo,f=IR(u),p;try{for(f.s();!(p=f.n()).done;){var h=p.value;l.index++;var d=o?o(h,l):null;e(d,l.index)}}catch(v){f.e(v)}finally{f.f()}}},{key:"_rebuildGeometry",value:function(e){var n=this;if(this.data){var i=this.indexStarts,a=this.vertexStarts,o=this.instanceCount,s=this.data,u=this.geometryBuffer,l=e||{},f=l.startRow,p=f===void 0?0:f,h=l.endRow,d=h===void 0?1/0:h,v={};
2167if(e||(i=[0],a=[0]),this.normalize||!u)this._forEachGeometry(function(x,w){var P=x&&n.normalizeGeometry(x);v[w]=P,a[w+1]=a[w]+(P?n.getGeometrySize(P):0)},p,d),o=a[a.length-1];else if(a=s.startIndices,o=a[s.length]||0,ArrayBuffer.isView(u))o=o||u.length/this.positionSize;else if(u instanceof Pe){var m=u.accessor.stride||this.positionSize*4;o=o||u.byteLength/m}else if(u.buffer){var g=u.stride||this.positionSize*4;o=o||u.buffer.byteLength/g}else if(u.value){var y=u.value,_=u.stride/y.BYTES_PER_ELEMENT||this.positionSize;o=o||y.length/_}this._allocate(o,Boolean(e)),this.indexStarts=i,this.vertexStarts=a,this.instanceCount=o;var b={};this._forEachGeometry(function(x,w){var P=v[w]||x;b.vertexStart=a[w],b.indexStart=i[w];var E=w<a.length-1?a[w+1]:o;b.geometrySize=E-a[w],b.geometryIndex=w,n.updateGeometryAttributes(P,b)},p,d),this.vertexCount=i[i.length-1]}}}]),t}();F();j();k();var LR=`#define SHADER_NAME arc-layer-vertex-shader
2168
2169attribute vec3 positions;
2170attribute vec4 instanceSourceColors;
2171attribute vec4 instanceTargetColors;
2172attribute vec3 instanceSourcePositions;
2173attribute vec3 instanceSourcePositions64Low;
2174attribute vec3 instanceTargetPositions;
2175attribute vec3 instanceTargetPositions64Low;
2176attribute vec3 instancePickingColors;
2177attribute float instanceWidths;
2178attribute float instanceHeights;
2179attribute float instanceTilts;
2180
2181uniform bool greatCircle;
2182uniform bool useShortestPath;
2183uniform float numSegments;
2184uniform float opacity;
2185uniform float widthScale;
2186uniform float widthMinPixels;
2187uniform float widthMaxPixels;
2188uniform int widthUnits;
2189
2190varying vec4 vColor;
2191varying vec2 uv;
2192varying float isValid;
2193
2194float paraboloid(float distance, float sourceZ, float targetZ, float ratio) {
2195
2196  float deltaZ = targetZ - sourceZ;
2197  float dh = distance * instanceHeights;
2198  if (dh == 0.0) {
2199    return sourceZ + deltaZ * ratio;
2200  }
2201  float unitZ = deltaZ / dh;
2202  float p2 = unitZ * unitZ + 1.0;
2203  float dir = step(deltaZ, 0.0);
2204  float z0 = mix(sourceZ, targetZ, dir);
2205  float r = mix(ratio, 1.0 - ratio, dir);
2206  return sqrt(r * (p2 - r)) * dh + z0;
2207}
2208vec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) {
2209  vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize);
2210  dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);
2211
2212  return dir_screenspace * offset_direction * width / 2.0;
2213}
2214
2215float getSegmentRatio(float index) {
2216  return smoothstep(0.0, 1.0, index / (numSegments - 1.0));
2217}
2218
2219vec3 interpolateFlat(vec3 source, vec3 target, float segmentRatio) {
2220  float distance = length(source.xy - target.xy);
2221  float z = paraboloid(distance, source.z, target.z, segmentRatio);
2222
2223  float tiltAngle = radians(instanceTilts);
2224  vec2 tiltDirection = normalize(target.xy - source.xy);
2225  vec2 tilt = vec2(-tiltDirection.y, tiltDirection.x) * z * sin(tiltAngle);
2226
2227  return vec3(
2228    mix(source.xy, target.xy, segmentRatio) + tilt,
2229    z * cos(tiltAngle)
2230  );
2231}
2232float getAngularDist (vec2 source, vec2 target) {
2233  vec2 sourceRadians = radians(source);
2234  vec2 targetRadians = radians(target);
2235  vec2 sin_half_delta = sin((sourceRadians - targetRadians) / 2.0);
2236  vec2 shd_sq = sin_half_delta * sin_half_delta;
2237
2238  float a = shd_sq.y + cos(sourceRadians.y) * cos(targetRadians.y) * shd_sq.x;
2239  return 2.0 * asin(sqrt(a));
2240}
2241
2242vec3 interpolateGreatCircle(vec3 source, vec3 target, vec3 source3D, vec3 target3D, float angularDist, float t) {
2243  vec2 lngLat;
2244  if(abs(angularDist - PI) < 0.001) {
2245    lngLat = (1.0 - t) * source.xy + t * target.xy;
2246  } else {
2247    float a = sin((1.0 - t) * angularDist);
2248    float b = sin(t * angularDist);
2249    vec3 p = source3D.yxz * a + target3D.yxz * b;
2250    lngLat = degrees(vec2(atan(p.y, -p.x), atan(p.z, length(p.xy))));
2251  }
2252
2253  float z = paraboloid(angularDist * EARTH_RADIUS, source.z, target.z, t);
2254
2255  return vec3(lngLat, z);
2256}
2257
2258void main(void) {
2259  geometry.worldPosition = instanceSourcePositions;
2260  geometry.worldPositionAlt = instanceTargetPositions;
2261
2262  float segmentIndex = positions.x;
2263  float segmentRatio = getSegmentRatio(segmentIndex);
2264  float prevSegmentRatio = getSegmentRatio(max(0.0, segmentIndex - 1.0));
2265  float nextSegmentRatio = getSegmentRatio(min(numSegments - 1.0, segmentIndex + 1.0));
2266  float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));
2267  isValid = 1.0;
2268
2269  uv = vec2(segmentRatio, positions.y);
2270  geometry.uv = uv;
2271  geometry.pickingColor = instancePickingColors;
2272
2273  vec4 curr;
2274  vec4 next;
2275  vec3 source;
2276  vec3 target;
2277
2278  if ((greatCircle || project_uProjectionMode == PROJECTION_MODE_GLOBE) && project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {
2279    source = project_globe_(vec3(instanceSourcePositions.xy, 0.0));
2280    target = project_globe_(vec3(instanceTargetPositions.xy, 0.0));
2281    float angularDist = getAngularDist(instanceSourcePositions.xy, instanceTargetPositions.xy);
2282
2283    vec3 prevPos = interpolateGreatCircle(instanceSourcePositions, instanceTargetPositions, source, target, angularDist, prevSegmentRatio);
2284    vec3 currPos = interpolateGreatCircle(instanceSourcePositions, instanceTargetPositions, source, target, angularDist, segmentRatio);
2285    vec3 nextPos = interpolateGreatCircle(instanceSourcePositions, instanceTargetPositions, source, target, angularDist, nextSegmentRatio);
2286
2287    if (abs(currPos.x - prevPos.x) > 180.0) {
2288      indexDir = -1.0;
2289      isValid = 0.0;
2290    } else if (abs(currPos.x - nextPos.x) > 180.0) {
2291      indexDir = 1.0;
2292      isValid = 0.0;
2293    }
2294    nextPos = indexDir < 0.0 ? prevPos : nextPos;
2295    nextSegmentRatio = indexDir < 0.0 ? prevSegmentRatio : nextSegmentRatio;
2296
2297    if (isValid == 0.0) {
2298      nextPos.x += nextPos.x > 0.0 ? -360.0 : 360.0;
2299      float t = ((currPos.x > 0.0 ? 180.0 : -180.0) - currPos.x) / (nextPos.x - currPos.x);
2300      currPos = mix(currPos, nextPos, t);
2301      segmentRatio = mix(segmentRatio, nextSegmentRatio, t);
2302    }
2303
2304    vec3 currPos64Low = mix(instanceSourcePositions64Low, instanceTargetPositions64Low, segmentRatio);
2305    vec3 nextPos64Low = mix(instanceSourcePositions64Low, instanceTargetPositions64Low, nextSegmentRatio);
2306  
2307    curr = project_position_to_clipspace(currPos, currPos64Low, vec3(0.0), geometry.position);
2308    next = project_position_to_clipspace(nextPos, nextPos64Low, vec3(0.0));
2309  
2310  } else {
2311    vec3 source_world = instanceSourcePositions;
2312    vec3 target_world = instanceTargetPositions;
2313    if (useShortestPath) {
2314      source_world.x = mod(source_world.x + 180., 360.0) - 180.;
2315      target_world.x = mod(target_world.x + 180., 360.0) - 180.;
2316
2317      float deltaLng = target_world.x - source_world.x;
2318      if (deltaLng > 180.) target_world.x -= 360.;
2319      if (deltaLng < -180.) source_world.x -= 360.;
2320    }
2321    source = project_position(source_world, instanceSourcePositions64Low);
2322    target = project_position(target_world, instanceTargetPositions64Low);
2323    float antiMeridianX = 0.0;
2324
2325    if (useShortestPath) {
2326      if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) {
2327        antiMeridianX = -(project_uCoordinateOrigin.x + 180.) / 360. * TILE_SIZE;
2328      }
2329      float thresholdRatio = (antiMeridianX - source.x) / (target.x - source.x);
2330
2331      if (prevSegmentRatio <= thresholdRatio && nextSegmentRatio > thresholdRatio) {
2332        isValid = 0.0;
2333        indexDir = sign(segmentRatio - thresholdRatio);
2334        segmentRatio = thresholdRatio;
2335      }
2336    }
2337
2338    nextSegmentRatio = indexDir < 0.0 ? prevSegmentRatio : nextSegmentRatio;
2339    vec3 currPos = interpolateFlat(source, target, segmentRatio);
2340    vec3 nextPos = interpolateFlat(source, target, nextSegmentRatio);
2341
2342    if (useShortestPath) {
2343      if (nextPos.x < antiMeridianX) {
2344        currPos.x += TILE_SIZE;
2345        nextPos.x += TILE_SIZE;
2346      }
2347    }
2348
2349    curr = project_common_position_to_clipspace(vec4(currPos, 1.0));
2350    next = project_common_position_to_clipspace(vec4(nextPos, 1.0));
2351    geometry.position = vec4(currPos, 1.0);
2352  }
2353  float widthPixels = clamp(
2354    project_size_to_pixel(instanceWidths * widthScale, widthUnits),
2355    widthMinPixels, widthMaxPixels
2356  );
2357  vec3 offset = vec3(
2358    getExtrusionOffset((next.xy - curr.xy) * indexDir, positions.y, widthPixels),
2359    0.0);
2360  DECKGL_FILTER_SIZE(offset, geometry);
2361  DECKGL_FILTER_GL_POSITION(curr, geometry);
2362  gl_Position = curr + vec4(project_pixel_size_to_clipspace(offset.xy), 0.0, 0.0);
2363
2364  vec4 color = mix(instanceSourceColors, instanceTargetColors, segmentRatio);
2365  vColor = vec4(color.rgb, color.a * opacity);
2366  DECKGL_FILTER_COLOR(vColor, geometry);
2367}
2368`;var kR=`#define SHADER_NAME arc-layer-fragment-shader
2369
2370precision highp float;
2371
2372varying vec4 vColor;
2373varying vec2 uv;
2374varying float isValid;
2375
2376void main(void) {
2377  if (isValid == 0.0) {
2378    discard;
2379  }
2380
2381  gl_FragColor = vColor;
2382  geometry.uv = uv;
2383
2384  DECKGL_FILTER_COLOR(gl_FragColor, geometry);
2385}
2386`;function BR(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function FR(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?BR(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):BR(Object(e)).forEac
2386h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function QZ(t){var r=eJ();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function eJ(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Gd=[0,0,0,255],tJ={getSourcePosition:{type:"accessor",value:function(r){return r.sourcePosition}},getTargetPosition:{type:"accessor",value:function(r){return r.targetPosition}},getSourceColor:{type:"accessor",value:Gd},getTargetColor:{type:"accessor",value:Gd},getWidth:{type:"accessor",value:1},getHeight:{type:"accessor",value:1},getTilt:{type:"accessor",value:0},greatCircle:!1,numSegments:{type:"number",value:50,min:1},widthUnits:"pixels",widthScale:{type:"number",value:1,min:0},widthMinPixels:{type:"number",value:0,min:0},widthMaxPixels:{type:"number",value:Number.MAX_SAFE_INTEGER,min:0}},Au=function(t){L(e,t);var r=QZ(e);function e(){var n;A(this,e);for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return n=r.call.apply(r,[this].concat(a)),c(q(n),"state",void 0),n}return T(e,[{key:"getBounds",value:function(){var i;return(i=this.getAttributeManager())===null||i===void 0?void 0:i.getBounds(["instanceSourcePositions","instanceTargetPositions"])}},{key:"getShaders",value:function(){return Z(S(e.prototype),"getShaders",this).call(this,{vs:LR,fs:kR,modules:[qe,rt]})}},{key:"wrapLongitude",get:function(){return!1}},{key:"initializeState",value:function(){var i=this.getAttributeManager();i.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:Gd},instanceTargetColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getTargetColor",defaultValue:Gd},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(i){Z(S(e.prototype),"updateState",this).call(this,i);var a=i.props,o=i.oldProps,s=i.changeFlags;if(s.extensionsChanged||s.propsChanged&&a.numSegments!==o.numSegments){var u,l=this.context.gl;(u=this.state.model)===null||u===void 0||u.delete(),this.state.model=this._getModel(l),this.getAttributeManager().invalidateAll()}}},{key:"draw",value:function(i){var a=i.uniforms,o=this.props,s=o.widthUnits,u=o.widthScale,l=o.widthMinPixels,f=o.widthMaxPixels,p=o.greatCircle,h=o.wrapLongitude;this.state.model.setUniforms(a).setUniforms({greatCircle:p,widthUnits:dt[s],widthScale:u,widthMinPixels:l,widthMaxPixels:f,useShortestPath:h}).draw()}},{key:"_getModel",value:function(i){for(var a=this.props,o=a.id,s=a.numSegments,u=[],l=0;l<s;l++)u=u.concat([l,1,0,l,-1,0]);var f=new Ie(i,FR(FR({},this.getShaders()),{},{id:o,geometry:new Re({drawMode:5,attributes:{positions:new Float32Array(u)}}),isInstanced:!0}));return f.setUniforms({numSegments:s}),f}}]),e}(He);c(Au,"layerName","ArcLayer");c(Au,"defaultProps",tJ);be();F();j();k();var rJ=new Uint16Array([0,2,1,0,3,2]),nJ=new Float32Array([0,1,0,0,1,0,1,1]);function Cb(t,r){if(!r)return iJ(t);for(var e=Math.max(Math.abs(t[0][0]-t[3][0]),Math.abs(t[1][0]-t[2][0])),n=Math.max(Math.abs(t[1][1]-t[0][1]),Math.abs(t[2][1]-t[3][1])),i=Math.ceil(e/r)+1,a=Math.ceil(n/r)+1,o=(i-1)*(a-1)*6,s=new Uint32Array(o),u=new Float32Array(i*a*2),l=new Float64Array(i*a*3),f=0,p=0,h=0;h<i;h++)for(var d=h/(i-1),v=0;v<a;v++){var m=v/(a-1),g=aJ(t,d,m);l[f*3+0]=g[0],l[f*3+1]=g[1],l[f*3+2]=g[2]||0,u[f*2+0]=d,u[f*2+1]=1-m,h>0&&v>0&&(s[p++]=f-a,s[p++]=f-a-1,s[p++]=f-1,s[p++]=f-a,s[p++]=f-1,s[p++]=f),f++}return{vertexCount:o,positions:l,indices:s,texCoords:u}}function iJ(t){for(var r=new Float64Array(12),e=0;e<t.length;e++)r[e*3+0]=t[e][0],r[e*3+1]=t[e][1],r[e*3+2]=t[e][2]||0;return{vertexCount:6,positions:r,indices:rJ,texCoords:nJ}}function aJ(t,r,e){return Gt(Gt(t[0],t[1],e),Gt(t[3],t[2],e),r)}var DR=`
2387#define SHADER_NAME bitmap-layer-vertex-shader
2388
2389attribute vec2 texCoords;
2390attribute vec3 positions;
2391attribute vec3 positions64Low;
2392
2393varying vec2 vTexCoord;
2394varying vec2 vTexPos;
2395
2396uniform float coordinateConversion;
2397
2398const vec3 pickingColor = vec3(1.0, 0.0, 0.0);
2399
2400void main(void) {
2401  geometry.worldPosition = positions;
2402  geometry.uv = texCoords;
2403  geometry.pickingColor = pickingColor;
2404
2405  gl_Position = project_position_to_clipspace(positions, positions64Low, vec3(0.0), geometry.position);
2406  DECKGL_FILTER_GL_POSITION(gl_Position, geometry);
2407
2408  vTexCoord = texCoords;
2409
2410  if (coordinateConversion < -0.5) {
2411    vTexPos = geometry.position.xy + project_uCommonOrigin.xy;
2412  } else if (coordinateConversion > 0.5) {
2413    vTexPos = geometry.worldPosition.xy;
2414  }
2415
2416  vec4 color = vec4(0.0);
2417  DECKGL_FILTER_COLOR(color, geometry);
2418}
2419`;var oJ=`
2420vec3 packUVsIntoRGB(vec2 uv) {
2421  // Extract the top 8 bits. We want values to be truncated down so we can add a fraction
2422  vec2 uv8bit = floor(uv * 256.);
2423
2424  // Calculate the normalized remainders of u and v parts that do not fit into 8 bits
2425  // Scale and clamp to 0-1 range
2426  vec2 uvFraction = fract(uv * 256.);
2427  vec2 uvFraction4bit = floor(uvFraction * 16.);
2428
2429  // Remainder can be encoded in blue channel, encode as 4 bits for pixel coordinates
2430  float fractions = uvFraction4bit.x + uvFraction4bit.y * 16.;
2431
2432  return vec3(uv8bit, fractions) / 255.;
2433}
2434`,NR=`
2435#define SHADER_NAME bitmap-layer-fragment-shader
2436
2437#ifdef GL_ES
2438precision highp float;
2439#endif
2440
2441uniform sampler2D bitmapTexture;
2442
2443varying vec2 vTexCoord;
2444varying vec2 vTexPos;
2445
2446uniform float desaturate;
2447uniform vec4 transparentColor;
2448uniform vec3 tintColor;
2449uniform float opacity;
2450
2451uniform float coordinateConversion;
2452uniform vec4 bounds;
2453
2454/* projection utils */
2455const float TILE_SIZE = 512.0;
2456const float PI = 3.1415926536;
2457const float WORLD_SCALE = TILE_SIZE / PI / 2.0;
2458
2459// from degrees to Web Mercator
2460vec2 lnglat_to_mercator(vec2 lnglat) {
2461  float x = lnglat.x;
2462  float y = clamp(lnglat.y, -89.9, 89.9);
2463  return vec2(
2464    radians(x) + PI,
2465    PI + log(tan(PI * 0.25 + radians(y) * 0.5))
2466  ) * WORLD_SCALE;
2467}
2468
2469// from Web Mercator to degrees
2470vec2 mercator_to_lnglat(vec2 xy) {
2471  xy /= WORLD_SCALE;
2472  return degrees(vec2(
2473    xy.x - PI,
2474    atan(exp(xy.y - PI)) * 2.0 - PI * 0.5
2475  ));
2476}
2477/* End projection utils */
2478
2479// apply desaturation
2480vec3 color_desaturate(vec3 color) {
2481  float luminance = (color.r + color.g + color.b) * 0.333333333;
2482  return mix(color, vec3(luminance), desaturate);
2483}
2484
2485// apply tint
2486vec3 color_tint(vec3 color) {
2487  return color * tintColor;
2488}
2489
2490// blend with background color
2491vec4 apply_opacity(vec3 color, float alpha) {
2492  if (transparentColor.a == 0.0) {
2493    return vec4(color, alpha);
2494  }
2495  float blendedAlpha = alpha + transparentColor.a * (1.0 - alpha);
2496  float highLightRatio = alpha / blendedAlpha;
2497  vec3 blendedRGB = mix(transparentColor.rgb, color, highLightRatio);
2498  return vec4(blendedRGB, blendedAlpha);
2499}
2500
2501vec2 getUV(vec2 pos) {
2502  return vec2(
2503    (pos.x - bounds[0]) / (bounds[2] - bounds[0]),
2504    (pos.y - bounds[3]) / (bounds[1] - bounds[3])
2505  );
2506}
2507
2508`.concat(oJ,`
2509
2510void main(void) {
2511  vec2 uv = vTexCoord;
2512  if (coordinateConversion < -0.5) {
2513    vec2 lnglat = mercator_to_lnglat(vTexPos);
2514    uv = getUV(lnglat);
2515  } else if (coordinateConversion > 0.5) {
2516    vec2 commonPos = lnglat_to_mercator(vTexPos);
2517    uv = getUV(commonPos);
2518  }
2519  vec4 bitmapColor = texture2D(bitmapTexture, uv);
2520
2521  gl_FragColor = apply_opacity(color_tint(color_desaturate(bitmapColor.rgb)), bitmapColor.a * opacity);
2522
2523  geometry.uv = uv;
2524  DECKGL_FILTER_COLOR(gl_FragColor, geometry);
2525
2526  if (picking_uActive && !picking_uAttribute) {
2527    // Since instance information is not used, we can use picking color for pixel index
2528    gl_FragColor.rgb = packUVsIntoRGB(uv);
2529  }
2530}
2531`);function jR(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function tc(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?jR(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):jR(Object(e)).forEac
2531h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function sJ(t){var r=uJ();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function uJ(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var lJ={image:{type:"image",value:null,async:!0},bounds:{type:"array",value:[1,0,0,1],compare:!0},_imageCoordinateSystem:de.DEFAULT,desaturate:{type:"number",min:0,max:1,value:0},transparentColor:{type:"color",value:[0,0,0,0]},tintColor:{type:"color",value:[255,255,255]},textureParameters:{type:"object",ignore:!0}},Su=function(t){L(e,t);var r=sJ(e);function e(){var n;A(this,e);for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return n=r.call.apply(r,[this].concat(a)),c(q(n),"state",void 0),n}return T(e,[{key:"getShaders",value:function(){return Z(S(e.prototype),"getShaders",this).call(this,{vs:DR,fs:NR,modules:[qe,rt]})}},{key:"initializeState",value:function(){var i=this,a=this.getAttributeManager();a.remove(["instancePickingColors"]);var o=!0;a.add({indices:{size:1,isIndexed:!0,update:function(u){return u.value=i.state.mesh.indices},noAlloc:o},positions:{size:3,type:5130,fp64:this.use64bitPositions(),update:function(u){return u.value=i.state.mesh.positions},noAlloc:o},texCoords:{size:2,update:function(u){return u.value=i.state.mesh.texCoords},noAlloc:o}})}},{key:"updateState",value:function(i){var a=i.props,o=i.oldProps,s=i.changeFlags,u=this.getAttributeManager();if(s.extensionsChanged){var l,f=this.context.gl;(l=this.state.model)===null||l===void 0||l.delete(),this.state.model=this._getModel(f),u.invalidateAll()}if(a.bounds!==o.bounds){var p=this.state.mesh,h=this._createMesh();this.state.model.setVertexCount(h.vertexCount);for(var d in h)p&&p[d]!==h[d]&&u.invalidate(d);this.setState(tc({mesh:h},this._getCoordinateUniforms()))}else a._imageCoordinateSystem!==o._imageCoordinateSystem&&this.setState(this._getCoordinateUniforms())}},{key:"getPickingInfo",value:function(i){var a=this.props.image,o=i.info;if(!o.color||!a)return o.bitmap=null,o;var s=a,u=s.width,l=s.height;o.index=0;var f=fJ(o.color),p=[Math.floor(f[0]*u),Math.floor(f[1]*l)];return o.bitmap={size:{width:u,height:l},uv:f,pixel:p},o}},{key:"disablePickingIndex",value:function(){this.setState({disablePicking:!0})}},{key:"restorePickingColors",value:function(){this.setState({disablePicking:!1})}},{key:"_updateAutoHighlight",value:function(i){Z(S(e.prototype),"_updateAutoHighlight",this).call(this,tc(tc({},i),{},{color:this.encodePickingColor(0)}))}},{key:"_createMesh",value:function(){var i=this.props.bounds,a=i;return UR(i)&&(a=[[i[0],i[1]],[i[0],i[3]],[i[2],i[3]],[i[2],i[1]]]),Cb(a,this.context.viewport.resolution)}},{key:"_getModel",value:function(i){return i?new Ie(i,tc(tc({},this.getShaders()),{},{id:this.props.id,geometry:new Re({drawMode:4,vertexCount:6}),isInstanced:!1})):null}},{key:"draw",value:function(i){var a=i.uniforms,o=i.moduleParameters,s=this.state,u=s.model,l=s.coordinateConversion,f=s.bounds,p=s.disablePicking,h=this.props,d=h.image,v=h.desaturate,m=h.transparentColor,g=h.tintColor;o.pickingActive&&p||d&&u&&u.setUniforms(a).setUniforms({bitmapTexture:d,desaturate:v,transparentColor:m.map(function(y){return y/255}),tintColor:g.slice(0,3).map(function(y){return y/255}),coordinateConversion:l,bounds:f}).draw()}},{key:"_getCoordinateUniforms",value:function(){var i=de.LNGLAT,a=de.CARTESIAN,o=de.DEFAULT,s=this.props._imageCoordinateSystem;if(s!==o){var u=this.props.bounds;if(!UR(u))throw new Error("_imageCoordinateSystem only supports rectangular bounds");var l=this.context.viewport.resolution?i:a;if(s=s===i?i:a,s===i&&l===a)return{coordinateConversion:-1,bounds:u};if(s===a&&l===i){var f=mt([u[0],u[1]]),p=mt([u[2],u[3]]);return{coordinateConversion:1,bounds:[f[0],f[1],p[0],p[1]]}}}return{coordinateConversion:0,bounds:[0,0,0,0]}}}]),e}(He);c(Su,"layerName","BitmapLayer");c(Su,"defaultProps",lJ);function fJ(t){var r=W(t,3),e=r[0],n=r[1],i=r[2],a=(i&240)/256,o=(i&15)/16;return[(e+o)/256,(n+a)/256]}function UR(t){return Number.isFinite(t[0])}F();j();k();var GR=`#define SHADER_NAME icon-layer-vertex-shader
2532
2533attribute vec2 positions;
2534
2535attribute vec3 instancePositions;
2536attribute vec3 instancePositions64Low;
2537attribute float instanceSizes;
2538attribute float instanceAngles;
2539attribute vec4 instanceColors;
2540attribute vec3 instancePickingColors;
2541attribute vec4 instanceIconFrames;
2542attribute float instanceColorModes;
2543attribute vec2 instanceOffsets;
2544attribute vec2 instancePixelOffset;
2545
2546uniform float sizeScale;
2547uniform vec2 iconsTextureDim;
2548uniform float sizeMinPixels;
2549uniform float sizeMaxPixels;
2550uniform bool billboard;
2551uniform int sizeUnits;
2552
2553varying float vColorMode;
2554varying vec4 vColor;
2555varying vec2 vTextureCoords;
2556varying vec2 uv;
2557
2558vec2 rotate_by_angle(vec2 vertex, float angle) {
2559  float angle_radian = angle * PI / 180.0;
2560  float cos_angle = cos(angle_radian);
2561  float sin_angle = sin(angle_radian);
2562  mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);
2563  return rotationMatrix * vertex;
2564}
2565
2566void main(void) {
2567  geometry.worldPosition = instancePositions;
2568  geometry.uv = positions;
2569  geometry.pickingColor = instancePickingColors;
2570  uv = positions;
2571
2572  vec2 iconSize = instanceIconFrames.zw;
2573  float sizePixels = clamp(
2574    project_size_to_pixel(instanceSizes * sizeScale, sizeUnits), 
2575    sizeMinPixels, sizeMaxPixels
2576  );
2577  float instanceScale = iconSize.y == 0.0 ? 0.0 : sizePixels / iconSize.y;
2578  vec2 pixelOffset = positions / 2.0 * iconSize + instanceOffsets;
2579  pixelOffset = rotate_by_angle(pixelOffset, instanceAngles) * instanceScale;
2580  pixelOffset += instancePixelOffset;
2581  pixelOffset.y *= -1.0;
2582
2583  if (billboard)  {
2584    gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);
2585    DECKGL_FILTER_GL_POSITION(gl_Position, geometry);
2586    vec3 offset = vec3(pixelOffset, 0.0);
2587    DECKGL_FILTER_SIZE(offset, geometry);
2588    gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);
2589
2590  } else {
2591    vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);
2592    DECKGL_FILTER_SIZE(offset_common, geometry);
2593    gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset_common, geometry.position); 
2594    DECKGL_FILTER_GL_POSITION(gl_Position, geometry);
2595  }
2596
2597  vTextureCoords = mix(
2598    instanceIconFrames.xy,
2599    instanceIconFrames.xy + iconSize,
2600    (positions.xy + 1.0) / 2.0
2601  ) / iconsTextureDim;
2602
2603  vColor = instanceColors;
2604  DECKGL_FILTER_COLOR(vColor, geometry);
2605
2606  vColorMode = instanceColorModes;
2607}
2608`;var zR=`#define SHADER_NAME icon-layer-fragment-shader
2609
2610precision highp float;
2611
2612uniform float opacity;
2613uniform sampler2D iconsTexture;
2614uniform float alphaCutoff;
2615
2616varying float vColorMode;
2617varying vec4 vColor;
2618varying vec2 vTextureCoords;
2619varying vec2 uv;
2620
2621void main(void) {
2622  geometry.uv = uv;
2623
2624  vec4 texColor = texture2D(iconsTexture, vTextureCoords);
2625  vec3 color = mix(texColor.rgb, vColor.rgb, vColorMode);
2626  float a = texColor.a * opacity * vColor.a;
2627
2628  if (a < alphaCutoff) {
2629    discard;
2630  }
2631
2632  gl_FragColor = vec4(color, a);
2633  DECKGL_FILTER_COLOR(gl_FragColor, geometry);
2634}
2635`;F();j();k();var Tu;function qR(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=cJ(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2636In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function cJ(t,r){if(t){if(typeof t=="string")return VR(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return VR(t,r)}}function VR(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function HR(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function zd(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?HR(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):HR(Object(e)).forEac
2636h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var pJ=1024,hJ=4,WR=function(){},$R=(Tu={},c(Tu,10241,9987),c(Tu,10240,9729),c(Tu,10242,33071),c(Tu,10243,33071),Tu);function dJ(t){return Math.pow(2,Math.ceil(Math.log2(t)))}function vJ(t,r,e,n){var i=Math.min(e/r.width,n/r.height),a=Math.floor(r.width*i),o=Math.floor(r.height*i);return i===1?{data:r,width:a,height:o}:(t.canvas.height=o,t.canvas.width=a,t.clearRect(0,0,a,o),t.drawImage(r,0,0,r.width,r.height,0,0,a,o),{data:t.canvas,width:a,height:o})}function rc(t){return t&&(t.id||t.url)}function mJ(t,r,e,n){var i=t.width,a=t.height,o=new Ce(t.gl,{width:r,height:e,parameters:n});return Ns(t,o,{targetY:0,width:i,height:a}),t.delete(),o}function XR(t,r,e){for(var n=0;n<r.length;n++){var i=r[n],a=i.icon,o=i.xOffset,s=rc(a);t[s]=zd(zd({},a),{},{x:o,y:e})}}function gJ(t){for(var r=t.icons,e=t.buffer,n=t.mapping,i=n===void 0?{}:n,a=t.xOffset,o=a===void 0?0:a,s=t.yOffset,u=s===void 0?0:s,l=t.rowHeight,f=l===void 0?0:l,p=t.canvasWidth,h=[],d=0;d<r.length;d++){var v=r[d],m=rc(v);if(!i[m]){var g=v.height,y=v.width;o+y+e>p&&(XR(i,h,u),o=0,u=f+u+e,f=0,h=[]),h.push({icon:v,xOffset:o}),o=o+y+e,f=Math.max(f,g)}}return h.length>0&&XR(i,h,u),{mapping:i,rowHeight:f,xOffset:o,yOffset:u,canvasWidth:p,canvasHeight:dJ(f+u+e)}}function yJ(t,r,e){if(!t||!r)return null;e=e||{};var n={},i=Ot(t),a=i.iterable,o=i.objectInfo,s=qR(a),u;try{for(s.s();!(u=s.n()).done;){var l=u.value;o.index++;var f=r(l,o),p=rc(f);if(!f)throw new Error("Icon is missing.");if(!f.url)throw new Error("Icon url is missing.");!n[p]&&(!e[p]||f.url!==e[p].url)&&(n[p]=zd(zd({},f),{},{source:l,sourceIndex:o.index}))}}catch(h){s.e(h)}finally{s.f()}return n}var YR=function(){function t(r,e){var n=e.onUpdate,i=n===void 0?WR:n,a=e.onError,o=a===void 0?WR:a;A(this,t),c(this,"gl",void 0),c(this,"onUpdate",void 0),c(this,"onError",void 0),c(this,"_loadOptions",null),c(this,"_texture",null),c(this,"_externalTexture",null),c(this,"_mapping",{}),c(this,"_textureParameters",null),c(this,"_pendingCount",0),c(this,"_autoPacking",!1),c(this,"_xOffset",0),c(this,"_yOffset",0),c(this,"_rowHeight",0),c(this,"_buffer",hJ),c(this,"_canvasWidth",pJ),c(this,"_canvasHeight",0),c(this,"_canvas",null),this.gl=r,this.onUpdate=i,this.onError=o}return T(t,[{key:"finalize",value:function(){var e;(e=this._texture)===null||e===void 0||e.delete()}},{key:"getTexture",value:function(){return this._texture||this._externalTexture}},{key:"getIconMapping",value:function(e){var n=this._autoPacking?rc(e):e;return this._mapping[n]||{}}},{key:"setProps",value:function(e){var n=e.loadOptions,i=e.autoPacking,a=e.iconAtlas,o=e.iconMapping,s=e.textureParameters;if(n&&(this._loadOptions=n),i!==void 0&&(this._autoPacking=i),o&&(this._mapping=o),a){var u;(u=this._texture)===null||u===void 0||u.delete(),this._texture=null,this._externalTexture=a}s&&(this._textureParameters=s)}},{key:"isLoaded",get:function(){return this._pendingCount===0}},{key:"packIcons",value:function(e,n){if(!(!this._autoPacking||typeof document>"u")){var i=Object.values(yJ(e,n,this._mapping)||{});if(i.length>0){var a=gJ({icons:i,buffer:this._buffer,canvasWidth:this._canvasWidth,mapping:this._mapping,rowHeight:this._rowHeight,xOffset:this._xOffset,yOffset:this._yOffset}),o=a.mapping,s=a.xOffset,u=a.yOffset,l=a.rowHeight,f=a.canvasHeight;this._rowHeight=l,this._mapping=o,this._xOffset=s,this._yOffset=u,this._canvasHeight=f,this._texture||(this._texture=new Ce(this.gl,{width:this._canvasWidth,height:this._canvasHeight,parameters:this._textureParameters||$R})),this._texture.height!==this._canvasHeight&&(this._texture=mJ(this._texture,this._canvasWidth,this._canvasHeight,this._textureParameters||$R)),this.onUpdate(),this._canvas=this._canvas||document.createElement("canvas"),this._loadIcons(i)}}}},{key:"_loadIcons",value:function(e){var n=this,i=this._canvas.getContext("2d",{willReadFrequently:!0}),a=qR(e),o;try{var s=function(){var l=o.value;n._pendingCount++,Bt(l.url,n._loadOptions).then(function(f){var p=rc(l),h=n._mapping[p],d=h.x,v=h.y,m=h.width,g=h.height,y=vJ(i,f,m,g),_=y.data,b=y.width,x=y.height;n._texture.setSubImageData({data:_,x:d+(m-b)/2,y:v+(g-x)/2,width:b,height:x}),h.width=b,h.height=x,n._texture.generateMipmap(),n.onUpdate()}).catch(function(f){n.onError({url:l.url,source:l.source,sourceIndex:l.sourceIndex,loadOptions:n._loadOptions,error:f})}).finally(function(){n._pendingCount--})};for(a.s();!(o=a.n()).done;)s()}catch(u){a.e(u)}finally{a.f()}}}]),t}();function KR(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function ZR(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};
2636r%2?KR(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):KR(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function _J(t){var r=bJ();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function bJ(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var JR=[0,0,0,255],xJ={iconAtlas:{type:"image",value:null,async:!0},iconMapping:{type:"object",value:{},async:!0},sizeScale:{type:"number",value:1,min:0},billboard:!0,sizeUnits:"pixels",sizeMinPixels:{type:"number",min:0,value:0},sizeMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},alphaCutoff:{type:"number",value:.05,min:0,max:1},getPosition:{type:"accessor",value:function(r){return r.position}},getIcon:{type:"accessor",value:function(r){return r.icon}},getColor:{type:"accessor",value:JR},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0},getPixelOffset:{type:"accessor",value:[0,0]},onIconError:{type:"function",value:null,optional:!0},textureParameters:{type:"object",ignore:!0}},Ta=function(t){L(e,t);var r=_J(e);function e(){var n;A(this,e);for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return n=r.call.apply(r,[this].concat(a)),c(q(n),"state",void 0),n}return T(e,[{key:"getShaders",value:function(){return Z(S(e.prototype),"getShaders",this).call(this,{vs:GR,fs:zR,modules:[qe,rt]})}},{key:"initializeState",value:function(){this.state={iconManager:new YR(this.context.gl,{onUpdate:this._onUpdate.bind(this),onError:this._onError.bind(this)})};var i=this.getAttributeManager();i.addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceOffsets:{size:2,accessor:"getIcon",transform:this.getInstanceOffset},instanceIconFrames:{size:4,accessor:"getIcon",transform:this.getInstanceIconFrame},instanceColorModes:{size:1,type:5121,accessor:"getIcon",transform:this.getInstanceColorMode},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getColor",defaultValue:JR},instanceAngles:{size:1,transition:!0,accessor:"getAngle"},instancePixelOffset:{size:2,transition:!0,accessor:"getPixelOffset"}})}},{key:"updateState",value:function(i){Z(S(e.prototype),"updateState",this).call(this,i);var a=i.props,o=i.oldProps,s=i.changeFlags,u=this.getAttributeManager(),l=a.iconAtlas,f=a.iconMapping,p=a.data,h=a.getIcon,d=a.textureParameters,v=this.state.iconManager,m=l||this.internalState.isAsyncPropLoading("iconAtlas");if(v.setProps({loadOptions:a.loadOptions,autoPacking:!m,iconAtlas:l,iconMapping:m?f:null,textureParameters:d}
2636),m?o.iconMapping!==a.iconMapping&&u.invalidate("getIcon"):(s.dataChanged||s.updateTriggersChanged&&(s.updateTriggersChanged.all||s.updateTriggersChanged.getIcon))&&v.packIcons(p,h),s.extensionsChanged){var g,y=this.context.gl;(g=this.state.model)===null||g===void 0||g.delete(),this.state.model=this._getModel(y),u.invalidateAll()}}},{key:"isLoaded",get:function(){return Z(S(e.prototype),"isLoaded",this)&&this.state.iconManager.isLoaded}},{key:"finalizeState",value:function(i){Z(S(e.prototype),"finalizeState",this).call(this,i),this.state.iconManager.finalize()}},{key:"draw",value:function(i){var a=i.uniforms,o=this.props,s=o.sizeScale,u=o.sizeMinPixels,l=o.sizeMaxPixels,f=o.sizeUnits,p=o.billboard,h=o.alphaCutoff,d=this.state.iconManager,v=d.getTexture();v&&this.state.model.setUniforms(a).setUniforms({iconsTexture:v,iconsTextureDim:[v.width,v.height],sizeUnits:dt[f],sizeScale:s,sizeMinPixels:u,sizeMaxPixels:l,billboard:p,alphaCutoff:h}).draw()}},{key:"_getModel",value:function(i){var a=[-1,-1,-1,1,1,1,1,-1];return new Ie(i,ZR(ZR({},this.getShaders()),{},{id:this.props.id,geometry:new Re({drawMode:6,attributes:{positions:{size:2,value:new Float32Array(a)}}}),isInstanced:!0}))}},{key:"_onUpdate",value:function(){this.setNeedsRedraw()}},{key:"_onError",value:function(i){var a,o=(a=this.getCurrentLayer())===null||a===void 0?void 0:a.props.onIconError;o?o(i):ne.error(i.error.message)()}},{key:"getInstanceOffset",value:function(i){var a=this.state.iconManager.getIconMapping(i),o=a.width,s=a.height,u=a.anchorX,l=u===void 0?o/2:u,f=a.anchorY,p=f===void 0?s/2:f;return[o/2-l,s/2-p]}},{key:"getInstanceColorMode",value:function(i){var a=this.state.iconManager.getIconMapping(i);return a.mask?1:0}},{key:"getInstanceIconFrame",value:function(i){var a=this.state.iconManager.getIconMapping(i),o=a.x,s=a.y,u=a.width,l=a.height;return[o,s,u,l]}}]),e}(He);c(Ta,"defaultProps",xJ);c(Ta,"layerName","IconLayer");F();j();k();var QR=`#define SHADER_NAME line-layer-vertex-shader
2637
2638attribute vec3 positions;
2639attribute vec3 instanceSourcePositions;
2640attribute vec3 instanceTargetPositions;
2641attribute vec3 instanceSourcePositions64Low;
2642attribute vec3 instanceTargetPositions64Low;
2643attribute vec4 instanceColors;
2644attribute vec3 instancePickingColors;
2645attribute float instanceWidths;
2646
2647uniform float opacity;
2648uniform float widthScale;
2649uniform float widthMinPixels;
2650uniform float widthMaxPixels;
2651uniform float useShortestPath;
2652uniform int widthUnits;
2653
2654varying vec4 vColor;
2655varying vec2 uv;
2656vec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) {
2657  vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize);
2658  dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);
2659
2660  return dir_screenspace * offset_direction * width / 2.0;
2661}
2662
2663vec3 splitLine(vec3 a, vec3 b, float x) {
2664  float t = (x - a.x) / (b.x - a.x);
2665  return vec3(x, mix(a.yz, b.yz, t));
2666}
2667
2668void main(void) {
2669  geometry.worldPosition = instanceSourcePositions;
2670  geometry.worldPositionAlt = instanceTargetPositions;
2671
2672  vec3 source_world = instanceSourcePositions;
2673  vec3 target_world = instanceTargetPositions;
2674  vec3 source_world_64low = instanceSourcePositions64Low;
2675  vec3 target_world_64low = instanceTargetPositions64Low;
2676
2677  if (useShortestPath > 0.5 || useShortestPath < -0.5) {
2678    source_world.x = mod(source_world.x + 180., 360.0) - 180.;
2679    target_world.x = mod(target_world.x + 180., 360.0) - 180.;
2680    float deltaLng = target_world.x - source_world.x;
2681
2682    if (deltaLng * useShortestPath > 180.) {
2683      source_world.x += 360. * useShortestPath;
2684      source_world = splitLine(source_world, target_world, 180. * useShortestPath);
2685      source_world_64low = vec3(0.0);
2686    } else if (deltaLng * useShortestPath < -180.) {
2687      target_world.x += 360. * useShortestPath;
2688      target_world = splitLine(source_world, target_world, 180. * useShortestPath);
2689      target_world_64low = vec3(0.0);
2690    } else if (useShortestPath < 0.) {
2691      gl_Position = vec4(0.);
2692      return;
2693    }
2694  }
2695  vec4 source_commonspace;
2696  vec4 target_commonspace;
2697  vec4 source = project_position_to_clipspace(source_world, source_world_64low, vec3(0.), source_commonspace);
2698  vec4 target = project_position_to_clipspace(target_world, target_world_64low, vec3(0.), target_commonspace);
2699  float segmentIndex = positions.x;
2700  vec4 p = mix(source, target, segmentIndex);
2701  geometry.position = mix(source_commonspace, target_commonspace, segmentIndex);
2702  uv = positions.xy;
2703  geometry.uv = uv;
2704  geometry.pickingColor = instancePickingColors;
2705  float widthPixels = clamp(
2706    project_size_to_pixel(instanceWidths * widthScale, widthUnits),
2707    widthMinPixels, widthMaxPixels
2708  );
2709  vec3 offset = vec3(
2710    getExtrusionOffset(target.xy - source.xy, positions.y, widthPixels),
2711    0.0);
2712  DECKGL_FILTER_SIZE(offset, geometry);
2713  DECKGL_FILTER_GL_POSITION(p, geometry);
2714  gl_Position = p + vec4(project_pixel_size_to_clipspace(offset.xy), 0.0, 0.0);
2715  vColor = vec4(instanceColors.rgb, instanceColors.a * opacity);
2716  DECKGL_FILTER_COLOR(vColor, geometry);
2717}
2718`;var eL=`#define SHADER_NAME line-layer-fragment-shader
2719
2720precision highp float;
2721
2722varying vec4 vColor;
2723varying vec2 uv;
2724
2725void main(void) {
2726  geometry.uv = uv;
2727
2728  gl_FragColor = vColor;
2729
2730  DECKGL_FILTER_COLOR(gl_FragColor, geometry);
2731}
2732`;function tL(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function rL(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?tL(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):tL(Object(e)).forEac
2732h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function AJ(t){var r=SJ();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function SJ(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var TJ=[0,0,0,255],wJ={getSourcePosition:{type:"accessor",value:function(r){return r.sourcePosition}},getTargetPosition:{type:"accessor",value:function(r){return r.targetPosition}},getColor:{type:"accessor",value:TJ},getWidth:{type:"accessor",value:1},widthUnits:"pixels",widthScale:{type:"number",value:1,min:0},widthMinPixels:{type:"number",value:0,min:0},widthMaxPixels:{type:"number",value:Number.MAX_SAFE_INTEGER,min:0}},wu=function(t){L(e,t);var r=AJ(e);function e(){return A(this,e),r.apply(this,arguments)}return T(e,[{key:"getBounds",value:function(){var i;return(i=this.getAttributeManager())===null||i===void 0?void 0:i.getBounds(["instanceSourcePositions","instanceTargetPositions"])}},{key:"getShaders",value:function(){return Z(S(e.prototype),"getShaders",this).call(this,{vs:QR,fs:eL,modules:[qe,rt]})}},{key:"wrapLongitude",get:function(){return!1}},{key:"initializeState",value:function(){var i=this.getAttributeManager();i.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(i){if(Z(S(e.prototype),"updateState",this).call(this,i),i.changeFlags.extensionsChanged){var a,o=this.context.gl;(a=this.state.model)===null||a===void 0||a.delete(),this.state.model=this._getModel(o),this.getAttributeManager().invalidateAll()}}},{key:"draw",value:function(i){var a=i.uniforms,o=this.props,s=o.widthUnits,u=o.widthScale,l=o.widthMinPixels,f=o.widthMaxPixels,p=o.wrapLongitude;this.state.model.setUniforms(a).setUniforms({widthUnits:dt[s],widthScale:u,widthMinPixels:l,widthMaxPixels:f,useShortestPath:p?1:0}).draw(),p&&this.state.model.setUniforms({useShortestPath:-1}).draw()}},{key:"_getModel",value:function(i){var a=[0,-1,0,0,1,0,1,-1,0,1,1,0];return new Ie(i,rL(rL({},this.getShaders()),{},{id:this.props.id,geometry:new Re({drawMode:5,attributes:{positions:new Float32Array(a)}}),isInstanced:!0}))}}]),e}(He);c(wu,"layerName","LineLayer");c(wu,"defaultProps",wJ);F();j();k();var nL=`#define SHADER_NAME point-cloud-layer-vertex-shader
2733
2734attribute vec3 positions;
2735attribute vec3 instanceNormals;
2736attribute vec4 instanceColors;
2737attribute vec3 instancePositions;
2738attribute vec3 instancePositions64Low;
2739attribute vec3 instancePickingColors;
2740
2741uniform float opacity;
2742uniform float radiusPixels;
2743uniform int sizeUnits;
2744
2745varying vec4 vColor;
2746varying vec2 unitPosition;
2747
2748void main(void) {
2749  geometry.worldPosition = instancePositions;
2750  geometry.normal = project_normal(instanceNormals);
2751  unitPosition = positions.xy;
2752  geometry.uv = unitPosition;
2753  geometry.pickingColor = instancePickingColors;
2754  vec3 offset = vec3(positions.xy * project_size_to_pixel(radiusPixels, sizeUnits), 0.0);
2755  DECKGL_FILTER_SIZE(offset, geometry);
2756
2757  gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.), geometry.position);
2758  DECKGL_FILTER_GL_POSITION(gl_Position, geometry);
2759  gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);
2760  vec3 lightColor = lighting_getLightColor(instanceColors.rgb, project_uCameraPosition, geometry.position.xyz, geometry.normal);
2761  vColor = vec4(lightColor, instanceColors.a * opacity);
2762  DECKGL_FILTER_COLOR(vColor, geometry);
2763}
2764`;var iL=`#define SHADER_NAME point-cloud-layer-fragment-shader
2765
2766precision highp float;
2767
2768varying vec4 vColor;
2769varying vec2 unitPosition;
2770
2771void main(void) {
2772  geometry.uv = unitPosition;
2773
2774  float distToCenter = length(unitPosition);
2775
2776  if (distToCenter > 1.0) {
2777    discard;
2778  }
2779
2780  gl_FragColor = vColor;
2781  DECKGL_FILTER_COLOR(gl_FragColor, geometry);
2782}
2783`;function aL(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function oL(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};
2783r%2?aL(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):aL(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function PJ(t){var r=OJ();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function OJ(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var sL=[0,0,0,255],uL=[0,0,1],EJ={sizeUnits:"pixels",pointSize:{type:"number",min:0,value:10},getPosition:{type:"accessor",value:function(r){return r.position}},getNormal:{type:"accessor",value:uL},getColor:{type:"accessor",value:sL},material:!0,radiusPixels:{deprecatedFor:"pointSize"}};function CJ(t){var r=t.header,e=t.attributes;!r||!e||(t.length=r.vertexCount,e.POSITION&&(e.instancePositions=e.POSITION),e.NORMAL&&(e.instanceNormals=e.NORMAL),e.COLOR_0&&(e.instanceColors=e.COLOR_0))}var Pu=function(t){L(e,t);var r=PJ(e);function e(){return A(this,e),r.apply(this,arguments)}return T(e,[{key:"getShaders",value:function(){return Z(S(e.prototype),"getShaders",this).call(this,{vs:nL,fs:iL,modules:[qe,Dr,rt]})}},{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:uL},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getColor",defaultValue:sL}})}},{key:"updateState",value:function(i){var a=i.changeFlags,o=i.props;if(Z(S(e.prototype),"updateState",this).call(this,i),a.extensionsChanged){var s,u=this.context.gl;(s=this.state.model)===null||s===void 0||s.delete(),this.state.model=this._getModel(u),this.getAttributeManager().invalidateAll()}a.dataChanged&&CJ(o.data)}},{key:"draw",value:function(i){var a=i.uniforms,o=this.props,s=o.pointSize,u=o.sizeUnits;this.state.model.setUniforms(a).setUniforms({sizeUnits:dt[u],radiusPixels:s}).draw()}},{key:"_getModel",value:function(i){for(var a=[],o=0;o<3;o++){var s=o/3*Math.PI*2;a.push(Math.cos(s)*2,Math.sin(s)*2,0)}return new Ie(i,oL(oL({},this.getShaders()),{},{id:this.props.id,geometry:new Re({drawMode:4,attributes:{positions:new Float32Array(a)}}),isInstanced:!0}))}}]),e}(He);c(Pu,"layerName","PointCloudLayer");c(Pu,"defaultProps",EJ);F();j();k();var lL=`#define SHADER_NAME scatterplot-layer-vertex-shader
2784
2785attribute vec3 positions;
2786
2787attribute vec3 instancePositions;
2788attribute vec3 instancePositions64Low;
2789attribute float instanceRadius;
2790attribute float instanceLineWidths;
2791attribute vec4 instanceFillColors;
2792attribute vec4 instanceLineColors;
2793attribute vec3 instancePickingColors;
2794
2795uniform float opacity;
2796uniform float radiusScale;
2797uniform float radiusMinPixels;
2798uniform float radiusMaxPixels;
2799uniform float lineWidthScale;
2800uniform float lineWidthMinPixels;
2801uniform float lineWidthMaxPixels;
2802uniform float stroked;
2803uniform bool filled;
2804uniform bool antialiasing;
2805uniform bool billboard;
2806uniform int radiusUnits;
2807uniform int lineWidthUnits;
2808
2809varying vec4 vFillColor;
2810varying vec4 vLineColor;
2811varying vec2 unitPosition;
2812varying float innerUnitRadius;
2813varying float outerRadiusPixels;
2814
2815
2816void main(void) {
2817  geometry.worldPosition = instancePositions;
2818  outerRadiusPixels = clamp(
2819    project_size_to_pixel(radiusScale * instanceRadius, radiusUnits),
2820    radiusMinPixels, radiusMaxPixels
2821  );
2822  float lineWidthPixels = clamp(
2823    project_size_to_pixel(lineWidthScale * instanceLineWidths, lineWidthUnits),
2824    lineWidthMinPixels, lineWidthMaxPixels
2825  );
2826  outerRadiusPixels += stroked * lineWidthPixels / 2.0;
2827  float edgePadding = antialiasing ? (outerRadiusPixels + SMOOTH_EDGE_RADIUS) / outerRadiusPixels : 1.0;
2828  unitPosition = edgePadding * positions.xy;
2829  geometry.uv = unitPosition;
2830  geometry.pickingColor = instancePickingColors;
2831
2832  innerUnitRadius = 1.0 - stroked * lineWidthPixels / outerRadiusPixels;
2833  
2834  if (billboard) {
2835    gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);
2836    DECKGL_FILTER_GL_POSITION(gl_Position, geometry);
2837    vec3 offset = edgePadding * positions * outerRadiusPixels;
2838    DECKGL_FILTER_SIZE(offset, geometry);
2839    gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);
2840  } else {
2841    vec3 offset = edgePadding * positions * project_pixel_size(outerRadiusPixels);
2842    DECKGL_FILTER_SIZE(offset, geometry);
2843    gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset, geometry.position);
2844    DECKGL_FILTER_GL_POSITION(gl_Position, geometry);
2845  }
2846  vFillColor = vec4(instanceFillColors.rgb, instanceFillColors.a * opacity);
2847  DECKGL_FILTER_COLOR(vFillColor, geometry);
2848  vLineColor = vec4(instanceLineColors.rgb, instanceLineColors.a * opacity);
2849  DECKGL_FILTER_COLOR(vLineColor, geometry);
2850}
2851`;var fL=`#define SHADER_NAME scatterplot-layer-fragment-shader
2852
2853precision highp float;
2854
2855uniform bool filled;
2856uniform float stroked;
2857uniform bool antialiasing;
2858
2859varying vec4 vFillColor;
2860varying vec4 vLineColor;
2861varying vec2 unitPosition;
2862varying float innerUnitRadius;
2863varying float outerRadiusPixels;
2864
2865void main(void) {
2866  geometry.uv = unitPosition;
2867
2868  float distToCenter = length(unitPosition) * outerRadiusPixels;
2869  float inCircle = antialiasing ? 
2870    smoothedge(distToCenter, outerRadiusPixels) : 
2871    step(distToCenter, outerRadiusPixels);
2872
2873  if (inCircle == 0.0) {
2874    discard;
2875  }
2876
2877  if (stroked > 0.5) {
2878    float isLine = antialiasing ? 
2879      smoothedge(innerUnitRadius * outerRadiusPixels, distToCenter) :
2880      step(innerUnitRadius * outerRadiusPixels, distToCenter);
2881
2882    if (filled) {
2883      gl_FragColor = mix(vFillColor, vLineColor, isLine);
2884    } else {
2885      if (isLine == 0.0) {
2886        discard;
2887      }
2888      gl_FragColor = vec4(vLineColor.rgb, vLineColor.a * isLine);
2889    }
2890  } else if (!filled) {
2891    discard;
2892  } else {
2893    gl_FragColor = vFillColor;
2894  }
2895
2896  gl_FragColor.a *= inCircle;
2897  DECKGL_FILTER_COLOR(gl_FragColor, geometry);
2898}
2899`;function cL(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function pL(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};
2899r%2?cL(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):cL(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function MJ(t){var r=IJ();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function IJ(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var hL=[0,0,0,255],RJ={radiusUnits:"meters",radiusScale:{type:"number",min:0,value:1},radiusMinPixels:{type:"number",min:0,value:0},radiusMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},lineWidthUnits:"meters",lineWidthScale:{type:"number",min:0,value:1},lineWidthMinPixels:{type:"number",min:0,value:0},lineWidthMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},stroked:!1,filled:!0,billboard:!1,antialiasing:!0,getPosition:{type:"accessor",value:function(r){return r.position}},getRadius:{type:"accessor",value:1},getFillColor:{type:"accessor",value:hL},getLineColor:{type:"accessor",value:hL},getLineWidth:{type:"accessor",value:1},strokeWidth:{deprecatedFor:"getLineWidth"},outline:{deprecatedFor:"stroked"},getColor:{deprecatedFor:["getFillColor","getLineColor"]}},Ou=function(t){L(e,t);var r=MJ(e);function e(){return A(this,e),r.apply(this,arguments)}return T(e,[{key:"getShaders",value:function(){return Z(S(e.prototype),"getShaders",this).call(this,{vs:lL,fs:fL,modules:[qe,rt]})}},{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(i){if(Z(S(e.prototype),"updateState",this).call(this,i),i.changeFlags.extensionsChanged){var a,o=this.context.gl;(a=this.state.model)===null||a===void 0||a.delete(),this.state.model=this._getModel(o),this.getAttributeManager().invalidateAll()}}},{key:"draw",value:function(i){var a=i.uniforms,o=this.props,s=o.radiusUnits,u=o.radiusScale,l=o.radiusMinPixels,f=o.radiusMaxPixels,p=o.stroked,h=o.filled,d=o.billboard,v=o.antialiasing,m=o.lineWidthUnits,g=o.lineWidthScale,y=o.lineWidthMinPixels,_=o.lineWidthMaxPixels;this.state.model.setUniforms(a).setUniforms({stroked:p?1:0,filled:h,billboard:d,antialiasing:v,radiusUnits:dt[s],radiusScale:u,radiusMinPixels:l,radiusMaxPixels:f,lineWidthUnits:dt[m],lineWidthScale:g,lineWidthMinPixels:y,lineWidthMaxPixels:_}).draw()}},{key:"_getModel",value:function(i){var a=[-1,-1,0,1,-1,0,1,1,0,-1,1,0];return new Ie(i,pL(pL({},this.getShaders()),{},{id:this.props.id,geometry:new Re({drawMode:6,vertexCount:4,attributes:{positions:{size:3,value:new Float32Array(a)}}}),isInstanced:!0}))}}]),e}(He);c(Ou,"defaultProps",RJ);c(Ou,"layerName","ScatterplotLayer");F();j();k();k();F();F();j();k();var Eu={CLOCKWISE:1,COUNTER_CLOCKWISE:-1};function wa(t,r){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=dL(t,e);return n!==r?(LJ(t,e),!0):!1}function dL(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Math.sign(Mi(t,r))}function Mi(t){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=r.start,n=e===void 0?0:e,i=r.end,a=i===void 0?t.length:i,o=r.size||2,s=0,u=n,l=a-o;u<a;u+=o)s+=(t[u]-t[l])*(t[u+1]+t[l+1]),l=u;return s/2}function Mb(t,r){for(var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=e.start,i=n===void 0?0:n,a=e.end,o=a===void 0?t.length:a,s=e.size,u=s===void 0?2:s,l=e.isClosed,f=(o-i)/u,p=0;p<f-1;++p)r(t[i+p*u],t[i+p*u+1],t[i+(p+1)*u],t[i+(p+1)*u+1],p,p+1);var h=i+(f-1)*u,d=l||Ze(t[i],t[h])&&Ze(t[i+1],t[h+1]);d||r(t[h],t[h+1],t[i],t[i+1],f-1,0)}function LJ(t,r){for(var e=r.start,n=e===void 0?0:e,i=r.end,a=i===void 0?t.length:i,o=r.size,s=o===void 0?2:o,u=(a-n)/s,l=Math.floor(u/2),f=0;f<l;++f)for(var p=n+f*s,h=n+(u-1-f)*s,d=0;d<s;++d){var v=t[p+d];t[p+d]=t[h+d],t[h+d]=v}}function vL(t,r){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=kJ(t,e);return n!==r?(t.reverse(),!0):!1}function kJ(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Math.sign(Ib(t,r))}function Ib(t){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=r.start,n=e===void 0?0:e,i=r.end,a=i===void 0?t.length:i,o=0,s=n,u=a-1;s<a;++s)o+=(t[s][0]-t[u][0])*(t[s][1]+t[u][1]),u=s;return o/2}function mL(t,r){for(var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=e.start,i=n===void 0?0:n,a=e.end,o=a===void 0?t.length:a,s=e.isClosed,u=i;u<o-1;++u)r(t[u],t[u+1],u,u+1);var l=s||Ze(t[o-1],t[0]);l||r(t[o-1],t[0],o-1,0)}var gL=function(){function t(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};A(this,t),c(this,"points",void 0),c(this,"isFlatArray",void 0),c(this,"options",void 0),this.points=r,this.isFlatArray=!vr(r[0]),this.options={start:e.start||0,end:e.end||r.length,size:e.size||2,isClosed:e.isClosed},Object.freeze(this)}return T(t,[{key:"getSignedArea",value:function(){return this.isFlatArray?Mi(this.points,this.options):Ib(this.points,this.options)}},{key:"getArea",value:function(){return Math.abs(this.getSignedArea())}},{key:"getWindingDirection",value:function(){return Math.sign(this.getSignedArea())}}
2899,{key:"forEachSegment",value:function(e){this.isFlatArray?Mb(this.points,function(n,i,a,o,s,u){e([n,i],[a,o],s,u)},this.options):mL(this.points,e,this.options)}},{key:"modifyWindingDirection",value:function(e){return this.isFlatArray?wa(this.points,e,this.options):vL(this.points,e,this.options)}}]),t}();function kb(t,r){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:2,n=arguments.length>3?arguments[3]:void 0,i=r&&r.length,a=i?r[0]*e:t.length,o=_L(t,0,a,e,!0,n&&n[0]),s=[];if(!o||o.next===o.prev)return s;var u,l,f,p,h,d,v;if(i&&(o=jJ(t,r,o,e,n)),t.length>80*e){p=l=t[0],h=f=t[1];for(var m=e;m<a;m+=e)d=t[m],v=t[m+1],d<p&&(p=d),v<h&&(h=v),d>l&&(l=d),v>f&&(f=v);u=Math.max(l-p,f-h),u=u!==0?1/u:0}return nc(o,s,e,p,h,u),s}function _L(t,r,e,n,i,a){var o,s;if(a===void 0&&(a=Mi(t,{start:r,end:e,size:n})),i===a<0)for(o=r;o<e;o+=n)s=yL(o,t[o],t[o+1],s);else for(o=e-n;o>=r;o-=n)s=yL(o,t[o],t[o+1],s);return s&&Wd(s,s.next)&&(ac(s),s=s.next),s}function Pa(t,r){if(!t)return t;r||(r=t);var e=t,n;do if(n=!1,!e.steiner&&(Wd(e,e.next)||St(e.prev,e,e.next)===0)){if(ac(e),e=r=e.prev,e===e.next)break;n=!0}else e=e.next;while(n||e!==r);return r}function nc(t,r,e,n,i,a,o){if(t){!o&&a&&HJ(t,n,i,a);for(var s=t,u,l;t.prev!==t.next;){if(u=t.prev,l=t.next,a?FJ(t,n,i,a):BJ(t)){r.push(u.i/e),r.push(t.i/e),r.push(l.i/e),ac(t),t=l.next,s=l.next;continue}if(t=l,t===s){o?o===1?(t=DJ(Pa(t),r,e),nc(t,r,e,n,i,a,2)):o===2&&NJ(t,r,e,n,i,a):nc(Pa(t),r,e,n,i,a,1);break}}}}function BJ(t){var r=t.prev,e=t,n=t.next;if(St(r,e,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(Cu(r.x,r.y,e.x,e.y,n.x,n.y,i.x,i.y)&&St(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function FJ(t,r,e,n){var i=t.prev,a=t,o=t.next;if(St(i,a,o)>=0)return!1;for(var s=i.x<a.x?i.x<o.x?i.x:o.x:a.x<o.x?a.x:o.x,u=i.y<a.y?i.y<o.y?i.y:o.y:a.y<o.y?a.y:o.y,l=i.x>a.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,f=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,p=Rb(s,u,r,e,n),h=Rb(l,f,r,e,n),d=t.prevZ,v=t.nextZ;d&&d.z>=p&&v&&v.z<=h;){if(d!==t.prev&&d!==t.next&&Cu(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&St(d.prev,d,d.next)>
2899=0||(d=d.prevZ,v!==t.prev&&v!==t.next&&Cu(i.x,i.y,a.x,a.y,o.x,o.y,v.x,v.y)&&St(v.prev,v,v.next)>=0))return!1;v=v.nextZ}for(;d&&d.z>=p;){if(d!==t.prev&&d!==t.next&&Cu(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&St(d.prev,d,d.next)>=0)return!1;d=d.prevZ}for(;v&&v.z<=h;){if(v!==t.prev&&v!==t.next&&Cu(i.x,i.y,a.x,a.y,o.x,o.y,v.x,v.y)&&St(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}function DJ(t,r,e){var n=t;do{var i=n.prev,a=n.next.next;!Wd(i,a)&&bL(i,n,n.next,a)&&ic(i,a)&&ic(a,i)&&(r.push(i.i/e),r.push(n.i/e),r.push(a.i/e),ac(n),ac(n.next),n=t=a),n=n.next}while(n!==t);return Pa(n)}function NJ(t,r,e,n,i,a){var o=t;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&XJ(o,s)){var u=xL(o,s);o=Pa(o,o.next),u=Pa(u,u.next),nc(o,r,e,n,i,a),nc(u,r,e,n,i,a);return}s=s.next}o=o.next}while(o!==t)}function jJ(t,r,e,n,i){var a=[],o,s,u,l,f;for(o=0,s=r.length;o<s;o++)u=r[o]*n,l=o<s-1?r[o+1]*n:t.length,f=_L(t,u,l,n,!1,i&&i[o+1]),f===f.next&&(f.steiner=!0),a.push($J(f));for(a.sort(UJ),o=0;o<a.length;o++)GJ(a[o],e),e=Pa(e,e.next);return e}function UJ(t,r){return t.x-r.x}function GJ(t,r){if(r=zJ(t,r),r){var e=xL(r,t);Pa(r,r.next),Pa(e,e.next)}}function zJ(t,r){var e=r,n=t.x,i=t.y,a=-1/0,o;
2899do{if(i<=e.y&&i>=e.next.y&&e.next.y!==e.y){var s=e.x+(i-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(s<=n&&s>a){if(a=s,s===n){if(i===e.y)return e;if(i===e.next.y)return e.next}o=e.x<e.next.x?e:e.next}}e=e.next}while(e!==r);if(!o)return null;if(n===a)return o;var u=o,l=o.x,f=o.y,p=1/0,h;e=o;do n>=e.x&&e.x>=l&&n!==e.x&&Cu(i<f?n:a,i,l,f,i<f?a:n,i,e.x,e.y)&&(h=Math.abs(i-e.y)/(n-e.x),ic(e,t)&&(h<p||h===p&&(e.x>o.x||e.x===o.x&&VJ(o,e)))&&(o=e,p=h)),e=e.next;while(e!==u);return o}function VJ(t,r){return St(t.prev,t,r.prev)<0&&St(r.next,t,t.next)<0}function HJ(t,r,e,n){var i=t;do i.z===null&&(i.z=Rb(i.x,i.y,r,e,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,WJ(i)}function WJ(t){var r,e,n=1,i,a,o,s,u,l;do{for(a=t,t=null,l=null,i=0;a;){for(i++,s=a,o=0,e=0;e<n&&(o++,s=s.nextZ,!!s);e++);for(u=n;o>0||u>0&&s;)o!==0&&(u===0||!s||a.z<=s.z)?(r=a,a=a.nextZ,o--):(r=s,s=s.nextZ,u--),l?l.nextZ=r:t=r,r.prevZ=l,l=r;a=s}l.nextZ=null,n*=2}while(i>1);return t}function Rb(t,r,e,n,i){return t=32767*(t-e)*i,r=32767*(r-n)*i,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,t|r<<1}function $J(t){var r=t,e=t;do(r.x<e.x||r.x===e.x&&r.y<e.y)&&(e=r),r=r.next;while(r!==t);return e}function Cu(t,r,e,n,i,a,o,s){return(i-o)*(r-s)-(t-o)*(a-s)>=0&&(t-o)*(n-s)-(e-o)*(r-s)>=0&&(e-o)*(a-s)-(i-o)*(n-s)>=0}function XJ(t,r){return t.next.i!==r.i&&t.prev.i!==r.i&&!qJ(t,r)&&(ic(t,r)&&ic(r,t)&&YJ(t,r)&&(St(t.prev,t,r.prev)||St(t,r.prev,r))||Wd(t,r)&&St(t.prev,t,t.next)>0&&St(r.prev,r,r.next)>0)}function St(t,r,e){return(r.y-t.y)*(e.x-r.x)-(r.x-t.x)*(e.y-r.y)}function Wd(t,r){return t.x===r.x&&t.y===r.y}function bL(t,r,e,n){var i=Hd(St(t,r,e)),a=Hd(St(t,r,n)),o=Hd(St(e,n,t)),s=Hd(St(e,n,r));return!!(i!==a&&o!==s||i===0&&Vd(t,e,r)||a===0&&Vd(t,n,r)||o===0&&Vd(e,t,n)||s===0&&Vd(e,r,n))}function Vd(t,r,e){return r.x<=Math.max(t.x,e.x)&&r.x>=Math.min(t.x,e.x)&&r.y<=Math.max(t.y,e.y)&&r.y>=Math.min(t.y,e.y)}function Hd(t){return t>0?1:t<0?-1:0}function qJ(t,r){var e=t;do{if(e.i!==t.i&&e.next.i!==t.i&&e.i!==r.i&&e.next.i!==r.i&&bL(e,e.next,t,r))return!0;e=e.next}while(e!==t);return!1}function ic(t,r){return St(t.prev,t,t.next)<0?St(t,r,t.next)>=0&&St(t,t.prev,r)>=0:St(t,r,t.prev)<0||St(t,t.next,r)<0}function YJ(t,r){var e=t,n=!1,i=(t.x+r.x)/2,a=(t.y+r.y)/2;do e.y>a!=e.next.y>a&&e.next.y!==e.y&&i<(e.next.x-e.x)*(a-e.y)/(e.next.y-e.y)+e.x&&(n=!n),e=e.next;while(e!==t);return n}function xL(t,r){var e=new Lb(t.i,t.x,t.y),n=new Lb(r.i,r.x,r.y),i=t.next,a=r.prev;return t.next=r,r.prev=t,e.next=i,i.prev=e,n.next=e,e.prev=n,a.next=n,n.prev=a,n}function yL(t,r,e,n){var i=new Lb(t,r,e);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function ac(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 Lb(t,r,e){this.i=t,this.x=r,this.y=e,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function wr(t,r){var e=r.length,n=t.length;if(n>0){for(var i=!0,a=0;a<e;a++)if(t[n-e+a]!==r[a]){i=!1;break}if(i)return!1}for(var o=0;o<e;o++)t[n+o]=r[o];return!0}function oc(t,r){for(var e=r.length,n=0;n<e;n++)t[n]=r[n]}function Oa(t,r,e,n){for(var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:[],a=n+r*e,o=0;o<e;o++)i[o]=t[a+o];return i}function $d(t,r,e,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:[],a,o;if(e&8)a=(n[3]-t[1])/(r[1]-t[1]),o=3;else if(e&4)a=(n[1]-t[1])/(r[1]-t[1]),o=1;else if(e&2)a=(n[2]-t[0])/(r[0]-t[0]),o=2;else if(e&1)a=(n[0]-t[0])/(r[0]-t[0]),o=0;else return null;for(var s=0;s<t.length;s++)i[s]=(o&1)===s?n[o]:a*(r[s]-t[s])+t[s];return i}function sc(t,r){var e=0;return t[0]<r[0]?e|=1:t[0]>r[2]&&(e|=2),t[1]<r[1]?e|=4:t[1]>r[3]&&(e|=8),e}function uc(t,r){var e=r||{},n=e.size,i=n===void 0?2:n,a=e.broken,o=a===void 0?!1:a,s=e.gridResolution,u=s===void 0?10:s,l=e.gridOffset,f=l===void 0?[0,0]:l,p=e.startIndex,h=p===void 0?0:p,d=e.endIndex,v=d===void 0?t.length:d,m=(v-h)/i,g=[],y=[g],_=Oa(t,0,i,h),b,x,w=T
2899L(_,u,f,[]),P=[];wr(g,_);for(var E=1;E<m;E++){for(b=Oa(t,E,i,h,b),x=sc(b,w);x;){$d(_,b,x,w,P);var C=sc(P,w);C&&($d(_,P,C,w,P),x=C),wr(g,P),oc(_,P),ZJ(w,u,x),o&&g.length>i&&(g=[],y.push(g),wr(g,_)),x=sc(b,w)}wr(g,b),oc(_,b)}return o?y:y[0]}var AL=0,KJ=1;function Xd(t,r){for(var e=0;e<r.length;e++)t.push(r[e]);return t}function lc(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,e=arguments.length>2?arguments[2]:void 0;if(!t.length)return[];for(var n=e||{},i=n.size,a=i===void 0?2:i,o=n.gridResolution,s=o===void 0?10:o,u=n.gridOffset,l=u===void 0?[0,0]:u,f=n.edgeTypes,p=f===void 0?!1:f,h=[],d=[{pos:t,types:p?new Array(t.length/a).fill(KJ):null,holes:r||[]}],v=[[],[]],m=[];d.length;){var g=d.shift(),y=g.pos,_=g.types,b=g.holes;JJ(y,a,b[0]||y.length,v),m=TL(v[0],s,l,m);var x=sc(v[1],m);if(x){var w=SL(y,_,a,0,b[0]||y.length,m,x),P={pos:w[0].pos,types:w[0].types,holes:[]},E={pos:w[1].pos,types:w[1].types,holes:[]};d.push(P,E);for(var C=0;C<b.length;C++)w=SL(y,_,a,b[C],b[C+1]||y.length,m,x),w[0]&&(P.holes.push(P.pos.length),P.pos=Xd(P.pos,w[0].pos),p&&(P.types=Xd(P.types,w[0].types))),w[1]&&(E.holes.push(E.pos.length),E.pos=Xd(E.pos,w[1].pos),p&&(E.types=Xd(E.types,w[1].types)))}else{var I={positions:y};p&&(I.edgeTypes=_),b.length&&(I.holeIndices=b),h.push(I)}}return h}function SL(t,r,e,n,i,a,o){for(var s=(i-n)/e,u=[],l=[],f=[],p=[],h=[],d,v,m,g=Oa(t,s-1,e,n),y=Math.sign(o&8?g[1]-a[3]:g[0]-a[2]),_=r&&r[s-1],b=0,x=0,w=0;w<s;w++)d=Oa(t,w,e,n,d),v=Math.sign(o&8?d[1]-a[3]:d[0]-a[2]),m=r&&r[n/e+w],v&&y&&y!==v&&($d(g,d,o,a,h),wr(u,h)&&f.push(_),wr(l,h)&&p.push(_)),v<=0?(wr(u,d)&&f.push(m),b-=v):f.length&&(f[f.length-1]=AL),v>=0?(wr(l,d)&&p.push(m),x+=v):p.length&&(p[p.length-1]=AL),oc(g,d),y=v,_=m;return[b?{pos:u,types:r&&f}:null,x?{pos:l,types:r&&p}:null]}function TL(t,r,e,n){var i=Math.floor((t[0]-e[0])/r)*r+e[0],a=Math.floor((t[1]-e[1])/r)*r+e[1];return n[0]=i,n[1]=a,n[2]=i+r,n[3]=a+r,n}function ZJ(t,r,e){e&8?(t[1]+=r,t[3]+=r):e&4?(t[1]-=r,t[3]-=r):e&2?(t[0]+=r,t[2]+=r):e&1&&(t[0]-=r,t[2]-=r)}function JJ(t,r,e,n){for(var i=1/0,a=-1/0,o=1/0,s=-1/0,u=0;u<e;u+=r){var l=t[u],f=t[u+1];i=l<i?l:i,a=l>a?l:a,o=f<o?f:o,s=f>s?f:s}return n[0][0]=i,n[0][1]=o,n[1][0]=a,n[1][1]=s,n}function PL(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=QJ(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2900In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function QJ(t,r){if(t){if(typeof t=="string")return wL(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return wL(t,r)}}function wL(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var eQ=85.051129;function Bb(t,r){var e=r||{},n=e.size,i=n===void 0?2:n,a=e.startIndex,o=a===void 0?0:a,s=e.endIndex,u=s===void 0?t.length:s,l=e.normalize,f=l===void 0?!0:l,p=t.slice(o,u);OL(p,i,0,u-o);var h=uc(p,{size:i,broken:!0,gridResolution:360,gridOffset:[-180,-180]});if(f){var d=PL(h),v;try{for(d.s();!(v=d.n()).done;){var m=v.value;EL(m,i)}}catch(g){d.e(g)}finally{d.f()}}return h}function Fb(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,e=arguments.length>2?arguments[2]:void 0,n=e||{},i=n.size,a=i===void 0?2:i,o=n.normalize,s=o===void 0?!0:o,u=n.edgeTypes,l=u===void 0?!1:u;r=r||[];for(var f=[],p=[],h=0,d=0,v=0;v<=r.length;v++){for(var m=r[v]||t.length,g=d,y=tQ(t,a,h,m),_=y;_<m;_++)f[d++]=t[_];for(var b=h;b<y;b++)f[d++]=t[b];OL(f,a,g,d),rQ(f,a,g,d,e?.maxLatitude),h=m,p[v]=d}p.pop();var x=lc(f,p,{size:a,gridResolution:360,gridOffset:[-180,-180],edgeTypes:l});if(s){var w=PL(x),P;try{for(w.s();!(P=w.n()).done;){var E=P.value;EL(E.positions,a)}}catch(C){w.e(C)}finally{w.f()}}return x}function tQ(t,r,e,n){for(var i=-1,a=-1,o=e+1;o<n;o+=r){var s=Math.abs(t[o]);s>i&&(i=s,a=o-1)}return a}function rQ(t,r,e,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:eQ,a=t[e],o=t[n-r];if(Math.abs(a-o)>180){var s=Oa(t,0,r,e);s[0]+=Math.round((o-a)/360)*360,wr(t,s),s[1]=Math.sign(s[1])*i,wr(t,s),s[0]=a,wr(t,s)}}function OL(t,r,e,n){for(var i=t[0],a,o=e;o<n;o+=r){a=t[o];var s=a-i;(s>180||s<-180)&&(a-=Math.round(s/360)*360),t[o]=i=a}}function EL(t,r){for(var e,n=t.length/r,i=0;i<n&&(e=t[i*r],(e+180)%360===0);i++);var a=-Math.round(e/360)*360;if(a!==0)for(var o=0;o<n;o++)t[o*r]+=a}function CL(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function ML(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};
2900r%2?CL(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):CL(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function nQ(t){var r=iQ();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function iQ(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var IL=function(t){L(e,t);var r=nQ(e);function e(n){A(this,e);var i=n.id,a=i===void 0?$e("column-geometry"):i,o=aQ(n),s=o.indices,u=o.attributes;return r.call(this,ML(ML({},n),{},{id:a,indices:s,attributes:u}))}return e}(Re);function aQ(t){var r=t.radius,e=t.height,n=e===void 0?1:e,i=t.nradial,a=i===void 0?10:i,o=t.vertices;o&&(ne.assert(o.length>=a),o=o.flatMap(function(H){return[H[0],H[1]]}),wa(o,Eu.COUNTER_CLOCKWISE));var s=n>0,u=a+1,l=s?u*3+1:a,f=Math.PI*2/a,p=new Uint16Array(s?a*3*2:0),h=new Float32Array(l*3),d=new Float32Array(l*3),v=0;if(s){for(var m=0;m<u;m++)for(var g=m*f,y=m%a,_=Math.sin(g),b=Math.cos(g),x=0;x<2;x++)h[v+0]=o?o[y*2]:b*r,h[v+1]=o?o[y*2+1]:_*r,h[v+2]=(1/2-x)*n,d[v+0]=o?o[y*2]:b,d[v+1]=o?o[y*2+1]:_,v+=3;h[v+0]=h[v-3],h[v+1]=h[v-2],h[v+2]=h[v-1],v+=3}for(var w=s?0:1;w<u;w++){var P=Math.floor(w/2)*Math.sign(.5-w%2),E=P*f,C=(P+a)%a,I=Math.sin(E),O=Math.cos(E);h[v+0]=o?o[C*2]:O*r,h[v+1]=o?o[C*2+1]:I*r,h[v+2]=n/2,d[v+2]=1,v+=3}if(s)for(var D=0,N=0;N<a;N++)p[D++]=N*2+0,p[D++]=N*2+2,p[D++]=N*2+0,p[D++]=N*2+1,p[D++]=N*2+1,p[D++]=N*2+3;return{indices:p,attributes:{POSITION:{size:3,value:h},NORMAL:{size:3,value:d}}}}var RL=`#version 300 es
2901
2902#define SHADER_NAME column-layer-vertex-shader
2903
2904in vec3 positions;
2905in vec3 normals;
2906
2907in vec3 instancePositions;
2908in float instanceElevations;
2909in vec3 instancePositions64Low;
2910in vec4 instanceFillColors;
2911in vec4 instanceLineColors;
2912in float instanceStrokeWidths;
2913
2914in vec3 instancePickingColors;
2915uniform float opacity;
2916uniform float radius;
2917uniform float angle;
2918uniform vec2 offset;
2919uniform bool extruded;
2920uniform bool stroked;
2921uniform bool isStroke;
2922uniform float coverage;
2923uniform float elevationScale;
2924uniform float edgeDistance;
2925uniform float widthScale;
2926uniform float widthMinPixels;
2927uniform float widthMaxPixels;
2928uniform int radiusUnits;
2929uniform int widthUnits;
2930out vec4 vColor;
2931#ifdef FLAT_SHADING
2932out vec4 position_commonspace;
2933#endif
2934
2935void main(void) {
2936  geometry.worldPosition = instancePositions;
2937
2938  vec4 color = isStroke ? instanceLineColors : instanceFillColors;
2939  mat2 rotationMatrix = mat2(cos(angle), sin(angle), -sin(angle), cos(angle));
2940  float elevation = 0.0;
2941  float strokeOffsetRatio = 1.0;
2942
2943  if (extruded) {
2944    elevation = instanceElevations * (positions.z + 1.0) / 2.0 * elevationScale;
2945  } else if (stroked) {
2946    float widthPixels = clamp(
2947      project_size_to_pixel(instanceStrokeWidths * widthScale, widthUnits),
2948      widthMinPixels, widthMaxPixels) / 2.0;
2949    float halfOffset = project_pixel_size(widthPixels) / project_size(edgeDistance * coverage * radius);
2950    if (isStroke) {
2951      strokeOffsetRatio -= sign(positions.z) * halfOffset;
2952    } else {
2953      strokeOffsetRatio -= halfOffset;
2954    }
2955  }
2956  float shouldRender = float(color.a > 0.0 && instanceElevations >= 0.0);
2957  float dotRadius = radius * coverage * shouldRender;
2958
2959  geometry.pickingColor = instancePickingColors;
2960  vec3 centroidPosition = vec3(instancePositions.xy, instancePositions.z + elevation);
2961  vec3 centroidPosition64Low = instancePositions64Low;
2962  vec2 offset = (rotationMatrix * positions.xy * strokeOffsetRatio + offset) * dotRadius;
2963  if (radiusUnits == UNIT_METERS) {
2964    offset = project_size(offset);
2965  }
2966  vec3 pos = vec3(offset, 0.);
2967  DECKGL_FILTER_SIZE(pos, geometry);
2968
2969  gl_Position = project_position_to_clipspace(centroidPosition, centroidPosition64Low, pos, geometry.position);
2970  geometry.normal = project_normal(vec3(rotationMatrix * normals.xy, normals.z));
2971  DECKGL_FILTER_GL_POSITION(gl_Position, geometry);
2972  if (extruded && !isStroke) {
2973#ifdef FLAT_SHADING
2974    position_commonspace = geometry.position;
2975    vColor = vec4(color.rgb, color.a * opacity);
2976#else
2977    vec3 lightColor = lighting_getLightColor(color.rgb, project_uCameraPosition, geometry.position.xyz, geometry.normal);
2978    vColor = vec4(lightColor, color.a * opacity);
2979#endif
2980  } else {
2981    vColor = vec4(color.rgb, color.a * opacity);
2982  }
2983  DECKGL_FILTER_COLOR(vColor, geometry);
2984}
2985`;var LL=`#version 300 es
2986#define SHADER_NAME column-layer-fragment-shader
2987
2988precision highp float;
2989
2990uniform vec3 project_uCameraPosition;
2991uniform bool extruded;
2992uniform bool isStroke;
2993
2994out vec4 fragColor;
2995
2996in vec4 vColor;
2997#ifdef FLAT_SHADING
2998in vec4 position_commonspace;
2999#endif
3000
3001void main(void) {
3002  fragColor = vColor;
3003#ifdef FLAT_SHADING
3004  if (extruded && !isStroke && !picking_uActive) {
3005    vec3 normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));
3006    fragColor.rgb = lighting_getLightColor(vColor.rgb, project_uCameraPosition, position_commonspace.xyz, normal);
3007  }
3008#endif
3009  DECKGL_FILTER_COLOR(fragColor, geometry);
3010}
3011`;function kL(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function BL(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};
3011r%2?kL(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):kL(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function oQ(t){var r=sQ();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function sQ(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var qd=[0,0,0,255],uQ={diskResolution:{type:"number",min:4,value:20},vertices:null,radius:{type:"number",min:0,value:1e3},angle:{type:"number",value:0},offset:{type:"array",value:[0,0]},coverage:{type:"number",min:0,max:1,value:1},elevationScale:{type:"number",min:0,value:1},radiusUnits:"meters",lineWidthUnits:"meters",lineWidthScale:1,lineWidthMinPixels:0,lineWidthMaxPixels:Number.MAX_SAFE_INTEGER,extruded:!0,wireframe:!1,filled:!0,stroked:!1,getPosition:{type:"accessor",value:function(r){return r.position}},getFillColor:{type:"accessor",value:qd},getLineColor:{type:"accessor",value:qd},getLineWidth:{type:"accessor",value:1},getElevation:{type:"accessor",value:1e3},material:!0,getColor:{deprecatedFor:["getFillColor","getLineColor"]}},Kn=function(t){L(e,t);var r=oQ(e);function e(){return A(this,e),r.apply(this,arguments)}return T(e,[{key:"getShaders",value:function(){var i=this.context.gl,a=!ge(i),o={},s=this.props.flatShading&&yn(i,Ee.GLSL_DERIVATIVES);return s&&(o.FLAT_SHADING=1),Z(S(e.prototype),"getShaders",this).call(this,{vs:RL,fs:LL,defines:o,transpileToGLSL100:a,modules:[qe,s?xi:Dr,rt]})}},{key:"initializeState",value:function(){var i=this.getAttributeManager();i.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:qd},instanceLineColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getLineColor",defaultValue:qd},instanceStrokeWidths:{size:1,accessor:"getLineWidth",transition:!0}})}},{key:"updateState",value:function(i){Z(S(e.prototype),"updateState",this).call(this,i);var a=i.props,o=i.oldProps,s=i.changeFlags,u=s.extensionsChanged||a.flatShading!==o.flatShading;if(u){var l,f=this.context.gl;(l=this.state.model)===null||l===void 0||l.delete(),this.state.model=this._getModel(f),this.getAttributeManager().invalidateAll()}(u||a.diskResolution!==o.diskResolution||a.vertices!==o.vertices||(a.extruded||a.stroked)!==(o.extruded||o.stroked))&&this._updateGeometry(a)}},{key:"getGeometry",value:function(i,a,o){var s=new IL({radius:1,height:o?2:0,vertices:a,nradial:i}),u=0;if(a)for(var l=0;l<i;l++){var f=a[l],p=Math.sqrt(f[0]*f[0]+f[1]*f[1]);u+=p/i}else u=1;return this.setState({edgeDistance:Math.cos(Math.PI/i)*u}),s}},{key:"_getModel",value:function(i){return new Ie(i,BL(BL({},this.getShaders()),{},{id:this.props.id,isInstanced:!0}))}},{key:"_updateGeometry",value:function(i){var a=i.diskResolution,o=i.vertices,s=i.extruded,u=i.stroked,l=this.getGeometry(a,o,s||u);this.setState({fillVertexCount:l.attributes.POSITION.value.length/3,wireframeVertexCount:l.indices.value.length}),this.state.model.setProps({geometry:l})}},{key:"draw",value:function(i){var a=i.uniforms,o=this.props,s=o.lineWidthUnits,u=o.lineWidthScale,l=o.lineWidthMinPixels,f=o.lineWidthMaxPixels,p=o.radiusUnits,h=o.elevationScale,d=o.extruded,v=o.filled,m=o.stroked,g=o.wireframe,y=o.offset,_=o.coverage,b=o.radius,x=o.angle,w=this.state,P=w.model,E=w.fillVertexCount,C=w.wireframeVertexCount,I=w.edgeDistance;P.setUniforms(a).setUniforms({radius:b,angle:x/180*Math.PI,offset:y,extruded:d,stroked:m,coverage:_,elevationScale:h,edgeDistance:I,radiusUnits:dt[p],widthUnits:dt[s],widthScale:u,widthMinPixels:l,widthMaxPixels:f}),d&&g&&(P.setProps({isIndexed:!0}),P.setVertexCount(C).setDrawMode(1).setUniforms({isStroke:!0}).draw()),v&&(P.setProps({isIndexed:!1}
3011),P.setVertexCount(E).setDrawMode(5).setUniforms({isStroke:!1}).draw()),!d&&m&&(P.setProps({isIndexed:!1}),P.setVertexCount(E*2/3).setDrawMode(5).setUniforms({isStroke:!0}).draw())}}]),e}(He);c(Kn,"layerName","ColumnLayer");c(Kn,"defaultProps",uQ);F();j();k();function lQ(t){var r=fQ();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function fQ(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var cQ={cellSize:{type:"number",min:0,value:1e3},offset:{type:"array",value:[1,1]}},Mu=function(t){L(e,t);var r=lQ(e);function e(){return A(this,e),r.apply(this,arguments)}return T(e,[{key:"getGeometry",value:function(i){return new va}},{key:"draw",value:function(i){var a=i.uniforms,o=this.props,s=o.elevationScale,u=o.extruded,l=o.offset,f=o.coverage,p=o.cellSize,h=o.angle,d=o.radiusUnits;this.state.model.setUniforms(a).setUniforms({radius:p/2,radiusUnits:dt[d],angle:h,offset:l,extruded:u,coverage:f,elevationScale:s,edgeDistance:1,isWireframe:!1}).draw()}}]),e}(Kn);c(Mu,"layerName","GridCellLayer");c(Mu,"defaultProps",cQ);F();j();k();k();F();j();function FL(t,r,e,n){var i;if(Array.isArray(t[0])){var a=t.length*r;i=new Array(a);for(var o=0;o<t.length;o++)for(var s=0;s<r;s++)i[o*r+s]=t[o][s]||0}else i=t;return e?uc(i,{size:r,gridResolution:e}):n?Bb(i,{size:r}):i}function DL(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=pQ(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3012In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function pQ(t,r){if(t){if(typeof t=="string")return NL(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return NL(t,r)}}function NL(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function jL(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function UL(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?jL(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):jL(Object(e)).forEac
3012h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function hQ(t){var r=dQ();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function dQ(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var vQ=1,mQ=2,Db=4,zL=function(t){L(e,t);var r=hQ(e);function e(n){return A(this,e),r.call(this,UL(UL({},n),{},{attributes:{positions:{size:3,padding:18,initialize:!0,type:n.fp64?Float64Array:Float32Array},segmentTypes:{size:1,type:Uint8ClampedArray}}}))}return T(e,[{key:"get",value:function(i){return this.attributes[i]}},{key:"getGeometryFromBuffer",value:function(i){return this.normalize?Z(S(e.prototype),"getGeometryFromBuffer",this).call(this,i):null}},{key:"normalizeGeometry",value:function(i){return this.normalize?FL(i,this.positionSize,this.opts.resolution,this.opts.wrapLongitude):i}},{key:"getGeometrySize",value:function(i){if(GL(i)){var a=0,o=DL(i),s;try{for(o.s();!(s=o.n()).done;){var u=s.value;a+=this.getGeometrySize(u)}}catch(f){o.e(f)}finally{o.f()}return a}var l=this.getPathLength(i);return l<2?0:this.isClosed(i)?l<3?0:l+2:l}},{key:"updateGeometryAttributes",value:function(i,a){if(a.geometrySize!==0)if(i&&GL(i)){var o=DL(i),s;try{for(o.s();!(s=o.n()).done;){var u=s.value,l=this.getGeometrySize(u);a.geometrySize=l,this.updateGeometryAttributes(u,a),a.vertexStart+=l}}catch(f){o.e(f)}finally{o.f()}}else this._updateSegmentTypes(i,a),this._updatePositions(i,a)}},{key:"_updateSegmentTypes",value:function(i,a){var o=this.attributes.segmentTypes,s=i?this.isClosed(i):!1,u=a.vertexStart,l=a.geometrySize;o.fill(0,u,u+l),s?(o[u]=Db,o[u+l-2]=Db):(o[u]+=vQ,o[u+l-2]+=mQ),o[u+l-1]=Db}},{key:"_updatePositions",value:function(i,a){var o=this.attributes.positions;if(!(!o||!i))for(var s=a.vertexStart,u=a.geometrySize,l=new Array(3),f=s,p=0;p<u;f++,p++)this.getPointOnPath(i,p,l),o[f*3]=l[0],o[f*3+1]=l[1],o[f*3+2]=l[2]}},{key:"getPathLength",value:function(i){return i.length/this.positionSize}},{key:"getPointOnPath",value:function(i,a){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],s=this.positionSize;a*s>=i.length&&(a+=1-i.length/s);var u=a*s;return o[0]=i[u],o[1]=i[u+1],o[2]=s===3&&i[u+2]||0,o}},{key:"isClosed",value:function(i){if(!this.normalize)return Boolean(this.opts.loop);var a=this.positionSize,o=i.length-a;return i[0]===i[o]&&i[1]===i[o+1]&&(a===2||i[2]===i[o+2])}}]),e}(xu);function GL(t){return Array.isArray(t[0])}var VL=`#define SHADER_NAME path-layer-vertex-shader
3013
3014attribute vec2 positions;
3015
3016attribute float instanceTypes;
3017attribute vec3 instanceStartPositions;
3018attribute vec3 instanceEndPositions;
3019attribute vec3 instanceLeftPositions;
3020attribute vec3 instanceRightPositions;
3021attribute vec3 instanceLeftPositions64Low;
3022attribute vec3 instanceStartPositions64Low;
3023attribute vec3 instanceEndPositions64Low;
3024attribute vec3 instanceRightPositions64Low;
3025attribute float instanceStrokeWidths;
3026attribute vec4 instanceColors;
3027attribute vec3 instancePickingColors;
3028
3029uniform float widthScale;
3030uniform float widthMinPixels;
3031uniform float widthMaxPixels;
3032uniform float jointType;
3033uniform float capType;
3034uniform float miterLimit;
3035uniform bool billboard;
3036uniform int widthUnits;
3037
3038uniform float opacity;
3039
3040varying vec4 vColor;
3041varying vec2 vCornerOffset;
3042varying float vMiterLength;
3043varying vec2 vPathPosition;
3044varying float vPathLength;
3045varying float vJointType;
3046
3047const float EPSILON = 0.001;
3048const vec3 ZERO_OFFSET = vec3(0.0);
3049
3050float flipIfTrue(bool flag) {
3051  return -(float(flag) * 2. - 1.);
3052}
3053vec3 getLineJoinOffset(
3054  vec3 prevPoint, vec3 currPoint, vec3 nextPoint,
3055  vec2 width
3056) {
3057  bool isEnd = positions.x > 0.0;
3058  float sideOfPath = positions.y;
3059  float isJoint = float(sideOfPath == 0.0);
3060
3061  vec3 deltaA3 = (currPoint - prevPoint);
3062  vec3 deltaB3 = (nextPoint - currPoint);
3063
3064  mat3 rotationMatrix;
3065  bool needsRotation = !billboard && project_needs_rotation(currPoint, rotationMatrix);
3066  if (needsRotation) {
3067    deltaA3 = deltaA3 * rotationMatrix;
3068    deltaB3 = deltaB3 * rotationMatrix;
3069  }
3070  vec2 deltaA = deltaA3.xy / width;
3071  vec2 deltaB = deltaB3.xy / width;
3072
3073  float lenA = length(deltaA);
3074  float lenB = length(deltaB);
3075
3076  vec2 dirA = lenA > 0. ? normalize(deltaA) : vec2(0.0, 0.0);
3077  vec2 dirB = lenB > 0. ? normalize(deltaB) : vec2(0.0, 0.0);
3078
3079  vec2 perpA = vec2(-dirA.y, dirA.x);
3080  vec2 perpB = vec2(-dirB.y, dirB.x);
3081  vec2 tangent = dirA + dirB;
3082  tangent = length(tangent) > 0. ? normalize(tangent) : perpA;
3083  vec2 miterVec = vec2(-tangent.y, tangent.x);
3084  vec2 dir = isEnd ? dirA : dirB;
3085  vec2 perp = isEnd ? perpA : perpB;
3086  float L = isEnd ? lenA : lenB;
3087  float sinHalfA = abs(dot(miterVec, perp));
3088  float cosHalfA = abs(dot(dirA, miterVec));
3089  float turnDirection = flipIfTrue(dirA.x * dirB.y >= dirA.y * dirB.x);
3090  float cornerPosition = sideOfPath * turnDirection;
3091
3092  float miterSize = 1.0 / max(sinHalfA, EPSILON);
3093  miterSize = mix(
3094    min(miterSize, max(lenA, lenB) / max(cosHalfA, EPSILON)),
3095    miterSize,
3096    step(0.0, cornerPosition)
3097  );
3098
3099  vec2 offsetVec = mix(miterVec * miterSize, perp, step(0.5, cornerPosition))
3100    * (sideOfPath + isJoint * turnDirection);
3101  bool isStartCap = lenA == 0.0 || (!isEnd && (instanceTypes == 1.0 || instanceTypes == 3.0));
3102  bool isEndCap = lenB == 0.0 || (isEnd && (instanceTypes == 2.0 || instanceTypes == 3.0));
3103  bool isCap = isStartCap || isEndCap;
3104  if (isCap) {
3105    offsetVec = mix(perp * sideOfPath, dir * capType * 4.0 * flipIfTrue(isStartCap), isJoint);
3106    vJointType = capType;
3107  } else {
3108    vJointType = jointType;
3109  }
3110  vPathLength = L;
3111  vCornerOffset = offsetVec;
3112  vMiterLength = dot(vCornerOffset, miterVec * turnDirection);
3113  vMiterLength = isCap ? isJoint : vMiterLength;
3114
3115  vec2 offsetFromStartOfPath = vCornerOffset + deltaA * float(isEnd);
3116  vPathPosition = vec2(
3117    dot(offsetFromStartOfPath, perp),
3118    dot(offsetFromStartOfPath, dir)
3119  );
3120  geometry.uv = vPathPosition;
3121
3122  float isValid = step(instanceTypes, 3.5);
3123  vec3 offset = vec3(offsetVec * width * isValid, 0.0);
3124
3125  if (needsRotation) {
3126    offset = rotationMatrix * offset;
3127  }
3128  return offset;
3129}
3130void clipLine(inout vec4 position, vec4 refPosition) {
3131  if (position.w < EPSILON) {
3132    float r = (EPSILON - refPosition.w) / (position.w - refPosition.w);
3133    position = refPosition + (position - refPosition) * r;
3134  }
3135}
3136
3137void main() {
3138  geometry.pickingColor = instancePickingColors;
3139
3140  vColor = vec4(instanceColors.rgb, instanceColors.a * opacity);
3141
3142  float isEnd = positions.x;
3143
3144  vec3 prevPosition = mix(instanceLeftPositions, instanceStartPositions, isEnd);
3145  vec3 prevPosition64Low = mix(instanceLeftPositions64Low, instanceStartPositions64Low, isEnd);
3146
3147  vec3 currPosition = mix(instanceStartPositions, instanceEndPositions, isEnd);
3148  vec3 currPosition64Low = mix(instanceStartPositions64Low, instanceEndPositions64Low, isEnd);
3149
3150  vec3 nextPosition = mix(instanceEndPositions, instanceRightPositions, isEnd);
3151  vec3 nextPosition64Low = mix(instanceEndPositions64Low, instanceRightPositions64Low, isEnd);
3152
3153  geometry.worldPosition = currPosition;
3154  vec2 widthPixels = vec2(clamp(
3155    project_size_to_pixel(instanceStrokeWidths * widthScale, widthUnits),
3156    widthMinPixels, widthMaxPixels) / 2.0);
3157  vec3 width;
3158
3159  if (billboard) {
3160    vec4 prevPositionScreen = project_position_to_clipspace(prevPosition, prevPosition64Low, ZERO_OFFSET);
3161    vec4 currPositionScreen = project_position_to_clipspace(currPosition, currPosition64Low, ZERO_OFFSET, geometry.position);
3162    vec4 nextPositionScreen = project_position_to_clipspace(nextPosition, nextPosition64Low, ZERO_OFFSET);
3163
3164    clipLine(prevPositionScreen, currPositionScreen);
3165    clipLine(nextPositionScreen, currPositionScreen);
3166    clipLine(currPositionScreen, mix(nextPositionScreen, prevPositionScreen, isEnd));
3167
3168    width = vec3(widthPixels, 0.0);
3169    DECKGL_FILTER_SIZE(width, geometry);
3170
3171    vec3 offset = getLineJoinOffset(
3172      prevPositionScreen.xyz / prevPositionScreen.w,
3173      currPositionScreen.xyz / currPositionScreen.w,
3174      nextPositionScreen.xyz / nextPositionScreen.w,
3175      project_pixel_size_to_clipspace(width.xy)
3176    );
3177
3178    DECKGL_FILTER_GL_POSITION(currPositionScreen, geometry);
3179    gl_Position = vec4(currPositionScreen.xyz + offset * currPositionScreen.w, currPositionScreen.w);
3180  } else {
3181    prevPosition = project_position(prevPosition, prevPosition64Low);
3182    currPosition = project_position(currPosition, currPosition64Low);
3183    nextPosition = project_position(nextPosition, nextPosition64Low);
3184
3185    width = vec3(project_pixel_size(widthPixels), 0.0);
3186    DECKGL_FILTER_SIZE(width, geometry);
3187
3188    vec3 offset = getLineJoinOffset(prevPosition, currPosition, nextPosition, width.xy);
3189    geometry.position = vec4(currPosition + offset, 1.0);
3190    gl_Position = project_common_position_to_clipspace(geometry.position);
3191    DECKGL_FILTER_GL_POSITION(gl_Position, geometry);
3192  }
3193  DECKGL_FILTER_COLOR(vColor, geometry);
3194}
3195`;var HL=`#define SHADER_NAME path-layer-fragment-shader
3196
3197precision highp float;
3198
3199uniform float miterLimit;
3200
3201varying vec4 vColor;
3202varying vec2 vCornerOffset;
3203varying float vMiterLength;
3204varying vec2 vPathPosition;
3205varying float vPathLength;
3206varying float vJointType;
3207
3208void main(void) {
3209  geometry.uv = vPathPosition;
3210
3211  if (vPathPosition.y < 0.0 || vPathPosition.y > vPathLength) {
3212    if (vJointType > 0.5 && length(vCornerOffset) > 1.0) {
3213      discard;
3214    }
3215    if (vJointType < 0.5 && vMiterLength > miterLimit + 1.0) {
3216      discard;
3217    }
3218  }
3219  gl_FragColor = vColor;
3220
3221  DECKGL_FILTER_COLOR(gl_FragColor, geometry);
3222}
3223`;function WL(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function $L(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};
3223r%2?WL(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):WL(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function gQ(t){var r=yQ();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function yQ(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var XL=[0,0,0,255],_Q={widthUnits:"meters",widthScale:{type:"number",min:0,value:1},widthMinPixels:{type:"number",min:0,value:0},widthMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},jointRounded:!1,capRounded:!1,miterLimit:{type:"number",min:0,value:4},billboard:!1,_pathType:null,getPath:{type:"accessor",value:function(r){return r.path}},getColor:{type:"accessor",value:XL},getWidth:{type:"accessor",value:1},rounded:{deprecatedFor:["jointRounded","capRounded"]}},Nb={enter:function(r,e){return e.length?e.subarray(e.length-r.length):r}},Zn=function(t){L(e,t);var r=gQ(e);function e(){var n;A(this,e);for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return n=r.call.apply(r,[this].concat(a)),c(q(n),"state",void 0),n}return T(e,[{key:"getShaders",value:function(){return Z(S(e.prototype),"getShaders",this).call(this,{vs:VL,fs:HL,modules:[qe,rt]})}},{key:"wrapLongitude",get:function(){return!1}},{key:"initializeState",value:function(){var i=this,a=!0,o=this.getAttributeManager();o.addInstanced({positions:{size:3,vertexOffset:1,type:5130,fp64:this.use64bitPositions(),transition:Nb,accessor:"getPath",update:this.calculatePositions,noAlloc:a,shaderAttributes:{instanceLeftPositions:{vertexOffset:0},instanceStartPositions:{vertexOffset:1},instanceEndPositions:{vertexOffset:2},instanceRightPositions:{vertexOffset:3}}},instanceTypes:{size:1,type:5121,update:this.calculateSegmentTypes,noAlloc:a},instanceStrokeWidths:{size:1,accessor:"getWidth",transition:Nb,defaultValue:1},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,accessor:"getColor",transition:Nb,defaultValue:XL},instancePickingColors:{size:3,type:5121,accessor:function(u,l){var f=l.index,p=l.target;return i.encodePickingColor(u&&u.__source?u.__source.index:f,p)}}}),this.setState({pathTesselator:new zL({fp64:this.use64bitPositions()})})}},{key:"updateState",value:function(i){Z(S(e.prototype),"updateState",this).call(this,i);var a=i.props,o=i.changeFlags,s=this.getAttributeManager(),u=o.dataChanged||o.updateTriggersChanged&&(o.updateTriggersChanged.all||o.updateTriggersChanged.getPath);if(u){var l=this.state.pathTesselator,f=a.data.attributes||{};l.updateGeometry({data:a.data,geometryBuffer:f.getPath,buffers:f,normalize:!a._pathType,loop:a._pathType==="loop",getGeometry:a.getPath,positionFormat:a.positionFormat,wrapLongitude:a.wrapLongitude,resolution:this.context.viewport.resolution,dataChanged:o.dataChanged}),this.setState({numInstances:l.instanceCount,startIndices:l.vertexStarts}),o.dataChanged||s.invalidateAll()}if(o.extensionsChanged){var p,h=this.context.gl;(p=this.state.model)===null||p===void 0||p.delete(),this.state.model=this._getModel(h),s.invalidateAll()}}},{key:"getPickingInfo",value:function(i){var a=Z(S(e.prototype),"getPickingInfo",this).call(this,i),o=a.index,s=this.props.data;return s[0]&&s[0].__source&&(a.object=s.find(function(u){return u.__source.index===o})),a}},{key:"disablePickingIndex",value:function(i){var a=this.props.data;if(a[0]&&a[0].__source)for(var o=0;o<a.length;o++)a[o].__source.index===i&&this._disablePickingIndex(o);else Z(S(e.prototype),"disablePickingIndex",this).call(this,i)}},{key:"draw",value:function(i){var a=i.uniforms,o=this.props,s=o.jointRounded,u=o.capRounded,l=o.billboard,f=o.miterLimit,p=o.widthUnits,h=o.widthScale,d=o.widthMinPixels,v=o.widthMaxPixels;this.state.model.setUniforms(a).setUniforms({jointType:Number(s),capType:Number(u),billboard:l,widthUnits:dt[p],widthScale:h,miterLimit:f,widthMinPixels:d,widthMaxPixels:v}).draw()}},{key:"_getModel",value:function(i){var a=[0,1,2,1,4,2,1,3,4,3,5,4],o=[0,0,0,-1,0,1,1,-1,1,1,1,0];return new Ie(i,$L($L({}
3223,this.getShaders()),{},{id:this.props.id,geometry:new Re({drawMode:4,attributes:{indices:new Uint16Array(a),positions:{value:new Float32Array(o),size:2}}}),isInstanced:!0}))}},{key:"calculatePositions",value:function(i){var a=this.state.pathTesselator;i.startIndices=a.vertexStarts,i.value=a.get("positions")}},{key:"calculateSegmentTypes",value:function(i){var a=this.state.pathTesselator;i.startIndices=a.vertexStarts,i.value=a.get("segmentTypes")}}]),e}(He);c(Zn,"defaultProps",_Q);c(Zn,"layerName","PathLayer");F();j();k();F();j();k();k();F();j();be();var ik=me(JL());function BQ(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=FQ(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3224In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function FQ(t,r){if(t){if(typeof t=="string")return QL(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return QL(t,r)}}function QL(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var Qd=Eu.CLOCKWISE,ek=Eu.COUNTER_CLOCKWISE,Ea={isClosed:!0};function DQ(t){if(t=t&&t.positions||t,!Array.isArray(t)&&!ArrayBuffer.isView(t))throw new Error("invalid polygon")}function Ru(t){return"positions"in t?t.positions:t}function hc(t){return"holeIndices"in t?t.holeIndices:null}function NQ(t){return Array.isArray(t[0])}function jQ(t){return t.length>=1&&t[0].length>=2&&Number.isFinite(t[0][0])}function UQ(t){var r=t[0],e=t[t.length-1];return r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2]}function GQ(t,r,e,n){for(var i=0;i<r;i++)if(t[e+i]!==t[n-r+i])return!1;return!0}function tk(t,r,e,n,i){for(var a=r,o=e.length,s=0;s<o;s++)for(var u=0;u<n;u++)t[a++]=e[s][u]||0;if(!UQ(e))for(var l=0;l<n;l++)t[a++]=e[0][l]||0;return Ea.start=r,Ea.end=a,Ea.size=n,wa(t,i,Ea),a}function rk(t,r,e,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,a=arguments.length>5?arguments[5]:void 0,o=arguments.length>6?arguments[6]:void 0;a=a||e.length;var s=a-i;if(s<=0)return r;for(var u=r,l=0;l<s;l++)t[u++]=e[i+l];if(!GQ(e,n,i,a))for(var f=0;f<n;f++)t[u++]=e[i+f];return Ea.start=r,Ea.end=u,Ea.size=n,wa(t,o,Ea),u}function ev(t,r){DQ(t);var e=[],n=[];if("positions"in t){var i=t,a=i.positions,o=i.holeIndices;if(o){for(var s=0,u=0;u<=o.length;u++)s=rk(e,s,a,r,o[u-1],o[u],u===0?Qd:ek),n.push(s);return n.pop(),{positions:e,holeIndices:n}}t=a}if(!NQ(t))return rk(e,0,t,r,0,e.length,Qd),e;if(!jQ(t)){var l=0,f=BQ(t.entries()),p;try{for(f.s();!(p=f.n()).done;){var h=W(p.value,2),d=h[0],v=h[1];l=tk(e,l,v,r,d===0?Qd:ek),n.push(l)}}catch(m){f.e(m)}finally{f.f()}return n.pop(),{positions:e,holeIndices:n}}return tk(e,0,t,r,Qd),e}function Vb(t,r,e){for(var n=t.length/3,i=0,a=0;a<n;a++){var o=(a+1)%n;i+=t[a*3+r]*t[o*3+e],i-=t[o*3+r]*t[a*3+e]}return Math.abs(i/2)}function nk(t,r,e,n){for(var i=t.length/3,a=0;a<i;a++){var o=a*3,s=t[o+0],u=t[o+1],l=t[o+2];t[o+r]=s,t[o+e]=u,t[o+n]=l}}function ak(t,r,e,n){var i=hc(t);i&&(i=i.map(function(v){return v/r}));var a=Ru(t),o=n&&r===3;if(e){var s=a.length;a=a.slice();for(var u=[],l=0;l<s;l+=r){u[0]=a[l],u[1]=a[l+1],o&&(u[2]=a[l+2]);var f=e(u);a[l]=f[0],a[l+1]=f[1],o&&(a[l+2]=f[2])}}if(o){var p=Vb(a,0,1),h=Vb(a,0,2),d=Vb(a,1,2);if(!p&&!h&&!d)return[];p>h&&p>d||(h>d?(e||(a=a.slice()),nk(a,0,2,1)):(e||(a=a.slice()),nk(a,2,0,1)))}return(0,ik.default)(a,i,r)}function sk(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=zQ(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}
vendor: 1,236 bytes, lines 3224-3225
3224}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3225In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function zQ(t,r){if(t){if(typeof t=="string")return uk(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return uk(t,r)}}function uk(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function lk(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function fk(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?lk(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):lk(Object(e)).forEac
3225h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function VQ(t){var r=HQ();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function HQ(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var pk=function(t){L(e,t);var r=VQ(e);function e(n){A(this,e);var i=n.fp64,a=n.IndexType,o=a===void 0?Uint32Array:a;return r.call(this,fk(fk({},n),{},{attributes:{positions:{size:3,type:i?Float64Array:Float32Array},vertexValid:{type:Uint8ClampedArray,size:1},indices:{type:o,size:1}}}))}return T(e,[{key:"get",value:function(i){var a=this.attributes;return i==="indices"?a.indices&&a.indices.subarray(0,this.vertexCount):a[i]}},{key:"updateGeometry",value:function(i){Z(S(e.prototype),"updateGeometry",this).call(this,i);var a=this.buffers.indices;if(a)this.vertexCount=(a.value||a).length;else if(this.data&&!this.getGeometry)throw new Error("missing indices buffer")}},{key:"normalizeGeometry",value:function(i){if(this.normalize){var a=ev(i,this.positionSize);return this.opts.resolution?lc(Ru(a),hc(a),{size:this.positionSize,gridResolution:this.opts.resolution,edgeTypes:!0}):this.opts.wrapLongitude?Fb(Ru(a),hc(a),{size:this.positionSize,maxLatitude:86,edgeTypes:!0}):a}return i}},{key:"getGeometrySize",value:function(i){if(ck(i)){var a=0,o=sk(i),s;try{for(o.s();!(s=o.n()).done;){var u=s.value;a+=this.getGeometrySize(u)}}catch(l){o.e(l)}finally{o.f()}return a}return Ru(i).length/this.positionSize}},{key:"getGeometryFromBuffer",value:function(i){return this.normalize||!this.buffers.indices?Z(S(e.prototype),"getGeometryFromBuffer",this).call(this,i):null}},{key:"updateGeometryAttributes",value:function(i,a){if(i&&ck(i)){var o=sk(i),s;try{for(o.s();!(s=o.n()).done;){var u=s.value,l=this.getGeometrySize(u);a.geometrySize=l,this.updateGeometryAttributes(u,a),a.vertexStart+=l,a.indexStart=this.indexStarts[a.geometryIndex+1]}}catch(f){o.e(f)}finally{o.f()}}else this._updateIndices(i,a),this._updatePositions(i,a),this._updateVertexValid(i,a)}},{key:"_updateIndices",value:function(i,a){var o=a.geometryIndex,s=a.vertexStart,u=a.indexStart,l=this.attributes,f=this.indexStarts,p=this.typedArrayManager,h=l.indices;if(!(!h||!i)){var d=u,v=ak(i,this.positionSize,this.opts.preproject,this.opts.full3d);h=p.allocate(h,u+v.length,{copy:!0});for(var m=0;m<v.length;m++)h[d++]=v[m]+s;f[o+1]=u+v.length,l.indices=h}}},{key:"_updatePositions",value:function(i,a){var o=a.vertexStart,s=a.geometrySize,u=this.attributes.positions,l=this.positionSize;if(!(!u||!i))for(var f=Ru(i),p=o,h=0;h<s;p++,h++){var d=f[h*l],v=f[h*l+1],m=l>2?f[h*l+2]:0;u[p*3]=d,u[p*3+1]=v,u[p*3+2]=m}}},{key:"_updateVertexValid",value:function(i,a){var o=a.vertexStart,s=a.geometrySize,u=this.positionSize,l=this.attributes.vertexValid,f=i&&hc(i);if(i&&i.edgeTypes?l.set(i.edgeTypes,o):l.fill(1,o,o+s),f)for(var p=0;p<f.length;p++)l[o+f[p]/u-1]=0;l[o+s-1]=0}}]),e}(xu);function ck(t){return Array.isArray(t)&&t.length>0&&!Number.isFinite(t[0])}var tv=`
3226attribute vec2 vertexPositions;
3227attribute float vertexValid;
3228
3229uniform bool extruded;
3230uniform bool isWireframe;
3231uniform float elevationScale;
3232uniform float opacity;
3233
3234varying vec4 vColor;
3235
3236struct PolygonProps {
3237  vec4 fillColors;
3238  vec4 lineColors;
3239  vec3 positions;
3240  vec3 nextPositions;
3241  vec3 pickingColors;
3242  vec3 positions64Low;
3243  vec3 nextPositions64Low;
3244  float elevations;
3245};
3246
3247vec3 project_offset_normal(vec3 vector) {
3248  if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT ||
3249    project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSETS) {
3250    return normalize(vector * project_uCommonUnitsPerWorldUnit);
3251  }
3252  return project_normal(vector);
3253}
3254
3255void calculatePosition(PolygonProps props) {
3256#ifdef IS_SIDE_VERTEX
3257  if(vertexValid < 0.5){
3258    gl_Position = vec4(0.);
3259    return;
3260  }
3261#endif
3262
3263  vec3 pos;
3264  vec3 pos64Low;
3265  vec3 normal;
3266  vec4 colors = isWireframe ? props.lineColors : props.fillColors;
3267
3268  geometry.worldPosition = props.positions;
3269  geometry.worldPositionAlt = props.nextPositions;
3270  geometry.pickingColor = props.pickingColors;
3271
3272#ifdef IS_SIDE_VERTEX
3273  pos = mix(props.positions, props.nextPositions, vertexPositions.x);
3274  pos64Low = mix(props.positions64Low, props.nextPositions64Low, vertexPositions.x);
3275#else
3276  pos = props.positions;
3277  pos64Low = props.positions64Low;
3278#endif
3279
3280  if (extruded) {
3281    pos.z += props.elevations * vertexPositions.y * elevationScale;
3282  }
3283  gl_Position = project_position_to_clipspace(pos, pos64Low, vec3(0.), geometry.position);
3284
3285  DECKGL_FILTER_GL_POSITION(gl_Position, geometry);
3286
3287  if (extruded) {
3288  #ifdef IS_SIDE_VERTEX
3289    normal = vec3(
3290      props.positions.y - props.nextPositions.y + (props.positions64Low.y - props.nextPositions64Low.y),
3291      props.nextPositions.x - props.positions.x + (props.nextPositions64Low.x - props.positions64Low.x),
3292      0.0);
3293    normal = project_offset_normal(normal);
3294  #else
3295    normal = project_normal(vec3(0.0, 0.0, 1.0));
3296  #endif
3297    geometry.normal = normal;
3298    vec3 lightColor = lighting_getLightColor(colors.rgb, project_uCameraPosition, geometry.position.xyz, normal);
3299    vColor = vec4(lightColor, colors.a * opacity);
3300  } else {
3301    vColor = vec4(colors.rgb, colors.a * opacity);
3302  }
3303  DECKGL_FILTER_COLOR(vColor, geometry);
3304}
3305`;var hk=`#define SHADER_NAME solid-polygon-layer-vertex-shader
3306
3307attribute vec3 positions;
3308attribute vec3 positions64Low;
3309attribute float elevations;
3310attribute vec4 fillColors;
3311attribute vec4 lineColors;
3312attribute vec3 pickingColors;
3313
3314`.concat(tv,`
3315
3316void main(void) {
3317  PolygonProps props;
3318
3319  props.positions = positions;
3320  props.positions64Low = positions64Low;
3321  props.elevations = elevations;
3322  props.fillColors = fillColors;
3323  props.lineColors = lineColors;
3324  props.pickingColors = pickingColors;
3325
3326  calculatePosition(props);
3327}
3328`);var dk=`#define SHADER_NAME solid-polygon-layer-vertex-shader-side
3329#define IS_SIDE_VERTEX
3330
3331
3332attribute vec3 instancePositions;
3333attribute vec3 nextPositions;
3334attribute vec3 instancePositions64Low;
3335attribute vec3 nextPositions64Low;
3336attribute float instanceElevations;
3337attribute vec4 instanceFillColors;
3338attribute vec4 instanceLineColors;
3339attribute vec3 instancePickingColors;
3340
3341`.concat(tv,`
3342
3343void main(void) {
3344  PolygonProps props;
3345
3346  #if RING_WINDING_ORDER_CW == 1
3347    props.positions = instancePositions;
3348    props.positions64Low = instancePositions64Low;
3349    props.nextPositions = nextPositions;
3350    props.nextPositions64Low = nextPositions64Low;
3351  #else
3352    props.positions = nextPositions;
3353    props.positions64Low = nextPositions64Low;
3354    props.nextPositions = instancePositions;
3355    props.nextPositions64Low = instancePositions64Low;
3356  #endif
3357  props.elevations = instanceElevations;
3358  props.fillColors = instanceFillColors;
3359  props.lineColors = instanceLineColors;
3360  props.pickingColors = instancePickingColors;
3361
3362  calculatePosition(props);
3363}
3364`);var vk=`#define SHADER_NAME solid-polygon-layer-fragment-shader
3365
3366precision highp float;
3367
3368varying vec4 vColor;
3369
3370void main(void) {
3371  gl_FragColor = vColor;
3372
3373  DECKGL_FILTER_COLOR(gl_FragColor, geometry);
3374}
3375`;function mk(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function Lu(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};
3375r%2?mk(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):mk(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function WQ(t){var r=$Q();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function $Q(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var nv=[0,0,0,255],XQ={filled:!0,extruded:!1,wireframe:!1,_normalize:!0,_windingOrder:"CW",_full3d:!1,elevationScale:{type:"number",min:0,value:1},getPolygon:{type:"accessor",value:function(r){return r.polygon}},getElevation:{type:"accessor",value:1e3},getFillColor:{type:"accessor",value:nv},getLineColor:{type:"accessor",value:nv},material:!0},rv={enter:function(r,e){return e.length?e.subarray(e.length-r.length):r}},Jn=function(t){L(e,t);var r=WQ(e);function e(){var n;A(this,e);for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return n=r.call.apply(r,[this].concat(a)),c(q(n),"state",void 0),n}return T(e,[{key:"getShaders",value:function(i){return Z(S(e.prototype),"getShaders",this).call(this,{vs:i==="top"?hk:dk,fs:vk,defines:{RING_WINDING_ORDER_CW:!this.props._normalize&&this.props._windingOrder==="CCW"?0:1},modules:[qe,Dr,rt]})}},{key:"wrapLongitude",get:function(){return!1}},{key:"initializeState",value:function(){var i=this,a=this.context,o=a.gl,s=a.viewport,u=this.props.coordinateSystem,l=this.props._full3d;s.isGeospatial&&u===de.DEFAULT&&(u=de.LNGLAT);var f;u===de.LNGLAT&&(l?f=s.projectPosition.bind(s):f=s.projectFlat.bind(s)),this.setState({numInstances:0,polygonTesselator:new pk({preproject:f,fp64:this.use64bitPositions(),IndexType:!o||qt(o,Ee.ELEMENT_INDEX_UINT32)?Uint32Array:Uint16Array})});var p=this.getAttributeManager(),h=!0;p.remove(["instancePickingColors"]),p.add({indices:{size:1,isIndexed:!0,update:this.calculateIndices,noAlloc:h},positions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:rv,accessor:"getPolygon",update:this.calculatePositions,noAlloc:h,shaderAttributes:{positions:{vertexOffset:0,divisor:0},instancePositions:{vertexOffset:0,divisor:1},nextPositions:{vertexOffset:1,divisor:1}}},vertexValid:{size:1,divisor:1,type:5121,update:this.calculateVertexValid,noAlloc:h},elevations:{size:1,transition:rv,accessor:"getElevation",shaderAttributes:{elevations:{divisor:0},instanceElevations:{divisor:1}}},fillColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:rv,accessor:"getFillColor",defaultValue:nv,shaderAttributes:{fillColors:{divisor:0},instanceFillColors:{divisor:1}}},lineColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:rv,accessor:"getLineColor",defaultValue:nv,shaderAttributes:{lineColors:{divisor:0},instanceLineColors:{divisor:1}}},pickingColors:{size:3,type:5121,accessor:function(v,m){var g=m.index,y=m.target;return i.encodePickingColor(v&&v.__source?v.__source.index:g,y)},shaderAttributes:{pickingColors:{divisor:0},instancePickingColors:{divisor:1}}}})}},{key:"getPickingInfo",value:function(i){var a=Z(S(e.prototype),"getPickingInfo",this).call(this,i),o=a.index,s=this.props.data;return s[0]&&s[0].__source&&(a.object=s.find(function(u){return u.__source.index===o})),a}},{key:"disablePickingIndex",value:function(i){var a=this.props.data;if(a[0]&&a[0].__source)for(var o=0;o<a.length;o++)a[o].__source.index===i&&this._disablePickingIndex(o);else Z(S(e.prototype),"disablePickingIndex",this).call(this,i)}},{key:"draw",value:function(i){var a=i.uniforms,o=this.props,s=o.extruded,u=o.filled,l=o.wireframe,f=o.elevationScale,p=this.state,h=p.topModel,d=p.sideModel,v=p.polygonTesselator,m=Lu(Lu({},a),{},{extruded:Boolean(s),elevationScale:f});d&&(d.setInstanceCount(v.instanceCount-1),d.setUniforms(m),l&&(d.setDrawMode(3),d.setUniforms({isWireframe:!0}).draw()),u&&(d.setDrawMode(6),d.setUniforms({isWireframe:!1}).draw())),h&&(h.setVertexCount(v.vertexCount),h.setUniforms(m).draw())}},{key:"updateState",value:function(i){Z(S(e.prototype),"updateState",this).call(this,i),this.updateGeometry(i);var a=i.props,o=i.oldProps,s=i.changeFlags,u=this.getAttributeManager(),l=s.extensionsChanged||a.filled!==o.filled||a.extruded!==o.extruded;if(l){var f;(f=this.state.models)===null||f===void 0||f.forEach(function(p){return p.delete()}
3375),this.setState(this._getModels(this.context.gl)),u.invalidateAll()}}},{key:"updateGeometry",value:function(i){var a=i.props,o=i.oldProps,s=i.changeFlags,u=s.dataChanged||s.updateTriggersChanged&&(s.updateTriggersChanged.all||s.updateTriggersChanged.getPolygon);if(u){var l=this.state.polygonTesselator,f=a.data.attributes||{};l.updateGeometry({data:a.data,normalize:a._normalize,geometryBuffer:f.getPolygon,buffers:f,getGeometry:a.getPolygon,positionFormat:a.positionFormat,wrapLongitude:a.wrapLongitude,resolution:this.context.viewport.resolution,fp64:this.use64bitPositions(),dataChanged:s.dataChanged,full3d:a._full3d}),this.setState({numInstances:l.instanceCount,startIndices:l.vertexStarts}),s.dataChanged||this.getAttributeManager().invalidateAll()}}},{key:"_getModels",value:function(i){var a=this.props,o=a.id,s=a.filled,u=a.extruded,l,f;if(s){var p=this.getShaders("top");p.defines.NON_INSTANCED_MODEL=1,l=new Ie(i,Lu(Lu({},p),{},{id:"".concat(o,"-top"),drawMode:4,attributes:{vertexPositions:new Float32Array([0,1])},uniforms:{isWireframe:!1,isSideVertex:!1},vertexCount:0,isIndexed:!0}))}return u&&(f=new Ie(i,Lu(Lu({},this.getShaders("side")),{},{id:"".concat(o,"-side"),geometry:new Re({drawMode:1,vertexCount:4,attributes:{vertexPositions:{size:2,value:new Float32Array([1,0,0,0,0,1,1,1])}}}),instanceCount:0,isInstanced:1})),f.userData.excludeAttributes={indices:!0}),{models:[f,l].filter(Boolean),topModel:l,sideModel:f}}},{key:"calculateIndices",value:function(i){var a=this.state.polygonTesselator;i.startIndices=a.indexStarts,i.value=a.get("indices")}},{key:"calculatePositions",value:function(i){var a=this.state.polygonTesselator;i.startIndices=a.vertexStarts,i.value=a.get("positions")}},{key:"calculateVertexValid",value:function(i){i.value=this.state.polygonTesselator.get("vertexValid")}}]),e}(He);c(Jn,"defaultProps",XQ);c(Jn,"layerName","SolidPolygonLayer");function iv(t){for(var r=t.data,e=t.getIndex,n=t.dataRange,i=t.replace,a=n.startRow,o=a===void 0?0:a,s=n.endRow,u=s===void 0?1/0:s,l=r.length,f=l,p=l,h=0;h<l;h++){var d=e(r[h]);if(f>h&&d>=o&&(f=h),d>=u){p=h;break}}for(var v=f,m=p-f!==i.length,g=m?r.slice(p):void 0,y=0;y<i.length;y++)r[v++]=i[y];if(g){for(var _=0;_<g.length;_++)r[v++]=g[_];r.length=v}return{startRow:f,endRow:f+i.length}}function qQ(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=YQ(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3376In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function YQ(t,r){if(t){if(typeof t=="string")return gk(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return gk(t,r)}}function gk(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function KQ(t){var r=ZQ();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function ZQ(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var yk=[0,0,0,255],JQ=[0,0,0,255],QQ={stroked:!0,filled:!0,extruded:!1,elevationScale:1,wireframe:!1,_normalize:!0,_windingOrder:"CW",lineWidthUnits:"meters",lineWidthScale:1,lineWidthMinPixels:0,lineWidthMaxPixels:Number.MAX_SAFE_INTEGER,lineJointRounded:!1,lineMiterLimit:4,getPolygon:{type:"accessor",value:function(r){return r.polygon}},getFillColor:{type:"accessor",value:JQ},getLineColor:{type:"accessor",value:yk},getLineWidth:{type:"accessor",value:1},getElevation:{type:"accessor",value:1e3},material:!0},Qn=function(t){L(e,t);var r=KQ(e);function e(){return A(this,e),r.apply(this,arguments)}return T(e,[{key:"initializeState",value:function(){this.state={paths:[]},this.props.getLineDashArray&&ne.removed("getLineDashArray","PathStyleExtension")()}},{key:"updateState",value:function(i){var a=this,o=i.changeFlags,s=o.dataChanged||o.updateTriggersChanged&&(o.updateTriggersChanged.all||o.updateTriggersChanged.getPolygon);if(s&&Array.isArray(o.dataChanged)){var u=this.state.paths.slice(),l=o.dataChanged.map(function(f){return iv({data:u,getIndex:function(h){return h.__source.index},dataRange:f,replace:a._getPaths(f)})});this.setState({paths:u,pathsDiff:l})}else s&&this.setState({paths:this._getPaths(),pathsDiff:null})}},{key:"_getPaths",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=this.props,o=a.data,s=a.getPolygon,u=a.positionFormat,l=a._normalize,f=[],p=u==="XY"?2:3,h=i.startRow,d=i.endRow,v=Ot(o,h,d),m=v.iterable,g=v.objectInfo,y=qQ(m),_;try{for(y.s();!(_=y.n()).done;){var b=_.value;g.index++;var x=s(b,g);l&&(x=ev(x,p));var w=x,P=w.holeIndices,E=x.positions||x;if(P)for(var C=0;C<=P.length;C++){var I=E.slice(P[C-1]||0,P[C]||E.length);f.push(this.getSubLayerRow({path:I},b,g.index))}else f.push(this.getSubLayerRow({path:E},b,g.index))}}catch(O){y.e(O)}finally{y.f()}return f}},{key:"renderLayers",value:function(){var i=this.props,a=i.data,o=i._dataDiff,s=i.stroked,u=i.filled,l=i.extruded,f=i.wireframe,p=i._normalize,h=i._windingOrder,d=i.elevationScale,v=i.transitions,m=i.positionFormat,g=this.props,y=g.lineWidthUnits,_=g.lineWidthScale,b=g.lineWidthMinPixels,x=g.lineWidthMaxPixels,w=g.lineJointRounded,P=g.lineMiterLimit,E=g.lineDashJustified,C=this.props,I=C.getFillColor,O=C.getLineColor,D=C.getLineWidth,N=C.getLineDashArray,H=C.getElevation,$=C.getPolygon,ee=C.updateTriggers,V=C.material,U=this.state,X=U.paths,K=U.pathsDiff,te=this.getSubLayerClass("fill",Jn),ie=this.getSubLayerClass("stroke",Zn),ce=this.shouldRenderSubLayer("fill",X)&&new te({_dataDiff:o,extruded:l,elevationScale:d,filled:u,wireframe:f,_normalize:p,_windingOrder:h,getElevation:H,getFillColor:I,getLineColor:l&&f?O:yk,material:V,transitions:v}
3376,this.getSubLayerProps({id:"fill",updateTriggers:ee&&{getPolygon:ee.getPolygon,getElevation:ee.getElevation,getFillColor:ee.getFillColor,lineColors:l&&f,getLineColor:ee.getLineColor}}),{data:a,positionFormat:m,getPolygon:$}),Te=!l&&s&&this.shouldRenderSubLayer("stroke",X)&&new ie({_dataDiff:K&&function(){return K},widthUnits:y,widthScale:_,widthMinPixels:b,widthMaxPixels:x,jointRounded:w,miterLimit:P,dashJustified:E,_pathType:"loop",transitions:v&&{getWidth:v.getLineWidth,getColor:v.getLineColor,getPath:v.getPolygon},getColor:this.getSubLayerAccessor(O),getWidth:this.getSubLayerAccessor(D),getDashArray:this.getSubLayerAccessor(N)},this.getSubLayerProps({id:"stroke",updateTriggers:ee&&{getWidth:ee.getLineWidth,getColor:ee.getLineColor,getDashArray:ee.getLineDashArray}}),{data:X,positionFormat:m,getPath:function(Fe){return Fe.path}});return[!l&&ce,Te,l&&ce]}}]),e}(gt);c(Qn,"layerName","PolygonLayer");c(Qn,"defaultProps",QQ);function Hb(t,r){if(t==null)return{};var e={},n=Object.keys(t),i,a;for(a=0;a<n.length;a++)i=n[a],!(r.indexOf(i)>=0)&&(e[i]=t[i]);return e}function Ii(t,r){if(t==null)return{};var e=Hb(t,r),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i<a.length;i++)n=a[i],!(r.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(e[n]=t[n])}return e}F();j();k();k();function _k(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function eee(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?_k(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):_k(Object(e)).forEac
3376h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function bk(t,r){if(!t)return null;var e="startIndices"in t?t.startIndices[r]:r,n=t.featureIds.value[e];return e!==-1?tee(t,n,e):null}function tee(t,r,e){var n={properties:eee({},t.properties[r])};for(var i in t.numericProps)n.properties[i]=t.numericProps[i].value[e];return n}function xk(t,r){var e={points:null,lines:null,polygons:null};for(var n in e){var i=t[n].globalFeatureIds.value;e[n]=new Uint8ClampedArray(i.length*3);for(var a=[],o=0;o<i.length;o++)r(i[o],a),e[n][o*3+0]=a[0],e[n][o*3+1]=a[1],e[n][o*3+2]=a[2]}return e}be();F();j();k();F();j();k();var Ak=`#define SHADER_NAME multi-icon-layer-fragment-shader
3377
3378precision highp float;
3379
3380uniform float opacity;
3381uniform sampler2D iconsTexture;
3382uniform float gamma;
3383uniform bool sdf;
3384uniform float alphaCutoff;
3385uniform float sdfBuffer;
3386uniform float outlineBuffer;
3387uniform vec4 outlineColor;
3388
3389varying vec4 vColor;
3390varying vec2 vTextureCoords;
3391varying vec2 uv;
3392
3393void main(void) {
3394  geometry.uv = uv;
3395
3396  if (!picking_uActive) {
3397    float alpha = texture2D(iconsTexture, vTextureCoords).a;
3398    vec4 color = vColor;
3399    if (sdf) {
3400      float distance = alpha;
3401      alpha = smoothstep(sdfBuffer - gamma, sdfBuffer + gamma, distance);
3402
3403      if (outlineBuffer > 0.0) {
3404        float inFill = alpha;
3405        float inBorder = smoothstep(outlineBuffer - gamma, outlineBuffer + gamma, distance);
3406        color = mix(outlineColor, vColor, inFill);
3407        alpha = inBorder;
3408      }
3409    }
3410    float a = alpha * color.a;
3411    
3412    if (a < alphaCutoff) {
3413      discard;
3414    }
3415
3416    gl_FragColor = vec4(color.rgb, a * opacity);
3417  }
3418
3419  DECKGL_FILTER_COLOR(gl_FragColor, geometry);
3420}
3421`;function Sk(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function av(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?Sk(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Sk(Object(e)).forEac
3421h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function ree(t){var r=nee();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function nee(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Wb=192/256,Tk=[],iee={getIconOffsets:{type:"accessor",value:function(r){return r.offsets}},alphaCutoff:.001,smoothing:.1,outlineWidth:0,outlineColor:{type:"color",value:[0,0,0,255]}},ku=function(t){L(e,t);var r=ree(e);function e(){var n;A(this,e);for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return n=r.call.apply(r,[this].concat(a)),c(q(n),"state",void 0),n}return T(e,[{key:"getShaders",value:function(){return av(av({},Z(S(e.prototype),"getShaders",this).call(this)),{},{fs:Ak})}},{key:"initializeState",value:function(){var i=this;Z(S(e.prototype),"initializeState",this).call(this);var a=this.getAttributeManager();a.addInstanced({instanceOffsets:{size:2,accessor:"getIconOffsets"},instancePickingColors:{type:5121,size:3,accessor:function(s,u){var l=u.index,f=u.target;return i.encodePickingColor(l,f)}}})}},{key:"updateState",value:function(i){Z(S(e.prototype),"updateState",this).call(this,i);var a=i.props,o=i.oldProps,s=a.outlineColor;s!==o.outlineColor&&(s=s.map(function(u){return u/255}),s[3]=Number.isFinite(s[3])?s[3]:1,this.setState({outlineColor:s})),!a.sdf&&a.outlineWidth&&ne.warn("".concat(this.id,": fontSettings.sdf is required to render outline"))()}},{key:"draw",value:function(i){var a=this.props,o=a.sdf,s=a.smoothing,u=a.outlineWidth,l=this.state.outlineColor,f=u?Math.max(s,Wb*(1-u)):-1;if(i.uniforms=av(av({},i.uniforms),{},{sdfBuffer:Wb,outlineBuffer:f,gamma:s,sdf:Boolean(o),outlineColor:l}),Z(S(e.prototype),"draw",this).call(this,i),o&&u){var p=this.state.iconManager,h=p.getTexture();h&&this.state.model.draw({uniforms:{outlineBuffer:Wb}})}}},{key:"getInstanceOffset",value:function(i){var a=this;return i?Array.from(i).flatMap(function(o){return Z(S(e.prototype),"getInstanceOffset",a).call(a,o)}):Tk}},{key:"getInstanceColorMode",value:function(i){return 1}},{key:"getInstanceIconFrame",value:function(i){var a=this;return i?Array.from(i).flatMap(function(o){return Z(S(e.prototype),"getInstanceIconFrame",a).call(a,o)}):Tk}}]),e}(Ta);c(ku,"defaultProps",iee);c(ku,"layerName","MultiIconLayer");F();j();k();var dc=class{constructor({fontSize:r=24,buffer:e=3,radius:n=8,cutoff:i=.25,fontFamily:a="sans-serif",fontWeight:o="normal",fontStyle:s="normal"}={}){this.buffer=e,this.cutoff=i,this.radius=n;let u=this.size=r+e*4,l=this._createCanvas(u),f=this.ctx=l.getContext("2d",{willReadFrequently:!0});f.font=`${s} ${o} ${r}px ${a}`,f.textBaseline="alphabetic",f.textAlign="left",f.fillStyle="black",this.gridOuter=new Float64Array(u*u),this.gridInner=new Float64Array(u*u),this.f=new Float64Array(u),this.z=new Float64Array(u+1),this.v=new Uint16Array(u)}_createCanvas(r){let e=document.createElement("canvas");return e.width=e.height=r,e}draw(r){let{width:e,actualBoundingBoxAscent:n,actualBoundingBoxDescent:i,actualBoundingBoxLeft:a,actualBoundingBoxRight:o}=this.ctx.measureText(r),s=Math.ceil(n),u=0,l=Math.min(this.size-this.buffer,Math.ceil(o-a)),f=Math.min(this.size-this.buffer,s+Math.ceil(i)),p=l+2*this.buffer,h=f+2*this.buffer,d=Math.max(p*h,0),v=new Uint8ClampedArray(d),m={data:v,width:p,height:h,glyphWidth:l,glyphHeight:f,glyphTop:s,glyphLeft:u,glyphAdvance:e};if(l===0||f===0)return m;let{ctx:g,buffer:y,gridInner:_,gridOuter:b}=this;g.clearRect(y,y,l,f),g.fillText(r,y,y+s);let x=g.getImageData(y,y,l,f);b.fill(1e20,0,d),_.fill(0,0,d);for(let w=0;w<f;w++)for(let P=0;P<l;P++){let E=x.data[4*(w*l+P)+3]/255;if(E===0)continue;let C=(w+y)*p+P+y;if(E===1)b[C]=0,_[C]=1e20;else{let I=.5-E;b[C]=I>0?I*I:0,_[C]=I<0?I*I:0}}wk(b,0,0,p,h,p,this.f,this.v,this.z),wk(_,y,y,l,f,p,this.f,this.v,this.z);for(let w=0;w<d;w++){let P=Math.sqrt(b[w])-Math.sqrt(_[w]);v[w]=Math.round(255-255*(P/this.radius+this.cutoff))}return m}};function wk(t,r,e,n,i,a,o,s,u){for(let l=r;l<r+n;l++)Pk(t,e*a+l,a,i,o,s,u);for(let l=e;l<e+i;l++)Pk(t,l*a+r,1,n,o,s,u)}function Pk(t,r,e,n,i,a,o){a[0]=0,o[0]=-1e20,o[1]=1e20,i[0]=t[r];for(let s=1,u=0,l=0;s<n;s++){i[s]=t[r+s*e];let f=s*s;do{let p=a[u];l=(i[s]-i[p]+f-p*p)/(s-p)/2}while(l<=o[u]&&--u>-1);u++,a[u]=s,o[u]=l,o[u+1]=1e20}for(let s=0,u=0;s<n;s++){for(;o[u+1]<s;)u++;let l=a[u],f=s-l;t[r+s*e]=i[l]+f*f}}function Ek(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=aee(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}
3421}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3422In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function aee(t,r){if(t){if(typeof t=="string")return Ok(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return Ok(t,r)}}function Ok(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var oee=32,see=[];function uee(t){return Math.pow(2,Math.ceil(Math.log2(t)))}function Ck(t){var r=t.characterSet,e=t.getFontWidth,n=t.fontHeight,i=t.buffer,a=t.maxCanvasWidth,o=t.mapping,s=o===void 0?{}:o,u=t.xOffset,l=u===void 0?0:u,f=t.yOffset,p=f===void 0?0:f,h=0,d=l,v=n+i*2,m=Ek(r),g;try{for(m.s();!(g=m.n()).done;){var y=g.value;if(!s[y]){var _=e(y);d+_+i*2>a&&(d=0,h++),s[y]={x:d+i,y:p+h*v+i,width:_,height:v,layoutWidth:_,layoutHeight:n},d+=_+i*2}}}catch(b){m.e(b)}finally{m.f()}return{mapping:s,xOffset:d,yOffset:p+h*v,canvasHeight:uee(p+(h+1)*v)}}function Mk(t,r,e,n){for(var i=0,a=r;a<e;a++){var o,s=t[a];i+=((o=n[s])===null||o===void 0?void 0:o.layoutWidth)||0}return i}function Ik(t,r,e,n,i,a){for(var o=r,s=0,u=r;u<e;u++){var l=Mk(t,u,u+1,i);s+l>n&&(o<u&&a.push(u),o=u,s=0),s+=l}return s}function lee(t,r,e,n,i,a){for(var o=r,s=r,u=r,l=0,f=r;f<e;f++)if((t[f]===" "||t[f+1]===" "||f+1===e)&&(u=f+1),u>s){var p=Mk(t,s,u,i);l+p>n&&(o<s&&(a.push(s),o=s,l=0),p>n&&(p=Ik(t,s,u,n,i,a),o=a[a.length-1])),s=u,l+=p}return l}function fee(t,r,e,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,a=arguments.length>5?arguments[5]:void 0;a===void 0&&(a=t.length);var o=[];return r==="break-all"?Ik(t,i,a,e,n,o):lee(t,i,a,e,n,o),o}function cee(t,r,e,n,i,a){for(var o=0,s=0,u=r;u<e;u++){var l=t[u],f=n[l];f?(s||(s=f.layoutHeight),i[u]=o+f.layoutWidth/2,o+=f.layoutWidth):(ne.warn("Missing character: ".concat(l," (").concat(l.codePointAt(0),")"))(),i[u]=o,o+=oee)}a[0]=o,a[1]=s}function Rk(t,r,e,n,i){for(var a=Array.from(t),o=a.length,s=new Array(o),u=new Array(o),l=new Array(o),f=(e==="break-word"||e==="break-all")&&isFinite(n)&&n>0,p=[0,0],h=[0,0],d=0,v=0,m=0,g=0;g<=o;g++){var y=a[g];if((y===`
3423`||g===o)&&(m=g),m>v){for(var _=f?fee(a,e,n,i,v,m):see,b=0;b<=_.length;b++){var x=b===0?v:_[b-1],w=b<_.length?_[b]:m;cee(a,x,w,i,s,h);for(var P=x;P<w;P++){var E,C=a[P],I=((E=i[C])===null||E===void 0?void 0:E.layoutOffsetY)||0;u[P]=d+h[1]/2+I,l[P]=h[0]}d=d+h[1]*r,p[0]=Math.max(p[0],h[0])}v=m}y===`
3424`&&(s[v]=0,u[v]=0,l[v]=0,v++)}return p[1]=d,{x:s,y:u,rowWidth:l,size:p}}function Lk(t){var r=t.value,e=t.length,n=t.stride,i=t.offset,a=t.startIndices,o=t.characterSet,s=r.BYTES_PER_ELEMENT,u=n?n/s:1,l=i?i/s:0,f=a[e]||Math.ceil((r.length-l)/u),p=o&&new Set,h=new Array(e),d=r;if(u>1||l>0){var v=r.constructor;d=new v(f);for(var m=0;m<f;m++)d[m]=r[m*u+l]}for(var g=0;g<e;g++){var y=a[g],_=a[g+1]||f,b=d.subarray(y,_);h[g]=String.fromCodePoint.apply(null,b),p&&b.forEach(p.add,p)}if(p){var x=Ek(p),w;try{for(x.s();!(w=x.n()).done;){var P=w.value;o.add(String.fromCodePoint(P))}}catch(E){x.e(E)}finally{x.f()}}return{texts:h,characterCount:f}}F();j();k();var $b=function(){function t(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:5;A(this,t),c(this,"limit",void 0),c(this,"_cache",{}),c(this,"_order",[]),this.limit=r}return T(t,[{key:"get",value:function(e){var n=this._cache[e];return n&&(this._deleteOrder(e),this._appendOrder(e)),n}},{key:"set",value:function(e,n){this._cache[e]?(this.delete(e),this._cache[e]=n,this._appendOrder(e)):(Object.keys(this._cache).length===this.limit&&this.delete(this._order[0]),this._cache[e]=n,this._appendOrder(e))}},{key:"delete",value:function(e){var n=this._cache[e];n&&(delete this._cache[e],this._deleteOrder(e))}},{key:"_deleteOrder",value:function(e){var n=this._order.indexOf(e);n>=0&&this._order.splice(n,1)}},{key:"_appendOrder",value:function(e){this._order.push(e)}}]),t}();function kk(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=pee(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}
vendor: 1,237 bytes, lines 3424-3425
3424}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3425In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function pee(t,r){if(t){if(typeof t=="string")return Bk(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return Bk(t,r)}}function Bk(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function Fk(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function Dk(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?Fk(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Fk(Object(e)).forEac
3425h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function hee(){for(var t=[],r=32;r<128;r++)t.push(String.fromCharCode(r));return t}var jo={fontFamily:"Monaco, monospace",fontWeight:"normal",characterSet:hee(),fontSize:64,buffer:4,sdf:!1,cutoff:.25,radius:12,smoothing:.1},Nk=1024,jk=.9,Uk=1.2,zk=3,ov=new $b(zk);function dee(t,r){var e;typeof r=="string"?e=new Set(Array.from(r)):e=new Set(r);var n=ov.get(t);if(!n)return e;for(var i in n.mapping)e.has(i)&&e.delete(i);return e}function vee(t,r){for(var e=0;e<t.length;e++)r.data[4*e+3]=t[e]}function Gk(t,r,e,n){t.font="".concat(n," ").concat(e,"px ").concat(r),t.fillStyle="#000",t.textBaseline="alphabetic",t.textAlign="left"}function Vk(t){ne.assert(Number.isFinite(t)&&t>=zk,"Invalid cache limit"),ov=new $b(t)}var Hk=function(){function t(){A(this,t),c(this,"props",Dk({},jo)),c(this,"_key",void 0),c(this,"_atlas",void 0)}return T(t,[{key:"texture",get:function(){return this._atlas}},{key:"mapping",get:function(){return this._atlas&&this._atlas.mapping}},{key:"scale",get:function(){var e=this.props,n=e.fontSize,i=e.buffer;return(n*Uk+i*2)/n}},{key:"setProps",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Object.assign(this.props,e),this._key=this._getKey();var n=dee(this._key,this.props.characterSet),i=ov.get(this._key);if(i&&n.size===0){this._atlas!==i&&(this._atlas=i);return}var a=this._generateFontAtlas(n,i);this._atlas=a,ov.set(this._key,a)}},{key:"_generateFontAtlas",value:function(e,n){var i=this.props,a=i.fontFamily,o=i.fontWeight,s=i.fontSize,u=i.buffer,l=i.sdf,f=i.radius,p=i.cutoff,h=n&&n.data;h||(h=document.createElement("canvas"),h.width=Nk);var d=h.getContext("2d",{willReadFrequently:!0});Gk(d,a,s,o);var v=Ck(Dk({getFontWidth:function(X){return d.measureText(X).width},fontHeight:s*Uk,buffer:u,characterSet:e,maxCanvasWidth:Nk},n&&{mapping:n.mapping,xOffset:n.xOffset,yOffset:n.yOffset})),m=v.mapping,g=v.canvasHeight,y=v.xOffset,_=v.yOffset;if(h.height!==g){var b=d.getImageData(0,0,h.width,h.height);h.height=g,d.putImageData(b,0,0)}if(Gk(d,a,s,o),l){var x=new dc({fontSize:s,buffer:u,radius:f,cutoff:p,fontFamily:a,fontWeight:"".concat(o)}),w=kk(e),P;try{for(w.s();!(P=w.n()).done;){var E=P.value,C=x.draw(E),I=C.data,O=C.width,D=C.height,N=C.glyphTop;m[E].width=O,m[E].layoutOffsetY=s*jk-N;var H=d.createImageData(O,D);vee(I,H),d.putImageData(H,m[E].x,m[E].y)}}catch(U){w.e(U)}finally{w.f()}}else{var $=kk(e),ee;try{for($.s();!(ee=$.n()).done;){var V=ee.value;d.fillText(V,m[V].x,m[V].y+u+s*jk)}}catch(U){$.e(U)}finally{$.f()}}return{xOffset:y,yOffset:_,mapping:m,data:h,width:h.width,height:h.height}}},{key:"_getKey",value:function(){var e=this.props,n=e.fontFamily,i=e.fontWeight,a=e.fontSize,o=e.buffer,s=e.sdf,u=e.radius,l=e.cutoff;return s?"".concat(n," ").concat(i," ").concat(a," ").concat(o," ").concat(u," ").concat(l):"".concat(n," ").concat(i," ").concat(a," ").concat(o)}}]),t}();F();j();k();var Wk=`#define SHADER_NAME text-background-layer-vertex-shader
3426
3427attribute vec2 positions;
3428
3429attribute vec3 instancePositions;
3430attribute vec3 instancePositions64Low;
3431attribute vec4 instanceRects;
3432attribute float instanceSizes;
3433attribute float instanceAngles;
3434attribute vec2 instancePixelOffsets;
3435attribute float instanceLineWidths;
3436attribute vec4 instanceFillColors;
3437attribute vec4 instanceLineColors;
3438attribute vec3 instancePickingColors;
3439
3440uniform bool billboard;
3441uniform float opacity;
3442uniform float sizeScale;
3443uniform float sizeMinPixels;
3444uniform float sizeMaxPixels;
3445uniform vec4 padding;
3446uniform int sizeUnits;
3447
3448varying vec4 vFillColor;
3449varying vec4 vLineColor;
3450varying float vLineWidth;
3451varying vec2 uv;
3452varying vec2 dimensions;
3453
3454vec2 rotate_by_angle(vec2 vertex, float angle) {
3455  float angle_radian = radians(angle);
3456  float cos_angle = cos(angle_radian);
3457  float sin_angle = sin(angle_radian);
3458  mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);
3459  return rotationMatrix * vertex;
3460}
3461
3462void main(void) {
3463  geometry.worldPosition = instancePositions;
3464  geometry.uv = positions;
3465  geometry.pickingColor = instancePickingColors;
3466  uv = positions;
3467  vLineWidth = instanceLineWidths;
3468  float sizePixels = clamp(
3469    project_size_to_pixel(instanceSizes * sizeScale, sizeUnits),
3470    sizeMinPixels, sizeMaxPixels
3471  );
3472
3473  dimensions = instanceRects.zw * sizePixels + padding.xy + padding.zw;
3474
3475  vec2 pixelOffset = (positions * instanceRects.zw + instanceRects.xy) * sizePixels + mix(-padding.xy, padding.zw, positions);
3476  pixelOffset = rotate_by_angle(pixelOffset, instanceAngles);
3477  pixelOffset += instancePixelOffsets;
3478  pixelOffset.y *= -1.0;
3479
3480  if (billboard)  {
3481    gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);
3482    DECKGL_FILTER_GL_POSITION(gl_Position, geometry);
3483    vec3 offset = vec3(pixelOffset, 0.0);
3484    DECKGL_FILTER_SIZE(offset, geometry);
3485    gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);
3486  } else {
3487    vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);
3488    DECKGL_FILTER_SIZE(offset_common, geometry);
3489    gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset_common, geometry.position);
3490    DECKGL_FILTER_GL_POSITION(gl_Position, geometry);
3491  }
3492  vFillColor = vec4(instanceFillColors.rgb, instanceFillColors.a * opacity);
3493  DECKGL_FILTER_COLOR(vFillColor, geometry);
3494  vLineColor = vec4(instanceLineColors.rgb, instanceLineColors.a * opacity);
3495  DECKGL_FILTER_COLOR(vLineColor, geometry);
3496}
3497`;var $k=`#define SHADER_NAME text-background-layer-fragment-shader
3498
3499precision highp float;
3500
3501uniform bool stroked;
3502
3503varying vec4 vFillColor;
3504varying vec4 vLineColor;
3505varying float vLineWidth;
3506varying vec2 uv;
3507varying vec2 dimensions;
3508
3509void main(void) {
3510  geometry.uv = uv;
3511
3512  vec2 pixelPosition = uv * dimensions;
3513  if (stroked) {
3514    float distToEdge = min(
3515      min(pixelPosition.x, dimensions.x - pixelPosition.x),
3516      min(pixelPosition.y, dimensions.y - pixelPosition.y)
3517    );
3518    float isBorder = smoothedge(distToEdge, vLineWidth);
3519    gl_FragColor = mix(vFillColor, vLineColor, isBorder);
3520  } else {
3521    gl_FragColor = vFillColor;
3522  }
3523
3524  DECKGL_FILTER_COLOR(gl_FragColor, geometry);
3525}
3526`;function Xk(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function qk(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?Xk(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Xk(Object(e)).forEac
3526h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function mee(t){var r=gee();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function gee(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var yee={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,padding:{type:"array",value:[0,0,0,0]},getPosition:{type:"accessor",value:function(r){return r.position}},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0},getPixelOffset:{type:"accessor",value:[0,0]},getBoundingRect:{type:"accessor",value:[0,0,0,0]},getFillColor:{type:"accessor",value:[0,0,0,255]},getLineColor:{type:"accessor",value:[0,0,0,255]},getLineWidth:{type:"accessor",value:1}},Bu=function(t){L(e,t);var r=mee(e);function e(){var n;A(this,e);for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return n=r.call.apply(r,[this].concat(a)),c(q(n),"state",void 0),n}return T(e,[{key:"getShaders",value:function(){return Z(S(e.prototype),"getShaders",this).call(this,{vs:Wk,fs:$k,modules:[qe,rt]})}},{key:"initializeState",value:function(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceAngles:{size:1,transition:!0,accessor:"getAngle"},instanceRects:{size:4,accessor:"getBoundingRect"},instancePixelOffsets:{size:2,transition:!0,accessor:"getPixelOffset"},instanceFillColors:{size:4,transition:!0,normalized:!0,type:5121,accessor:"getFillColor",defaultValue:[0,0,0,255]},instanceLineColors:{size:4,transition:!0,normalized:!0,type:5121,accessor:"getLineColor",defaultValue:[0,0,0,255]},instanceLineWidths:{size:1,transition:!0,accessor:"getLineWidth",defaultValue:1}})}},{key:"updateState",value:function(i){Z(S(e.prototype),"updateState",this).call(this,i);var a=i.changeFlags;if(a.extensionsChanged){var o,s=this.context.gl;(o=this.state.model)===null||o===void 0||o.delete(),this.state.model=this._getModel(s),this.getAttributeManager().invalidateAll()}}},{key:"draw",value:function(i){var a=i.uniforms,o=this.props,s=o.billboard,u=o.sizeScale,l=o.sizeUnits,f=o.sizeMinPixels,p=o.sizeMaxPixels,h=o.getLineWidth,d=this.props.padding;d.length<4&&(d=[d[0],d[1],d[0],d[1]]),this.state.model.setUniforms(a).setUniforms({billboard:s,stroked:Boolean(h),padding:d,sizeUnits:dt[l],sizeScale:u,sizeMinPixels:f,sizeMaxPixels:p}).draw()}},{key:"_getModel",value:function(i){var a=[0,0,1,0,1,1,0,1];return new Ie(i,qk(qk({},this.getShaders()),{},{id:this.props.id,geometry:new Re({drawMode:6,vertexCount:4,attributes:{positions:{size:2,value:new Float32Array(a)}}}),isInstanced:!0}))}}]),e}(He);c(Bu,"defaultProps",yee);c(Bu,"layerName","TextBackgroundLayer");function _ee(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=bee(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3527In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function bee(t,r){if(t){if(typeof t=="string")return Yk(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return Yk(t,r)}}function Yk(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function Kk(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function sv(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};
3527r%2?Kk(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Kk(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function xee(t){var r=Aee();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function Aee(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Zk={start:1,middle:0,end:-1},Jk={top:1,center:0,bottom:-1},Xb=[0,0,0,255],See=1,Tee={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,background:!1,getBackgroundColor:{type:"accessor",value:[255,255,255,255]},getBorderColor:{type:"accessor",value:Xb},getBorderWidth:{type:"accessor",value:0},backgroundPadding:{type:"array",value:[0,0,0,0]},characterSet:{type:"object",value:jo.characterSet},fontFamily:jo.fontFamily,fontWeight:jo.fontWeight,lineHeight:See,outlineWidth:{type:"number",value:0,min:0},outlineColor:{type:"color",value:Xb},fontSettings:{type:"object",value:{},compare:1},wordBreak:"break-word",maxWidth:{type:"number",value:-1},getText:{type:"accessor",value:function(r){return r.text}},getPosition:{type:"accessor",value:function(r){return r.position}},getColor:{type:"accessor",value:Xb},getSize:{type:"accessor",value:32},getAngle:{type:"accessor",value:0},getTextAnchor:{type:"accessor",value:"middle"},getAlignmentBaseline:{type:"accessor",value:"center"},getPixelOffset:{type:"accessor",value:[0,0]},backgroundColor:{deprecatedFor:["background","getBackgroundColor"]}},Fu=function(t){L(e,t);var r=xee(e);function e(){var n;A(this,e);for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return n=r.call.apply(r,[this].concat(a)),c(q(n),"state",void 0),c(q(n),"getBoundingRect",function(s,u){var l=n.transformParagraph(s,u),f=W(l.size,2),p=f[0],h=f[1],d=n.state.fontAtlasManager.props.fontSize;p/=d,h/=d;var v=n.props,m=v.getTextAnchor,g=v.getAlignmentBaseline,y=Zk[typeof m=="function"?m(s,u):m],_=Jk[typeof g=="function"?g(s,u):g];return[(y-1)*p/2,(_-1)*h/2,p,h]}),c(q(n),"getIconOffsets",function(s,u){for(var l=n.props,f=l.getTextAnchor,p=l.getAlignmentBaseline,h=n.transformParagraph(s,u),d=h.x,v=h.y,m=h.rowWidth,g=W(h.size,2),y=g[0],_=g[1],b=Zk[typeof f=="function"?f(s,u):f],x=Jk[typeof p=="function"?p(s,u):p],w=d.length,P=new Array(w*2),E=0,C=0;C<w;C++){var I=(1-b)*(y-m[C])/2;P[E++]=(b-1)*y/2+I+d[C],P[E++]=(x-1)*_/2+v[C]}return P}),n}return T(e,[{key:"initializeState",value:function(){this.state={styleVersion:0,fontAtlasManager:new Hk},this.props.maxWidth>0&&ne.warn("v8.9 breaking change: TextLayer maxWidth is now relative to text size")()}},{key:"updateState",value:function(i){var a=i.props,o=i.oldProps,s=i.changeFlags,u=s.dataChanged||s.updateTriggersChanged&&(s.updateTriggersChanged.all||s.updateTriggersChanged.getText);u&&this._updateText();var l=this._updateFontAtlas(),f=l||a.lineHeight!==o.lineHeight||a.wordBreak!==o.wordBreak||a.maxWidth!==o.maxWidth;f&&this.setState({styleVersion:this.state.styleVersion+1})}},{key:"getPickingInfo",value:function(i){var a=i.info;return a.object=a.index>=0?this.props.data[a.index]:null,a}},{key:"_updateFontAtlas",value:function(){var i=this.props,a=i.fontSettings,o=i.fontFamily,s=i.fontWeight,u=this.state,l=u.fontAtlasManager,f=u.characterSet,p=sv(sv({},a),{},{characterSet:f,fontFamily:o,fontWeight:s});if(!l.mapping)return l.setProps(p),!0;for(var h in p)if(p[h]!==l.props[h])return l.setProps(p),!0;return!1}},{key:"_updateText",value:function(){var i,a=this.props,o=a.data,s=a.characterSet,u=(i=o.attributes)===null||i===void 0?void 0:i.getText,l=this.props.getText,f=o.startIndices,p,h=s==="auto"&&new Set;if(u&&f){var d=Lk(sv(sv({},ArrayBuffer.isView(u)?{value:u}:u),{},{length:o.length,startIndices:f,characterSet:h})),v=d.texts,m=d.characterCount;p=m,l=function(C,I){var O=I.index;return v[O]}}else{var g=Ot(o),y=g.iterable,_=g.objectInfo;f=[0],p=0;var b=_ee(y),x;try{for(b.s();!(x=b.n()).done;){var w=x.value;_.index++;var P=Array.from(l(w,_)||"");h&&P.forEach(h.add,h),p+=P.length,f.push(p)}}catch(E){b.e(E)}finally{b.f()}}this.setState({getText:l,startIndices:f,numInstances:p,characterSet:h||s})}},{key:"transformParagraph",value:function(i,a){var o=this.state.fontAtlasManager,s=o.mapping,u=this.state.getText,l=this.props,f=l.wordBreak,p=l.lineHeight,h=l.maxWidth,d=u(i,a)||"";return Rk(d,p,f,h*o.props.fontSize,s)}},{key:"renderLayers",value:function(){var i=this.state,a=i.startIndices,o=i.numInstances,s=i.getText,u=i.fontAtlasManager,l=u.scale,f=u.texture,p=u.mapping,h=i.styleVersion,d=this.props,v=d.data,m=d._dataDiff,g=d.getPosition,y=d.getColor,_=d.getSize,b=d.getAngle,x=d.getPixelOffset,w=d.getBackgroun
3527dColor,P=d.getBorderColor,E=d.getBorderWidth,C=d.backgroundPadding,I=d.background,O=d.billboard,D=d.fontSettings,N=d.outlineWidth,H=d.outlineColor,$=d.sizeScale,ee=d.sizeUnits,V=d.sizeMinPixels,U=d.sizeMaxPixels,X=d.transitions,K=d.updateTriggers,te=this.getSubLayerClass("characters",ku),ie=this.getSubLayerClass("background",Bu);return[I&&new ie({getFillColor:w,getLineColor:P,getLineWidth:E,padding:C,getPosition:g,getSize:_,getAngle:b,getPixelOffset:x,billboard:O,sizeScale:$,sizeUnits:ee,sizeMinPixels:V,sizeMaxPixels:U,transitions:X&&{getPosition:X.getPosition,getAngle:X.getAngle,getSize:X.getSize,getFillColor:X.getBackgroundColor,getLineColor:X.getBorderColor,getLineWidth:X.getBorderWidth,getPixelOffset:X.getPixelOffset}},this.getSubLayerProps({id:"background",updateTriggers:{getPosition:K.getPosition,getAngle:K.getAngle,getSize:K.getSize,getFillColor:K.getBackgroundColor,getLineColor:K.getBorderColor,getLineWidth:K.getBorderWidth,getPixelOffset:K.getPixelOffset,getBoundingRect:{getText:K.getText,getTextAnchor:K.getTextAnchor,getAlignmentBaseline:K.getAlignmentBaseline,styleVersion:h}}}),{data:v.attributes&&v.attributes.background?{length:v.length,attributes:v.attributes.background}:v,_dataDiff:m,autoHighlight:!1,getBoundingRect:this.getBoundingRect}),new te({sdf:D.sdf,smoothing:Number.isFinite(D.smoothing)?D.smoothing:jo.smoothing,outlineWidth:N/(D.radius||jo.radius),outlineColor:H,iconAtlas:f,iconMapping:p,getPosition:g,getColor:y,getSize:_,getAngle:b,getPixelOffset:x,billboard:O,sizeScale:$*l,sizeUnits:ee,sizeMinPixels:V*l,sizeMaxPixels:U*l,transitions:X&&{getPosition:X.getPosition,getAngle:X.getAngle,getColor:X.getColor,getSize:X.getSize,getPixelOffset:X.getPixelOffset}},this.getSubLayerProps({id:"characters",updateTriggers:{all:K.getText,getPosition:K.getPosition,getAngle:K.getAngle,getColor:K.getColor,getSize:K.getSize,getPixelOffset:K.getPixelOffset,getIconOffsets:{getTextAnchor:K.getTextAnchor,getAlignmentBaseline:K.getAlignmentBaseline,styleVersion:h}}}),{data:v,_dataDiff:m,startIndices:a,numInstances:o,getIconOffsets:this.getIconOffsets,getIcon:s})]}}],[{key:"fontAtlasCacheLimit",set:function(i){Vk(i)}}]),e}(gt);c(Fu,"defaultProps",Tee);c(Fu,"layerName","TextLayer");var vc={circle:{type:Ou,props:{filled:"filled",stroked:"stroked",lineWidthMaxPixels:"lineWidthMaxPixels",lineWidthMinPixels:"lineWidthMinPixels",lineWidthScale:"lineWidthScale",lineWidthUnits:"lineWidthUnits",pointRadiusMaxPixels:"radiusMaxPixels",pointRadiusMinPixels:"radiusMinPixels",pointRadiusScale:"radiusScale",pointRadiusUnits:"radiusUnits",pointAntialiasing:"antialiasing",pointBillboard:"billboard",getFillColor:"getFillColor",getLineColor:"getLineColor",getLineWidth:"getLineWidth",getPointRadius:"getRadius"}},icon:{type:Ta,props:{iconAtlas:"iconAtlas",iconMapping:"iconMapping",iconSizeMaxPixels:"sizeMaxPixels",iconSizeMinPixels:"sizeMinPixels",iconSizeScale:"sizeScale",iconSizeUnits:"sizeUnits",iconAlphaCutoff:"alphaCutoff",iconBillboard:"billboard",getIcon:"getIcon",getIconAngle:"getAngle",getIconColor:"getColor",getIconPixelOffset:"getPixelOffset",getIconSize:"getSize"}},text:{type:Fu,props:{textSizeMaxPixels:"sizeMaxPixels",textSizeMinPi
3527xels:"sizeMinPixels",textSizeScale:"sizeScale",textSizeUnits:"sizeUnits",textBackground:"background",textBackgroundPadding:"backgroundPadding",textFontFamily:"fontFamily",textFontWeight:"fontWeight",textLineHeight:"lineHeight",textMaxWidth:"maxWidth",textOutlineColor:"outlineColor",textOutlineWidth:"outlineWidth",textWordBreak:"wordBreak",textCharacterSet:"characterSet",textBillboard:"billboard",textFontSettings:"fontSettings",getText:"getText",getTextAngle:"getAngle",getTextColor:"getColor",getTextPixelOffset:"getPixelOffset",getTextSize:"getSize",getTextAnchor:"getTextAnchor",getTextAlignmentBaseline:"getAlignmentBaseline",getTextBackgroundColor:"getBackgroundColor",getTextBorderColor:"getBorderColor",getTextBorderWidth:"getBorderWidth"}}},mc={type:Zn,props:{lineWidthUnits:"widthUnits",lineWidthScale:"widthScale",lineWidthMinPixels:"widthMinPixels",lineWidthMaxPixels:"widthMaxPixels",lineJointRounded:"jointRounded",lineCapRounded:"capRounded",lineMiterLimit:"miterLimit",lineBillboard:"billboard",getLineColor:"getColor",getLineWidth:"getWidth"}},uv={type:Jn,props:{extruded:"extruded",filled:"filled",wireframe:"wireframe",elevationScale:"elevationScale",material:"material",_full3d:"_full3d",getElevation:"getElevation",getFillColor:"getFillColor",getLineColor:"getLineColor"}};function Du(t){var r=t.type,e=t.props,n={};for(var i in e)n[i]=r.defaultProps[e[i]];return n}function lv(t,r){var e=t.props,n=e.transitions,i=e.updateTriggers,a={updateTriggers:{},transitions:n&&{getPosition:n.geometry}};for(var o in r){var s=r[o],u=t.props[o];o.startsWith("get")&&(u=t.getSubLayerAccessor(u),a.updateTriggers[s]=i[o],n&&(a.transitions[s]=n[o])),a[s]=u}return a}function eB(t){if(Array.isArray(t))return t;switch(ne.assert(t.type,"GeoJSON does not have type"),t.type){case"Feature":return[t];case"FeatureCollection":return ne.assert(Array.isArray(t.features),"GeoJSON does not have features array"),t.features;default:return[{geometry:t}]}}function qb(t,r){for(var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n={pointFeatures:[],lineFeatures:[],polygonFeatures:[],polygonOutlineFeatures:[]},i=e.startRow,a=i===void 0?0:i,o=e.endRow,s=o===void 0?t.length:o,u=a;u<s;u++){var l=t[u],f=l.geometry;if(f)if(f.type==="GeometryCollection"){ne.assert(Array.isArray(f.geometries),"GeoJSON does not have geometries array");for(var p=f.geometries,h=0;h<p.length;h++){var d=p[h];Qk(d,n,r,l,u)}}else Qk(f,n,r,l,u)}return n}function Qk(t,r,e,n,i){var a=t.type,o=t.coordinates,s=r.pointFeatures,u=r.lineFeatures,l=r.polygonFeatures,f=r.polygonOutlineFeatures;if(!Pee(a,o)){ne.warn("".concat(a," coordinates are malformed"))();return}switch(a){case"Point":s.push(e({geometry:t},n,i));break;case"MultiPoint":o.forEach(function(p){s.push(e({geometry:{type:"Point",coordinates:p}},n,i))});break;case"LineString":u.push(e({geometry:t},n,i));break;case"MultiLineString":o.forEach(function(p){u.push(e({geometry:{type:"LineString",coordinates:p}},n,i))});break;case"Polygon":l.push(e({geometry:t},n,i)),o.forEach(function(p){f.push(e({geometry:{type:"LineString",coordinates:p}},n,i))});break;case"MultiPolygon":o.forEach(function(p){l.push(e({geometry:{type:"Polygon",coordinates:p}},n,i)),p.forEach(function(h){f.push(e({geometry:{type:"LineString",coordinates:h}},n,i))})});break;default:}}var wee={Point:1,MultiPoint:2,LineString:2,MultiLineString:3,Polygon:3,MultiPolygon:4};function Pee(t,r){var e=wee[t];for(ne.assert(e,"Unknown GeoJSON type ".concat(t));r&&--e>0;)r=r[0];return r&&Number.isFinite(r[0])}k();function tB(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function Ca(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?tB(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):tB(Object(e)).forEac
3527h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function rB(){return{points:{},lines:{},polygons:{},polygonsOutline:{}}}function fv(t){return t.geometry.coordinates}function nB(t,r){var e=rB(),n=t.pointFeatures,i=t.lineFeatures,a=t.polygonFeatures,o=t.polygonOutlineFeatures;return e.points.data=n,e.points._dataDiff=r.pointFeatures&&function(){return r.pointFeatures},e.points.getPosition=fv,e.lines.data=i,e.lines._dataDiff=r.lineFeatures&&function(){return r.lineFeatures},e.lines.getPath=fv,e.polygons.data=a,e.polygons._dataDiff=r.polygonFeatures&&function(){return r.polygonFeatures},e.polygons.getPolygon=fv,e.polygonsOutline.data=o,e.polygonsOutline._dataDiff=r.polygonOutlineFeatures&&function(){return r.polygonOutlineFeatures},e.polygonsOutline.getPath=fv,e}function iB(t,r){var e=rB(),n=t.points,i=t.lines,a=t.polygons,o=xk(t,r);return e.points.data={length:n.positions.value.length/n.positions.size,attributes:Ca(Ca({},n.attributes),{},{getPosition:n.positions,instancePickingColors:{size:3,value:o.points}}),properties:n.properties,numericProps:n.numericProps,featureIds:n.featureIds},e.lines.data={length:i.pathIndices.value.length-1,startIndices:i.pathIndices.value,attributes:Ca(Ca({},i.attributes),{},{getPath:i.positions,instancePickingColors:{size:3,value:o.lines}}),properties:i.properties,numericProps:i.numericProps,featureIds:i.featureIds},e.lines._pathType="open",e.polygons.data={length:a.polygonIndices.value.length-1,startIndices:a.polygonIndices.value,attributes:Ca(Ca({},a.attributes),{},{getPolygon:a.positions,pickingColors:{size:3,value:o.polygons}}),properties:a.properties,numericProps:a.numericProps,featureIds:a.featureIds},e.polygons._normalize=!1,a.triangles&&(e.polygons.data.attributes.indices=a.triangles.value),e.polygonsOutline.data={length:a.primitivePolygonIndices.value.length-1,startIndices:a.primitivePolygonIndices.value,attributes:Ca(Ca({},a.attributes),{},{getPath:a.positions,instancePickingColors:{size:3,value:o.polygons}}),properties:a.properties,numericProps:a.numericProps,featureIds:a.featureIds},e.polygonsOutline._pathType="open",e}var Oee=["instancePickingColors"];function Yb(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=Eee(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3528In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function Eee(t,r){if(t){if(typeof t=="string")return aB(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return aB(t,r)}}function aB(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function Cee(t){var r=Mee();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function Mee(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function oB(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function ei(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?oB(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):oB(Object(e)).forEac
3528h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var Iee=["points","linestrings","polygons"],Ree=ei(ei(ei(ei(ei(ei({},Du(vc.circle)),Du(vc.icon)),Du(vc.text)),Du(mc)),Du(uv)),{},{stroked:!0,filled:!0,extruded:!1,wireframe:!1,_full3d:!1,iconAtlas:{type:"object",value:null},iconMapping:{type:"object",value:{}},getIcon:{type:"accessor",value:function(r){return r.properties.icon}},getText:{type:"accessor",value:function(r){return r.properties.text}},pointType:"circle",getRadius:{deprecatedFor:"getPointRadius"}}),Ri=function(t){L(e,t);var r=Cee(e);function e(){return A(this,e),r.apply(this,arguments)}return T(e,[{key:"initializeState",value:function(){this.state={layerProps:{},features:{}}}},{key:"updateState",value:function(i){var a=i.props,o=i.changeFlags;if(o.dataChanged){var s=this.props.data,u=s&&"points"in s&&"polygons"in s&&"lines"in s;this.setState({binary:u}),u?this._updateStateBinary({props:a,changeFlags:o}):this._updateStateJSON({props:a,changeFlags:o})}}},{key:"_updateStateBinary",value:function(i){var a=i.props,o=i.changeFlags,s=iB(a.data,this.encodePickingColor);this.setState({layerProps:s})}},{key:"_updateStateJSON",value:function(i){var a=i.props,o=i.changeFlags,s=eB(a.data),u=this.getSubLayerRow.bind(this),l={},f={};if(Array.isArray(o.dataChanged)){var p=this.state.features;for(var h in p)l[h]=p[h].slice(),f[h]=[];var d=Yb(o.dataChanged),v;try{for(d.s();!(v=d.n()).done;){var m=v.value,g=qb(s,u,m);for(var y in p)f[y].push(iv({data:l[y],getIndex:function(x){return x.__source.index},dataRange:m,replace:g[y]}))}}catch(b){d.e(b)}finally{d.f()}}else l=qb(s,u);var _=nB(l,f);this.setState({features:l,featuresDiff:f,layerProps:_})}},{key:"getPickingInfo",value:function(i){var a=this,o=Z(S(e.prototype),"getPickingInfo",this).call(this,i),s=o.index,u=o.sourceLayer;return o.featureType=Iee.find(function(l){return u.id.startsWith("".concat(a.id,"-").concat(l,"-"))}),s>=0&&u.id.startsWith("".concat(this.id,"-points-text"))&&this.state.binary&&(o.index=this.props.data.points.globalFeatureIds.value[s]),o}},{key:"_updateAutoHighlight",value:function(i){var a="".concat(this.id,"-points-"),o=i.featureType==="points",s=Yb(this.getSubLayers()),u;try{for(s.s();!(u=s.n()).done;){var l=u.value;l.id.startsWith(a)===o&&l.updateAutoHighlight(i)}}catch(f){s.e(f)}finally{s.f()}}},{key:"_renderPolygonLayer",value:function(){var i=this.props,a=i.extruded,o=i.wireframe,s=this.state.layerProps,u="polygons-fill",l=this.shouldRenderSubLayer(u,s.polygons.data)&&this.getSubLayerClass(u,uv.type);if(l){var f=lv(this,uv.props),p=a&&o;return p||delete f.getLineColor,f.updateTriggers.lineColors=p,new l(f,this.getSubLayerProps({id:u,updateTriggers:f.updateTriggers}),s.polygons)}return null}},{key:"_renderLineLayers",value:function(){var i=this.props,a=i.extruded,o=i.stroked,s=this.state.layerProps,u="polygons-stroke",l="linestrings",f=!a&&o&&this.shouldRenderSubLayer(u,s.polygonsOutline.data)&&this.getSubLayerClass(u,mc.type),p=this.shouldRenderSubLayer(l,s.lines.data)&&this.getSubLayerClass(l,mc.type);if(f||p){var h=lv(this,mc.props);return[f&&new f(h,this.getSubLayerProps({id:u,updateTriggers:h.updateTriggers}),s.polygonsOutline),p&&new p(h,this.getSubLayerProps({id:l,updateTriggers:h.updateTriggers}),s.lines)]}return null}},{key:"_renderPointLayers",value:function(){var i=this.props.pointType,a=this.state,o=a.layerProps,s=a.binary,u=this.props.highlightedObjectIndex;!s&&Number.isFinite(u)&&(u=o.points.data.findIndex(function(P){return P.__source.index===u}));var l=new Set(i.split("+")),f=[],p=Yb(l),h;try{for(p.s();!(h=p.n()).done;){var d=h.value,v="points-".concat(d),m=vc[d],g=m&&this.shouldRenderSubLayer(v,o.points.data)&&this.getSubLayerClass(v,m.type);if(g){var y=lv(this,m.props),_=o.points;if(d==="text"&&s){var b=_.data.attributes,x=b.instancePickingColors,w=Ii(b,Oee);_=ei(ei({},_),{},{data:ei(ei({},_.data),{},{attributes:w})})}f.push(new g(y,this.getSubLayerProps({id:v,updateTriggers:y.updateTriggers,highlightedObjectIndex:u}),_))}}}catch(P){p.e(P)}finally{p.f()}return f}},{key:"renderLayers",value:function(){var i=this.props.extruded,a=this._renderPolygonLayer(),o=this._renderLineLayers(),s=this._renderPointLayers();return[!i&&a,o,s,i&&a]}},{key:"getSubLayerAccessor",value:function(i){var a=this.state.binary;return!a||typeof i!="function"?Z(S(e.prototype),"getSubLayerAccessor",this).call(this,i):function(o,s){var u=s.data,l=s.index,f=bk(u,l);return i(f,s)}}}]),e}(gt);c(Ri,"layerName","GeoJsonLayer");c(Ri,"defaultProps",Ree);k();var n1=me(Ae());k();
3528var jB=me(DB());function NB(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function $te(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?NB(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):NB(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function UB(t,r){var e=new jB.XMLParser($te({ignoreAttributes:!1,attributeNamePrefix:""},r)),n=e.parse(t);return n}be();Ge();function Xte(t){return typeof t=="string"?t.charAt(0).toLowerCase()+t.slice(1):t}function pv(t){if(Array.isArray(t))return t.map(function(s){return pv(s)});if(t&&ue(t)==="object"){for(var r={},e=0,n=Object.entries(t);e<n.length;e++){var i=W(n[e],2),a=i[0],o=i[1];r[Xte(a)]=pv(o)}return r}return t}function GB(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function r1(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?GB(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):GB(Object(e)).forEac
3528h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var qte="3.4.13",tn={name:"XML",id:"xml",module:"xml",version:qte,worker:!1,extensions:["xml"],mimeTypes:["application/xml","text/xml"],testText:Yte,options:{xml:{parser:"fast-xml-parser",uncapitalizeKeys:!1,removeNSPrefix:!1,textNodeName:"value",arrayPaths:[]}},parse:function(){var t=Y(n1.default.mark(function e(n,i){return n1.default.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",zB(new TextDecoder().decode(n),i));case 1:case"end":return o.stop()}},e)}));function r(e,n){return t.apply(this,arguments)}return r}(),parseTextSync:function(r,e){return zB(r,e)}};function Yte(t){return t.startsWith("<?xml")}function zB(t,r){var e,n=r1(r1({},tn.options.xml),r?.xml);switch(n.parser){case"fast-xml-parser":var i=r1({allowBooleanAttributes:!0,ignoreDeclaration:!0,removeNSPrefix:n.removeNSPrefix,textNodeName:n.textNodeName,isArray:function(s,u,l,f){var p,h=Boolean(n==null||(p=n.arrayPaths)===null||p===void 0?void 0:p.some(function(d){return u===d}));return h}},r?._fastXML),a=UB(t,i);return n.uncapitalizeKeys?pv(a):a;default:throw new Error(r==null||(e=r.xml)===null||e===void 0?void 0:e.parser)}}k();var a1=me(Ae());function VB(t,r){var e,n,i,a=(e=tn.parseTextSync)===null||e===void 0?void 0:e.call(tn,t,r),o=(a==null||(n=a.ServiceExceptionReport)===null||n===void 0?void 0:n.ServiceException)||(a==null||(i=a["ogc:ServiceExceptionReport"])===null||i===void 0?void 0:i["ogc:ServiceException"]),s=typeof o=="string"?o:o.value||o.code||"Unknown error";return s}function HB(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function WB(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?HB(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):HB(Object(e)).forEac
3528h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var Kte="3.4.13",Nu={id:"wms-error",name:"WMS Error",module:"wms",version:Kte,worker:!1,extensions:["xml"],mimeTypes:["application/vnd.ogc.se_xml","application/xml","text/xml"],testText:Zte,options:{wms:{throwOnError:!1}},parse:function(){var t=Y(a1.default.mark(function e(n,i){return a1.default.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",i1(new TextDecoder().decode(n),i));case 1:case"end":return o.stop()}},e)}));function r(e,n){return t.apply(this,arguments)}return r}(),parseSync:function(r,e){return i1(new TextDecoder().decode(r),e)},parseTextSync:function(r,e){return i1(r,e)}};function Zte(t){return t.startsWith("<?xml")}function i1(t,r){var e=WB(WB({},Nu.options.wms),r?.wms),n=VB(t,e),i=e.minimalErrors?n:"WMS Service error: ".concat(n);if(e.throwOnError)throw new Error(i);return i}var s1=me(Ae());be();Ge();function Go(t){return Array.isArray(t)?t:t?[t]:[]}function _c(t){var r=Go(t);return r.length>0&&r.every(function(e){return typeof e=="string"})?r:[]}function bc(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0;switch(ue(t)){case"number":return t;case"string":return parseFloat(t);default:return}}function hv(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0;switch(ue(t)){case"number":return t;case"string":return parseInt(t,10);default:return}}function zo(t){switch(t){case"true":return!0;case"false":return!1;case"1":return!0;case"0":return!1;default:return!1}}function dv(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=Jte(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3529In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function Jte(t,r){if(t){if(typeof t=="string")return $B(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return $B(t,r)}}function $B(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function o1(t,r){var e=tn.parseTextSync(t,r),n=e.WMT_MS_Capabilities||e.WMS_Capabilities||e,i=Qte(n);if(r!=null&&r.inheritedLayerProps){var a=dv(i.layers),o;try{for(a.s();!(o=a.n()).done;){var s=o.value;qB(s,null)}}catch(u){a.e(u)}finally{a.f()}}return(r!=null&&r.includeRawData||r!=null&&r.raw)&&(i.raw=n),r!=null&&r.includeXMLText&&(i.xml=t),i}function Qte(t){var r,e,n,i,a,o,s,u,l,f,p,h,d,v,m,g,y={version:String(t.version||""),name:String(((r=t.Service)===null||r===void 0?void 0:r.Name)||"unnamed"),title:(e=t.Service)!==null&&e!==void 0&&e.Title?String((n=t.Service)===null||n===void 0?void 0:n.Title):void 0,abstract:(i=t.Service)!==null&&i!==void 0&&i.Abstract?String((a=t.Service)===null||a===void 0?void 0:a.Abstract):void 0,keywords:_c((o=t.Service)===null||o===void 0||(s=o.KeywordList)===null||s===void 0?void 0:s.Keyword),fees:(u=t.Service)!==null&&u!==void 0&&u.Fees?JSON.stringify((l=t.Service)===null||l===void 0?void 0:l.Fees):void 0,accessConstraints:(f=t.Service)!==null&&f!==void 0&&f.AccessConstraints?JSON.stringify((p=t.Service)===null||p===void 0?void 0:p.AccessConstraints):void 0,layerLimit:hv((h=t.Service)===null||h===void 0?void 0:h.LayerLimit),maxWidth:hv((d=t.Service)===null||d===void 0?void 0:d.maxWidth),maxHeight:hv((v=t.Service)===null||v===void 0?void 0:v.maxHeight),layers:[],requests:ere((m=t.Capability)===null||m===void 0?void 0:m.Request),exceptions:tre(t.Exception)},_=Go((g=t.Capability)===null||g===void 0?void 0:g.Layer),b=dv(_),x;try{for(b.s();!(x=b.n()).done;){var w=x.value;y.layers.push(XB(w))}}catch(D){b.e(D)}finally{b.f()}for(var P=0,E=Object.entries(y);P<E.length;P++){var C=W(E[P],2),I=C[0],O=C[1];O===void 0&&delete y[I]}return y}function ere(t){for(var r={},e=0,n=Object.entries(t||{});e<n.length;e++){var i=W(n[e],2),a=i[0],o=i[1],s=_c(o?.Format);r[a]={mimeTypes:s}}return r}function tre(t){var r=Go(t?.Format);if(r.length>0)return{mimeTypes:_c(t)}}function XB(t){var r,e={title:String(t?.Title||""),name:t?.Name&&String(t?.Name),abstract:t?.N
3529ame&&String(t?.Abstract),keywords:_c((r=t.KeywordList)===null||r===void 0?void 0:r.Keyword)},n=t?.CRS||t?.SRS;n&&Array.isArray(n)&&n.every(function(_){return typeof _=="string"})&&(e.crs=n);var i=t?.EX_GeographicBoundingBox&&rre(t?.EX_GeographicBoundingBox);i&&(e.geographicBoundingBox=i),i=t?.LatLonBoundingBox&&nre(t?.LatLonBoundingBox),i&&(e.geographicBoundingBox=i);var a=t?.BoundingBox&&ire(t?.BoundingBox);a&&a.length>0&&(e.boundingBoxes=a);var o=Go(t?.Dimension),s=o.map(function(_){return ore(_)});s.length&&(e.dimensions=s),t!=null&&t.opaque&&(e.opaque=zo(t?.opaque)),t!=null&&t.cascaded&&(e.cascaded=zo(t?.cascaded)),t!=null&&t.queryable&&(e.queryable=zo(t?.queryable));var u=Go(t?.Layer),l=[],f=dv(u),p;try{for(f.s();!(p=f.n()).done;){var h=p.value;l.push(XB(h))}}catch(_){f.e(_)}finally{f.f()}l.length>0&&(e.layers=l);for(var d=0,v=Object.entries(e);d<v.length;d++){var m=W(v[d],2),g=m[0],y=m[1];y===void 0&&delete e[g]}return e}function rre(t){var r=t.westBoundLongitude,e=t.northBoundLatitude,n=t.eastBoundLongitude,i=t.southBoundLatitude;return[[r,i],[n,e]]}function nre(t){var r=t.minx,e=t.miny,n=t.maxx,i=t.maxy;return[[r,e],[n,i]]}function ire(t){var r=Go(t);return r.map(function(e){return are(e)})}function are(t){var r=t.CRS,e=t.SRS,n=t.minx,i=t.miny,a=t.maxx,o=t.maxy,s=t.resx,u=t.resy,l={crs:r||e,boundingBox:[[bc(n),bc(i)],[bc(a),bc(o)]]};return s&&(l.xResolution=s),u&&(l.yResolution=u),l}function ore(t){var r=t.name,e=t.units,n=t.value,i={name:r,units:e,extent:n};return t.unitSymbol&&(i.unitSymbol=t.unitSymbol),t.default&&(i.defaultValue=t.default),t.multipleValues&&(i.multipleValues=zo(t.multipleValues)),t.nearestValue&&(i.nearestValue=zo(t.nearestValue)),t.current&&(i.current=zo(t.current)),i}function qB(t,r){r!=null&&r.geographicBoundingBox&&!t.geographicBoundingBox&&(t.geographicBoundingBox=ae(r.geographicBoundingBox)),r!=null&&r.crs&&!t.crs&&(t.crs=ae(r.crs)),r!=null&&r.boundingBoxes&&!t.boundingBoxes&&(t.boundingBoxes=ae(r.boundingBoxes)),r!=null&&r.dimensions&&!t.dimensions&&(t.dimensions=ae(r.dimensions));var e=dv(t.layers||[]),n;try{for(e.s();!(n=e.n()).done;){var i=n.value;qB(i,t)}}catch(a){e.e(a)}finally{e.f()}}var sre="3.4.13",Vo={id:"wms-capabilities",name:"WMS Capabilities",module:"wms",version:sre,worker:!1,extensions:["xml"],mimeTypes:["application/vnd.ogc.wms_xml","application/xml","text/xml"],testText:ure,options:{wms:{}},parse:function(){var t=Y(s1.default.mark(function e(n,i){return s1.default.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",o1(new TextDecoder().decode(n),i?.wms));case 1:case"end":return o.stop()}},e)}));function r(e,n){return t.apply(this,arguments)}return r}(),parseTextSync:function(r,e){return o1(r,e?.wms)}};function ure(t){return t.startsWith("<?xml")}k();var l1=me(Ae());function u1(t,r){var e,n=tn.parseTextSync(t,r),i=((e=n.FeatureInfoResponse)===null||e===void 0?void 0:e.FIELDS)||[],a=Array.isArray(i)?i:[i];return{features:a.map(function(o){return lre(o)})}}function lre(t){var r=t||{};return{attributes:r,type:"",bounds:{bottom:0,top:0,left:0,right:0}}}function YB(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function KB(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?YB(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):YB(Object(e)).forEac
3529h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var f1=KB(KB({},Vo),{},{id:"wms-feature-info",name:"WMS FeatureInfo",parse:function(){var t=Y(l1.default.mark(function e(n,i){return l1.default.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",u1(new TextDecoder().decode(n),i));case 1:case"end":return o.stop()}},e)}));function r(e,n){return t.apply(this,arguments)}return r}(),parseTextSync:function(r,e){return u1(r,e)}});k();var p1=me(Ae());function c1(t,r){var e,n=(e=tn.parseTextSync)===null||e===void 0?void 0:e.call(tn,t,r);return n}function ZB(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function JB(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?ZB(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):ZB(Object(e)).forEac
3529h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var h1=JB(JB({},Vo),{},{id:"wms-layer-description",name:"WMS DescribeLayer",parse:function(){var t=Y(p1.default.mark(function e(n,i){return p1.default.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",c1(new TextDecoder().decode(n),i));case 1:case"end":return o.stop()}},e)}));function r(e,n){return t.apply(this,arguments)}return r}(),parseTextSync:function(r,e){return c1(r,e)}});F();k();F();j();k();function QB(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function e3(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?QB(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):QB(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var t3=function(){function t(r){A(this,t),c(this,"fetch",void 0),c(this,"loadOptions",void 0),c(this,"_needsRefresh",!0),c(this,"props",void 0),this.props=e3({},r),this.loadOptions=e3({},r.loadOptions),this.fetch=fre(this.loadOptions)}return T(t,[{key:"setProps",value:function(e){this.props=Object.assign(this.props,e),this.setNeedsRefresh()}},{key:"setNeedsRefresh",value:function(){this._needsRefresh=!0}},{key:"getNeedsRefresh",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,n=this._needsRefresh;return e&&(this._needsRefresh=!1),n}}]),t}();function fre(t){var r=t?.fetch;if(r&&typeof r=="function")return function(n,i){return r(n,i)};var e=t?.fetch;return e&&typeof e!="function"?function(n){return fetch(n,e)}:function(n){return fetch(n)}}function cre(t){var r=pre();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function pre(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var ki=function(t){L(e,t);var r=cre(e);function e(){return A(this,e),r.apply(this,arguments)}return e}(t3);k();be();F();j();var xc=me(Ae());k();function r3(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function n3(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?r3(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):r3(Object(e)).forEac
3529h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function hre(t){var r=dre();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function dre(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Ac=function(t){L(e,t);var r=hre(e);function e(n){return A(this,e),r.call(this,n)}return T(e,[{key:"getMetadata",value:function(){var n=Y(xc.default.mark(function a(){return xc.default.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:throw new Error("ImageSource.getMetadata not implemented");case 1:case"end":return s.stop()}},a)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getImage",value:function(){var n=Y(xc.default.mark(function a(o){var s,u,l,f;return xc.default.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return s=this.getGranularParameters(o),u=this.getURLFromTemplate(s),h.next=4,this.fetch(u);case 4:return l=h.sent,h.next=7,l.arrayBuffer();case 7:return f=h.sent,h.next=10,vn.parse(f);case 10:return h.abrupt("return",h.sent);case 11:case"end":return h.stop()}},a,this)}));function i(a){return n.apply(this,arguments)}return i}()},{key:"getGranularParameters",value:function(i){var a=W(i.bbox,4),o=a[0],s=a[1],u=a[2],l=a[3];return n3(n3({},i),{},{east:o,north:s,south:l,west:u})}},{key:"getURLFromTemplate",value:function(i){for(var a=this.props.url,o=0,s=Object.entries(i);o<s.length;o++){var u=W(s[o],2),l=u[0],f=u[1];a=a.replace("${".concat(l,"}"),String(f)),a=a.replace("{".concat(l,"}"),String(f))}return a}}]),e}(ki);c(Ac,"type","template");c(Ac,"testURL",function(t){return t.toLowerCase().includes("{")});be();k();F();j();var zt=me(Ae());k();function vre(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=mre(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3530In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function mre(t,r){if(t){if(typeof t=="string")return i3(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return i3(t,r)}}function i3(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function a3(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function ti(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?a3(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):a3(Object(e)).forEac
3530h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function gre(t){var r=yre();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function yre(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Sc=function(t){L(e,t);var r=gre(e);function e(n){var i;A(this,e);var a;return i=r.call(this,n),c(q(i),"url",void 0),c(q(i),"substituteCRS84",void 0),c(q(i),"flipCRS",void 0),c(q(i),"wmsParameters",void 0),c(q(i),"vendorParameters",void 0),c(q(i),"capabilities",null),c(q(i),"loaders",[vn,Nu,Vo,f1,h1]),i.url=n.url,i.substituteCRS84=(a=n.substituteCRS84)!==null&&a!==void 0?a:!1,i.flipCRS=["EPSG:4326"],i.wmsParameters=ti({layers:void 0,query_layers:void 0,styles:void 0,version:"1.3.0",crs:"EPSG:4326",format:"image/png",info_format:"text/plain",transparent:void 0,time:void 0,elevation:void 0},n.wmsParameters),i.vendorParameters=n.vendorParameters||{},i}return T(e,[{key:"getMetadata",value:function(){var n=Y(zt.default.mark(function a(){var o;return zt.default.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,this.getCapabilities();case 2:return o=u.sent,u.abrupt("return",this.normalizeMetadata(o));case 4:case"end":return u.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getImage",value:function(){var n=Y(zt.default.mark(function a(o){return zt.default.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,this.getMap(o);case 2:return u.abrupt("return",u.sent);case 3:case"end":return u.stop()}},a,this)}));function i(a){return n.apply(this,arguments)}return i}()},{key:"normalizeMetadata",value:function(i){return i}},{key:"getCapabilities",value:function(){var n=Y(zt.default.mark(function a(o,s){var u,l,f,p;return zt.default.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return u=this.getCapabilitiesURL(o,s),d.next=3,this.fetch(u);case 3:return l=d.sent,d.next=6,l.arrayBuffer();case 6:return f=d.sent,this._checkResponse(l,f),d.next=10,Vo.parse(f,this.loadOptions);case 10:return p=d.sent,this.capabilities=p,d.abrupt("return",p);case 13:case"end":return d.stop()}},a,this)}));function i(a,o){return n.apply(this,arguments)}return i}()},{key:"getMap",value:function(){var n=Y(zt.default.mark(function a(o,s){var u,l,f;return zt.default.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return u=this.getMapURL(o,s),h.next=3,this.fetch(u);case 3:return l=h.sent,h.next=6,l.arrayBuffer();case 6:return f=h.sent,this._checkResponse(l,f),h.prev=8,h.next=11,vn.parse(f,this.loadOptions);case 11:return h.abrupt("return",h.sent);case 14:throw h.prev=14,h.t0=h.catch(8),this._parseError(f);case 17:case"end":return h.stop()}},a,this,[[8,14]])}));function i(a,o){return n.apply(this,arguments)}return i}()},{key:"getFeatureInfo",value:function(){var n=Y(zt.default.mark(function a(o,s){var u,l,f;return zt.default.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return u=this.getFeatureInfoURL(o,s),h.next=3,this.fetch(u);case 3:return l=h.sent,h.next=6,l.arrayBuffer();case 6:return f=h.sent,this._checkResponse(l,f),h.next=10,f1.parse(f,this.loadOptions);case 10:return h.abrupt("return",h.sent);case 11:case"end":return h.stop()}},a,this)}));function i(a,o){return n.apply(this,arguments)}return i}()},{key:"getFeatureInfoText",value:function(){var n=Y(zt.default.mark(function a(o,s){var u,l,f;return zt.default.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return u=this.getFeatureInfoURL(o,s),h.next=3,this.fetch(u);case 3:return l=h.sent,h.next=6,l.arrayBuffer();case 6:return f=h.sent,this._checkResponse(l,f),h.abrupt("return",new TextDecoder().decode(f));case 9:case"end":return h.stop()}},a,this)}));function i(a,o){return n.apply(this,arguments)}return i}()},{key:"describeLayer",value:function(){var n=Y(zt.default.mark(function a(o,s){var u,l,f;return zt.default.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return u=this.describeLayerURL(o,s),h.next=3,this.fetch(u);case 3:return l=h.sent,h.next=6,l.arrayBuffer();case 6:return f=h.sent,this._checkResponse(l,f),h.next=10,h1.parse(f,this.loadOptions);case 10:return h.abrupt("return",h.sent);case 11:case"end":return h.stop()}},a,this)}));function i(a,o){return n.apply(this,arguments)}return i}()},{key:"getLegendGraphic",value:function(){var n=Y(zt.default.mark(function a(o,s){var u,l,f;return zt.default.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return u=this.getLegendGraphicURL(o,s),h.next=3,this.fetch(u);case 3:return l=h.sent,h.next=6,l.arrayBuffer();case 6:return f=h.sent,this._checkResponse(l,f),h.prev=8,h.next=11,vn.parse(f,this.loadOptions);case 11:return h.abrupt("return",h.sent);case 14:throw h.prev=14,h.t0=h.catch(8),this._parseError(f);case 17:case"end":return h.stop()}},a,this,[[8,14]])}));function i(a,o){return n.apply(this,arguments)}return i}()},{key:"getCapabilitiesURL",value:function(i,a){var o=ti({version:this.wmsParameters.version},i);return this._getWMSUrl("GetCapabilities",o,a)}},{key:"getMapURL",value:function(i,a){i=this._getWMS130Parameters(i);var o=ti({version:this.wmsParameters.version,format:this.wmsParameters.format,transparent:this.wmsParameters.transparent,time:this.wmsParameters.time,elevation:this.wmsParameters.elevation,layers:this.wmsParameters.layers,styles:this.wmsParameters.styles,crs:this.wmsParameters.crs},i);return this._getWMSUrl("GetMap",o,a)}},{key:"getFeatureInfoURL",value:function(i,a){var o=ti({version:this.wmsParameters.version,info_format:this.wmsParameters.info_format,layers:this.wmsParameters.layers,query_layers:this.wmsParameters.query_layers,styles:this.wmsParameters.styles,crs:this.wmsParameters.crs},i);return this._getWMSUrl("GetFeatureInfo",o,a)}},{key:"describeLayerURL",value:function(i,a){var o=ti({version:this.wmsParameters.version},i);return this._getWMSUrl("DescribeLayer",o,a)}},{key:"getLegendGraphicURL",value:function(i,a){var o=ti({version:this.wmsParameters.version},i);return this._getWMSUrl("GetLegendGraphic",o,a)}},{key:"_parseWMSUrl",value:function(i){var a=i.split("?"),o=W(a,2),s=o[0],u=o[1],l=u.split("&"),f={},p=vre(l),h;try{for(p.s();!(h=p.n()).done;){var d=h.value,v=d.split("="),m=W(v,2),g=m[0],y=m[1];f[g]=y}}catch(_){p.e(_)}finally{p.f()}return{url:s,parameters:f}}},{key:"_getWMSUrl",value:function(i,a,o){for(var s=this.url,u=!0,l=ti(ti(ti({service:"WMS",version:a.version,request:i},a),this.vendorParameters),o),f=["transparent","time","elevation"],p=0,h=Object.entries(l);p<h.length;p++){var d=W(h[p],2),v=d[0],m=d[1];(!f.includes(v)||m)&&(s+=u?"?":"&",u=!1,s+=this._getURLParameter(v,m,a))}return encodeURI(s)}},{key:"_getWMS130Parameters",value:function(i){var a=ti({},i);return a.srs&&(a.crs=a.crs||a.srs,delete a.srs),a}},{key:"_getURLParameter",value:function(i,a,o){switch(i){case"crs":o.version!=="1.3.0"?i="srs":this.substituteCRS84&&a==="EPSG:4326"&&(a="CRS:84");break;case"srs":o.version==="1.3.0"&&(i="crs");break;case"bbox":var s=this._flipBoundingBox(a,o);s&&(a=s);break;default:}return i=i.toUpperCase(),Array.isArray(a)?"".concat(i,"=").concat(a.join(",")):"".concat(i,"=").concat(a?String(a):"")}},{key:"_flipBoundingBox",value:function(i,a){if(!Array.isArray(i)||i.length!==4)return null;var o=a.version==="1.3.0"&&this.flipCRS.includes(a.crs||"")&&!(this.substituteCRS84&&a.crs==="EPSG:4326"),s=i;return o?[s[1],s[0],s[3],s[2]]:s}},{key:"_fetchArrayBuffer",value:function(){var n=Y(zt.default.mark(function a(o){var s,u;return zt.default.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.next=2,this.fetch(o);case 2:return s=f.sent,f.next=5,s.arrayBuffer();case 5:return u=f.sent,this._checkResponse(s,u),f.abrupt("return",u);case 8:case"end":return f.stop()}},a,this)}));function i(a){return n.apply(this,arguments)}return i}()},{key:"_checkResponse",value:function(i,a){var o=i.headers["content-type"];if(!i.ok||Nu.mimeTypes.includes(o)){var s=Jg(this.loadOptions,{wms:{throwOnError:!0}}),u=Nu.parseSync(a,s);throw new Error(u)}}},{key:"_parseError",value:function(i){var a=Nu.parseSync(i,this.loadOptions);return new Error(a)}}]),e}(ki);c(Sc,"type","wms");c(Sc,"testURL",function(t){return t.toLowerCase().includes("wms")});be();k();F();j();var Bi=me(Ae());k();function o3(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function s3(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};
3530r%2?o3(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):o3(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function _re(t){var r=bre();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function bre(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var vv=function(t){L(e,t);var r=_re(e);function e(n){return A(this,e),r.call(this,n)}return T(e,[{key:"getMetadata",value:function(){var n=Y(Bi.default.mark(function a(){return Bi.default.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,this.metadata();case 2:return s.abrupt("return",s.sent);case 3:case"end":return s.stop()}},a,this)}));function i(){return n.apply(this,arguments)}return i}()},{key:"getImage",value:function(){var n=Y(Bi.default.mark(function a(o){return Bi.default.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:throw new Error("not implemented");case 1:case"end":return u.stop()}},a)}));function i(a){return n.apply(this,arguments)}return i}()},{key:"metadata",value:function(){var n=Y(Bi.default.mark(function a(){return Bi.default.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:throw new Error("not implemented");case 1:case"end":return s.stop()}},a)}));function i(){return n.apply(this,arguments)}return i}()},{key:"exportImage",value:function(i){throw new Error("not implemented")}},{key:"metadataURL",value:function(i){return"".concat(this.props.url,"?f=pjson")}},{key:"exportImageURL",value:function(i){var a="bbox=".concat(i.bbox[0],",").concat(i.bbox[1],",").concat(i.bbox[2],",").concat(i.bbox[3]),o="size=".concat(i.width,",").concat(i.height),s=s3(s3({},i),{},{bbox:a,size:o});return delete s.width,delete s.height,this.getUrl("exportImage",s)}},{key:"getUrl",value:function(i,a,o){for(var s="".concat(this.props.url,"/").concat(i),u=!0,l=0,f=Object.entries(a);l<f.length;l++){var p=W(f[l],2),h=p[0],d=p[1];s+=u?"?":"&",u=!1,Array.isArray(d)?s+="".concat(h.toUpperCase(),"=").concat(d.join(",")):s+="".concat(h.toUpperCase(),"=").concat(d?String(d):"")}return s}},{key:"checkResponse",value:function(){var n=Y(Bi.default.mark(function a(o){return Bi.default.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(o.ok){u.next=2;break}throw new Error("error");case 2:case"end":return u.stop()}},a)}));function i(a){return n.apply(this,arguments)}return i}()}]),e}(ki);c(vv,"type","arcgis-image-server");c(vv,"testURL",function(t){return t.toLowerCase().includes("ImageServer")});function xre(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=Are(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3531In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function Are(t,r){if(t){if(typeof t=="string")return u3(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return u3(t,r)}}function u3(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var Sre=[Sc,vv,Ac];function d1(t){var r=t.type,e=r===void 0?"auto":r,n=e==="auto"?Tre(t.url):e;switch(n){case"template":return new Ac(t);case"wms":return new Sc(t);default:throw new Error("Not a valid image source type")}}function Tre(t){var r=xre(Sre),e;try{for(r.s();!(e=r.n()).done;){var n=e.value;if(n.testURL&&n.testURL(t))return n.type}}catch(i){r.e(i)}finally{r.f()}return"wms"}var l3=6378137*Math.PI;function v1(t){var r=mt(t);return r[0]=(r[0]/256-1)*l3,r[1]=(r[1]/256-1)*l3,r}function f3(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function mv(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};
3531r%2?f3(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):f3(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function wre(t){var r=Pre();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function Pre(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Ore={id:"imagery-layer",data:"",serviceType:"auto",srs:"auto",layers:{type:"array",compare:!0,value:[]},onMetadataLoad:{type:"function",value:function(){}},onMetadataLoadError:{type:"function",value:console.error},onImageLoadStart:{type:"function",value:function(){}},onImageLoad:{type:"function",value:function(){}},onImageLoadError:{type:"function",compare:!1,value:function(r,e){return console.error(e,r)}}},gv=function(t){L(e,t);var r=wre(e);function e(){var n;A(this,e);for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return n=r.call.apply(r,[this].concat(a)),c(q(n),"state",void 0),n}return T(e,[{key:"isLoaded",get:function(){return Boolean(this.state)&&this.state.loadCounter===0&&Z(S(e.prototype),"isLoaded",this)}},{key:"shouldUpdateState",value:function(){return!0}},{key:"initializeState",value:function(){this.state._nextRequestId=0,this.state.lastRequestId=-1,this.state.loadCounter=0}},{key:"updateState",value:function(i){var a=this,o=i.changeFlags,s=i.props,u=i.oldProps,l=this.context.viewport;o.dataChanged||s.serviceType!==u.serviceType?(this.state.imageSource=this._createImageSource(s),this._loadMetadata(),this.debounce(function(){return a.loadImage(l,"image source changed")},0)):xt(s.layers,u.layers,1)?o.viewportChanged&&this.debounce(function(){return a.loadImage(l,"viewport changed")}):this.debounce(function(){return a.loadImage(l,"layers changed")},0)}},{key:"finalizeState",value:function(){}},{key:"renderLayers",value:function(){var i=this.state,a=i.bounds,o=i.image,s=i.lastRequestParameters;return o&&new Su(mv(mv({},this.getSubLayerProps({id:"bitmap"})),{},{_imageCoordinateSystem:s.srs==="EPSG:4326"?de.LNGLAT:de.CARTESIAN,bounds:a,image:o}))}},{key:"getFeatureInfoText",value:function(){var n=Y(Ho.default.mark(function a(o,s){var u,l,f,p;return Ho.default.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:if(u=this.state.lastRequestParameters,!u){d.next=6;break}return d.next=4,(l=(f=this.state.imageSource).getFeatureInfoText)===null||l===void 0?void 0:l.call(f,mv(mv({},u),{},{query_layers:u.layers,x:o,y:s,info_format:"application/vnd.ogc.gml"}));case 4:return p=d.sent,d.abrupt("return",p);case 6:return d.abrupt("return","");case 7:case"end":return d.stop()}},a,this)}));function i(a,o){return n.apply(this,arguments)}return i}()},{key:"_createImageSource",value:function(i){if(i.data instanceof ki)return i.data;
3531if(typeof i.data=="string")return d1({url:i.data,loadOptions:i.loadOptions,type:i.serviceType});throw new Error("invalid image source in props.data")}},{key:"_loadMetadata",value:function(){var n=Y(Ho.default.mark(function a(){var o,s,u,l;return Ho.default.wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return o=this.state.imageSource,p.prev=1,this.state.loadCounter++,p.next=5,o.getMetadata();case 5:s=p.sent,this.state.imageSource===o&&((u=this.getCurrentLayer())===null||u===void 0||u.props.onMetadataLoad(s)),p.next=12;break;case 9:p.prev=9,p.t0=p.catch(1),(l=this.getCurrentLayer())===null||l===void 0||l.props.onMetadataLoadError(p.t0);case 12:return p.prev=12,this.state.loadCounter--,p.finish(12);case 15:case"end":return p.stop()}},a,this,[[1,9,12,15]])}));function i(){return n.apply(this,arguments)}return i}()},{key:"loadImage",value:function(){var n=Y(Ho.default.mark(function a(o,s){var u,l,f,p,h,d,v,m,g,y,_,b,x,w,P,E,C,I,O,D;return Ho.default.wrap(function(H){for(;;)switch(H.prev=H.next){case 0:if(u=this.props,l=u.layers,f=u.serviceType,!(f==="wms"&&l.length===0)){H.next=3;break}return H.abrupt("return");case 3:return p=o.getBounds(),h=o.width,d=o.height,v=this.getRequestId(),m=this.props.srs,m==="auto"&&(m=o.resolution?"EPSG:4326":"EPSG:3857"),g={width:h,height:d,bbox:p,layers:l,srs:m},m==="EPSG:3857"&&(y=v1([p[0],p[1]]),_=W(y,2),b=_[0],x=_[1],w=v1([p[2],p[3]]),P=W(w,2),E=P[0],C=P[1],g.bbox=[b,x,E,C]),H.prev=10,this.state.loadCounter++,this.props.onImageLoadStart(v),H.next=15,this.state.imageSource.getImage(g);case 15:I=H.sent,this.state.lastRequestId<v&&((O=this.getCurrentLayer())===null||O===void 0||O.props.onImageLoad(v),this.setState({image:I,bounds:p,lastRequestParameters:g,lastRequestId:v})),H.next=23;break;case 19:H.prev=19,H.t0=H.catch(10),this.raiseError(H.t0,"Load image"),(D=this.getCurrentLayer())===null||D===void 0||D.props.onImageLoadError(v,H.t0);case 23:return H.prev=23,this.state.loadCounter--,H.finish(23);case 26:case"end":return H.stop()}},a,this,[[10,19,23,26]])}));function i(a,o){return n.apply(this,arguments)}return i}()},{key:"getRequestId",value:function(){return this.state._nextRequestId++}},{key:"debounce",value:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:500;clearTimeout(this.state._timeoutId),this.state._timeoutId=setTimeout(function(){return i()},a)}}]),e}(gt);c(gv,"layerName","WMSLayer");c(gv,"defaultProps",Ore);F();k();function Ere(t){var r=Cre();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function Cre(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Mre={getHeight:{type:"accessor",value:0},greatCircle:!0},yv=function(t){L(e,t);var r=Ere(e);function e(){return A(this,e),r.apply(this,arguments)}return e}(Au);c(yv,"layerName","GreatCircleLayer");c(yv,"defaultProps",Mre);F();j();k();F();j();k();var Ire=["updateTriggers"];function Rre(t){var r=Lre();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function Lre(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function c3(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function m1(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?c3(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):c3(Object(e)).forEac
3531h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var kre=m1({},Qn.defaultProps),rn=function(t){L(e,t);var r=Rre(e);function e(){return A(this,e),r.apply(this,arguments)}return T(e,[{key:"indexToBounds",value:function(){return null}},{key:"renderLayers",value:function(){var i=this.props,a=i.elevationScale,o=i.extruded,s=i.wireframe,u=i.filled,l=i.stroked,f=i.lineWidthUnits,p=i.lineWidthScale,h=i.lineWidthMinPixels,d=i.lineWidthMaxPixels,v=i.lineJointRounded,m=i.lineMiterLimit,g=i.lineDashJustified,y=i.getElevation,_=i.getFillColor,b=i.getLineColor,x=i.getLineWidth,w=this.props,P=w.updateTriggers,E=w.material,C=w.transitions,I=this.getSubLayerClass("cell",Qn),O=this.indexToBounds()||{},D=O.updateTriggers,N=Ii(O,Ire);return new I({filled:u,wireframe:s,extruded:o,elevationScale:a,stroked:l,lineWidthUnits:f,lineWidthScale:p,lineWidthMinPixels:h,lineWidthMaxPixels:d,lineJointRounded:v,lineMiterLimit:m,lineDashJustified:g,material:E,transitions:C,getElevation:y,getFillColor:_,getLineColor:b,getLineWidth:x}
3531,this.getSubLayerProps({id:"cell",updateTriggers:P&&m1(m1({},D),{},{getElevation:P.getElevation,getFillColor:P.getFillColor,getLineColor:P.getLineColor,getLineWidth:P.getLineWidth})}),N)}}]),e}(gt);c(rn,"layerName","GeoCellLayer");c(rn,"defaultProps",kre);be();var _v=me(g1()),Bre=3,Fre=30,Dre=2*Fre+1,h3=180/Math.PI;function v3(t,r,e){var n=1<<r;return[(t[0]+e[0])/n,(t[1]+e[1])/n]}function d3(t){return t>=.5?1/3*(4*t*t-1):1/3*(1-4*(1-t)*(1-t))}function m3(t){return[d3(t[0]),d3(t[1])]}function g3(t,r){var e=W(r,2),n=e[0],i=e[1];switch(t){case 0:return[1,n,i];case 1:return[-n,1,i];case 2:return[-n,-i,1];case 3:return[-1,-i,-n];case 4:return[i,-1,-n];case 5:return[i,n,-1];default:throw new Error("Invalid face")}}function y3(t){var r=W(t,3),e=r[0],n=r[1],i=r[2],a=Math.atan2(i,Math.sqrt(e*e+n*n)),o=Math.atan2(n,e);return[o*h3,a*h3]}function _3(t){for(var r=_v.default.fromString(t,!0,10).toString(2);r.length<Bre+Dre;)r="0"+r;for(var e=r.lastIndexOf("1"),n=r.substring(0,3),i=r.substring(3,e),a=i.length/2,o=_v.default.fromString(n,!0,2).toString(10),s=_v.default.fromString(i,!0,2).toString(4);s.length<a;)s="0"+s;return"".concat(o,"/").concat(s)}function Nre(t,r,e,n){if(n===0){e===1&&(r[0]=t-1-r[0],r[1]=t-1-r[1]);var i=r[0];r[0]=r[1],r[1]=i}}function b3(t){for(var r=t.split("/"),e=parseInt(r[0],10),n=r[1],i=n.length,a=[0,0],o,s=i-1;s>=0;s--){o=i-s;var u=n[s],l=0,f=0;u==="1"?f=1:u==="2"?(l=1,f=1):u==="3"&&(l=1);var p=Math.pow(2,o-1);Nre(p,a,l,f),a[0]+=p*l,a[1]+=p*f}if(e%2===1){var h=a[0];a[0]=a[1],a[1]=h}return{face:e,ij:a,level:o}}var x3=me(g1());function jre(t){var r=t.padEnd(16,"0");return x3.default.fromString(r,16)}var Ure=100;function Gre(t){for(var r=t.face,e=t.ij,n=t.level,i=[[0,0],[0,1],[1,1],[1,0],[0,0]],a=Math.max(1,Math.ceil(Ure*Math.pow(2,-n))),o=new Float64Array(4*a*2+2),s=0,u=0,l=0;l<4;l++)for(var f=i[l].slice(0),p=i[l+1],h=(p[0]-f[0])/a,d=(p[1]-f[1])/a,v=0;v<a;v++){f[0]+=h,f[1]+=d;var m=v3(e,n,f),g=m3(m),y=g3(r,g),_=y3(y);Math.abs(_[1])>89.999&&(_[0]=u);var b=_[0]-u;_[0]+=b>180?-360:b<-180?360:0,o[s++]=_[0],o[s++]=_[1],u=_[0]}return o[s++]=o[0],o[s++]=o[1],o}function zre(t){if(typeof t=="string"){if(t.indexOf("/")>0)return t;t=jre(t)}return _3(t.toString())}function A3(t){var r=zre(t),e=b3(r);return Gre(e)}function Vre(t){var r=Hre();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function Hre(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Wre={getS2Token:{type:"accessor",value:function(r){return r.token}}},bv=function(t){L(e,t);var r=Vre(e);function e(){return A(this,e),r.apply(this,arguments)}return T(e,[{key:"indexToBounds",value:function(){var i=this.props,a=i.data,o=i.getS2Token;return{data:a,_normalize:!1,positionFormat:"XY",getPolygon:function(u,l){return A3(o(u,l))}}}}]),e}(rn);c(bv,"layerName","S2Layer");c(bv,"defaultProps",Wre);F();j();k();be();var y1=512;function $re(t,r){for(var e=0,n=0,i=1<<t.length,a=i/y1,o=0;o<t.length;o++){i>>=1;var s=parseInt(t[o]);s%2&&(e|=i),s>1&&(n|=i)}return[[e/a,y1-n/a],[(e+r)/a,y1-(n+r)/a]]}function S3(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,e=$re(t,r),n=W(e,2),i=n[0],a=n[1],o=Dt(i),s=W(o,2),u=s[0],l=s[1],f=Dt(a),p=W(f,2),h=p[0],d=p[1];return[h,l,h,d,u,d,u,l,h,l]}function Xre(t){var r=qre();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function qre(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Yre={getQuadkey:{type:"accessor",value:function(r){return r.quadkey}}},xv=function(t){L(e,t);var r=Xre(e);function e(){return A(this,e),r.apply(this,arguments)}return T(e,[{key:"indexToBounds",value:function(){var i=this.props,a=i.data,o=i.extruded,s=i.getQuadkey,u=o?.99:1;return{data:a,_normalize:!1,positionFormat:"XY",getPolygon:function(f,p){return S3(s(f,p),u)},updateTriggers:{getPolygon:u}}}}]),e}(rn);c(xv,"layerName","QuadkeyLayer");c(xv,"defaultProps",Yre);F();j();k();be();F();j();k();F();j();k();var _1=me(Ae()),wc=function(){function t(r){A(this,t),c(this,"index",void 0),c(this,"isVisible",void 0),c(this,"isSelected",void 0),c(this,"parent",void 0),c(this,"children",void 0),c(this,"content",void 0),c(this,"state",void 0),c(this,"layers",void 0),c(this,"id",void 0),c(this,"zoom",void 0),c(this,"userData",void 0),c(this,"boundingBox",void 0),c(this,"_abortController",void 0),c(this,"_loader",void 0),c(this,"_loaderId",void 0),c(this,"_isLoaded",void 0),c(this,"_isCancelled",void 0),c(this,"_needsReload",void 0),c(this,"_bbox",void 0),this.index=r,this.isVisible=!1,this.isSelected=!1,this.parent=null,this.children=[],this.content=null,this._loader=void 0,this._abortController=null,this._loaderId=0,this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1}return T(t,[{key:"bbox",get:function(){return this._bbox},set:function(e){this._bbox||(this._bbox=e,"west"in e?this.boundingBox=[[e.west,e.south],[e.east,e.north]]:this.boundingBox=[[e.left,e.top],[e.right,e.bottom]])}},{key:"data",get:function(){var e=this;return this.isLoading&&this._loader?this._loader.then(function(){return e.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 e=this.content?this.content.byteLength:0;return Number.isFinite(e)||console.error("byteLength not defined in tile data"),e}}
3531,{key:"_loadData",value:function(){var r=Y(_1.default.mark(function n(i){var a,o,s,u,l,f,p,h,d,v,m,g,y,_;return _1.default.wrap(function(x){for(;;)switch(x.prev=x.next){case 0:return a=i.getData,o=i.requestScheduler,s=i.onLoad,u=i.onError,l=this.index,f=this.id,p=this.bbox,h=this.userData,d=this.zoom,v=this._loaderId,this._abortController=new AbortController,m=this._abortController.signal,x.next=7,o.scheduleRequest(this,function(w){return w.isSelected?1:-1});case 7:if(g=x.sent,g){x.next=11;break}return this._isCancelled=!0,x.abrupt("return");case 11:if(!this._isCancelled){x.next=14;break}return g.done(),x.abrupt("return");case 14:return y=null,x.prev=15,x.next=18,a({index:l,id:f,bbox:p,userData:h,zoom:d,signal:m});case 18:y=x.sent,x.next=24;break;case 21:x.prev=21,x.t0=x.catch(15),_=x.t0||!0;case 24:return x.prev=24,g.done(),x.finish(24);case 27:if(v===this._loaderId){x.next=29;break}return x.abrupt("return");case 29:if(this._loader=void 0,this.content=y,!(this._isCancelled&&!y)){x.next=34;break}return this._isLoaded=!1,x.abrupt("return");case 34:this._isLoaded=!0,this._isCancelled=!1,_?u(_,this):s(this);case 37:case"end":return x.stop()}},n,this,[[15,21,24,27]])}));function e(n){return r.apply(this,arguments)}return e}()},{key:"loadData",value:function(e){return this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1,this._loaderId++,this._loader=this._loadData(e),this._loader}},{key:"setNeedsReload",value:function(){this.isLoading&&(this.abort(),this._loader=void 0),this._needsReload=!0}},{key:"abort",value:function(){var e;this.isLoaded||(this._isCancelled=!0,(e=this._abortController)===null||e===void 0||e.abort())}}]),t}();be();be();F();j();k();var Lt={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};F();j();k();var T3=new z,Kre=new z,Av=function(){function t(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[0,0,0],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0],n=arguments.length>2?arguments[2]:void 0;A(this,t),c(this,"center",void 0),c(this,"halfDiagonal",void 0),c(this,"minimum",void 0),c(this,"maximum",void 0),n=n||T3.copy(r).add(e).scale(.5),this.center=new z(n),this.halfDiagonal=new z(e).subtract(this.center),this.minimum=new z(r),this.maximum=new z(e)}return T(t,[{key:"clone",value:function(){return new t(this.minimum,this.maximum,this.center)}},{key:"equals",value:function(e){return this===e||Boolean(e)&&this.minimum.equals(e.minimum)&&this.maximum.equals(e.maximum)}},{key:"transform",value:function(e){return this.center.transformAsPoint(e),this.halfDiagonal.transform(e),this.minimum.transform(e),this.maximum.transform(e),this}},{key:"intersectPlane",value:function(e){var n=this.halfDiagonal,i=Kre.from(e.normal),a=n.x*Math.abs(i.x)+n.y*Math.abs(i.y)+n.z*Math.abs(i.z),o=this.center.dot(i)+e.distance;return o-a>0?Lt.INSIDE:o+a<0?Lt.OUTSIDE:Lt.INTERSECTING}},{key:"distanceTo",value:function(e){return Math.sqrt(this.distanceSquaredTo(e))}},{key:"distanceSquaredTo",value:function(e){var n=T3.from(e).subtract(this.center),i=this.halfDiagonal,a=0,o;return o=Math.abs(n.x)-i.x,o>0&&(a+=o*o),o=Math.abs(n.y)-i.y,o>0&&(a+=o*o),o=Math.abs(n.z)-i.z,o>0&&(a+=o*o),a}}]),t}();F();j();k();var Pc=new z,w3=new z,Ia=function(){function t(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[0,0,0],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;A(this,t),c(this,"center",void 0),c(this,"radius",void 0),this.radius=-0,this.center=new z,this.fromCenterRadius(r,e)}return T(t,[{key:"fromCenterRadius",value:function(e,n){return this.center.from(e),this.radius=n,this}},{key:"fromCornerPoints",value:function(e,n){return n=Pc.from(n),this.center=new z().from(e).add(n).scale(.5),this.radius=this.center.distance(n),this}},{key:"equals",value:function(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.radius===e.radius}},{key:"clone",value:function(){return new t(this.center,this.radius)}},{key:"union",value:function(e){var n=this.center,i=this.radius,a=e.center,o=e.radius,s=Pc.copy(a).subtract(n),u=s.magnitude();if(i>=u+o)return this.clone();if(o>=u+i)return e.clone();var l=(i+u+o)*.5;return w3.copy(s).scale((-i+l)/u).add(n),this.center.copy(w3),this.radius=l,this}},{key:"expand",value:function(e){var n=Pc.from(e),i=n.subtract(this.center).magnitude();return i>this.radius&&(this.radius=i),this}},{key:"transform",value:function(e){this.center.transform(e);var n=kE(Pc,e);return this.radius=Math.max(n[0],Math.max(n[1],n[2]))*this.radius,this}},{key:"distanceSquaredTo",value:function(e){var n=this.distanceTo(e);return n*n}},{key:"distanceTo",value:function(e){var n=Pc.from(e),i=n.subtract(this.center);return Math.max(0,i.len()-this.radius)}},{key:"intersectPlane",value:function(e){var n=this.center,i=this.radius,a=e.n
3531ormal,o=a.dot(n)+e.distance;return o<-i?Lt.OUTSIDE:o<i?Lt.INTERSECTING:Lt.INSIDE}}]),t}();F();j();k();var Zre=new z,Jre=new z,Sv=new z,Tv=new z,wv=new z,Qre=new z,ene=new z,Fi={COLUMN0ROW0:0,COLUMN0ROW1:1,COLUMN0ROW2:2,COLUMN1ROW0:3,COLUMN1ROW1:4,COLUMN1ROW2:5,COLUMN2ROW0:6,COLUMN2ROW1:7,COLUMN2ROW2:8},Wo=function(){function t(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[0,0,0],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0,0,0,0,0,0,0];A(this,t),c(this,"center",void 0),c(this,"halfAxes",void 0),this.center=new z().from(r),this.halfAxes=new at(e)}return T(t,[{key:"halfSize",get:function(){var e=this.halfAxes.getColumn(0),n=this.halfAxes.getColumn(1),i=this.halfAxes.getColumn(2);return[new z(e).len(),new z(n).len(),new z(i).len()]}},{key:"quaternion",get:function(){var e=this.halfAxes.getColumn(0),n=this.halfAxes.getColumn(1),i=this.halfAxes.getColumn(2),a=new z(e).normalize(),o=new z(n).normalize(),s=new z(i).normalize();return new Vn().fromMatrix3(new at([].concat(ae(a),ae(o),ae(s))))}},{key:"fromCenterHalfSizeQuaternion",value:function(e,n,i){var a=new Vn(i),o=new at().fromQuaternion(a);return o[0]=o[0]*n[0],o[1]=o[1]*n[0],o[2]=o[2]*n[0],o[3]=o[3]*n[1],o[4]=o[4]*n[1],o[5]=o[5]*n[1],o[6]=o[6]*n[2],o[7]=o[7]*n[2],o[8]=o[8]*n[2],this.center=new z().from(e),this.halfAxes=o,this}},{key:"clone",value:function(){return new t(this.center,this.halfAxes)}},{key:"equals",value:function(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.halfAxes.equals(e.halfAxes)}},{key:"getBoundingSphere",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Ia,n=this.halfAxes,i=n.getColumn(0,Sv),a=n.getColumn(1,Tv),o=n.getColumn(2,wv),s=Zre.copy(i).add(a).add(o);return e.center.copy(this.center),e.radius=s.magnitude(),e}},{key:"intersectPlane",value:function(e){var n=this.center,i=e.normal,a=this.halfAxes,o=i.x,s=i.y,u=i.z,l=Math.abs(o*a[Fi.COLUMN0ROW0]+s*a[Fi.COLUMN0ROW1]+u*a[Fi.COLUMN0ROW2])+Math.abs(o*a[Fi.COLUMN1ROW0]+s*a[Fi.COLUMN1ROW1]+u*a[Fi.COLUMN1ROW2])+Math.abs(o*a[Fi.COLUMN2ROW0]+s*a[Fi.COLUMN2ROW1]+u*a[Fi.COLUMN2ROW2]),f=i.dot(n)+e.distance;return f<=-l?Lt.OUTSIDE:f>=l?Lt.INSIDE:Lt.INTERSECTING}},{key:"distanceTo",value:function(e){return Math.sqrt(this.distanceSquaredTo(e))}},{key:"distanceSquaredTo",value:function(e){var n=Jre.from(e).subtract(this.center),i=this.halfAxes,a=i.getColumn(0,Sv),o=i.getColumn(1,Tv),s=i.getColumn(2,wv),u=a.magnitude(),l=o.magnitude(),f=s.magnitude();a.normalize(),o.normalize(),s.normalize();var p=0,h;return h=Math.abs(n.dot(a))-u,h>0&&(p+=h*h),h=Math.abs(n.dot(o))-l,h>0&&(p+=h*h),h=Math.abs(n.dot(s))-f,h>0&&(p+=h*h),p}},{key:"computePlaneDistances",value:function(e,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[-0,-0],a=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,s=this.center,u=this.halfAxes,l=u.getColumn(0,Sv),f=u.getColumn(1,Tv),p=u.getColumn(2,wv),h=Qre.copy(l).add(f).add(p).add(s),d=ene.copy(h).subtract(e),v=n.dot(d);return a=Math.min(v,a),o=Math.max(v,o),h.copy(s).add(l).add(f).subtract(p),d.copy(h).subtract(e),v=n.dot(d),a=Math.min(v,a),o=Math.max(v,o),h.copy(s).add(l).subtract(f).add(p),d.copy(h).subtract(e),v=n.dot(d),a=Math.min(v,a),o=Math.max(v,o),h.copy(s).add(l).subtract(f).subtract(p),d.copy(h).subtract(e),v=n.dot(d),a=Math.min(v,a),o=Math.max(v,o),s.copy(h).subtract(l).add(f).add(p),d.copy(h).subtract(e),v=n.dot(d),a=Math.min(v,a),o=Math.max(v,o),s.copy(h).subtract(l).add(f).subtract(p),d.copy(h).subtract(e),v=n.dot(d),a=Math.min(v,a),o=Math.max(v,o),s.copy(h).subtract(l).subtract(f).add(p),d.copy(h).subtract(e),v=n.dot(d),a=Math.min(v,a),o=Math.max(v,o),s.copy(h).subtract(l).subtract(f).subtract(p),d.copy(h).subtract(e),v=n.dot(d),a=Math.min(v,a),o=Math.max(v,o),i[0]=a,i[1]=o,i}},{key:"transform",value:function(e){this.center.transformAsPoint(e);var n=this.halfAxes.getColumn(0,Sv);n.transformAsPoint(e);var i=this.halfAxes.getColumn(1,Tv);i.transformAsPoint(e);var a=this.halfAxes.getColumn(2,wv);return a.transformAsPoint(e),this.halfAxes=new at([].concat(ae(n),ae(i),ae(a))),this}},{key:"getTransform",value:function(){throw new Error("not implemented")}}]),t}();F();j();k();F();j();k();var P3=new z,O3=new z,kt=function(){function t(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[0,0,1],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;A(this,t),c(this,"normal",void 0),c(this,"distance",void 0),this.normal=new z,this.distance=-0,this.fromNormalDistance(r,e)}return T(t,[{key:"fromNormalDistance",value:function(e,n){return Xe(Number.isFinite(n)),this.normal.from(e).normalize(),this.distance=n,this}},{key:"fromPointNormal",value:function(e,n){e=P3.from(e),this.normal.from(n).normalize();var i=-this.normal.dot(e);return this.distance=i,this}},{key:"fromCoefficients",value:function(e,n,i,a){return this.normal.set(e,n,i),Xe(Ze(this.normal.len(),1)),this.distance=a,this}},{key:"clone",value:function(){return new t(this.normal,this.distance)}},{key:"equals",value:function(e){return Ze(this.distance,e.distance)&&Ze(this.normal,e.normal)}},{key:"getPointDistance",value:function(e){return this.normal.dot(e)+this.distance}},{key:"transform",value:function(e){var n=O3.copy(this.normal).transformAsVector(e).normalize(),i=this.normal.scale(-this.distance).transform(e);return this.fromPointNormal(i,n)}},{key:"projectPointOntoPlane",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];e=P3.from(e);var i=this.getPointDistance(e),a=O3.copy(this.normal).scale(i);return e.subtract(a).to(n)}}]),t}();function E3(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=tne(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}
3531}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3532In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function tne(t,r){if(t){if(typeof t=="string")return C3(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return C3(t,r)}}function C3(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var M3=[new z([1,0,0]),new z([0,1,0]),new z([0,0,1])],I3=new z,rne=new z,WZe=new kt(new z(1,0,0),0),Or=function(){function t(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];A(this,t),c(this,"planes",void 0),this.planes=r}return T(t,[{key:"fromBoundingSphere",value:function(e){this.planes.length=2*M3.length;var n=e.center,i=e.radius,a=0,o=E3(M3),s;try{for(o.s();!(s=o.n()).done;){var u=s.value,l=this.planes[a],f=this.planes[a+1];l||(l=this.planes[a]=new kt),f||(f=this.planes[a+1]=new kt);var p=I3.copy(u).scale(-i).add(n),h=-u.dot(p);l.fromPointNormal(p,u);var d=I3.copy(u).scale(i).add(n),v=rne.copy(u).negate(),m=-v.dot(d);f.fromPointNormal(d,v),a+=2}}catch(g){o.e(g)}finally{o.f()}return this}},{key:"computeVisibility",value:function(e){var n=Lt.INSIDE,i=E3(this.planes),a;try{for(i.s();!(a=i.n()).done;){var o=a.value,s=e.intersectPlane(o);switch(s){case Lt.OUTSIDE:return Lt.OUTSIDE;case Lt.INTERSECTING:n=Lt.INTERSECTING;break;default:}}}catch(u){i.e(u)}finally{i.f()}return n}},{key:"computeVisibilityWithPlaneMask",value:function(e,n){if(Xe(Number.isFinite(n),"parentPlaneMask is required."),n===t.MASK_OUTSIDE||n===t.MASK_INSIDE)return n;for(var i=t.MASK_INSIDE,a=this.planes,o=0;o<this.planes.length;++o){var s=o<31?1<<o:0;if(!(o<31&&!(n&s))){var u=a[o],l=e.intersectPlane(u);if(l===Lt.OUTSIDE)return t.MASK_OUTSIDE;l===Lt.INTERSECTING&&(i|=s)}}return i}}]),t}();c(Or,"MASK_OUTSIDE",4294967295);c(Or,"MASK_INSIDE",0);c(Or,"MASK_INDETERMINATE",2147483647);F();j();k();var nne=new z,ine=new z,ane=new z,one=new z,sne=new z,b1=function(){function t(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};A(this,t),c(this,"left",void 0),c(this,"_left",void 0),c(this,"right",void 0),c(this,"_right",void 0),c(this,"top",void 0),c(this,"_top",void 0),c(this,"bottom",void 0),c(this,"_bottom",void 0),c(this,"near",void 0),c(this,"_near",void 0),c(this,"far",void 0),c(this,"_far",void 0),c(this,"_cullingVolume",new Or([new kt,new kt,new kt,new kt,new kt,new kt])),c(this,"_perspectiveMatrix",new ye),c(this,"_infinitePerspective",new ye);var e=r.near,n=e===void 0?1:e,i=r.far,a=i===void 0?5e8:i;this.left=r.left,this._left=void 0,this.right=r.right,this._right=void 0,this.top=r.top,this._top=void 0,this.bottom=r.bottom,this._bottom=void 0,this.near=n,this._near=n,this.far=a,this._far=a}return T(t,[{key:"clone",value:function(){return new t({right:this.right,left:this.left,top:this.top,bottom:this.bottom,near:this.near,far:this.far})}},{key:"equals",value:function(e){return e&&e instanceof t&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far}},{key:"projectionMatrix",get:function(){return this._update(),this._perspectiveMatrix}},{key:"infiniteProjectionMatrix",get:function(){return this._update(),this._infinitePerspective}},{key:"computeCullingVolume",value:function(e,n,i){Xe(e,"position is required."),Xe(n,"direction is required."),Xe(i,"up is required.");var a=this._cullingVolume.planes;i=nne.copy(i).normalize();var o=ine.copy(n).cross(i).normalize(),s=ane.copy(n).multiplyByScalar(this.near).add(e),u=one.copy(n).multiplyByScalar(this.far).add(e),l=sne;return l.copy(o).multiplyByScalar(this.left).add(s).subtract(e).cross(i),a[0].fromPointNormal(e,l),l.copy(o).multiplyByScalar(this.right).add(s).subtract(e).cross(i).negate(),a[1].fromPointNormal(e,l),l.copy(i).multiplyByScalar(this.bottom).add(s).subtract(e).cross(o).negate(),a[2].fromPointNormal(e,l),l.copy(i).multiplyByScalar(this.top).add(s).subtract(e).cross(o),a[3].fromPointNormal(e,l),l=new z().copy(n),a[4].fromPointNormal(s,l),l.negate(),a[5].fromPointNormal(u,l),this._cullingVolume}},{key:"getPixelDimensions",value:function(e,n,i,a){this._update(),Xe(Number.isFinite(e)&&Number.isFinite(n)),Xe(e>0),Xe(n>0),Xe(i>0),Xe(a);
3532var o=1/this.near,s=this.top*o,u=2*i*s/n;s=this.right*o;var l=2*i*s/e;return a.x=l,a.y=u,a}},{key:"_update",value:function(){Xe(Number.isFinite(this.right)&&Number.isFinite(this.left)&&Number.isFinite(this.top)&&Number.isFinite(this.bottom)&&Number.isFinite(this.near)&&Number.isFinite(this.far));var e=this.top,n=this.bottom,i=this.right,a=this.left,o=this.near,s=this.far;(e!==this._top||n!==this._bottom||a!==this._left||i!==this._right||o!==this._near||s!==this._far)&&(Xe(this.near>0&&this.near<this.far,"near must be greater than zero and less than far."),this._left=a,this._right=i,this._top=e,this._bottom=n,this._near=o,this._far=s,this._perspectiveMatrix=new ye().frustum({left:a,right:i,bottom:n,top:e,near:o,far:s}),this._infinitePerspective=new ye().frustum({left:a,right:i,bottom:n,top:e,near:o,far:1/0}))}}]),t}();F();j();k();var une=function(r){return r!==null&&typeof r<"u"},lne=function(){function t(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};A(this,t),c(this,"_offCenterFrustum",new b1),c(this,"fov",void 0),c(this,"_fov",void 0),c(this,"_fovy",void 0),c(this,"_sseDenominator",void 0),c(this,"aspectRatio",void 0),c(this,"_aspectRatio",void 0),c(this,"near",void 0),c(this,"_near",void 0),c(this,"far",void 0),c(this,"_far",void 0),c(this,"xOffset",void 0),c(this,"_xOffset",void 0),c(this,"yOffset",void 0),c(this,"_yOffset",void 0);var e=r.fov,n=r.aspectRatio,i=r.near,a=i===void 0?1:i,o=r.far,s=o===void 0?5e8:o,u=r.xOffset,l=u===void 0?0:u,f=r.yOffset,p=f===void 0?0:f;this.fov=e,this.aspectRatio=n,this.near=a,this.far=s,this.xOffset=l,this.yOffset=p}return T(t,[{key:"clone",value:function(){return new t({aspectRatio:this.aspectRatio,fov:this.fov,near:this.near,far:this.far})}},{key:"equals",value:function(e){return!une(e)||!(e instanceof t)?!1:(this._update(),e._update(),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this.near===e.near&&this.far===e.far&&this._offCenterFrustum.equals(e._offCenterFrustum))}},{key:"projectionMatrix",get:function(){return this._update(),this._offCenterFrustum.projectionMatrix}},{key:"infiniteProjectionMatrix",get:function(){return this._update(),this._offCenterFrustum.infiniteProjectionMatrix}},{key:"fovy",get:function(){return this._update(),this._fovy}},{key:"sseDenominator",get:function(){return this._update(),this._sseDenominator}},{key:"computeCullingVolume",value:function(e,n,i){return this._update(),this._offCenterFrustum.computeCullingVolume(e,n,i)}},{key:"getPixelDimensions",value:function(e,n,i,a){return this._update(),this._offCenterFrustum.getPixelDimensions(e,n,i,a||new _n)}},{key:"_update",value:function(){Xe(Number.isFinite(this.fov)&&Number.isFinite(this.aspectRatio)&&Number.isFinite(this.near)&&Number.isFinite(this.far));var e=this._offCenterFrustum;(this.fov!==this._fov||this.aspectRatio!==this._aspectRatio||this.near!==this._near||this.far!==this._far||this.xOffset!==this._xOffset||this.yOffset!==this._yOffset)&&(Xe(this.fov>=0&&this.fov<Math.PI),Xe(this.aspectRatio>0),Xe(this.near>=0&&this.near<this.far),this._aspectRatio=this.aspectRatio,this._fov=this.fov,this._fovy=this.aspectRatio<=1?this.fov:Math.atan(Math.tan(this.fov*.5)/this.aspectRatio)*2,this._near=this.near,this._far=this.far,this._sseDenominator=2*Math.tan(.5*this._fovy),this._xOffset=this.xOffset,this._yOffset=this.yOffset,e.top=this.near*Math.tan(.5*this._fovy),e.bottom=-e.top,e.right=this.aspectRatio*e.top,e.left=-e.right,e.near=this.near,e.far=this.far,e.right+=this.xOffset,e.left+=this.xOffset,e.top+=this.yOffset,e.bottom+=this.yOffset)}}]),t}();var uJe=new z,lJe=new z,fJe=new z,cJe=new z,pJe=new z,hJe=new z,dJe=new z,vJe=new z,mJe=new z,gJe=new z,yJe=new z,_Je=new z,bJe=4/3*Math.PI;var ri=new at,fne=new at,cne=new at,Pv=new at,R3=new at;function Ov(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=Hn.EPSILON20,n=10,i=0,a=0,o=fne,s=cne;o.identity(),s.copy(t);for(var u=e*pne(s);a<n&&hne(s)>u;)dne(s,Pv),R3.copy(Pv).transpose(),s.multiplyRight(Pv),s.multiplyLeft(R3),o.multiplyRight(Pv),++i>2&&(++a,i=0);return r.unitary=o.toTarget(r.unitary),r.diagonal=s.toTarget(r.diagonal),r}function pne(t){for(var r=0,e=0;e<9;++e){var n=t[e];r+=n*n}return Math.sqrt(r)}var x1=[1,0,0],A1=[2,2,1];function hne(t){for(var r=0,e=0;e<3;++e){var n=t[ri.getElementIndex(A1[e],x1[e])];r+=2*n*n}return Math.sqrt(r)}function dne(t,r){for(var e=Hn.EPSILON15,n=0,i=1,a=0;a<3;++a){var o=Math.abs(t[ri.getElementIndex(A1[a],x1[a])]);o>n&&(i=a,n=o)}var s=x1[i],u=A1[i],l=1,f=0;if(Math.abs(t[ri.getElementIndex(u,s)])>e){var p=t[ri.getElementIndex(u,u)],h=t[ri.getElementIndex(s,s)],d=t[ri.getElementIndex(u,s)],v=(p-h)/2/d,m;v<0?m=-1/(-v+Math.sqrt(1+v*v)):m=1/(v+Math.sqrt(1+v*v)),l=1/Math.sqrt(1+m*m),f=m*l}return at.IDENTITY.to(r),r[ri.getElementIndex(s,s)]=r[ri.getElementIndex(u,u)]=l,r[ri.getElementIndex(u,s)]=f,r[ri.getElementIndex(s,u)]=-f,r}function S1(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=vne(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}
3532}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3533In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function vne(t,r){if(t){if(typeof t=="string")return L3(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return L3(t,r)}}function L3(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var Ra=new z,mne=new z,gne=new z,yne=new z,_ne=new z,bne=new at,xne={diagonal:new at,unitary:new at};function Oc(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new Wo;if(!t||t.length===0)return r.halfAxes=new at([0,0,0,0,0,0,0,0,0]),r.center=new z,r;var e=t.length,n=new z(0,0,0),i=S1(t),a;try{for(i.s();!(a=i.n()).done;){var o=a.value;n.add(o)}}catch(te){i.e(te)}finally{i.f()}var s=1/e;n.multiplyByScalar(s);var u=0,l=0,f=0,p=0,h=0,d=0,v=S1(t),m;try{for(v.s();!(m=v.n()).done;){var g=m.value,y=Ra.copy(g).subtract(n);u+=y.x*y.x,l+=y.x*y.y,f+=y.x*y.z,p+=y.y*y.y,h+=y.y*y.z,d+=y.z*y.z}}catch(te){v.e(te)}finally{v.f()}u*=s,l*=s,f*=s,p*=s,h*=s,d*=s;var _=bne;_[0]=u,_[1]=l,_[2]=f,_[3]=l,_[4]=p,_[5]=h,_[6]=f,_[7]=h,_[8]=d;var b=Ov(_,xne),x=b.unitary,w=r.halfAxes.copy(x),P=w.getColumn(0,gne),E=w.getColumn(1,yne),C=w.getColumn(2,_ne),I=-Number.MAX_VALUE,O=-Number.MAX_VALUE,D=-Number.MAX_VALUE,N=Number.MAX_VALUE,H=Number.MAX_VALUE,$=Number.MAX_VALUE,ee=S1(t),V;try{for(ee.s();!(V=ee.n()).done;){var U=V.value;Ra.copy(U),I=Math.max(Ra.dot(P),I),O=Math.max(Ra.dot(E),O),D=Math.max(Ra.dot(C),D),N=Math.min(Ra.dot(P),N),H=Math.min(Ra.dot(E),H),$=Math.min(Ra.dot(C),$)}}catch(te){ee.e(te)}finally{ee.f()}P=P.multiplyByScalar(.5*(N+I)),E=E.multiplyByScalar(.5*(H+O)),C=C.multiplyByScalar(.5*($+D)),r.center.copy(P).add(E).add(C);var X=mne.set(I-N,O-H,D-$).multiplyByScalar(.5),K=new at([X[0],0,0,0,X[1],0,0,0,X[2]]);return r.halfAxes.multiplyRight(K),r}function T1(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=Ane(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3534In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function Ane(t,r){if(t){if(typeof t=="string")return k3(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return k3(t,r)}}function k3(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var ju=512,B3=3,F3=[[.5,.5],[0,0],[0,1],[1,0],[1,1]],D3=F3.concat([[0,.5],[.5,0],[1,.5],[.5,1]]),Sne=D3.concat([[.25,.5],[.75,.5]]),Tne=function(){function t(r,e,n){A(this,t),c(this,"x",void 0),c(this,"y",void 0),c(this,"z",void 0),c(this,"childVisible",void 0),c(this,"selected",void 0),c(this,"_children",void 0),this.x=r,this.y=e,this.z=n}return T(t,[{key:"children",get:function(){if(!this._children){var e=this.x*2,n=this.y*2,i=this.z+1;this._children=[new t(e,n,i),new t(e,n+1,i),new t(e+1,n,i),new t(e+1,n+1,i)]}return this._children}},{key:"update",value:function(e){var n=e.viewport,i=e.cullingVolume,a=e.elevationBounds,o=e.minZ,s=e.maxZ,u=e.bounds,l=e.offset,f=e.project,p=this.getBoundingVolume(a,l,f);if(u&&!this.insideBounds(u))return!1;var h=i.computeVisibility(p);if(h<0)return!1;if(!this.childVisible){var d=this.z;if(d<s&&d>=o){var v=p.distanceTo(n.cameraPosition)*n.scale/n.height;d+=Math.floor(Math.log2(v))}if(d>=s)return this.selected=!0,!0}this.selected=!1,this.childVisible=!0;var m=T1(this.children),g;try{for(m.s();!(g=m.n()).done;){var y=g.value;y.update(e)}}catch(_){m.e(_)}finally{m.f()}return!0}},{key:"getSelected",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];if(this.selected&&e.push(this),this._children){var n=T1(this._children),i;try{for(n.s();!(i=n.n()).done;){var a=i.value;a.getSelected(e)}}catch(o){n.e(o)}finally{n.f()}}return e}},{key:"insideBounds",value:function(e){var n=W(e,4),i=n[0],a=n[1],o=n[2],s=n[3],u=Math.pow(2,this.z),l=ju/u;return this.x*l<o&&this.y*l<s&&(this.x+1)*l>i&&(this.y+1)*l>a}},{key:"getBoundingVolume",value:function(e,n,i){if(i){var a=this.z<1?Sne:this.z<2?D3:F3,o=[],s=T1(a),u;try{for(s.s();!(u=s.n()).done;){var l=u.value,f=Ev(this.x+l[0],this.y+l[1],this.z);f[2]=e[0],o.push(i(f)),e[0]!==e[1]&&(f[2]=e[1],o.push(i(f)))}}catch(m){s.e(m)}finally{s.f()}return Oc(o)}var p=Math.pow(2,this.z),h=ju/p,d=this.x*h+n*ju,v=ju-(this.y+1)*h;return new Av([d,v,e[0]],[d+h,v+h,e[1]])}}]),t}();function N3(t,r,e,n){var i=t instanceof _u&&t.resolution?t.projectPosition:null,a=Object.values(t.getFrustumPlanes()).map(function(w){var P=w.normal,E=w.distance;return new kt(P.clone().negate(),E)}),o=new Or(a),s=t.distanceScales.unitsPerMeter[2],u=e&&e[0]*s||0,l=e&&e[1]*s||0,f=t instanceof Sr&&t.pitch<=60?r:0;if(n){var p=n,h=W(p,4),d=h[0],v=h[1],m=h[2],g=h[3],y=mt([d,g]),_=mt([m,v]);n=[y[0],ju-y[1],_[0],ju-_[1]]}var b=new Tne(0,0,0),x={viewport:t,project:i,cullingVolume:o,elevationBounds:[u,l],minZ:f,maxZ:r,bounds:n,offset:0};if(b.update(x),t instanceof Sr&&t.subViewports&&t.subViewports.length>1){for(x.offset=-1;b.update(x)&&!(--x.offset<-B3););for(x.offset=1;b.update(x)&&!(++x.offset>B3););}return b.getSelected()}var Di=512,wne=[-1/0,-1/0,1/0,1/0],La={type:"object",value:null,validate:function(r,e){return e.optional&&r===null||typeof r=="string"||Array.isArray(r)&&r.every(function(n){return typeof n=="string"})},equal:function(r,e){if(r===e)return!0;
3534if(!Array.isArray(r)||!Array.isArray(e))return!1;var n=r.length;if(n!==e.length)return!1;for(var i=0;i<n;i++)if(r[i]!==e[i])return!1;return!0}};function U3(t,r){var e=[r.transformAsPoint([t[0],t[1]]),r.transformAsPoint([t[2],t[1]]),r.transformAsPoint([t[0],t[3]]),r.transformAsPoint([t[2],t[3]])],n=[Math.min.apply(Math,ae(e.map(function(i){return i[0]}))),Math.min.apply(Math,ae(e.map(function(i){return i[1]}))),Math.max.apply(Math,ae(e.map(function(i){return i[0]}))),Math.max.apply(Math,ae(e.map(function(i){return i[1]})))];return n}function Pne(t){return Math.abs(t.split("").reduce(function(r,e){return(r<<5)-r+e.charCodeAt(0)|0},0))}function ni(t,r){if(!t||!t.length)return null;var e=r.index,n=r.id;if(Array.isArray(t)){var i=Pne(n)%t.length;t=t[i]}for(var a=t,o=0,s=Object.keys(e);o<s.length;o++){var u=s[o],l=new RegExp("{".concat(u,"}"),"g");a=a.replace(l,String(e[u]))}return Number.isInteger(e.y)&&Number.isInteger(e.z)&&(a=a.replace(/\{-y\}/g,String(Math.pow(2,e.z)-e.y-1))),a}function One(t,r,e){var n;if(r&&r.length===2){var i=W(r,2),a=i[0],o=i[1],s=t.getBounds({z:a}),u=t.getBounds({z:o});n=[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 n=t.getBounds();return t.isGeospatial?[Math.max(n[0],e[0]),Math.max(n[1],e[1]),Math.min(n[2],e[2]),Math.min(n[3],e[3])]:[Math.max(Math.min(n[0],e[2]),e[0]),Math.max(Math.min(n[1],e[3]),e[1]),Math.min(Math.max(n[2],e[0]),e[2]),Math.min(Math.max(n[3],e[1]),e[3])]}function G3(t){var r=t.viewport,e=t.z,n=e===void 0?0:e,i=t.cullRect,a=r.subViewports||[r];return a.map(function(o){return w1(o,n,i)})}function w1(t,r,e){if(!Array.isArray(r)){var n=e.x-t.x,i=e.y-t.y,a=e.width,o=e.height,s={targetZ:r},u=t.unproject([n,i],s),l=t.unproject([n+a,i],s),f=t.unproject([n,i+o],s),p=t.unproject([n+a,i+o],s);return[Math.min(u[0],l[0],f[0],p[0]),Math.min(u[1],l[1],f[1],p[1]),Math.max(u[0],l[0],f[0],p[0]),Math.max(u[1],l[1],f[1],p[1])]}var h=w1(t,r[0],e),d=w1(t,r[1],e);return[Math.min(h[0],d[0]),Math.min(h[1],d[1]),Math.max(h[2],d[2]),Math.max(h[3],d[3])]}function Ene(t,r,e){if(e){var n=U3(t,e).map(function(i){return i*r/Di});return n}return t.map(function(i){return i*r/Di})}function P1(t,r){return Math.pow(2,t)*Di/r}function Ev(t,r,e){var n=P1(e,Di),i=t/n*360-180,a=Math.PI-2*Math.PI*r/n,o=180/Math.PI*Math.atan(.5*(Math.exp(a)-Math.exp(-a)));return[i,o]}function j3(t,r,e,n){var i=P1(e,n);return[t/i*Di,r/i*Di]}function O1(t,r,e,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:Di;if(t.isGeospatial){var a=Ev(r,e,n),o=W(a,2),s=o[0],u=o[1],l=Ev(r+1,e+1,n),f=W(l,2),p=f[0],h=f[1];return{west:s,north:u,east:p,south:h}}var d=j3(r,e,n,i),v=W(d,2),m=v[0],g=v[1],y=j3(r+1,e+1,n,i),_=W(y,2),b=_[0],x=_[1];return{left:m,top:g,right:b,bottom:x}}function Cne(t,r,e,n,i){for(var a=One(t,null,n),o=P1(r,e),s=Ene(a,o,i),u=W(s,4),l=u[0],f=u[1],p=u[2],h=u[3],d=[],v=Math.floor(l);v<p;v++)for(var m=Math.floor(f);m<h;m++)d.push({x:v,y:m,z:r});return d}function E1(t){var r=t.viewport,e=t.maxZoom,n=t.minZoom,i=t.zRange,a=t.extent,o=t.tileSize,s=o===void 0?Di:o,u=t.modelMatrix,l=t.modelMatrixInverse,f=t.zoomOffset,p=f===void 0?0:f,h=r.isGeospatial?Math.round(r.zoom+Math.log2(Di/s))+p:Math.ceil(r.zoom)+p;if(typeof n=="number"&&Number.isFinite(n)&&h<n){if(!a)return[];h=n}typeof e=="number"&&Number.isFinite(e)&&h>e&&(h=e);var d=a;return u&&l&&a&&!r.isGeospatial&&(d=U3(a,u)),r.isGeospatial?N3(r,h,i,a):Cne(r,h,s,d||wne,l)}function C1(t){return/(?=.*{z})(?=.*{x})(?=.*({y}|{-y}))/.test(t)}function M1(t){return Number.isFinite(t.west)&&Number.isFinite(t.north)&&Number.isFinite(t.east)&&Number.isFinite(t.south)}function z3(t){var r={},e;return function(n){for(var i in n)if(!Mne(n[i],r[i])){e=t(n),r=n;break}return e}}function Mne(t,r){if(t===r)return!0;if(Array.isArray(t)){var e=t.length;if(!r||r.length!==e)return!1;for(var n=0;n<e;n++)if(t[n]!==r[n])return!1;return!0}return!1}var Ec;function Kt(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=Ine(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}
vendor: 1,237 bytes, lines 3534-3535
3534}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3535In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function Ine(t,r){if(t){if(typeof t=="string")return V3(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return V3(t,r)}}function V3(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function H3(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function W3(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?H3(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):H3(Object(e)).forEac
3535h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var $3=1,Cv=2,Rne="never",Lne="no-overlap",Cc="best-available",kne=5,Bne=(Ec={},c(Ec,Cc,Dne),c(Ec,Lne,Nne),c(Ec,Rne,function(){}),Ec),Fne={extent:null,tileSize:512,maxZoom:null,minZoom:null,maxCacheSize:null,maxCacheByteSize:null,refinementStrategy:"best-available",zRange:null,maxRequests:6,zoomOffset:0,onTileLoad:function(){},onTileUnload:function(){},onTileError:function(){}},Mc=function(){function t(r){var e=this;A(this,t),c(this,"opts",void 0),c(this,"_requestScheduler",void 0),c(this,"_cache",void 0),c(this,"_dirty",void 0),c(this,"_tiles",void 0),c(this,"_cacheByteSize",void 0),c(this,"_viewport",void 0),c(this,"_zRange",void 0),c(this,"_selectedTiles",void 0),c(this,"_frameNumber",void 0),c(this,"_modelMatrix",void 0),c(this,"_modelMatrixInverse",void 0),c(this,"_maxZoom",void 0),c(this,"_minZoom",void 0),c(this,"onTileLoad",void 0),c(this,"_getCullBounds",z3(G3)),this.opts=W3(W3({},Fne),r),this.onTileLoad=function(n){var i,a;(i=(a=e.opts).onTileLoad)===null||i===void 0||i.call(a,n),e.opts.maxCacheByteSize&&(e._cacheByteSize+=n.byteLength,e._resizeCache())},this._requestScheduler=new Yl({maxRequests:r.maxRequests,throttleRequests:Boolean(r.maxRequests&&r.maxRequests>0)}),this._cache=new Map,this._tiles=[],this._dirty=!1,this._cacheByteSize=0,this._viewport=null,this._selectedTiles=null,this._frameNumber=0,this._modelMatrix=new ye,this._modelMatrixInverse=new ye,this.setOptions(r)}return T(t,[{key:"tiles",get:function(){return this._tiles}},{key:"selectedTiles",get:function(){return this._selectedTiles}},{key:"isLoaded",get:function(){return this._selectedTiles!==null&&this._selectedTiles.every(function(e){return e.isLoaded})}},{key:"needsReload",get:function(){return this._selectedTiles!==null&&this._selectedTiles.some(function(e){return e.needsReload})}},{key:"setOptions",value:function(e){Object.assign(this.opts,e),Number.isFinite(e.maxZoom)&&(this._maxZoom=Math.floor(e.maxZoom)),Number.isFinite(e.minZoom)&&(this._minZoom=Math.ceil(e.minZoom))}},{key:"finalize",value:function(){var e=Kt(this._cache.values()),n;try{for(e.s();!(n=e.n()).done;){var i=n.value;i.isLoading&&i.abort()}}catch(a){e.e(a)}finally{e.f()}this._cache.clear(),this._tiles=[],this._selectedTiles=null}},{key:"reloadAll",value:function(){var e=Kt(this._cache.keys()),n;try{for(e.s();!(n=e.n()).done;){var i=n.value,a=this._cache.get(i);!this._selectedTiles||!this._selectedTiles.includes(a)?this._cache.delete(i):a.setNeedsReload()}}catch(o){e.e(o)}finally{e.f()}}},{key:"update",value:function(e){var n=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=i.zRange,o=i.modelMatrix,s=new ye(o),u=!s.equals(this._modelMatrix);if(!this._viewport||!e.equals(this._viewport)||!Ze(this._zRange,a)||u){u&&(this._modelMatrixInverse=s.clone().invert(),this._modelMatrix=s),this._viewport=e,this._zRange=a;var l=this.getTileIndices({viewport:e,maxZoom:this._maxZoom,minZoom:this._minZoom,zRange:a,modelMatrix:this._modelMatrix,modelMatrixInverse:this._modelMatrixInverse});this._selectedTiles=l.map(function(p){return n._getTile(p,!0)}),this._dirty&&this._rebuildTree()}else this.needsReload&&(this._selectedTiles=this._selectedTiles.map(function(p){return n._getTile(p.index,!0)}));var f=this.updateTileStates();return this._pruneRequests(),this._dirty&&this._resizeCache(),f&&this._frameNumber++,this._frameNumber}},{key:"isTileVisible",value:function(e,n){if(!e.isVisible)return!1;if(n&&this._viewport){var i=this._getCullBounds({viewport:this._viewport,z:this._zRange,cullRect:n}),a=e.bbox,o=Kt(i),s;try{for(o.s();!(s=o.n()).done;){var u=W(s.value,4),l=u[0],f=u[1],p=u[2],h=u[3],d=void 0;if("west"in a)d=a.west<p&&a.east>l&&a.south<h&&a.north>f;else{var v=Math.min(a.top,a.bottom),m=Math.max(a.top,a.bottom);d=a.left<p&&a.right>l&&v<h&&m>f}if(d)return!0}}catch(g){o.e(g)}finally{o.f()}return!1}return!0}},{key:"getTileIndices",value:function(e){var n=e.viewport,i=e.maxZoom,a=e.minZoom,o=e.zRange,s=e.modelMatrix,u=e.modelMatrixInverse,l=this.opts,f=l.tileSize,p=l.extent,h=l.zoomOffset;return E1({viewport:n,maxZoom:i,minZoom:a,zRange:o,tileSize:f,extent:p,modelMatrix:s,modelMatrixInverse:u,zoomOffset:h})}},{key:"getTileId",value:function(e){return"".concat(e.x,"-").concat(e.y,"-").concat(e.z)}},{key:"getTileZoom",value:function(e){return e.z}},{key:"getTileMetadata",value:function(e){var n=this.opts.tileSize;return{bbox:O1(this._viewport,e.x,e.y,e.z,n)}}},{key:"getParentIndex",value:function(e){var n=Math.floor(e.x/2),i=Math.floor(e.y/2),a=e.z-1;return{x:n,y:i,z:a}}},{key:"updateTileStates",value:function(){var e=this.opts.refinementStrategy||Cc,n=new Array(this._cache.size),i=0,a=Kt(this._cache.values()),o;try{for(a.s();!(o=a.n()).done;){var s=o.value;n[i++]=s.isVisible,s.isSelected=!1,s.isVisible=!1}}catch(v){a.e(v)}finally{a.f()}var u=Kt(this._selectedTiles),l;try{for(u.s();!(l=u.n()).done;){var f=l.value;f.isSelected=!0,f.isVisible=!0}}catch(v){u.e(v)}finally{u.f()}(typeof e=="function"?e:Bne[e])(Array.from(this._cache.values())
3535),i=0;var p=Kt(this._cache.values()),h;try{for(p.s();!(h=p.n()).done;){var d=h.value;if(n[i++]!==d.isVisible)return!0}}catch(v){p.e(v)}finally{p.f()}return!1}},{key:"_pruneRequests",value:function(){var e=this.opts.maxRequests,n=e===void 0?0:e,i=[],a=0,o=Kt(this._cache.values()),s;try{for(o.s();!(s=o.n()).done;){var u=s.value;u.isLoading&&(a++,!u.isSelected&&!u.isVisible&&i.push(u))}}catch(f){o.e(f)}finally{o.f()}for(;n>0&&a>n&&i.length>0;){var l=i.shift();l.abort(),a--}}},{key:"_rebuildTree",value:function(){var e=this._cache,n=Kt(e.values()),i;try{for(n.s();!(i=n.n()).done;){var a=i.value;a.parent=null,a.children&&(a.children.length=0)}}catch(f){n.e(f)}finally{n.f()}var o=Kt(e.values()),s;try{for(o.s();!(s=o.n()).done;){var u=s.value,l=this._getNearestAncestor(u);u.parent=l,l!=null&&l.children&&l.children.push(u)}}catch(f){o.e(f)}finally{o.f()}}},{key:"_resizeCache",value:function(){var e=this._cache,n=this.opts,i=n.maxCacheSize||(n.maxCacheByteSize?1/0:kne*this.selectedTiles.length),a=n.maxCacheByteSize||1/0,o=e.size>i||this._cacheByteSize>a;if(o){var s=Kt(e),u;try{for(s.s();!(u=s.n()).done;){var l=W(u.value,2),f=l[0],p=l[1];if(!p.isVisible&&!p.isSelected){var h,d;this._cacheByteSize-=n.maxCacheByteSize?p.byteLength:0,e.delete(f),(h=(d=this.opts).onTileUnload)===null||h===void 0||h.call(d,p)}if(e.size<=i&&this._cacheByteSize<=a)break}}catch(v){s.e(v)}finally{s.f()}this._rebuildTree(),this._dirty=!0}this._dirty&&(this._tiles=Array.from(this._cache.values()).sort(function(v,m){return v.zoom-m.zoom}),this._dirty=!1)}},{key:"_getTile",value:function(e,n){var i=this.getTileId(e),a=this._cache.get(i),o=!1;return!a&&n?(a=new wc(e),Object.assign(a,this.getTileMetadata(a.index)),Object.assign(a,{id:i,zoom:this.getTileZoom(a.index)}),o=!0,this._cache.set(i,a),this._dirty=!0):a&&a.needsReload&&(o=!0),a&&o&&a.loadData({getData:this.opts.getTileData,requestScheduler:this._requestScheduler,onLoad:this.onTileLoad,onError:this.opts.onTileError}),a}},{key:"_getNearestAncestor",value:function(e){for(var n=this._minZoom,i=n===void 0?0:n,a=e.index;this.getTileZoom(a)>i;){a=this.getParentIndex(a);var o=this._getTile(a);if(o)return o}return null}}]),t}();function Dne(t){var r=Kt(t),e;try{for(r.s();!(e=r.n()).done;){var n=e.value;n.state=0}}catch(f){r.e(f)}finally{r.f()}var i=Kt(t),a;try{for(i.s();!(a=i.n()).done;){var o=a.value;o.isSelected&&!X3(o)&&I1(o)}}catch(f){i.e(f)}finally{i.f()}var s=Kt(t),u;try{for(s.s();!(u=s.n()).done;){var l=u.value;l.isVisible=Boolean(l.state&Cv)}}catch(f){s.e(f)}finally{s.f()}}function Nne(t){var r=Kt(t),e;try{for(r.s();!(e=r.n()).done;){var n=e.value;n.state=0}}catch(v){r.e(v)}finally{r.f()}var i=Kt(t),a;try{for(i.s();!(a=i.n()).done;){var o=a.value;o.isSelected&&X3(o)}}catch(v){i.e(v)}finally{i.f()}var s=Array.from(t).sort(function(v,m){return v.zoom-m.zoom}),u=Kt(s),l;try{for(u.s();!(l=u.n()).done;){var f=l.value;if(f.isVisible=Boolean(f.state&Cv),f.children&&(f.isVisible||f.state&$3)){var p=Kt(f.children),h;try{for(p.s();!(h=p.n()).done;){var d=h.value;d.state=$3}}catch(v){p.e(v)}finally{p.f()}}else f.isSelected&&I1(f)}}catch(v){u.e(v)}finally{u.f()}}function X3(t){for(var r=t;r;){if(r.isLoaded||r.content)return r.state|=Cv,!0;r=r.parent}return!1}function I1(t){var r=Kt(t.children),e;try{for(r.s();!(e=r.n()).done;){var n=e.value;n.isLoaded||n.content?n.state|=Cv:I1(n)}}catch(i){r.e(i)}finally{r.f()}}function q3(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function Mv(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?q3(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):q3(Object(e)).forEac
3535h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function jne(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=Une(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3536In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function Une(t,r){if(t){if(typeof t=="string")return Y3(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return Y3(t,r)}}function Y3(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function Gne(t){var r=zne();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function zne(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Vne={TilesetClass:Mc,data:{type:"data",value:[]},dataComparator:La.equal,renderSubLayers:{type:"function",value:function(r){return new Ri(r)}},getTileData:{type:"function",optional:!0,value:null},onViewportLoad:{type:"function",optional:!0,value:null},onTileLoad:{type:"function",value:function(r){}},onTileUnload:{type:"function",value:function(r){}},onTileError:{type:"function",value:function(r){return console.error(r)}},extent:{type:"array",optional:!0,value:null,compare:!0},tileSize:512,maxZoom:null,minZoom:0,maxCacheSize:null,maxCacheByteSize:null,refinementStrategy:Cc,zRange:null,maxRequests:6,zoomOffset:0},Ni=function(t){L(e,t);var r=Gne(e);function e(){return A(this,e),r.apply(this,arguments)}return T(e,[{key:"initializeState",value:function(){this.state={tileset:null,isLoaded:!1}}},{key:"finalizeState",value:function(){var i,a;(i=this.state)===null||i===void 0||(a=i.tileset)===null||a===void 0||a.finalize()}},{key:"isLoaded",get:function(){var i,a,o;return(i=this.state)===null||i===void 0||(a=i.tileset)===null||a===void 0||(o=a.selectedTiles)===null||o===void 0?void 0:o.every(function(s){return s.isLoaded&&s.layers&&s.layers.every(function(u){return u.isLoaded})})}},{key:"shouldUpdateState",value:function(i){var a=i.changeFlags;return a.somethingChanged}},{key:"updateState",value:function(i){var a=i.changeFlags,o=this.state.tileset,s=a.propsOrDataChanged||a.updateTriggersChanged,u=a.dataChanged||a.updateTriggersChanged&&(a.updateTriggersChanged.all||a.updateTriggersChanged.getTileData);o?s&&(o.setOptions(this._getTilesetOptions()),u?o.reloadAll():this.state.tileset.tiles.forEach(function(l){l.layers=null})):(o=new this.props.TilesetClass(this._getTilesetOptions()),this.setState({tileset:o})),this._updateTileset()}},{key:"_getTilesetOptions",value:function(){var i=this.props,a=i.tileSize,o=i.maxCacheSize,s=i.maxCacheByteSize,u=i.refinementStrategy,l=i.extent,f=i.maxZoom,p=i.minZoom,h=i.maxRequests,d=i.zoomOffset;return{maxCacheSize:o,maxCacheByteSize:s,maxZoom:f,minZoom:p,tileSize:a,refinementStrategy:u,extent:l,maxRequests:h,zoomOffset:d,getTileData:this.getTileData.bind(this),onTileLoad:this._onTileLoad.bind(this),onTileError:this._onTileError.bind(this),onTileUnload:this._onTileUnload.bind(this)}}},{key:"_updateTileset",value:function(){var i=this.state.tileset,a=this.props,o=a.zRange,s=a.modelMatrix,u=i.update(this.context.viewport,{zRange:o,modelMatrix:s}),l=i.isLoaded,f=this.state.isLoaded!==l,p=this.state.frameNumber!==u;l&&(f||p)&&this._onViewportLoad(),p&&this.setState({frameNumber:u}),this.state.isLoaded=l}},{key:"_onViewportLoad",value:function(){var i=this.state.tileset,a=this.props.onViewportLoad;a&&a(i.selectedTiles)}},{key:"_onTileLoad",value:function(i){this.props.onTileLoad(i),i.layers=null,this.setNeedsUpdate()}},{key:"_onTileError",value:function(i,a){this.props.onTileError(i),a.layers=null,this.setNeedsUpdate()}},{key:"_onTileUnload",value:function(i){this.props.onTileUnload(i)}},{key:"getTileData",value:function(i){var a=this.props,o=a.data,s=a.getTileData,u=a.fetch,l=i.signal;
3536return i.url=typeof o=="string"||Array.isArray(o)?ni(o,i):null,s?s(i):u&&i.url?u(i.url,{propName:"data",layer:this,signal:l}):null}},{key:"renderSubLayers",value:function(i){return this.props.renderSubLayers(i)}},{key:"getSubLayerPropsByTile",value:function(i){return null}},{key:"getPickingInfo",value:function(i){var a=i.info,o=i.sourceLayer,s=o.props.tile;return a.picked&&(a.tile=s),a.sourceTile=s,a}},{key:"_updateAutoHighlight",value:function(i){var a=i.sourceTile;if(a&&a.layers){var o=jne(a.layers),s;try{for(o.s();!(s=o.n()).done;){var u=s.value;u.updateAutoHighlight(i)}}catch(l){o.e(l)}finally{o.f()}}}},{key:"renderLayers",value:function(){var i=this;return this.state.tileset.tiles.map(function(a){var o=i.getSubLayerPropsByTile(a);if(!(!a.isLoaded&&!a.content))if(a.layers)o&&a.layers[0]&&Object.keys(o).some(function(u){return a.layers[0].props[u]!==o[u]})&&(a.layers=a.layers.map(function(u){return u.clone(o)}));else{var s=i.renderSubLayers(Mv(Mv(Mv({},i.props),i.getSubLayerProps({id:a.id,updateTriggers:i.props.updateTriggers})),{},{data:a.content,_offset:0,tile:a}));a.layers=gr(s,Boolean).map(function(u){return u.clone(Mv({tile:a},o))})}return a.layers})}},{key:"filterSubLayer",value:function(i){var a=i.layer,o=i.cullRect,s=a.props.tile;return this.state.tileset.isTileVisible(s,o)}}]),e}(gt);c(Ni,"defaultProps",Vne);c(Ni,"layerName","TileLayer");F();j();k();function K3(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function Z3(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?K3(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):K3(Object(e)).forEac
3536h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function Hne(t){var r=Wne();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function Wne(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var $ne={fadeTrail:!0,trailLength:{type:"number",value:120,min:0},currentTime:{type:"number",value:0,min:0},getTimestamps:{type:"accessor",value:function(r){return r.timestamps}}},Iv=function(t){L(e,t);var r=Hne(e);function e(){return A(this,e),r.apply(this,arguments)}return T(e,[{key:"getShaders",value:function(){var i=Z(S(e.prototype),"getShaders",this).call(this);return i.inject={"vs:#decl":`uniform float trailLength;
3537attribute float instanceTimestamps;
3538attribute float instanceNextTimestamps;
3539varying float vTime;
3540`,"vs:#main-end":`vTime = instanceTimestamps + (instanceNextTimestamps - instanceTimestamps) * vPathPosition.y / vPathLength;
3541`,"fs:#decl":`uniform bool fadeTrail;
3542uniform float trailLength;
3543uniform float currentTime;
3544varying float vTime;
3545`,"fs:#main-start":`if(vTime > currentTime || (fadeTrail && (vTime < currentTime - trailLength))) {
3546  discard;
3547}
3548`,"fs:DECKGL_FILTER_COLOR":`if(fadeTrail) {
3549  color.a *= 1.0 - (currentTime - vTime) / trailLength;
3550}
3551`},i}},{key:"initializeState",value:function(){Z(S(e.prototype),"initializeState",this).call(this);var i=this.getAttributeManager();i.addInstanced({timestamps:{size:1,accessor:"getTimestamps",shaderAttributes:{instanceTimestamps:{vertexOffset:0},instanceNextTimestamps:{vertexOffset:1}}}})}},{key:"draw",value:function(i){var a=this.props,o=a.fadeTrail,s=a.trailLength,u=a.currentTime;i.uniforms=Z3(Z3({},i.uniforms),{},{fadeTrail:o,trailLength:s,currentTime:u}),Z(S(e.prototype),"draw",this).call(this,i)}}]),e}(Zn);c(Iv,"layerName","TripsLayer");c(Iv,"defaultProps",$ne);F();j();k();var aF=me(Rv());F();j();k();Ge();be();var ir=me(Rv());function Xne(t){var r=qne();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}
3551function qne(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Q3(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function Lv(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?Q3(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Q3(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function R1(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=Yne(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3552In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function Yne(t,r){if(t){if(typeof t=="string")return eF(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return eF(t,r)}}function eF(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var Kne=10;function rF(t,r){r=r===void 0?t[0][0]:r;var e=R1(t),n;try{for(e.s();!(n=e.n()).done;){var i=n.value,a=i[0]-r;a>180?i[0]-=360:a<-180&&(i[0]+=360)}}catch(o){e.e(o)}finally{e.f()}}function Zne(t,r,e){var n=(0,ir.h3ToGeo)(t),i=W(n,2),a=i[0],o=i[1],s=r.length;rF(r,o);for(var u=r[0]===r[s-1]?s-1:s,l=0;l<u;l++)r[l][0]=Gt(o,r[l][0],e),r[l][1]=Gt(a,r[l][1],e)}function Jne(t,r,e){var n=t(r,e),i=(0,ir.h3ToGeo)(n),a=W(i,2),o=a[0],s=a[1];return[s,o]}function tF(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,e=(0,ir.h3ToGeoBoundary)(t,!0);return r!==1?Zne(t,e,r):rF(e),e}function Qne(t){var r=new Float64Array(t.length*2),e=0,n=R1(t),i;try{for(n.s();!(i=n.n()).done;){var a=i.value;r[e++]=a[0],r[e++]=a[1]}}catch(o){n.e(o)}finally{n.f()}return r}function eie(t,r){var e;return t==null?e=r:ue(t)==="object"?e=Lv(Lv({},t),{},{coverage:r}):e={getHexagon:t,coverage:r},e}var tie=Lv(Lv({},Qn.defaultProps),{},{highPrecision:"auto",coverage:{type:"number",min:0,max:1,value:1},centerHexagon:null,getHexagon:{type:"accessor",value:function(r){return r.hexagon}},extruded:!0}),ji=function(t){L(e,t);var r=Xne(e);function e(){var n;A(this,e);for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return n=r.call.apply(r,[this].concat(a)),c(q(n),"state",void 0),n}return T(e,[{key:"initializeState",value:function(){e._checkH3Lib(),this.state={edgeLengthKM:0,resolution:-1}}},{key:"shouldUpdateState",value:function(i){var a=i.changeFlags;return this._shouldUseHighPrecision()?a.propsOrDataChanged:a.somethingChanged}},{key:"updateState",value:function(i){var a=i.props,o=i.changeFlags;if(a.highPrecision!==!0&&(o.dataChanged||o.updateTriggersChanged&&o.updateTriggersChanged.getHexagon)){var s=this._calculateH3DataProps();this.setState(s)}this._updateVertices(this.context.viewport)}},{key:"_calculateH3DataProps",value:function(){var i=-1,a=!1,o=!1,s=Ot(this.props.data),u=s.iterable,l=s.objectInfo,f=R1(u),p;try{for(f.s();!(p=f.n()).done;){var h=p.value;l.index++;var d=this.props.getHexagon(h,l),v=(0,ir.h3GetResolution)(d);if(i<0){if(i=v,!this.props.highPrecision)break}else if(i!==v){o=!0;break}if((0,ir.h3IsPentagon)(d)){a=!0;break}}}catch(m){f.e(m)}finally{f.f()}return{resolution:i,edgeLengthKM:i>=0?(0,ir.edgeLength)(i,"km"):0,hasMultipleRes:o,hasPentagon:a}}},{key:"_shouldUseHighPrecision",value:function(){if(this.props.highPrecision==="auto"){var i=this.state,a=i.resolution,o=i.hasPentagon,s=i.hasMultipleRes,u=this.context.viewport;return Boolean(u?.resolution)||s||o||a>=0&&a<=5}return this.props.highPrecision}},{key:"_updateVertices",value:function(i){if(!this._shouldUseHighPrecision()){var a=this.state,o=a.resolution,s=a.edgeLengthKM,u=a.centerHex;if(!(o<0)){var l=this.props.centerHexagon||(0,ir.geoToH3)(i.latitude,i.longitude,o);if(u!==l){if(u){var f=(0,ir.h3Distance)(u,l);if(f>=0&&f*s<Kne)return}var p=i.distanceScales.unitsPerMeter,h=tF(l),d=(0,ir.h3ToGeo)(l),v=W(d,2),m=v[0],g=v[1],y=i.projectFlat([g,m]),_=W(y,2),b=_[0],x=_[1];h=h.map(function(w){var P=i.projectFlat(w);return[(P[0]-b)/p[0],(P[1]-x)/p[1]]}),this.setState({centerHex:l,vertices:h})}}}}},{key:"renderLayers",value:function(){return this._shouldUseHighPrecision()?this._renderPolygonLayer():this._renderColumnLayer()}},{key:"_getForwardProps",value:function(){var i=this.props,a=i.elevationScale,o=i.material,s=i.coverage,u=i.extruded,l=i.wireframe,f=i.stroked,p=i.filled,h=i.lineWidthUnits,d=i.lineWidthScale,v=i.lineWidthMinPixels,m=i.lineWidthMaxPixels,g=i.getFillColor,y=i.getElevation,_=i.getLineColor,b=i.getLineWidth,x=i.transitions,w=i.updateTriggers;return{elevationScale:a,extruded:u,coverage:s,wireframe:l,stroked:f,filled:p,lineWidthUnits:h,lineWidthScale:d,lineWidthMinPixels:v,lineWidthMaxPixels:m,material:o,getElevation:y,getFillColor:g,getLineColor:_,getLineWidth:b,transitions:x,updateTriggers:{getFillColor:w.getFillColor,getElevation:w.getElevation,getLineColor:w.getLineColor,getLineWidth:w.getLineWidth}}}},{key:"_renderPolygonLayer",value:function(){var i=this.props,a=i.data,o=i.getHexagon,s=i.updateTriggers,u=i.coverage,l=this.getSubLayerClass("hexagon-cell-hifi",Qn),f=this._getForwardProps();return f.updateTriggers.getPolygon=eie(s.getHexagon,u),new l(f,this.get
3552SubLayerProps({id:"hexagon-cell-hifi",updateTriggers:f.updateTriggers}),{data:a,_normalize:!1,_windingOrder:"CCW",positionFormat:"XY",getPolygon:function(h,d){var v=o(h,d);return Qne(tF(v,u))}})}},{key:"_renderColumnLayer",value:function(){var i=this.props,a=i.data,o=i.getHexagon,s=i.updateTriggers,u=this.getSubLayerClass("hexagon-cell",Kn),l=this._getForwardProps();return l.updateTriggers.getPosition=s.getHexagon,new u(l,this.getSubLayerProps({id:"hexagon-cell",flatShading:!0,updateTriggers:l.updateTriggers}),{data:a,diskResolution:6,radius:1,vertices:this.state.vertices,getPosition:Jne.bind(null,o)})}}]),e}(gt);c(ji,"defaultProps",tie);c(ji,"layerName","H3HexagonLayer");c(ji,"_checkH3Lib",function(){});function nF(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=rie(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3553In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function rie(t,r){if(t){if(typeof t=="string")return iF(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return iF(t,r)}}function iF(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function nie(t){var r=iie();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function iie(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var aie={getHexagons:{type:"accessor",value:function(r){return r.hexagons}}},kv=function(t){L(e,t);var r=nie(e);function e(){return A(this,e),r.apply(this,arguments)}return T(e,[{key:"initializeState",value:function(){ji._checkH3Lib()}},{key:"updateState",value:function(i){var a=i.props,o=i.changeFlags;if(o.dataChanged||o.updateTriggersChanged&&o.updateTriggersChanged.getHexagons){var s=a.data,u=a.getHexagons,l=[],f=Ot(s),p=f.iterable,h=f.objectInfo,d=nF(p),v;try{for(d.s();!(v=d.n()).done;){var m=v.value;h.index++;var g=u(m,h),y=(0,aF.h3SetToMultiPolygon)(g,!0),_=nF(y),b;try{for(_.s();!(b=_.n()).done;){var x=b.value;l.push(this.getSubLayerRow({polygon:x},m,h.index))}}catch(w){_.e(w)}finally{_.f()}}}catch(w){d.e(w)}finally{d.f()}this.setState({polygons:l})}}},{key:"indexToBounds",value:function(){var i=this.props,a=i.getElevation,o=i.getFillColor,s=i.getLineColor,u=i.getLineWidth;return{data:this.state.polygons,getPolygon:function(f){return f.polygon},getElevation:this.getSubLayerAccessor(a),getFillColor:this.getSubLayerAccessor(o),getLineColor:this.getSubLayerAccessor(s),getLineWidth:this.getSubLayerAccessor(u)}}}]),e}(rn);c(kv,"layerName","H3ClusterLayer");c(kv,"defaultProps",aie);F();j();k();var hS=me(Ae());F();j();k();function oie(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=sie(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3554In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function sie(t,r){if(t){if(typeof t=="string")return oF(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);
3554if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return oF(t,r)}}function oF(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var L1=Math.PI/180,Bv=new Float32Array(16),sF=new Float32Array(12);function uF(t,r,e){var n=r[0]*L1,i=r[1]*L1,a=r[2]*L1,o=Math.sin(a),s=Math.sin(n),u=Math.sin(i),l=Math.cos(a),f=Math.cos(n),p=Math.cos(i),h=e[0],d=e[1],v=e[2];t[0]=h*p*f,t[1]=h*u*f,t[2]=h*-s,t[3]=d*(-u*l+p*s*o),t[4]=d*(p*l+u*s*o),t[5]=d*f*o,t[6]=v*(u*o+p*s*l),t[7]=v*(-p*o+u*s*l),t[8]=v*f*l}function lF(t){return t[0]=t[0],t[1]=t[1],t[2]=t[2],t[3]=t[4],t[4]=t[5],t[5]=t[6],t[6]=t[8],t[7]=t[9],t[8]=t[10],t[9]=t[12],t[10]=t[13],t[11]=t[14],t.subarray(0,12)}var Fv={size:12,accessor:["getOrientation","getScale","getTranslation","getTransformMatrix"],shaderAttributes:{instanceModelMatrix__LOCATION_0:{size:3,elementOffset:0},instanceModelMatrix__LOCATION_1:{size:3,elementOffset:3},instanceModelMatrix__LOCATION_2:{size:3,elementOffset:6},instanceTranslation:{size:3,elementOffset:9}},update:function(r,e){var n=e.startRow,i=e.endRow,a=this.props,o=a.data,s=a.getOrientation,u=a.getScale,l=a.getTranslation,f=a.getTransformMatrix,p=Array.isArray(f),h=p&&f.length===16,d=Array.isArray(u),v=Array.isArray(s),m=Array.isArray(l),g=h||!p&&Boolean(f(o[0]));g?r.constant=h:r.constant=v&&d&&m;var y=r.value;if(r.constant){var _;if(g)Bv.set(f),_=lF(Bv);else{_=sF;var b=s,x=u;uF(_,b,x),_.set(l,9)}r.value=new Float32Array(_)}else{var w=n*r.size,P=Ot(o,n,i),E=P.iterable,C=P.objectInfo,I=oie(E),O;try{for(I.s();!(O=I.n()).done;){var D=O.value;C.index++;var N=void 0;if(g)Bv.set(h?f:f(D,C)),N=lF(Bv);else{N=sF;var H=v?s:s(D,C),$=d?u:u(D,C);uF(N,H,$),N.set(m?l:l(D,C),9)}y[w++]=N[0],y[w++]=N[1],y[w++]=N[2],y[w++]=N[3],y[w++]=N[4],y[w++]=N[5],y[w++]=N[6],y[w++]=N[7],y[w++]=N[8],y[w++]=N[9],y[w++]=N[10],y[w++]=N[11]}}catch(ee){I.e(ee)}finally{I.f()}}}};function Dv(t,r){return r===de.CARTESIAN||r===de.METER_OFFSETS||r===de.DEFAULT&&!t.isGeospatial}var fF=`#version 300 es
3555#define SHADER_NAME simple-mesh-layer-vs
3556uniform float sizeScale;
3557uniform bool composeModelMatrix;
3558in vec3 positions;
3559in vec3 normals;
3560in vec3 colors;
3561in vec2 texCoords;
3562in vec3 instancePositions;
3563in vec3 instancePositions64Low;
3564in vec4 instanceColors;
3565in vec3 instancePickingColors;
3566in mat3 instanceModelMatrix;
3567in vec3 instanceTranslation;
3568out vec2 vTexCoord;
3569out vec3 cameraPosition;
3570out vec3 normals_commonspace;
3571out vec4 position_commonspace;
3572out vec4 vColor;
3573
3574void main(void) {
3575  geometry.worldPosition = instancePositions;
3576  geometry.uv = texCoords;
3577  geometry.pickingColor = instancePickingColors;
3578
3579  vTexCoord = texCoords;
3580  cameraPosition = project_uCameraPosition;
3581  vColor = vec4(colors * instanceColors.rgb, instanceColors.a);
3582
3583  vec3 pos = (instanceModelMatrix * positions) * sizeScale + instanceTranslation;
3584
3585  if (composeModelMatrix) {
3586    DECKGL_FILTER_SIZE(pos, geometry);
3587    normals_commonspace = project_normal(instanceModelMatrix * normals);
3588    geometry.worldPosition += pos;
3589    gl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), position_commonspace);
3590    geometry.position = position_commonspace;
3591  }
3592  else {
3593    pos = project_size(pos);
3594    DECKGL_FILTER_SIZE(pos, geometry);
3595    gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, position_commonspace);
3596    geometry.position = position_commonspace;
3597    normals_commonspace = project_normal(instanceModelMatrix * normals);
3598  }
3599
3600  geometry.normal = normals_commonspace;
3601  DECKGL_FILTER_GL_POSITION(gl_Position, geometry);
3602
3603  DECKGL_FILTER_COLOR(vColor, geometry);
3604}
3605`;var cF=`#version 300 es
3606#define SHADER_NAME simple-mesh-layer-fs
3607
3608precision highp float;
3609
3610uniform bool hasTexture;
3611uniform sampler2D sampler;
3612uniform bool flatShading;
3613uniform float opacity;
3614
3615in vec2 vTexCoord;
3616in vec3 cameraPosition;
3617in vec3 normals_commonspace;
3618in vec4 position_commonspace;
3619in vec4 vColor;
3620
3621out vec4 fragColor;
3622
3623void main(void) {
3624  geometry.uv = vTexCoord;
3625
3626  vec3 normal;
3627  if (flatShading) {
3628#ifdef DERIVATIVES_AVAILABLE
3629    normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));
3630#else
3631    normal = vec3(0.0, 0.0, 1.0);
3632#endif
3633  } else {
3634    normal = normals_commonspace;
3635  }
3636
3637  vec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor;
3638  DECKGL_FILTER_COLOR(color, geometry);
3639
3640  vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);
3641  fragColor = vec4(lightColor, color.a * opacity);
3642}
3643`;function Ui(t){for(var r=1/0,e=1/0,n=1/0,i=-1/0,a=-1/0,o=-1/0,s=t.POSITION?t.POSITION.value:[],u=s&&s.length,l=0;l<u;l+=3){var f=s[l],p=s[l+1],h=s[l+2];r=f<r?f:r,e=p<e?p:e,n=h<n?h:n,i=f>i?f:i,a=p>a?p:a,o=h>o?h:o}return[[r,e,n],[i,a,o]]}F();j();k();function pF(t,r){if(!t)throw new Error(r||"loader assertion failed.")}function k1(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=uie(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}
3643}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3644In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function uie(t,r){if(t){if(typeof t=="string")return hF(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return hF(t,r)}}function hF(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var Ic=function(){function t(r,e){A(this,t),c(this,"fields",void 0),c(this,"metadata",void 0),pF(Array.isArray(r)),lie(r),this.fields=r,this.metadata=e||new Map}return T(t,[{key:"compareTo",value:function(e){if(this.metadata!==e.metadata||this.fields.length!==e.fields.length)return!1;for(var n=0;n<this.fields.length;++n)if(!this.fields[n].compareTo(e.fields[n]))return!1;return!0}},{key:"select",value:function(){for(var e=Object.create(null),n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];for(var o=0,s=i;o<s.length;o++){var u=s[o];e[u]=!0}var l=this.fields.filter(function(f){return e[f.name]});return new t(l,this.metadata)}},{key:"selectAt",value:function(){for(var e=this,n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];var o=i.map(function(s){return e.fields[s]}).filter(Boolean);return new t(o,this.metadata)}},{key:"assign",value:function(e){var n,i=this.metadata;if(e instanceof t){var a=e;n=a.fields,i=dF(dF(new Map,this.metadata),a.metadata)}else n=e;var o=Object.create(null),s=k1(this.fields),u;try{for(s.s();!(u=s.n()).done;){var l=u.value;o[l.name]=l}}catch(v){s.e(v)}finally{s.f()}var f=k1(n),p;try{for(f.s();!(p=f.n()).done;){var h=p.value;o[h.name]=h}}catch(v){f.e(v)}finally{f.f()}var d=Object.values(o);return new t(d,i)}}]),t}();function lie(t){var r={},e=k1(t),n;try{for(e.s();!(n=e.n()).done;){var i=n.value;r[i.name]&&console.warn("Schema: duplicated field name",i.name,i),r[i.name]=!0}}catch(a){e.e(a)}finally{e.f()}}function dF(t,r){return new Map([].concat(ae(t||new Map),ae(r||new Map)))}F();j();k();var Rc=function(){function t(r,e){A(this,t);var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:new Map;c(this,"name",void 0),c(this,"type",void 0),c(this,"nullable",void 0),c(this,"metadata",void 0),this.name=r,this.type=e,this.nullable=n,this.metadata=i}return T(t,[{key:"typeId",get:function(){return this.type&&this.type.typeId}},{key:"clone",value:function(){return new t(this.name,this.type,this.nullable,this.metadata)}},{key:"compareTo",value:function(e){return this.name===e.name&&this.type===e.type&&this.nullable===e.nullable&&this.metadata===e.metadata}},{key:"toString",value:function(){return"".concat(this.type).concat(this.nullable?", nullable":"").concat(this.metadata?", metadata: ".concat(this.metadata):"")}}]),t}();F();j();k();var Qe=function(t){return t[t.NONE=0]="NONE",t[t.Null=1]="Null",t[t.Int=2]="Int",t[t.Float=3]="Float",t[t.Binary=4]="Binary",t[t.Utf8=5]="Utf8",t[t.Bool=6]="Bool",t[t.Decimal=7]="Decimal",t[t.Date=8]="Date",t[t.Time=9]="Time",t[t.Timestamp=10]="Timestamp",t[t.Interval=11]="Interval",t[t.List=12]="List",t[t.Struct=13]="Struct",t[t.Union=14]="Union",t[t.FixedSizeBinary=15]="FixedSizeBinary",t[t.FixedSizeList=16]="FixedSizeList",t[t.Map=17]="Map",t[t.Dictionary=-1]="Dictionary",t[t.Int8=-2]="Int8",t[t.Int16=-3]="Int16",t[t.Int32=-4]="Int32",t[t.Int64=-5]="Int64",t[t.Uint8=-6]="Uint8",t[t.Uint16=-7]="Uint16",t[t.Uint32=-8]="Uint32",t[t.Uint64=-9]="Uint64",t[t.Float16=-10]="Float16",t[t.Float32=-11]="Float32",t[t.Float64=-12]="Float64",t[t.DateDay=-13]="DateDay",t[t.DateMillisecond=-14]="DateMillisecond",t[t.TimestampSecond=-15]="TimestampSecond",t[t.TimestampMillisecond=-16]="TimestampMillisecond",t[t.TimestampMicrosecond=-17]="TimestampMicrosecond",t[t.TimestampNanosecond=-18]="TimestampNanosecond",t[t.TimeSecond=-19]="TimeSecond",t[t.TimeMillisecond=-20]="TimeMillisecond",t[t.TimeMicrosecond=-21]="TimeMicrosecond",t[t.TimeNanosecond=-22]="TimeNanosecond",t[t.DenseUnion=-23]="DenseUnion",t[t.SparseUnion=-24]="SparseUnion",t[t.IntervalDayTime=-25]="IntervalDayTime",t[t.IntervalYearMonth=-26]="IntervalYearMonth",t}({});function Ye(t){var r=fie();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function fie(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var vF,mF,gF,yF,_F,bF,xF,AF,Er=function(){function t(){A(this,t)}return T(t,[{key:"typeId",get:function(){return Qe.NONE}},{key:"compareTo",value:function(e){return this===e}}],[{key:"isNull",value:function(e){return e&&e.typeId===Qe.Null}},{key:"isInt",value:function(e){return e&&e.typeId===Qe.Int}},{key:"isFloat",value:function(e){return e&&e.typeId===Qe.Float}},{key:"isBinary",value:function(e){return e&&e.typeId===Qe.Binary}},{key:"isUtf8",value:function(e){return e&&e.typeId===Qe.Utf8}},{key:"isBool",value:function(e){return e&&e.typeId===Qe.Bool}}
3644,{key:"isDecimal",value:function(e){return e&&e.typeId===Qe.Decimal}},{key:"isDate",value:function(e){return e&&e.typeId===Qe.Date}},{key:"isTime",value:function(e){return e&&e.typeId===Qe.Time}},{key:"isTimestamp",value:function(e){return e&&e.typeId===Qe.Timestamp}},{key:"isInterval",value:function(e){return e&&e.typeId===Qe.Interval}},{key:"isList",value:function(e){return e&&e.typeId===Qe.List}},{key:"isStruct",value:function(e){return e&&e.typeId===Qe.Struct}},{key:"isUnion",value:function(e){return e&&e.typeId===Qe.Union}},{key:"isFixedSizeBinary",value:function(e){return e&&e.typeId===Qe.FixedSizeBinary}},{key:"isFixedSizeList",value:function(e){return e&&e.typeId===Qe.FixedSizeList}},{key:"isMap",value:function(e){return e&&e.typeId===Qe.Map}},{key:"isDictionary",value:function(e){return e&&e.typeId===Qe.Dictionary}}]),t}(),SF=function(t,r){L(n,t);var e=Ye(n);function n(){return A(this,n),e.apply(this,arguments)}return T(n,[{key:"typeId",get:function(){return Qe.Null}},{key:r,get:function(){return"Null"}},{key:"toString",value:function(){return"Null"}}]),n}(Er,Symbol.toStringTag),TF=function(t,r){L(n,t);var e=Ye(n);function n(){return A(this,n),e.apply(this,arguments)}return T(n,[{key:"typeId",get:function(){return Qe.Bool}},{key:r,get:function(){return"Bool"}},{key:"toString",value:function(){return"Bool"}}]),n}(Er,Symbol.toStringTag);vF=Symbol.toStringTag;var ii=function(t,r){L(n,t);var e=Ye(n);function n(i,a){var o;return A(this,n),o=e.call(this),c(q(o),"isSigned",void 0),c(q(o),"bitWidth",void 0),o.isSigned=i,o.bitWidth=a,o}return T(n,[{key:"typeId",get:function(){return Qe.Int}},{key:r,get:function(){return"Int"}},{key:"toString",value:function(){return"".concat(this.isSigned?"I":"Ui","nt").concat(this.bitWidth)}}]),n}(Er,vF),Nv=function(t){L(e,t);var r=Ye(e);function e(){return A(this,e),r.call(this,!0,8)}return e}(ii),jv=function(t){L(e,t);var r=Ye(e);function e(){return A(this,e),r.call(this,!0,16)}return e}(ii),Uv=function(t){L(e,t);var r=Ye(e);function e(){return A(this,e),r.call(this,!0,32)}return e}(ii),wF=function(t){L(e,t);var r=Ye(e);function e(){return A(this,e),r.call(this,!0,64)}return e}(ii),Gv=function(t){L(e,t);var r=Ye(e);function e(){return A(this,e),r.call(this,!1,8)}return e}(ii),zv=function(t){L(e,t);var r=Ye(e);function e(){return A(this,e),r.call(this,!1,16)}return e}(ii),Vv=function(t){L(e,t);var r=Ye(e);function e(){return A(this,e),r.call(this,!1,32)}return e}(ii),PF=function(t){L(e,t);var r=Ye(e);function e(){return A(this,e),r.call(this,!1,64)}return e}(ii),B1={HALF:16,SINGLE:32,DOUBLE:64};mF=Symbol.toStringTag;var Lc=function(t,r){L(n,t);var e=Ye(n);function n(i){var a;return A(this,n),a=e.call(this),c(q(a),"precision",void 0),a.precision=i,a}return T(n,[{key:"typeId",get:function(){return Qe.Float}},{key:r,get:function(){return"Float"}},{key:"toString",value:function(){return"Float".concat(this.precision)}}]),n}(Er,mF),OF=function(t){L(e,t);var r=Ye(e);function e(){return A(this,e),r.call(this,B1.HALF)}return e}(Lc),Hv=function(t){L(e,t);var r=Ye(e);function e(){return A(this,e),r.call(this,B1.SINGLE)}return e}(Lc),Wv=function(t){L(e,t);var r=Ye(e);function e(){return A(this,e),r.call(this,B1.DOUBLE)}return e}(Lc),EF=function(t,r){L(n,t);var e=Ye(n);function n(){return A(this,n),e.call(this)}return T(n,[{key:"typeId",get:function(){return Qe.Binary}},{key:"toString",value:function(){return"Binary"}},{key:r,get:function(){return"Binary"}}]),n}(Er,Symbol.toStringTag),CF=function(t,r){L(n,t);var e=Ye(n);function n(){return A(this,n),e.apply(this,arguments)}return T(n,[{key:"typeId",get:function(){return Qe.Utf8}},{key:r,get:function(){return"Utf8"}},{key:"toString",value:function(){return"Utf8"}}]),n}(Er,Symbol.toStringTag),F1={DAY:0,MILLISECOND:1};gF=Symbol.toStringTag;var $v=function(t,r){L(n,t);var e=Ye(n);function n(i){var a;return A(this,n),a=e.call(this),c(q(a),"unit",void 0),a.unit=i,a}return T(n,[{key:"typeId",get:function(){return Qe.Date}},{key:r,get:function(){return"Date"}},{key:"toString",value:function(){return"Date".concat((this.unit+1)*32,"<").concat(F1[this.unit],">")}}]),n}(Er,gF),MF=function(t){L(e,t);var r=Ye(e);function e(){return A(this,e),r.call(this,F1.DAY)}return e}($v),IF=function(t){L(e,t);var r=Ye(e);function e(){return A(this,e),r.call(this,F1.MILLISECOND)}return e}($v),ka={SECOND:1,MILLISECOND:1e3,MICROSECOND:1e6,NANOSECOND:1e9};yF=Symbol.toStringTag;var Xv=function(t,r){L(n,t);var e=Ye(n);function n(i,a){var o;return A(this,n),o=e.call(this),c(q(o),"unit",void 0),c(q(o),"bitWidth",void 0),o.unit=i,o.bitWidth=a,o}return T(n,[{key:"typeId",get:function(){return Qe.Time}},{key:"toString",value:function(){return"Time".concat(this.bitWidth,"<").concat(ka[this.unit],">")}},{key:r,get:function(){return"Time"}}]),n}(Er,yF),RF=function(t){L(e,t);var r=Ye(e);function e(){return A(this,e),r.call(this,ka.SECOND,32)}return e}(Xv),LF=function(t){L(e,t);var r=Ye(e);function e(){return A(this,e),r.call(this,ka.MILLISECOND,32)}return e}(Xv);_F=Symbol.toStringTag;var Uu=function(t,r){L(n,t);var e=Ye(n);function n(i){var a;A(this,n);var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return a=e.call(this),c(q(a),"unit",void 0),c(q(a),"timezone",void 0),a.unit=i,a.timezone=o,a}return T(n,[{key:"typeId",get:function(){return Qe.Timestamp}},{key:r,get:function(){return"Timestamp"}},{key:"toString",value:function(){return"Timestamp<".concat(ka[this.unit]).concat(this.timezone?", ".concat(this.timezone):"",">")}}]),n}(Er,_F),kF=function(t){L(e,t);var r=Ye(e);function e(){A(this,e);var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return r.call(this,ka.SECOND,n)}return e}(Uu),BF=function(t){L(e,t);var r=Ye(e);function e(){A(this,e);var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return r.call(this,ka.MILLISECOND,n)}return e}(Uu),FF=function(t){L(e,t);var r=Ye(e);function e(){A(this,e);var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return r.call(this,ka.MICROSECOND,n)}return e}(Uu),DF=function(t){L(e,t);var r=Ye(e);function e(){A(this,e);var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return r.call(this,ka.NANOSECOND,n)}return e}(Uu),D1={DAY_TIME:0,YEAR_MONTH:1};bF=Symbol.toStringTag;var qv=function(t,r){L(n,t);var e=Ye(n);function n(i){var a;return A(this,n),a=e.call(this),c(q(a),"unit",void 0),a.unit=i,a}return T(n,[{key:"typeId",get:function(){return Qe.Interval}},{key:r,get:function(){return"Interval"}},{key:"toString",value:function(){return"Interval<".concat(D1[this.unit],">")}}]),n}(Er,bF),NF=function(t){L(e,t);var r=Ye(e);function e(){return A(this,e),r.call(this,D1.DAY_TIME)}return e}(qv),jF=function(t){L(e,t);var r=Ye(e);function e(){return A(this,e),r.call(this,D1.YEAR_MONTH)}return e}(qv);xF=Symbol.toStringTag;var Yv=function(t,r){L(n,t);var e=Ye(n);function n(i,a){var o;return A(this,n),o=e.call(this),c(q(o),"listSize",void 0),c(q(o),"children",void 0),o.listSize=i,o.children=[a],o}return T(n,[{key:"typeId",get:function(){return Qe.FixedSizeList}},{key:"valueType",get:function(){return this.children[0].type}},{key:"valueField",get:function(){return this.children[0]}},{key:r,get:function(){return"FixedSizeList"}},{key:"toString",value:function(){return"FixedSizeList[".concat(this.listSize,"]<").concat(this.valueType,">")}}]),n}(Er,xF);AF=Symbol.toStringTag;var UF=function(t,r){L(n,t);var e=Ye(n);function n(i){var a;return A(this,n),a=e.call(this),c(q(a),"children",void 0),a.children=i,a}return T(n,[{key:"typeId",get:function(){return Qe.Struct}},{key:"toString",value:function(){return"Struct<{".concat(this.children.map(function(a){return"".concat(a.name,":").concat(a.type)}).join(", "),"}>")}},{key:r,get:function(){return"Struct"}}]),n}(Er,AF);function GF(t){switch(t.constructor){case Int8Array:return new Nv;case Uint8Array:return new Gv;case Int16Array:return new jv;case Uint16Array:return new zv;case Int32Array:return new Uv;case Uint32Array:return new Vv;case Float32Array:return new Hv;case Float64Array:return new Wv;default:throw new Error("array type not supported")}}function N1(t,r,e){var n=GF(r.value),i=e||zF(r),a=new Rc(t,new Yv(r.size,new Rc("value",n)),!1,i);return a}function zF(t){var r=new Map;return"byteOffset"in t&&r.set("byteOffset",t.byteOffset.toString(10)),"byteStride"in t&&r.set("byteStride",t.byteStride.toString(10)),"normalized"in t&&r.set("normalized",t.normalized.toString()),r}function VF(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function HF(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};
3644r%2?VF(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):VF(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function cie(t){var r=pie();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function pie(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function WF(t,r){var e=t.COLOR_0||t.colors,n=e&&r;n||(t.colors={constant:!0,value:new Float32Array([1,1,1])}),ne.assert(t.positions||t.POSITION,'no "postions" or "POSITION" attribute in mesh')}function $F(t,r){if(t.attributes)return WF(t.attributes,r),t instanceof Re?t:new Re(t);if(t.positions||t.POSITION)return WF(t,r),new Re({attributes:t});throw Error("Invalid mesh")}var hie=[0,0,0,255],die={mesh:{type:"object",value:null,async:!0},texture:{type:"image",value:null,async:!0},sizeScale:{type:"number",value:1,min:0},_useMeshColors:{type:"boolean",value:!1},_instanced:!0,wireframe:!1,material:!0,getPosition:{type:"accessor",value:function(r){return r.position}},getColor:{type:"accessor",value:hie},getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]},textureParameters:{type:"object",ignore:!0}},Gi=function(t){L(e,t);var r=cie(e);function e(){var n;A(this,e);for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return n=r.call.apply(r,[this].concat(a)),c(q(n),"state",void 0),n}return T(e,[{key:"getShaders",value:function(){var i=!ge(this.context.gl),a={};return yn(this.context.gl,Ee.GLSL_DERIVATIVES)&&(a.DERIVATIVES_AVAILABLE=1),Z(S(e.prototype),"getShaders",this).call(this,{vs:fF,fs:cF,modules:[qe,xi,rt],transpileToGLSL100:i,defines:a})}},{key:"getBounds",value:function(){var i;if(this.props._instanced)return Z(S(e.prototype),"getBounds",this).call(this);var a=this.state.positionBounds;if(a)return a;var o=this.props.mesh;if(!o)return null;if(a=(i=o.header)===null||i===void 0?void 0:i.boundingBox,!a){var s=$F(o,this.props._useMeshColors),u=s.attributes;u.POSITION=u.POSITION||u.positions,a=Ui(u)}return this.state.positionBounds=a,a}},{key:"initializeState",value:function(){var i=this.getAttributeManager();i.addInstanced({instancePositions:{transition:!0,type:5130,fp64:this.use64bitPositions(),size:3,accessor:"getPosition"},instanceColors:{type:5121,transition:!0,size:this.props.colorFormat.length,normalized:!0,accessor:"getColor",defaultValue:[0,0,0,255]},instanceModelMatrix:Fv}),this.setState({emptyTexture:new Ce(this.context.gl,{data:new Uint8Array(4),width:1,height:1})})}},{key:"updateState",value:function(i){Z(S(e.prototype),"updateState",this).call(this,i);var a=i.props,o=i.oldProps,s=i.changeFlags;if(a.mesh!==o.mesh||s.extensionsChanged){var u;if(this.state.positionBounds=null,(u=this.state.model)===null||u===void 0||u.delete(),a.mesh){this.state.model=this.getModel(a.mesh);var l=a.mesh.attributes||a.mesh;this.setState({hasNormals:Boolean(l.NORMAL||l.normals)})}this.getAttributeManager().invalidateAll()}a.texture!==o.texture&&this.setTexture(a.texture),this.state.model&&this.state.model.setDrawMode(this.props.wireframe?3:4)}},{key:"finalizeState",value:function(i){Z(S(e.prototype),"finalizeState",this).call(this,i),this.state.emptyTexture.delete()}},{key:"draw",value:function(i){var a=i.uniforms;if(this.state.model){var o=this.context.viewport,s=this.props,u=s.sizeScale,l=s.coordinateSystem,f=s._instanced;this.state.model.setUniforms(a).setUniforms({sizeScale:u,composeModelMatrix:!f||Dv(o,l),flatShading:!this.state.hasNormals}).draw()}}},{key:"getModel",value:function(i){var a=new Ie(this.context.gl,HF(HF({},this.getShaders()),{},{id:this.props.id,geometry:$F(i,this.props._useMeshColors),isInstanced:!0})),o=this.props.texture,s=this.state.emptyTexture;return a.setUniforms({sampler:o||s,hasTexture:Boolean(o)}),a}},{key:"setTexture",value:function(i){var a=this.state,o=a.emptyTexture,s=a.model;s&&s.setUniforms({sampler:i||o,hasTexture:Boolean(i)})}}]),e}(He);c(Gi,"defaultProps",die);c(Gi,"layerName","SimpleMeshLayer");F();j();k();Ge();F();j();be();F();j();F();j();var ai=function(){function t(){A(this,t);var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}
3644,e=r.id;this.id=e||$e(this.constructor.name),this.display=!0,this.position=new z,this.rotation=new z,this.scale=new z(1,1,1),this.matrix=new ye,this.userData={},this.props={},this._setScenegraphNodeProps(r)}return T(t,[{key:"delete",value:function(){}},{key:"setProps",value:function(e){return this._setScenegraphNodeProps(e),this}},{key:"toString",value:function(){return"{type: ScenegraphNode, id: ".concat(this.id,")}")}},{key:"getBounds",value:function(){return null}},{key:"setPosition",value:function(e){return re(e.length===3,"setPosition requires vector argument"),this.position=e,this}},{key:"setRotation",value:function(e){return re(e.length===3,"setRotation requires vector argument"),this.rotation=e,this}},{key:"setScale",value:function(e){return re(e.length===3,"setScale requires vector argument"),this.scale=e,this}},{key:"setMatrix",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;n?this.matrix.copy(e):this.matrix=e}},{key:"setMatrixComponents",value:function(e){var n=e.position,i=e.rotation,a=e.scale,o=e.update,s=o===void 0?!0:o;return n&&this.setPosition(n),i&&this.setRotation(i),a&&this.setScale(a),s&&this.updateMatrix(),this}},{key:"updateMatrix",value:function(){var e=this.position,n=this.rotation,i=this.scale;return this.matrix.identity(),this.matrix.translate(e),this.matrix.rotateXYZ(n),this.matrix.scale(i),this}},{key:"update",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.position,i=e.rotation,a=e.scale;return n&&this.setPosition(n),i&&this.setRotation(i),a&&this.setScale(a),this.updateMatrix(),this}},{key:"getCoordinateUniforms",value:function(e,n){re(e),n=n||this.matrix;var i=new ye(e).multiplyRight(n),a=i.invert(),o=a.transpose();return{viewMatrix:e,modelMatrix:n,objectMatrix:n,worldMatrix:i,worldInverseMatrix:a,worldInverseTransposeMatrix:o}}},{key:"_setScenegraphNodeProps",value:function(e){"display"in e&&(this.display=e.display),"position"in e&&this.setPosition(e.position),"rotation"in e&&this.setRotation(e.rotation),"scale"in e&&this.setScale(e.scale),"matrix"in e&&this.setMatrix(e.matrix),Object.assign(this.props,e)}}]),t}();function vie(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=mie(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3645In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function mie(t,r){if(t){if(typeof t=="string")return XF(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return XF(t,r)}}function XF(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function gie(t){var r=yie();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function yie(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Kv=function(t){L(e,t);var r=gie(e);function e(){var n;A(this,e);var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};i=Array.isArray(i)?{children:i}:i;var a=i,o=a.children,s=o===void 0?[]:o;return fe.assert(s.every(function(u){return u instanceof ai}),"every child must an instance of ScenegraphNode"),n=r.call(this,i),n.children=s,n}return T(e,[{key:"add",value:function(){for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];for(var s=0,u=a;s<u.length;s++){var l=u[s];Array.isArray(l)?this.add.apply(this,ae(l)):this.children.push(l)}return this}},{key:"remove",value:function(i){var a=this.children,o=a.indexOf(i);return o>-1&&a.splice(o,1),this}},{key:"removeAll",value:function(){return this.children=[],this}}
3645,{key:"delete",value:function(){this.children.forEach(function(i){return i.delete()}),this.removeAll(),Z(S(e.prototype),"delete",this).call(this)}},{key:"getBounds",value:function(){var i=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]];return this.traverse(function(a,o){var s=o.worldMatrix,u=a.getBounds();if(u){var l=W(u,2),f=l[0],p=l[1],h=new z(f).add(p).divide([2,2,2]);s.transformAsPoint(h,h);var d=new z(p).subtract(f).divide([2,2,2]);s.transformAsVector(d,d);for(var v=0;v<8;v++)for(var m=new z(v&1?-1:1,v&2?-1:1,v&4?-1:1).multiply(d).add(h),g=0;g<3;g++)i[0][g]=Math.min(i[0][g],m[g]),i[1][g]=Math.max(i[1][g],m[g])}}),Number.isFinite(i[0][0])?i:null}},{key:"traverse",value:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=a.worldMatrix,s=o===void 0?new ye:o,u=new ye(s).multiplyRight(this.matrix),l=vie(this.children),f;try{for(l.s();!(f=l.n()).done;){var p=f.value;p instanceof e?p.traverse(i,{worldMatrix:u}):i(p,{worldMatrix:u})}}catch(h){l.e(h)}finally{l.f()}}}]),e}(ai);F();j();var _ie={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},bie={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function qF(t){if(!t._animation){var r=bie[t.componentType],e=_ie[t.type],n=e*t.count,i=t.bufferView.data,a=i.buffer,o=i.byteOffset,s=new r(a,o+(t.byteOffset||0),n);if(e===1)t._animation=Array.from(s);else{for(var u=[],l=0;l<s.length;l+=e)u.push(Array.from(s.slice(l,l+e)));t._animation=u}}return t._animation}var xie=new ye;function Aie(t,r){if(r.matrix.identity(),t.translation&&r.matrix.translate(t.translation),t.rotation){var e=xie.fromQuaternion(t.rotation);r.matrix.multiplyRight(e)}t.scale&&r.matrix.scale(t.scale)}var j1=new Vn;function Sie(t,r,e,n,i){if(r==="rotation"){j1.slerp({start:e,target:n,ratio:i});for(var a=0;a<j1.length;a++)t[r][a]=j1[a]}else for(var o=0;o<e.length;o++)t[r][o]=i*n[o]+(1-i)*e[o]}function Tie(t,r,e){for(var n=e.p0,i=e.outTangent0,a=e.inTangent1,o=e.p1,s=e.tDiff,u=e.ratio,l=0;l<t[r].length;l++){var f=i[l]*s,p=a[l]*s;t[r][l]=(2*Math.pow(u,3)-3*Math.pow(u,2)+1)*n[l]+(Math.pow(u,3)-2*Math.pow(u,2)+u)*f+(-2*Math.pow(u,3)+3*Math.pow(u,2))*o[l]+(Math.pow(u,3)-Math.pow(u,2))*p}}function wie(t,r,e){for(var n=0;n<e.length;n++)t[r][n]=e[n]}function Pie(t,r,e,n){var i=r.input,a=r.interpolation,o=r.output,s=i[i.length-1],u=t%s,l=i.findIndex(function(x){return x>=u}),f=Math.max(0,l-1);if(!Array.isArray(e[n]))switch(n){case"translation":e[n]=[0,0,0];break;case"rotation":e[n]=[0,0,0,1];break;case"scale":e[n]=[1,1,1];break;default:fe.warn("Bad animation path ".concat(n))()}re(e[n].length===o[f].length);var p=i[f],h=i[l];switch(a){case"STEP":wie(e,n,o[f]);break;case"LINEAR":if(h>p){var d=(u-p)/(h-p);Sie(e,n,o[f],o[l],d)}break;case"CUBICSPLINE":if(h>p){var v=(u-p)/(h-p),m=h-p,g=o[3*f+1],y=o[3*f+2],_=o[3*l+0],b=o[3*l+1];Tie(e,n,{p0:g,outTangent0:y,inTangent1:_,p1:b,tDiff:m,ratio:v})}break;default:fe.warn("Interpolation ".concat(a," not supported"))();break}}var Oie=function(){function t(r){A(this,t),this.startTime=0,this.playing=!0,this.speed=1,this.channels=[],Object.assign(this,r)}return T(t,[{key:"animate",value:function(e){if(this.playing){var n=e/1e3,i=(n-this.startTime)*this.speed;this.channels.forEach(function(a){var o=a.sampler,s=a.target,u=a.path;Pie(i,o,s,u),Aie(s,s._node)})}}}]),t}(),YF=function(){function t(r){A(this,t),this.animations=r.animations.map(function(e,n){var i=e.name||"Animation-".concat(n),a=e.samplers.map(function(s){var u=s.input,l=s.interpolation,f=l===void 0?"LINEAR":l,p=s.output;return{input:qF(r.accessors[u]),interpolation:f,output:qF(r.accessors[p])}}),o=e.channels.map(function(s){var u=s.sampler,l=s.target;return{sampler:a[u],target:r.nodes[l.node],path:l.path}});return new Oie({name:i,channels:o})})}return T(t,[{key:"animate",value:function(e){this.setTime(e)}},{key:"setTime",value:function(e){this.animations.forEach(function(n){return n.animate(e)})}},{key:"getAnimations",value:function(){return this.animations}}]),t}();k();F();j();function Eie(t){var r=Cie();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function Cie(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var KF=function(t){L(e,t);var r=Eie(e);function e(n){var i;A(this,e);var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return i=r.call(this,a),i.onBeforeRender=null,i.AfterRender=null,n instanceof Ie?(i.model=n,i._setModelNodeProps(a)):i.model=new Ie(n,a),i.bounds=null,i.managedResources=a.managedResources||[],i}return T(e,[{key:"setProps",value:function(i){return Z(S(e.prototype),"setProps",this).call(this,i),this._setModelNodeProps(i),this}},{key:"getBounds",value:function(){return this.bounds}},{key:"delete",value:function(){this.model&&(this.model.delete(),this.model=null),this.managedResources.forEac
3645h(function(i){return i.delete()}),this.managedResources=[]}},{key:"draw",value:function(){var i;return(i=this.model).draw.apply(i,arguments)}},{key:"setUniforms",value:function(){var i;return(i=this.model).setUniforms.apply(i,arguments),this}},{key:"setAttributes",value:function(){var i;return(i=this.model).setAttributes.apply(i,arguments),this}},{key:"updateModuleSettings",value:function(){var i;return(i=this.model).updateModuleSettings.apply(i,arguments),this}},{key:"_setModelNodeProps",value:function(i){this.model.setProps(i)}}]),e}(ai);k();F();j();function ZF(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function U1(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?ZF(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):ZF(Object(e)).forEac
3645h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var kc=function(){function t(r,e){A(this,t);var n=e.attributes,i=e.material,a=e.pbrDebug,o=e.imageBasedLightingEnvironment,s=e.lights,u=e.useTangents;this.gl=r,this.defines={MANUAL_SRGB:1,SRGB_FAST_APPROXIMATION:1},yn(r,Ee.GLSL_TEXTURE_LOD)&&(this.defines.USE_TEX_LOD=1),this.uniforms={u_Camera:[0,0,0],u_MetallicRoughnessValues:[1,1]},this.parameters={},this.generatedTextures=[],o&&(this.uniforms.u_DiffuseEnvSampler=o.getDiffuseEnvSampler(),this.uniforms.u_SpecularEnvSampler=o.getSpecularEnvSampler(),this.uniforms.u_brdfLUT=o.getBrdfTexture(),this.uniforms.u_ScaleIBLAmbient=[1,1]),a&&(this.uniforms.u_ScaleDiffBaseMR=[0,0,0,0],this.uniforms.u_ScaleFGDSpec=[0,0,0,0]),this.defineIfPresent(n.NORMAL,"HAS_NORMALS"),this.defineIfPresent(n.TANGENT&&u,"HAS_TANGENTS"),this.defineIfPresent(n.TEXCOORD_0,"HAS_UV"),this.defineIfPresent(o,"USE_IBL"),this.defineIfPresent(s,"USE_LIGHTS"),this.defineIfPresent(a,"PBR_DEBUG"),i&&this.parseMaterial(i)}return T(t,[{key:"defineIfPresent",value:function(e,n){e&&(this.defines[n]=1)}},{key:"parseTexture",value:function(e,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,a=e.texture&&e.texture.sampler&&e.texture.sampler.parameters||{},o=e.texture.source.image,s,u={};o.compressed?(s=o,u=c({},this.gl.TEXTURE_MIN_FILTER,o.data.length>1?this.gl.LINEAR_MIPMAP_NEAREST:this.gl.LINEAR)):s={data:o};var l=new Ce(this.gl,U1({id:e.name||e.id,parameters:U1(U1({},a),u),pixelStore:c({},this.gl.UNPACK_FLIP_Y_WEBGL,!1)},s));this.uniforms[n]=l,this.defineIfPresent(i,i),this.generatedTextures.push(l)}},{key:"parsePbrMetallicRoughness",value:function(e){e.baseColorTexture&&this.parseTexture(e.baseColorTexture,"u_BaseColorSampler","HAS_BASECOLORMAP"),this.uniforms.u_BaseColorFactor=e.baseColorFactor||[1,1,1,1],e.metallicRoughnessTexture&&this.parseTexture(e.metallicRoughnessTexture,"u_MetallicRoughnessSampler","HAS_METALROUGHNESSMAP");var n=e.metallicFactor,i=n===void 0?1:n,a=e.roughnessFactor,o=a===void 0?1:a;this.uniforms.u_MetallicRoughnessValues=[i,o]}},{key:"parseMaterial",value:function(e){if(this.uniforms.pbr_uUnlit=Boolean(e.unlit),e.pbrMetallicRoughness&&this.parsePbrMetallicRoughness(e.pbrMetallicRoughness),e.normalTexture){this.parseTexture(e.normalTexture,"u_NormalSampler","HAS_NORMALMAP");var n=e.normalTexture.scale,i=n===void 0?1:n;this.uniforms.u_NormalScale=i}if(e.occlusionTexture){this.parseTexture(e.occlusionTexture,"u_OcclusionSampler","HAS_OCCLUSIONMAP");var a=e.occlusionTexture.strength,o=a===void 0?1:a;this.uniforms.u_OcclusionStrength=o}if(e.emissiveTexture&&(this.parseTexture(e.emissiveTexture,"u_EmissiveSampler","HAS_EMISSIVEMAP"),this.uniforms.u_EmissiveFactor=e.emissiveFactor||[0,0,0]),e.alphaMode==="MASK"){var s=e.alphaCutoff,u=s===void 0?.5:s;this.defines.ALPHA_CUTOFF=1,this.uniforms.u_AlphaCutoff=u}else e.alphaMode==="BLEND"&&(fe.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]}))}},{key:"delete",value:function(){this.generatedTextures.forEach(function(e){return e.delete()})}}]),t}();function JF(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function Zv(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?JF(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):JF(Object(e)).forEac
3645h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var Mie=`
3646#if (__VERSION__ < 300)
3647  #define _attr attribute
3648#else
3649  #define _attr in
3650#endif
3651
3652  _attr vec4 POSITION;
3653
3654  #ifdef HAS_NORMALS
3655    _attr vec4 NORMAL;
3656  #endif
3657
3658  #ifdef HAS_TANGENTS
3659    _attr vec4 TANGENT;
3660  #endif
3661
3662  #ifdef HAS_UV
3663    _attr vec2 TEXCOORD_0;
3664  #endif
3665
3666  void main(void) {
3667    vec4 _NORMAL = vec4(0.);
3668    vec4 _TANGENT = vec4(0.);
3669    vec2 _TEXCOORD_0 = vec2(0.);
3670
3671    #ifdef HAS_NORMALS
3672      _NORMAL = NORMAL;
3673    #endif
3674
3675    #ifdef HAS_TANGENTS
3676      _TANGENT = TANGENT;
3677    #endif
3678
3679    #ifdef HAS_UV
3680      _TEXCOORD_0 = TEXCOORD_0;
3681    #endif
3682
3683    pbr_setPositionNormalTangentUV(POSITION, _NORMAL, _TANGENT, _TEXCOORD_0);
3684    gl_Position = u_MVPMatrix * POSITION;
3685  }
3686`,Iie=`
3687#if (__VERSION__ < 300)
3688  #define fragmentColor gl_FragColor
3689#else
3690  out vec4 fragmentColor;
3691#endif
3692
3693  void main(void) {
3694    fragmentColor = pbr_filterColor(vec4(0));
3695  }
3696`;function QF(t,r){return ge(t)?`#version 300 es
3697`.concat(r):r}function G1(t,r){var e=r.id,n=r.drawMode,i=r.vertexCount,a=r.attributes,o=r.modelOptions,s=new kc(t,r);fe.info(4,"createGLTFModel defines: ",s.defines)();var u=[];u.push.apply(u,ae(s.generatedTextures)),u.push.apply(u,ae(Object.values(a).map(function(f){return f.buffer})));var l=new KF(t,Zv(Zv({id:e,drawMode:n,vertexCount:i,modules:[ha],parameters:s.parameters,vs:QF(t,Mie),fs:QF(t,Iie),managedResources:u},o),{},{defines:Zv(Zv({},s.defines),o.defines)}));return l.setProps({attributes:a}),l.setUniforms(s.uniforms),l}var Rie={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Lie={modelOptions:{},pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1},eD=function(){function t(r){A(this,t);var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.gl=r,this.options=Object.assign({},Lie,e)}return T(t,[{key:"instantiate",value:function(e){var n=this;this.gltf=e;var i=(e.scenes||[]).map(function(a){return n.createScene(a)});return i}},{key:"createAnimator",value:function(){return Array.isArray(this.gltf.animations)?new YF(this.gltf):null}},{key:"createScene",value:function(e){var n=this,i=e.nodes||[],a=i.map(function(s){return n.createNode(s)}),o=new Kv({id:e.name||e.id,children:a});return o}},{key:"createNode",value:function(e){var n=this;if(!e._node){var i=e.children||[],a=i.map(function(u){return n.createNode(u)});e.mesh&&a.push(this.createMesh(e.mesh));var o=new Kv({id:e.name||e.id,children:a});if(e.matrix)o.setMatrix(e.matrix);else{if(o.matrix.identity(),e.translation&&o.matrix.translate(e.translation),e.rotation){var s=new ye().fromQuaternion(e.rotation);o.matrix.multiplyRight(s)}e.scale&&o.matrix.scale(e.scale)}e._node=o}return e._node}},{key:"createMesh",value:function(e){var n=this;if(!e._mesh){var i=e.primitives||[],a=i.map(function(s,u){return n.createPrimitive(s,u,e)}),o=new Kv({id:e.name||e.id,children:a});e._mesh=o}return e._mesh}},{key:"getVertexCount",value:function(e){fe.warn("getVertexCount() not found")()}},{key:"createPrimitive",value:function(e,n,i){var a=G1(this.gl,Object.assign({id:e.name||"".concat(i.name||i.id,"-primitive-").concat(n),drawMode:e.mode||4,vertexCount:e.indices?e.indices.count:this.getVertexCount(e.attributes),attributes:this.createAttributes(e.attributes,e.indices),material:e.material},this.options));return a.bounds=[e.attributes.POSITION.min,e.attributes.POSITION.max],a}},{key:"createAttributes",value:function(e,n){var i=this,a={};return Object.keys(e).forEach(function(o){a[o]=i.createAccessor(e[o],i.createBuffer(e[o],i.gl.ARRAY_BUFFER))}),n&&(a.indices=this.createAccessor(n,this.createBuffer(n,this.gl.ELEMENT_ARRAY_BUFFER))),fe.info(4,"glTF Attributes",{attributes:e,indices:n,generated:a})(),a}},{key:"createBuffer",value:function(e,n){e.bufferView||(e.bufferView={});var i=e.bufferView;return i.lumaBuffers||(i.lumaBuffers={}),i.lumaBuffers[n]||(i.lumaBuffers[n]=new Pe(this.gl,{id:"from-".concat(i.id),data:i.data||e.value,target:n})),i.lumaBuffers[n]}},{key:"createAccessor",value:function(e,n){return new pr({buffer:n,offset:e.byteOffset||0,stride:e.bufferView.byteStride||0,type:e.componentType,size:Rie[e.type]})}},{key:"createSampler",value:function(e){return e}},{key:"needsPOT",value:function(){return!1}}]),t}();function Jv(t,r,e){var n=new eD(t,e),i=n.instantiate(r),a=n.createAnimator();return{scenes:i,animator:a}}k();var Yx=me(Ae());var tD="3.4.13";var Hi=me(Ae());var rD="3.4.13";k();Ge();var Z1=me(Ae());be();var zi=me(Ae());var nD="3.4.13",kie="https://unpkg.com/@loaders.gl/textures@".concat(nD,"/dist/libs/basis_encoder.wasm"),Bie="https://unpkg.com/@loaders.gl/textures@".concat(nD,"/dist/libs/basis_encoder.js"),z1;function q1(t){return H1.apply(this,arguments)}function H1(){return H1=Y(zi.default.mark(function t(r){var e;return zi.default.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(e=r.modules||{},!e.basis){i.next=3;break}return i.abrupt("return",e.basis);case 3:return z1=z1||Fie(r),i.next=6,z1;case 6:return i.abrupt("return",i.sent);case 7:case"end":return i.stop()}},t)})),H1.apply(this,arguments)}function Fie(t){return W1.apply(this,arguments)}function W1(){return W1=Y(zi.default.mark(function t(r){var e,n,i,a;return zi.default.wrap(function(s){for(;;
3697)switch(s.prev=s.next){case 0:return e=null,n=null,s.t0=Promise,s.next=5,Fn("basis_transcoder.js","textures",r);case 5:return s.t1=s.sent,s.next=8,Fn("basis_transcoder.wasm","textures",r);case 8:return s.t2=s.sent,s.t3=[s.t1,s.t2],s.next=12,s.t0.all.call(s.t0,s.t3);case 12:return i=s.sent,a=W(i,2),e=a[0],n=a[1],e=e||globalThis.BASIS,s.next=19,Die(e,n);case 19:return s.abrupt("return",s.sent);case 20:case"end":return s.stop()}},t)})),W1.apply(this,arguments)}function Die(t,r){var e={};return r&&(e.wasmBinary=r),new Promise(function(n){t(e).then(function(i){var a=i.BasisFile,o=i.initializeBasis;o(),n({BasisFile:a})})})}var V1;function Y1(t){return $1.apply(this,arguments)}function $1(){return $1=Y(zi.default.mark(function t(r){var e;return zi.default.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(e=r.modules||{},!e.basisEncoder){i.next=3;break}return i.abrupt("return",e.basisEncoder);case 3:return V1=V1||Nie(r),i.next=6,V1;case 6:return i.abrupt("return",i.sent);case 7:case"end":return i.stop()}},t)})),$1.apply(this,arguments)}function Nie(t){return X1.apply(this,arguments)}function X1(){return X1=Y(zi.default.mark(function t(r){var e,n,i,a;return zi.default.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return e=null,n=null,s.t0=Promise,s.next=5,Fn(Bie,"textures",r);case 5:return s.t1=s.sent,s.next=8,Fn(kie,"textures",r);case 8:return s.t2=s.sent,s.t3=[s.t1,s.t2],s.next=12,s.t0.all.call(s.t0,s.t3);case 12:return i=s.sent,a=W(i,2),e=a[0],n=a[1],e=e||globalThis.BASIS,s.next=19,jie(e,n);case 19:return s.abrupt("return",s.sent);case 20:case"end":return s.stop()}},t)})),X1.apply(this,arguments)}function jie(t,r){var e={};return r&&(e.wasmBinary=r),new Promise(function(n){t(e).then(function(i){var a=i.BasisFile,o=i.KTX2File,s=i.initializeBasis,u=i.BasisEncoder;s(),n({BasisFile:a,KTX2File:o,BasisEncoder:u})})})}var $o={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};function Uie(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=Gie(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}
3697}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3698In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function Gie(t,r){if(t){if(typeof t=="string")return iD(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return iD(t,r)}}function iD(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var zie=["","WEBKIT_","MOZ_"],aD={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"},Qv=null;function oD(t){if(!Qv){t=t||Vie()||void 0,Qv=new Set;var r=Uie(zie),e;try{for(r.s();!(e=r.n()).done;){var n=e.value;for(var i in aD)if(t&&t.getExtension("".concat(n).concat(i))){var a=aD[i];Qv.add(a)}}}catch(o){r.e(o)}finally{r.f()}}return Qv}function Vie(){try{var t=document.createElement("canvas");return t.getContext("webgl")}catch{return null}}var Trt=new Uint8Array([0]);var sD,uD,lD,fD,cD,pD,hD,dD;(function(t){t[t.NONE=0]="NONE",t[t.BASISLZ=1]="BASISLZ",t[t.ZSTD=2]="ZSTD",t[t.ZLIB=3]="ZLIB"})(sD||(sD={})),function(t){t[t.BASICFORMAT=0]="BASICFORMAT"}(uD||(uD={})),function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.ETC1S=163]="ETC1S",t[t.UASTC=166]="UASTC"}(lD||(lD={})),function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.SRGB=1]="SRGB"}(fD||(fD={})),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"}(cD||(cD={})),function(t){t[t.ALPHA_STRAIGHT=0]="ALPHA_STRAIGHT",t[t.ALPHA_PREMULTIPLIED=1]="ALPHA_PREMULTIPLIED"}(pD||(pD={})),function(t){t[t.RGB=0]="RGB",t[t.RRR=3]="RRR",t[t.GGG=4]="GGG",t[t.AAA=15]="AAA"}(hD||(hD={})),function(t){t[t.RGB=0]="RGB",t[t.RGBA=3]="RGBA",t[t.RRR=4]="RRR",t[t.RRRG=5]="RRRG"}(dD||(dD={}));var jr=[171,75,84,88,32,50,48,187,13,10,26,10];function vD(t){var r=new Uint8Array(t),e=r.byteLength<jr.length||r[0]!==jr[0]||r[1]!==jr[1]||r[2]!==jr[2]||r[3]!==jr[3]||r[4]!==jr[4]||r[5]!==jr[5]||r[6]!==jr[6]||r[7]!==jr[7]||r[8]!==jr[8]||r[9]!==jr[9]||r[10]!==jr[10]||r[11]!==jr[11];return!e}var Hie={etc1:{basisFormat:0,compressed:!0,format:$o.COMPRESSED_RGB_ETC1_WEBGL},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:$o.COMPRESSED_RGB_S3TC_DXT1_EXT},bc3:{basisFormat:3,compressed:!0,format:$o.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:$o.COMPRESSED_RGB_PVRTC_4BPPV1_IMG},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:$o.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG},"astc-4x4":{basisFormat:10,compressed:!0,format:$o.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 Q1(t,r){return J1.apply(this,arguments)}function J1(){return J1=Y(Z1.default.mark(function t(r,e){var n,i,a,o,s,u;return Z1.default.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(e.basis.containerFormat!=="auto"){f.next=11;break}if(!vD(r)){f.next=6;break}return f.next=4,Y1(e);case 4:return n=f.sent,f.abrupt("return",mD(n.KTX2File,r,e));case 6:return f.next=8,q1(e);case 8:return i=f.sent,a=i.BasisFile,f.abrupt("return",K1(a,r,e));case 11:f.t0=e.basis.module,f.next=f.t0==="encoder"?14:(f.t0==="transcoder",22);break;case 14:return f.next=16,Y1(e);case 16:o=f.sent,f.t1=e.basis.containerFormat,f.next=f.t1==="ktx2"?20:(f.t1==="basis",21);break;case 20:return f.abrupt("return",mD(o.KTX2File,r,e));case 21:return f.abrupt("return",K1(o.BasisFile,r,e));case 22:return f.next=24,q1(e);case 24:return s=f.sent,u=s.BasisFile,f.abrupt("return",K1(u,r,e));case 27:case"end":return f.stop()}},t)})),J1.apply(this,arguments)}function K1(t,r,e){var n=new t(new Uint8Array(r));try{if(!n.startTranscoding())throw new Error("Failed to start basis transcoding");for(var i=n.getNumImages(),a=[],o=0;o<i;o++){for(var s=n.getNumLevels(o),u=[],l=0;l<s;l++)u.push(Wie(n,o,l,e));a.push(u)}return a}finally{n.close(),n.delete()}}function Wie(t,r,e,n){var i=t.getImageWidth(r,e),a=t.getImageHeight(r,e),o=t.getHasAlpha(),s=gD(n,o),u=s.compressed,l=s.format,f=s.basisFormat,p=t.getImageTranscodedSizeInBytes(r,e,f),h=new Uint8Array(p);if(!t.transcodeImage(h,r,e,f,0,0))throw new Error("failed to start Basis transcoding");return{width:i,height:a,data:h,compressed:u,format:l,hasAlpha:o}}function mD(t,r,e){var n=new t(new Uint8Array(r));try{if(!n.startTranscoding())throw new Error("failed to start KTX2 transcoding");for(var i=n.getLevels(),a=[],o=0;o<i;o++){a.push($ie(n,o,e));break}return[a]}finally{n.close(),n.delete()}}function $ie(t,r,e){var n=t.getImageLevelInfo(r,0,0),i=n.alphaFlag,a=n.height,o=n.width,s=gD(e,i),u=s.compressed,l=s.format,f=s.basisFormat,p=t.getImageTranscodedSizeInBytes(r,0,0,f),h=new Uint8Array(p);if(!t.transcodeImage(h,r,0,0,f,0,-1,-1))throw new Error("Failed to transcode KTX2 image");return{width:o,height:a,data:h,compressed:u,levelSize:p,hasAlpha:i,format:l}}function gD(t,r){var e=t&&t.basis&&t.basis.format;
3698return e==="auto"&&(e=em()),ue(e)==="object"&&(e=r?e.alpha:e.noAlpha),e=e.toLowerCase(),Hie[e]}function em(){var t=oD();return t.has("astc")?"astc-4x4":t.has("dxt")?{alpha:"bc3",noAlpha:"bc1"}:t.has("pvrtc")?{alpha:"pvrtc1-4-rgba",noAlpha:"pvrtc1-4-rgb"}:t.has("etc1")?"etc1":t.has("etc2")?"etc2":"rgb565"}function yD(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function _D(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?yD(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):yD(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var bD={name:"Basis",id:cr?"basis":"basis-nodejs",module:"textures",version:rD,worker:!0,extensions:["basis","ktx2"],mimeTypes:["application/octet-stream","image/ktx2"],tests:["sB"],binary:!0,options:{basis:{format:"auto",libraryPath:"libs/",containerFormat:"auto",module:"transcoder"}}},ex=_D(_D({},bD),{},{parse:Q1});function Vt(t,r){if(!t)throw new Error(r||"assert failed: gltf")}function tx(t,r){var e=t.startsWith("data:")||t.startsWith("http:")||t.startsWith("https:");if(e)return t;var n=r.baseUri||r.uri;if(!n)throw new Error("'baseUri' must be provided to resolve relative url ".concat(t));return n.substr(0,n.lastIndexOf("/")+1)+t}function xD(t,r,e){var n=t.bufferViews[e];Vt(n);var i=n.buffer,a=r[i];Vt(a);var o=(n.byteOffset||0)+a.byteOffset;return new Uint8Array(a.arrayBuffer,o,n.byteLength)}var Nx=me(Ae());var lx={};Lr(lx,{decode:()=>dae,name:()=>hae});var Fc=me(Ae());Ge();k();F();j();k();var AD=["SCALAR","VEC2","VEC3","VEC4"],Xie=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],qie=new Map(Xie),Yie={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Kie={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Zie={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function tm(t){var r=AD[t-1];return r||AD[0]}function rm(t){var r=qie.get(t.constructor);if(!r)throw new Error("Illegal typed array");return r}function Gu(t,r){var e=Zie[t.componentType],n=Yie[t.type],i=Kie[t.componentType],a=t.count*n,o=t.count*n*i;return Vt(o>=0&&o<=r.byteLength),{ArrayType:e,length:a,byteLength:o}}function Bc(t){var r=t.images,e=t.bufferViews;r=r||[],e=e||[];var n=r.map(function(o){return o.bufferView});e=e.filter(function(o){return!n.includes(o)});var i=e.reduce(function(o,s){return o+s.byteLength},0),a=r.reduce(function(o,s){var u=s.image,l=u.width,f=u.height;return o+l*f},0);return i+Math.ceil(4*a*1.33)}function SD(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=Jie(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3699In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function Jie(t,r){if(t){if(typeof t=="string")return TD(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return TD(t,r)}}function TD(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function wD(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function Qie(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};
3699r%2?wD(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):wD(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var eae={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]},bt=function(){function t(r){A(this,t),c(this,"gltf",void 0),c(this,"sourceBuffers",void 0),c(this,"byteLength",void 0),this.gltf=r||{json:Qie({},eae),buffers:[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}return T(t,[{key:"json",get:function(){return this.gltf.json}},{key:"getApplicationData",value:function(e){var n=this.json[e];return n}},{key:"getExtraData",value:function(e){var n=this.json.extras||{};return n[e]}},{key:"getExtension",value:function(e){var n=this.getUsedExtensions().find(function(a){return a===e}),i=this.json.extensions||{};return n?i[e]||!0:null}},{key:"getRequiredExtension",value:function(e){var n=this.getRequiredExtensions().find(function(i){return i===e});return n?this.getExtension(e):null}},{key:"getRequiredExtensions",value:function(){return this.json.extensionsRequired||[]}},{key:"getUsedExtensions",value:function(){return this.json.extensionsUsed||[]}},{key:"getRemovedExtensions",value:function(){return this.json.extensionsRemoved||[]}},{key:"getObjectExtension",value:function(e,n){var i=e.extensions||{};return i[n]}},{key:"getScene",value:function(e){return this.getObject("scenes",e)}},{key:"getNode",value:function(e){return this.getObject("nodes",e)}},{key:"getSkin",value:function(e){return this.getObject("skins",e)}},{key:"getMesh",value:function(e){return this.getObject("meshes",e)}},{key:"getMaterial",value:function(e){return this.getObject("materials",e)}},{key:"getAccessor",value:function(e){return this.getObject("accessors",e)}},{key:"getTexture",value:function(e){return this.getObject("textures",e)}},{key:"getSampler",value:function(e){return this.getObject("samplers",e)}},{key:"getImage",value:function(e){return this.getObject("images",e)}},{key:"getBufferView",value:function(e){return this.getObject("bufferViews",e)}},{key:"getBuffer",value:function(e){return this.getObject("buffers",e)}},{key:"getObject",value:function(e,n){if(ue(n)==="object")return n;var i=this.json[e]&&this.json[e][n];if(!i)throw new Error("glTF file error: Could not find ".concat(e,"[").concat(n,"]"));return i}},{key:"getTypedArrayForBufferView",value:function(e){e=this.getBufferView(e);var n=e.buffer,i=this.gltf.buffers[n];Vt(i);var a=(e.byteOffset||0)+i.byteOffset;return new Uint8Array(i.arrayBuffer,a,e.byteLength)}},{key:"getTypedArrayForAccessor",value:function(e){e=this.getAccessor(e);var n=this.getBufferView(e.bufferView),i=this.getBuffer(n.buffer),a=i.data,o=Gu(e,n),s=o.ArrayType,u=o.length,l=n.byteOffset+e.byteOffset;return new s(a,l,u)}},{key:"getTypedArrayForImageData",value:function(e){e=this.getAccessor(e);var n=this.getBufferView(e.bufferView),i=this.getBuffer(n.buffer),a=i.data,o=n.byteOffset||0;return new Uint8Array(a,o,n.byteLength)}},{key:"addApplicationData",value:function(e,n){return this.json[e]=n,this}},{key:"addExtraData",value:function(e,n){return this.json.extras=this.json.extras||{},this.json.extras[e]=n,this}},{key:"addObjectExtension",value:function(e,n,i){return e.extensions=e.extensions||{},e.extensions[n]=i,this.registerUsedExtension(n),this}},{key:"setObjectExtension",value:function(e,n,i){var a=e.extensions||{};a[n]=i}},{key:"removeObjectExtension",value:function(e,n){var i=e.extensions||{},a=i[n];return delete i[n],a}},{key:"addExtension",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Vt(n),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=n,this.registerUsedExtension(e),n}},{key:"addRequiredExtension",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Vt(n),this.addExtension(e,n),this.registerRequiredExtension(e),n}},{key:"registerUsedExtension",value:function(e){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(function(n){return n===e})||this.json.extensionsUsed.push(e)}},{key:"registerRequiredExtension",value:function(e){this.registerUsedExtension(e),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(function(n){return n===e})||this.json.extensionsRequired.push(e)}},{key:"removeExtension",value:function(e){if(this.getExtension(e)){this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,e),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,e),this.json.extensions&&delete this.json.extensions[e],Array.isArray(this.json.extensionsRemoved)||(this.json.extensionsRemoved=[]);var n=this.json.extensionsRemoved;n.includes(e)||n.push(e)}}},{key:"setDefaultScene",value:function(e){this.json.scene=e}},{key:"addScene",value:function(e){var n=e.nodeIndices;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:n}),this.json.scenes.length-1}},{key:"addNode",value:function(e){var n=e.meshIndex,i=e.matrix;this.json.nodes=this.json.nodes||[];var a={mesh:n};return i&&(a.matrix=i),this.json.nodes.push(a),this.json.nodes.length-1}},{key:"addMesh",value:function(e){var n=e.attributes,i=e.indices,a=e.material,o=e.mode,s=o===void 0?4:o,u=this._addAttributes(n),l={primitives:[{attributes:u,mode:s}]};if(i){var f=this._addIndices(i);l.primitives[0].indices=f}return Number.isFinite(a)&&(l.primitives[0].material=a),this.json.meshes=this.json.meshes||[],this.json.meshes.push(l),this.json.meshes.length-1}},{key:"addPointCloud",value:function(e){var n=this._addAttributes(e),i={primitives:[{attributes:n,mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(i),this.json.meshes.length-1}},{key:"addImage",value:function(e,n){var i=uo(e),a=n||i?.mimeType,o=this.addBufferView(e),s={bufferView:o,mimeType:a};return this.json.images=this.json.images||[],this.json.images.push(s),this.json.images.length-1}},{key:"addBufferView",value:function(e){var n=e.byteLength;Vt(Number.isFinite(n)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);var i={buffer:0,byteOffset:this.byteLength,byteLength:n};return this.byteLength+=ra(n,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(i),this.json.bufferViews.length-1}},{key:"addAccessor",value:function(e,n){var i={bufferView:e,type:tm(n.size),componentType:n.componentType,count:n.count,max:n.max,min:n.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(i),this.json.accessors.length-1}},{key:"addBinaryBuffer",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{size:3},i=this.addBufferView(e),a={min:n.min,max:n.max};(!a.min||!a.max)&&(a=this._getAccessorMinMax(e,n.size));var o={size:n.size,componentType:rm(e),count:Math.round(e.length/n.size),min:a.min,max:a.max};return this.addAccessor(i,Object.assign(o,n))}},{key:"addTexture",value:function(e){var n=e.imageIndex,i={source:n};return this.json.textures=this.json.textures||[],this.json.textures.push(i),this.json.textures.length-1}},{key:"addMaterial",value:function(e){return this.json.materials=this.json.materials||[],this.json.materials.push(e),this.json.materials.length-1}},{key:"createBinaryChunk",value:function(){var e,n;this.gltf.buffers=[];var i=this.byteLength,a=new ArrayBuffer(i),o=new Uint8Array(a),s=0,u=SD(this.sourceBuffers||[]),l;try{for(u.s();!(l=u.n()).done;){var f=l.value;s=vy(f,o,s)}}catch(p){u.e(p)}finally{u.f()}(e=this.json)!==null&&e!==void 0&&(n=e.buffers)!==null&&n!==void 0&&n[0]?this.json.buffers[0].byteLength=i:this.json.buffers=[{byteLength:i}
3699],this.gltf.binary=a,this.sourceBuffers=[a]}},{key:"_removeStringFromArray",value:function(e,n){for(var i=!0;i;){var a=e.indexOf(n);a>-1?e.splice(a,1):i=!1}}},{key:"_addAttributes",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n={};for(var i in e){var a=e[i],o=this._getGltfAttributeName(i),s=this.addBinaryBuffer(a.value,a);n[o]=s}return n}},{key:"_addIndices",value:function(e){return this.addBinaryBuffer(e,{size:1})}},{key:"_getGltfAttributeName",value:function(e){switch(e.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 e}}},{key:"_getAccessorMinMax",value:function(e,n){var i={min:null,max:null};if(e.length<n)return i;i.min=[],i.max=[];var a=e.subarray(0,n),o=SD(a),s;try{for(o.s();!(s=o.n()).done;){var u=s.value;i.min.push(u),i.max.push(u)}}catch(p){o.e(p)}finally{o.f()}for(var l=n;l<e.length;l+=n)for(var f=0;f<n;f++)i.min[0+f]=Math.min(i.min[0+f],e[l+f]),i.max[0+f]=Math.max(i.max[0+f],e[l+f]);return i}}]),t}();Ge();var Xo=me(Ae()),unt=(typeof WebAssembly>
3699"u"?"undefined":ue(WebAssembly))!=="object",tae="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIA
3699LAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM+lLKFaF99GaG99FaG99GXGXAGCI9HQBAF9FQFEXGXGX9DBBB8/9DBBB+/ABCGJHG1BB+yAB1BBHE+yHI+L+TABCFJHL1BBHK+yHO+L+THN9DBBBB9gHVyAN9DBB/+hANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE86BBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG86BBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG86BBABCIJRBAFCaJHFQBSGMMAF9FQBEXGXGX9DBBB8/9DBBB+/ABCIJHG8uFB+yAB8uFBHE+yHI+L+TABCGJHL8uFBHK+yHO+L+THN9DBBBB9gHVyAN9DB/+g6ANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE87FBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG87FBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG87FBABCNJRBAFCaJHFQBMMM/SEIEaE99EaF99GXAF9FQBCBREABRIEXGXGX9D/zI818/AICKJ8uFBHLCEq+y+VHKAI8uFB+y+UHO9DB/+g6+U9DBBB8/9DBBB+/AO9DBBBB9gy+SHN+L9DBBB9P9d9FQBAN+oRVSFMCUUUU94RVMAICIJ8uFBRcAICGJ8uFBRMABALCFJCEZAEqCFWJAV87FBGXGXAKAM+y+UHN9DB/+g6+U9DBBB8/9DBBB+/AN9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRMSFMCUUUU94RMMABALCGJCEZAEqCFWJAM87FBGXGXAKAc+y+UHK9DB/+g6+U9DBBB8/9DBBB+/AK9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRcSFMCUUUU94RcMABALCaJCEZAEqCFWJAc87FBGXGX9DBBU8/AOAO+U+TANAN+U+TAKAK+U+THO9DBBBBAO9DBBBB9gy+R9DB/+g6+U9DBBB8/+SHO+L9DBBB9P9d9FQBAO+oRcSFMCUUUU94RcMABALCEZAEqCFWJAc87FBAICNJRIAECIJREAFCaJHFQBMMM9JBGXAGCGrAF9sHF9FQBEXABAB8oGBHGCNWCN91+yAGCi91CnWCUUU/8EJ+++U84GBABCIJRBAFCaJHFQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEM/lFFFaGXGXAFABqCEZ9FQBABRESFMGXGXAGCT9PQBABRESFMABREEXAEAF8oGBjGBAECIJAFCIJ8oGBjGBAECNJAFCNJ8oGBjGBAECSJAFCSJ8oGBjGBAECTJREAFCTJRFAGC9wJHGCb9LQBMMAGCI9JQBEXAEAF8oGBjGBAFCIJRFAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF2BB86BBAECFJREAFCFJRFAGCaJHGQBMMABMoFFGaGXGXABCEZ9FQBABRESFMAFCgFZC+BwsN9sRIGXGXAGCT9PQBABRESFMABREEXAEAIjGBAECSJAIjGBAECNJAIjGBAECIJAIjGBAECTJREAGC9wJHGCb9LQBMMAGCI9JQBEXAEAIjGBAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF86BBAECFJREAGCaJHGQBMMABMMMFBCUNMIT9kBB",ra
vendor: 10,663 bytes, line 3699
3699e="B9h9z9tFBBBF8dL9gBB9gLaaaaaFa9gEaaaB9gGaaB9gFaFaEQSBBFBFFGEGEGIILF9wFFFLEFBFKNFaFCx/aFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBG8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBIy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBKi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBNn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBcI9z9iqlBMc/j9JSIBTEM9+FLa8jUUUUBCTlRBCBRFEXCBRGCBREEXABCNJAGJAECUaAFAGrCFZHIy86BBAEAIJREAGCFJHGCN9HQBMAFCx+YUUBJAE86BBAFCEWCxkUUBJAB8pEN83EBAFCFJHFCUG9HQBMMkRIbaG97FaK978jUUUUBCU/KBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAG/8cBBCUoBAG9uC/wgBZHKCUGAKCUG9JyRNAECFJRKCBRVGXEXAVAF9PQFANAFAVlAVANJAF9JyRcGXGXAG9FQBAcCbJHIC9wZHMCE9sRSAMCFWRQAICIrCEJCGrRfCBRbEXAKRTCBRtGXEXGXAOATlAf9PQBCBRKSLMALCU/CBJAtAM9sJRmATAfJRKCBREGXAMCoB9JQBAOAKlC/gB9JQBCBRIEXAmAIJREGXGXGXGXGXATAICKrJ2BBHYCEZfIBFGEBMAECBDtDMIBSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMIBAKCTJRKMGXGXGXGXGXAYCGrCEZfIBFGEBMAECBDtDMITSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMITAKCTJRKMGXGXGXGXGXAYCIrCEZfIBFGEBMAECBDtDMIASEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMIAAKCTJRKMGXGXGXGXGXAYCKrfIBFGEBMAECBDtDMI8wSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCIJAnDeBJAYCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCNJAnDeBJAYCx+YUUBJ2BBJRKSFMAEAKDBBBDMI8wAKCTJRKMAICoBJREAICUFJAM9LQFAERIAOAKlC/fB9LQBMMGXAEAM9PQBAECErRIEXGXAOAKlCi9PQBCBRKSOMAmAEJRYGXGXGXGXGXATAECKrJ2BBAICKZrCEZfIBFGEBMAYCBDtDMIBSEMAYAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAYAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAYAKDBBBDMIBAKCTJRKMAICGJRIAECTJHEAM9JQBMMGXAK9FQBAKRTAtCFJHtCI6QGSFMMCBRKSEMGXAM9FQBALCUGJAbJREALAbJDBGBRnCBRYEXAEALCU/CBJAYJHIDBIBHdCFD9tAdCFDbHPD9OD9hD9RHdAIAMJDBIBHiCFD9tAiAPD9OD9hD9RHiDQBTFtGmEYIPLdKeOnH8ZAIAQJDBIBHpCFD9tApAPD9OD9hD9RHpAIASJDBIBHyCFD9tAyAPD9OD9hD9RHyDQBTFtGmEYIPLdKeOnH8cDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGEAnD9uHnDyBjGBAEAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnA8ZA8cDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnAdAiDQNiV8ZcpMyS8cQ8df8eb8fHdApAyDQNiV8ZcpMyS8cQ8df8eb8fHiDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnAdAiDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJREAYCTJHYAM9JQBMMAbCIJHbAG9JQBMMABAVAG9sJALCUGJAcAG9s/8cBBALALCUGJAcCaJAG9sJAG/8cBBMAcCBAKyAVJRVAKQBMC9+RKSFMCBC99AOAKlAGCAAGCA9Ly6yRKMALCU/KBJ8kUUUUBAKMNBT+BUUUBM+KmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUF/8MBALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM/xLGEaK978jUUUUBCAlHE8kUUUUBGXGXAGCI9HQBGXAFC98ZHI9FQBABRGCBRLEXAGAGDBBBHKCiD+rFCiD+sFD/6FHOAKCND+rFCiD+sFD/6FAOD/gFAKCTD+rFCiD+sFD/6FHND/gFD/kFD/lFHVCBDtD+2FHcAOCUUUU94DtHMD9OD9RD/kFHO9DBB/+hDYAOAOD/mFAVAVD/mFANAcANAMD9OD9RD/kFHOAOD/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHcD/kFCgFDtD9OAKCUUU94DtD9OD9QAOAND/mFAcD/kFCND+rFCU/+EDtD9OD9QAVAND/mFAcD/kFCTD+rFCUU/8ODtD9OD9QDMBBAGCTJRGALCIJHLAI9JQBMMAIAF9PQFAEAFCEZHLCGWHGqCBCTAGl/8MBAEABAICGWJHIAG/8cBBGXAL9FQBAEAEDBIBHKCiD+rFCiD+sFD/6FHOAKCND+rFCiD+sFD/6FAOD/gFAKCTD+rFCiD+sFD/6FHND/gFD/kFD/lFHVCBDtD+2FHcAOCUUUU94DtHMD9OD9RD/kFHO9DBB/+hDYAOAOD/mFAVAVD/mFANAcANAMD9OD9RD/kFHOAOD/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHcD/kFCgFDtD9OAKCUUU94DtD9OD9QAOAND/mFAcD/kFCND+rFCU/+EDtD9OD9QAVAND/mFAcD/kFCTD+rFCUU/8ODtD9OD9QDMIBMAIAEAG/8cBBSFMABAFC98ZHGT+HUUUBAGAF9PQBAEAFCEZHICEWHLJCBCAALl/8MBAEABAGCEWJHGAL/8cBBAEAIT+HUUUBAGAEAL/8cBBMAECAJ8kUUUUBM+yEGGaO97GXAF9FQBCBRGEXABCTJHEAEDBBBHICBDtHLCUU98D8cFCUU98D8cEHKD9OABDBBBHOAIDQILKOSQfbPden8c8d8e8fCggFDtD9OD/6FAOAIDQBFGENVcMTtmYi8ZpyHICTD+sFD/6FHND/gFAICTD+rFCTD+sFD/6FHVD/gFD/kFD/lFHI9DB/+g6DYAVAIALD+2FHLAVCUUUU94DtHcD9OD9RD/kFHVAVD/mFAIAID/mFANALANAcD9OD9RD/kFHIAID/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHLD/kFCTD+rFAVAND/mFALD/kFCggEDtD9OD9QHVAIAND/mFALD/kFCaDbCBDnGCBDnECBDnKCBDnOCBDncCBDnMCBDnfCBDnbD9OHIDQNVi8ZcMpySQ8c8dfb8e8fD9QDMBBABAOAKD9OAVAIDQBFTtGEmYILPdKOenD9QDMBBABCAJRBAGCIJHGAF9JQBMMM94FEa8jUUUUBCAlHE8kUUUUBABAFC98ZHIT+JUUUBGXAIAF9PQBAEAFCEZHLCEWHFJCBCAAFl/8MBAEABAICEWJHBAF/8cBBAEALT+JUUUBABAEAF/8cBBMAECAJ8kUUUUBM/hEIGaF97FaL978jUUUUBCTlRGGXAF9FQBCBREEXAGABDBBBHIABCTJHLDBBBHKDQILKOSQfbPden8c8d8e8fHOCTD+sFHNCID+rFDMIBAB9DBBU8/DY9D/zI818/DYANCEDtD9QD/6FD/nFHNAIAKDQBFGENVcMTtmYi8ZpyHICTD+rFCTD+sFD/6FD/mFHKAKD/mFANAICTD+sFD/6FD/mFHVAVD/mFANAOCTD+rFCTD+sFD/6FD/mFHOAOD/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHND/mF9DBBX9LDYHID/kFCggEDtHcD9OAVAND/mFAID/kFCTD+rFD9QHVAOAND/mFAID/kFCTD+rFAKAND/mFAID/kFAcD9OD9QHNDQBFTtGEmYILPdKOenHID8dBAGDBIBDyB+t+J83EBABCNJAID8dFAGDBIBDyF+t+J83EBALAVANDQNVi8ZcMpySQ8c8dfb8e8fHND8dBAGDBIBDyG+t+J83EBABCiJAND8dFAGDBIBDyE+t+J83EBABCAJRBAECIJHEAF9JQBMMM/3FGEaF978jUUUUBCoBlREGXAGCGrAF9sHIC98ZHL9FQBCBRGABRFEXAFAFDBBBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBAFCTJRFAGCIJHGAL9JQBMMGXALAI9PQBAEAICEZHGCGWHFqCBCoBAFl/8MBAEABALCGWJHLAF/8cBBGXAG9FQBAEAEDBIBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMIBMALAEAF/8cBBMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB",
3699nae=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),iae=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]),aae={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},oae={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};function PD(t,r,e,n,i){return nx.apply(this,arguments)}function nx(){return nx=Y(Xo.default.mark(function t(r,e,n,i,a){var o,s,u=arguments;return Xo.default.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return o=u.length>5&&u[5]!==void 0?u[5]:"NONE",f.next=3,sae();case 3:s=f.sent,fae(s,s.exports[oae[a]],r,e,n,i,s.exports[aae[o||"NONE"]]);case 5:case"end":return f.stop()}},t)})),nx.apply(this,arguments)}var rx;function sae(){return ix.apply(this,arguments)}function ix(){return ix=Y(Xo.default.mark(function t(){return Xo.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return rx||(rx=uae()),e.abrupt("return",rx);case 2:case"end":return e.stop()}},t)})),ix.apply(this,arguments)}function uae(){return ax.apply(this,arguments)}function ax(){return ax=Y(Xo.default.mark(function t(){var r,e;return Xo.default.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return r=tae,WebAssembly.validate(nae)&&(r=rae,console.log("Warning: meshopt_decoder is using experimental SIMD support")),i.next=4,WebAssembly.instantiate(lae(r),{});case 4:return e=i.sent,i.next=7,e.instance.exports.__wasm_call_ctors();case 7:return i.abrupt("return",e.instance);case 8:case"end":return i.stop()}},t)})),ax.apply(this,arguments)}function lae(t){for(var r=new Uint8Array(t.length),e=0;e<t.length;++e){var n=t.charCodeAt(e);r[e]=n>96?n-71:n>64?n-65:n>47?n+4:n>46?63:62}for(var i=0,a=0;a<t.length;++a)r[i++]=r[a]<60?iae[r[a]]:(r[a]-60)*64+r[++a];return r.buffer.slice(0,i)}function fae(t,r,e,n,i,a,o){var s=t.exports.sbrk,u=n+3&-4,l=s(u*i),f=s(a.length),p=new Uint8Array(t.exports.memory.buffer);p.set(a,f);var h=r(l,n,i,f,a.length);if(h===0&&o&&o(l,u,i),e.set(p.subarray(l,l+n*i)),s(l-s(0)),h!==0)throw new Error("Malformed buffer data: ".concat(h))}function cae(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=pae(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3700In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function pae(t,r){if(t){if(typeof t=="string")return OD(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return OD(t,r)}}function OD(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var ux="EXT_meshopt_compression",hae=ux;function dae(t,r){return ox.apply(this,arguments)}function ox(){return ox=Y(Fc.default.mark(function t(r,e){var n,i,a,o,s,u;return Fc.default.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(i=new bt(r),e!=null&&(n=e.gltf)!==null&&n!==void 0&&n.decompressMeshes){f.next=3;break}return f.abrupt("return");case 3:a=[],o=cae(r.json.bufferViews||[]);try{for(o.s();!(s=o.n()).done;)u=s.value,a.push(vae(i,u))}catch(p){o.e(p)}finally{o.f()}return f.next=8,Promise.all(a);case 8:i.removeExtension(ux);case 9:case"end":return f.stop()}},t)})),ox.apply(this,arguments)}function vae(t,r){return sx.apply(this,arguments)}function sx(){return sx=Y(Fc.default.mark(function t(r,e){var n,i,a,o,s,u,l,f,p,h,d,v,m,g;return Fc.default.wrap(function(_){for(;;)switch(_.prev=_.next){case 0:if(n=r.getObjectExtension(e,ux),!n){_.next=9;break}return i=n.byteOffset,a=i===void 0?0:i,o=n.byteLength,s=o===void 0?0:o,u=n.byteStride,l=n.count,f=n.mode,p=n.filter,h=p===void 0?"NONE":p,d=n.buffer,v=r.gltf.buffers[d],m=new Uint8Array(v.arrayBuffer,v.byteOffset+a,s),g=new Uint8Array(r.gltf.buffers[e.buffer].arrayBuffer,e.byteOffset,e.byteLength),_.next=8,PD(g,l,u,m,f,h);case 8:return _.abrupt("return",g);case 9:return _.abrupt("return",null);case 10:case"end":return _.stop()}},t)})),sx.apply(this,arguments)}var fx={};Lr(fx,{name:()=>yae,preprocess:()=>_ae});function mae(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=gae(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}
3700}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3701In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function gae(t,r){if(t){if(typeof t=="string")return ED(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return ED(t,r)}}function ED(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var zu="EXT_texture_webp",yae=zu;function _ae(t,r){var e=new bt(t);if(!g0("image/webp")){if(e.getRequiredExtensions().includes(zu))throw new Error("gltf: Required extension ".concat(zu," not supported by browser"));return}var n=e.json,i=mae(n.textures||[]),a;try{for(i.s();!(a=i.n()).done;){var o=a.value,s=e.getObjectExtension(o,zu);s&&(o.source=s.source),e.removeObjectExtension(o,zu)}}catch(u){i.e(u)}finally{i.f()}e.removeExtension(zu)}var cx={};Lr(cx,{name:()=>Aae,preprocess:()=>Sae});function bae(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=xae(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3702In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function xae(t,r){if(t){if(typeof t=="string")return CD(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return CD(t,r)}}function CD(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var nm="KHR_texture_basisu",Aae=nm;function Sae(t,r){var e=new bt(t),n=e.json,i=bae(n.textures||[]),a;try{for(i.s();!(a=i.n()).done;){var o=a.value,s=e.getObjectExtension(o,nm);s&&(o.source=s.source),e.removeObjectExtension(o,nm)}}catch(u){i.e(u)}finally{i.f()}e.removeExtension(nm)}var xx={};Lr(xx,{decode:()=>qae,encode:()=>Yae,name:()=>$ae,preprocess:()=>Xae});be();k();var qo=me(Ae());k();var vx=me(Ae());Ge();var MD="3.4.13";var Tae={draco:{decoderType:(typeof WebAssembly>
3702"u"?"undefined":ue(WebAssembly))==="object"?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}},ID={name:"Draco",id:cr?"draco":"draco-nodejs",module:"draco",shapes:["mesh"],version:MD,worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:Tae};be();k();F();j();k();function LD(t,r,e){var n=kD(r.metadata),i=[],a=wae(r.attributes);for(var o in t){var s=t[o],u=RD(o,s,a[o]);i.push(u)}if(e){var l=RD("indices",e);i.push(l)}return new Ic(i,n)}function wae(t){var r={};for(var e in t){var n=t[e];r[n.name||"undefined"]=n}return r}function RD(t,r,e){var n=e?kD(e.metadata):void 0,i=N1(t,r,n);return i}function kD(t){var r=new Map;for(var e in t)r.set("".concat(e,".string"),JSON.stringify(t[e]));return r}function Pae(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=Oae(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3703In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function Oae(t,r){if(t){if(typeof t=="string")return BD(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return BD(t,r)}}function BD(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function FD(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function DD(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?FD(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):FD(Object(e)).forEac
3703h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var ND={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},Eae={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},Cae=4,jD=function(){function t(r){A(this,t),c(this,"draco",void 0),c(this,"decoder",void 0),c(this,"metadataQuerier",void 0),this.draco=r,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}return T(t,[{key:"destroy",value:function(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}},{key:"parseSync",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=new this.draco.DecoderBuffer;i.Init(new Int8Array(e),e.byteLength),this._disableAttributeTransforms(n);var a=this.decoder.GetEncodedGeometryType(i),o=a===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{var s;switch(a){case this.draco.TRIANGULAR_MESH:s=this.decoder.DecodeBufferToMesh(i,o);break;case this.draco.POINT_CLOUD:s=this.decoder.DecodeBufferToPointCloud(i,o);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!s.ok()||!o.ptr){var u="DRACO decompression failed: ".concat(s.error_msg());throw new Error(u)}var l=this._getDracoLoaderData(o,a,n),f=this._getMeshData(o,l,n),p=Ui(f.attributes),h=LD(f.attributes,l,f.indices),d=DD(DD({loader:"draco",loaderData:l,header:{vertexCount:o.num_points(),boundingBox:p}},f),{},{schema:h});return d}finally{this.draco.destroy(i),o&&this.draco.destroy(o)}}},{key:"_getDracoLoaderData",value:function(e,n,i){var a=this._getTopLevelMetadata(e),o=this._getDracoAttributes(e,i);return{geometry_type:n,num_attributes:e.num_attributes(),num_points:e.num_points(),num_faces:e instanceof this.draco.Mesh?e.num_faces():0,metadata:a,attributes:o}}},{key:"_getDracoAttributes",value:function(e,n){for(var i={},a=0;a<e.num_attributes();a++){var o=this.decoder.GetAttribute(e,a),s=this._getAttributeMetadata(e,a);i[o.unique_id()]={unique_id:o.unique_id(),attribute_type:o.attribute_type(),data_type:o.data_type(),num_components:o.num_components(),byte_offset:o.byte_offset(),byte_stride:o.byte_stride(),normalized:o.normalized(),attribute_index:a,metadata:s};var u=this._getQuantizationTransform(o,n);u&&(i[o.unique_id()].quantization_transform=u);var l=this._getOctahedronTransform(o,n);l&&(i[o.unique_id()].octahedron_transform=l)}return i}},{key:"_getMeshData",value:function(e,n,i){var a=this._getMeshAttributes(n,e,i),o=a.POSITION;if(!o)throw new Error("DRACO: No position attribute found.");if(e instanceof this.draco.Mesh)switch(i.topology){case"triangle-strip":return{topology:"triangle-strip",mode:4,attributes:a,indices:{value:this._getTriangleStripIndices(e),size:1}};case"triangle-list":default:return{topology:"triangle-list",mode:5,attributes:a,indices:{value:this._getTriangleListIndices(e),size:1}}}return{topology:"point-list",mode:0,attributes:a}}},{key:"_getMeshAttributes",value:function(e,n,i){for(var a={},o=0,s=Object.values(e.attributes);o<s.length;o++){var u=s[o],l=this._deduceAttributeName(u,i);u.name=l;var f=this._getAttributeValues(n,u),p=f.value,h=f.size;a[l]={value:p,size:h,byteOffset:u.byte_offset,byteStride:u.byte_stride,normalized:u.normalized}}return a}},{key:"_getTriangleListIndices",value:function(e){var n=e.num_faces(),i=n*3,a=i*Cae,o=this.draco._malloc(a);try{return this.decoder.GetTrianglesUInt32Array(e,a,o),new Uint32Array(this.draco.HEAPF32.buffer,o,i).slice()}finally{this.draco._free(o)}}},{key:"_getTriangleStripIndices",value:function(e){var n=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(e,n),Rae(n)}finally{this.draco.destroy(n)}}},{key:"_getAttributeValues",value:function(e,n){var i=Eae[n.data_type],a=n.num_components,o=e.num_points(),s=o*a,u=s*i.BYTES_PER_ELEMENT,l=Mae(this.draco,i),f,p=this.draco._malloc(u);try{var h=this.decoder.GetAttribute(e,n.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(e,h,l,u,p),f=new i(this.draco.HEAPF32.buffer,p,s).slice()}finally{this.draco._free(p)}return{value:f,size:a}}},{key:"_deduceAttributeName",value:function(e,n){for(var i=e.unique_id,a=0,o=Object.entries(n.extraAttributes||{});a<o.length;a++){var s=W(o[a],2),u=s[0],l=s[1];if(l===i)return u}var f=e.attribute_type;for(var p in ND){var h=this.draco[p];if(h===f)return ND[p]}var d=n.attributeNameEntry||"name";return e.metadata[d]?e.metadata[d].string:"CUSTOM_ATTRIBUTE_".concat(i)}},{key:"_getTopLevelMetadata",value:function(e){var n=this.decoder.GetMetadata(e);return this._getDracoMetadata(n)}},{key:"_getAttributeMetadata",value:function(e,n){var i=this.decoder.GetAttributeMetadata(e,n);return this._getDracoMetadata(i)}},{key:"_getDracoMetadata",value:function(e){if(!e||!e.ptr)return{};for(var n={},i=this.metadataQuerier.NumEntries(e),a=0;a<i;a++){var o=this.metadataQuerier.GetEntryName(e,a);n[o]=this._getDracoMetadataField(e,o)}return n}},{key:"_getDracoMetadataField",value:function(e,n){var i=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(e,n,i);var a=Iae(i);return{int:this.metadataQuerier.GetIntEntry(e,n),string:this.metadataQuerier.GetStringEntry(e,n),double:this.metadataQuerier.GetDoubleEntry(e,n),intArray:a}}finally{this.draco.destroy(i)}}},{key:"_disableAttributeTransforms",value:function(e){var n=e.quantizedAttributes,i=n===void 0?[]:n,a=e.octahedronAttributes,o=a===void 0?[]:a,s=[].concat(ae(i),ae(o
3703)),u=Pae(s),l;try{for(u.s();!(l=u.n()).done;){var f=l.value;this.decoder.SkipAttributeTransform(this.draco[f])}}catch(p){u.e(p)}finally{u.f()}}},{key:"_getQuantizationTransform",value:function(e,n){var i=this,a=n.quantizedAttributes,o=a===void 0?[]:a,s=e.attribute_type(),u=o.map(function(f){return i.decoder[f]}).includes(s);if(u){var l=new this.draco.AttributeQuantizationTransform;try{if(l.InitFromAttribute(e))return{quantization_bits:l.quantization_bits(),range:l.range(),min_values:new Float32Array([1,2,3]).map(function(f){return l.min_value(f)})}}finally{this.draco.destroy(l)}}return null}},{key:"_getOctahedronTransform",value:function(e,n){var i=this,a=n.octahedronAttributes,o=a===void 0?[]:a,s=e.attribute_type(),u=o.map(function(f){return i.decoder[f]}).includes(s);if(u){var l=new this.draco.AttributeQuantizationTransform;try{if(l.InitFromAttribute(e))return{quantization_bits:l.quantization_bits()}}finally{this.draco.destroy(l)}}return null}}]),t}();function Mae(t,r){switch(r){case Float32Array:return t.DT_FLOAT32;case Int8Array:return t.DT_INT8;case Int16Array:return t.DT_INT16;case Int32Array:return t.DT_INT32;case Uint8Array:return t.DT_UINT8;case Uint16Array:return t.DT_UINT16;case Uint32Array:return t.DT_UINT32;default:return t.DT_INVALID}}function Iae(t){for(var r=t.size(),e=new Int32Array(r),n=0;n<r;n++)e[n]=t.GetValue(n);return e}function Rae(t){for(var r=t.size(),e=new Int32Array(r),n=0;n<r;n++)e[n]=t.GetValue(n);return e}be();k();var Nc=me(Ae());function UD(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function GD(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?UD(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):UD(Object(e)).forEac
3703h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var Lae="1.5.5",kae="1.4.1",dx="https://www.gstatic.com/draco/versioned/decoders/".concat(Lae),Bae="".concat(dx,"/draco_decoder.js"),Fae="".concat(dx,"/draco_wasm_wrapper.js"),Dae="".concat(dx,"/draco_decoder.wasm"),Dnt="https://raw.githubusercontent.com/google/draco/".concat(kae,"/javascript/draco_encoder.js"),Dc;function zD(t){return px.apply(this,arguments)}function px(){return px=Y(Nc.default.mark(function t(r){var e;return Nc.default.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return e=r.modules||{},e.draco3d?Dc=Dc||e.draco3d.createDecoderModule({}).then(function(a){return{draco:a}}):Dc=Dc||Nae(r),i.next=4,Dc;case 4:return i.abrupt("return",i.sent);case 5:case"end":return i.stop()}},t)})),px.apply(this,arguments)}function Nae(t){return hx.apply(this,arguments)}function hx(){return hx=Y(Nc.default.mark(function t(r){var e,n,i,a;return Nc.default.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:s.t0=r.draco&&r.draco.decoderType,s.next=s.t0==="js"?3:(s.t0==="wasm",7);break;case 3:return s.next=5,Fn(Bae,"draco",r);case 5:return e=s.sent,s.abrupt("break",21);case 7:return s.t1=Promise,s.next=10,Fn(Fae,"draco",r);case 10:return s.t2=s.sent,s.next=13,Fn(Dae,"draco",r);case 13:return s.t3=s.sent,s.t4=[s.t2,s.t3],s.next=17,s.t1.all.call(s.t1,s.t4);case 17:i=s.sent,a=W(i,2),e=a[0],n=a[1];case 21:return e=e||globalThis.DracoDecoderModule,s.next=24,jae(e,n);case 24:return s.abrupt("return",s.sent);case 25:case"end":return s.stop()}},t)})),hx.apply(this,arguments)}function jae(t,r){var e={};return r&&(e.wasmBinary=r),new Promise(function(n){t(GD(GD({},e),{},{onModuleLoaded:function(a){return n({draco:a})}}))})}function VD(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function HD(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?VD(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):VD(Object(e)).forEac
3703h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var im=HD(HD({},ID),{},{parse:Uae});function Uae(t,r){return mx.apply(this,arguments)}function mx(){return mx=Y(vx.default.mark(function t(r,e){var n,i,a;return vx.default.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,zD(e);case 2:return n=s.sent,i=n.draco,a=new jD(i),s.prev=5,s.abrupt("return",a.parseSync(r,e?.draco));case 7:return s.prev=7,a.destroy(),s.finish(7);case 10:case"end":return s.stop()}},t,null,[[5,,7,10]])})),mx.apply(this,arguments)}function WD(t){var r={};for(var e in t){var n=t[e];if(e!=="indices"){var i=gx(n);r[e]=i}}return r}function gx(t){var r=Gae(t),e=r.buffer,n=r.size,i=r.count,a={value:e,size:n,byteOffset:0,count:i,type:tm(n),componentType:rm(e)};return a}function Gae(t){var r=t,e=1,n=0;return t&&t.value&&(r=t.value,e=t.size||1),r&&(ArrayBuffer.isView(r)||(r=zae(r,Float32Array)),n=r.length/e),{buffer:r,size:e,count:n}}function zae(t,r){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return t?Array.isArray(t)?new r(t):e&&!(t instanceof r)?new r(t):t:null}function $D(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function Vae(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?$D(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):$D(Object(e)).forEac
3703h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var Hae=qo.default.mark(bx);function jc(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=Wae(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3704In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function Wae(t,r){if(t){if(typeof t=="string")return XD(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return XD(t,r)}}function XD(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var Yo="KHR_draco_mesh_compression",$ae=Yo;function Xae(t,r,e){var n=new bt(t),i=jc(bx(n)),a;try{for(i.s();!(a=i.n()).done;){var o=a.value;n.getObjectExtension(o,Yo)}}catch(s){i.e(s)}finally{i.f()}}function qae(t,r,e){return yx.apply(this,arguments)}function yx(){return yx=Y(qo.default.mark(function t(r,e,n){var i,a,o,s,u,l;return qo.default.wrap(function(p){for(;;)switch(p.prev=p.next){case 0:if(e!=null&&(i=e.gltf)!==null&&i!==void 0&&i.decompressMeshes){p.next=2;break}return p.abrupt("return");case 2:a=new bt(r),o=[],s=jc(bx(a));try{for(s.s();!(u=s.n()).done;)l=u.value,a.getObjectExtension(l,Yo)&&o.push(Kae(a,l,e,n))}catch(h){s.e(h)}finally{s.f()}return p.next=8,Promise.all(o);case 8:a.removeExtension(Yo);case 9:case"end":return p.stop()}},t)})),yx.apply(this,arguments)}function Yae(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=new bt(t),n=jc(e.json.meshes||[]),i;try{for(n.s();!(i=n.n()).done;){var a=i.value;Zae(a,r),e.addRequiredExtension(Yo)}}catch(o){n.e(o)}finally{n.f()}}function Kae(t,r,e,n){return _x.apply(this,arguments)}function _x(){return _x=Y(qo.default.mark(function t(r,e,n,i){var a,o,s,u,l,f,p,h,d,v,m,g,y,_;return qo.default.wrap(function(x){for(;;)switch(x.prev=x.next){case 0:if(a=r.getObjectExtension(e,Yo),a){x.next=3;break}return x.abrupt("return");case 3:return o=r.getTypedArrayForBufferView(a.bufferView),s=Qa(o.buffer,o.byteOffset),u=i.parse,l=Vae({},n),delete l["3d-tiles"],x.next=10,u(s,im,l,i);case 10:for(f=x.sent,p=WD(f.attributes),h=0,d=Object.entries(p);h<d.length;h++)v=W(d[h],2),m=v[0],g=v[1],m in e.attributes&&(y=e.attributes[m],_=r.getAccessor(y),_!=null&&_.min&&_!==null&&_!==void 0&&_.max&&(g.min=_.min,g.max=_.max));e.attributes=p,f.indices&&(e.indices=gx(f.indices)),Jae(e);case 16:case"end":return x.stop()}},t)})),_x.apply(this,arguments)}function Zae(t,r){var e,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:4,i=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0;if(!i.DracoWriter)throw new Error("options.gltf.DracoWriter not provided");var o=i.DracoWriter.encodeSync({attributes:t}),s=a==null||(e=a.parseSync)===null||e===void 0?void 0:e.call(a,{attributes:t}),u=i._addFauxAttributes(s.attributes),l=i.addBufferView(o),f={primitives:[{attributes:u,mode:n,extensions:c({},Yo,{bufferView:l,attributes:u})}]};return f}function Jae(t){if(!t.attributes&&Object.keys(t.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function bx(t){var r,e,n,i,a,o;return qo.default.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:r=jc(t.json.meshes||[]),u.prev=1,r.s();case 3:if((e=r.n()).done){u.next=24;break}n=e.value,i=jc(n.primitives),u.prev=6,i.s();case 8:if((a=i.n()).done){u.next=14;break}return o=a.value,u.next=12,o;case 12:u.next=8;break;case 14:u.next=19;break;case 16:u.prev=16,u.t0=u.catch(6),i.e(u.t0);case 19:return u.prev=19,i.f(),u.finish(19);case 22:u.next=3;break;case 24:u.next=29;break;case 26:u.prev=26,u.t1=u.catch(1),r.e(u.t1);case 29:return u.prev=29,r.f(),u.finish(29);case 32:case"end":return u.stop()}},Hae,null,[[1,26,29,32],[6,16,19,22]])}var wx={};Lr(wx,{decode:()=>noe,name:()=>eoe});be();var Ax=me(Ae());var qD={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},YD={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4};function KD(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=Qae(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}
3704}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3705In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function Qae(t,r){if(t){if(typeof t=="string")return ZD(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return ZD(t,r)}}function ZD(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var Tx="KHR_texture_transform",eoe=Tx,am=new z,toe=new at,roe=new at;function noe(t,r){return Sx.apply(this,arguments)}function Sx(){return Sx=Y(Ax.default.mark(function t(r,e){var n,i,a,o;return Ax.default.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(n=new bt(r),i=n.getExtension(Tx),i){u.next=4;break}return u.abrupt("return");case 4:for(a=r.json.materials||[],o=0;o<a.length;o++)ioe(o,r);case 6:case"end":return u.stop()}},t)})),Sx.apply(this,arguments)}function ioe(t,r){var e,n,i,a=[],o=(e=r.json.materials)===null||e===void 0?void 0:e[t],s=o==null||(n=o.pbrMetallicRoughness)===null||n===void 0?void 0:n.baseColorTexture;s&&Uc(r,t,s,a);var u=o?.emissiveTexture;u&&Uc(r,t,u,a);var l=o?.normalTexture;l&&Uc(r,t,l,a);var f=o?.occlusionTexture;f&&Uc(r,t,f,a);var p=o==null||(i=o.pbrMetallicRoughness)===null||i===void 0?void 0:i.metallicRoughnessTexture;p&&Uc(r,t,p,a)}function Uc(t,r,e,n){var i=aoe(e,n);if(i){var a=t.json.meshes||[],o=KD(a),s;try{for(o.s();!(s=o.n()).done;){var u=s.value,l=KD(u.primitives),f;try{for(l.s();!(f=l.n()).done;){var p=f.value,h=p.material;Number.isFinite(h)&&r===h&&ooe(t,p,i)}}catch(d){l.e(d)}finally{l.f()}}}catch(d){o.e(d)}finally{o.f()}}}function aoe(t,r){var e,n=(e=t.extensions)===null||e===void 0?void 0:e[Tx],i=t.texCoord,a=i===void 0?0:i,o=n.texCoord,s=o===void 0?a:o,u=r.findIndex(function(f){var p=W(f,2),h=p[0],d=p[1];return h===a&&d===s})!==-1;if(!u){var l=loe(n);return a!==s&&(t.texCoord=s),r.push([a,s]),{originalTexCoord:a,texCoord:s,matrix:l}}return null}function ooe(t,r,e){var n=e.originalTexCoord,i=e.texCoord,a=e.matrix,o=r.attributes["TEXCOORD_".concat(n)];if(Number.isFinite(o)){var s,u=(s=t.json.accessors)===null||s===void 0?void 0:s[o];if(u&&u.bufferView){var l,f=(l=t.json.bufferViews)===null||l===void 0?void 0:l[u.bufferView];if(f){for(var p=t.buffers[f.buffer],h=p.arrayBuffer,d=p.byteOffset,v=(d||0)+(u.byteOffset||0)+(f.byteOffset||0),m=Gu(u,f),g=m.ArrayType,y=m.length,_=YD[u.componentType],b=qD[u.type],x=f.byteStride||_*b,w=new Float32Array(y),P=0;P<u.count;P++){var E=new g(h,v+P*x,2);am.set(E[0],E[1],1),am.transformByMatrix3(a),w.set([am[0],am[1]],P*b)}n===i?soe(u,f,t.buffers,w):uoe(i,u,r,t,w)}}}}function soe(t,r,e,n){t.componentType=5126,e.push({arrayBuffer:n.buffer,byteOffset:0,byteLength:n.buffer.byteLength}),r.buffer=e.length-1,r.byteLength=n.buffer.byteLength,r.byteOffset=0,delete r.byteStride}function uoe(t,r,e,n,i){n.buffers.push({arrayBuffer:i.buffer,byteOffset:0,byteLength:i.buffer.byteLength});var a=n.json.bufferViews;if(a){a.push({buffer:n.buffers.length-1,byteLength:i.buffer.byteLength,byteOffset:0});var o=n.json.accessors;o&&(o.push({bufferView:a?.length-1,byteOffset:0,componentType:5126,count:r.count,type:"VEC2"}),e.attributes["TEXCOORD_".concat(t)]=o.length-1)}}function loe(t){var r=t.offset,e=r===void 0?[0,0]:r,n=t.rotation,i=n===void 0?0:n,a=t.scale,o=a===void 0?[1,1]:a,s=new at().set(1,0,0,0,1,0,e[0],e[1],1),u=toe.set(Math.cos(i),Math.sin(i),0,-Math.sin(i),Math.cos(i),0,0,0,1),l=roe.set(o[0],0,0,0,o[1],0,0,0,1);return s.multiplyRight(u).multiplyRight(l)}var Ex={};Lr(Ex,{decode:()=>poe,encode:()=>hoe,name:()=>coe});var Gc=me(Ae());function QD(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=foe(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}
3705}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3706In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function foe(t,r){if(t){if(typeof t=="string")return JD(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return JD(t,r)}}function JD(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var Ko="KHR_lights_punctual",coe=Ko;function poe(t){return Px.apply(this,arguments)}function Px(){return Px=Y(Gc.default.mark(function t(r){var e,n,i,a,o,s,u;return Gc.default.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:e=new bt(r),n=e.json,i=e.getExtension(Ko),i&&(e.json.lights=i.lights,e.removeExtension(Ko)),a=QD(n.nodes||[]);try{for(a.s();!(o=a.n()).done;)s=o.value,u=e.getObjectExtension(s,Ko),u&&(s.light=u.light),e.removeObjectExtension(s,Ko)}catch(p){a.e(p)}finally{a.f()}case 6:case"end":return f.stop()}},t)})),Px.apply(this,arguments)}function hoe(t){return Ox.apply(this,arguments)}function Ox(){return Ox=Y(Gc.default.mark(function t(r){var e,n,i,a,o,s,u;return Gc.default.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(e=new bt(r),n=e.json,n.lights&&(i=e.addExtension(Ko),Vt(!i.lights),i.lights=n.lights,delete n.lights),e.json.lights){a=QD(e.json.lights);try{for(a.s();!(o=a.n()).done;)s=o.value,u=s.node,e.addObjectExtension(u,Ko,s)}catch(p){a.e(p)}finally{a.f()}delete e.json.lights}case 4:case"end":return f.stop()}},t)})),Ox.apply(this,arguments)}var Ix={};Lr(Ix,{decode:()=>moe,encode:()=>goe,name:()=>voe});var Cx=me(Ae());function tN(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=doe(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3707In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function doe(t,r){if(t){if(typeof t=="string")return eN(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return eN(t,r)}}function eN(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var zc="KHR_materials_unlit",voe=zc;function moe(t){return Mx.apply(this,arguments)}function Mx(){return Mx=Y(Cx.default.mark(function t(r){var e,n,i,a,o,s;return Cx.default.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:e=new bt(r),n=e.json,i=tN(n.materials||[]);try{for(i.s();!(a=i.n()).done;)o=a.value,s=o.extensions&&o.extensions.KHR_materials_unlit,s&&(o.unlit=!0),e.removeObjectExtension(o,zc)}catch(f){i.e(f)}finally{i.f()}e.removeExtension(zc);case 5:case"end":return l.stop()}},t)})),Mx.apply(this,arguments)}function goe(t){var r=new bt(t),e=r.json;if(r.materials){var n=tN(e.materials||[]),i;try{for(n.s();!(i=n.n()).done;){var a=i.value;a.unlit&&(delete a.unlit,r.addObjectExtension(a,zc,{}),r.addExtension(zc))}}catch(o){n.e(o)}finally{n.f()}}}var kx={};Lr(kx,{decode:()=>xoe,encode:()=>Aoe,name:()=>boe});Ge();var Hc=me(Ae());function yoe(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=_oe(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3708In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function _oe(t,r){if(t){if(typeof t=="string")return rN(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);
3708if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return rN(t,r)}}function rN(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var Vc="KHR_techniques_webgl",boe=Vc;function xoe(t){return Rx.apply(this,arguments)}function Rx(){return Rx=Y(Hc.default.mark(function t(r){var e,n,i,a,o,s,u,l;return Hc.default.wrap(function(p){for(;;)switch(p.prev=p.next){case 0:if(e=new bt(r),n=e.json,i=e.getExtension(Vc),i){a=Soe(i,e),o=yoe(n.materials||[]);try{for(o.s();!(s=o.n()).done;)u=s.value,l=e.getObjectExtension(u,Vc),l&&(u.technique=Object.assign({},l,a[l.technique]),u.technique.values=Toe(u.technique,e)),e.removeObjectExtension(u,Vc)}catch(h){o.e(h)}finally{o.f()}e.removeExtension(Vc)}case 4:case"end":return p.stop()}},t)})),Rx.apply(this,arguments)}function Aoe(t,r){return Lx.apply(this,arguments)}function Lx(){return Lx=Y(Hc.default.mark(function t(r,e){return Hc.default.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:case"end":return i.stop()}},t)})),Lx.apply(this,arguments)}function Soe(t,r){var e=t.programs,n=e===void 0?[]:e,i=t.shaders,a=i===void 0?[]:i,o=t.techniques,s=o===void 0?[]:o,u=new TextDecoder;return a.forEach(function(l){if(Number.isFinite(l.bufferView))l.code=u.decode(r.getTypedArrayForBufferView(l.bufferView));else throw new Error("KHR_techniques_webgl: no shader code")}),n.forEach(function(l){l.fragmentShader=a[l.fragmentShader],l.vertexShader=a[l.vertexShader]}),s.forEach(function(l){l.program=n[l.program]}),s}function Toe(t,r){var e=Object.assign({},t.values);return Object.keys(t.uniforms||{}).forEach(function(n){t.uniforms[n].value&&!(n in e)&&(e[n]=t.uniforms[n].value)}),Object.keys(e).forEach(function(n){ue(e[n])==="object"&&e[n].index!==void 0&&(e[n].texture=r.getTexture(e[n].index))}),e}var Dx={};Lr(Dx,{decode:()=>Poe,name:()=>woe});var Bx=me(Ae());var nN="EXT_feature_metadata",woe=nN;function Poe(t){return Fx.apply(this,arguments)}function Fx(){return Fx=Y(Bx.default.mark(function t(r){var e;return Bx.default.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:e=new bt(r),Ooe(e);case 2:case"end":return i.stop()}},t)})),Fx.apply(this,arguments)}function Ooe(t){var r,e=t.getExtension(nN),n=e==null||(r=e.schema)===null||r===void 0?void 0:r.classes,i=e?.featureTables,a=e?.featureTextures;if(a&&console.warn('featureTextures is not yet supported in the "EXT_feature_metadata" extension.'),n&&i)for(var o in n){var s=n[o],u=Moe(i,o);u&&Eoe(t,u,s)}}function Eoe(t,r,e){for(var n in e.properties){var i,a=e.properties[n],o=r==null||(i=r.properties)===null||i===void 0?void 0:i[n],s=r.count;if(o){var u=Coe(t,a,s,o);o.data=u}}}function Coe(t,r,e,n){var i=n.bufferView,a=t.getTypedArrayForBufferView(i);switch(r.type){case"STRING":{var o=n.stringOffsetBufferView,s=t.getTypedArrayForBufferView(o);a=Ioe(a,s,e);break}default:}return a}function Moe(t,r){for(var e in t){var n=t[e];if(n.class===r)return n}return null}function Ioe(t,r,e){for(var n=[],i=new TextDecoder("utf8"),a=0,o=4,s=0;s<e;s++){var u=r[(s+1)*o]-r[s*o],l=t.subarray(a,u+a),f=i.decode(l);n.push(f),a+=u}return n}function aN(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=Roe(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3709In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function Roe(t,r){if(t){if(typeof t=="string")return iN(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return iN(t,r)}}function iN(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var oN=[lx,fx,cx,xx,Ex,Ix,kx,wx,Dx];function sN(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=arguments.length>2?arguments[2]:void 0,n=oN.filter(function(u){return lN(u.name,r)}),i=aN(n),a;try{for(i.s();!(a=i.n()).done;){var o=a.value,s;(s=o.preprocess)===null||s===void 0||s.call(o,t,r,e)}}catch(u){i.e(u)}finally{i.f()}}function uN(t){return jx.apply(this,arguments)}function jx(){return jx=Y(Nx.default.mark(function t(r){var e,n,i,a,o,s,u,l=arguments;return Nx.default.wrap(function(p){for(;;)switch(p.prev=p.next){case 0:e=l.length>1&&l[1]!==void 0?l[1]:{},n=l.length>2?l[2]:void 0,i=oN.filter(function(h){return lN(h.name,e)}),a=aN(i),p.prev=4,a.s();case 6:if((o=a.n()).done){p.next=12;break}return s=o.value,p.next=10,(u=s.decode)===null||u===void 0?void 0:u.call(s,r,e,n);case 10:p.next=6;break;case 12:p.next=17;break;case 14:p.prev=14,p.t0=p.catch(4),a.e(p.t0);case 17:return p.prev=17,a.f(),p.finish(17);case 20:case"end":return p.stop()}},t,null,[[4,14,17,20]])})),jx.apply(this,arguments)}function lN(t,r){var e,n=(r==null||(e=r.gltf)===null||e===void 0?void 0:e.excludeExtensions)||{},i=t in n&&!n[t];return!i}F();j();k();function Loe(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=koe(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}
3709}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3710In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function koe(t,r){if(t){if(typeof t=="string")return fN(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return fN(t,r)}}function fN(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var Ux="KHR_binary_glTF";function cN(t){var r=new bt(t),e=r.json,n=Loe(e.images||[]),i;try{for(n.s();!(i=n.n()).done;){var a=i.value,o=r.getObjectExtension(a,Ux);o&&Object.assign(a,o),r.removeObjectExtension(a,Ux)}}catch(s){n.e(s)}finally{n.f()}e.buffers&&e.buffers[0]&&delete e.buffers[0].uri,r.removeExtension(Ux)}function Ba(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=Foe(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3711In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function Foe(t,r){if(t){if(typeof t=="string")return pN(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return pN(t,r)}}function pN(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var hN={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},Doe={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"},Noe=function(){function t(){A(this,t),c(this,"idToIndexMap",{animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}}),c(this,"json",void 0)}return T(t,[{key:"normalize",value:function(e,n){this.json=e.json;var i=e.json;switch(i.asset&&i.asset.version){case"2.0":return;case void 0:case"1.0":break;default:console.warn("glTF: Unknown version ".concat(i.asset.version));return}if(!n.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(i),this._convertTopLevelObjectsToArrays(i),cN(e),this._convertObjectIdsToArrayIndices(i),this._updateObjects(i),this._updateMaterial(i)}},{key:"_addAsset",value:function(e){e.asset=e.asset||{},e.asset.version="2.0",e.asset.generator=e.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}},{key:"_convertTopLevelObjectsToArrays",value:function(e){for(var n in hN)this._convertTopLevelObjectToArray(e,n)}},{key:"_convertTopLevelObjectToArray",value:function(e,n){var i=e[n];if(!(!i||Array.isArray(i))){e[n]=[];for(var a in i){var o=i[a];o.id=o.id||a;var s=e[n].length;e[n].push(o),this.idToIndexMap[n][a]=s}}}},{key:"_convertObjectIdsToArrayIndices",value:function(e){for(var n in hN)this._convertIdsToIndices(e,n);"scene"in e&&(e.scene=this._convertIdToIndex(e.scene,"scene"));var i=Ba(e.textures),a;try{for(i.s();!(a=i.n()).done;){var o=a.value;this._convertTextureIds(o)}}catch(g){i.e(g)}finally{i.f()}var s=Ba(e.meshes),u;try{for(s.s();!(u=s.n()).done;){var l=u.value;this._convertMeshIds(l)}}catch(g){s.e(g)}finally{s.f()}var f=Ba(e.nodes),p;try{for(f.s();!(p=f.n()).done;){var h=p.value;this._convertNodeIds(h)}}catch(g){f.e(g)}finally{f.f()}var d=Ba(e.scenes),v;try{for(d.s();!(v=d.n()).done;){var m=v.value;this._convertSceneIds(m)}}catch(g){d.e(g)}finally{d.f()}}},{key:"_convertTextureIds",value:function(e){e.source&&(e.source=this._convertIdToIndex(e.source,"image"))}},{key:"_convertMeshIds",value:function(e){var n=Ba(e.primitives),i;try{for(n.s();!(i=n.n()).done;){var a=i.value,o=a.attributes,s=a.indices,u=a.material;for(var l in o)o[l]=this._convertIdToIndex(o[l],"accessor");s&&(a.indices=this._convertIdToIndex(s,"accessor")),u&&(a.material=this._convertIdToIndex(u,"material"))}}catch(f){n.e(f)}finally{n.f()}}},{key:"_convertNodeIds",value:function(e){var n=this;e.children&&(e.children=e.children.map(function(i){return n._convertIdToIndex(i,"node")})),e.meshes&&(e.meshes=e.meshes.map(function(i){return n._convertIdToIndex(i,"mesh")}))}},{key:"_convertSceneIds",value:function(e){var n=this;e.nodes&&(e.nodes=e.nodes.map(function(i){return n._convertIdToIndex(i,"node")}))}},{key:"_convertIdsToIndices",value:function(e,n){e[n]||(console.warn("gltf v1: json doesn't contain attribute ".concat(n)),e[n]=[]);var i=Ba(e[n]),a;try{for(i.s();!(a=i.n()).done;){var o=a.value;for(var s in o){var u=o[s],l=this._convertIdToIndex(u,s);o[s]=l}}}catch(f){i.e(f)}finally{i.f()}}},{key:"_convertIdToIndex",value:function(e,n){var i=Doe[n];if(i in this.idToIndexMap){var a=this.idToIndexMap[i][e];if(!Number.isFinite(a))throw new Error("gltf v1: failed to resolve ".concat(n," with i
3711d ").concat(e));return a}return e}},{key:"_updateObjects",value:function(e){var n=Ba(this.json.buffers),i;try{for(n.s();!(i=n.n()).done;){var a=i.value;delete a.type}}catch(o){n.e(o)}finally{n.f()}}},{key:"_updateMaterial",value:function(e){var n=Ba(e.materials),i;try{var a=function(){var f=i.value;f.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};var p=((o=f.values)===null||o===void 0?void 0:o.tex)||((s=f.values)===null||s===void 0?void 0:s.texture2d_0)||((u=f.values)===null||u===void 0?void 0:u.diffuseTex),h=e.textures.findIndex(function(d){return d.id===p});h!==-1&&(f.pbrMetallicRoughness.baseColorTexture={index:h})};for(n.s();!(i=n.n()).done;){var o,s,u;a()}}catch(l){n.e(l)}finally{n.f()}}}]),t}();function dN(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return new Noe().normalize(t,r)}Ge();F();j();k();k();var Vu;function vN(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function Vi(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?vN(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):vN(Object(e)).forEac
3711h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var joe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Uoe={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},nn={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},Goe={magFilter:nn.TEXTURE_MAG_FILTER,minFilter:nn.TEXTURE_MIN_FILTER,wrapS:nn.TEXTURE_WRAP_S,wrapT:nn.TEXTURE_WRAP_T},zoe=(Vu={},c(Vu,nn.TEXTURE_MAG_FILTER,nn.LINEAR),c(Vu,nn.TEXTURE_MIN_FILTER,nn.NEAREST_MIPMAP_LINEAR),c(Vu,nn.TEXTURE_WRAP_S,nn.REPEAT),c(Vu,nn.TEXTURE_WRAP_T,nn.REPEAT),Vu);function Voe(t){return Uoe[t]}function Hoe(t){return joe[t]}var Woe=function(){function t(){A(this,t),c(this,"baseUri",""),c(this,"json",{}),c(this,"buffers",[]),c(this,"images",[])}return T(t,[{key:"postProcess",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=e.json,a=e.buffers,o=a===void 0?[]:a,s=e.images,u=s===void 0?[]:s,l=e.baseUri,f=l===void 0?"":l;return Vt(i),this.baseUri=f,this.json=i,this.buffers=o,this.images=u,this._resolveTree(this.json,n),this.json}},{key:"_resolveTree",value:function(e){var n=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};e.bufferViews&&(e.bufferViews=e.bufferViews.map(function(a,o){return n._resolveBufferView(a,o)})),e.images&&(e.images=e.images.map(function(a,o){return n._resolveImage(a,o)})),e.samplers&&(e.samplers=e.samplers.map(function(a,o){return n._resolveSampler(a,o)})),e.textures&&(e.textures=e.textures.map(function(a,o){return n._resolveTexture(a,o)})),e.accessors&&(e.accessors=e.accessors.map(function(a,o){return n._resolveAccessor(a,o)})),e.materials&&(e.materials=e.materials.map(function(a,o){return n._resolveMaterial(a,o)})),e.meshes&&(e.meshes=e.meshes.map(function(a,o){return n._resolveMesh(a,o)})),e.nodes&&(e.nodes=e.nodes.map(function(a,o){return n._resolveNode(a,o)})),e.skins&&(e.skins=e.skins.map(function(a,o){return n._resolveSkin(a,o)})),e.scenes&&(e.scenes=e.scenes.map(function(a,o){return n._resolveScene(a,o)})),e.scene!==void 0&&(e.scene=e.scenes[this.json.scene])}},{key:"getScene",value:function(e){return this._get("scenes",e)}},{key:"getNode",value:function(e){return this._get("nodes",e)}},{key:"getSkin",value:function(e){return this._get("skins",e)}},{key:"getMesh",value:function(e){return this._get("meshes",e)}},{key:"getMaterial",value:function(e){return this._get("materials",e)}},{key:"getAccessor",value:function(e){return this._get("accessors",e)}},{key:"getCamera",value:function(e){return null}},{key:"getTexture",value:function(e){return this._get("textures",e)}},{key:"getSampler",value:function(e){return this._get("samplers",e)}},{key:"getImage",value:function(e){return this._get("images",e)}},{key:"getBufferView",value:function(e){return this._get("bufferViews",e)}},{key:"getBuffer",value:function(e){return this._get("buffers",e)}},{key:"_get",value:function(e,n){if(ue(n)==="object")return n;var i=this.json[e]&&this.json[e][n];return i||console.warn("glTF file error: Could not find ".concat(e,"[").concat(n,"]")),i}},{key:"_resolveScene",value:function(e,n){var i=this;return e.id=e.id||"scene-".concat(n),e.nodes=(e.nodes||[]).map(function(a){return i.getNode(a)}),e}},{key:"_resolveNode",value:function(e,n){var i=this;return e.id=e.id||"node-".concat(n),e.children&&(e.children=e.children.map(function(a){return i.getNode(a)})),e.mesh!==void 0?e.mesh=this.getMesh(e.mesh):e.meshes!==void 0&&e.meshes.length&&(e.mesh=e.meshes.reduce(function(a,o){var s=i.getMesh(o);return a.id=s.id,a.primitives=a.primitives.concat(s.primitives),a},{primitives:[]})),e.camera!==void 0&&(e.camera=this.getCamera(e.camera)),e.skin!==void 0&&(e.skin=this.getSkin(e.skin)),e}},{key:"_resolveSkin",value:function(e,n){return e.id=e.id||"skin-".concat(n),e.inverseBindMatrices=this.getAccessor(e.inverseBindMatrices),e}},{key:"_resolveMesh",value:function(e,n){var i=this;return e.id=e.id||"mesh-".concat(n),e.primitives&&(e.primitives=e.primitives.map(function(a){a=Vi({},a);var o=a.attributes;a.attributes={};
3711for(var s in o)a.attributes[s]=i.getAccessor(o[s]);return a.indices!==void 0&&(a.indices=i.getAccessor(a.indices)),a.material!==void 0&&(a.material=i.getMaterial(a.material)),a})),e}},{key:"_resolveMaterial",value:function(e,n){if(e.id=e.id||"material-".concat(n),e.normalTexture&&(e.normalTexture=Vi({},e.normalTexture),e.normalTexture.texture=this.getTexture(e.normalTexture.index)),e.occlusionTexture&&(e.occlustionTexture=Vi({},e.occlustionTexture),e.occlusionTexture.texture=this.getTexture(e.occlusionTexture.index)),e.emissiveTexture&&(e.emmisiveTexture=Vi({},e.emmisiveTexture),e.emissiveTexture.texture=this.getTexture(e.emissiveTexture.index)),e.emissiveFactor||(e.emissiveFactor=e.emmisiveTexture?[1,1,1]:[0,0,0]),e.pbrMetallicRoughness){e.pbrMetallicRoughness=Vi({},e.pbrMetallicRoughness);var i=e.pbrMetallicRoughness;i.baseColorTexture&&(i.baseColorTexture=Vi({},i.baseColorTexture),i.baseColorTexture.texture=this.getTexture(i.baseColorTexture.index)),i.metallicRoughnessTexture&&(i.metallicRoughnessTexture=Vi({},i.metallicRoughnessTexture),i.metallicRoughnessTexture.texture=this.getTexture(i.metallicRoughnessTexture.index))}return e}},{key:"_resolveAccessor",value:function(e,n){if(e.id=e.id||"accessor-".concat(n),e.bufferView!==void 0&&(e.bufferView=this.getBufferView(e.bufferView)),e.bytesPerComponent=Voe(e.componentType),e.components=Hoe(e.type),e.bytesPerElement=e.bytesPerComponent*e.components,e.bufferView){var i=e.bufferView.buffer,a=Gu(e,e.bufferView),o=a.ArrayType,s=a.byteLength,u=(e.bufferView.byteOffset||0)+(e.byteOffset||0)+i.byteOffset,l=i.arrayBuffer.slice(u,u+s);e.bufferView.byteStride&&(l=this._getValueFromInterleavedBuffer(i,u,e.bufferView.byteStride,e.bytesPerElement,e.count)),e.value=new o(l)}return e}},{key:"_getValueFromInterleavedBuffer",value:function(e,n,i,a,o){for(var s=new Uint8Array(o*a),u=0;u<o;u++){var l=n+u*i;s.set(new Uint8Array(e.arrayBuffer.slice(l,l+a)),u*a)}return s.buffer}},{key:"_resolveTexture",value:function(e,n){return e.id=e.id||"texture-".concat(n),e.sampler="sampler"in e?this.getSampler(e.sampler):zoe,e.source=this.getImage(e.source),e}},{key:"_resolveSampler",value:function(e,n){e.id=e.id||"sampler-".concat(n),e.parameters={};for(var i in e){var a=this._enumSamplerParameter(i);a!==void 0&&(e.parameters[a]=e[i])}return e}},{key:"_enumSamplerParameter",value:function(e){return Goe[e]}},{key:"_resolveImage",value:function(e,n){e.id=e.id||"image-".concat(n),e.bufferView!==void 0&&(e.bufferView=this.getBufferView(e.bufferView));var i=this.images[n];return i&&(e.image=i),e}},{key:"_resolveBufferView",value:function(e,n){var i=e.buffer,a=Vi(Vi({id:"bufferView-".concat(n)},e),{},{buffer:this.buffers[i]}),o=this.buffers[i].arrayBuffer,s=this.buffers[i].byteOffset||0;return"byteOffset"in e&&(s+=e.byteOffset),a.data=new Uint8Array(o,s,e.byteLength),a}},{key:"_resolveCamera",value:function(e,n){return e.id=e.id||"camera-".concat(n),e.perspective,e.orthographic,e}}]),t}();function mN(t,r){return new Woe().postProcess(t,r)}var gN=1735152710,Vx=12,om=8,$oe=1313821514,Xoe=5130562,qoe=0,Yoe=1,Koe=0,Hu=!0;function Zoe(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return"".concat(String.fromCharCode(t.getUint8(r+0))).concat(String.fromCharCode(t.getUint8(r+1))).concat(String.fromCharCode(t.getUint8(r+2))).concat(String.fromCharCode(t.getUint8(r+3)))}function yN(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=new DataView(t),i=e.magic,a=i===void 0?gN:i,o=n.getUint32(r,!1);return o===a||o===gN}function Hx(t,r){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},i=new DataView(r),a=Zoe(i,e+0),o=i.getUint32(e+4,Hu),s=i.getUint32(e+8,Hu);switch(Object.assign(t,{header:{byteOffset:e,byteLength:s,hasBinChunk:!1},type:a,version:o,json:{},binChunks:[]}),e+=Vx,t.version){case 1:return Joe(t,i,e);case 2:return Qoe(t,i,e,n={});default:throw new Error("Invalid GLB version ".concat(t.version,". Only supports v1 and v2."))}}function Joe(t,r,e){je(t.header.byteLength>Vx+om);var n=r.getUint32(e+0,Hu),i=r.getUint32(e+4,Hu);return e+=om,je(i===Koe),Gx(t,r,e,n),e+=n,e+=zx(t,r,e,t.header.byteLength),e}function Qoe(t,r,e,n){return je(t.header.byteLength>Vx+om),ese(t,r,e,n),e+t.header.byteLength}function ese(t,r,e,n){for(;e+8<=t.header.byteLength;){var i=r.getUint32(e+0,Hu),a=r.getUint32(e+4,Hu);switch(e+=om,a){case $oe:Gx(t,r,e,i);break;case Xoe:zx(t,r,e,i);break;case qoe:n.strict||Gx(t,r,e,i);break;case Yoe:n.strict||zx(t,r,e,i);break;default:break}e+=ra(i,4)}return e}function Gx(t,r,e,n){var i=new Uint8Array(r.buffer,e,n),a=new TextDecoder("utf8"),o=a.decode(i);return t.json=JSON.parse(o),ra(n,4)}function zx(t,r,e,n){return t.header.hasBinChunk=!0,t.binChunks.push({byteOffset:e,byteLength:n,arrayBuffer:r.buffer}),ra(n,4)}function bN(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=tse(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}
3711}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3712In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function tse(t,r){if(t){if(typeof t=="string")return _N(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return _N(t,r)}}function _N(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function xN(t,r){return Wx.apply(this,arguments)}function Wx(){return Wx=Y(Hi.default.mark(function t(r,e){var n,i,a,o,s,u,l,f,p,h,d=arguments;return Hi.default.wrap(function(m){for(;;)switch(m.prev=m.next){case 0:if(s=d.length>2&&d[2]!==void 0?d[2]:0,u=d.length>3?d[3]:void 0,l=d.length>4?d[4]:void 0,rse(r,e,s,u),dN(r,{normalize:u==null||(n=u.gltf)===null||n===void 0?void 0:n.normalize}),sN(r,u,l),f=[],!(u!=null&&(i=u.gltf)!==null&&i!==void 0&&i.loadBuffers&&r.json.buffers)){m.next=10;break}return m.next=10,nse(r,u,l);case 10:return u!=null&&(a=u.gltf)!==null&&a!==void 0&&a.loadImages&&(p=ise(r,u,l),f.push(p)),h=uN(r,u,l),f.push(h),m.next=15,Promise.all(f);case 15:return m.abrupt("return",u!=null&&(o=u.gltf)!==null&&o!==void 0&&o.postProcess?mN(r,u):r);case 16:case"end":return m.stop()}},t)})),Wx.apply(this,arguments)}function rse(t,r,e,n){if(n.uri&&(t.baseUri=n.uri),r instanceof ArrayBuffer&&!yN(r,e,n)){var i=new TextDecoder;r=i.decode(r)}if(typeof r=="string")t.json=py(r);else if(r instanceof ArrayBuffer){var a={};e=Hx(a,r,e,n.glb),Vt(a.type==="glTF","Invalid GLB magic string ".concat(a.type)),t._glb=a,t.json=a.json}else Vt(!1,"GLTF: must be ArrayBuffer or string");var o=t.json.buffers||[];if(t.buffers=new Array(o.length).fill(null),t._glb&&t._glb.header.hasBinChunk){var s=t._glb.binChunks;t.buffers[0]={arrayBuffer:s[0].arrayBuffer,byteOffset:s[0].byteOffset,byteLength:s[0].byteLength}}var u=t.json.images||[];t.images=new Array(u.length).fill({})}function nse(t,r,e){return $x.apply(this,arguments)}function $x(){return $x=Y(Hi.default.mark(function t(r,e,n){var i,a,o,s,u,l,f,p,h;return Hi.default.wrap(function(v){for(;;)switch(v.prev=v.next){case 0:i=r.json.buffers||[],a=0;case 2:if(!(a<i.length)){v.next=22;break}if(o=i[a],!o.uri){v.next=18;break}return l=n.fetch,Vt(l),f=tx(o.uri,e),v.next=10,n==null||(s=n.fetch)===null||s===void 0?void 0:s.call(n,f);case 10:return p=v.sent,v.next=13,p==null||(u=p.arrayBuffer)===null||u===void 0?void 0:u.call(p);case 13:h=v.sent,r.buffers[a]={arrayBuffer:h,byteOffset:0,byteLength:h.byteLength},delete o.uri,v.next=19;break;case 18:r.buffers[a]===null&&(r.buffers[a]={arrayBuffer:new ArrayBuffer(o.byteLength),byteOffset:0,byteLength:o.byteLength});case 19:++a,v.next=2;break;case 22:case"end":return v.stop()}},t)})),$x.apply(this,arguments)}function ise(t,r,e){return Xx.apply(this,arguments)}function Xx(){return Xx=Y(Hi.default.mark(function t(r,e,n){var i,a,o,s,u,l;return Hi.default.wrap(function(p){for(;;)switch(p.prev=p.next){case 0:i=ase(r),a=r.json.images||[],o=[],s=bN(i);try{for(s.s();!(u=s.n()).done;)l=u.value,o.push(ose(r,a[l],l,e,n))}catch(h){s.e(h)}finally{s.f()}return p.next=7,Promise.all(o);case 7:return p.abrupt("return",p.sent);case 8:case"end":return p.stop()}},t)})),Xx.apply(this,arguments)}function ase(t){var r=new Set,e=t.json.textures||[],n=bN(e),i;try{for(n.s();!(i=n.n()).done;){var a=i.value;a.source!==void 0&&r.add(a.source)}}catch(o){n.e(o)}finally{n.f()}return Array.from(r).sort()}function ose(t,r,e,n,i){return qx.apply(this,arguments)}function qx(){return qx=Y(Hi.default.mark(function t(r,e,n,i,a){var o,s,u,l,f,p,h;return Hi.default.wrap(function(v){for(;;)switch(v.prev=v.next){case 0:if(o=a.fetch,s=a.parse,!(e.uri&&!e.hasOwnProperty("bufferView"))){v.next=10;break}return l=tx(e.uri,i),v.next=5,o(l);case 5:return f=v.sent,v.next=8,f.arrayBuffer();case 8:u=v.sent,e.bufferView={data:u};
3712case 10:return Number.isFinite(e.bufferView)&&(p=xD(r.json,r.buffers,e.bufferView),u=Qa(p.buffer,p.byteOffset,p.byteLength)),Vt(u,"glTF image has no data"),v.next=14,s(u,[vn,ex],{mimeType:e.mimeType,basis:i.basis||{format:em()}},a);case 14:h=v.sent,h&&h[0]&&(h={compressed:!0,mipmaps:!1,width:h[0].width,height:h[0].height,data:h[0]}),r.images=r.images||[],r.images[n]=h;case 18:case"end":return v.stop()}},t)})),qx.apply(this,arguments)}function AN(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function sm(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?AN(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):AN(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var Wi={name:"glTF",id:"gltf",module:"gltf",version:tD,extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:sse,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 sse(t){return Kx.apply(this,arguments)}function Kx(){return Kx=Y(Yx.default.mark(function t(r){var e,n,i,a,o,s,u=arguments;return Yx.default.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return e=u.length>1&&u[1]!==void 0?u[1]:{},n=u.length>2?u[2]:void 0,e=sm(sm({},Wi.options),e),e.gltf=sm(sm({},Wi.options.gltf),e.gltf),i=e,a=i.byteOffset,o=a===void 0?0:a,s={},f.next=8,xN(s,r,o,e,n);case 8:return f.abrupt("return",f.sent);case 9:case"end":return f.stop()}},t)})),Kx.apply(this,arguments)}var Wc=me(Ae());function SN(t){return Zx.apply(this,arguments)}function Zx(){return Zx=Y(Wc.default.mark(function t(r){var e;return Wc.default.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return e=[],r.scenes.forEach(function(a){a.traverse(function(o){Object.values(o.model.getUniforms()).forEach(function(s){s.loaded===!1&&e.push(s)})})}),i.next=4,use(function(){return e.some(function(a){return!a.loaded})});case 4:return i.abrupt("return",i.sent);case 5:case"end":return i.stop()}},t)})),Zx.apply(this,arguments)}function use(t){return Jx.apply(this,arguments)}function Jx(){return Jx=Y(Wc.default.mark(function t(r){return Wc.default.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(!r()){n.next=5;break}return n.next=3,new Promise(function(i){return requestAnimationFrame(i)});case 3:n.next=0;break;case 5:case"end":return n.stop()}},t)})),Jx.apply(this,arguments)}var TN=`#version 300 es
3713in vec3 instancePositions;
3714in vec3 instancePositions64Low;
3715in vec4 instanceColors;
3716in vec3 instancePickingColors;
3717in mat3 instanceModelMatrix;
3718in vec3 instanceTranslation;
3719uniform float sizeScale;
3720uniform float sizeMinPixels;
3721uniform float sizeMaxPixels;
3722uniform mat4 sceneModelMatrix;
3723uniform bool composeModelMatrix;
3724in vec4 POSITION;
3725
3726#ifdef HAS_UV
3727  in vec2 TEXCOORD_0;
3728#endif
3729
3730#ifdef MODULE_PBR
3731  #ifdef HAS_NORMALS
3732    in vec4 NORMAL;
3733  #endif
3734#endif
3735out vec4 vColor;
3736#ifndef MODULE_PBR
3737  #ifdef HAS_UV
3738    out vec2 vTEXCOORD_0;
3739  #endif
3740#endif
3741void main(void) {
3742  #if defined(HAS_UV) && !defined(MODULE_PBR)
3743    vTEXCOORD_0 = TEXCOORD_0;
3744    geometry.uv = vTEXCOORD_0;
3745  #endif
3746
3747  geometry.worldPosition = instancePositions;
3748  geometry.pickingColor = instancePickingColors;
3749
3750  vec3 normal = vec3(0.0, 0.0, 1.0);
3751  #ifdef MODULE_PBR
3752    #ifdef HAS_NORMALS
3753      normal = instanceModelMatrix * (sceneModelMatrix * vec4(NORMAL.xyz, 0.0)).xyz;
3754    #endif
3755  #endif
3756
3757  float originalSize = project_size_to_pixel(sizeScale);
3758  float clampedSize = clamp(originalSize, sizeMinPixels, sizeMaxPixels);
3759
3760  vec3 pos = (instanceModelMatrix * (sceneModelMatrix * POSITION).xyz) * sizeScale * (clampedSize / originalSize) + instanceTranslation;
3761  if(composeModelMatrix) {
3762    DECKGL_FILTER_SIZE(pos, geometry);
3763    geometry.normal = project_normal(normal);
3764    geometry.worldPosition += pos;
3765    gl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), geometry.position);
3766  }
3767  else {
3768    pos = project_size(pos);
3769    DECKGL_FILTER_SIZE(pos, geometry);
3770    gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, geometry.position);
3771    geometry.normal = project_normal(normal);
3772  }
3773  DECKGL_FILTER_GL_POSITION(gl_Position, geometry);
3774
3775  #ifdef MODULE_PBR
3776    pbr_vPosition = geometry.position.xyz;
3777    #ifdef HAS_NORMALS
3778      pbr_vNormal = geometry.normal;
3779    #endif
3780
3781    #ifdef HAS_UV
3782      pbr_vUV = TEXCOORD_0;
3783    #else
3784      pbr_vUV = vec2(0., 0.);
3785    #endif
3786    geometry.uv = pbr_vUV;
3787  #endif
3788
3789  vColor = instanceColors;
3790  DECKGL_FILTER_COLOR(vColor, geometry);
3791}
3792`;var wN=`#version 300 es
3793uniform float opacity;
3794in vec4 vColor;
3795
3796out vec4 fragmentColor;
3797#ifndef MODULE_PBR
3798  #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)
3799    in vec2 vTEXCOORD_0;
3800    uniform sampler2D u_BaseColorSampler;
3801  #endif
3802#endif
3803
3804void main(void) {
3805  #ifdef MODULE_PBR
3806    fragmentColor = vColor * pbr_filterColor(vec4(0));
3807    geometry.uv = pbr_vUV;
3808  #else
3809    #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)
3810      fragmentColor = vColor * texture2D(u_BaseColorSampler, vTEXCOORD_0);
3811      geometry.uv = vTEXCOORD_0;
3812    #else
3813      fragmentColor = vColor;
3814    #endif
3815  #endif
3816
3817  fragmentColor.a *= opacity;
3818  DECKGL_FILTER_COLOR(fragmentColor, geometry);
3819}
3820`;function PN(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function ON(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?PN(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):PN(Object(e)).forEac
3820h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function lse(t){var r=fse();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function fse(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var EN=[255,255,255,255],cse={scenegraph:{type:"object",value:null,async:!0},getScene:function(r){return r&&r.scenes?ue(r.scene)==="object"?r.scene:r.scenes[r.scene||0]:r},getAnimator:function(r){return r&&r.animator},_animations:null,sizeScale:{type:"number",value:1,min:0},sizeMinPixels:{type:"number",min:0,value:0},sizeMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},getPosition:{type:"accessor",value:function(r){return r.position}},getColor:{type:"accessor",value:EN},_lighting:"flat",_imageBasedLightingEnvironment:null,getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]},loaders:[Wi]},Wu=function(t){L(e,t);var r=lse(e);function e(){var n;A(this,e);for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return n=r.call.apply(r,[this].concat(a)),c(q(n),"state",void 0),n}return T(e,[{key:"getShaders",value:function(){var i=[qe,rt];return this.props._lighting==="pbr"&&i.push(ha),Z(S(e.prototype),"getShaders",this).call(this,{vs:TN,fs:wN,modules:i})}},{key:"initializeState",value:function(){var i=this.getAttributeManager();i.addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),accessor:"getPosition",transition:!0},instanceColors:{type:5121,size:this.props.colorFormat.length,accessor:"getColor",normalized:!0,defaultValue:EN,transition:!0},instanceModelMatrix:Fv})}},{key:"updateState",value:function(i){Z(S(e.prototype),"updateState",this).call(this,i);var a=i.props,o=i.oldProps;a.scenegraph!==o.scenegraph?this._updateScenegraph():a._animations!==o._animations&&this._applyAnimationsProp(this.state.scenegraph,this.state.animator,a._animations)}},{key:"finalizeState",value:function(i){Z(S(e.prototype),"finalizeState",this).call(this,i),this._deleteScenegraph()}},{key:"_updateScenegraph",value:function(){var i=this,a=this.props,o=this.context.gl,s=null;if(a.scenegraph instanceof ai)s={scenes:[a.scenegraph]};else if(a.scenegraph&&!a.scenegraph.gltf){var u=a.scenegraph,l=Jv(o,u,this._getModelOptions());s=ON({gltf:u},l),SN(l).then(function(){return i.setNeedsRedraw()})}else a.scenegraph&&(ne.deprecated("ScenegraphLayer.props.scenegraph","Use GLTFLoader instead of GLTFScenegraphLoader")(),s=a.scenegraph);var f={layer:this,gl:o},p=a.getScene(s,f),h=a.getAnimator(s,f);p instanceof ai?(this._deleteScenegraph(),this._applyAllAttributes(p),this._applyAnimationsProp(p,h,a._animations),this.setState({scenegraph:p,animator:h})):p!==null&&ne.warn("invalid scenegraph:",p)()}},{key:"_applyAllAttributes",value:function(i){var a=this;if(this.state.attributesAvailable){var o=this.getAttributeManager().getAttributes();i.traverse(function(s){a._setModelAttributes(s.model,o)})}}},{key:"_applyAnimationsProp",value:function(i,a,o){if(!(!i||!a||!o)){var s=a.getAnimations();Object.keys(o).sort().forEach(function(u){var l=o[u];if(u==="*")s.forEach(function(h){Object.assign(h,l)});else if(Number.isFinite(Number(u))){var f=Number(u);f>=0&&f<s.length?Object.assign(s[f],l):ne.warn("animation ".concat(u," not found"))()}else{var p=s.find(function(h){var d=h.name;return d===u});p?Object.assign(p,l):ne.warn("animation ".concat(u," not found"))()}})}}},{key:"_deleteScenegraph",value:function(){var i=this.state.scenegraph;i instanceof ai&&i.delete()}},{key:"_getModelOptions",value:function(){var i=this.props._imageBasedLightingEnvironment,a=null;return i&&(typeof i=="function"?a=i({gl:this.context.gl,layer:this}):a=i),{gl:this.context.gl,waitForFullLoad:!0,imageBasedLightingEnvironment:a,modelOptions:ON({isInstanced:!0,transpileToGLSL100:!ge(this.context.gl)}
3820,this.getShaders()),useTangents:!1}}},{key:"updateAttributes",value:function(i){var a=this;this.setState({attributesAvailable:!0}),this.state.scenegraph&&this.state.scenegraph.traverse(function(o){a._setModelAttributes(o.model,i)})}},{key:"draw",value:function(i){var a=i.moduleParameters,o=a===void 0?null:a,s=i.parameters,u=s===void 0?{}:s,l=i.context;if(this.state.scenegraph){this.props._animations&&this.state.animator&&(this.state.animator.animate(l.timeline.getTime()),this.setNeedsRedraw());var f=this.context.viewport,p=this.props,h=p.sizeScale,d=p.sizeMinPixels,v=p.sizeMaxPixels,m=p.opacity,g=p.coordinateSystem,y=this.getNumInstances();this.state.scenegraph.traverse(function(_,b){var x=b.worldMatrix;_.model.setInstanceCount(y),_.updateModuleSettings(o),_.draw({parameters:u,uniforms:{sizeScale:h,opacity:m,sizeMinPixels:d,sizeMaxPixels:v,composeModelMatrix:Dv(f,g),sceneModelMatrix:x,u_Camera:_.model.getUniforms().project_uCameraPosition}})})}}}]),e}(He);c(Wu,"defaultProps",cse);c(Wu,"layerName","ScenegraphLayer");F();j();k();var CN=`#version 300 es
3821#define SHADER_NAME simple-mesh-layer-vs
3822uniform float sizeScale;
3823uniform bool composeModelMatrix;
3824uniform bool pickFeatureIds;
3825in vec3 positions;
3826in vec3 normals;
3827in vec3 colors;
3828in vec2 texCoords;
3829in vec4 uvRegions;
3830in vec3 featureIdsPickingColors;
3831in vec4 instanceColors;
3832in vec3 instancePickingColors;
3833in mat3 instanceModelMatrix;
3834out vec2 vTexCoord;
3835out vec3 cameraPosition;
3836out vec3 normals_commonspace;
3837out vec4 position_commonspace;
3838out vec4 vColor;
3839
3840vec2 applyUVRegion(vec2 uv) {
3841  #ifdef HAS_UV_REGIONS
3842    return fract(uv) * (uvRegions.zw - uvRegions.xy) + uvRegions.xy;
3843  #else
3844    return uv;
3845  #endif
3846}
3847
3848void main(void) {
3849  vec2 uv = applyUVRegion(texCoords);
3850  geometry.uv = uv;
3851
3852  if (pickFeatureIds) {
3853    geometry.pickingColor = featureIdsPickingColors;
3854  } else {
3855    geometry.pickingColor = instancePickingColors;
3856  }
3857
3858  vTexCoord = uv;
3859  cameraPosition = project_uCameraPosition;
3860  vColor = vec4(colors * instanceColors.rgb, instanceColors.a);
3861
3862  vec3 pos = (instanceModelMatrix * positions) * sizeScale;
3863  vec3 projectedPosition = project_position(positions);
3864  position_commonspace = vec4(projectedPosition, 1.0);
3865  gl_Position = project_common_position_to_clipspace(position_commonspace);
3866
3867  geometry.position = position_commonspace;
3868  normals_commonspace = project_normal(instanceModelMatrix * normals);
3869  geometry.normal = normals_commonspace;
3870
3871  DECKGL_FILTER_GL_POSITION(gl_Position, geometry);
3872
3873  #ifdef MODULE_PBR
3874    pbr_vPosition = geometry.position.xyz;
3875    #ifdef HAS_NORMALS
3876      pbr_vNormal = geometry.normal;
3877    #endif
3878
3879    #ifdef HAS_UV
3880      pbr_vUV = uv;
3881    #else
3882      pbr_vUV = vec2(0., 0.);
3883    #endif
3884    geometry.uv = pbr_vUV;
3885  #endif
3886
3887  DECKGL_FILTER_COLOR(vColor, geometry);
3888}
3889`;var MN=`#version 300 es
3890#define SHADER_NAME simple-mesh-layer-fs
3891
3892precision highp float;
3893
3894uniform bool hasTexture;
3895uniform sampler2D sampler;
3896uniform bool flatShading;
3897uniform float opacity;
3898
3899in vec2 vTexCoord;
3900in vec3 cameraPosition;
3901in vec3 normals_commonspace;
3902in vec4 position_commonspace;
3903in vec4 vColor;
3904
3905out vec4 fragColor;
3906
3907void main(void) {
3908  
3909#ifdef MODULE_PBR
3910
3911  fragColor = vColor * pbr_filterColor(vec4(0));
3912  geometry.uv = pbr_vUV;
3913  fragColor.a *= opacity;
3914
3915#else
3916
3917  geometry.uv = vTexCoord;
3918
3919  vec3 normal;
3920  if (flatShading) {
3921#ifdef DERIVATIVES_AVAILABLE
3922    normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));
3923#else
3924    normal = vec3(0.0, 0.0, 1.0);
3925#endif
3926  } else {
3927    normal = normals_commonspace;
3928  }
3929
3930  vec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor;
3931  vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);
3932  fragColor = vec4(lightColor, color.a * opacity);
3933
3934#endif
3935
3936  DECKGL_FILTER_COLOR(fragColor, geometry);
3937}
3938`;function IN(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function Fa(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?IN(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):IN(Object(e)).forEac
3938h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function pse(t){var r=hse();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function hse(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function dse(t){var r=t.COLOR_0||t.colors;r||(t.colors={constant:!0,value:new Float32Array([1,1,1])})}var vse={pbrMaterial:{type:"object",value:null},featureIds:{type:"array",value:null,optional:!0}},um=function(t){L(e,t);var r=pse(e);function e(){return A(this,e),r.apply(this,arguments)}return T(e,[{key:"getShaders",value:function(){var i=Z(S(e.prototype),"getShaders",this).call(this),a=i.modules;return a.push(ha),Fa(Fa({},i),{},{vs:CN,fs:MN})}},{key:"initializeState",value:function(){var i=this.props.featureIds;Z(S(e.prototype),"initializeState",this).call(this);var a=this.getAttributeManager();i&&a.add({featureIdsPickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateFeatureIdsPickingColors}})}},{key:"updateState",value:function(i){Z(S(e.prototype),"updateState",this).call(this,i);var a=i.props,o=i.oldProps;a.pbrMaterial!==o.pbrMaterial&&this.updatePbrMaterialUniforms(a.pbrMaterial)}},{key:"draw",value:function(i){var a=this.props.featureIds;this.state.model&&(this.state.model.setUniforms({u_Camera:this.state.model.getUniforms().project_uCameraPosition,pickFeatureIds:Boolean(a)}),Z(S(e.prototype),"draw",this).call(this,i))}},{key:"getModel",value:function(i){var a=this.props,o=a.id,s=a.pbrMaterial,u=this.parseMaterial(s,i);this.setState({materialParser:u});var l=this.getShaders();dse(i.attributes);var f=new Ie(this.context.gl,Fa(Fa({},this.getShaders()),{},{id:o,geometry:i,defines:Fa(Fa(Fa({},l.defines),u?.defines),{},{HAS_UV_REGIONS:i.attributes.uvRegions}),parameters:u?.parameters,isInstanced:!0}));return f}},{key:"updatePbrMaterialUniforms",value:function(i){var a=this.state.model;if(a){var o=this.props.mesh,s=this.parseMaterial(i,o);this.setState({materialParser:s}),a.setUniforms(s.uniforms)}}},{key:"parseMaterial",value:function(i,a){var o,s=Boolean(i.pbrMetallicRoughness&&i.pbrMetallicRoughness.baseColorTexture);return(o=this.state.materialParser)===null||o===void 0||o.delete(),new kc(this.context.gl,{attributes:{NORMAL:a.attributes.normals,TEXCOORD_0:a.attributes.texCoords},material:Fa({unlit:s},i),pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1})}},{key:"calculateFeatureIdsPickingColors",value:function(i){for(var a=this.props.featureIds,o=new Uint8ClampedArray(a.length*i.size),s=[],u=0;u<a.length;u++)this.encodePickingColor(a[u],s),o[u*3]=s[0],o[u*3+1]=s[1],o[u*3+2]=s[2];i.value=o}},{key:"finalizeState",value:function(i){var a;Z(S(e.prototype),"finalizeState",this).call(this,i),(a=this.state.materialParser)===null||a===void 0||a.delete(),this.setState({materialParser:null})}}]),e}(Gi);c(um,"layerName","MeshLayer");c(um,"defaultProps",vse);be();k();F();j();var Qo=me(Ae());k();be();F();j();k();var $i=6378137,Xi=6378137,qi=6356752314245179e-9,mse={radii:[$i,Xi,qi],radiiSquared:[$i*$i,Xi*Xi,qi*qi],oneOverRadii:[1/$i,1/Xi,1/qi],oneOverRadiiSquared:[1/($i*$i),1/(Xi*Xi),1/(qi*qi)],maximumRadius:Math.max($i,Xi,qi),centerToleranceSquared:.1};function lm(t){return t}var Hat=new z;function gse(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:lm;return"longitude"in t?(r[0]=e(t.longitude),r[1]=e(t.latitude),r[2]=t.height):"x"in t?(r[0]=e(t.x),r[1]=e(t.y),r[2]=t.z):(r[0]=e(t[0]),r[1]=e(t[1]),r[2]=t[2]),r}function RN(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return gse(t,r,it._cartographicRadians?lm:v_)}function yse(t,r){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:lm;return"longitude"in r?(r.longitude=e(t[0]),r.latitude=e(t[1]),r.height=t[2]):"x"in r?(r.x=e(t[0]),r.y=e(t[1]),r.z=t[2]):(r[0]=e(t[0]),r[1]=e(t[1]),r[2]=t[2]),r}function LN(t,r){return yse(t,r,it._cartographicRadians?lm:m_)}var $u=new z,_se=new z,bse=new z;function Qx(t,r){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],n=r.oneOverRadii,i=r.oneOverRadiiSquared,a=r.centerToleranceSquared;$u.from(t);var o=$u.x,s=$u.y,u=$u.z,l=n.x,f=n.y,p=n.z,h=o*o*l*l,d=s*s*f*f,v=u*u*p*p,m=h+d+v,g=Math.sqrt(1/m);if(Number.isFinite(g)){var y=_se;if(y.copy(t).scale(g),m<a)return y.to(e);var _=i.x,b=i.y,x=i.z,w=bse;w.set(y.x*_*2,y.y*b*2,y.z*x*2);var P=(1-g)*$u.len()/(.5*w.len()),E=0,C,I,O,D;do{P-=E,C=1/(1+P*_),I=1/(1+P*b),O=1/(1+P*x);var N=C*C,H=I*I,$=O*O,ee=N*C,V=H*I,U=$*O;D=h*N+d*H+v*$-1;var X=h*ee*_+d*V*b+v*U*x,K=-2*X;E=D/K}while(Math.abs(D)>Hn.EPSILON12);return $u.scale([C,I,O]).to(e)}}var kN=1e-14,xse=new z,BN={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},eA={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},Yi={east:new z,north:new z,up:new z,west:new z,south:new z,down:new z},Ase=new z,Sse=new z,Tse=new z;function fm(t,r,e,n,i,a){var o=BN[r]&&BN[r][e];Xe(o&&(!n||n===o));var s,u,l,f=xse.copy(i),p=Ze(f.x,0,kN)&&Ze(f.y,0,kN);if(p){var h=Math.sign(f.z);s=Ase.fromArray(eA[r]),r!=="east"&&r!=="west"&&s.scale(h),u=Sse.fromArray(eA[e]),e!=="east"&&e!=="west"&&u.scale(h),l=Tse.fromArray(eA[n]),n!=="east"&&n!=="west"&&l.scale(h)}else{var d=Yi.up,v=Yi.east,m=Yi.north;v.set(-f.y,f.x,0).normalize(),t.geodeticSurfaceNormal(f,d),m.copy(d).cross(v);var g=Yi.down,y=Yi.west,_=Yi.south;g.copy(d).scale(-1),y.copy(v).scale(-1),_.copy(m).scale(-1),s=Yi[r],u=Yi[e],l=Yi[n]}return a[0]=s.x,a[1]=s.y,a[2]=s.z,a[3]=0,a[4]=u.x,a[5]=u.y,a[6]=u.z,a[7]=0,a[8]=l.x,a[9]=l.y,a[10]=l.z,a[11]=0,a[12]=f.x,a[13]=f.y,a[14]=f.z,a[15]=1,a}var cm=new z,FN=new z,wse=new z,Pn=new z,Pse=new z,pm=new z;var et=function(){function t(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;A(this,t),c(this,"radii",void 0),c(this,"radiiSquared",void 0),c(this,"radiiToTheFourth",void 0),c(this,"oneOverRadii",void 0),c(this,"oneOverRadiiSquared",void 0),c(this,"minimumRadius",void 0),c(this,"maximumRadius",void 0),c(this,"centerToleranceSquared",Hn.EPSILON1),c(this,"squaredXOverSquaredZ",void 0),Xe(r>=0),Xe(e>=0),Xe(n>=0),this.radii=new z(r,e,n),this.radiiSquared=new z(r*r,e*e,n*n),this.radiiToTheFourth=new z(r*r*r*r,e*e*e*e,n*n*n*n),this.oneOverRadii=new z(r===0?0:1/r,e===0?0:1/e,n===0?0:1/n),this.oneOverRadiiSquared=new z(r===0?0:1/(r*r),e===0?0:1/(e*e),n===0?0:1/(n*n)),this.minimumRadius=Math.min(r,e,n),this.maximumRadius=Math.max(r,e,n),this.radiiSquared.z!==0&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}return T(t,[{key:"equals",value:function(e){return this===e||Boolean(e&&this.radii.equals(e.radii))}},{key:"toString",value:function(){return this.radii.toString()}},{key:"cartographicToCartesian",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0],i=FN,a=wse,o=W(e,3),s=o[2];this.geodeticSurfaceNormalCartographic(e,i),a.copy(this.radiiSquared).scale(i);var u=Math.sqrt(i.dot(a));return a.scale(1/u),i.scale(s),a.add(i),a.to(n)}},{key:"cartesianToCartographic",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];pm.from(e);var i=this.scaleToGeodeticSurface(pm,Pn);if(i){var a=this.geodeticSurfaceNormal(i,FN),o=Pse;o.copy(pm).subtract(i);var s=Math.atan2(a.y,a.x),u=Math.asin(a.z),l=Math.sign(If(o,pm))*Mf(o);return LN([s,u,l],n)}}},{key:"eastNorthUpToFixedFrame",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new ye;return fm(this,"east","north","up",e,n)}},{key:"localFrameToFixedFrame",value:function(e,n,i,a){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:new ye;return fm(this,e,n,i,a,o)}},{key:"geocentricSurfaceNormal",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];return cm.from(e).normalize().to(n)}},{key:"geodeticSurfaceNormalCartographic",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0],i=RN(e),a=i[0],o=i[1],s=Math.cos(o);return cm.set(s*Math.cos(a),s*Math.sin(a),Math.sin(o)).normalize(),cm.to(n)}},{key:"geodeticSurfaceNormal",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];return cm.from(e).scale(this.oneOverRadiiSquared).normalize().to(n)}},{key:"scaleToGeodeticSurface",value:function(e,n){return Qx(e,this,n)}},{key:"scaleToGeocentricSurface",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];Pn.from(e);var i=Pn.x,a=Pn.y,o=Pn.z,s=this.oneOverRadiiSquared,u=1/Math.sqrt(i*i*s.x+a*a*s.y+o*o*s.z);return Pn.multiplyScalar(u).to(n)}},{key:"transformPositionToScaledSpace",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];return Pn.from(e).scale(this.oneOverRadii).to(n)}},{key:"transformPositionFromScaledSpace",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0];return Pn.from(e).scale(this.radii).to(n)}},{key:"getSurfaceNormalIntersectionWithZAxis",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[0,0,0];Xe(Ze(this.radii.x,this.radii.y,Hn.EPSILON15)),Xe(this.radii.z>0),Pn.from(e);var a=Pn.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(a)>=this.radii.z-n))return Pn.set(0,0,a).to(i)}}]),t}();c(et,"WGS84",new et($i,Xi,qi));k();k();function $c(){let t;if(typeof window<"u"&&window.performance)t=window.performance.now();else if(typeof process<"u"&&process.hrtime){let r=process.hrtime();t=r[0]*1e3+r[1]/1e6}else t=Date.now();return t}var Zo=class{constructor(r,e){c(this,"name",void 0),c(this,"type",void 0),c(this,"sampleSize",1),c(this,"time",0),c(this,"count",0),c(this,"samples",0),c(this,"lastTiming",0),c(this,"lastSampleTime",0),c(this,"lastSampleCount",0),c(this,"_count",0),c(this,"_time",0),c(this,"_samples",0),c(this,"_startTime",0),c(this,"_timerPending",!1),this.name=r,this.type=e,this.reset()}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}setSampleSize(r){return this.sampleSize=r,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(r){return this._count+=r,this._samples++,this._checkSampling(),this}subtractCount(r){return this._count-=r,this._samples++,this._checkSampling(),this}addTime(r){return this._time+=r,this.lastTiming=r,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=$c(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime($c()-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}_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)}};var Xu=class{constructor(r){c(this,"id",void 0),c(this,"stats",{}),this.id=r.id,this.stats={},this._initializeStats(r.stats),Object.seal(this)}get(r){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"count";return this._getOrCreate({name:r,type:e})}get size(){return Object.keys(this.stats).length}reset(){for(let r of Object.values(this.stats))r.reset();return this}forEach(r){for(let e of Object.values(this.stats))r(e)}getTable(){let r={};
3938return this.forEach(e=>{r[e.name]={time:e.time||0,count:e.count||0,average:e.getAverageTime()||0,hz:e.getHz()||0}}),r}_initializeStats(){(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).forEach(e=>this._getOrCreate(e))}_getOrCreate(r){let{name:e,type:n}=r,i=this.stats[e];return i||(r instanceof Zo?i=r:i=new Zo(e,n),this.stats[e]=i),i}};F();j();k();F();j();k();F();k();var DN=function t(r,e,n){A(this,t),c(this,"item",void 0),c(this,"previous",void 0),c(this,"next",void 0),this.item=r,this.previous=e,this.next=n};var NN=function(){function t(){A(this,t),c(this,"head",null),c(this,"tail",null),c(this,"_length",0)}return T(t,[{key:"length",get:function(){return this._length}},{key:"add",value:function(e){var n=new DN(e,this.tail,null);return this.tail?(this.tail.next=n,this.tail=n):(this.head=n,this.tail=n),++this._length,n}},{key:"remove",value:function(e){e&&(e.previous&&e.next?(e.previous.next=e.next,e.next.previous=e.previous):e.previous?(e.previous.next=null,this.tail=e.previous):e.next?(e.next.previous=null,this.head=e.next):(this.head=null,this.tail=null),e.next=null,e.previous=null,--this._length)}},{key:"splice",value:function(e,n){e!==n&&(this.remove(n),this._insert(e,n))}},{key:"_insert",value:function(e,n){var i=e.next;e.next=n,this.tail===e?this.tail=n:i.previous=n,n.next=i,n.previous=e,++this._length}}]),t}();var jN=function(){function t(){A(this,t),c(this,"_list",void 0),c(this,"_sentinel",void 0),c(this,"_trimTiles",void 0),this._list=new NN,this._sentinel=this._list.add("sentinel"),this._trimTiles=!1}return T(t,[{key:"reset",value:function(){this._list.splice(this._list.tail,this._sentinel)}},{key:"touch",value:function(e){var n=e._cacheNode;n&&this._list.splice(this._sentinel,n)}},{key:"add",value:function(e,n,i){n._cacheNode||(n._cacheNode=this._list.add(n),i&&i(e,n))}},{key:"unloadTile",value:function(e,n,i){var a=n._cacheNode;a&&(this._list.remove(a),n._cacheNode=null,i&&i(e,n))}},{key:"unloadTiles",value:function(e,n){var i=this._trimTiles;this._trimTiles=!1;for(var a=this._list,o=e.maximumMemoryUsage*1024*1024,s=this._sentinel,u=a.head;u!==s&&(e.gpuMemoryUsageInBytes>o||i);){var l=u.item;u=u.next,this.unloadTile(e,l,n)}}},{key:"trim",value:function(){this._trimTiles=!0}}]),t}();function UN(t,r){je(t),je(r);var e=r.rtcCenter,n=r.gltfUpAxis,i=t.computedTransform,a=t.boundingVolume.center,o=new ye(i);switch(e&&o.translate(e),n){case"Z":break;case"Y":var s=new ye().rotateX(Math.PI/2);o=o.multiplyRight(s);break;case"X":var u=new ye().rotateY(-Math.PI/2);o=o.multiplyRight(u);break;default:break}r.isQuantized&&o.translate(r.quantizedVolumeOffset).scale(r.quantizedVolumeScale);var l=new z(a);r.cartesianModelMatrix=o,r.cartesianOrigin=l;var f=et.WGS84.cartesianToCartographic(l,new z),p=et.WGS84.eastNorthUpToFixedFrame(l),h=p.invert();r.cartographicModelMatrix=h.multiplyRight(o),r.cartographicOrigin=f,r.coordinateSystem||(r.modelMatrix=r.cartographicModelMatrix)}be();function Ose(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=Ese(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3939In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function Ese(t,r){if(t){if(typeof t=="string")return GN(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return GN(t,r)}}function GN(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var zN=new z,tA=new z,rA=new Or([new kt,new kt,new kt,new kt,new kt,new kt]);function HN(t,r){var e=t.cameraDirection,n=t.cameraUp,i=t.height,a=t.distanceScales.metersPerUnit,o=hm(t,t.center),s=et.WGS84.eastNorthUpToFixedFrame(o),u=t.unprojectPosition(t.cameraPosition),l=et.WGS84.cartographicToCartesian(u,new z),f=new z(s.transformAsVector(new z(e).scale(a))).normalize(),p=new z(s.transformAsVector(new z(n).scale(a))).normalize();Cse(t);var h=t.constructor,d=t.longitude,v=t.latitude,m=t.width,g=t.bearing,y=t.zoom,_=new h({longitude:d,latitude:v,height:i,width:m,bearing:g,zoom:y,pitch:0});return{camera:{position:l,direction:f,up:p},viewport:t,topDownViewport:_,height:i,cullingVolume:rA,frameNumber:r,sseDenominator:1.15}}function WN(t,r,e){if(e===0||t.length<=e)return[t,[]];var n=[],i=r.viewport,a=i.longitude,o=i.latitude,s=Ose(t.entries()),u;try{for(s.s();!(u=s.n()).done;){var l=W(u.value,2),f=l[0],p=l[1],h=W(p.header.mbs,2),d=h[0],v=h[1],m=Math.abs(a-d),g=Math.abs(o-v),y=Math.sqrt(g*g+m*m);n.push([f,y])}}catch(E){s.e(E)}finally{s.f()}for(var _=n.sort(function(E,C){return E[1]-C[1]}),b=[],x=0;x<e;x++)b.push(t[_[x][0]]);for(var w=[],P=e;P<_.length;P++)w.push(t[_[P][0]]);return[b,w]}function Cse(t){var r=t.getFrustumPlanes(),e=VN(r.near,t.cameraPosition),n=hm(t,e),i=hm(t,t.cameraPosition,tA),a=0;rA.planes[a++].fromPointNormal(n,zN.copy(n).subtract(i));
3939for(var o in r)if(o!=="near"){var s=r[o],u=VN(s,e,tA),l=hm(t,u,tA);rA.planes[a++].fromPointNormal(l,zN.copy(n).subtract(l))}}function VN(t,r){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new z,n=t.normal.dot(r);return e.copy(t.normal).scale(t.distance-n).add(r),e}function hm(t,r){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new z,n=t.unprojectPosition(r);return et.WGS84.cartographicToCartesian(n,e)}be();var Mse=6378137,Ise=6378137,nA=6356752314245179e-9,$N=new z;function XN(t,r){if(t instanceof Wo){var e=t.halfAxes,n=Rse(e);return Math.log2(nA/(n+r[2]))}else if(t instanceof Ia){var i=t.radius;return Math.log2(nA/(i+r[2]))}else if(t.width&&t.height){var a=t.width,o=t.height,s=Math.log2(Mse/a),u=Math.log2(Ise/o);return(s+u)/2}return 1}function iA(t,r,e){var n=et.WGS84.cartographicToCartesian([t.xmax,t.ymax,t.zmax],new z),i=Math.sqrt(Math.pow(n[0]-e[0],2)+Math.pow(n[1]-e[1],2)+Math.pow(n[2]-e[2],2));return Math.log2(nA/(i+r[2]))}function qN(t,r,e){var n=W(t,4),i=n[0],a=n[1],o=n[2],s=n[3];return iA({xmin:i,xmax:o,ymin:a,ymax:s,zmin:0,zmax:0},r,e)}function Rse(t){t.getColumn(0,$N);var r=t.getColumn(1),e=t.getColumn(2),n=$N.add(r).add(e),i=n.len();return i}k();F();j();var lA=me(Ae());k();var yr={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5},Cr={ADD:1,REPLACE:2},Ki={EMPTY:"empty",SCENEGRAPH:"scenegraph",POINTCLOUD:"pointcloud",MESH:"mesh"},ar={I3S:"I3S",TILES3D:"TILES3D"},Jo={GEOMETRIC_ERROR:"geometricError",MAX_SCREEN_THRESHOLD:"maxScreenThreshold"},YN={NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0};be();function ZN(t){return t!=null}var or=new z,dm=new z,Lse=new z,kse=new z;function vm(t,r,e){if(je(t,"3D Tile: boundingVolume must be defined"),t.box)return Bse(t.box,r,e);if(t.region){var n=W(t.region,6),i=n[0],a=n[1],o=n[2],s=n[3],u=n[4],l=n[5],f=et.WGS84.cartographicToCartesian([Yt(i),Yt(s),u],Lse),p=et.WGS84.cartographicToCartesian([Yt(o),Yt(a),l],kse),h=new z().addVectors(f,p).multiplyScalar(.5),d=new z().subVectors(f,p).len()/2;return KN([h[0],h[1],h[2],d],new ye)}if(t.sphere)return KN(t.sphere,r,e);throw new Error("3D Tile: boundingVolume must contain a sphere, region, or box")}function JN(t,r){if(t.box)return Fse(r);if(t.region){var e=W(t.region,6),n=e[0],i=e[1],a=e[2],o=e[3],s=e[4],u=e[5];return[[Yt(n),Yt(i),s],[Yt(a),Yt(o),u]]}if(t.sphere)return Dse(r);throw new Error("Unkown boundingVolume type")}function Bse(t,r,e){var n=new z(t[0],t[1],t[2]);r.transform(n,n);var i=[];if(t.length===10){var a=t.slice(3,6),o=new Vn;o.fromArray(t,6);var s=new z([1,0,0]),u=new z([0,1,0]),l=new z([0,0,1]);s.transformByQuaternion(o),s.scale(a[0]),u.transformByQuaternion(o),u.scale(a[1]),l.transformByQuaternion(o),l.scale(a[2]),i=[].concat(ae(s.toArray()),ae(u.toArray()),ae(l.toArray()))}else i=[].concat(ae(t.slice(3,6)),ae(t.slice(6,9)),ae(t.slice(9,12)));var f=r.transformAsVector(i.slice(0,3)),p=r.transformAsVector(i.slice(3,6)),h=r.transformAsVector(i.slice(6,9)),d=new at([f[0],f[1],f[2],p[0],p[1],p[2],h[0],h[1],h[2]]);return ZN(e)?(e.center=n,e.halfAxes=d,e):new Wo(n,d)}function KN(t,r,e){var n=new z(t[0],t[1],t[2]);r.transform(n,n);var i=r.getScale(dm),a=Math.max(Math.max(i[0],i[1]),i[2]),o=t[3]*a;return ZN(e)?(e.center=n,e.radius=o,e):new Ia(n,o)}function Fse(t){for(var r=QN(),e=t.halfAxes,n=new z(e.getColumn(0)),i=new z(e.getColumn(1)),a=new z(e.getColumn(2)),o=0;o<2;o++){for(var s=0;s<2;s++){for(var u=0;u<2;u++)or.copy(t.center),or.add(n),or.add(i),or.add(a),ej(r,or),a.negate();i.negate()}n.negate()}return r}function Dse(t){var r=QN(),e=t.center,n=t.radius,i=et.WGS84.scaleToGeodeticSurface(e,or),a;i?a=et.WGS84.geodeticSurfaceNormal(i):a=new z(0,0,1);var o=new z(a[2],-a[1],0);o.len()>0?o.normalize():o=new z(0,1,0);for(var s=o.clone().cross(a),u=0,l=[o,s,a];u<l.length;u++){var f=l[u];dm.copy(f).scale(n);for(var p=0;p<2;p++)or.copy(e),or.add(dm),ej(r,or),dm.negate()}return r}function QN(){return[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]]}function ej(t,r){et.WGS84.cartesianToCartographic(r,or),t[0][0]=Math.min(t[0][0],or[0]),t[0][1]=Math.min(t[0][1],or[1]),t[0][2]=Math.min(t[0][2],or[2]),t[1][0]=Math.max(t[1][0],or[0]),t[1][1]=Math.max(t[1][1],or[1]),t[1][2]=Math.max(t[1][2],or[2])}var nst=new z,ist=new z,ast=new ye,ost=new z,sst=new z,ust=new z;function Nse(t,r){var e=t*r;return 1-Math.exp(-(e*e))}function jse(t,r){if(t.dynamicScreenSpaceError&&t.dynamicScreenSpaceErrorComputedDensity){var e=t.dynamicScreenSpaceErrorComputedDensity,n=t.dynamicScreenSpaceErrorFactor,i=Nse(r,e)*n;return i}return 0}function tj(t,r,e){var n=t.tileset,i=t.parent&&t.parent.lodMetricValue||t.lodMetricValue,a=e?i:t.lodMetricValue;if(a===0)return 0;var o=Math.max(t._distanceToCamera,1e-7),s=r.height,u=r.sseDenominator,l=n.options.viewDistanceScale,f=a*s*(l||1)/(o*u);return f-=jse(n,o),f}var aA=new z,rj=new z,Da=new z,nj=new z,Use=new z,oA=new ye,ij=new ye;function aj(t,r){if(t.lodMetricValue===0||isNaN(t.lodMetricValue))return"DIG";var e=2*sA(t,r);return e<2?"OUT":!t.header.children||e<=t.lodMetricValue?"DRAW":t.header.children?"DIG":"OUT"}function sA(t,r){var e=r.topDownViewport,n=t.header.mbs[1],i=t.header.mbs[0],a=t.header.mbs[2],o=t.header.mbs[3],s=ae(t.boundingVolume.center),u=e.unprojectPosition(e.cameraPosition);et.WGS84.cartographicToCartesian(u,aA),rj.copy(aA).subtract(s).normalize(),et.WGS84.eastNorthUpToFixedFrame(s,oA),ij.copy(oA).invert(),Da.copy(aA).transform(ij);var l=Math.sqrt(Da[0]*Da[0]+Da[1]*Da[1]),f=l*l/Da[2];nj.copy([Da[0],Da[1],f]);var p=nj.transform(oA),h=p.subtract(s).normalize(),d=rj.cross(h).normalize().scale(o),v=d.add(s),m=et.WGS84.cartesianToCartographic(v),g=e.project([i,n,a]),y=e.project(m),_=Use.copy(g).subtract(y).magnitude();return _}function oj(t){return{assetGltfUpAxis:t.asset&&t.asset.gltfUpAxis||"Y"}}k();F();j();k();F();j();k();var uA=function(){function t(){A(this,t);var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;c(this,"_map",new Map),c(this,"_array",void 0),c(this,"_length",void 0),this._array=new Array(r),this._length=r}return T(t,[{key:"length",get:function(){return this._length},set:function(e){this._length=e,e>this._array.length&&(this._array.length=e)}},{key:"values",get:function(){return this._array}},{key:"get",value:function(e){return je(e<this._array.length),this._array[e]}}
3939,{key:"set",value:function(e,n){je(e>=0),e>=this.length&&(this.length=e+1),this._map.has(this._array[e])&&this._map.delete(this._array[e]),this._array[e]=n,this._map.set(n,e)}},{key:"delete",value:function(e){var n=this._map.get(e);n>=0&&(this._array.splice(n,1),this._map.delete(e),this.length--)}},{key:"peek",value:function(){return this._array[this._length-1]}},{key:"push",value:function(e){if(!this._map.has(e)){var n=this.length++;this._array[n]=e,this._map.set(e,n)}}},{key:"pop",value:function(){var e=this._array[--this.length];return this._map.delete(e),e}},{key:"reserve",value:function(e){je(e>=0),e>this._array.length&&(this._array.length=e)}},{key:"resize",value:function(e){je(e>=0),this.length=e}},{key:"trim",value:function(e){e==null&&(e=this.length),this._array.length=e}},{key:"reset",value:function(){this._array=[],this._map=new Map,this._length=0}},{key:"find",value:function(e){return this._map.has(e)}}]),t}();function mm(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=Gse(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3940In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function Gse(t,r){if(t){if(typeof t=="string")return sj(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return sj(t,r)}}function sj(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function uj(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function gm(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?uj(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):uj(Object(e)).forEac
3940h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var zse={loadSiblings:!1,skipLevelOfDetail:!1,maximumScreenSpaceError:2,updateTransforms:!0,onTraversalEnd:function(){},viewportTraversersMap:{},basePath:""},Na=function(){function t(r){A(this,t),c(this,"options",void 0),c(this,"root",null),c(this,"selectedTiles",{}),c(this,"requestedTiles",{}),c(this,"emptyTiles",{}),c(this,"lastUpdate",new Date().getTime()),c(this,"updateDebounceTime",1e3),c(this,"_traversalStack",new uA),c(this,"_emptyTraversalStack",new uA),c(this,"_frameNumber",null),this.options=gm(gm({},zse),r)}return T(t,[{key:"traversalFinished",value:function(e){return!0}},{key:"traverse",value:function(e,n,i){this.root=e,this.options=gm(gm({},this.options),i),this.reset(),this.updateTile(e,n),this._frameNumber=n.frameNumber,this.executeTraversal(e,n)}},{key:"reset",value:function(){this.requestedTiles={},this.selectedTiles={},this.emptyTiles={},this._traversalStack.reset(),this._emptyTraversalStack.reset()}},{key:"executeTraversal",value:function(e,n){var i=this._traversalStack;for(e._selectionDepth=1,i.push(e);i.length>0;){var a=i.pop(),o=!1;this.canTraverse(a,n)&&(this.updateChildTiles(a,n),o=this.updateAndPushChildren(a,n,i,a.hasRenderContent?a._selectionDepth+1:a._selectionDepth));var s=a.parent,u=Boolean(!s||s._shouldRefine),l=!o;a.hasRenderContent?a.refine===Cr.ADD?(this.loadTile(a,n),this.selectTile(a,n)):a.refine===Cr.REPLACE&&(this.loadTile(a,n),l&&this.selectTile(a,n)):(this.emptyTiles[a.id]=a,this.loadTile(a,n),l&&this.selectTile(a,n)),this.touchTile(a,n),a._shouldRefine=o&&u}var f=new Date().getTime();(this.traversalFinished(n)||f-this.lastUpdate>this.updateDebounceTime)&&(this.lastUpdate=f,this.options.onTraversalEnd(n))}},{key:"updateChildTiles",value:function(e,n){var i=e.children,a=mm(i),o;try{for(a.s();!(o=a.n()).done;){var s=o.value;this.updateTile(s,n)}}catch(u){a.e(u)}finally{a.f()}}},{key:"updateAndPushChildren",value:function(e,n,i,a){var o=this.options,s=o.loadSiblings,u=o.skipLevelOfDetail,l=e.children;l.sort(this.compareDistanceToCamera.bind(this));var f=e.refine===Cr.REPLACE&&e.hasRenderContent&&!u,p=!1,h=!0,d=mm(l),v;try{for(d.s();!(v=d.n()).done;){var m=v.value;if(m._selectionDepth=a,m.isVisibleAndInRequestVolume?(i.find(m)&&i.delete(m),i.push(m),p=!0):(f||s)&&(this.loadTile(m,n),this.touchTile(m,n)),f){var g=void 0;if(m._inRequestVolume?m.hasRenderContent?g=m.contentAvailable:g=this.executeEmptyTraversal(m,n):g=!1,h=h&&g,!h)return!1}}}catch(y){d.e(y)}finally{d.f()}return p||(h=!1),h}},{key:"updateTile",value:function(e,n){this.updateTileVisibility(e,n)}},{key:"selectTile",value:function(e,n){this.shouldSelectTile(e)&&(e._selectedFrame=n.frameNumber,this.selectedTiles[e.id]=e)}},{key:"loadTile",value:function(e,n){this.shouldLoadTile(e)&&(e._requestedFrame=n.frameNumber,e._priority=e._getPriority(),this.requestedTiles[e.id]=e)}},{key:"touchTile",value:function(e,n){e.tileset._cache.touch(e),e._touchedFrame=n.frameNumber}},{key:"canTraverse",value:function(e,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;return e.hasChildren?e.hasTilesetContent?!e.contentExpired:!a&&!e.isVisibleAndInRequestVolume?!1:this.shouldRefine(e,n,i):!1}},{key:"shouldLoadTile",value:function(e){return e.hasUnloadedContent||e.contentExpired}},{key:"shouldSelectTile",value:function(e){return e.contentAvailable&&!this.options.skipLevelOfDetail}},{key:"shouldRefine",value:function(e,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=e._screenSpaceError;return i&&(a=e.getScreenSpaceError(n,!0)),a>this.options.maximumScreenSpaceError}},{key:"updateTileVisibility",value:function(e,n){var i=[];if(this.options.viewportTraversersMap)for(var a in this.options.viewportTraversersMap){var o=this.options.viewportTraversersMap[a];o===n.viewport.id&&i.push(a)}else i.push(n.viewport.id);e.updateVisibility(n,i)}},{key:"compareDistanceToCamera",value:function(e,n){return e._distanceToCamera-n._distanceToCamera}},{key:"anyChildrenVisible",value:function(e,n){var i=!1,a=mm(e.children),o;try{for(a.s();!(o=a.n()).done;){var s=o.value;s.updateVisibility(n),i=i||s.isVisibleAndInRequestVolume}}catch(u){a.e(u)}finally{a.f()}return i}},{key:"executeEmptyTraversal",value:function(e,n){var i=!0,a=this._emptyTraversalStack;for(a.push(e);a.length>0&&i;){var o=a.pop();this.updateTile(o,n),o.isVisibleAndInRequestVolume||this.loadTile(o,n),this.touchTile(o,n);var s=!o.hasRenderContent&&this.canTraverse(o,n,!1,!0);if(s){var u=o.children,l=mm(u),f;try{for(l.s();!(f=l.n()).done;){var p=f.value;a.find(p)&&a.delete(p),a.push(p)}}catch(h){l.e(h)}finally{l.f()}}else!o.contentAvailable&&!o.hasEmptyContent&&(i=!1)}return i}}]),t}();function lj(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function qu(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};
3940r%2?lj(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):lj(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var fj=new z;function Vse(t){return t!=null}var Xc=function(){function t(r,e,n){A(this,t);var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"";c(this,"tileset",void 0),c(this,"header",void 0),c(this,"id",void 0),c(this,"url",void 0),c(this,"parent",void 0),c(this,"refine",void 0),c(this,"type",void 0),c(this,"contentUrl",void 0),c(this,"lodMetricType","geometricError"),c(this,"lodMetricValue",0),c(this,"boundingVolume",null),c(this,"content",null),c(this,"contentState",yr.UNLOADED),c(this,"gpuMemoryUsageInBytes",0),c(this,"children",[]),c(this,"depth",0),c(this,"viewportIds",[]),c(this,"transform",new ye),c(this,"extensions",null),c(this,"implicitTiling",null),c(this,"userData",{}),c(this,"computedTransform",void 0),c(this,"hasEmptyContent",!1),c(this,"hasTilesetContent",!1),c(this,"traverser",new Na({})),c(this,"_cacheNode",null),c(this,"_frameNumber",null),c(this,"_expireDate",null),c(this,"_expiredContent",null),c(this,"_boundingBox",void 0),c(this,"_distanceToCamera",0),c(this,"_screenSpaceError",0),c(this,"_visibilityPlaneMask",void 0),c(this,"_visible",void 0),c(this,"_contentBoundingVolume",void 0),c(this,"_viewerRequestVolume",void 0),c(this,"_initialTransform",new ye),c(this,"_priority",0),c(this,"_selectedFrame",0),c(this,"_requestedFrame",0),c(this,"_selectionDepth",0),c(this,"_touchedFrame",0),c(this,"_centerZDepth",0),c(this,"_shouldRefine",!1),c(this,"_stackLength",0),c(this,"_visitedFrame",0),c(this,"_inRequestVolume",!1),c(this,"_lodJudge",null),this.header=e,this.tileset=r,this.id=i||e.id,this.url=e.url,this.parent=n,this.refine=this._getRefine(e.refine),this.type=e.type,this.contentUrl=e.contentUrl,this._initializeLodMetric(e),this._initializeTransforms(e),this._initializeBoundingVolumes(e),this._initializeContent(e),this._initializeRenderingState(e),Object.seal(this)}return T(t,[{key:"destroy",value:function(){this.header=null}},{key:"isDestroyed",value:function(){return this.header===null}},{key:"selected",get:function(){return this._selectedFrame===this.tileset._frameNumber}},{key:"isVisible",get:function(){return this._visible}},{key:"isVisibleAndInRequestVolume",get:function(){return this._visible&&this._inRequestVolume}},{key:"hasRenderContent",get:function(){return!this.hasEmptyContent&&!this.hasTilesetContent}},{key:"hasChildren",get:function(){return this.children.length>0||this.header.children&&this.header.children.length>0}},{key:"contentReady",get:function(){return this.contentState===yr.READY||this.hasEmptyContent}},{key:"contentAvailable",get:function(){return Boolean(this.contentReady&&this.hasRenderContent||this._expiredContent&&!this.contentFailed)}},{key:"hasUnloadedContent",get:function(){return this.hasRenderContent&&this.contentUnloaded}},{key:"contentUnloaded",get:function(){return this.contentState===yr.UNLOADED}},{key:"contentExpired",get:function(){return this.contentState===yr.EXPIRED}},{key:"contentFailed",get:function(){return this.contentState===yr.FAILED}},{key:"distanceToCamera",get:function(){return this._distanceToCamera}},{key:"screenSpaceError",get:function(){return this._screenSpaceError}},{key:"boundingBox",get:function(){return this._boundingBox||(this._boundingBox=JN(this.header.boundingVolume,this.boundingVolume)),this._boundingBox}},{key:"getScreenSpaceError",value:function(e,n){switch(this.tileset.type){case ar.I3S:return sA(this,e);case ar.TILES3D:return tj(this,e,n);default:throw new Error("Unsupported tileset type")}}},{key:"unselect",value:function(){this._selectedFrame=0}},{key:"_getGpuMemoryUsageInBytes",value:function(){return this.content.gpuMemoryUsageInBytes||this.content.byteLength||0}},{key:"_getPriority",value:function(){var e=this.tileset._traverser,n=e.options.skipLevelOfDetail,i=this.refine===Cr.ADD||n;if(i&&!this.isVisible&&this._visible!==void 0||this.tileset._frameNumber-this._touchedFrame>=1||this.contentState===yr.UNLOADED)return-1;var a=this.parent,o=a&&(!i||this._screenSpaceError===0||a.hasTilesetContent),s=o?a._screenSpaceError:this._screenSpaceError,u=e.root?e.root._screenSpaceError:0;return Math.max(u-s,0)}},{key:"loadContent",value:function(){var r=Y(lA.default.mark(function n(){var i,a,o,s,u;return lA.default.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(!this.hasEmptyContent){f.next=2;break}return f.abrupt("return",!1);case 2:if(!this.content){f.next=4;break}return f.abrupt("return",!0);case 4:return i=this.contentExpired,i&&(this._expireDate=null),this.contentState=yr.LOADING,f.next=9,this.tileset._requestScheduler.scheduleRequest(this.id,this._getPriority.bind(this));
3940case 9:if(a=f.sent,a){f.next=13;break}return this.contentState=yr.UNLOADED,f.abrupt("return",!1);case 13:return f.prev=13,o=this.tileset.getTileUrl(this.contentUrl),s=this.tileset.loader,u=qu(qu({},this.tileset.loadOptions),{},c({},s.id,qu(qu({},this.tileset.loadOptions[s.id]),{},{isTileset:this.type==="json"},this._getLoaderSpecificOptions(s.id)))),f.next=19,Bt(o,s,u);case 19:if(this.content=f.sent,!this.tileset.options.contentLoader){f.next=23;break}return f.next=23,this.tileset.options.contentLoader(this);case 23:return this._isTileset()&&this.tileset._initializeTileHeaders(this.content,this),this.contentState=yr.READY,this._onContentLoaded(),f.abrupt("return",!0);case 29:throw f.prev=29,f.t0=f.catch(13),this.contentState=yr.FAILED,f.t0;case 33:return f.prev=33,a.done(),f.finish(33);case 36:case"end":return f.stop()}},n,this,[[13,29,33,36]])}));function e(){return r.apply(this,arguments)}return e}()},{key:"unloadContent",value:function(){return this.content&&this.content.destroy&&this.content.destroy(),this.content=null,this.header.content&&this.header.content.destroy&&this.header.content.destroy(),this.header.content=null,this.contentState=yr.UNLOADED,!0}},{key:"updateVisibility",value:function(e,n){if(this._frameNumber!==e.frameNumber){var i=this.parent,a=i?i._visibilityPlaneMask:Or.MASK_INDETERMINATE;if(this.tileset._traverser.options.updateTransforms){var o=i?i.computedTransform:this.tileset.modelMatrix;this._updateTransform(o)}this._distanceToCamera=this.distanceToTile(e),this._screenSpaceError=this.getScreenSpaceError(e,!1),this._visibilityPlaneMask=this.visibility(e,a),this._visible=this._visibilityPlaneMask!==Or.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._frameNumber=e.frameNumber,this.viewportIds=n}}},{key:"visibility",value:function(e,n){var i=e.cullingVolume,a=this.boundingVolume;return i.computeVisibilityWithPlaneMask(a,n)}},{key:"contentVisibility",value:function(){return!0}},{key:"distanceToTile",value:function(e){var n=this.boundingVolume;return Math.sqrt(Math.max(n.distanceSquaredTo(e.camera.position),0))}},{key:"cameraSpaceZDepth",value:function(e){var n=e.camera,i=this.boundingVolume;return fj.subVectors(i.center,n.position),n.direction.dot(fj)}},{key:"insideViewerRequestVolume",value:function(e){var n=this._viewerRequestVolume;return!n||n.distanceSquaredTo(e.camera.position)<=0}},{key:"updateExpiration",value:function(){if(Vse(this._expireDate)&&this.contentReady&&!this.hasEmptyContent){var e=Date.now();Date.lessThan(this._expireDate,e)&&(this.contentState=yr.EXPIRED,this._expiredContent=this.content)}}},{key:"extras",get:function(){return this.header.extras}},{key:"_initializeLodMetric",value:function(e){"lodMetricType"in e?this.lodMetricType=e.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 e?this.lodMetricValue=e.lodMetricValue:(this.lodMetricValue=this.parent&&this.parent.lodMetricValue||this.tileset.lodMetricValue,console.warn("3D Tile: Required prop lodMetricValue is undefined. Using parent lodMetricValue"))}},{key:"_initializeTransforms",value:function(e){this.transform=e.transform?new ye(e.transform):new ye;var n=this.parent,i=this.tileset,a=n&&n.computedTransform?n.computedTransform.clone():i.modelMatrix.clone();this.computedTransform=new ye(a).multiplyRight(this.transform);var o=n&&n._initialTransform?n._initialTransform.clone():new ye;this._initialTransform=new ye(o).multiplyRight(this.transform)}},{key:"_initializeBoundingVolumes",value:function(e){this._contentBoundingVolume=null,this._viewerRequestVolume=null,this._updateBoundingVolume(e)}},{key:"_initializeContent",value:function(e){this.content={_tileset:this.tileset,_tile:this},this.hasEmptyContent=!0,this.contentState=yr.UNLOADED,this.hasTilesetContent=!1,e.contentUrl&&(this.content=null,this.hasEmptyContent=!1)}},{key:"_initializeRenderingState",value:function(e){this.depth=e.level||(this.parent?this.parent.depth+1:0),this._shouldRefine=!1,this._distanceToCamera=0,this._centerZDepth=0,this._screenSpaceError=0,this._visibilityPlaneMask=Or.MASK_INDETERMINATE,this._visible=void 0,this._inRequestVolume=!1,this._stackLength=0,this._selectionDepth=0,this._frameNumber=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._requestedFrame=0,this._priority=0}},{key:"_getRefine",value:function(e){return e||this.parent&&this.parent.refine||Cr.REPLACE}},{key:"_isTileset",value:function(){return this.contentUrl.indexOf(".json")!==-1}},{key:"_onContentLoaded",value:function(){switch(this.content&&this.content.type){case"vctr":case"geom":this.tileset._traverser.disableSkipLevelOfDetail=!0;break;default:}this._isTileset()?this.hasTilesetContent=!0:this.gpuMemoryUsageInBytes=this._getGpuMemoryUsageInBytes()}},{key:"_updateBoundingVolume",value:function(e){this.boundingVolume=vm(e.boundingVolume,this.computedTransform,this.boundingVolume);var n=e.content;n&&(n.boundingVolume&&(this._contentBoundingVolume=vm(n.boundingVolume,this.computedTransform,this._contentBoundingVolume)),e.viewerRequestVolume&&(this._viewerRequestVolume=vm(e.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)))}},{key:"_updateTransform",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new ye,n=e.clone().multiplyRight(this.transform),i=!n.equals(this.computedTransform);i&&(this.computedTransform=n,this._updateBoundingVolume(this.header))}},{key:"_getLoaderSpecificOptions",value:function(e){switch(e){case"i3s":return qu(qu({},this.tileset.options.i3s),{},{_tileOptions:{attributeUrls:this.header.attributeUrls,textureUrl:this.header.textureUrl,textureFormat:this.header.textureFormat,textureLoaderOptions:this.header.textureLoaderOptions,materialDefinition:this.header.materialDefinition,isDracoGeometry:this.header.isDracoGeometry,mbs:this.header.mbs},_tilesetOptions:{store:this.tileset.tileset.store,attributeStorageInfo:this.tileset.tileset.attributeStorageInfo,fields:this.tileset.tileset.fields},isTileHeader:!1});case"3d-tiles":case"cesium-ion":default:return oj(this.tileset.tileset)}}}]),t}();F();j();function Hse(t){var r=Wse();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function Wse(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var cj=function(t){L(e,t);var r=Hse(e);function e(){return A(this,e),r.apply(this,arguments)}
3940return T(e,[{key:"compareDistanceToCamera",value:function(i,a){return a._distanceToCamera===0&&i._distanceToCamera===0?a._centerZDepth-i._centerZDepth:a._distanceToCamera-i._distanceToCamera}},{key:"updateTileVisibility",value:function(i,a){if(Z(S(e.prototype),"updateTileVisibility",this).call(this,i,a),!!i.isVisibleAndInRequestVolume){var o=i.children.length>0;if(i.hasTilesetContent&&o){var s=i.children[0];this.updateTileVisibility(s,a),i._visible=s._visible;return}if(this.meetsScreenSpaceErrorEarly(i,a)){i._visible=!1;return}var u=i.refine===Cr.REPLACE,l=i._optimChildrenWithinParent===YN.USE_OPTIMIZATION;if(u&&l&&o&&!this.anyChildrenVisible(i,a)){i._visible=!1;return}}}},{key:"meetsScreenSpaceErrorEarly",value:function(i,a){var o=i.parent;return!o||o.hasTilesetContent||o.refine!==Cr.ADD?!1:!this.shouldRefine(i,a,!0)}}]),e}(Na);k();F();j();var cA=me(Ae());k();F();j();k();F();j();k();var pj=function(){function t(){A(this,t),c(this,"frameNumberMap",new Map)}return T(t,[{key:"register",value:function(e,n){var i=this.frameNumberMap.get(e)||new Map,a=i.get(n)||0;i.set(n,a+1),this.frameNumberMap.set(e,i)}},{key:"deregister",value:function(e,n){var i=this.frameNumberMap.get(e);if(i){var a=i.get(n)||1;i.set(n,a-1)}}},{key:"isZero",value:function(e,n){var i,a=((i=this.frameNumberMap.get(e))===null||i===void 0?void 0:i.get(n))||0;return a===0}}]),t}();var fA={REQUESTED:"REQUESTED",COMPLETED:"COMPLETED",ERROR:"ERROR"},hj=function(){function t(){A(this,t),c(this,"_statusMap",void 0),c(this,"pendingTilesRegister",new pj),this._statusMap={}}return T(t,[{key:"add",value:function(e,n,i,a){var o=this;if(!this._statusMap[n]){var s=a.frameNumber,u=a.viewport.id;this._statusMap[n]={request:e,callback:i,key:n,frameState:a,status:fA.REQUESTED},this.pendingTilesRegister.register(u,s),e().then(function(l){o._statusMap[n].status=fA.COMPLETED;var f=o._statusMap[n].frameState,p=f.frameNumber,h=f.viewport.id;o.pendingTilesRegister.deregister(h,p),o._statusMap[n].callback(l,a)}).catch(function(l){o._statusMap[n].status=fA.ERROR;var f=o._statusMap[n].frameState,p=f.frameNumber,h=f.viewport.id;o.pendingTilesRegister.deregister(h,p),i(l)})}}},{key:"update",value:function(e,n){if(this._statusMap[e]){var i=this._statusMap[e].frameState,a=i.frameNumber,o=i.viewport.id;this.pendingTilesRegister.deregister(o,a);var s=n.frameNumber,u=n.viewport.id;this.pendingTilesRegister.register(u,s),this._statusMap[e].frameState=n}}},{key:"find",value:function(e){return this._statusMap[e]}},{key:"hasPendingTiles",value:function(e,n){return!this.pendingTilesRegister.isZero(e,n)}}]),t}();function dj(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function ym(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?dj(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):dj(Object(e)).forEac
3940h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function $se(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=Xse(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3941In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function Xse(t,r){if(t){if(typeof t=="string")return vj(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return vj(t,r)}}function vj(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function qse(t){var r=Yse();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function Yse(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var mj=function(t){L(e,t);var r=qse(e);function e(n){var i;return A(this,e),i=r.call(this,n),c(q(i),"_tileManager",void 0),i._tileManager=new hj,i}return T(e,[{key:"traversalFinished",value:function(i){return!this._tileManager.hasPendingTiles(i.viewport.id,this._frameNumber||0)}},{key:"shouldRefine",value:function(i,a){return i._lodJudge=aj(i,a),i._lodJudge==="DIG"}},{key:"updateChildTiles",value:function(i,a){var o=this,s=i.header.children||[],u=i.children,l=i.tileset,f=$se(s),p;try{var h=function(){var v=p.value,m="".concat(v.id,"-").concat(a.viewport.id),g=u&&u.find(function(b){return b.id===m});if(g)g&&o.updateTile(g,a);else{var y=function(){return o._loadTile(v.id,l)},_=o._tileManager.find(m);_?o._tileManager.update(m,a):(l.tileset.nodePages&&(y=function(){return l.tileset.nodePagesTile.formTileFromNodePages(v.id)}),o._tileManager.add(y,m,function(b){return o._onTileLoad(b,i,m)},a))}};for(f.s();!(p=f.n()).done;)h()}catch(d){f.e(d)}finally{f.f()}return!1}},{key:"_loadTile",value:function(){var n=Y(cA.default.mark(function a(o,s){var u,l,f;return cA.default.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return u=s.loader,l=s.getTileUrl("".concat(s.url,"/nodes/").concat(o)),f=ym(ym({},s.loadOptions),{},{i3s:ym(ym({},s.loadOptions.i3s),{},{isTileHeader:!0})}),h.next=5,Bt(l,u,f);case 5:return h.abrupt("return",h.sent);case 6:case"end":return h.stop()}},a)}));function i(a,o){return n.apply(this,arguments)}return i}()},{key:"_onTileLoad",value:function(i,a,o){var s=new Xc(a.tileset,i,a,o);a.children.push(s);var u=this._tileManager.find(s.id).frameState;this.updateTile(s,u),this._frameNumber===u.frameNumber&&(this.traversalFinished(u)||new Date().getTime()-this.lastUpdate>this.updateDebounceTime)&&this.executeTraversal(s,u)}}]),e}(Na);function Zi(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=Kse(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3942In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function Kse(t,r){if(t){if(typeof t=="string")return gj(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return gj(t,r)}}function gj(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function yj(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function ja(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};
3942r%2?yj(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):yj(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var Zse={description:"",ellipsoid:et.WGS84,modelMatrix:new ye,throttleRequests:!0,maxRequests:64,maximumMemoryUsage:32,maximumTilesSelected:0,debounceTime:0,onTileLoad:function(){},onTileUnload:function(){},onTileError:function(){},onTraversalComplete:function(r){return r},contentLoader:void 0,viewDistanceScale:1,maximumScreenSpaceError:8,loadTiles:!0,updateTransforms:!0,viewportTraversersMap:null,loadOptions:{fetch:{}},attributions:[],basePath:"",i3s:{}},_m="Tiles In Tileset(s)",pA="Tiles In Memory",_j="Tiles In View",bj="Tiles To Render",xj="Tiles Loaded",hA="Tiles Loading",Aj="Tiles Unloaded",Sj="Failed Tile Loads",Tj="Points/Vertices",dA="Tile Memory Use",vA=function(){function t(r,e){A(this,t),c(this,"options",void 0),c(this,"loadOptions",void 0),c(this,"type",void 0),c(this,"tileset",void 0),c(this,"loader",void 0),c(this,"url",void 0),c(this,"basePath",void 0),c(this,"modelMatrix",void 0),c(this,"ellipsoid",void 0),c(this,"lodMetricType",void 0),c(this,"lodMetricValue",void 0),c(this,"refine",void 0),c(this,"root",null),c(this,"roots",{}),c(this,"asset",{}),c(this,"description",""),c(this,"properties",void 0),c(this,"extras",null),c(this,"attributions",{}),c(this,"credits",{}),c(this,"stats",void 0),c(this,"contentFormats",{draco:!1,meshopt:!1,dds:!1,ktx2:!1}),c(this,"cartographicCenter",null),c(this,"cartesianCenter",null),c(this,"zoom",1),c(this,"boundingVolume",null),c(this,"dynamicScreenSpaceErrorComputedDensity",0),c(this,"maximumMemoryUsage",32),c(this,"gpuMemoryUsageInBytes",0),c(this,"_frameNumber",0),c(this,"_queryParams",{}),c(this,"_extensionsUsed",[]),c(this,"_tiles",{}),c(this,"_pendingCount",0),c(this,"selectedTiles",[]),c(this,"traverseCounter",0),c(this,"geometricError",0),c(this,"lastUpdatedVieports",null),c(this,"_requestedTiles",[]),c(this,"_emptyTiles",[]),c(this,"frameStateData",{}),c(this,"_traverser",void 0),c(this,"_cache",new jN),c(this,"_requestScheduler",void 0),c(this,"updatePromise",null),c(this,"tilesetInitializationPromise",void 0),this.options=ja(ja({},Zse),e),this.tileset=r,this.loader=r.loader,this.type=r.type,this.url=r.url,this.basePath=r.basePath||hn.dirname(this.url),this.modelMatrix=this.options.modelMatrix,this.ellipsoid=this.options.ellipsoid,this.lodMetricType=r.lodMetricType,this.lodMetricValue=r.lodMetricValue,this.refine=r.root.refine,this.loadOptions=this.options.loadOptions||{},this._traverser=this._initializeTraverser(),this._requestScheduler=new Yl({throttleRequests:this.options.throttleRequests,maxRequests:this.options.maxRequests}),this.stats=new Xu({id:this.url}),this._initializeStats(),this.tilesetInitializationPromise=this._initializeTileSet(r)}return T(t,[{key:"destroy",value:function(){this._destroy()}},{key:"isLoaded",value:function(){return this._pendingCount===0&&this._frameNumber!==0&&this._requestedTiles.length===0}},{key:"tiles",get:function(){return Object.values(this._tiles)}},{key:"frameNumber",get:function(){return this._frameNumber}},{key:"queryParams",get:function(){return new URLSearchParams(this._queryParams).toString()}},{key:"setProps",value:function(e){this.options=ja(ja({},this.options),e)}},{key:"setOptions",value:function(e){this.options=ja(ja({},this.options),e)}},{key:"getTileUrl",value:function(e){var n=e.startsWith("data:");return n?e:"".concat(e).concat(e.includes("?")?"&":"?").concat(this.queryParams)}},{key:"hasExtension",value:function(e){return Boolean(this._extensionsUsed.indexOf(e)>-1)}},{key:"update",value:function(){var e=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;this.tilesetInitializationPromise.then(function(){!n&&e.lastUpdatedVieports?n=e.lastUpdatedVieports:e.lastUpdatedVieports=n,n&&e.doUpdate(n)})}},{key:"selectTiles",value:function(){var r=Y(Qo.default.mark(function n(){var i=this,a,o=arguments;return Qo.default.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return a=o.length>0&&o[0]!==void 0?o[0]:null,u.next=3,this.tilesetInitializationPromise;case 3:return a&&(this.lastUpdatedVieports=a),this.updatePromise||(this.updatePromise=new Promise(function(l){setTimeout(function(){i.lastUpdatedVieports&&i.doUpdate(i.lastUpdatedVieports),l(i._frameNumber),i.updatePromise=null},i.options.debounceTime)})),u.abrupt("return",this.updatePromise);case 6:case"end":return u.stop()}},n,this)}));function e(){return r.apply(this,arguments)}return e}()},{key:"doUpdate",value:function(e){if(!("loadTiles"in this.options&&!this.options.loadTiles)&&!(this.traverseCounter>0)){var n=e instanceof Array?e:[e];this._cache.reset(),this._frameNumber++,this.traverseCounter=n.length;var i=[],a=Zi(n),o;try{for(a.s();!(o=a.n()).done;){var s=o.value,u=s.id;this._needTraverse(u)?i.push(u):this.traverseCounter--}}catch(v){a.e(v)}finally{a.f()}var l=Zi(n),f;try{for(l.s();!(f=l.n()).done;){var p=f.value,h=p.id;if(this.roots[h]||(this.roots[h]=this._initializeTileHeaders(this.tileset,null)),!!i.includes(h)){var d=HN(p,this._frameNumber);this._traverser.traverse(this.roots[h],d,this.options)}}}catch(v){l.e(v)}finally{l.f()}}}},{key:"_needTraverse",value:function(e){var n=e;return this.options.viewportTraversersMap&&(n=this.options.viewportTraversersMap[e]),n===e}},{key:"_onTraversalEnd",value:function(e){var n=e.viewport.id;this.frameStateData[n]||(this.frameStateData[n]={selectedTiles:[],_requestedTiles:[],_emptyTiles:[]});var i=this.frameStateData[n],a=Object.values(this._traverser.selectedTiles),o=WN(a,e,this.options.maximumTilesSelected),s=W(o,2),u=s[0],l=s[1];i.selectedTiles=u;var f=Zi(l),p;try{for(f.s();!(p=f.n()).done;){var h=p.value;h.unselect()}}catch(d){f.e(d)}finally{f.f()}i._requestedTiles=Object.values(this._traverser.requestedTiles),i._emptyTiles=Object.values(this._traverser.emptyTiles),this.traverseCounter--,!(this.traverseCounter>0)&&this._updateTiles()}},{key:"_updateTiles",value:function(){this.selectedTiles=[],this._requestedTiles=[],this._emptyTiles=[];for(var e in this.frameStateData){var n=this.frameStateData[e];this.selectedTiles=this.selectedTiles.concat(n.selectedTiles),this._requestedTiles=this._requestedTiles.concat(n._requestedTiles),this._emptyTiles=this._emptyTiles.c
3942oncat(n._emptyTiles)}this.selectedTiles=this.options.onTraversalComplete(this.selectedTiles);var i=Zi(this.selectedTiles),a;try{for(i.s();!(a=i.n()).done;){var o=a.value;this._tiles[o.id]=o}}catch(s){i.e(s)}finally{i.f()}this._loadTiles(),this._unloadTiles(),this._updateStats()}},{key:"_tilesChanged",value:function(e,n){if(e.length!==n.length)return!0;var i=new Set(e.map(function(s){return s.id})),a=new Set(n.map(function(s){return s.id})),o=e.filter(function(s){return!a.has(s.id)}).length>0;return o=o||n.filter(function(s){return!i.has(s.id)}).length>0,o}},{key:"_loadTiles",value:function(){var e=Zi(this._requestedTiles),n;try{for(e.s();!(n=e.n()).done;){var i=n.value;i.contentUnloaded&&this._loadTile(i)}}catch(a){e.e(a)}finally{e.f()}}},{key:"_unloadTiles",value:function(){this._cache.unloadTiles(this,function(e,n){return e._unloadTile(n)})}},{key:"_updateStats",value:function(){var e=0,n=0,i=Zi(this.selectedTiles),a;try{for(i.s();!(a=i.n()).done;){var o=a.value;o.contentAvailable&&o.content&&(e++,o.content.pointCount?n+=o.content.pointCount:n+=o.content.vertexCount)}}catch(s){i.e(s)}finally{i.f()}this.stats.get(_j).count=this.selectedTiles.length,this.stats.get(bj).count=e,this.stats.get(Tj).count=n}},{key:"_initializeTileSet",value:function(){var r=Y(Qo.default.mark(function n(i){return Qo.default.wrap(function(o){for(;;
3942)switch(o.prev=o.next){case 0:if(this.type!==ar.I3S){o.next=5;break}return this.calculateViewPropsI3S(),o.next=4,i.root;case 4:i.root=o.sent;case 5:this.root=this._initializeTileHeaders(i,null),this.type===ar.TILES3D&&(this._initializeTiles3DTileset(i),this.calculateViewPropsTiles3D()),this.type===ar.I3S&&this._initializeI3STileset();case 8:case"end":return o.stop()}},n,this)}));function e(n){return r.apply(this,arguments)}return e}()},{key:"calculateViewPropsI3S",value:function(){var e,n=this.tileset.fullExtent;if(n){var i=n.xmin,a=n.xmax,o=n.ymin,s=n.ymax,u=n.zmin,l=n.zmax;this.cartographicCenter=new z(i+(a-i)/2,o+(s-o)/2,u+(l-u)/2),this.cartesianCenter=et.WGS84.cartographicToCartesian(this.cartographicCenter,new z),this.zoom=iA(n,this.cartographicCenter,this.cartesianCenter);return}var f=(e=this.tileset.store)===null||e===void 0?void 0:e.extent;if(f){var p=W(f,4),h=p[0],d=p[1],v=p[2],m=p[3];this.cartographicCenter=new z(h+(v-h)/2,d+(m-d)/2,0),this.cartesianCenter=et.WGS84.cartographicToCartesian(this.cartographicCenter,new z),this.zoom=qN(f,this.cartographicCenter,this.cartesianCenter);return}console.warn("Extent is not defined in the tileset header"),this.cartographicCenter=new z,this.zoom=1}},{key:"calculateViewPropsTiles3D",value:function(){var e=this.root,n=e.boundingVolume.center;if(!n){console.warn("center was not pre-calculated for the root tile"),this.cartographicCenter=new z,this.zoom=1;return}n[0]!==0||n[1]!==0||n[2]!==0?this.cartographicCenter=et.WGS84.cartesianToCartographic(n,new z):this.cartographicCenter=new z(0,0,-et.WGS84.radii[0]),this.cartesianCenter=n,this.zoom=XN(e.boundingVolume,this.cartographicCenter)}},{key:"_initializeStats",value:function(){this.stats.get(_m),this.stats.get(hA),this.stats.get(pA),this.stats.get(_j),this.stats.get(bj),this.stats.get(xj),this.stats.get(Aj),this.stats.get(Sj),this.stats.get(Tj),this.stats.get(dA,"memory")}},{key:"_initializeTileHeaders",value:function(e,n){var i=new Xc(this,e.root,n);if(n&&(n.children.push(i),i.depth=n.depth+1),this.type===ar.TILES3D){var a=[];for(a.push(i);a.length>0;){var o=a.pop();this.stats.get(_m).incrementCount();var s=o.header.children||[],u=Zi(s),l;try{for(u.s();!(l=u.n()).done;){var f=l.value,p,h=new Xc(this,f,o);if((p=h.contentUrl)!==null&&p!==void 0&&p.includes("?session=")){var d=new URL(h.contentUrl),v=d.searchParams.get("session");v&&(this._queryParams.session=v)}o.children.push(h),h.depth=o.depth+1,a.push(h)}}catch(m){u.e(m)}finally{u.f()}}}return i}},{key:"_initializeTraverser",value:function(){var e,n=this.type;switch(n){case ar.TILES3D:e=cj;break;case ar.I3S:e=mj;break;default:e=Na}return new e({basePath:this.basePath,onTraversalEnd:this._onTraversalEnd.bind(this)})}},{key:"_destroyTileHeaders",value:function(e){this._destroySubtree(e)}},{key:"_loadTile",value:function(){var r=Y(Qo.default.mark(function n(i){var a;return Qo.default.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.prev=0,this._onStartTileLoading(),s.next=4,i.loadContent();case 4:a=s.sent,s.next=10;break;case 7:s.prev=7,s.t0=s.catch(0),this._onTileLoadError(i,s.t0 instanceof Error?s.t0:new Error("load failed"));case 10:return s.prev=10,this._onEndTileLoading(),this._onTileLoad(i,a),s.finish(10);case 14:case"end":return s.stop()}},n,this,[[0,7,10,14]])}));function e(n){return r.apply(this,arguments)}return e}()},{key:"_onTileLoadError",value:function(e,n){this.stats.get(Sj).incrementCount();var i=n.message||n.toString(),a=e.url;console.error("A 3D tile failed to load: ".concat(e.url," ").concat(i)),this.options.onT
3942ileError(e,i,a)}},{key:"_onTileLoad",value:function(e,n){if(n){if(this.type===ar.I3S){var i,a,o=((i=this.tileset)===null||i===void 0||(a=i.nodePagesTile)===null||a===void 0?void 0:a.nodesInNodePages)||0;this.stats.get(_m).reset(),this.stats.get(_m).addCount(o)}e&&e.content&&UN(e,e.content),this.updateContentTypes(e),this._addTileToCache(e),this.options.onTileLoad(e)}}},{key:"updateContentTypes",value:function(e){if(this.type===ar.I3S)switch(e.header.isDracoGeometry&&(this.contentFormats.draco=!0),e.header.textureFormat){case"dds":this.contentFormats.dds=!0;break;case"ktx2":this.contentFormats.ktx2=!0;break;default:}else if(this.type===ar.TILES3D){var n,i=((n=e.content)===null||n===void 0?void 0:n.gltf)||{},a=i.extensionsRemoved,o=a===void 0?[]:a;o.includes("KHR_draco_mesh_compression")&&(this.contentFormats.draco=!0),o.includes("EXT_meshopt_compression")&&(this.contentFormats.meshopt=!0),o.includes("KHR_texture_basisu")&&(this.contentFormats.ktx2=!0)}}},{key:"_onStartTileLoading",value:function(){this._pendingCount++,this.stats.get(hA).incrementCount()}},{key:"_onEndTileLoading",value:function(){this._pendingCount--,this.stats.get(hA).decrementCount()}},{key:"_addTileToCache",value:function(e){this._cache.add(this,e,function(n){return n._updateCacheStats(e)})}},{key:"_updateCacheStats",value:function(e){this.stats.get(xj).incrementCount(),this.stats.get(pA).incrementCount(),this.gpuMemoryUsageInBytes+=e.gpuMemoryUsageInBytes||0,this.stats.get(dA).count=this.gpuMemoryUsageInBytes}},{key:"_unloadTile",value:function(e){this.gpuMemoryUsageInBytes-=e.gpuMemoryUsageInBytes||0,this.stats.get(pA).decrementCount(),this.stats.get(Aj).incrementCount(),this.stats.get(dA).count=this.gpuMemoryUsageInBytes,this.options.onT
3942ileUnload(e),e.unloadContent()}},{key:"_destroy",value:function(){var e=[];for(this.root&&e.push(this.root);e.length>0;){var n=e.pop(),i=Zi(n.children),a;try{for(i.s();!(a=i.n()).done;){var o=a.value;e.push(o)}}catch(s){i.e(s)}finally{i.f()}this._destroyTile(n)}this.root=null}},{key:"_destroySubtree",value:function(e){var n=e,i=[];for(i.push(n);i.length>0;){e=i.pop();var a=Zi(e.children),o;try{for(a.s();!(o=a.n()).done;){var s=o.value;i.push(s)}}catch(u){a.e(u)}finally{a.f()}e!==n&&this._destroyTile(e)}n.children=[]}},{key:"_destroyTile",value:function(e){this._cache.unloadTile(this,e),this._unloadTile(e),e.destroy()}},{key:"_initializeTiles3DTileset",value:function(e){if(e.queryString){var n=new URLSearchParams(e.queryString),i=Object.fromEntries(n.entries());this._queryParams=ja(ja({},this._queryParams),i)}if(this.asset=e.asset,!this.asset)throw new Error("Tileset must have an asset property.");if(this.asset.version!=="0.0"&&this.asset.version!=="1.0")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=e.properties,this.geometricError=e.geometricError,this._extensionsUsed=e.extensionsUsed||[],this.extras=e.extras}},{key:"_initializeI3STileset",value:function(){this.loadOptions.i3s&&"token"in this.loadOptions.i3s&&(this._queryParams.token=this.loadOptions.i3s.token)}}]),t}();var os=me(Ae());var bm="3.4.13";var FA=me(Ae());var es={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect",GLTF:"glTF"},Wut=Object.keys(es);function mA(t,r,e){je(t instanceof ArrayBuffer);var n=new TextDecoder("utf8"),i=new Uint8Array(t,r,e),a=n.decode(i);return a}function wj(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,e=new DataView(t);return"".concat(String.fromCharCode(e.getUint8(r+0))).concat(String.fromCharCode(e.getUint8(r+1))).concat(String.fromCharCode(e.getUint8(r+2))).concat(String.fromCharCode(e.getUint8(r+3)))}k();var rs=me(Ae());F();j();k();var oi,gA=(oi={},c(oi,5130,Float64Array),c(oi,5126,Float32Array),c(oi,5123,Uint16Array),c(oi,5125,Uint32Array),c(oi,5121,Uint8Array),c(oi,5120,Int8Array),c(oi,5122,Int16Array),c(oi,5124,Int32Array),oi),Jse={DOUBLE:5130,FLOAT:5126,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125,UNSIGNED_BYTE:5121,BYTE:5120,SHORT:5122,INT:5124},yA="Failed to convert GL type",Ua=function(){function t(){A(this,t)}return T(t,null,[{key:"fromTypedArray",value:function(e){e=ArrayBuffer.isView(e)?e.constructor:e;for(var n in gA){var i=gA[n];if(i===e)return n}throw new Error(yA)}},{key:"fromName",value:function(e){var n=Jse[e];if(!n)throw new Error(yA);return n}},{key:"getArrayType",value:function(e){switch(e){case 33635:case 32819:case 32820:return Uint16Array;default:var n=gA[e];if(!n)throw new Error(yA);return n}}},{key:"getByteSize",value:function(e){var n=t.getArrayType(e);return n.BYTES_PER_ELEMENT}},{key:"validate",value:function(e){return Boolean(t.getArrayType(e))}},{key:"createTypedArray",value:function(e,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3?arguments[3]:void 0;a===void 0&&(a=(n.byteLength-i)/t.getByteSize(e));var o=t.getArrayType(e);return new o(n,i,a)}}]),t}();function Pj(t,r){if(!t)throw new Error("math.gl assertion failed. ".concat(r))}function _A(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0,0,0],e=t>>11&31,n=t>>5&63,i=t&31;return r[0]=e<<3,r[1]=n<<2,r[2]=i<<3,r}var nlt=1/256;var ilt=new _n,alt=new z,olt=new _n,slt=new _n,ult=new Uint8Array(1);function Oj(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:255;return We(t,0,r)/r*2-1}function Ej(t){return t<0?-1:1}function Cj(t,r,e,n){if(Pj(n),t<0||t>e||r<0||r>e)throw new Error("x and y must be unsigned normalized integers between 0 and ".concat(e));if(n.x=Oj(t,e),n.y=Oj(r,e),n.z=1-(Math.abs(n.x)+Math.abs(n.y)),n.z<0){var i=n.x;n.x=(1-Math.abs(n.y))*Ej(i),n.y=(1-Math.abs(i))*Ej(n.y)}return n.normalize()}function bA(t,r,e){return Cj(t,r,255,e)}F();j();k();var Yu=function(){function t(r,e){A(this,t),c(this,"json",void 0),c(this,"buffer",void 0),c(this,"featuresLength",0),c(this,"_cachedTypedArrays",{}),this.json=r,this.buffer=e}return T(t,[{key:"getExtension",value:function(e){return this.json.extensions&&this.json.extensions[e]}},{key:"hasProperty",value:function(e){return Boolean(this.json[e])}},{key:"getGlobalProperty",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:5125,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,a=this.json[e];return a&&Number.isFinite(a.byteOffset)?this._getTypedArrayFromBinary(e,n,i,1,a.byteOffset):a}},{key:"getPropertyArray",value:function(e,n,i){var a=this.json[e];return a&&Number.isFinite(a.byteOffset)?("componentType"in a&&(n=Ua.fromName(a.componentType)),this._getTypedArrayFromBinary(e,n,i,this.featuresLength,a.byteOffset)):this._getTypedArrayFromArray(e,n,a)}},{key:"getProperty",value:function(e,n,i,a,o){var s=this.json[e];if(!s)return s;var u=this.getPropertyArray(e,n,i);if(i===1)return u[a];for(var l=0;l<i;++l)o[l]=u[i*a+l];return o}},{key:"_getTypedArrayFromBinary",value:function(e,n,i,a,o){var s=this._cachedTypedArrays,u=s[e];return u||(u=Ua.createTypedArray(n,this.buffer.buffer,this.buffer.byteOffset+o,a*i),s[e]=u),u}},{key:"_getTypedArrayFromArray",value:function(e,n,i){var a=this._cachedTypedArrays,o=a[e];return o||(o=Ua.createTypedArray(n,i),a[e]=o),o}}]),t}();F();j();k();var Qse={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},eue={SCALAR:function(r,e){return r[e]},VEC2:function(r,e){return[r[2*e+0],r[2*e+1]]},VEC3:function(r,e){return[r[3*e+0],r[3*e+1],r[3*e+2]]},VEC4:function(r,e){return[r[4*e+0],r[4*e+1],r[4*e+2],r[4*e+3]]},MAT2:function(r,e){return[r[4*e+0],r[4*e+1],r[4*e+2],r[4*e+3]]},MAT3:function(r,e){return[r[9*e+0],r[9*e+1],r[9*e+2],r[9*e+3],r[9*e+4],r[9*e+5],r[9*e+6],r[9*e+7],r[9*e+8]]},MAT4:function(r,e){return[r[16*e+0],r[16*e+1],r[16*e+2],r[16*e+3],r[16*e+4],r[16*e+5],r[16*e+6],r[16*e+7],r[16*e+8],r[16*e+9],r[16*e+10],r[16*e+11],r[16*e+12],r[16*e+13],r[16*e+14],r[16*e+15]]}},tue={SCALAR:function(r,e,n){e[n]=r},VEC2:function(r,e,n){e[2*n+0]=r[0],e[2*n+1]=r[1]},VEC3:function(r,e,n){e[3*n+0]=r[0],e[3*n+1]=r[1],e[3*n+2]=r[2]},VEC4:function(r,e,n){e[4*n+0]=r[0],e[4*n+1]=r[1],e[4*n+2]=r[2],e[4*n+3]=r[3]},MAT2:function(r,e,n){e[4*n+0]=r[0],e[4*n+1]=r[1],e[4*n+2]=r[2],e[4*n+3]=r[3]},MAT3:function(r,e,n){e[9*n+0]=r[0],e[9*n+1]=r[1],e[9*n+2]=r[2],e[9*n+3]=r[3],e[9*n+4]=r[4],e[9*n+5]=r[5],e[9*n+6]=r[6],e[9*n+7]=r[7],e[9*n+8]=r[8],e[9*n+9]=r[9]}
3942,MAT4:function(r,e,n){e[16*n+0]=r[0],e[16*n+1]=r[1],e[16*n+2]=r[2],e[16*n+3]=r[3],e[16*n+4]=r[4],e[16*n+5]=r[5],e[16*n+6]=r[6],e[16*n+7]=r[7],e[16*n+8]=r[8],e[16*n+9]=r[9],e[16*n+10]=r[10],e[16*n+11]=r[11],e[16*n+12]=r[12],e[16*n+13]=r[13],e[16*n+14]=r[14],e[16*n+15]=r[15]}};function Mj(t,r,e,n){var i=t.componentType;je(t.componentType);var a=typeof i=="string"?Ua.fromName(i):i,o=Qse[t.type],s=eue[t.type],u=tue[t.type];e+=t.byteOffset;var l=Ua.createTypedArray(a,r,e,o*n);return{values:l,type:a,size:o,unpacker:s,packer:u}}var si=function(r){return r!==void 0};function Ij(t,r,e){if(!r)return null;var n=t.getExtension("3DTILES_batch_table_hierarchy"),i=r.HIERARCHY;return i&&(console.warn("3D Tile Parser: HIERARCHY is deprecated. Use 3DTILES_batch_table_hierarchy."),r.extensions=r.extensions||{},r.extensions["3DTILES_batch_table_hierarchy"]=i,n=i),n?rue(n,e):null}function rue(t,r){var e,n,i,a=t.instancesLength,o=t.classes,s=t.classIds,u=t.parentCounts,l=t.parentIds,f=a;si(s.byteOffset)&&(s.componentType=defaultValue(s.componentType,5123),s.type=AttributeType.SCALAR,i=getBinaryAccessor(s),s=i.createArrayBufferView(r.buffer,r.byteOffset+s.byteOffset,a));var p;if(si(u))for(si(u.byteOffset)&&(u.componentType=defaultValue(u.componentType,5123),u.type=AttributeType.SCALAR,i=getBinaryAccessor(u),u=i.createArrayBufferView(r.buffer,r.byteOffset+u.byteOffset,a)),p=new Uint16Array(a),f=0,e=0;e<a;++e)p[e]=f,f+=u[e];si(l)&&si(l.byteOffset)&&(l.componentType=defaultValue(l.componentType,5123),l.type=AttributeType.SCALAR,i=getBinaryAccessor(l),l=i.createArrayBufferView(r.buffer,r.byteOffset+l.byteOffset,f));var h=o.length;for(e=0;e<h;++e){var d=o[e].length,v=o[e].instances,m=getBinaryProperties(d,v,r);o[e].instances=combine(m,v)}var g=new Array(h).fill(0),y=new Uint16Array(a);for(e=0;e<a;++e)n=s[e],y[e]=g[n],++g[n];var _={classes:o,classIds:s,classIndexes:y,parentCounts:u,parentIndexes:p,parentIds:l};return aue(_),_}function Ku(t,r,e){if(t){var n=t.parentCounts,i=t.parentIds;return i?e(t,r):n>0?nue(t,r,e):iue(t,r,e)}}function nue(t,r,e){var n=t.classIds,i=t.parentCounts,a=t.parentIds,o=t.parentIndexes,s=n.length,u=scratchVisited;u.length=Math.max(u.length,s);var l=++marker,f=scratchStack;for(f.length=0,f.push(r);f.length>0;)if(r=f.pop(),u[r]!==l){u[r]=l;var p=e(t,r);if(si(p))return p;for(var h=i[r],d=o[r],v=0;v<h;++v){var m=a[d+v];m!==r&&f.push(m)}}return null}function iue(t,r,e){for(var n=!0;n;){var i=e(t,r);if(si(i))return i;var a=t.parentIds[r];n=a!==r,r=a}throw new Error("traverseHierarchySingleParent")}function aue(t){for(var r=[],e=t.classIds,n=e.length,i=0;i<n;++i)Rj(t,i,stack)}function Rj(t,r,e){var n=t.parentCounts,i=t.parentIds,a=t.parentIndexes,o=t.classIds,s=o.length;if(si(i)){assert(r<s,"Parent index ".concat(r," exceeds the total number of instances: ").concat(s)),assert(e.indexOf(r)===-1,"Circular dependency detected in the batch table hierarchy."),e.push(r);for(var u=si(n)?n[r]:1,l=si(n)?a[r]:r,f=0;f<u;++f){var p=i[l+f];p!==r&&Rj(t,p,e)}e.pop(r)}}function Mr(t){return t!=null}var xm=function(r,e){return r},oue={HIERARCHY:!0,extensions:!0,extras:!0},Am=function(){function t(r,e,n){A(this,t);var i,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};c(this,"json",void 0),c(this,"binary",void 0),c(this,"featureCount",void 0),c(this,"_extensions",void 0),c(this,"_properties",void 0),c(this,"_binaryProperties",void 0),c(this,"_hierarchy",void 0),je(n>=0),this.json=r||{},this.binary=e,this.featureCount=n,this._extensions=((i=this.json)===null||i===void 0?void 0:i.extensions)||{},this._properties={};for(var o in this.json)oue[o]||(this._properties[o]=this.json[o]);this._binaryProperties=this._initializeBinaryProperties(),a["3DTILES_batch_table_hierarchy"]&&(this._hierarchy=Ij(this,this.json,this.binary))}return T(t,[{key:"getExtension",value:function(e){return this.json&&this.json.extensions&&this.json.extensions[e]}},{key:"memorySizeInBytes",value:function(){return 0}},{key:"isClass",value:function(e,n){if(this._checkBatchId(e),je(typeof n=="string",n),this._hierarchy){var i=Ku(this._hierarchy,e,function(a,o){var s=a.classIds[o],u=a.classes[s];return u.name===n});return Mr(i)}return!1}},{key:"isExactClass",value:function(e,n){return je(typeof n=="string",n),this.getExactClassName(e)===n}},{key:"getExactClassName",value:function(e){if(this._checkBatchId(e),this._hierarchy){var n=this._hierarchy.classIds[e],i=this._hierarchy.classes[n];return i.name}}},{key:"hasProperty",value:function(e,n){return this._checkBatchId(e),je(typeof n=="string",n),Mr(this._properties[n])||this._hasPropertyInHierarchy(e,n)}},{key:"getPropertyNames",value:function(e,n){var i;this._checkBatchId(e),n=Mr(n)?n:[],n.length=0;var a=Object.keys(this._properties);return(i=n).push.apply(i,ae(a)),this._hierarchy&&this._getPropertyNamesInHierarchy(e,n),n}},{key:"getProperty",value:function(e,n){if(this._checkBatchId(e),je(typeof n=="string",n),this._binaryProperties){var i=this._binaryProperties[n];if(Mr(i))return this._getBinaryProperty(i,e)}var a=this._properties[n];if(Mr(a))return xm(a[e],!0);if(this._hierarchy){var o=this._getHierarchyProperty(e,n);if(Mr(o))return o}}},{key:"setProperty",value:function(e,n,i){var a=this.featureCount;if(this._checkBatchId(e),je(typeof n=="string",n),this._binaryProperties){var o=this._binaryProperties[n];if(o){this._setBinaryProperty(o,e,i);return}}if(!(this._hierarchy&&this._setHierarchyProperty(this,e,n,i))){var s=this._properties[n];Mr(s)||(this._properties[n]=new Array(a),s=this._properties[n]),s[e]=xm(i,!0)}}},{key:"_checkBatchId",value:function(e){var n=e>=0&&e<this.featureCount;if(!n)throw new Error("batchId not in range [0, featureCount - 1].")}},{key:"_getBinaryProperty",value:function(e,n){return e.unpack(e.typedArray,n)}},{key:"_setBinaryProperty",value:function(e,n,i){e.pack(i,e.typedArray,n)}},{key:"_initializeBinaryProperties",value:function(){var e=null;for(var n in this._properties){var i=this._properties[n],a=this._initializeBinaryProperty(n,i);a&&(e=e||{},e[n]=a)}return e}},{key:"_initializeBinaryProperty",value:function(e,n){if("byteOffset"in n){var i=n;je(this.binary,"Property ".concat(e," requires a batch table binary.")),je(i.type,"Property ".concat(e," requires a type."));var a=Mj(i,this.binary.buffer,this.binary.byteOffset|0,this.featureCount);return{typedArray:a.values,componentCount:a.size,unpack:a.unpacker,pack:a.packer}}return null}},{key:"_hasPropertyInHierarchy",value:function(e,n){if(!this._hierarchy)return!1;var i=Ku(this._hierarchy,e,function(a,o){var s=a.classIds[o],u=a.classes[s].instances;return Mr(u[n])});return Mr(i)}},{key:"_getPropertyNamesInHierarchy",value:function(e,n){Ku(this._hierarchy,e,function(i,a){var o=i.classIds[a],s=i.classes[o].instances;for(var u in s)s.hasOwnProperty(u)&&n.indexOf(u)===-1&&n.push(u)})}},{key:"_getHierarchyProperty",value:function(e,n){var i=this;return Ku(this._hierarchy,e,function(a,o){var s=a.classIds[o],u=a.classes[s],l=a.classIndexes[o],f=u.instances[n];return Mr(f)?Mr(f.typedArray)?i._getBinaryProperty(f,l):xm(f[l],!0):null})}},{key:"_setHierarchyProperty",value:function(e,n,i,a){var o=this,s=Ku(this._hierarchy,n,function(u,l){var f=u.classIds[l],p=u.classes[f],h=u.classIndexes[l],d=p.instances[i];return Mr(d)?(je(l===n,'Inherited property "'.concat(i,'" is read-only.')),Mr(d.typedArray)?o._setBinaryProperty(d,h,a):d[h]=xm(a,!0),!0):!1});return Mr(s)}}]),t}();var xA=4;function Ga(t,r){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=new DataView(r);if(t.magic=n.getUint32(e,!0),e+=xA,t.version=n.getUint32(e,!0),e+=xA,t.byteLength=n.getUint32(e,!0),e+=xA,t.version!==1)throw new Error("3D Tile Version ".concat(t.version," not supported"));return e}var Zu=4,Lj="b3dm tile in legacy format.";function Ju(t,r,e){var n=new DataView(r),i;t.header=t.header||{};var a=n.getUint32(e,!0);e+=Zu;var o=n.getUint32(e,!0);e+=Zu;var s=n.getUint32(e,!0);e+=Zu;var u=n.getUint32(e,!0);return e+=Zu,s>=570425344?(e-=Zu*2,i=a,s=o,u=0,a=0,o=0,console.warn(Lj)):u>=570425344&&(e-=Zu,i=s,s=a,u=o,a=0,o=0,console.warn(Lj)),t.header.featureTableJsonByteLength=a,t.header.featureTableBinaryByteLength=o,t.header.batchTableJsonByteLength=s,t.header.batchTableBinaryByteLength=u,t.header.batchLength=i,e}function Qu(t,r,e,n){return e=sue(t,r,e,n),e=uue(t,r,e,n),e}function sue(t,r,e,n){var i=t.header,a=i.featureTableJsonByteLength,o=i.featureTableBinaryByteLength,s=i.batchLength;
3942if(t.featureTableJson={BATCH_LENGTH:s||0},a>0){var u=mA(r,e,a);t.featureTableJson=JSON.parse(u)}return e+=a,t.featureTableBinary=new Uint8Array(r,e,o),e+=o,e}function uue(t,r,e,n){var i=t.header,a=i.batchTableJsonByteLength,o=i.batchTableBinaryByteLength;if(a>0){var s=mA(r,e,a);t.batchTableJson=JSON.parse(s),e+=a,o>0&&(t.batchTableBinary=new Uint8Array(r,e,o),t.batchTableBinary=new Uint8Array(t.batchTableBinary),e+=o)}return e}function AA(t,r,e){if(!r&&(!t||!t.batchIds||!e))return null;var n=t.batchIds,i=t.isRGB565,a=t.pointCount;if(n&&e){for(var o=new Uint8ClampedArray(a*3),s=0;s<a;s++){var u=n[s],l=e.getProperty(u,"dimensions"),f=l.map(function(v){return v*255});o[s*3]=f[0],o[s*3+1]=f[1],o[s*3+2]=f[2]}return{type:5121,value:o,size:3,normalized:!0}}if(i){for(var p=new Uint8ClampedArray(a*3),h=0;h<a;h++){var d=_A(r[h]);p[h*3]=d[0],p[h*3+1]=d[1],p[h*3+2]=d[2]}return{type:5121,value:p,size:3,normalized:!0}}return r&&r.length===a*3?{type:5121,value:r,size:3,normalized:!0}:{type:5121,value:r,size:4,normalized:!0}}var kj=new z;function Bj(t,r){if(!r)return null;if(t.isOctEncoded16P){for(var e=new Float32Array(t.pointsLength*3),n=0;n<t.pointsLength;n++)bA(r[n*2],r[n*2+1],kj),kj.toArray(e,n*3);return{type:5126,size:2,value:e}}return{type:5126,size:2,value:r}}function Fj(t,r,e){return t.isQuantized?e["3d-tiles"]&&e["3d-tiles"].decodeQuantizedPositions?(t.isQuantized=!1,lue(t,r)):{type:5123,value:r,size:3,normalized:!0}:r}function lue(t,r){for(var e=new z,n=new Float32Array(t.pointCount*3),i=0;i<t.pointCount;i++)e.set(r[i*3],r[i*3+1],r[i*3+2]).scale(1/t.quantizedRange).multiply(t.quantizedVolumeScale).add(t.quantizedVolumeOffset).toArray(n,i*3);return n}function Dj(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function ts(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?Dj(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Dj(Object(e)).forEac
3942h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function Nj(t,r,e,n,i){return SA.apply(this,arguments)}function SA(){return SA=Y(rs.default.mark(function t(r,e,n,i,a){var o,s,u;return rs.default.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return n=Ga(r,e,n),n=Ju(r,e,n),n=Qu(r,e,n,i),fue(r),o=cue(r),s=o.featureTable,u=o.batchTable,f.next=7,mue(r,s,u,i,a);case 7:return pue(r,s,i),hue(r,s,u),due(r,s),f.abrupt("return",n);case 11:case"end":return f.stop()}},t)})),SA.apply(this,arguments)}function fue(t){t.attributes={positions:null,colors:null,normals:null,batchIds:null},t.isQuantized=!1,t.isTranslucent=!1,t.isRGB565=!1,t.isOctEncoded16P=!1}function cue(t){var r=new Yu(t.featureTableJson,t.featureTableBinary),e=r.getGlobalProperty("POINTS_LENGTH");if(!Number.isFinite(e))throw new Error("POINTS_LENGTH must be defined");r.featuresLength=e,t.featuresLength=e,t.pointsLength=e,t.pointCount=e,t.rtcCenter=r.getGlobalProperty("RTC_CENTER",5126,3);var n=vue(t,r);return{featureTable:r,batchTable:n}}function pue(t,r,e){if(!t.attributes.positions){if(r.hasProperty("POSITION"))t.attributes.positions=r.getPropertyArray("POSITION",5126,3);else if(r.hasProperty("POSITION_QUANTIZED")){var n=r.getPropertyArray("POSITION_QUANTIZED",5123,3);if(t.isQuantized=!0,t.quantizedRange=(1<<16)-1,t.quantizedVolumeScale=r.getGlobalProperty("QUANTIZED_VOLUME_SCALE",5126,3),!t.quantizedVolumeScale)throw new Error("QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");if(t.quantizedVolumeOffset=r.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",5126,3),!t.quantizedVolumeOffset)throw new Error("QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");t.attributes.positions=Fj(t,n,e)}}if(!t.attributes.positions)throw new Error("Either POSITION or POSITION_QUANTIZED must be defined.")}function hue(t,r,e){if(!t.attributes.colors){var n=null;r.hasProperty("RGBA")?(n=r.getPropertyArray("RGBA",5121,4),t.isTranslucent=!0):r.hasProperty("RGB")?n=r.getPropertyArray("RGB",5121,3):r.hasProperty("RGB565")&&(n=r.getPropertyArray("RGB565",5123,1),t.isRGB565=!0),t.attributes.colors=AA(t,n,e)}r.hasProperty("CONSTANT_RGBA")&&(t.constantRGBA=r.getGlobalProperty("CONSTANT_RGBA",5121,4))}function due(t,r){if(!t.attributes.normals){var e=null;r.hasProperty("NORMAL")?e=r.getPropertyArray("NORMAL",5126,3):r.hasProperty("NORMAL_OCT16P")&&(e=r.getPropertyArray("NORMAL_OCT16P",5121,2),t.isOctEncoded16P=!0),t.attributes.normals=Bj(t,e)}}function vue(t,r){var e=null;if(!t.batchIds&&r.hasProperty("BATCH_ID")&&(t.batchIds=r.getPropertyArray("BATCH_ID",5123,1),t.batchIds)){var n=r.getGlobalProperty("BATCH_LENGTH");if(!n)throw new Error("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");var i=t.batchTableJson,a=t.batchTableBinary;e=new Am(i,a,n)}return e}function mue(t,r,e,n,i){return TA.apply(this,arguments)}function TA(){return TA=Y(rs.default.mark(function t(r,e,n,i,a){var o,s,u,l,f,p,h,d;return rs.default.wrap(function(m){for(;;)switch(m.prev=m.next){case 0:if(l=r.batchTableJson&&r.batchTableJson.extensions&&r.batchTableJson.extensions["3DTILES_draco_point_compression"],l&&(u=l.properties),f=e.getExtension("3DTILES_draco_point_compression"),!f){m.next=15;break}if(s=f.properties,p=f.byteOffset,h=f.byteLength,!(!s||!Number.isFinite(p)||!h)){m.next=9;break}throw new Error("Draco properties, byteOffset, and byteLength must be defined");case 9:o=r.featureTableBinary.slice(p,p+h),r.hasPositions=Number.isFinite(s.POSITION),r.hasColors=Number.isFinite(s.RGB)||Number.isFinite(s.RGBA),r.hasNormals=Number.isFinite(s.NORMAL),r.hasBatchIds=Number.isFinite(s.BATCH_ID),r.isTranslucent=Number.isFinite(s.RGBA);case 15:if(o){m.next=17;break}return m.abrupt("return",!0);case 17:return d={buffer:o,properties:ts(ts({},s),u),featureTableProperties:s,batchTableProperties:u,dequantizeInShader:!1},m.next=20,gue(r,d,i,a);case 20:return m.abrupt("return",m.sent);case 21:case"end":return m.stop()}},t)})),TA.apply(this,arguments)}function gue(t,r,e,n){return wA.apply(this,arguments)}function wA(){return wA=Y(rs.default.mark(function t(r,e,n,i){var a,o,s,u,l,f,p,h,d,v,m,g,y,_,b;return rs.default.wrap(function(w){for(;;)switch(w.prev=w.next){case 0:return a=i.parse,o=ts(ts({},n),{},{draco:ts(ts({},n.draco),{},{extraAttributes:e.batchTableProperties||{}})}),delete o["3d-tiles"],w.next=5,a(e.buffer,im,o);case 5:if(s=w.sent,u=s.attributes.POSITION&&s.attributes.POSITION.value,l=s.attributes.COLOR_0&&s.attributes.COLOR_0.value,f=s.attributes.NORMAL&&s.attributes.NORMAL.value,p=s.attributes.BATCH_ID&&s.attributes.BATCH_ID.value,h=u&&s.attributes.POSITION.value.quantization,d=f&&s.attributes.NORMAL.value.quantization,h&&(v=s.POSITION.data.quantization,m=v.range,r.quantizedVolumeScale=new z(m,m,m),r.quantizedVolumeOffset=new z(v.minValues),r.quantizedRange=(1<<v.quantizationBits)-1,r.isQuantizedDraco=!0),d&&(r.octEncodedRange=(1<<s.NORMAL.data.quantization.quantizationBits)-1,r.isOctEncodedDraco=!0),g={},e.batchTableProperties)for(y=0,_=Object.keys(e.batchTableProperties);y<_.length;y++)b=_[y],s.attributes[b]&&s.attributes[b].value&&(g[b.toLowerCase()]=s.attributes[b].value);r.attributes=ts({positions:u,colors:AA(r,l,void 0),normals:f,batchIds:p},g);case 17:case"end":return w.stop()}},t)})),wA.apply(this,arguments)}var EA=me(Ae());var PA=me(Ae());var Sm={URI:0,EMBEDDED:1};function Tm(t,r,e,n){t.rotateYtoZ=!0;var i=t.byteOffset+t.byteLength-e;if(i===0)throw new Error("glTF byte length must be greater than 0.");return t.gltfUpAxis=n["3d-tiles"]&&n["3d-tiles"].assetGltfUpAxis?n["3d-tiles"].assetGltfUpAxis:"Y",t.gltfArrayBuffer=Qa(r,e,i),t.gltfByteOffset=0,t.gltfByteLength=i,e%4===0||console.warn("".concat(t.type,": embedded glb is not aligned to a 4-byte boundary.")),t.byteOffset+t.byteLength}function wm(t,r,e,n){return OA.apply(this,arguments)}function OA(){return OA=Y(PA.default.mark(function t(r,e,n,i){var a,o,s;return PA.default.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(a=n["3d-tiles"]||{},yue(r,e,n),!a.loadGLTF){l.next=17;break}if(o=i.parse,s=i.fetch,!r.gltfUrl){l.next=9;break}return l.next=7,s(r.gltfUrl,n);case 7:r.gltfArrayBuffer=l.sent,r.gltfByteOffset=0;case 9:if(!r.gltfArrayBuffer){l.next=17;break}return l.next=12,o(r.gltfArrayBuffer,Wi,n,i);case 12:r.gltf=l.sent,r.gpuMemoryUsageInBytes=Bc(r.gltf),delete r.gltfArrayBuffer,delete r.gltfByteOffset,delete r.gltfByteLength;case 17:case"end":return l.stop()}},t)})),OA.apply(this,arguments)}function yue(t,r,e){switch(r){case Sm.URI:var n=new Uint8Array(t.gltfArrayBuffer,t.gltfByteOffset),i=new TextDecoder,a=i.decode(n);t.gltfUrl=a.replace(/[\s\0]+$/,""),delete t.gltfArrayBuffer,delete t.gltfByteOffset,delete t.gltfByteLength;break;case Sm.EMBEDDED:break;default:throw new Error("b3dm: Illegal glTF format field")}}function jj(t,r,e,n,i){return CA.apply(this,arguments)}function CA(){return CA=Y(EA.default.mark(function t(r,e,n,i,a){var o,s;return EA.default.wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return n=_ue(r,e,n,i,a),l.next=3,wm(r,Sm.EMBEDDED,i,a);case 3:return s=r==null||(o=r.gltf)===null||o===void 0?void 0:o.extensions,s&&s.CESIUM_RTC&&(r.rtcCe
3942nter=s.CESIUM_RTC.center),l.abrupt("return",n);case 6:case"end":return l.stop()}},t)})),CA.apply(this,arguments)}function _ue(t,r,e,n,i){e=Ga(t,r,e),e=Ju(t,r,e),e=Qu(t,r,e,n),e=Tm(t,r,e,n);var a=new Yu(t.featureTableJson,t.featureTableBinary);return t.rtcCenter=a.getGlobalProperty("RTC_CENTER",5126,3),e}var MA=me(Ae());function Uj(t,r,e,n,i){return IA.apply(this,arguments)}function IA(){return IA=Y(MA.default.mark(function t(r,e,n,i,a){return MA.default.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return n=bue(r,e,n,i,a),s.next=3,wm(r,r.gltfFormat,i,a);case 3:return s.abrupt("return",n);case 4:case"end":return s.stop()}},t)})),IA.apply(this,arguments)}function bue(t,r,e,n,i){if(e=Ga(t,r,e),t.version!==1)throw new Error("Instanced 3D Model version ".concat(t.version," is not supported"));e=Ju(t,r,e);var a=new DataView(r);if(t.gltfFormat=a.getUint32(e,!0),e+=4,e=Qu(t,r,e,n),e=Tm(t,r,e,n),t.featureTableJsonByteLength===0)throw new Error("i3dm parser: featureTableJsonByteLength is zero.");var o=new Yu(t.featureTableJson,t.featureTableBinary),s=o.getGlobalProperty("INSTANCES_LENGTH");if(o.featuresLength=s,!Number.isFinite(s))throw new Error("i3dm parser: INSTANCES_LENGTH must be defined");t.eastNorthUp=o.getGlobalProperty("EAST_NORTH_UP"),t.rtcCenter=o.getGlobalProperty("RTC_CENTER",5126,3);var u=new Am(t.batchTableJson,t.batchTableBinary,s);return xue(t,o,u,s),e}function xue(t,r,e,n){for(var i={instances:new Array(n),batchTable:t._batchTable,cull:!1,url:void 0,gltf:void 0,basePath:void 0,incrementallyLoadTextures:!1,forwardAxis:[1,0,0]},a=i.instances,o=new z,s=new z,u=new z,l=new z,f=new at,p=new Vn,h=new z,d={},v=new ye,m=[],g=[],y=new z,_=new z,b=0;b<n;b++){var x=void 0;if(r.hasProperty("POSITION"))x=r.getProperty("POSITION",5126,3,b,o);else if(r.hasProperty("POSITION_QUANTIZED")){x=r.getProperty("POSITION_QUANTIZED",5123,3,b,o);var w=r.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",5126,3,y);if(!w)throw new Error("i3dm parser: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");var P=r.getGlobalProperty("QUANTIZED_VOLUME_SCALE",5126,3,_);if(!P)throw new Error("i3dm parser: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");for(var E=65535,C=0;C<3;C++)x[C]=x[C]/E*P[C]+w[C]}if(!x)throw new Error("i3dm: POSITION or POSITION_QUANTIZED must be defined for each instance.");o.copy(x),d.translation=o,t.normalUp=r.getProperty("NORMAL_UP",5126,3,b,m),t.normalRight=r.getProperty("NORMAL_RIGHT",5126,3,b,g);var I=!1;if(t.normalUp){if(!t.normalRight)throw new Error("i3dm: Custom orientation requires both NORMAL_UP and NORMAL_RIGHT.");t.hasCustomOrientation=!0}else{if(t.octNormalUp=r.getProperty("NORMAL_UP_OCT32P",5123,2,m),t.octNormalRight=r.getProperty("NORMAL_RIGHT_OCT32P",5123,2,g),t.octNormalUp)throw t.octNormalRight?new Error("i3dm: oct-encoded orientation not implemented"):new Error("i3dm: oct-encoded orientation requires NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P");t.eastNorthUp?(et.WGS84.eastNorthUpToFixedFrame(o,v),v.getRotationMatrix3(f)):f.identity()}I&&(l.copy(s).cross(u).normalize(),f.setColumn(0,s),f.setColumn(1,u),f.setColumn(2,l)),p.fromMatrix3(f),d.rotation=p,h.set(1,1,1);var O=r.getProperty("SCALE",5126,1,b);Number.isFinite(O)&&h.multiplyByScalar(O);var D=r.getProperty("SCALE_NON_UNIFORM",5126,3,b,m);D&&h.scale(D),d.scale=h;var N=r.getProperty("BATCH_ID",5123,1,b);N===void 0&&(N=b);var H=new ye().fromQuaternion(d.rotation);v.identity(),v.translate(d.translation),v.multiplyRight(H),v.scale(d.scale);var $=v.clone();a[b]={modelMatrix:$,batchId:N}}t.instances=a}var RA=me(Ae());function Gj(t,r,e,n,i,a){return LA.apply(this,arguments)}function LA(){return LA=Y(RA.default.mark(function t(r,e,n,i,a,o){var s,u;return RA.default.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:n=Ga(r,e,n),s=new DataView(e),r.tilesLength=s.getUint32(n,!0),n+=4,r.tiles=[];case 5:if(!(r.tiles.length<r.tilesLength&&r.byteLength-n>12)){f.next=13;break}return u={},r.tiles.push(u),f.next=10,o(e,n,i,a,u);case 10:n=f.sent,f.next=5;break;case 13:return f.abrupt("return",n);case 14:case"end":return f.stop()}},t)})),LA.apply(this,arguments)}var kA=me(Ae());function zj(t,r,e,n){return BA.apply(this,arguments)}function BA(){return BA=Y(kA.default.mark(function t(r,e,n,i){var a;return kA.default.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return r.rotateYtoZ=!0,r.gltfUpAxis=n["3d-tiles"]&&n["3d-tiles"].assetGltfUpAxis?n["3d-tiles"].assetGltfUpAxis:"Y",a=i.parse,s.next=5,a(e,Wi,n,i);case 5:r.gltf=s.sent,r.gpuMemoryUsageInBytes=Bc(r.gltf);case 7:case"end":return s.stop()}},t)})),BA.apply(this,arguments)}function NA(t){return DA.apply(this,arguments)}function DA(){return DA=Y(FA.default.mark(function t(r){var e,n,i,a,o=arguments;return FA.default.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:e=o.length>1&&o[1]!==void 0?o[1]:0,n=o.length>2?o[2]:void 0,i=o.length>3?o[3]:void 0,a=o.length>4&&o[4]!==void 0?o[4]:{},a.byteOffset=e,a.type=wj(r,e),u.t0=a.type,u.next=u.t0===es.COMPOSITE?9:u.t0===es.BATCHED_3D_MODEL?12:u.t0===es.GLTF?15:u.t0===es.INSTANCED_3D_MODEL?18:u.t0===es.POINT_CLOUD?21:24;break;case 9:return u.next=11,Gj(a,r,e,n,i,NA);case 11:return u.abrupt("return",u.sent);case 12:return u.next=14,jj(a,r,e,n,i);case 14:return u.abrupt("return",u.sent);case 15:return u.next=17,zj(a,r,n,i);case 17:return u.abrupt("return",u.sent);case 18:return u.next=20,Uj(a,r,e,n,i);case 20:return u.abrupt("return",u.sent);case 21:return u.next=23,Nj(a,r,e,n,i);case 23:return u.abrupt("return",u.sent);case 24:throw new Error("3DTileLoader: unknown type ".concat(a.type));case 25:case"end":return u.stop()}},t)})),DA.apply(this,arguments)}var as=me(Ae());
3942var qc=me(Ae()),Aue=1952609651,Sue=1;function zA(t,r,e){return UA.apply(this,arguments)}function UA(){return UA=Y(qc.default.mark(function t(r,e,n){var i,a,o,s,u,l,f,p,h;return qc.default.wrap(function(v){for(;;)switch(v.prev=v.next){case 0:if(i=new Uint32Array(r.slice(0,4)),i[0]===Aue){v.next=3;break}throw new Error("Wrong subtree file magic number");case 3:if(a=new Uint32Array(r.slice(4,8)),a[0]===Sue){v.next=6;break}throw new Error("Wrong subtree file verson, must be 1");case 6:if(o=Vj(r.slice(8,16)),s=new Uint8Array(r,24,o),u=new TextDecoder("utf8"),l=u.decode(s),f=JSON.parse(l),p=Vj(r.slice(16,24)),h=new ArrayBuffer(0),p&&(h=r.slice(24+o)),!("bufferView"in f.tileAvailability)){v.next=18;break}return v.next=17,jA(f,"tileAvailability",h,n);case 17:f.tileAvailability.explicitBitstream=v.sent;case 18:if(!("bufferView"in f.contentAvailability)){v.next=22;break}return v.next=21,jA(f,"contentAvailability",h,n);case 21:f.contentAvailability.explicitBitstream=v.sent;case 22:if(!("bufferView"in f.childSubtreeAvailability)){v.next=26;break}return v.next=25,jA(f,"childSubtreeAvailability",h,n);case 25:f.childSubtreeAvailability.explicitBitstream=v.sent;case 26:return v.abrupt("return",f);case 27:case"end":return v.stop()}},t)})),UA.apply(this,arguments)}function Tue(t,r){var e=r.startsWith("http");if(e){var n=new URL(t,r);return decodeURI(n.toString())}var i="http://".concat(r),a=new URL(t,i);return"/".concat(a.host).concat(a.pathname)}function jA(t,r,e,n){return GA.apply(this,arguments)}function GA(){return GA=Y(qc.default.mark(function t(r,e,n,i){var a,o,s,u,l,f;return qc.default.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(a=r[e].bufferView,o=r.bufferViews[a],s=r.buffers[o.buffer],!(!(i!=null&&i.url)||!i.fetch)){h.next=5;break}throw new Error("Url is not provided");case 5:if(i.fetch){h.next=7;break}throw new Error("fetch is not provided");case 7:if(!s.uri){h.next=16;break}return u=Tue(s.uri,i?.url),h.next=11,i.fetch(u);case 11:return l=h.sent,h.next=14,l.arrayBuffer();case 14:return f=h.sent,h.abrupt("return",new Uint8Array(f,o.byteOffset,o.byteLength));case 16:return h.abrupt("return",new Uint8Array(n,o.byteOffset,o.byteLength));case 17:case"end":return h.stop()}},t)})),GA.apply(this,arguments)}function Vj(t){var r=new DataView(t),e=r.getUint32(0,!0),n=r.getUint32(4,!0);return e+Math.pow(2,32)*n}var Pm={id:"3d-tiles-subtree",name:"3D Tiles Subtree",module:"3d-tiles",version:bm,extensions:["subtree"],mimeTypes:["application/octet-stream"],tests:["subtree"],parse:zA,options:{}};be();k();var tS=me(Ae());var an=null;try{an=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function ht(t,r,e){this.low=t|0,this.high=r|0,this.unsigned=!!e}ht.prototype.__isLong__;Object.defineProperty(ht.prototype,"__isLong__",{value:!0});function sr(t){return(t&&t.__isLong__)===!0}function Hj(t){var r=Math.clz32(t&-t);return t?31-r:r}ht.isLong=sr;var Wj={},$j={};function ns(t,r){var e,n,i;return r?(t>>>=0,(i=0<=t&&t<256)&&(n=$j[t],n)?n:(e=tt(t,0,!0),i&&($j[t]=e),e)):(t|=0,(i=-128<=t&&t<128)&&(n=Wj[t],n)?n:(e=tt(t,t<0?-1:0,!1),i&&(Wj[t]=e),e))}ht.fromInt=ns;function on(t,r){if(isNaN(t))return r?Ji:On;if(r){if(t<0)return Ji;if(t>=Kj)return Qj}else{if(t<=-qj)return Ir;if(t+1>
vendor: 4,426 bytes, line 3942
3942=qj)return Jj}return t<0?on(-t,r).neg():tt(t%tl|0,t/tl|0,r)}ht.fromNumber=on;function tt(t,r,e){return new ht(t,r,e)}ht.fromBits=tt;var Om=Math.pow;function HA(t,r,e){if(t.length===0)throw Error("empty string");if(typeof r=="number"?(e=r,r=!1):r=!!r,t==="NaN"||t==="Infinity"||t==="+Infinity"||t==="-Infinity")return r?Ji:On;if(e=e||10,e<2||36<e)throw RangeError("radix");var n;if((n=t.indexOf("-"))>0)throw Error("interior hyphen");if(n===0)return HA(t.substring(1),r,e).neg();for(var i=on(Om(e,8)),a=On,o=0;o<t.length;o+=8){var s=Math.min(8,t.length-o),u=parseInt(t.substring(o,o+s),e);if(s<8){var l=on(Om(e,s));a=a.mul(l).add(on(u))}else a=a.mul(i),a=a.add(on(u))}return a.unsigned=r,a}ht.fromString=HA;function En(t,r){return typeof t=="number"?on(t,r):typeof t=="string"?HA(t,r):tt(t.low,t.high,typeof r=="boolean"?r:t.unsigned)}ht.fromValue=En;var Xj=1<<16,wue=1<<24,tl=Xj*Xj,Kj=tl*tl,qj=Kj/2,Yj=ns(wue),On=ns(0);ht.ZERO=On;var Ji=ns(0,!0);ht.UZERO=Ji;var el=ns(1);ht.ONE=el;var Zj=ns(1,!0);ht.UONE=Zj;var VA=ns(-1);ht.NEG_ONE=VA;var Jj=tt(-1,2147483647,!1);ht.MAX_VALUE=Jj;var Qj=tt(-1,-1,!0);ht.MAX_UNSIGNED_VALUE=Qj;var Ir=tt(0,-2147483648,!1);ht.MIN_VALUE=Ir;var le=ht.prototype;le.toInt=function(){return this.unsigned?this.low>>>0:this.low};le.toNumber=function(){return this.unsigned?(this.high>>>0)*tl+(this.low>>>0):this.high*tl+(this.low>>>0)};le.toString=function(r){if(r=r||10,r<2||36<r)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(Ir)){var e=on(r),n=this.div(e),i=n.mul(e).sub(this);return n.toString(r)+i.toInt().toString(r)}else return"-"+this.neg().toString(r);for(var a=on(Om(r,6),this.unsigned),o=this,s="";;){var u=o.div(a),l=o.sub(u.mul(a)).toInt()>>>0,f=l.toString(r);if(o=u,o.isZero())return f+s;for(;f.length<6;)f="0"+f;s=""+f+s}};le.getHighBits=function(){return this.high};le.getHighBitsUnsigned=function(){return this.high>>>0};le.getLowBits=function(){return this.low};le.getLowBitsUnsigned=function(){return this.low>>>0};le.getNumBitsAbs=function(){if(this.isNegative())return this.eq(Ir)?64:this.neg().getNumBitsAbs();for(var r=this.high!=0?this.high:this.low,e=31;e>0&&!(r&1<<e);e--);return this.high!=0?e+33:e+1};le.isZero=function(){return this.high===0&&this.low===0};le.eqz=le.isZero;le.isNegative=function(){return!this.unsigned&&this.high<0};le.isPositive=function(){return this.unsigned||this.high>=0};le.isOdd=function(){return(this.low&1)===1};le.isEven=function(){return(this.low&1)===0};le.equals=function(r){return sr(r)||(r=En(r)),this.unsigned!==r.unsigned&&this.high>>>31===1&&r.high>>>31===1?!1:this.high===r.high&&this.low===r.low};le.eq=le.equals;le.notEquals=function(r){return!this.eq(r)};le.neq=le.notEquals;le.ne=le.notEquals;le.lessThan=function(r){return this.comp(r)<0};le.lt=le.lessThan;le.lessThanOrEqual=function(r){return this.comp(r)<=0};le.lte=le.lessThanOrEqual;le.le=le.lessThanOrEqual;le.greaterThan=function(r){return this.comp(r)>0};le.gt=le.greaterThan;le.greaterThanOrEqual=function(r){return this.comp(r)>=0};le.gte=le.greaterThanOrEqual;le.ge=le.greaterThanOrEqual;le.compare=function(r){if(sr(r)||(r=En(r)),this.eq(r))return 0;var e=this.isNegative(),n=r.isNegative();return e&&!n?-1:!e&&n?1:this.unsigned?r.high>>>0>this.high>>>0||r.high===this.high&&r.low>>>0>this.low>>>0?-1:1:this.sub(r).isNegative()?-1:1};le.comp=le.compare;le.negate=function(){return!this.unsigned&&this.eq(Ir)?Ir:this.not().add(el)};le.neg=le.negate;le.add=function(r){sr(r)||(r=En(r));var e=this.high>>>16,n=this.high&65535,i=this.low>>>16,a=this.low&65535,o=r.high>>>16,s=r.high&65535,u=r.low>>>16,l=r.low&65535,f=0,p=0,h=0,d=0;return d+=a+l,h+=d>>>16,d&=65535,h+=i+u,p+=h>>>16,h&=65535,p+=n+s,f+=p>>>16,p&=65535,f+=e+o,f&=65535,tt(h<<16|d,f<<16|p,this.unsigned)};le.subtract=function(r){return sr(r)||(r=En(r)),this.add(r.neg())};le.sub=le.subtract;le.multiply=function(r){if(this.isZero())return this;if(sr(r)||(r=En(r)),an){var e=an.mul(this.low,this.high,r.low,r.high);return tt(e,an.get_high(),this.unsigned)}if(r.isZero())return this.unsigned?Ji:On;if(this.eq(Ir))return r.isOdd()?Ir:On;if(r.eq(Ir))return this.isOdd()?Ir:On;if(this.isNegative())return r.isNegative()?this.neg().mul(r.neg()):this.neg().mul(r).neg();if(r.isNegative())return this.mul(r.neg()).neg();if(this.lt(Yj)&&r.lt(Yj))return on(this.toNumber()*r.toNumber(),this.unsigned);var n=this.high>>>16,i=this.high&65535,a=this.low>>>16,o=this.low&65535,s=r.high>
3942>>16,u=r.high&65535,l=r.low>>>16,f=r.low&65535,p=0,h=0,d=0,v=0;return v+=o*f,d+=v>>>16,v&=65535,d+=a*f,h+=d>>>16,d&=65535,d+=o*l,h+=d>>>16,d&=65535,h+=i*f,p+=h>>>16,h&=65535,h+=a*l,p+=h>>>16,h&=65535,h+=o*u,p+=h>>>16,h&=65535,p+=n*f+i*l+a*u+o*s,p&=65535,tt(d<<16|v,p<<16|h,this.unsigned)};le.mul=le.multiply;le.divide=function(r){if(sr(r)||(r=En(r)),r.isZero())throw Error("division by zero");if(an){if(!this.unsigned&&this.high===-2147483648&&r.low===-1&&r.high===-1)return this;var e=(this.unsigned?an.div_u:an.div_s)(this.low,this.high,r.low,r.high);return tt(e,an.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?Ji:On;var n,i,a;if(this.unsigned){if(r.unsigned||(r=r.toUnsigned()),r.gt(this))return Ji;if(r.gt(this.shru(1)))return Zj;a=Ji}else{if(this.eq(Ir)){if(r.eq(el)||r.eq(VA))return Ir;if(r.eq(Ir))return el;var o=this.shr(1);return n=o.div(r).shl(1),n.eq(On)?r.isNegative()?el:VA:(i=this.sub(r.mul(n)),a=n.add(i.div(r)),a)}else if(r.eq(Ir))return this.unsigned?Ji:On;if(this.isNegative())return r.isNegative()?this.neg().div(r.neg()):this.neg().div(r).neg();if(r.isNegative())return this.div(r.neg()).neg();a=On}for(i=this;i.gte(r);){n=Math.max(1,Math.floor(i.toNumber()/r.toNumber()));for(var s=Math.ceil(Math.log(n)/Math.LN2),u=s<=48?1:Om(2,s-48),l=on(n),f=l.mul(r);f.isNegative()||f.gt(i);)n-=u,l=on(n,this.unsigned),f=l.mul(r);l.isZero()&&(l=el),a=a.add(l),i=i.sub(f)}return a};le.div=le.divide;le.modulo=function(r){if(sr(r)||(r=En(r)),an){var e=(this.unsigned?an.rem_u:an.rem_s)(this.low,this.high,r.low,r.high);return tt(e,an.get_high(),this.unsigned)}return this.sub(this.div(r).mul(r))};le.mod=le.modulo;le.rem=le.modulo;le.not=function(){return tt(~this.low,~this.high,this.unsigned)};le.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32};le.clz=le.countLeadingZeros;le.countTrailingZeros=function(){return this.low?Hj(this.low):Hj(this.high)+32};le.ctz=le.countTrailingZeros;le.and=function(r){return sr(r)||(r=En(r)),tt(this.low&r.low,this.high&r.high,this.unsigned)};le.or=function(r){return sr(r)||(r=En(r)),tt(this.low|r.low,this.high|r.high,this.unsigned)};le.xor=function(r){return sr(r)||(r=En(r)),tt(this.low^r.low,this.high^r.high,this.unsigned)};le.shiftLeft=function(r){return sr(r)&&(r=r.toInt()),(r&=63)===0?this:r<32?tt(this.low<<r,this.high<<r|this.low>>>32-r,this.unsigned):tt(0,this.low<<r-32,this.unsigned)};le.shl=le.shiftLeft;le.shiftRight=function(r){return sr(r)&&(r=r.toInt()),(r&=63)===0?this:r<32?tt(this.low>>>r|this.high<<32-r,this.high>>r,this.unsigned):tt(this.high>>r-32,this.high>=0?0:-1,this.unsigned)};le.shr=le.shiftRight;le.shiftRightUnsigned=function(r){return sr(r)&&(r=r.toInt()),(r&=63)===0?this:r<32?tt(this.low>>>r|this.high<<32-r,this.high>>>r,this.unsigned):r===32?tt(this.high,0,this.unsigned):tt(this.high>>>r-32,0,this.unsigned)};le.shru=le.shiftRightUnsigned;le.shr_u=le.shiftRightUnsigned;le.rotateLeft=function(r){var e;return sr(r)&&(r=r.toInt()),(r&=63)===0?this:r===32?tt(this.high,this.low,this.unsigned):r<32?(e=32-r,tt(this.low<<r|this.high>>>e,this.high<<r|this.low>>>e,this.unsigned)):(r-=32,e=32-r,tt(this.high<<r|this.low>>>e,this.low<<r|this.high>>>e,this.unsigned))};le.rotl=le.rotateLeft;le.rotateRight=function(r){var e;return sr(r)&&(r=r.toInt()),(r&=63)===0?this:r===32?tt(this.high,this.low,this.unsigned):r<32?(e=32-r,tt(this.high<<e|this.low>>>r,this.low<<e|this.high>>>r,this.unsigned)):(r-=32,e=32-r,tt(this.low<<e|this.high>>>r,this.high<<e|this.low>>>r,this.unsigned))};le.rotr=le.rotateRight;le.toSigned=function(){return this.unsigned?tt(this.low,this.high,!1):this};le.toUnsigned=function(){return this.unsigned?this:tt(this.low,this.high,!0)};le.toBytes=function(r){return r?this.toBytesLE():this.toBytesBE()};le.toBytesLE=function(){var r=this.high,e=this.low;return[e&255,e>>>8&255,e>>>16&255,e>>>24,r&255,r>>>8&255,r>>>16&255,r>>>24]};le.toBytesBE=function(){var r=this.high,e=this.low;return[r>>>24,r>>>16&255,r>>>8&255,r&255,e>>>24,e>>>16&255,e>>>8&255,e&255]};ht.fromBytes=function(r,e,n){return n?ht.fromBytesLE(r,e):ht.fromBytesBE(r,e)};ht.fromBytesLE=function(r,e){return new ht(r[0]|r[1]<<8|r[2]<<16|r[3]<<24,r[4]|r[5]<<8|r[6]<<16|r[7]<<24,e)};ht.fromBytesBE=function(r,e){return new ht(r[4]<<24|r[5]<<16|r[6]<<8|r[7],r[0]<<24|r[1]<<16|r[2]<<8|r[3],e)};var rl=ht;var Pue=16;function Yc(t){t==="X"&&(t="");var r=t.padEnd(Pue,"0");return rl.fromString(r,!0,16)}function WA(t){if(t.isZero())return"X";var r=t.countTrailingZeros(),e=r%4;r=(r-e)/4;var n=r;r*=4;var i=t.shiftRightUnsigned(r),a=i.toString(16).replace(/0+$/,""),o=Array(17-n-a.length).join("0");return o+a}function $A(t,r){var e=Oue(t).shiftRightUnsigned(2),n=t.add(rl.fromNumber(2*r+1-4).multiply(e));return n}function Oue(t){return t.and(t.not().add(1))}be();var Eue=3,Cue=30,Mue=2*Cue+1,e4=180/Math.PI;function r4(t){if(t.length===0)throw new Error("Invalid Hilbert quad key ".concat(t));for(var r=t.split("/"),e=parseInt(r[0],10),n=r[1],i=n.length,a=0,o=[0,0],s=i-1;s>=0;s--){a=i-s;var u=n[s],l=0,f=0;u==="1"?f=1:u==="2"?(l=1,f=1):u==="3"&&(l=1);var p=Math.pow(2,a-1);Iue(p,o,l,f),o[0]+=p*l,o[1]+=p*f}if(e%2===1){var h=o[0];o[0]=o[1],o[1]=h}return{face:e,ij:o,level:a}}function n4(t){if(t.isZero())return"";for(var r=t.toString(2);r.length<Eue+Mue;)r="0"+r;var e=r.lastIndexOf("1"),n=r.substring(0,3),i=r.substring(3,e),a=i.length/2,o=rl.fromString(n,!0,2).toString(10),s="";if(a!==0)for(s=rl.fromString(i,!0,2).toString(4);s.length<a;)s="0"+s;return"".concat(o,"/").concat(s)}function XA(t,r,e){var n=1<<r;return[(t[0]+e[0])/n,(t[1]+e[1])/n]}function t4(t){return t>=.5?1/3*(4*t*t-1):1/3*(1-4*(1-t)*(1-t))}function qA(t){return[t4(t[0]),t4(t[1])]}function YA(t,r){var e=W(r,2),n=e[0],i=e[1];switch(t){case 0:return[1,n,i];case 1:return[-n,1,i];case 2:return[-n,-i,1];case 3:return[-1,-i,-n];case 4:return[i,-1,-n];case 5:return[i,n,-1];default:throw new Error("Invalid face")}}function KA(t){var r=W(t,3),e=r[0],n=r[1],i=r[2],a=Math.atan2(i,Math.sqrt(e*e+n*n)),o=Math.atan2(n,e);return[o*e4,a*e4]}function Iue(t,r,e,n){if(n===0){e===1&&(r[0]=t-1-r[0],r[1]=t-1-r[1]);var i=r[0];r[0]=r[1],r[1]=i}}function i4(t){var r=XA(t.ij,t.level,[.5,.5]),e=qA(r),n=YA(t.face,e);return KA(n)}var Rue=100;function ZA(t){for(var r=t.face,e=t.ij,n=t.level,i=[[0,0],[0,1],[1,1],[1,0],[0,0]],a=Math.max(1,Math.ceil(Rue*Math.pow(2,-n))),o=new Float64Array(4*a*2+2),s=0,u=0,l=0;l<4;l++)for(var f=i[l].slice(0),p=i[l+1],h=(p[0]-f[0])/a,d=(p[1]-f[1])/a,v=0;v<a;v++){f[0]+=h,f[1]+=d;var m=XA(e,n,f),g=qA(m),y=YA(r,g),_=KA(y);Math.abs(_[1])>89.999&&(_[0]=u);var b=_[0]-u;_[0]+=b>180?-360:b<-180?360:0,o[s++]=_[0],o[s++]=_[1],u=_[0]}return o[s++]=o[0],o[s++]=o[1],o}function nl(t){var r=Lue(t),e=r4(r);return e}function Lue(t){if(t.indexOf("/")>0)return t;var r=Yc(t);return n4(r)}function JA(t){var r=nl(t);return i4(r)}function o4(t){var r;if(t.face===2||t.face===5){for(var e=null,n=0,i=0;i<4;i++){var a="".concat(t.face,"/").concat(i),o=nl(a),s=ZA(o);(typeof e>"u"||e===null)&&(e=new Float64Array(4*s.length)),e.set(s,n),n+=s.length}r=a4(e)}else{var u=ZA(t);r=a4(u)}return r}function a4(t){if(t.length%2!==0)throw new Error("Invalid corners");for(var r=[],e=[],n=0;n<t.length;n+=2)r.push(t[n]),e.push(t[n+1]);return r.sort(function(i,a){return i-a}),e.sort(function(i,a){return i-a}),{west:r[0],east:r[r.length-1],north:e[e.length-1],south:e[0]}}function QA(t,r){var e=r?.minimumHeight||0,n=r?.maximumHeight||0,i=nl(t),a=o4(i),o=a.west,s=a.south,u=a.east,l=a.north,f=[];return f.push(new z(o,l,e)),f.push(new z(u,l,e)),f.push(new z(u,s,e)),f.push(new z(o,s,e)),f.push(new z(o,l,n)),f.pu
3942sh(new z(u,l,n)),f.push(new z(u,s,n)),f.push(new z(o,s,n)),f}function Em(t){var r=t.token,e={minimumHeight:t.minimumHeight,maximumHeight:t.maximumHeight},n=QA(r,e),i=JA(r),a=i[0],o=i[1],s=et.WGS84.cartographicToCartesian([a,o,e.maximumHeight]),u=new z(s[0],s[1],s[2]);n.push(u);var l=Oc(n),f=[].concat(ae(l.center),ae(l.halfAxes));return f}function s4(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function kue(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?s4(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):s4(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var Bue=4,Fue=8,Due={QUADTREE:Bue,OCTREE:Fue};function Nue(t,r,e){if(t!=null&&t.box){var n=Yc(t.s2VolumeInfo.token),i=$A(n,r),a=WA(i),o=kue({},t.s2VolumeInfo);switch(o.token=a,e){case"OCTREE":var s=t.s2VolumeInfo,u=s.maximumHeight-s.minimumHeight,l=u/2,f=s.minimumHeight+u/2;s.minimumHeight=f-l,s.maximumHeight=f+l;break;default:break}var p=Em(o),h={box:p,s2VolumeInfo:o};return h}}function nS(t){return rS.apply(this,arguments)}function rS(){return rS=Y(tS.default.mark(function t(r){var e,n,i,a,o,s,u,l,f,p,h,d,v,m,g,y,_,b,x,w,P,E,C,I,O,D,N,H,$,ee,V,U,X,K,te,ie,ce,Te,Me,Fe,we,Ne,Oe,ft,un,Rr;return tS.default.wrap(function(Ct){for(;;)switch(Ct.prev=Ct.next){case 0:if(e=r.options,n=r.parentData,i=n===void 0?{mortonIndex:0,x:0,y:0,z:0}:n,a=r.childIndex,o=a===void 0?0:a,s=r.globalData,u=s===void 0?{level:0,mortonIndex:0,x:0,y:0,z:0}:s,l=r.s2VolumeBox,f=r.subtree,p=r.level,h=p===void 0?0:p,d=e.subdivisionScheme,v=e.subtreeLevels,m=e.maximumLevel,g=e.contentUrlTemplate,y=e.subtreesUriTemplate,_=e.basePath,b={children:[],lodMetricValue:0,contentUrl:""},x=Due[d],w=o&1,P=o>>1&1,E=o>>2&1,C=(Math.pow(x,h)-1)/(x-1),I=is(i.mortonIndex,o),O=C+I,D=is(i.x,w),N=is(i.y,P),H=is(i.z,E),$=!1,h+1>v&&($=eS(f.childSubtreeAvailability,I)),ee=is(u.x,D),V=is(u.y,N),U=is(u.z,H),X=h+u.level,!$){Ct.next=38;break}return K="".concat(_,"/").concat(y),te=Cm(K,X,ee,V,U),Ct.next=25,Bt(te,Pm);case 25:ie=Ct.sent,f=ie,u.mortonIndex=I,u.x=D,u.y=N,u.z=H,u.level=h,I=0,O=0,D=0,N=0,H=0,h=0;case 38:if(ce=eS(f.tileAvailability,O),!(!ce||h>m)){Ct.next=41;break}return Ct.abrupt("return",b);case 41:Te=eS(f.contentAvailability,O),Te&&(b.contentUrl=Cm(g,X,ee,V,U)),Me=h+1,Fe={mortonIndex:I,x:D,y:N,z:H},we=0;case 46:if(!(we<x)){Ct.next=55;break}return Ne=Nue(l,we,d),Ct.next=50,nS({subtree:f,options:e,parentData:Fe,childIndex:we,level:Me,globalData:u,s2VolumeBox:Ne});case 50:Oe=Ct.sent,(Oe.contentUrl||Oe.children.length)&&(ft=X+1,un={childTileX:D,childTileY:N,childTileZ:H},Rr=jue(Oe,ft,un,e,l),b.children.push(Rr));case 52:we++,Ct.next=46;break;case 55:return Ct.abrupt("return",b);case 56:case"end":return Ct.stop()}},t)})),rS.apply(this,arguments)}function eS(t,r){return"constant"in t?Boolean(t.constant):t.explicitBitstream?zue(r,t.explicitBitstream):!1}function jue(t,r,e,n,i){var a=n.basePath,o=n.refine,s=n.getRefine,u=n.lodMetricType,l=n.getTileType,f=n.rootLodMetricValue,p=n.rootBoundingVolume,h=t.contentUrl&&t.contentUrl.replace("".concat(a,"/"),""),d=f/Math.pow(2,r),v=i!=null&&i.box?{box:i.box}:p,m=Uue(r,v,e);return{children:t.children,contentUrl:t.contentUrl,content:{uri:h},id:t.contentUrl,refine:s(o),type:l(t),lodMetricType:u,lodMetricValue:d,geometricError:d,transform:t.transform,boundingVolume:m}}function Uue(t,r,e){if(r.region){var n=e.childTileX,i=e.childTileY,a=e.childTileZ,o=W(r.region,6),s=o[0],u=o[1],l=o[2],f=o[3],p=o[4],h=o[5],d=Math.pow(2,t),v=(l-s)/d,m=(f-u)/d,g=(h-p)/d,y=s+v*n,_=s+v*(n+1),b=u+m*i,x=u+m*(i+1),w=p+g*a,P=p+g*(a+1);return{region:[y,b,_,x,w,P]}}if(r.box)return r;throw new Error("Unsupported bounding volume type ".concat(r))}function is(t,r){return parseInt(t.toString(2)+r.toString(2),2)}function Cm(t,r,e,n,i){var a=Gue({level:r,x:e,y:n,z:i});return t.replace(/{level}|{x}
3942|{y}|{z}/gi,function(o){return a[o]})}function Gue(t){var r={};for(var e in t)r["{".concat(e,"}")]=t[e];return r}function zue(t,r){var e=Math.floor(t/8),n=t%8,i=r[e]>>n&1;return i===1}function Vue(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=Hue(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3943In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function Hue(t,r){if(t){if(typeof t=="string")return u4(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return u4(t,r)}}function u4(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function uS(t){if(!t.contentUrl)return Ki.EMPTY;var r=t.contentUrl.split("?")[0],e=r.split(".").pop();switch(e){case"pnts":return Ki.POINTCLOUD;case"i3dm":case"b3dm":case"glb":case"gltf":return Ki.SCENEGRAPH;default:return e}}function lS(t){switch(t){case"REPLACE":case"replace":return Cr.REPLACE;case"ADD":case"add":return Cr.ADD;default:return t}}function iS(t,r){var e=/^[a-z][0-9a-z+.-]*:/i;if(e.test(r)){var n=new URL(t,"".concat(r,"/"));return decodeURI(n.toString())}else if(t.startsWith("/"))return t;return"".concat(r,"/").concat(t)}function l4(t,r){if(!t)return null;if(t.content){var e=t.content.uri||t.content.url;t.contentUrl=iS(e,r.basePath)}return t.id=t.contentUrl,t.lodMetricType=Jo.GEOMETRIC_ERROR,t.lodMetricValue=t.geometricError,t.transformMatrix=t.transform,t.type=uS(t),t.refine=lS(t.refine),t}function p4(t,r){return aS.apply(this,arguments)}function aS(){return aS=Y(as.default.mark(function t(r,e){var n,i,a,o,s,u,l,f,p,h;return as.default.wrap(function(v){for(;;)switch(v.prev=v.next){case 0:if(n=r.basePath,a=c4(r?.root),!(a&&r.root)){v.next=8;break}return v.next=5,f4(r.root,r,a,e);case 5:i=v.sent,v.next=9;break;case 8:i=l4(r.root,r);case 9:o=[],o.push(i);case 11:if(!(o.length>0)){v.next=40;break}s=o.pop()||{},u=s.children||[],l=Vue(u),v.prev=15,l.s();case 17:if((f=l.n()).done){v.next=30;break}if(p=f.value,h=c4(p),!h){v.next=26;break}return v.next=23,f4(p,r,h,e);case 23:p=v.sent,v.next=27;break;case 26:l4(p,{basePath:n});case 27:o.push(p);case 28:v.next=17;break;case 30:v.next=35;break;case 32:v.prev=32,v.t0=v.catch(15),l.e(v.t0);case 35:return v.prev=35,l.f(),v.finish(35);case 38:v.next=11;break;case 40:return v.abrupt("return",i);case 41:case"end":return v.stop()}},t,null,[[15,32,35,38]])})),aS.apply(this,arguments)}function f4(t,r,e,n){return oS.apply(this,arguments)}function oS(){return oS=Y(as.default.mark(function t(r,e,n,i){var a,o,s,u,l,f,p,h,d,v,m,g,y,_,b,x,w,P;return as.default.wrap(function(C){for(;;)switch(C.prev=C.next){case 0:return s=e.basePath,u=n.subdivisionScheme,l=n.maximumLevel,f=n.subtreeLevels,p=n.subtrees.uri,h=Cm(p,0,0,0,0),d=iS(h,s),C.next=6,Bt(d,Pm,i);case 6:return v=C.sent,m=iS(r.content.uri,s),g=e==null||(a=e.root)===null||a===void 0?void 0:a.refine,y=r.geometricError,_=(o=r.boundingVolume.extensions)===null||o===void 0?void 0:o["3DTILES_bounding_volume_S2"],_&&(b=Em(_),x={box:b,s2VolumeInfo:_},r.boundingVolume=x),w=r.boundingVolume,P={contentUrlTemplate:m,subtreesUriTemplate:p,subdivisionScheme:u,subtreeLevels:f,maximumLevel:l,refine:g,basePath:s,lodMetricType:Jo.GEOMETRIC_ERROR,rootLodMetricValue:y,rootBoundingVolume:w,getTileType:uS,getRefine:lS},C.next=16,Wue(r,v,P);case 16:return C.abrupt("return",C.sent);case 17:case"end":return C.stop()}},t)})),oS.apply(this,arguments)}function Wue(t,r,e){return sS.apply(this,arguments)}function sS(){return sS=Y(as.default.mark(function t(r,e,n){var i,a,o;return as.default.wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(r){u.next=2;break}return u.abrupt("return",null);case 2:return r.lodMetricType=Jo.GEOMETRIC_ERROR,r.lodMetricValue=r.geometricError,r.transformMatrix=r.transform,u.next=7,nS({subtree:e,options:n,s2VolumeBox:r});case 7:return i=u.sent,a=i.children,o=i.contentUrl,o&&(r.contentUrl=o,r.content={uri:o.replace("".concat(n.basePath,"/"),"")}
3943),r.refine=lS(r.refine),r.type=uS(r),r.children=a,r.id=r.contentUrl,u.abrupt("return",r);case 16:case"end":return u.stop()}},t)})),sS.apply(this,arguments)}function c4(t){var r;return(t==null||(r=t.extensions)===null||r===void 0?void 0:r["3DTILES_implicit_tiling"])||t?.implicitTiling}var Mm={id:"3d-tiles",name:"3D Tiles",module:"3d-tiles",version:bm,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],tests:["cmpt","pnts","b3dm","i3dm"],parse:Yue,options:{"3d-tiles":{loadGLTF:!0,decodeQuantizedPositions:!1,isTileset:"auto",assetGltfUpAxis:null}}};function $ue(t){return hn.dirname(t.url)}function Xue(t,r,e){return fS.apply(this,arguments)}function fS(){return fS=Y(os.default.mark(function t(r,e,n){var i,a;return os.default.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return i={content:{featureIds:null}},a=0,s.next=4,NA(r,a,e,n,i.content);case 4:return s.abrupt("return",i.content);case 5:case"end":return s.stop()}},t)})),fS.apply(this,arguments)}function que(t,r,e){return cS.apply(this,arguments)}function cS(){return cS=Y(os.default.mark(function t(r,e,n){var i,a;return os.default.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return a=JSON.parse(new TextDecoder().decode(r)),a.loader=e.loader||Mm,a.url=n.url,a.queryString=n.queryString,a.basePath=$ue(a),s.next=7,p4(a,e);case 7:return a.root=s.sent,a.type=ar.TILES3D,a.lodMetricType=Jo.GEOMETRIC_ERROR,a.lodMetricValue=((i=a.root)===null||i===void 0?void 0:i.lodMetricValue)||0,s.abrupt("return",a);case 12:case"end":return s.stop()}},t)})),cS.apply(this,arguments)}function Yue(t,r,e){return pS.apply(this,arguments)}function pS(){return pS=Y(os.default.mark(function t(r,e,n){var i,a;return os.default.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(i=e["3d-tiles"]||{},i.isTileset==="auto"?a=n.url&&n.url.indexOf(".json")!==-1:a=i.isTileset,!a){s.next=8;break}return s.next=5,que(r,e,n);case 5:r=s.sent,s.next=11;break;case 8:return s.next=10,Xue(r,e,n);case 10:r=s.sent;case 11:return s.abrupt("return",r);case 12:case"end":return s.stop()}},t)})),pS.apply(this,arguments)}function h4(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function il(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?h4(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):h4(Object(e)).forEac
3943h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function Kue(t){var r=Zue();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function Zue(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var d4=[0],Jue={getPointColor:{type:"accessor",value:[0,0,0,255]},pointSize:1,data:"",loader:Mm,onTilesetLoad:{type:"function",value:function(r){}},onTileLoad:{type:"function",value:function(r){}},onTileUnload:{type:"function",value:function(r){}},onTileError:{type:"function",value:function(r,e,n){}},_getMeshColor:{type:"function",value:function(r){return[255,255,255]}}},Im=function(t){L(e,t);var r=Kue(e);function e(){var n;A(this,e);for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return n=r.call.apply(r,[this].concat(a)),c(q(n),"state",void 0),n}return T(e,[{key:"initializeState",value:function(){"onTileLoadFail"in this.props&&ne.removed("onTileLoadFail","onTileError")(),this.state={layerMap:{},tileset3d:null,activeViewports:{},lastUpdatedViewports:null}}},{key:"isLoaded",get:function(){var i,a;return Boolean(((i=this.state)===null||i===void 0||(a=i.tileset3d)===null||a===void 0?void 0:a.isLoaded())&&Z(S(e.prototype),"isLoaded",this))}},{key:"shouldUpdateState",value:function(i){var a=i.changeFlags;return a.somethingChanged}},{key:"updateState",value:function(i){var a=i.props,o=i.oldProps,s=i.changeFlags;if(a.data&&a.data!==o.data&&this._loadTileset(a.data),s.viewportChanged){var u=this.state.activeViewports,l=Object.keys(u).length;l&&(this._updateTileset(u),this.state.lastUpdatedViewports=u,this.state.activeViewports={})}if(s.propsChanged){var f=this.state.layerMap;for(var p in f)f[p].needsUpdate=!0}}},{key:"activateViewport",value:function(i){var a=this.state,o=a.activeViewports,s=a.lastUpdatedViewports;this.internalState.viewport=i,o[i.id]=i;var u=s?.[i.id];(!u||!i.equals(u))&&(this.setChangeFlags({viewportChanged:!0}),this.setNeedsUpdate())}},{key:"getPickingInfo",value:function(i){var a=i.info,o=i.sourceLayer,s=o&&o.props.tile;return a.picked&&(a.object=s),a.sourceTile=s,a}},{key:"filterSubLayer",value:function(i){var a=i.layer,o=i.viewport,s=a.props,u=s.tile,l=o.id;return u.selected&&u.viewportIds.includes(l)}},{key:"_updateAutoHighlight",value:function(i){var a=i.sourceTile,o=this.state.layerMap[a?.id];o&&o.layer&&o.layer.updateAutoHighlight(i)}},{key:"_loadTileset",value:function(){var n=Y(hS.default.mark(function a(o){var s,u,l,f,p,h,d,v;return hS.default.wrap(function(g){for(;;)switch(g.prev=g.next){case 0:if(s=this.props.loadOptions,u=s===void 0?{}:s,l=this.props.loader||this.props.loaders,Array.isArray(l)&&(l=l[0]),f={loadOptions:il({},u)},p=o,!l.preload){g.next=12;break}return g.next=8,l.preload(o,u);case 8:h=g.sent,h.url&&(p=h.url),h.headers&&(f.loadOptions.fetch=il(il({},f.loadOptions.fetch),{},{headers:h.headers})),Object.assign(f,h);case 12:return g.next=14,Bt(p,l,f.loadOptions);case 14:d=g.sent,v=new vA(d,il({onTileLoad:this._onTileLoad.bind(this),onTileUnload:this._onTileUnload.bind(this),onTileError:this.props.onTileError},f)),this.setState({tileset3d:v,layerMap:{}}),this._updateTileset(this.state.activeViewports),this.props.onTilesetLoad(v);case 19:case"end":return g.stop()}},a,this)}));function i(a){return n.apply(this,arguments)}return i}()},{key:"_onTileLoad",value:function(i){var a=this.state.lastUpdatedViewports;this.props.onTileLoad(i),this._updateTileset(a),this.setNeedsUpdate()}},{key:"_onTileUnload",value:function(i){delete this.state.layerMap[i.id],this.props.onTileUnload(i)}},{key:"_updateTileset",value:function(i){var a=this;if(i){var o=this.state.tileset3d,s=this.context.timeline,u=Object.keys(i).length;!s||!u||!o||o.selectTiles(Object.values(i)).then(function(l){var f=a.state.frameNumber!==l;f&&a.setState({frameNumber:l})})}}},{key:"_getSubLayer",value:function(i,a){if(!i.content)return null;switch(i.type){case Ki.POINTCLOUD:return this._makePointCloudLayer(i,a);case Ki.SCENEGRAPH:return this._make3DModelLayer(i);case Ki.MESH:return this._makeSimpleMeshLayer(i,a);default:throw new Error("Tile3DLayer: Failed to render layer of type ".concat(i.content.type))}}},{key:"_makePointCloudLayer",value:function(i,a){var o=i.content,s=o.attributes,u=o.pointCount,l=o.constantRGBA,f=o.cartographicOrigin,p=o.modelMatrix,h=s.positions,d=s.normals,v=s.colors;if(!h)return null;var m=a&&a.props.data||{header:{vertexCount:u},attributes:{POSITION:h,NORMAL:d,COLOR_0:v}},g=this.props,y=g.pointSize,_=g.getPointColor,b=this.getSubLayerClass("pointcloud",Pu);return new b({pointSize:y}
3943,this.getSubLayerProps({id:"pointcloud"}),{id:"".concat(this.id,"-pointcloud-").concat(i.id),tile:i,data:m,coordinateSystem:de.METER_OFFSETS,coordinateOrigin:f,modelMatrix:p,getColor:l||_,_offset:0})}},{key:"_make3DModelLayer",value:function(i){var a=i.content,o=a.gltf,s=a.instances,u=a.cartographicOrigin,l=a.modelMatrix,f=this.getSubLayerClass("scenegraph",Wu);return new f({_lighting:"pbr"},this.getSubLayerProps({id:"scenegraph"}),{id:"".concat(this.id,"-scenegraph-").concat(i.id),tile:i,data:s||d4,scenegraph:o,coordinateSystem:de.METER_OFFSETS,coordinateOrigin:u,modelMatrix:l,getTransformMatrix:function(h){return h.modelMatrix},getPosition:[0,0,0],_offset:0})}},{key:"_makeSimpleMeshLayer",value:function(i,a){var o=i.content,s=o.attributes,u=o.indices,l=o.modelMatrix,f=o.cartographicOrigin,p=o.coordinateSystem,h=p===void 0?de.METER_OFFSETS:p,d=o.material,v=o.featureIds,m=this.props._getMeshColor,g=a&&a.props.mesh||new Re({drawMode:4,attributes:Que(s),indices:u}),y=this.getSubLayerClass("mesh",um);return new y(this.getSubLayerProps({id:"mesh"}),{id:"".concat(this.id,"-mesh-").concat(i.id),tile:i,mesh:g,data:d4,getColor:m(i),pbrMaterial:d,modelMatrix:l,coordinateOrigin:f,coordinateSystem:h,featureIds:v,_offset:0})}},{key:"renderLayers",value:function(){var i=this,a=this.state,o=a.tileset3d,s=a.layerMap;return o?o.tiles.map(function(u){var l=s[u.id]=s[u.id]||{tile:u},f=l.layer;return u.selected&&(f?l.needsUpdate&&(f=i._getSubLayer(u,f),l.needsUpdate=!1):f=i._getSubLayer(u)),l.layer=f,f}).filter(Boolean):null}}]),e}(gt);c(Im,"defaultProps",Jue);c(Im,"layerName","Tile3DLayer");function Que(t){var r={};return r.positions=il(il({},t.positions),{},{value:new Float32Array(t.positions.value)}),t.normals&&(r.normals=t.normals),t.texCoords&&(r.texCoords=t.texCoords),t.colors&&(r.colors=t.colors),t.uvRegions&&(r.uvRegions=t.uvRegions),r}be();F();j();k();k();var bS=me(Ae());be();be();function ele(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=tle(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3944In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function tle(t,r){if(t){if(typeof t=="string")return v4(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return v4(t,r)}}function v4(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var rle=new Map([["centerX",Float64Array.BYTES_PER_ELEMENT],["centerY",Float64Array.BYTES_PER_ELEMENT],["centerZ",Float64Array.BYTES_PER_ELEMENT],["minHeight",Float32Array.BYTES_PER_ELEMENT],["maxHeight",Float32Array.BYTES_PER_ELEMENT],["boundingSphereCenterX",Float64Array.BYTES_PER_ELEMENT],["boundingSphereCenterY",Float64Array.BYTES_PER_ELEMENT],["boundingSphereCenterZ",Float64Array.BYTES_PER_ELEMENT],["boundingSphereRadius",Float64Array.BYTES_PER_ELEMENT],["horizonOcclusionPointX",Float64Array.BYTES_PER_ELEMENT],["horizonOcclusionPointY",Float64Array.BYTES_PER_ELEMENT],["horizonOcclusionPointZ",Float64Array.BYTES_PER_ELEMENT]]);function dS(t){return t>>1^-(t&1)}function nle(t){var r=0,e={},n=ele(rle),i;try{for(n.s();!(i=n.n()).done;){var a=W(i.value,2),o=a[0],s=a[1],u=s===8?t.getFloat64:t.getFloat32;e[o]=u.call(t,r,!0),r+=s}}catch(l){n.e(l)}finally{n.f()}return{header:e,headerEndPosition:r}}function ile(t,r){var e=r,n=3,i=t.getUint32(e,!0),a=new Uint16Array(i*n);e+=Uint32Array.BYTES_PER_ELEMENT;for(var o=Uint16Array.BYTES_PER_ELEMENT,s=i*o,u=e,l=u+s,f=l+s,p=0,h=0,d=0,v=0;v<i;v++)p+=dS(t.getUint16(u+o*v,!0)),h+=dS(t.getUint16(l+o*v,!0)),d+=dS(t.getUint16(f+o*v,!0)),a[v]=p,a[v+i]=h,a[v+i*2]=d;return e+=s*3,{vertexData:a,vertexDataEndPosition:e}}function Kc(t,r,e,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a;if(n===2?a=new Uint16Array(t,r,e):a=new Uint32Array(t,r,e),!i)return a;for(var o=0,s=0;s<a.length;++s){var u=a[s];a[s]=o-u,u===0&&++o}return a}
3944function ale(t,r,e){var n=e,i=3,a=r.length/i,o=a>65536?Uint32Array.BYTES_PER_ELEMENT:Uint16Array.BYTES_PER_ELEMENT;n%o!==0&&(n+=o-n%o);var s=t.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var u=s*3,l=Kc(t.buffer,n,u,o);return n+=u*o,{triangleIndicesEndPosition:n,triangleIndices:l}}function ole(t,r,e){var n=e,i=3,a=r.length/i,o=a>65536?Uint32Array.BYTES_PER_ELEMENT:Uint16Array.BYTES_PER_ELEMENT,s=t.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var u=Kc(t.buffer,n,s,o,!1);n+=s*o;var l=t.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var f=Kc(t.buffer,n,l,o,!1);n+=l*o;var p=t.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var h=Kc(t.buffer,n,p,o,!1);n+=p*o;var d=t.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var v=Kc(t.buffer,n,d,o,!1);return n+=d*o,{edgeIndicesEndPosition:n,westIndices:u,southIndices:f,eastIndices:h,northIndices:v}}function sle(t){return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}function ule(t){return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}function lle(t,r){var e={};if(t.byteLength<=r)return{extensions:e,extensionsEndPosition:r};for(var n=r;n<t.byteLength;){var i=t.getUint8(n,!0);n+=Uint8Array.BYTES_PER_ELEMENT;var a=t.getUint32(n,!0);n+=Uint32Array.BYTES_PER_ELEMENT;var o=new DataView(t.buffer,n,a);switch(i){case 1:{e.vertexNormals=sle(o);break}case 2:{e.waterMask=ule(o);break}default:}n+=a}return{extensions:e,extensionsEndPosition:n}}var ss={header:0,vertices:1,triangleIndices:2,edgeIndices:3,extensions:4},fle={maxDecodingStep:ss.extensions};function vS(t,r){var e=Object.assign({},fle,r),n=new DataView(t),i=nle(n),a=i.header,o=i.headerEndPosition;if(e.maxDecodingStep<ss.vertices)return{header:a};var s=ile(n,o),u=s.vertexData,l=s.vertexDataEndPosition;if(e.maxDecodingStep<ss.triangleIndices)return{header:a,vertexData:u};var f=ale(n,u,l),p=f.triangleIndices,h=f.triangleIndicesEndPosition;if(e.maxDecodingStep<ss.edgeIndices)return{header:a,vertexData:u,triangleIndices:p};var d=ole(n,u,h),v=d.westIndices,m=d.southIndices,g=d.eastIndices,y=d.northIndices,_=d.edgeIndicesEndPosition;if(e.maxDecodingStep<ss.extensions)return{header:a,vertexData:u,triangleIndices:p,westIndices:v,northIndices:y,eastIndices:g,southIndices:m};var b=lle(n,_),x=b.extensions;return{header:a,vertexData:u,triangleIndices:p,westIndices:v,northIndices:y,eastIndices:g,southIndices:m,extensions:x}}function Rm(t,r,e,n){for(var i=n?ple(n,t.POSITION.value):cle(r),a=new t.POSITION.value.constructor(i.length*6),o=new t.TEXCOORD_0.value.constructor(i.length*4),s=new r.constructor(i.length*6),u=0;u<i.length;u++){var l=i[u];hle({edge:l,edgeIndex:u,attributes:t,skirtHeight:e,newPosition:a,newTexcoord0:o,newTriangles:s})}t.POSITION.value=$l(t.POSITION.value,a),t.TEXCOORD_0.value=$l(t.TEXCOORD_0.value,o);var f=r instanceof Array?r.concat(s):$l(r,s);return{attributes:t,triangles:f}}function cle(t){for(var r=[],e=0;e<t.length;e+=3)r.push([t[e],t[e+1]]),r.push([t[e+1],t[e+2]]),r.push([t[e+2],t[e]]);r.sort(function(s,u){return Math.min.apply(Math,ae(s))-Math.min.apply(Math,ae(u))||Math.max.apply(Math,ae(s))-Math.max.apply(Math,ae(u))});for(var n=[],i=0;i<r.length;){var a,o;r[i][0]===((a=r[i+1])===null||a===void 0?void 0:a[1])&&r[i][1]===((o=r[i+1])===null||o===void 0?void 0:o[0])?i+=2:(n.push(r[i]),i++)}return n}function ple(t,r){t.westIndices.sort(function(o,s){return r[3*o+1]-r[3*s+1]}),t.eastIndices.sort(function(o,s){return r[3*s+1]-r[3*o+1]}),t.southIndices.sort(function(o,s){return r[3*s]-r[3*o]}),t.northIndices.sort(function(o,s){return r[3*o]-r[3*s]});var e=[];for(var n in t)for(var i=t[n],a=0;a<i.length-1;a++)e.push([i[a],i[a+1]]);return e}function hle(t){var r=t.edge,e=t.edgeIndex,n=t.attributes,i=t.skirtHeight,a=t.newPosition,o=t.newTexcoord0,s=t.newTriangles,u=n.POSITION.value.length,l=e*2,f=e*2+1;a.set(n.POSITION.value.subarray(r[0]*3,r[0]*3+3),l*3),a[l*3+2]=a[l*3+2]-i,a.set(n.POSITION.value.subarray(r[1]*3,r[1]*3+3),f*3),a[f*3+2]=a[f*3+2]-i,o.set(n.TEXCOORD_0.value.subarray(r[0]*2,r[0]*2+2),l*2),o.set(n.TEXCOORD_0.value.subarray(r[1]*2,r[1]*2+2),f*2);var p=e*2*3;s[p]=r[0],s[p+1]=u/3+f,s[p+2]=r[1],s[p+3]=u/3+f,s[p+4]=r[0],s[p+5]=u/3+l}function dle(t,r,e){for(var n=r.minHeight,i=r.maxHeight,a=e||[0,0,1,1],o=W(a,4),s=o[0],u=o[1],l=o[2],f=o[3],p=l-s,h=f-u,d=i-n,v=t.length/3,m=ne
3944w Float32Array(v*3),g=new Float32Array(v*2),y=0;y<v;y++){var _=t[y]/32767,b=t[y+v]/32767,x=t[y+v*2]/32767;m[3*y+0]=_*p+s,m[3*y+1]=b*h+u,m[3*y+2]=x*d+n,g[2*y+0]=_,g[2*y+1]=b}return{POSITION:{value:m,size:3},TEXCOORD_0:{value:g,size:2}}}function vle(t,r){if(!t)return null;var e=r.bounds,n=vS(t,ss.triangleIndices),i=n.header,a=n.vertexData,o=n.triangleIndices,s=n.westIndices,u=n.northIndices,l=n.eastIndices,f=n.southIndices,p=o,h=dle(a,i,e),d=Ui(h);if(r.skirtHeight){var v=Rm(h,p,r.skirtHeight,{westIndices:s,northIndices:u,eastIndices:l,southIndices:f}),m=v.attributes,g=v.triangles;h=m,p=g}return{loaderData:{header:{}},header:{vertexCount:p.length,boundingBox:d},mode:4,indices:{value:p,size:1},attributes:h}}function Lm(t,r){return vle(t,r["quantized-mesh"])}k();be();var gS=me(Ae());var Zc=class{constructor(r=257){this.gridSize=r;let e=r-1;if(e&e-1)throw new Error(`Expected grid size to be 2^n+1, got ${r}.`);this.numTriangles=e*e*2-2,this.numParentTriangles=this.numTriangles-e*e,this.indices=new Uint32Array(this.gridSize*this.gridSize),this.coords=new Uint16Array(this.numTriangles*4);for(let n=0;n<this.numTriangles;n++){let i=n+2,a=0,o=0,s=0,u=0,l=0,f=0;for(i&1?s=u=l=e:a=o=f=e;(i>>=1)>1;){let h=a+s>>1,d=o+u>>1;i&1?(s=a,u=o,a=l,o=f):(a=s,o=u,s=l,u=f),l=h,f=d}let p=n*4;this.coords[p+0]=a,this.coords[p+1]=o,this.coords[p+2]=s,this.coords[p+3]=u}}createTile(r){return new mS(r,this)}},mS=class{constructor(r,e){let n=e.gridSize;if(r.length!==n*n)throw new Error(`Expected terrain data of length ${n*n} (${n} x ${n}), got ${r.length}.`);this.terrain=r,this.martini=e,this.errors=new Float32Array(r.length),this.update()}update(){let{numTriangles:r,numParentTriangles:e,coords:n,gridSize:i}=this.martini,{terrain:a,errors:o}=this;for(let s=r-1;s>=0;s--){let u=s*4,l=n[u+0],f=n[u+1],p=n[u+2],h=n[u+3],d=l+p>>1,v=f+h>>1,m=d+v-f,g=v+l-d,y=(a[f*i+l]+a[h*i+p])/2,_=v*i+d,b=Math.abs(y-a[_]);if(o[_]=Math.max(o[_],b),s<e){let x=(f+g>>1)*i+(l+m>>1),w=(h+g>>1)*i+(p+m>>1);o[_]=Math.max(o[_],o[x],o[w])}}}getMesh(r=0){let{gridSize:e,indices:n}=this.martini,{errors:i}=this,a=0,o=0,s=e-1;n.fill(0);function u(d,v,m,g,y,_){let b=d+m>>1,x=v+g>>1;Math.abs(d-y)+Math.abs(v-_)>1&&i[x*e+b]>r?(u(y,_,d,v,b,x),u(m,g,y,_,b,x)):(n[v*e+d]=n[v*e+d]||++a,n[g*e+m]=n[g*e+m]||++a,n[_*e+y]=n[_*e+y]||++a,o++)}u(0,0,s,s,s,0),u(s,s,0,0,0,s);let l=new Uint16Array(a*2),f=new Uint32Array(o*3),p=0;function h(d,v,m,g,y,_){let b=d+m>>1,x=v+g>>1;if(Math.abs(d-y)+Math.abs(v-_)>1&&i[x*e+b]>r)h(y,_,d,v,b,x),h(m,g,y,_,b,x);else{let w=n[v*e+d]-1,P=n[g*e+m]-1,E=n[_*e+y]-1;l[2*w]=d,l[2*w+1]=v,l[2*P]=m,l[2*P+1]=g,l[2*E]=y,l[2*E+1]=_,f[p++]=w,f[p++]=P,f[p++]=E}}return h(0,0,s,s,s,0),h(s,s,0,0,0,s),{vertices:l,triangles:f}}};F();j();var m4=function(){function t(r,e){A(this,t);var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e;this.data=r,this.width=e,this.height=n,this.coords=[],this.triangles=[],this._halfedges=[],this._candidates=[],this._queueIndices=[],this._queue=[],this._errors=[],this._rms=[],this._pending=[],this._pendingLen=0,this._rmsSum=0;var i=e-1,a=n-1,o=this._addPoint(0,0),s=this._addPoint(i,0),u=this._addPoint(0,a),l=this._addPoint(i,a),f=this._addTriangle(l,o,u,-1,-1,-1);this._addTriangle(o,l,s,f,-1,-1),this._flush()}return T(t,[{key:"run",value:function(){for(var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1;this.getMaxError()>e;)this.refine()}},{key:"refine",value:function(){this._step(),this._flush()}},{key:"getMaxError",value:function(){return this._errors[0]}},{key:"getRMSD",value:function(){return this._rmsSum>0?Math.sqrt(this._rmsSum/(this.width*this.height)):0}},{key:"heightAt",value:function(e,n){return this.data[this.width*n+e]}},{key:"_flush",value:function(){for(var e=this.coords,n=0;n<this._pendingLen;n++){var i=this._pending[n],a=2*this.triangles[i*3+0],o=2*this.triangles[i*3+1],s=2*this.triangles[i*3+2];this._findCandidate(e[a],e[a+1],e[o],e[o+1],e[s],e[s+1],i)}this._pendingLen=0}},{key:"_findCandidate",value:function(e,n,i,a,o,s,u){for(var l=Math.min(e,i,o),f=Math.min(n,a,s),p=Math.max(e,i,o),h=Math.max(n,a,s),d=us(i,a,o,s,l,f),v=us(o,s,e,n,l,f),m=us(e,n,i,a,l,f),g=a-n,y=e-i,_=s-a,b=i-o,x=n-s,w=o-e,P=us(e,n,i,a,o,s),E=this.heightAt(e,n)/P,C=this.heightAt(i,a)/P,I=this.heightAt(o,s)/P,O=0,D=0,N=0,H=0,$=f;$<=h;$++){var ee=0;d<0&&_!==0&&(ee=Math.max(ee,Math.floor(-d/_))),v<0&&x!==0&&(ee=Math.max(ee,Math.floor(-v/x))),m<0&&g!==0&&(ee=Math.max(ee,Math.floor(-m/g)));for(var V=d+_*ee,U=v+x*ee,X=m+g*ee,K=!1,te=l+ee;
3944te<=p;te++){if(V>=0&&U>=0&&X>=0){K=!0;var ie=E*V+C*U+I*X,ce=Math.abs(ie-this.heightAt(te,$));H+=ce*ce,ce>O&&(O=ce,D=te,N=$)}else if(K)break;V+=_,U+=x,X+=g}d+=b,v+=w,m+=y}(D===e&&N===n||D===i&&N===a||D===o&&N===s)&&(O=0),this._candidates[2*u]=D,this._candidates[2*u+1]=N,this._rms[u]=H,this._queuePush(u,O,H)}},{key:"_step",value:function(){var e=this._queuePop(),n=e*3+0,i=e*3+1,a=e*3+2,o=this.triangles[n],s=this.triangles[i],u=this.triangles[a],l=this.coords[2*o],f=this.coords[2*o+1],p=this.coords[2*s],h=this.coords[2*s+1],d=this.coords[2*u],v=this.coords[2*u+1],m=this._candidates[2*e],g=this._candidates[2*e+1],y=this._addPoint(m,g);if(us(l,f,p,h,m,g)===0)this._handleCollinear(y,n);else if(us(p,h,d,v,m,g)===0)this._handleCollinear(y,i);else if(us(d,v,l,f,m,g)===0)this._handleCollinear(y,a);else{var _=this._halfedges[n],b=this._halfedges[i],x=this._halfedges[a],w=this._addTriangle(o,s,y,_,-1,-1,n),P=this._addTriangle(s,u,y,b,-1,w+1),E=this._addTriangle(u,o,y,x,w+2,P+1);this._legalize(w),this._legalize(P),this._legalize(E)}}},{key:"_addPoint",value:function(e,n){var i=this.coords.length>>1;return this.coords.push(e,n),i}},{key:"_addTriangle",value:function(e,n,i,a,o,s){var u=arguments.length>6&&arguments[6]!==void 0?arguments[6]:this.triangles.length,l=u/3;return this.triangles[u+0]=e,this.triangles[u+1]=n,this.triangles[u+2]=i,this._halfedges[u+0]=a,this._halfedges[u+1]=o,this._halfedges[u+2]=s,a>=0&&(this._halfedges[a]=u+0),o>=0&&(this._halfedges[o]=u+1),s>=0&&(this._halfedges[s]=u+2),this._candidates[2*l+0]=0,this._candidates[2*l+1]=0,this._queueIndices[l]=-1,this._rms[l]=0,this._pending[this._pendingLen++]=l,u}},{key:"_legalize",value:function(e){var n=this._halfedges[e];if(!(n<0)){var i=e-e%3,a=n-n%3,o=i+(e+1)%3,s=i+(e+2)%3,u=a+(n+2)%3,l=a+(n+1)%3,f=this.triangles[s],p=this.triangles[e],h=this.triangles[o],d=this.triangles[u],v=this.coords;if(mle(v[2*f],v[2*f+1],v[2*p],v[2*p+1],v[2*h],v[2*h+1],v[2*d],v[2*d+1])){var m=this._halfedges[o],g=this._halfedges[s],y=this._halfedges[u],_=this._halfedges[l];this._queueRemove(i/3),this._queueRemove(a/3);var b=this._addTriangle(f,d,h,-1,y,m,i),x=this._addTriangle(d,f,p,b,g,_,a);this._legalize(b+1),this._legalize(x+2)}}}},{key:"_handleCollinear",value:function(e,n){var i=n-n%3,a=i+(n+1)%3,o=i+(n+2)%3,s=this.triangles[o],u=this.triangles[n],l=this.triangles[a],f=this._halfedges[a],p=this._halfedges[o],h=this._halfedges[n];if(h<0){var d=this._addTriangle(e,s,u,-1,p,-1,i),v=this._addTriangle(s,e,l,d,-1,f);this._legalize(d+1),this._legalize(v+2);return}var m=h-h%3,g=m+(h+2)%3,y=m+(h+1)%3,_=this.triangles[g],b=this._halfedges[g],x=this._halfedges[y];this._queueRemove(m/3);var w=this._addTriangle(s,u,e,p,-1,-1,i),P=this._addTriangle(u,_,e,x,-1,w+1,m),E=this._addTriangle(_,l,e,b,-1,P+1),C=this._addTriangle(l,s,e,f,w+2,E+1);this._legalize(w),this._legalize(P),this._legalize(E),this._legalize(C)}},{key:"_queuePush",value:function(e,n,i){var a=this._queue.length;this._queueIndices[e]=a,this._queue.push(e),this._errors.push(n),this._rmsSum+=i,this._queueUp(a)}},{key:"_queuePop",value:function(){var e=this._queue.length-1;return this._queueSwap(0,e),this._queueDown(0,e),this._queuePopBack()}},{key:"_queuePopBack",value:function(){var e=this._queue.pop();return this._errors.pop(),this._rmsSum-=this._rms[e],this._queueIndices[e]=-1,e}},{key:"_queueRemove",value:function(e){var n=this._queueIndices[e];if(n<0){var i=this._pending.indexOf(e);if(i!==-1)this._pending[i]=this._pending[--this._pendingLen];else throw new Error("Broken triangulation (something went wrong).");return}var a=this._queue.length-1;a!==n&&(this._queueSwap(n,a),this._queueDown(n,a)||this._queueUp(n)),this._queuePopBack()}},{key:"_queueLess",value:function(e,n){return this._errors[e]>this._errors[n]}},{key:"_queueSwap",value:function(e,n){var i=this._queue[e],a=this._queue[n];this._queue[e]=a,this._queue[n]=i,this._queueIndices[i]=n,this._queueIndices[a]=e;var o=this._errors[e];this._errors[e]=this._errors[n],this._errors[n]=o}},{key:"_queueUp",value:function(e){for(var n=e;;){var i=n-1>>1;if(i===n||!this._queueLess(n,i))break;this._queueSwap(i,n),n=i}}},{key:"_queueDown",value:function(e,n){for(var i=e;;){var a=2*i+1;if(a>=n||a<0)break;var o=a+1,s=a;if(o<n&&this._queueLess(o,a)&&(s=o),!this._queueLess(s,i))break;this._queueSwap(i,s),i=s}return i>e}}]),t}();function us(t,r,e,n,i,a){return(e-i)*(r-a)-(n-a)*(t-i)}function mle(t,r,e,n,i,a,o,s){var u=t-o,l=r-s,f=e-o,p=n-s,h=i-o,d=a-s,v=u*u+l*l,m=f*f+p*p,g=h*h+d*d;return u*(p*g-m*d)-l*(f*g-m*h)+v*(f*d-p*h)<0}function g4(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function km(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};
3944r%2?g4(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):g4(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function Bm(t,r,e,n,i){for(var a=n.rScaler,o=n.bScaler,s=n.gScaler,u=n.offset,l=new Float32Array((r+1)*(e+1)),f=0,p=0;p<e;p++)for(var h=0;h<r;h++,f++){var d=f*4,v=t[d+0],m=t[d+1],g=t[d+2];l[f+p]=v*a+m*s+g*o+u}if(i==="martini"){for(var y=(r+1)*r,_=0;_<r;_++,y++)l[y]=l[y-r-1];for(var b=e,x=0;x<e+1;x++,b+=e+1)l[b]=l[b-1]}return l}function gle(t,r,e,n,i){for(var a=e+1,o=t.length/2,s=new Float32Array(o*3),u=new Float32Array(o*2),l=i||[0,0,e,n],f=W(l,4),p=f[0],h=f[1],d=f[2],v=f[3],m=(d-p)/e,g=(v-h)/n,y=0;y<o;y++){var _=t[y*2],b=t[y*2+1],x=b*a+_;s[3*y+0]=_*m+p,s[3*y+1]=-b*g+v,s[3*y+2]=r[x],u[2*y+0]=_/e,u[2*y+1]=b/n}return{POSITION:{value:s,size:3},TEXCOORD_0:{value:u,size:2}}}function yle(t,r){if(t===null)return null;var e=r.meshMaxError,n=r.bounds,i=r.elevationDecoder,a=t.data,o=t.width,s=t.height,u,l;switch(r.tesselator){case"martini":u=Bm(a,o,s,i,r.tesselator),l=y4(e,o,u);break;case"delatin":u=Bm(a,o,s,i,r.tesselator),l=_4(e,o,s,u);break;default:o===s&&!(s&o-1)?(u=Bm(a,o,s,i,"martini"),l=y4(e,o,u)):(u=Bm(a,o,s,i,"delatin"),l=_4(e,o,s,u));break}var f=l,p=f.vertices,h=l,d=h.triangles,v=gle(p,u,o,s,n),m=Ui(v);if(r.skirtHeight){var g=Rm(v,d,r.skirtHeight),y=g.attributes,_=g.triangles;v=y,d=_}return{loaderData:{header:{}},header:{vertexCount:d.length,boundingBox:m},mode:4,indices:{value:Uint32Array.from(d),size:1},attributes:v}}function y4(t,r,e){var n=r+1,i=new Zc(n),a=i.createTile(e),o=a.getMesh(t),s=o.vertices,u=o.triangles;return{vertices:s,triangles:u}}function _4(t,r,e,n){var i=new m4(n,r+1,e+1);i.run(t);var a=i.coords,o=i.triangles,s=a;return{vertices:s,triangles:o}}function _S(t,r,e){return yS.apply(this,arguments)}function yS(){return yS=Y(gS.default.mark(function t(r,e,n){var i,a;return gS.default.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return i=km(km({},e),{},{mimeType:"application/x.image",image:km(km({},e.image),{},{type:"data"})}),s.next=3,n.parse(r,i);case 3:return a=s.sent,s.abrupt("return",yle(a,e.terrain));case 5:case"end":return s.stop()}},t)})),yS.apply(this,arguments)}var Fm="3.4.13";var Dm={name:"Terrain",id:"terrain",module:"terrain",version:Fm,worker:!0,extensions:["png","pngraw","jpg","jpeg","gif","webp","bmp"],mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/bmp"],options:{terrain:{tesselator:"auto",bounds:null,meshMaxError:10,elevationDecoder:{rScaler:1,gScaler:0,bScaler:0,offset:0},skirtHeight:null}}};var b4={name:"Quantized Mesh",id:"quantized-mesh",module:"terrain",version:Fm,worker:!0,extensions:["terrain"],mimeTypes:["application/vnd.quantized-mesh"],options:{"quantized-mesh":{bounds:[0,0,1,1],skirtHeight:null}}};function x4(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function Nm(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?x4(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):x4(Object(e)).forEac
3944h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var eht=Nm(Nm({},Dm),{},{parse:_S});var tht=Nm(Nm({},b4),{},{parseSync:Lm,parse:function(){var t=Y(bS.default.mark(function e(n,i){return bS.default.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",Lm(n,i));case 1:case"end":return o.stop()}},e)}));function r(e,n){return t.apply(this,arguments)}return r}()});function _le(t){var r=ble();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function ble(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function A4(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function za(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?A4(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):A4(Object(e)).forEac
3944h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var S4=[1],xle=za(za({},Ni.defaultProps),{},{elevationData:La,texture:za(za({},La),{},{optional:!0}),meshMaxError:{type:"number",value:4},bounds:{type:"array",value:null,optional:!0,compare:!0},color:{type:"color",value:[255,255,255]},elevationDecoder:{type:"object",value:{rScaler:1,gScaler:0,bScaler:0,offset:0}},workerUrl:"",wireframe:!1,material:!0,loaders:[Dm]});function T4(t){return Array.isArray(t)?t.join(";"):t||""}var jm=function(t){L(e,t);var r=_le(e);function e(){var n;A(this,e);for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return n=r.call.apply(r,[this].concat(a)),c(q(n),"state",void 0),n}return T(e,[{key:"updateState",value:function(i){var a=i.props,o=i.oldProps,s=a.elevationData!==o.elevationData;if(s){var u=a.elevationData,l=u&&(Array.isArray(u)||u.includes("{x}")&&u.includes("{y}"));this.setState({isTiled:l})}var f=s||a.meshMaxError!==o.meshMaxError||a.elevationDecoder!==o.elevationDecoder||a.bounds!==o.bounds;if(!this.state.isTiled&&f){var p=this.loadTerrain(a);this.setState({terrain:p})}a.workerUrl&&ne.removed("workerUrl","loadOptions.terrain.workerUrl")()}},{key:"loadTerrain",value:function(i){var a,o=i.elevationData,s=i.bounds,u=i.elevationDecoder,l=i.meshMaxError,f=i.signal;if(!o)return null;var p=this.getLoadOptions();p=za(za({},p),{},{terrain:za(za({skirtHeight:this.state.isTiled?l*2:0},(a=p)===null||a===void 0?void 0:a.terrain),{},{bounds:s,meshMaxError:l,elevationDecoder:u})});var h=this.props.fetch;return h(o,{propName:"elevationData",layer:this,loadOptions:p,signal:f})}},{key:"getTiledTerrainData",value:function(i){var a=this.props,o=a.elevationData,s=a.fetch,u=a.texture,l=a.elevationDecoder,f=a.meshMaxError,p=this.context.viewport,h=ni(o,i),d=u&&ni(u,i),v=i.signal,m=[0,0],g=[0,0];if(p.isGeospatial){var y=i.bbox;m=p.projectFlat([y.west,y.south]),g=p.projectFlat([y.east,y.north])}else{var _=i.bbox;m=[_.left,_.bottom],g=[_.right,_.top]}var b=[m[0],m[1],g[0],g[1]],x=this.loadTerrain({elevationData:h,bounds:b,elevationDecoder:l,meshMaxError:f,signal:v}),w=d?s(d,{propName:"texture",layer:this,loaders:[],signal:v}).catch(function(P){return null}):Promise.resolve(null);return Promise.all([x,w])}},{key:"renderSubLayers",value:function(i){var a=this.getSubLayerClass("mesh",Gi),o=this.props,s=o.color,u=o.wireframe,l=o.material,f=i.data;if(!f)return null;var p=W(f,2),h=p[0],d=p[1];return new a(i,{data:S4,mesh:h,texture:d,_instanced:!1,coordinateSystem:de.CARTESIAN,getPosition:function(m){return[0,0,0]},getColor:s,wireframe:u,material:l})}},{key:"onViewportLoad",value:function(i){if(i){var a=this.state.zRange,o=i.map(function(l){return l.content}).filter(Boolean).map(function(l){var f=l[0].header.boundingBox;return f.map(function(p){return p[2]})});if(o.length!==0){var s=Math.min.apply(Math,ae(o.map(function(l){return l[0]}))),u=Math.max.apply(Math,ae(o.map(function(l){return l[1]})));(!a||s<a[0]||u>a[1])&&this.setState({zRange:[s,u]})}}}},{key:"renderLayers",value:function(){var i=this.props,a=i.color,o=i.material,s=i.elevationData,u=i.texture,l=i.wireframe,f=i.meshMaxError,p=i.elevationDecoder,h=i.tileSize,d=i.maxZoom,v=i.minZoom,m=i.extent,g=i.maxRequests,y=i.onTileLoad,_=i.onTileUnload,b=i.onTileError,x=i.maxCacheSize,w=i.maxCacheByteSize,P=i.refinementStrategy;if(this.state.isTiled)return new Ni(this.getSubLayerProps({id:"tiles"}),{getTileData:this.getTiledTerrainData.bind(this),renderSubLayers:this.renderSubLayers.bind(this),updateTriggers:{getTileData:{elevationData:T4(s),texture:T4(u),meshMaxError:f,elevationDecoder:p}},onViewportLoad:this.onViewportLoad.bind(this),zRange:this.state.zRange||null,tileSize:h,maxZoom:d,minZoom:v,extent:m,maxRequests:g,onTileLoad:y,onTileUnload:_,onTileError:b,maxCacheSize:x,maxCacheByteSize:w,refinementStrategy:P});var E=this.getSubLayerClass("mesh",Gi);return new E(this.getSubLayerProps({id:"mesh"}),{data:S4,mesh:this.state.terrain,texture:u,_instanced:!1,getPosition:function(I){return[0,0,0]},getColor:a,material:o,wireframe:l})}}]),e}(gt);c(jm,"defaultProps",xle);c(jm,"layerName","TerrainLayer");F();j();k();var GS=me(Ae());F();j();k();var Ale=`
3945  uniform bool brushing_enabled;
3946  uniform int brushing_target;
3947  uniform vec2 brushing_mousePos;
3948  uniform float brushing_radius;
3949
3950  #ifdef NON_INSTANCED_MODEL
3951  attribute vec2 brushingTargets;
3952  #else
3953  attribute vec2 instanceBrushingTargets;
3954  #endif
3955
3956  varying float brushing_isVisible;
3957
3958  bool brushing_isPointInRange(vec2 position) {
3959    if (!brushing_enabled) {
3960      return true;
3961    }
3962    vec2 source_commonspace = project_position(position);
3963    vec2 target_commonspace = project_position(brushing_mousePos);
3964    float distance = length((target_commonspace - source_commonspace) / project_uCommonUnitsPerMeter.xy);
3965
3966    return distance <= brushing_radius;
3967  }
3968
3969  bool brushing_arePointsInRange(vec2 sourcePos, vec2 targetPos) {
3970    return brushing_isPointInRange(sourcePos) || brushing_isPointInRange(targetPos);
3971  }
3972
3973  void brushing_setVisible(bool visible) {
3974    brushing_isVisible = float(visible);
3975  }
3976`,Sle=`
3977  uniform bool brushing_enabled;
3978  varying float brushing_isVisible;
3979`,Tle={source:0,target:1,custom:2,source_target:3},wle={"vs:DECKGL_FILTER_GL_POSITION":`
3980    vec2 brushingTarget;
3981    vec2 brushingSource;
3982    if (brushing_target == 3) {
3983      brushingTarget = geometry.worldPositionAlt.xy;
3984      brushingSource = geometry.worldPosition.xy;
3985    } else if (brushing_target == 0) {
3986      brushingTarget = geometry.worldPosition.xy;
3987    } else if (brushing_target == 1) {
3988      brushingTarget = geometry.worldPositionAlt.xy;
3989    } else {
3990      #ifdef NON_INSTANCED_MODEL
3991      brushingTarget = brushingTargets;
3992      #else
3993      brushingTarget = instanceBrushingTargets;
3994      #endif
3995    }
3996    bool visible;
3997    if (brushing_target == 3) {
3998      visible = brushing_arePointsInRange(brushingSource, brushingTarget);
3999    } else {
4000      visible = brushing_isPointInRange(brushingTarget);
4001    }
4002    brushing_setVisible(visible);
4003  `,"fs:DECKGL_FILTER_COLOR":`
4004    if (brushing_enabled && brushing_isVisible < 0.5) {
4005      discard;
4006    }
4007  `},w4={name:"brushing",dependencies:[Ft],vs:Ale,fs:Sle,inject:wle,getUniforms:function(r){if(!r||!("viewport"in r))return{};var e=r.brushingEnabled,n=e===void 0?!0:e,i=r.brushingRadius,a=i===void 0?1e4:i,o=r.brushingTarget,s=o===void 0?"source":o,u=r.mousePosition,l=r.viewport;return{brushing_enabled:Boolean(n&&u&&l.containsPixel(u)),brushing_radius:a,brushing_target:Tle[s]||0,brushing_mousePos:u?l.unproject([u.x-l.x,u.y-l.y]):[0,0]}}};function Ple(t){var r=Ole();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function Ole(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Ele={getBrushingTarget:{type:"accessor",value:[0,0]},brushingTarget:"source",brushingEnabled:!0,brushingRadius:1e4},Um=function(t){L(e,t);var r=Ple(e);function e(){return A(this,e),r.apply(this,arguments)}return T(e,[{key:"getShaders",value:function(){return{modules:[w4]}}},{key:"initializeState",value:function(i,a){var o=this,s=this.getAttributeManager();s&&s.add({brushingTargets:{size:2,accessor:"getBrushingTarget",shaderAttributes:{brushingTargets:{divisor:0},instanceBrushingTargets:{divisor:1}}}}),this.state.onMouseMove=function(){var u;(u=o.getCurrentLayer())===null||u===void 0||u.setNeedsRedraw()},i.deck&&i.deck.eventManager.on({pointermove:this.state.onMouseMove,pointerleave:this.state.onMouseMove})}},{key:"finalizeState",value:function(i,a){i.deck&&i.deck.eventManager.off({pointermove:this.state.onMouseMove,pointerleave:this.state.onMouseMove})}}]),e}(Et);c(Um,"defaultProps",Ele);c(Um,"extensionName","BrushingExtension");F();j();k();k();function P4(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function O4(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};
4007r%2?P4(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):P4(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var E4=`
4008uniform DATAFILTER_TYPE filter_min;
4009uniform DATAFILTER_TYPE filter_softMin;
4010uniform DATAFILTER_TYPE filter_softMax;
4011uniform DATAFILTER_TYPE filter_max;
4012uniform bool filter_useSoftMargin;
4013uniform bool filter_enabled;
4014uniform bool filter_transformSize;
4015
4016#ifdef NON_INSTANCED_MODEL
4017  #define DATAFILTER_ATTRIB filterValues
4018  #define DATAFILTER_ATTRIB_64LOW filterValues64Low
4019#else
4020  #define DATAFILTER_ATTRIB instanceFilterValues
4021  #define DATAFILTER_ATTRIB_64LOW instanceFilterValues64Low
4022#endif
4023
4024attribute DATAFILTER_TYPE DATAFILTER_ATTRIB;
4025#ifdef DATAFILTER_DOUBLE
4026  attribute DATAFILTER_TYPE DATAFILTER_ATTRIB_64LOW;
4027
4028  uniform DATAFILTER_TYPE filter_min64High;
4029  uniform DATAFILTER_TYPE filter_max64High;
4030#endif
4031
4032varying float dataFilter_value;
4033
4034float dataFilter_reduceValue(float value) {
4035  return value;
4036}
4037float dataFilter_reduceValue(vec2 value) {
4038  return min(value.x, value.y);
4039}
4040float dataFilter_reduceValue(vec3 value) {
4041  return min(min(value.x, value.y), value.z);
4042}
4043float dataFilter_reduceValue(vec4 value) {
4044  return min(min(value.x, value.y), min(value.z, value.w));
4045}
4046void dataFilter_setValue(DATAFILTER_TYPE valueFromMin, DATAFILTER_TYPE valueFromMax) {
4047  if (filter_enabled) {
4048    if (filter_useSoftMargin) {
4049      dataFilter_value = dataFilter_reduceValue(
4050        smoothstep(filter_min, filter_softMin, valueFromMin) *
4051        (1.0 - smoothstep(filter_softMax, filter_max, valueFromMax))
4052      );
4053    } else {
4054      dataFilter_value = dataFilter_reduceValue(
4055        step(filter_min, valueFromMin) * step(valueFromMax, filter_max)
4056      );
4057    }
4058  } else {
4059    dataFilter_value = 1.0;
4060  }
4061}
4062`,C4=`
4063uniform bool filter_transformColor;
4064varying float dataFilter_value;
4065`;function M4(t){if(!t||!("extensions"in t))return{};var r=t.filterRange,e=r===void 0?[-1,1]:r,n=t.filterEnabled,i=n===void 0?!0:n,a=t.filterTransformSize,o=a===void 0?!0:a,s=t.filterTransformColor,u=s===void 0?!0:s,l=t.filterSoftRange||e;return O4(O4({},Number.isFinite(e[0])?{filter_min:e[0],filter_softMin:l[0],filter_softMax:l[1],filter_max:e[1]}:{filter_min:e.map(function(f){return f[0]}),filter_softMin:l.map(function(f){return f[0]}),filter_softMax:l.map(function(f){return f[1]}),filter_max:e.map(function(f){return f[1]})}),{},{filter_enabled:i,filter_useSoftMargin:Boolean(t.filterSoftRange),filter_transformSize:i&&o,filter_transformColor:i&&u})}function Cle(t){if(!t||!("extensions"in t))return{};var r=M4(t);if(Number.isFinite(r.filter_min)){var e=Math.fround(r.filter_min);r.filter_min-=e,r.filter_softMin-=e,r.filter_min64High=e;var n=Math.fround(r.filter_max);r.filter_max-=n,r.filter_softMax-=n,r.filter_max64High=n}else{var i=r.filter_min.map(Math.fround);r.filter_min=r.filter_min.map(function(o,s){return o-i[s]}),r.filter_softMin=r.filter_softMin.map(function(o,s){return o-i[s]}),r.filter_min64High=i;var a=r.filter_max.map(Math.fround);r.filter_max=r.filter_max.map(function(o,s){return o-a[s]}),r.filter_softMax=r.filter_softMax.map(function(o,s){return o-a[s]}),r.filter_max64High=a}return r}var I4={"vs:#main-start":`
4066    #ifdef DATAFILTER_DOUBLE
4067      dataFilter_setValue(
4068        DATAFILTER_ATTRIB - filter_min64High + DATAFILTER_ATTRIB_64LOW,
4069        DATAFILTER_ATTRIB - filter_max64High + DATAFILTER_ATTRIB_64LOW
4070      );
4071    #else
4072      dataFilter_setValue(DATAFILTER_ATTRIB, DATAFILTER_ATTRIB);
4073    #endif
4074  `,"vs:#main-end":`
4075    if (dataFilter_value == 0.0) {
4076      gl_Position = vec4(0.);
4077    }
4078  `,"vs:DECKGL_FILTER_SIZE":`
4079    if (filter_transformSize) {
4080      size = size * dataFilter_value;
4081    }
4082  `,"fs:DECKGL_FILTER_COLOR":`
4083    if (dataFilter_value == 0.0) discard;
4084    if (filter_transformColor) {
4085      color.a *= dataFilter_value;
4086    }
4087  `},R4={name:"data-filter",vs:E4,fs:C4,inject:I4,getUniforms:M4},L4={name:"data-filter-fp64",vs:E4,fs:C4,inject:I4,getUniforms:Cle};k();function k4(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function Mle(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};
4087r%2?k4(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):k4(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var Ile=`#define SHADER_NAME data-filter-vertex-shader
4088
4089#ifdef FLOAT_TARGET
4090  attribute float filterIndices;
4091  attribute float filterPrevIndices;
4092#else
4093  attribute vec2 filterIndices;
4094  attribute vec2 filterPrevIndices;
4095#endif
4096
4097varying vec4 vColor;
4098const float component = 1.0 / 255.0;
4099
4100void main() {
4101  #ifdef FLOAT_TARGET
4102    dataFilter_value *= float(filterIndices != filterPrevIndices);
4103    gl_Position = vec4(0.0, 0.0, 0.0, 1.0);
4104    vColor = vec4(0.0, 0.0, 0.0, 1.0);
4105  #else
4106    // Float texture is not supported: pack result into 4 channels x 256 px x 64px
4107    dataFilter_value *= float(filterIndices.x != filterPrevIndices.x);
4108    float col = filterIndices.x;
4109    float row = filterIndices.y * 4.0;
4110    float channel = floor(row);
4111    row = fract(row);
4112    vColor = component * vec4(bvec4(channel == 0.0, channel == 1.0, channel == 2.0, channel == 3.0));
4113    gl_Position = vec4(col * 2.0 - 1.0, row * 2.0 - 1.0, 0.0, 1.0);
4114  #endif
4115  gl_PointSize = 1.0;
4116}
4117`,Rle=`#define SHADER_NAME data-filter-fragment-shader
4118precision highp float;
4119
4120varying vec4 vColor;
4121
4122void main() {
4123  if (dataFilter_value < 0.5) {
4124    discard;
4125  }
4126  gl_FragColor = vColor;
4127}
4128`;function B4(t){return Boolean(t.getExtension("EXT_float_blend")&&(t.getExtension("EXT_color_buffer_float")||t.getExtension("WEBGL_color_buffer_float")))}function F4(t,r){return r?new Le(t,{width:1,height:1,attachments:c({},36064,new Ce(t,{format:ge(t)?34836:6408,type:5126,mipmaps:!1}))}):new Le(t,{width:256,height:64,depth:!1})}function D4(t,r,e){return r.defines.NON_INSTANCED_MODEL=1,e&&(r.defines.FLOAT_TARGET=1),new Ie(t,Mle({id:"data-filter-aggregation-model",vertexCount:1,isInstanced:!1,drawMode:0,vs:Ile,fs:Rle},r))}var N4={blend:!0,blendFunc:[1,1,1,1],blendEquation:[32774,32774],depthTest:!1};function j4(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function Gm(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?j4(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):j4(Object(e)).forEac
4128h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function kle(t){var r=Ble();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function Ble(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Fle={getFilterValue:{type:"accessor",value:0},onFilteredItemsChange:{type:"function",value:null,optional:!0},filterEnabled:!0,filterRange:[-1,1],filterSoftRange:null,filterTransformSize:!0,filterTransformColor:!0},U4={1:"float",2:"vec2",3:"vec3",4:"vec4"},zm=function(t){L(e,t);var r=kle(e);function e(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.filterSize,a=i===void 0?1:i,o=n.fp64,s=o===void 0?!1:o,u=n.countItems,l=u===void 0?!1:u;if(A(this,e),!U4[a])throw new Error("filterSize out of range");return r.call(this,{filterSize:a,fp64:s,countItems:l})}return T(e,[{key:"getShaders",value:function(i){var a=i.opts,o=a.filterSize,s=a.fp64;return{modules:[s?L4:R4],defines:{DATAFILTER_TYPE:U4[o],DATAFILTER_DOUBLE:Boolean(s)}}}},{key:"initializeState",value:function(i,a){var o=this.getAttributeManager();o&&o.add({filterValues:{size:a.opts.filterSize,type:a.opts.fp64?5130:5126,accessor:"getFilterValue",shaderAttributes:{filterValues:{divisor:0},instanceFilterValues:{divisor:1}}}});var s=this.context.gl;if(o&&a.opts.countItems){var u=B4(s);o.add({filterIndices:{size:u?1:2,vertexOffset:1,type:5121,normalized:!0,accessor:function(h,d){var v=d.index,m=h&&h.__source?h.__source.index:v;return u?(m+1)%255:[(m+1)%255,Math.floor(m/255)%255]},shaderAttributes:{filterPrevIndices:{vertexOffset:0},filterIndices:{vertexOffset:1}}}});var l=F4(s,u),f=D4(s,a.getShaders.call(this,a),u);this.setState({filterFBO:l,filterModel:f})}}},{key:"updateState",value:function(i){var a=i.props,o=i.oldProps;if(this.state.filterModel){var s=this.getAttributeManager(),u=s.attributes.filterValues.needsUpdate()||a.filterEnabled!==o.filterEnabled||a.filterRange!==o.filterRange||a.filterSoftRange!==o.filterSoftRange;u&&this.setState({filterNeedsUpdate:u})}}},{key:"draw",value:function(i,a){var o=this.state,s=o.filterFBO,u=o.filterModel,l=o.filterNeedsUpdate,f=this.props.onFilteredItemsChange;if(l&&f&&u){var p=this.getAttributeManager(),h=p.attributes,d=h.filterValues,v=h.filterIndices;u.setVertexCount(this.getNumInstances());var m=this.context.gl;qr(m,{framebuffer:s,color:[0,0,0,0]}),u.updateModuleSettings(i.moduleParameters).setAttributes(Gm(Gm({},d.getShaderAttributes()),v&&v.getShaderAttributes())).draw({framebuffer:s,parameters:Gm(Gm({},N4),{},{viewport:[0,0,s.width,s.height]})});for(var g=gn(s),y=0,_=0;_<g.length;_++)y+=g[_];
4128f({id:this.id,count:y}),this.state.filterNeedsUpdate=!1}}},{key:"finalizeState",value:function(){var i=this.state,a=i.filterFBO,o=i.filterModel;a&&(a.color.delete(),a.delete(),o.delete())}}]),e}(Et);c(zm,"defaultProps",Fle);c(zm,"extensionName","DataFilterExtension");F();j();k();var G4=`
4129const vec2 WORLD_SCALE_FP64 = vec2(81.4873275756836, 0.0000032873668232014097);
4130
4131uniform vec2 project_uViewProjectionMatrixFP64[16];
4132void mercatorProject_fp64(vec4 lnglat_fp64, out vec2 out_val[2]) {
4133
4134#if defined(NVIDIA_FP64_WORKAROUND)
4135  out_val[0] = sum_fp64(radians_fp64(lnglat_fp64.xy), PI_FP64 * ONE);
4136#else
4137  out_val[0] = sum_fp64(radians_fp64(lnglat_fp64.xy), PI_FP64);
4138#endif
4139  out_val[1] = sum_fp64(PI_FP64,
4140    log_fp64(tan_fp64(sum_fp64(PI_4_FP64, radians_fp64(lnglat_fp64.zw) / 2.0))));
4141  return;
4142}
4143
4144void project_position_fp64(vec4 position_fp64, out vec2 out_val[2]) {
4145  vec2 pos_fp64[2];
4146  mercatorProject_fp64(position_fp64, pos_fp64);
4147  out_val[0] = mul_fp64(pos_fp64[0], WORLD_SCALE_FP64);
4148  out_val[1] = mul_fp64(pos_fp64[1], WORLD_SCALE_FP64);
4149
4150  return;
4151}
4152
4153void project_position_fp64(vec2 position, vec2 position64xyLow, out vec2 out_val[2]) {
4154  vec4 position64xy = vec4(
4155    position.x, position64xyLow.x,
4156    position.y, position64xyLow.y);
4157
4158  project_position_fp64(position64xy, out_val);
4159}
4160
4161vec4 project_common_position_to_clipspace_fp64(vec2 vertex_pos_modelspace[4]) {
4162  vec2 vertex_pos_clipspace[4];
4163  mat4_vec4_mul_fp64(project_uViewProjectionMatrixFP64, vertex_pos_modelspace,
4164    vertex_pos_clipspace);
4165  return vec4(
4166    vertex_pos_clipspace[0].x,
4167    vertex_pos_clipspace[1].x,
4168    vertex_pos_clipspace[2].x,
4169    vertex_pos_clipspace[3].x
4170    );
4171}
4172
4173vec4 project_position_to_clipspace(
4174  vec3 position, vec3 position64xyLow, vec3 offset, out vec4 commonPosition
4175) {
4176  vec2 offset64[4];
4177  vec4_fp64(vec4(offset, 0.0), offset64);
4178
4179  float z = project_size(position.z);
4180  vec2 projectedPosition64xy[2];
4181  project_position_fp64(position.xy, position64xyLow.xy, projectedPosition64xy);
4182
4183  vec2 commonPosition64[4];
4184  commonPosition64[0] = sum_fp64(offset64[0], projectedPosition64xy[0]);
4185  commonPosition64[1] = sum_fp64(offset64[1], projectedPosition64xy[1]);
4186  commonPosition64[2] = sum_fp64(offset64[2], vec2(z, 0.0));
4187  commonPosition64[3] = vec2(1.0, 0.0);
4188
4189  commonPosition = vec4(projectedPosition64xy[0].x, projectedPosition64xy[1].x, z, 1.0);
4190
4191  return project_common_position_to_clipspace_fp64(commonPosition64);
4192}
4193
4194vec4 project_position_to_clipspace(
4195  vec3 position, vec3 position64xyLow, vec3 offset
4196) {
4197  vec4 commonPosition;
4198  return project_position_to_clipspace(
4199    position, position64xyLow, offset, commonPosition
4200  );
4201}
4202`;var Dle=Vs.fp64ify,Nle=Vs.fp64ifyMatrix4,Vm={name:"project64",dependencies:[Ft,Vs],vs:G4,getUniforms:Ule},jle=xr(Gle);function Ule(t){if(t&&"viewport"in t){var r=t.viewport,e=r.viewProjectionMatrix,n=r.scale;return jle({viewProjectionMatrix:e,scale:n})}return{}}function Gle(t){var r=t.viewProjectionMatrix,e=t.scale,n=Nle(r),i=Dle(e);return{project_uViewProjectionMatrixFP64:n,project64_uViewProjectionMatrix:n,project64_uScale:i}}function zle(t){var r=Vle();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function Vle(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var xS=function(t){L(e,t);var r=zle(e);function e(){return A(this,e),r.apply(this,arguments)}return T(e,[{key:"getShaders",value:function(){var i=this.props.coordinateSystem;if(i!==de.LNGLAT&&i!==de.DEFAULT)throw new Error("fp64: coordinateSystem must be LNGLAT");return{modules:[Vm]}}}]),e}(Et);c(xS,"extensionName","Fp64Extension");F();j();k();var z4={inject:{"vs:#decl":`
4203attribute vec2 instanceDashArrays;
4204attribute float instanceDashOffsets;
4205varying vec2 vDashArray;
4206varying float vDashOffset;
4207`,"vs:#main-end":`
4208vDashArray = instanceDashArrays;
4209vDashOffset = instanceDashOffsets / width.x;
4210`,"fs:#decl":`
4211uniform float dashAlignMode;
4212uniform float capType;
4213uniform bool dashGapPickable;
4214varying vec2 vDashArray;
4215varying float vDashOffset;
4216
4217float round(float x) {
4218  return floor(x + 0.5);
4219}
4220`,"fs:#main-start":`
4221  float solidLength = vDashArray.x;
4222  float gapLength = vDashArray.y;
4223  float unitLength = solidLength + gapLength;
4224
4225  float offset;
4226
4227  if (unitLength > 0.0) {
4228    if (dashAlignMode == 0.0) {
4229      offset = vDashOffset;
4230    } else {
4231      unitLength = vPathLength / round(vPathLength / unitLength);
4232      offset = solidLength / 2.0;
4233    }
4234
4235    float unitOffset = mod(vPathPosition.y + offset, unitLength);
4236
4237    if (gapLength > 0.0 && unitOffset > solidLength) {
4238      if (capType <= 0.5) {
4239        if (!(dashGapPickable && picking_uActive)) {
4240          discard;
4241        }
4242      } else {
4243        float distToEnd = length(vec2(
4244          min(unitOffset - solidLength, unitLength - unitOffset),
4245          vPathPosition.x
4246        ));
4247        if (distToEnd > 1.0) {
4248          if (!(dashGapPickable && picking_uActive)) {
4249            discard;
4250          }
4251        }
4252      }
4253    }
4254  }
4255`}},V4={inject:{"vs:#decl":`
4256attribute float instanceOffsets;
4257`,"vs:DECKGL_FILTER_SIZE":`
4258  float offsetWidth = abs(instanceOffsets * 2.0) + 1.0;
4259  size *= offsetWidth;
4260`,"vs:#main-end":`
4261  float offsetWidth = abs(instanceOffsets * 2.0) + 1.0;
4262  float offsetDir = sign(instanceOffsets);
4263  vPathPosition.x = (vPathPosition.x + offsetDir) * offsetWidth - offsetDir;
4264  vPathPosition.y *= offsetWidth;
4265  vPathLength *= offsetWidth;
4266`,"fs:#main-start":`
4267  float isInside;
4268  isInside = step(-1.0, vPathPosition.x) * step(vPathPosition.x, 1.0);
4269  if (isInside == 0.0) {
4270    discard;
4271  }
4272`}};function Hle(t){var r=Wle();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function Wle(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var $le={getDashArray:{type:"accessor",value:[0,0]},getOffset:{type:"accessor",value:0},dashJustified:!1,dashGapPickable:!1},Hm=function(t){L(e,t);var r=Hle(e);function e(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.dash,a=i===void 0?!1:i,o=n.offset,s=o===void 0?!1:o,u=n.highPrecisionDash,l=u===void 0?!1:u;return A(this,e),r.call(this,{dash:a||l,offset:s,highPrecisionDash:l})}return T(e,[{key:"isEnabled",value:function(i){return"pathTesselator"in i.state}},{key:"getShaders",value:function(i){if(!i.isEnabled(this))return null;var a={};return i.opts.dash&&(a=Ci(a,z4)),i.opts.offset&&(a=Ci(a,V4)),a}},{key:"initializeState",value:function(i,a){var o=this.getAttributeManager();!o||!a.isEnabled(this)||(a.opts.dash&&o.addInstanced({instanceDashArrays:{size:2,accessor:"getDashArray"}}),a.opts.highPrecisionDash&&o.addInstanced({instanceDashOffsets:{size:1,accessor:"getPath",transform:a.getDashOffsets.bind(this)}}),a.opts.offset&&o.addInstanced({instanceOffsets:{size:1,accessor:"getOffset"}}))}},{key:"updateState",value:function(i,a){if(a.isEnabled(this)){var o={};a.opts.dash&&(o.dashAlignMode=this.props.dashJustified?1:0,o.dashGapPickable=Boolean(this.props.dashGapPickable)),this.state.model.setUniforms(o)}}},{key:"getDashOffsets",value:function(i){for(var a=[0],o=this.props.positionFormat==="XY"?2:3,s=Array.isArray(i[0]),u=s?i.length:i.length/o,l,f,p=0;p<u-1;p++)l=s?i[p]:i.slice(p*o,p*o+o),l=this.projectPosition(l),p>0&&(a[p]=a[p-1]+_E(f,l)),f=l;return a}}]),e}(Et);c(Hm,"defaultProps",$le);c(Hm,"extensionName","PathStyleExtension");F();j();k();var Xle=`
4273#ifdef NON_INSTANCED_MODEL
4274  #define FILL_PATTERN_FRAME_ATTRIB fillPatternFrames
4275  #define FILL_PATTERN_SCALE_ATTRIB fillPatternScales
4276  #define FILL_PATTERN_OFFSET_ATTRIB fillPatternOffsets
4277#else
4278  #define FILL_PATTERN_FRAME_ATTRIB instanceFillPatternFrames
4279  #define FILL_PATTERN_SCALE_ATTRIB instanceFillPatternScales
4280  #define FILL_PATTERN_OFFSET_ATTRIB instanceFillPatternOffsets
4281#endif
4282
4283attribute vec4 FILL_PATTERN_FRAME_ATTRIB;
4284attribute float FILL_PATTERN_SCALE_ATTRIB;
4285attribute vec2 FILL_PATTERN_OFFSET_ATTRIB;
4286
4287uniform bool fill_patternEnabled;
4288uniform vec2 fill_patternTextureSize;
4289
4290varying vec2 fill_uv;
4291varying vec4 fill_patternBounds;
4292varying vec4 fill_patternPlacement;
4293`,qle=`
4294uniform bool fill_patternEnabled;
4295uniform bool fill_patternMask;
4296uniform sampler2D fill_patternTexture;
4297uniform vec2 fill_uvCoordinateOrigin;
4298uniform vec2 fill_uvCoordinateOrigin64Low;
4299
4300varying vec4 fill_patternBounds;
4301varying vec4 fill_patternPlacement;
4302varying vec2 fill_uv;
4303
4304const float FILL_UV_SCALE = 512.0 / 40000000.0;
4305`,Yle={"vs:DECKGL_FILTER_GL_POSITION":`
4306    fill_uv = geometry.position.xy;
4307  `,"vs:DECKGL_FILTER_COLOR":`
4308    if (fill_patternEnabled) {
4309      fill_patternBounds = FILL_PATTERN_FRAME_ATTRIB / vec4(fill_patternTextureSize, fill_patternTextureSize);
4310      fill_patternPlacement.xy = FILL_PATTERN_OFFSET_ATTRIB;
4311      fill_patternPlacement.zw = FILL_PATTERN_SCALE_ATTRIB * FILL_PATTERN_FRAME_ATTRIB.zw;
4312    }
4313  `,"fs:DECKGL_FILTER_COLOR":`
4314    if (fill_patternEnabled) {
4315      vec2 scale = FILL_UV_SCALE * fill_patternPlacement.zw;
4316      vec2 patternUV = mod(mod(fill_uvCoordinateOrigin, scale) + fill_uvCoordinateOrigin64Low + fill_uv, scale) / scale;
4317      patternUV = mod(fill_patternPlacement.xy + patternUV, 1.0);
4318
4319      vec2 texCoords = fill_patternBounds.xy + fill_patternBounds.zw * patternUV;
4320
4321      vec4 patternColor = texture2D(fill_patternTexture, texCoords);
4322      color.a *= patternColor.a;
4323      if (!fill_patternMask) {
4324        color.rgb = patternColor.rgb;
4325      }
4326    }
4327  `};function Kle(t,r){if(!t)return{};if("fillPatternTexture"in t){var e=t.fillPatternTexture;return{fill_patternTexture:e,fill_patternTextureSize:[e.width,e.height]}}if("viewport"in t){var n=t.fillPatternMask,i=n===void 0?!0:n,a=t.fillPatternEnabled,o=a===void 0?!0:a,s=r,u=s.project_uCommonOrigin,l=[An(u[0]),An(u[1])];return{fill_uvCoordinateOrigin:u.slice(0,2),fill_uvCoordinateOrigin64Low:l,fill_patternMask:i,fill_patternEnabled:o}}return{}}var H4={name:"fill-pattern",vs:Xle,fs:qle,inject:Yle,dependencies:[Ft],getUniforms:Kle};function Zle(t){var r=Jle();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function Jle(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Qle={fillPatternEnabled:!0,fillPatternAtlas:{type:"image",value:null,async:!0,parameters:c({},10241,9729)},fillPatternMapping:{type:"object",value:{},async:!0},fillPatternMask:!0,getFillPattern:{type:"accessor",value:function(r){return r.pattern}},getFillPatternScale:{type:"accessor",value:1},getFillPatternOffset:{type:"accessor",value:[0,0]}},Wm=function(t){L(e,t);var r=Zle(e);function e(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.pattern,a=i===void 0?!1:i;return A(this,e),r.call(this,{pattern:a})}return T(e,[{key:"isEnabled",value:function(i){return i.getAttributeManager()!==null&&!("pathTesselator"in i.state)}},{key:"getShaders",value:function(i){return i.isEnabled(this)?{modules:[i.opts.pattern&&H4].filter(Boolean)}:null}},{key:"initializeState",value:function(i,a){if(a.isEnabled(this)){var o=this.getAttributeManager();a.opts.pattern&&o.add({fillPatternFrames:{size:4,accessor:"getFillPattern",transform:a.getPatternFrame.bind(this),shaderAttributes:{fillPatternFrames:{divisor:0},instanceFillPatternFrames:{divisor:1}}},fillPatternScales:{size:1,accessor:"getFillPatternScale",defaultValue:1,shaderAttributes:{fillPatternScales:{divisor:0},instanceFillPatternScales:{divisor:1}}},fillPatternOffsets:{size:2,accessor:"getFillPatternOffset",shaderAttributes:{fillPatternOffsets:{divisor:0},instanceFillPatternOffsets:{divisor:1}}}}),this.setState({emptyTexture:new Ce(this.context.gl,{data:new Uint8Array(4),width:1,height:1})})}}},{key:"updateState",value:function(i,a){var o=i.props,s=i.oldProps;a.isEnabled(this)&&o.fillPatternMapping&&o.fillPatternMapping!==s.fillPatternMapping&&this.getAttributeManager().invalidate("getFillPattern")}},{key:"draw",value:function(i,a){if(a.isEnabled(this)){var o=this.props.fillPatternAtlas;this.setModuleParameters({fillPatternTexture:o||this.state.emptyTexture})}}},{key:"finalizeState",value:function(){var i=this.state.emptyTexture;i?.delete()}},{key:"getPatternFrame",value:function(i){var a=this.getCurrentLayer().props.fillPatternMapping,o=a&&a[i];return o?[o.x,o.y,o.width,o.height]:[0,0,0,0]}}]),e}(Et);c(Wm,"defaultProps",Qle);c(Wm,"extensionName","FillStyleExtension");F();j();k();function efe(t){var r=tfe();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function tfe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var rfe={clipBounds:[0,0,1,1],clipByInstance:void 0},W4=`
4328uniform vec4 clip_bounds;
4329
4330bool clip_isInBounds(vec2 position) {
4331  return position.x >= clip_bounds[0] && position.y >= clip_bounds[1] && position.x < clip_bounds[2] && position.y < clip_bounds[3];
4332}
4333`,nfe={name:"clip-vs",vs:W4},ife={"vs:#decl":`
4334varying float clip_isVisible;
4335`,"vs:DECKGL_FILTER_GL_POSITION":`
4336  clip_isVisible = float(clip_isInBounds(geometry.worldPosition.xy));
4337`,"fs:#decl":`
4338varying float clip_isVisible;
4339`,"fs:DECKGL_FILTER_COLOR":`
4340  if (clip_isVisible < 0.5) discard;
4341`},afe={name:"clip-fs",fs:W4},ofe={"vs:#decl":`
4342varying vec2 clip_commonPosition;
4343`,"vs:DECKGL_FILTER_GL_POSITION":`
4344  clip_commonPosition = geometry.position.xy;
4345`,"fs:#decl":`
4346varying vec2 clip_commonPosition;
4347`,"fs:DECKGL_FILTER_COLOR":`
4348  if (!clip_isInBounds(clip_commonPosition)) discard;
4349`},al=function(t){L(e,t);var r=efe(e);function e(){return A(this,e),r.apply(this,arguments)}return T(e,[{key:"getShaders",value:function(){var i="instancePositions"in this.getAttributeManager().attributes;return this.props.clipByInstance!==void 0&&(i=Boolean(this.props.clipByInstance)),this.state.clipByInstance=i,i?{modules:[nfe],inject:ife}:{modules:[afe],inject:ofe}}},{key:"draw",value:function(i){var a=i.uniforms,o=this.props.clipBounds;if(this.state.clipByInstance)a.clip_bounds=o;else{var s=this.projectPosition([o[0],o[1],0]),u=this.projectPosition([o[2],o[3],0]);a.clip_bounds=[Math.min(s[0],u[0]),Math.min(s[1],u[1]),Math.max(s[0],u[0]),Math.max(s[1],u[1])]}}}]),e}(Et);c(al,"defaultProps",rfe);c(al,"extensionName","ClipExtension");F();j();k();var sfe=`
4350#ifdef NON_INSTANCED_MODEL
4351attribute float collisionPriorities;
4352#else
4353attribute float instanceCollisionPriorities;
4354#endif
4355
4356uniform sampler2D collision_texture;
4357uniform bool collision_sort;
4358uniform bool collision_enabled;
4359
4360vec2 collision_getCoords(vec4 position) {
4361  vec4 collision_clipspace = project_common_position_to_clipspace(position);
4362  return (1.0 + collision_clipspace.xy / collision_clipspace.w) / 2.0;
4363}
4364
4365float collision_match(vec2 tex, vec3 pickingColor) {
4366  vec4 collision_pickingColor = texture2D(collision_texture, tex);
4367  float delta = dot(abs(collision_pickingColor.rgb - pickingColor), vec3(1.0));
4368  float e = 0.001;
4369  return step(delta, e);
4370}
4371
4372float collision_isVisible(vec2 texCoords, vec3 pickingColor) {
4373  if (!collision_enabled) {
4374    return 1.0;
4375  }
4376
4377  // Visibility test, sample area of 5x5 pixels in order to fade in/out.
4378  // Due to the locality, the lookups will be cached
4379  // This reduces the flicker present when objects are shown/hidden
4380  const int N = 2;
4381  float accumulator = 0.0;
4382  vec2 step = vec2(1.0 / project_uViewportSize);
4383
4384  const float floatN = float(N);
4385  vec2 delta = -floatN * step;
4386  for(int i = -N; i <= N; i++) {
4387    delta.x = -step.x * floatN;
4388    for(int j = -N; j <= N; j++) {
4389      accumulator += collision_match(texCoords + delta, pickingColor);
4390      delta.x += step.x;
4391    }
4392    delta.y += step.y;
4393  }
4394
4395  float W = 2.0 * floatN + 1.0;
4396  return pow(accumulator / (W * W), 2.2);
4397}
4398`,ufe={"vs:#decl":`
4399  float collision_fade = 1.0;
4400`,"vs:DECKGL_FILTER_GL_POSITION":`
4401  if (collision_sort) {
4402    #ifdef NON_INSTANCED_MODEL
4403    float collisionPriority = collisionPriorities;
4404    #else
4405    float collisionPriority = instanceCollisionPriorities;
4406    #endif
4407    position.z = -0.001 * collisionPriority * position.w; // Support range -1000 -> 1000
4408  }
4409
4410  if (collision_enabled) {
4411    vec4 collision_common_position = project_position(vec4(geometry.worldPosition, 1.0));
4412    vec2 collision_texCoords = collision_getCoords(collision_common_position);
4413    collision_fade = collision_isVisible(collision_texCoords, geometry.pickingColor / 255.0);
4414    if (collision_fade < 0.0001) {
4415      // Position outside clip space bounds to discard
4416      position = vec4(0.0, 0.0, 2.0, 1.0);
4417    }
4418  }
4419  `,"vs:DECKGL_FILTER_COLOR":`
4420  color.a *= collision_fade;
4421  `},lfe=function(r,e){if(!r||!("dummyCollisionMap"in r))return{};var n=r.collisionFBO,i=r.drawToCollisionMap,a=r.dummyCollisionMap;return{collision_sort:Boolean(i),collision_texture:!i&&n?n:a}},$4={name:"collision",dependencies:[Ft],vs:sfe,inject:ufe,getUniforms:lfe};F();j();k();k();F();j();function X4(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function q4(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?X4(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):X4(Object(e)).forEac
4421h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function ffe(t){var r=cfe();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function cfe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Y4=function(t){L(e,t);var r=ffe(e);function e(){return A(this,e),r.apply(this,arguments)}return T(e,[{key:"renderCollisionMap",value:function(i,a){var o=this,s=this.gl,u=1;return ke(s,{scissorTest:!0,scissor:[u,u,i.width-2*u,i.height-2*u],clearColor:[0,0,0,0],blend:!1,depthTest:!0,depthRange:[0,1]},function(){return o.render(q4(q4({},a),{},{target:i,pass:"collision"}))})}},{key:"getModuleParameters",value:function(){return{drawToCollisionMap:!0,pickingActive:1,pickingAttribute:!1,lightSources:{}}}}]),e}(br);F();j();k();F();j();k();function K4(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function Z4(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?K4(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):K4(Object(e)).forEac
4421h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function pfe(t){var r=hfe();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function hfe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var J4=function(t){L(e,t);var r=pfe(e);function e(n,i){var a,o;A(this,e),o=r.call(this,n,i),c(q(o),"maskMap",void 0),c(q(o),"fbo",void 0);var s=i.mapSize,u=s===void 0?2048:s;return o.maskMap=new Ce(n,{width:u,height:u,parameters:(a={},c(a,10241,9729),c(a,10240,9729),c(a,10242,33071),c(a,10243,33071),a)}),o.fbo=new Le(n,{id:"maskmap",width:u,height:u,attachments:c({},36064,o.maskMap)}),o}return T(e,[{key:"render",value:function(i){var a=this,o=this.gl,s=[!1,!1,!1,!1];return s[i.channel]=!0,ke(o,{clearColor:[255,255,255,255],blend:!0,blendFunc:[0,1],blendEquation:32778,colorMask:s,depthTest:!1},function(){return Z(S(e.prototype),"render",a).call(a,Z4(Z4({},i),{},{target:a.fbo,pass:"mask"}))})}},{key:"shouldDrawLayer",value:function(i){return i.props.operation.includes("mask")}},{key:"delete",value:function(){this.fbo.delete(),this.maskMap.delete()}}]),e}(br);be();function dfe(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=vfe(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
4422In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function vfe(t,r){if(t){if(typeof t=="string")return Q4(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return Q4(t,r)}}function Q4(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function ol(t,r){var e=[1/0,1/0,-1/0,-1/0],n=dfe(t),i;try{for(n.s();!(i=n.n()).done;){var a=i.value,o=a.getBounds();if(o){var s=a.projectPosition(o[0],{viewport:r,autoOffset:!1}),u=a.projectPosition(o[1],{viewport:r,autoOffset:!1});e[0]=Math.min(e[0],s[0]),e[1]=Math.min(e[1],s[1]),e[2]=Math.max(e[2],u[0]),e[3]=Math.max(e[3],u[1])}}}catch(l){n.e(l)}finally{n.f()}return Number.isFinite(e[0])?e:null}var mfe=2048;function sl(t){var r=t.bounds,e=t.viewport,n=t.border,i=n===void 0?0:n,a=e.isGeospatial;if(r[2]<=r[0]||r[3]<=r[1])return null;var o=e.unprojectPosition([(r[0]+r[2])/2,(r[1]+r[3])/2,0]),s=t.width,u=t.height,l=t.zoom;if(l===void 0){s=s-i*2,u=u-i*2;var f=Math.min(s/(r[2]-r[0]),u/(r[3]-r[1]));l=Math.min(Math.log2(f),20)}else if(!s||!u){var p=Math.pow(2,l);s=Math.round(Math.abs(r[2]-r[0])*p),u=Math.round(Math.abs(r[3]-r[1])*p);var h=mfe-i*2;if(s>h||u>h){var d=h/Math.max(s,u);s=Math.round(s*d),u=Math.round(u*d),l+=Math.log2(d)}}return a?new Sr({id:e.id,x:i,y:i,width:s,height:u,longitude:o[0],latitude:o[1],zoom:l,orthographic:!0}):new bu({id:e.id,x:i,y:i,width:s,height:u,target:o,zoom:l,flipY:!1})}function gfe(t,r){var e;if(r&&r.length===2){var n=W(r,2),i=n[0],a=n[1],o=t.getBounds({z:i}),s=t.getBounds({z:a});e=[Math.min(o[0],s[0]),Math.min(o[1],s[1]),Math.max(o[2],s[2]),Math.max(o[3],s[3])]}else e=t.getBounds();var u=t.projectPosition(e.slice(0,2)),l=t.projectPosition(e.slice(2,4));return[u[0],u[1],l[0],l[1]]}function ul(t,r,e){if(!t)return[0,0,1,1];var n=gfe(r,e),i=yfe(n);return t[2]-t[0]<=i[2]-i[0]&&t[3]-t[1]<=i[3]-i[1]?t:[Math.max(t[0],i[0]),Math.max(t[1],i[1]),Math.min(t[2],i[2]),Math.min(t[3],i[3])]}function yfe(t){var r=t[2]-t[0],e=t[3]-t[1],n=(t[0]+t[2])/2,i=(t[1]+t[3])/2;return[n-r,i-e,n+r,i+e]}function _fe(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=bfe(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}
4422}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
4423In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function bfe(t,r){if(t){if(typeof t=="string")return eU(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return eU(t,r)}}function eU(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var $m=function(){function t(){A(this,t),c(this,"id","mask-effect"),c(this,"props",null),c(this,"useInPicking",!0),c(this,"order",0),c(this,"dummyMaskMap",void 0),c(this,"channels",[]),c(this,"masks",null),c(this,"maskPass",void 0),c(this,"maskMap",void 0),c(this,"lastViewport",void 0)}return T(t,[{key:"preRender",value:function(e,n){var i=n.layers,a=n.layerFilter,o=n.viewports,s=n.onViewportActive,u=n.views,l=n.isPicking,f=!1;if(this.dummyMaskMap||(this.dummyMaskMap=new Ce(e,{width:1,height:1})),l)return{didRender:f};var p=i.filter(function(y){return y.props.visible&&y.props.operation.includes("mask")});if(p.length===0)return this.masks=null,this.channels.length=0,{didRender:f};this.masks={},this.maskPass||(this.maskPass=new J4(e,{id:"default-mask"}),this.maskMap=this.maskPass.maskMap);var h=this._sortMaskChannels(p),d=o[0],v=!this.lastViewport||!this.lastViewport.equals(d);if(d.resolution!==void 0)return ne.warn("MaskExtension is not supported in GlobeView")(),{didRender:f};for(var m in h){var g=this._renderChannel(h[m],{layerFilter:a,onViewportActive:s,views:u,viewport:d,viewportChanged:v});f||(f=g)}return{didRender:f}}},{key:"_renderChannel",value:function(e,n){var i=n.layerFilter,a=n.onViewportActive,o=n.views,s=n.viewport,u=n.viewportChanged,l=!1,f=this.channels[e.index];if(!f)return l;var p=e===f||e.layers.length!==f.layers.length||e.layers.some(function(g,y){return g!==f.layers[y]||g.props.transitions})||e.layerBounds.some(function(g,y){return g!==f.layerBounds[y]});if(e.bounds=f.bounds,e.maskBounds=f.maskBounds,this.channels[e.index]=e,p||u){this.lastViewport=s;var h=ol(e.layers,s);if(e.bounds=h&&ul(h,s),p||!Ze(e.bounds,f.bounds)){var d=this.maskPass,v=this.maskMap,m=h&&sl({bounds:e.bounds,viewport:s,width:v.width,height:v.height,border:1});e.maskBounds=m?m.getBounds():[0,0,1,1],d.render({pass:"mask",channel:e.index,layers:e.layers,layerFilter:i,viewports:m?[m]:[],onViewportActive:a,views:o,moduleParameters:{devicePixelRatio:1}}),l=!0}}return this.masks[e.id]={index:e.index,bounds:e.maskBounds,coordinateOrigin:e.coordinateOrigin,coordinateSystem:e.coordinateSystem},l}},{key:"_sortMaskChannels",value:function(e){var n=this,i={},a=0,o=_fe(e),s;try{var u=function(){var m=s.value,g=m.root.id,y=i[g];if(!y){if(++a>4)return ne.warn("Too many mask layers. The max supported is 4")(),"continue";y={id:g,index:n.channels.findIndex(function(_){return _?.id===g}),layers:[],layerBounds:[],coordinateOrigin:m.root.props.coordinateOrigin,coordinateSystem:m.root.props.coordinateSystem},i[g]=y}y.layers.push(m),y.layerBounds.push(m.getBounds())};for(o.s();!(s=o.n()).done;)var l=u()}catch(v){o.e(v)}finally{o.f()}for(var f=0;f<4;f++){var p=this.channels[f];(!p||!(p.id in i))&&(this.channels[f]=null)}for(var h in i){var d=i[h];d.index<0&&(d.index=this.channels.findIndex(function(v){return!v}),this.channels[d.index]=d)}return i}},{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 xfe(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=Afe(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}
4423}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
4424In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function Afe(t,r){if(t){if(typeof t=="string")return tU(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return tU(t,r)}}function tU(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var AS=2,rU=function(){function t(){A(this,t),c(this,"id","collision-filter-effect"),c(this,"props",null),c(this,"useInPicking",!0),c(this,"order",1),c(this,"channels",{}),c(this,"collisionFilterPass",void 0),c(this,"collisionFBOs",{}),c(this,"dummyCollisionMap",void 0),c(this,"lastViewport",void 0)}return T(t,[{key:"preRender",value:function(e,n){var i,a=n.effects,o=n.layers,s=n.layerFilter,u=n.viewports,l=n.onViewportActive,f=n.views,p=n.isPicking,h=n.preRenderStats,d=h===void 0?{}:h;if(this.dummyCollisionMap||(this.dummyCollisionMap=new Ce(e,{width:1,height:1})),!p){var v=o.filter(function(E){var C=E.props,I=C.visible,O=C.collisionEnabled;return I&&O});if(v.length===0){this.channels={};return}this.collisionFilterPass||(this.collisionFilterPass=new Y4(e,{id:"default-collision-filter"}));var m=a?.filter(function(E){return E.constructor===$m}),g=(i=d["mask-effect"])===null||i===void 0?void 0:i.didRender,y=this._groupByCollisionGroup(e,v),_=u[0],b=!this.lastViewport||!this.lastViewport.equals(_)||g;for(var x in y){var w=this.collisionFBOs[x],P=y[x];w.resize({width:e.canvas.width/AS,height:e.canvas.height/AS}),this._render(P,{effects:m,layerFilter:s,onViewportActive:l,views:f,viewport:_,viewportChanged:b})}}}},{key:"_render",value:function(e,n){var i=n.effects,a=n.layerFilter,o=n.onViewportActive,s=n.views,u=n.viewport,l=n.viewportChanged,f=e.collisionGroup,p=this.channels[f];if(p){var h=l||e===p||!xt(p.layers,e.layers,1)||e.layerBounds.some(function(v,m){return!Ze(v,p.layerBounds[m])})||e.allLayersLoaded!==p.allLayersLoaded||e.layers.some(function(v){return v.props.transitions});if(this.channels[f]=e,h){this.lastViewport=u;var d=this.collisionFBOs[f];this.collisionFilterPass.renderCollisionMap(d,{pass:"collision-filter",isPicking:!0,layers:e.layers,effects:i,layerFilter:a,viewports:u?[u]:[],onViewportActive:o,views:s,moduleParameters:{dummyCollisionMap:this.dummyCollisionMap,devicePixelRatio:Jt(d.gl)/AS}})}}}},{key:"_groupByCollisionGroup",value:function(e,n){var i={},a=xfe(n),o;try{for(a.s();!(o=a.n()).done;){var s=o.value,u=s.props.collisionGroup,l=i[u];l||(l={collisionGroup:u,layers:[],layerBounds:[],allLayersLoaded:!0},i[u]=l),l.layers.push(s),l.layerBounds.push(s.getBounds()),s.isLoaded||(l.allLayersLoaded=!1)}}catch(g){a.e(g)}finally{a.f()}for(var f=0,p=Object.keys(i);f<p.length;f++){var h=p[f];this.collisionFBOs[h]||this.createFBO(e,h),this.channels[h]||(this.channels[h]=i[h])}for(var d=0,v=Object.keys(this.collisionFBOs);d<v.length;d++){var m=v[d];i[m]||this.destroyFBO(m)}return i}},{key:"getModuleParameters",value:function(e){var n=e.props.collisionGroup,i=this.collisionFBOs,a=this.dummyCollisionMap;return{collisionFBO:i[n],dummyCollisionMap:a}}},{key:"cleanup",value:function(){this.dummyCollisionMap&&(this.dummyCollisionMap.delete(),this.dummyCollisionMap=void 0),this.channels={};for(var e=0,n=Object.keys(this.collisionFBOs);e<n.length;e++){var i=n[e];this.destroyFBO(i)}this.collisionFBOs={},this.lastViewport=void 0}},{key:"createFBO",value:function(e,n){var i,a,o=e.canvas,s=o.width,u=o.height,l=new Ce(e,{width:s,height:u,parameters:(i={},c(i,10241,9728),c(i,10240,9728),c(i,10242,33071),c(i,10243,33071),i)}),f=new dr(e,{format:33189,width:s,height:u});this.collisionFBOs[n]=new Le(e,{id:"Collision-".concat(n),width:s,height:u,attachments:(a={},c(a,36064,l),c(a,36096,f),a)})}},{key:"destroyFBO",value:function(e){for(var n=this.collisionFBOs[e],i=0,a=Object.values(n.attachments);i<a.length;i++){var o=a[i];o.delete()}n.delete(),delete this.collisionFBOs[e]}}]),t}();function Sfe(t){var r=Tfe();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function Tfe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var wfe={getCollisionPriority:{type:"accessor",value:0},collisionEnabled:!0,collisionGroup:{type:"string",value:"default"},collisionTestProps:{}},Xm=function(t){L(e,t);var r=Sfe(e);function e(){return A(this,e),r.apply(this,arguments)}return T(e,[{key:"getShaders",value:function(){return{modules:[$4]}}},{key:"draw",value:function(i){var a=i.uniforms,o=i.context,s=i.moduleParameters,u=this.props.collisionEnabled,l=s.collisionFBO,f=s.drawToCollisionMap,p=u&&Boolean(l);a.collision_enabled=p,f&&(this.props=this.clone(this.props.collisionTestProps).props)}},{key:"initializeState",value:function(i,a){var o;if(this.getAttributeManager()!==null){(o=this.context.deck)===null||o===void 0||o._addDefaultEffect(new rU);var s=this.getAttributeManager();s.add({collisionPriorities:{size:1,accessor:"getCollisionPriority",shaderAttributes:{collisionPriorities:{divisor:0},instanceCollisionPriorities:{divisor:1}}}})}}},{key:"getNeedsPickingBuffer",value:function(){return this.props.collisionEnabled}}]),e}(Et);c(Xm,"defaultProps",wfe);c(Xm,"extensionName","CollisionFilterExtension");F();j();k();var Pfe=`
4425uniform vec4 mask_bounds;
4426uniform bool mask_maskByInstance;
4427vec2 mask_getCoords(vec4 position) {
4428  return (position.xy - mask_bounds.xy) / (mask_bounds.zw - mask_bounds.xy);
4429}
4430`,Ofe=`
4431uniform sampler2D mask_texture;
4432uniform int mask_channel;
4433uniform bool mask_enabled;
4434uniform bool mask_inverted;
4435bool mask_isInBounds(vec2 texCoords) {
4436  if (!mask_enabled) {
4437    return true;
4438  }
4439  vec4 maskColor = texture2D(mask_texture, texCoords);
4440  float maskValue = 1.0;
4441  if (mask_channel == 0) {
4442    maskValue = maskColor.r;
4443  } else if (mask_channel == 1) {
4444    maskValue = maskColor.g;
4445  } else if (mask_channel == 2) {
4446    maskValue = maskColor.b;
4447  } else if (mask_channel == 3) {
4448    maskValue = maskColor.a;
4449  }
4450
4451  if (mask_inverted) {
4452    return maskValue >= 0.5;
4453  } else {
4454    return maskValue < 0.5;
4455  }
4456}
4457`,Efe={"vs:#decl":`
4458varying vec2 mask_texCoords;
4459`,"vs:#main-end":`
4460   vec4 mask_common_position;
4461   if (mask_maskByInstance) {
4462     mask_common_position = project_position(vec4(geometry.worldPosition, 1.0
4462));
4463   } else {
4464     mask_common_position = geometry.position;
4465   }
4466   mask_texCoords = mask_getCoords(mask_common_position);
4467`,"fs:#decl":`
4468varying vec2 mask_texCoords;
4469`,"fs:#main-start":`
4470  if (mask_enabled) {
4471    bool mask = mask_isInBounds(mask_texCoords);
4472
4473    // Debug: show extent of render target
4474    // gl_FragColor = vec4(mask_texCoords, 0.0, 1.0);
4475    gl_FragColor = texture2D(mask_texture, mask_texCoords);
4476
4477    if (!mask) discard;
4478  }
4479`},Cfe=function(r){return r&&"maskMap"in r?{mask_texture:r.maskMap}:{}},nU={name:"mask",dependencies:[Ft],vs:Pfe,fs:Ofe,inject:Efe,getUniforms:Cfe};function Mfe(t){var r=Ife();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function Ife(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Rfe={maskId:"",maskByInstance:void 0,maskInverted:!1},qm=function(t){L(e,t);var r=Mfe(e);function e(){return A(this,e),r.apply(this,arguments)}return T(e,[{key:"initializeState",value:function(){var i;(i=this.context.deck)===null||i===void 0||i._addDefaultEffect(new $m)}},{key:"getShaders",value:function(){var i="instancePositions"in this.getAttributeManager().attributes;return this.props.maskByInstance!==void 0&&(i=Boolean(this.props.maskByInstance)),this.state.maskByInstance=i,{modules:[nU]}}},{key:"draw",value:function(i){var a=i.uniforms,o=i.context,s=i.moduleParameters;a.mask_maskByInstance=this.state.maskByInstance;var u=this.props,l=u.maskId,f=u.maskInverted,p=s.maskChannels,h=o.viewport;if(p&&p[l]){var d=p[l],v=d.index,m=d.bounds,g=d.coordinateOrigin,y=p[l].coordinateSystem;a.mask_enabled=!0,a.mask_channel=v,a.mask_inverted=f,y===de.DEFAULT&&(y=h.isGeospatial?de.LNGLAT:de.CARTESIAN);var _={modelMatrix:null,fromCoordinateOrigin:g,fromCoordinateSystem:y},b=this.projectPosition([m[0],m[1],0],_),x=this.projectPosition([m[2],m[3],0],_);a.mask_bounds=[b[0],b[1],x[0],x[1]]}else l&&ne.warn("Could not find a mask layer with id: ".concat(l))(),a.mask_enabled=!1}}]),e}(Et);c(qm,"defaultProps",Rfe);c(qm,"extensionName","MaskExtension");F();j();k();be();F();j();k();var ui={NONE:0,WRITE_HEIGHT_MAP:1,USE_HEIGHT_MAP:2,USE_COVER:3,USE_COVER_ONLY:4,SKIP:5},iU=Object.keys(ui).map(function(t){return"const float TERRAIN_MODE_".concat(t," = ").concat(ui[t],".0;")}).join(`
4480`),Ym={name:"terrain",dependencies:[Ft],inject:{"vs:#decl":`
4481uniform float terrain_mode;
4482uniform sampler2D terrain_map;
4483uniform vec4 terrain_bounds;
4484varying vec3 commonPos;
4485`.concat(iU,`
4486    `),"vs:#main-start":`
4487if (terrain_mode == TERRAIN_MODE_SKIP) {
4488  gl_Position = vec4(0.0);
4489  return;
4490}
4491`,"vs:DECKGL_FILTER_GL_POSITION":`
4492commonPos = geometry.position.xyz;
4493if (terrain_mode == TERRAIN_MODE_WRITE_HEIGHT_MAP) {
4494  vec2 texCoords = (commonPos.xy - terrain_bounds.xy) / terrain_bounds.zw;
4495  position = vec4(texCoords * 2.0 - 1.0, 0.0, 1.0);
4496  commonPos.z += project_uCommonOrigin.z;
4497}
4498if (terrain_mode == TERRAIN_MODE_USE_HEIGHT_MAP) {
4499  vec3 anchor = geometry.worldPosition;
4500  anchor.z = 0.0;
4501  vec3 anchorCommon = project_position(anchor);
4502  vec2 texCoords = (anchorCommon.xy - terrain_bounds.xy) / terrain_bounds.zw;
4503  if (texCoords.x >= 0.0 && texCoords.y >= 0.0 && texCoords.x <= 1.0 && texCoords.y <= 1.0) {
4504    float terrainZ = texture2D(terrain_map, texCoords).r;
4505    geometry.position.z += terrainZ;
4506    position = project_common_position_to_clipspace(geometry.position);
4507  }
4508}
4509    `,"fs:#decl":`
4510uniform float terrain_mode;
4511uniform sampler2D terrain_map;
4512uniform vec4 terrain_bounds;
4513varying vec3 commonPos;
4514`.concat(iU,`
4515    `),"fs:#main-start":`
4516if (terrain_mode == TERRAIN_MODE_WRITE_HEIGHT_MAP) {
4517  gl_FragColor = vec4(commonPos.z, 0.0, 0.0, 1.0);
4518  return;
4519}
4520    `,"fs:DECKGL_FILTER_COLOR":`
4521if ((terrain_mode == TERRAIN_MODE_USE_COVER) || (terrain_mode == TERRAIN_MODE_USE_COVER_ONLY)) {
4522  vec2 texCoords = (commonPos.xy - terrain_bounds.xy) / terrain_bounds.zw;
4523  vec4 pixel = texture2D(terrain_map, texCoords);
4524  if (terrain_mode == TERRAIN_MODE_USE_COVER_ONLY) {
4525    color = pixel;
4526  } else {
4527    // pixel is premultiplied
4528    color = pixel + color * (1.0 - pixel.a);
4529  }
4530  return;
4531}
4532    `},getUniforms:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;if("dummyHeightMap"in r){var n=r.drawToTerrainHeightMap,i=r.heightMap,a=r.heightMapBounds,o=r.dummyHeightMap,s=r.terrainCover,u=r.useTerrainHeightMap,l=r.terrainSkipRender,f=e.project_uCommonOrigin,p=l?ui.SKIP:ui.NONE,h=o,d=null;if(n)p=ui.WRITE_HEIGHT_MAP,d=a;else if(u&&i)p=ui.USE_HEIGHT_MAP,h=i,d=a;else if(s){var v=r.pickingActive;h=v?s.getPickingFramebuffer():s.getRenderFramebuffer(),v&&(p=ui.SKIP),h?(p=p===ui.SKIP?ui.USE_COVER_ONLY:ui.USE_COVER,d=s.bounds):h=o}return{terrain_mode:p,terrain_map:h,terrain_bounds:d?[d[0]-f[0],d[1]-f[1],d[2]-d[0],d[3]-d[1]]:[0,0,0,0]}}return null}};F();j();k();k();function aU(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function oU(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};
4532r%2?aU(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):aU(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function Jc(t,r){var e;return new Le(t,{id:r.id,attachments:c({},36064,new Ce(t,oU(oU({},r.float&&{format:ge(t)?34836:6408,type:5126}),{},{mipmaps:!1,parameters:(e={},c(e,10241,9729),c(e,10240,9729),c(e,10242,33071),c(e,10243,33071),e)})))})}function Lfe(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=kfe(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
4533In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function kfe(t,r){if(t){if(typeof t=="string")return sU(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return sU(t,r)}}function sU(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var uU=function(){function t(r){A(this,t),c(this,"isDirty",!0),c(this,"targetLayer",void 0),c(this,"renderViewport",null),c(this,"bounds",null),c(this,"fbo",void 0),c(this,"pickingFbo",void 0),c(this,"layers",[]),c(this,"tile",void 0),c(this,"targetBounds",null),c(this,"targetBoundsCommon",null),this.targetLayer=r,this.tile=lU(r)}return T(t,[{key:"id",get:function(){return this.targetLayer.id}},{key:"isActive",get:function(){return Boolean(this.targetLayer.getCurrentLayer())}},{key:"shouldUpdate",value:function(e){var n=e.targetLayer,i=e.viewport,a=e.layers,o=e.layerNeedsRedraw;n&&(this.targetLayer=n);var s=i?this._updateViewport(i):!1,u=a?this._updateLayers(a):!1;if(o){var l=Lfe(this.layers),f;try{for(l.s();!(f=l.n()).done;){var p=f.value;if(o[p]){u=!0;break}}}catch(h){l.e(h)}finally{l.f()}}return u||s}},{key:"_updateLayers",value:function(e){var n=!1;if(e=this.tile?Bfe(this.tile,e):e,e.length!==this.layers.length)n=!0;else for(var i=0;i<e.length;i++){var a=e[i].id;if(a!==this.layers[i]){n=!0;break}}return n&&(this.layers=e.map(function(o){return o.id})),n}},{key:"_updateViewport",value:function(e){var n=this.targetLayer,i=!1;if(this.tile&&"boundingBox"in this.tile){if(!this.targetBounds){i=!0,this.targetBounds=this.tile.boundingBox;var a=e.projectPosition(this.targetBounds[0]),o=e.projectPosition(this.targetBounds[1]);this.targetBoundsCommon=[a[0],a[1],o[0],o[1]]}}else this.targetBounds!==n.getBounds()&&(i=!0,this.targetBounds=n.getBounds(),this.targetBoundsCommon=ol([n],e));if(!this.targetBoundsCommon)return!1;var s=Math.ceil(e.zoom+.5);if(this.tile)this.bounds=this.targetBoundsCommon;else{var u,l=(u=this.renderViewport)===null||u===void 0?void 0:u.zoom;i=i||s!==l;var f=ul(this.targetBoundsCommon,e),p=this.bounds;i=i||!p||f.some(function(h,d){return h!==p[d]}),this.bounds=f}return i&&(this.renderViewport=sl({bounds:this.bounds,zoom:s,viewport:e})),i}},{key:"getRenderFramebuffer",value:function(){return!this.renderViewport||this.layers.length===0?null:(this.fbo||(this.fbo=Jc(this.targetLayer.context.gl,{id:this.id})),this.fbo)}},{key:"getPickingFramebuffer",value:function(){return!this.renderViewport||this.layers.length===0&&!this.targetLayer.props.pickable?null:(this.pickingFbo||(this.pickingFbo=Jc(this.targetLayer.context.gl,{id:"".concat(this.id,"-picking")})),this.pickingFbo)}},{key:"filterLayers",value:function(e){var n=this;return e.filter(function(i){var a=i.id;return n.layers.includes(a)})}},{key:"delete",value:function(){var e=this.fbo,n=this.pickingFbo;e&&(e.texture.delete(),e.delete()),n&&(n.texture.delete(),n.delete())}}]),t}();function Bfe(t,r){return r.filter(function(e){var n=lU(e);
4533return n?Ffe(t.boundingBox,n.boundingBox):!0})}function lU(t){for(;t;){var r=t.props.tile;if(r)return r;t=t.parent}return null}function Ffe(t,r){return t&&r?t[0][0]<r[1][0]&&r[0][0]<t[1][0]&&t[0][1]<r[1][1]&&r[0][1]<t[1][1]:!1}k();F();j();function fU(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function Km(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?fU(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):fU(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function Dfe(t){var r=Nfe();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function Nfe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var cU=function(t){L(e,t);var r=Dfe(e);function e(){return A(this,e),r.apply(this,arguments)}return T(e,[{key:"getRenderableLayers",value:function(i,a){for(var o=a.layers,s=[],u=this._getDrawLayerParams(i,a,!0),l=0;l<o.length;l++){var f=o[l];!f.isComposite&&u[l].shouldDrawLayer&&s.push(f)}return s}},{key:"renderHeightMap",value:function(i,a){var o=this,s=i.getRenderFramebuffer(),u=i.renderViewport;!s||!u||(s.resize(u),ke(this.gl,{clearColor:[0,0,0,0],blend:!0,blendFunc:[1,1],blendEquation:32776,depthTest:!1},function(){return o.render(Km(Km({},a),{},{target:s,pass:"terrain-height-map",layers:a.layers,viewports:[u],effects:[]}))}))}},{key:"renderTerrainCover",value:function(i,a){var o=this,s=i.getRenderFramebuffer(),u=i.renderViewport;if(!(!s||!u)){var l=i.filterLayers(a.layers);s.resize(u),ke(this.gl,{clearColor:[0,0,0,0],depthTest:!1},function(){return o.render(Km(Km({},a),{},{target:s,pass:"terrain-cover-".concat(i.id),layers:l,effects:[],viewports:[u]}))})}}}]),e}(br);F();j();k();function pU(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function hU(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?pU(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):pU(Object(e)).forEac
4533h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function jfe(t){var r=Ufe();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function Ufe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var dU=function(t){L(e,t);var r=jfe(e);function e(){var n;A(this,e);for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return n=r.call.apply(r,[this].concat(a)),c(q(n),"drawParameters",{}),n}return T(e,[{key:"getRenderableLayers",value:function(i,a){var o=a.layers,s=[];this.drawParameters={},this._resetColorEncoder(a.pickZ);for(var u=this._getDrawLayerParams(i,a),l=0;l<o.length;l++){var f=o[l];!f.isComposite&&u[l].shouldDrawLayer&&(s.push(f),this.drawParameters[f.id]=u[l].layerParameters)}return s}},{key:"renderTerrainCover",value:function(i,a){var o=this,s=i.getPickingFramebuffer(),u=i.renderViewport;if(!(!s||!u)){var l=i.filterLayers(a.layers),f=i.targetLayer;f.props.pickable&&l.unshift(f),s.resize(u),ke(this.gl,{depthTest:!1},function(){return o.render(hU(hU({},a),{},{pickingFBO:s,pass:"terrain-cover-picking-".concat(i.id),layers:l,effects:[],viewports:[u],cullRect:void 0,deviceRect:u,pickZ:!1}))})}}},{key:"getLayerParameters",value:function(i,a,o){if(this.drawParameters[i.id])return this.drawParameters[i.id];var s=Z(S(e.prototype),"getLayerParameters",this).call(this,i,a,o);return s.blend=!0,s}}]),e}(_a);F();j();k();var vU=2048,SS=function(){function t(r){A(this,t),c(this,"renderViewport",null),c(this,"bounds",null),c(this,"fbo",void 0),c(this,"gl",void 0),c(this,"layers",[]),c(this,"layersBounds",[]),c(this,"layersBoundsCommon",null),c(this,"lastViewport",null),this.gl=r}return T(t,[{key:"getRenderFramebuffer",value:function(){return this.renderViewport?(this.fbo||(this.fbo=Jc(this.gl,{id:"height-map",float:!0})),this.fbo):null}},{key:"shouldUpdate",value:function(e){var n=this,i=e.layers,a=e.viewport,o=i.length!==this.layers.length||i.some(function(h,d){return h!==n.layers[d]||h.props.transitions||h.getBounds()!==n.layersBounds[d]});o&&(this.layers=i,this.layersBounds=i.map(function(h){return h.getBounds()}),this.layersBoundsCommon=ol(i,a));var s=!this.lastViewport||!a.equals(this.lastViewport);if(!this.layersBoundsCommon)this.renderViewport=null;else if(o||s){var u=ul(this.layersBoundsCommon,a);if(u[2]<=u[0]||u[3]<=u[1])return this.renderViewport=null,!1;this.bounds=u,this.lastViewport=a;var l=a.scale,f=(u[2]-u[0])*l,p=(u[3]-u[1])*l;return this.renderViewport=f>0||p>0?sl({bounds:[a.center[0]-1,a.center[1]-1,a.center[0]+1,a.center[1]+1],zoom:a.zoom,width:Math.min(f,vU),height:Math.min(p,vU),viewport:a}):null,!0}return!1}},{key:"delete",value:function(){this.fbo&&(this.fbo.color.delete(),this.fbo.delete())}}],[{key:"isSupported",value:function(e){return Le.isSupported(e,{colorBufferFloat:!0})}}]),t}();function mU(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function Zm(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?mU(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):mU(Object(e)).forEac
4533h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function ll(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=Gfe(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
4534In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function Gfe(t,r){if(t){if(typeof t=="string")return gU(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return gU(t,r)}}function gU(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var yU=function(){function t(){A(this,t),c(this,"id","terrain-effect"),c(this,"props",null),c(this,"useInPicking",!0),c(this,"isPicking",!1),c(this,"isDrapingEnabled",!1),c(this,"dummyHeightMap",void 0),c(this,"heightMap",void 0),c(this,"terrainPass",void 0),c(this,"terrainPickingPass",void 0),c(this,"terrainCovers",new Map)}return T(t,[{key:"initialize",value:function(e){this.dummyHeightMap=new Ce(e,{width:1,height:1,data:new Uint8Array([0,0,0,0])}),this.terrainPass=new cU(e,{id:"terrain"}),this.terrainPickingPass=new dU(e,{id:"terrain-picking"}),SS.isSupported(e)?this.heightMap=new SS(e):ne.warn("Terrain offset mode is not supported by this browser")(),Yr.getDefaultProgramManager(e).addDefaultModule(Ym)}},{key:"preRender",value:function(e,n){if(!this.dummyHeightMap){this.initialize(e);var i=ll(n.layers),a;try{for(i.s();!(a=i.n()).done;){var o=a.value;o.props.operation.includes("terrain")&&o.setChangeFlags({extensionsChanged:!0})}}catch(m){i.e(m)}finally{i.f()}}if(n.pickZ){this.isDrapingEnabled=!1;return}var s=n.viewports,u=n.isPicking,l=u===void 0?!1:u;this.isPicking=l,this.isDrapingEnabled=!0;var f=s[0],p=(l?this.terrainPickingPass:this.terrainPass).getRenderableLayers(f,n),h=p.filter(function(m){return m.props.operation.includes("terrain")});if(h.length!==0){if(!l){var d=p.filter(function(m){return m.state.terrainDrawMode==="offset"});d.length>0&&this._updateHeightMap(h,f,n)}var v=p.filter(function(m){return m.state.terrainDrawMode==="drape"});this._updateTerrainCovers(h,v,f,n)}}},{key:"getModuleParameters",value:function(e){var n,i,a=e.state.terrainDrawMode;return{heightMap:(n=this.heightMap)===null||n===void 0?void 0:n.getRenderFramebuffer(),heightMapBounds:(i=this.heightMap)===null||i===void 0?void 0:i.bounds,dummyHeightMap:this.dummyHeightMap,terrainCover:this.isDrapingEnabled?this.terrainCovers.get(e.id):null,useTerrainHeightMap:a==="offset",terrainSkipRender:a==="drape"||!e.props.operation.includes("draw")}}},{key:"cleanup",value:function(){this.dummyHeightMap&&(this.dummyHeightMap.delete(),this.dummyHeightMap=void 0),this.heightMap&&(this.heightMap.delete(),this.heightMap=void 0);var e=ll(this.terrainCovers.values()),n;try{for(e.s();!(n=e.n()).done;){var i=n.value;i.delete()}}catch(a){e.e(a)}finally{e.f()}this.terrainCovers.clear()}},{key:"_updateHeightMap",value:function(e,n,i){if(this.heightMap){var a=this.heightMap.shouldUpdate({layers:e,viewport:n});a&&this.terrainPass.renderHeightMap(this.heightMap,Zm(Zm({},i),{},{layers:e,moduleParameters:{heightMapBounds:this.heightMap.bounds,dummyHeightMap:this.dummyHeightMap,devicePixelRatio:1,drawToTerrainHeightMap:!0}}))}}},{key:"_updateTerrainCovers",value:function(e,n,i,a){var o={},s=ll(n),u;try{for(s.s();!(u=s.n()).done;){var l=u.value;l.state.terrainCoverNeedsRedraw&&(o[l.id]=!0,l.state.terrainCoverNeedsRedraw=!1)}}catch(g){s.e(g)}finally{s.f()}var f=ll(this.terrainCovers.values()),p;try{for(f.s();!(p=f.n()).done;){var h=p.value;h.isDirty=h.isDirty||h.shouldUpdate({layerNeedsRedraw:o})}}catch(g){f.e(g)}finally{f.f()}var d=ll(e),v;try{for(d.s();!(v=d.n()).done;){var m=v.value;this._updateTerrainCover(m,n,i,a)}}catch(g){d.e(g)}finally{d.f()}this.isPicking||this._pruneTerrainCovers()}},{key:"_updateTerrainCover",value:function(e,n,i,a){var o=this.isPicking?this.terrainPickingPass:this.terrainPass,s=this.terrainCovers.get(e.id);s||(s=new uU(e),this.terrainCovers.set(e.id,s));try{var u=s.shouldUpdate({targetLayer:e,viewport:i,layers:n});(this.isPicking||s.isDirty||u)&&(o.renderTerrainCover(s,Zm(Zm({},a),{},{layers:n,moduleParameters:{dummyHeightMap:this.dummyHeightMap,terrainSkipRender:!1,devicePixelRatio:1}})),s.isDirty=!1)}catch(l){e.raiseError(l,"Error rendering terrain cover ".concat(s.id))}}},{key:"_pruneTerrainCovers",value:function(){var e=[],n=ll(this.terrainCovers),i;try{for(n.s();!(i=n.n()).done;){var a=W(i.value,2),o=a[0],s=a[1];s.isActive||e.push(o)}}catch(p){n.e(p)}finally{n.f()}for(var u=0,l=e;u<l.length;u++){var f=l[u];this.terrainCovers.delete(f)}}}]),t}();function zfe(t){var r=Vfe();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function Vfe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Hfe={terrainDrawMode:void 0},Jm=function(t){L(e,t);var r=zfe(e);function e(){return A(this,e),r.apply(this,arguments)}return T(e,[{key:"getShaders",value:function(){return{modules:[Ym]}}},{key:"initializeState",value:function(){var i;(i=this.context.deck)===null||i===void 0||i._addDefaultEffect(new yU)}},{key:"updateState",value:function(i){var a=i.props,o=i.oldProps;if(!(this.state.terrainDrawMode&&a.terrainDrawMode===o.terrainDrawMode&&a.extruded===o.extruded)){var s=a.terrainDrawMode;if(!s){var u,l=this.props.extruded,f=(u=this.getAttributeManager())===null||u===void 0?void 0:u.attributes,p=f&&"instancePositions"in f;s=l||p?"offset":"drape"}this.setState({terrainDrawMode:s})}}},{key:"onNeedsRedraw",value:function(){var i=this.state;i.terrainDrawMode==="drape"&&(i.terrainCoverNeedsRedraw=!0)}}]),e}(Et);c(Jm,"defaultProps",Hfe);c(Jm,"extensionName","TerrainExtension");k();var FS=me(Ae());be();k();function PS(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=Wfe(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}
vendor: 1,237 bytes, lines 4534-4535
4534}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
4535In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function Wfe(t,r){if(t){if(typeof t=="string")return _U(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return _U(t,r)}}function _U(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function bU(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function ls(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?bU(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):bU(Object(e)).forEac
4535h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function OS(t,r,e){var n=$fe(t),i=Object.keys(n).filter(function(a){return n[a]!==Array});return Xfe(t,ls({propArrayTypes:n},r),{numericPropKeys:e&&e.numericPropKeys||i,PositionDataType:e?e.PositionDataType:Float32Array,triangulate:e?e.triangulate:!0})}function $fe(t){var r={},e=PS(t),n;try{for(e.s();!(n=e.n()).done;){var i=n.value;if(i.properties)for(var a in i.properties){var o=i.properties[a];r[a]=Qfe(o,r[a])}}}catch(s){e.e(s)}finally{e.f()}return r}function Xfe(t,r,e){var n=r.pointPositionsCount,i=r.pointFeaturesCount,a=r.linePositionsCount,o=r.linePathsCount,s=r.lineFeaturesCount,u=r.polygonPositionsCount,l=r.polygonObjectsCount,f=r.polygonRingsCount,p=r.polygonFeaturesCount,h=r.propArrayTypes,d=r.coordLength,v=e.numericPropKeys,m=v===void 0?[]:v,g=e.PositionDataType,y=g===void 0?Float32Array:g,_=e.triangulate,b=_===void 0?!0:_,x=t[0]&&"id"in t[0],w=t.length>65535?Uint32Array:Uint16Array,P={type:"Point",positions:new y(n*d),globalFeatureIds:new w(n),featureIds:i>65535?new Uint32Array(n):new Uint16Array(n),numericProps:{},properties:[],fields:[]},E={type:"LineString",pathIndices:a>65535?new Uint32Array(o+1):new Uint16Array(o+1),positions:new y(a*d),globalFeatureIds:new w(a),featureIds:s>65535?new Uint32Array(a):new Uint16Array(a),numericProps:{},properties:[],fields:[]},C={type:"Polygon",polygonIndices:u>65535?new Uint32Array(l+1):new Uint16Array(l+1),primitivePolygonIndices:u>65535?new Uint32Array(f+1):new Uint16Array(f+1),positions:new y(u*d),globalFeatureIds:new w(u),featureIds:p>65535?new Uint32Array(u):new Uint16Array(u),numericProps:{},properties:[],fields:[]};b&&(C.triangles=[]);for(var I=0,O=[P,E,C];I<O.length;I++){var D=O[I],N=PS(m),H;try{for(N.s();!(H=N.n()).done;){var $=H.value,ee=h[$];D.numericProps[$]=new ee(D.positions.length/d)}}catch(ce){N.e(ce)}finally{N.f()}}E.pathIndices[o]=a,C.polygonIndices[l]=u,C.primitivePolygonIndices[f]=u;var V={pointPosition:0,pointFeature:0,linePosition:0,linePath:0,lineFeature:0,polygonPosition:0,polygonObject:0,polygonRing:0,polygonFeature:0,feature:0},U=PS(t),X;try{for(U.s();!(X=U.n()).done;){var K=X.value,te=K.geometry,ie=K.properties||{};switch(te.type){case"Point":qfe(te,P,V,d,ie),P.properties.push(wS(ie,m)),x&&P.fields.push({id:K.id}),V.pointFeature++;break;case"LineString":Yfe(te,E,V,d,ie),E.properties.push(wS(ie,m)),x&&E.fields.push({id:K.id}),V.lineFeature++;break;case"Polygon":Kfe(te,C,V,d,ie),C.properties.push(wS(ie,m)),x&&C.fields.push({id:K.id}),V.polygonFeature++;break;default:throw new Error("Invalid geometry type")}V.feature++}}catch(ce){U.e(ce)}finally{U.f()}return Jfe(P,E,C,d)}function qfe(t,r,e,n,i){r.positions.set(t.data,e.pointPosition*n);var a=t.data.length/n;ES(r,i,e.pointPosition,a),r.globalFeatureIds.fill(e.feature,e.pointPosition,e.pointPosition+a),r.featureIds.fill(e.pointFeature,e.pointPosition,e.pointPosition+a),e.pointPosition+=a}function Yfe(t,r,e,n,i){r.positions.set(t.data,e.linePosition*n);var a=t.data.length/n;ES(r,i,e.linePosition,a),r.globalFeatureIds.fill(e.feature,e.linePosition,e.linePosition+a),r.featureIds.fill(e.lineFeature,e.linePosition,e.linePosition+a);for(var o=0,s=t.indices.length;o<s;++o){var u=t.indices[o],l=o===s-1?t.data.length:t.indices[o+1];r.pathIndices[e.linePath++]=e.linePosition,e.linePosition+=(l-u)/n}}function Kfe(t,r,e,n,i){r.positions.set(t.data,e.polygonPosition*n);var a=t.data.length/n;ES(r,i,e.polygonPosition,a),r.globalFeatureIds.fill(e.feature,e.polygonPosition,e.polygonPosition+a),r.featureIds.fill(e.polygonFeature,e.polygonPosition,e.polygonPosition+a);for(var o=0,s=t.indices.length;o<s;++o){var u=e.polygonPosition;r.polygonIndices[e.polygonObject++]=u;for(var l=t.areas[o],f=t.indices[o],p=t.indices[o+1],h=0,d=f.length;h<d;++h){var v=f[h],m=h===d-1?p===void 0?t.data.length:p[0]:f[h+1];r.primitivePolygonIndices[e.polygonRing++]=e.polygonPosition,e.polygonPosition+=(m-v)/n}var g=e.polygonPosition;Zfe(r,l,f,{startPosition:u,endPosition:g,coordLength:n})}}function Zfe(t,r,e,n){var i=n.startPosition,a=n.endPosition,o=n.coordLength;if(t.triangles)for(var s=i*o,u=a*o,l=t.positions.subarray(s,u),f=e[0],p=e.slice(1).map(function(m){return(m-f)/o}),h=kb(l,p,o,r),d=0,v=h.length;d<v;++d)t.triangles.push(i+h[d])}function TS(t,r){var e={};for(var n in t)e[n]={value:t[n],size:r};return e}function Jfe(t,r,e,n){var i={points:ls(ls({},t),{},{positions:{value:t.positions,size:n},globalFeatureIds:{value:t.globalFeatureIds,size:1},featureIds:{value:t.featureIds,size:1},numericProps:TS(t.numericProps,1)}),lines:ls(ls({},r),{},{positions:{value:r.positions,size:n},pathIndices:{value:r.pathIndices,size:1},globalFeatureIds:{value:r.globalFeatureIds,size:1},featureIds:{value:r.featureIds,size:1},numericProps:TS(r.numericProps,1)}),polygons:ls(ls({},e),{},{positions:{value:e.positions,size:n},polygonIndices:{value:e.polygonIndices,size:1},primitivePolygonIndices:{value:e.primitivePolygonIndices,size:1},globalFeatureIds:{value:e.globalFeatureIds,size:1},featureIds:{value:e.featureIds,size:1},numericProps:TS(e.numericProps,1)})};return e.triangles&&(i.polygons.triangles={value:new Uint32Array(e.triangles),size:1}),i}function ES(t,r,e,n){for(var i in t.numericProps)if(i in r){var a=r[i];t.numericProps[i].fill(a,e,e+n)}}function wS(t,r){var e={};for(var n in t)r.includes(n)||(e[n]=t[n]);return e}function Qfe(t,r){return r===Array||!Number.isFinite(t)?Array:r===Float64Array||Math.fround(t)!==t?Float64Array:Float32Array}k();function xU(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function ece(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};
4535r%2?xU(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):xU(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function SU(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=tce(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
4536In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function tce(t,r){if(t){if(typeof t=="string")return AU(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return AU(t,r)}}function AU(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function tg(t,r){var e=r?.globalFeatureId;return e!==void 0?rce(t,e):nce(t,r?.type)}function rce(t,r){var e=wU(t),n=SU(e),i;try{for(n.s();!(i=n.n()).done;){for(var a=i.value,o=0,s=a.featureIds.value[0],u=0;u<a.featureIds.value.length;u++){var l=a.featureIds.value[u];if(l!==s){if(r===a.globalFeatureIds.value[o])return Qm(a,o,u);o=u,s=l}}if(r===a.globalFeatureIds.value[o])return Qm(a,o,a.featureIds.value.length)}}catch(f){n.e(f)}finally{n.f()}throw new Error("featureId:".concat(r," not found"))}function nce(t,r){var e=wU(t,r);return ice(e)}function TU(t,r,e){switch(t.type){case"Point":return uce(t,r,e);case"LineString":return sce(t,r,e);case"Polygon":return PU(t,r,e);default:var n=t;throw new Error("Unsupported geometry type: ".concat(n?.type))}}function wU(t,r){var e=Boolean(t.points||t.lines||t.polygons);if(!e)return t.type=r||lce(t),[t];var n=[];return t.points&&(t.points.type="Point",n.push(t.points)),t.lines&&(t.lines.type="LineString",n.push(t.lines)),t.polygons&&(t.polygons.type="Polygon",n.push(t.polygons)),n}function ice(t){var r=[],e=SU(t),n;try{for(e.s();!(n=e.n()).done;){var i=n.value;if(i.featureIds.value.length!==0){for(var a=0,o=i.featureIds.value[0],s=0;s<i.featureIds.value.length;s++){var u=i.featureIds.value[s];u!==o&&(r.push(Qm(i,a,s)),a=s,o=u)}r.push(Qm(i,a,i.featureIds.value.length))}}}catch(l){e.e(l)}finally{e.f()}return r}function Qm(t,r,e){var n=TU(t,r,e),i=oce(t,r,e),a=ace(t,r,e);return ece({type:"Feature",geometry:n,properties:i},a)}function ace(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,e=arguments.length>2?arguments[2]:void 0;return t.fields&&t.fields[t.featureIds.value[r]]}function oce(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,e=arguments.length>2?arguments[2]:void 0,n=Object.assign({},t.properties[t.featureIds.value[r]]);for(var i in t.numericProps)n[i]=t.numericProps[i].value[r];return n}function PU(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1/0,e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1/0,n=t.positions,i=t.polygonIndices.value.filter(function(y){return y>=r&&y<=e}),a=t.primitivePolygonIndices.value.filter(function(y){return y>=r&&y<=e}),o=i.length>2;if(!o){for(var s=[],u=0;u<a.length-1;u++){var l=a[u],f=a[u+1],p=eg(n,l,f);s.push(p)}return{type:"Polygon",coordinates:s}}for(var h=[],d=0;d<i.length-1;d++){var v=i[d],m=i[d+1],g=PU(t,v,m).coordinates;h.push(g)}return{type:"MultiPolygon",coordinates:h}}function sce(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1/0,e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1/0,n=t.positions,i=t.pathIndices.value.filter(function(f){return f>=r&&f<=e}),a=i.length>2;if(!a){var o=eg(n,i[0],i[1]);return{type:"LineString",coordinates:o}}for(var s=[],u=0;u<i.length-1;u++){var l=eg(n,i[u],i[u+1]);s.push(l)}return{type:"MultiLineString",coordinates:s}}function uce(t,r,e){var n=t.positions,i=eg(n,r,e),a=i.length>1;return a?{type:"MultiPoint",coordinates:i}:{type:"Point",coordinates:i[0]}}function eg(t,r,e){r=r||0,e=e||t.value.length/t.size;
4536for(var n=[],i=r;i<e;i++){for(var a=Array(),o=i*t.size;o<(i+1)*t.size;o++)a.push(Number(t.value[o]));n.push(a)}return n}function lce(t){return t.pathIndices?"LineString":t.polygonIndices?"Polygon":"Point"}var BS=me(LU());F();k();F();j();k();F();j();k();function kU(t){var r=t.length;if(r<=1)return[t];for(var e=[],n,i,a=0;a<r;a++){var o=Oce(t[a]);o!==0&&(i===void 0&&(i=o<0),i===o<0?(n&&e.push(n),n=[t[a]]):n&&n.push(t[a]))}return n&&e.push(n),e}function Oce(t){for(var r=0,e=0,n=t.length-1,i,a;e<t.length;n=e++)i=t[e],a=t[n],r+=(a[0]-i[0])*(i[1]+a[1]);return r}function BU(t,r,e){r&&e&&(t===1?r.id=e.readVarint():t===2?Ece(e,r):t===3?r.type=e.readVarint():t===4&&(r._geometry=e.pos))}function Ece(t,r){for(var e=t.readVarint()+t.pos;t.pos<e;){var n=r._keys[t.readVarint()],i=r._values[t.readVarint()];r.properties[n]=i}}var FU=function(){function t(r,e,n,i,a){A(this,t),c(this,"properties",void 0),c(this,"extent",void 0),c(this,"type",void 0),c(this,"id",void 0),c(this,"_pbf",void 0),c(this,"_geometry",void 0),c(this,"_keys",void 0),c(this,"_values",void 0),this.properties={},this.extent=n,this.type=0,this.id=null,this._pbf=r,this._geometry=-1,this._keys=i,this._values=a,r.readFields(BU,this,e)}return T(t,[{key:"loadGeometry",value:function(){var e=this._pbf;e.pos=this._geometry;for(var n=e.readVarint()+e.pos,i=1,a=0,o=0,s=0,u=[],l;e.pos<n;){if(a<=0){var f=e.readVarint();i=f&7,a=f>>3}if(a--,i===1||i===2)o+=e.readSVarint(),s+=e.readSVarint(),i===1&&(l&&u.push(l),l=[]),l&&l.push([o,s]);else if(i===7)l&&l.push(l[0].slice());else throw new Error("unknown command ".concat(i))}return l&&u.push(l),u}},{key:"bbox",value:function(){var e=this._pbf;e.pos=this._geometry;for(var n=e.readVarint()+e.pos,i=1,a=0,o=0,s=0,u=1/0,l=-1/0,f=1/0,p=-1/0;e.pos<n;){if(a<=0){var h=e.readVarint();i=h&7,a=h>>3}if(a--,i===1||i===2)o+=e.readSVarint(),s+=e.readSVarint(),o<u&&(u=o),o>l&&(l=o),s<f&&(f=s),s>p&&(p=s);else if(i!==7)throw new Error("unknown command ".concat(i))}return[u,f,l,p]}},{key:"_toGeoJSON",value:function(e){var n=this.loadGeometry(),i=t.types[this.type],a,o;switch(this.type){case 1:var s=[];for(a=0;a<n.length;a++)s[a]=n[a][0];n=s,e(n,this);break;case 2:for(a=0;a<n.length;a++)e(n[a],this);break;case 3:for(n=kU(n),a=0;a<n.length;a++)for(o=0;o<n[a].length;o++)e(n[a][o],this);break}n.length===1?n=n[0]:i="Multi".concat(i);var u={type:"Feature",geometry:{type:i,coordinates:n},properties:this.properties};return this.id!==null&&(u.id=this.id),u}},{key:"toGeoJSON",value:function(e){if(typeof e=="function")return this._toGeoJSON(e);var n=e.x,i=e.y,a=e.z,o=this.extent*Math.pow(2,a),s=this.extent*n,u=this.extent*i;function l(f){for(var p=0;p<f.length;p++){var h=f[p];h[0]=(h[0]+s)*360/o-180;var d=180-(h[1]+u)*360/o;
4536h[1]=360/Math.PI*Math.atan(Math.exp(d*Math.PI/180))-90}}return this._toGeoJSON(l)}}],[{key:"types",get:function(){return["Unknown","Point","LineString","Polygon"]}}]),t}();var DU=function(){function t(r,e){A(this,t),c(this,"version",void 0),c(this,"name",void 0),c(this,"extent",void 0),c(this,"length",void 0),c(this,"_pbf",void 0),c(this,"_keys",void 0),c(this,"_values",void 0),c(this,"_features",void 0),this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=r,this._keys=[],this._values=[],this._features=[],r.readFields(Cce,this,e),this.length=this._features.length}return T(t,[{key:"feature",value:function(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var n=this._pbf.readVarint()+this._pbf.pos;return new FU(this._pbf,n,this.extent,this._keys,this._values)}}]),t}();function Cce(t,r,e){r&&e&&(t===15?r.version=e.readVarint():t===1?r.name=e.readString():t===5?r.extent=e.readVarint():t===2?r._features.push(e.pos):t===3?r._keys.push(e.readString()):t===4&&r._values.push(Mce(e)))}function Mce(t){for(var r=null,e=t.readVarint()+t.pos;t.pos<e;){var n=t.readVarint()>>3;r=n===1?t.readString():n===2?t.readFloat():n===3?t.readDouble():n===4?t.readVarint64():n===5?t.readVarint():n===6?t.readSVarint():n===7?t.readBoolean():null}return r}var NU=function t(r,e){A(this,t),c(this,"layers",void 0),this.layers=r.readFields(Ice,{},e)};function Ice(t,r,e){if(t===3&&e){var n=new DU(e,e.readVarint()+e.pos);n.length&&r&&(r[n.name]=n)}}F();k();F();j();k();k();F();j();k();function jU(t){var r=t.indices.length,e="Polygon";if(r<=1)return{type:e,data:t.data,areas:[[Mi(t.data)]],indices:[t.indices]};for(var n=[],i=[],a=[],o=[],s,u=0,l,f=0,p;f<r;f++){p=t.indices[f]-u,l=t.indices[f+1]-u||t.data.length;var h=t.data.slice(p,l),d=Mi(h);if(d===0){var v=t.data.slice(0,p),m=t.data.slice(l);t.data=v.concat(m),u+=l-p;continue}s===void 0&&(s=d<0),s===d<0?(o.length&&(n.push(a),i.push(o)),o=[p],a=[d]):(a.push(d),o.push(p))}return a&&n.push(a),o.length&&i.push(o),{type:e,areas:n,indices:i,data:t.data}}function UU(t,r,e,n){for(var i=0,a=t.length;i<a;i+=2){t[i]=(t[i]+r)*360/n-180;var o=180-(t[i+1]+e)*360/n;t[i+1]=360/Math.PI*Math.atan(Math.exp(o*Math.PI/180))-90}}function GU(t,r,e){r&&e&&(t===1?r.id=e.readVarint():t===2?Rce(e,r):t===3?r.type=e.readVarint():t===4&&(r._geometry=e.pos))}function Rce(t,r){for(var e=t.readVarint()+t.pos;t.pos<e;){var n=r._keys[t.readVarint()],i=r._values[t.readVarint()];r.properties[n]=i}}function Lce(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=kce(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
4537In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function kce(t,r){if(t){if(typeof t=="string")return zU(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return zU(t,r)}}function zU(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function VU(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function HU(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?VU(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):VU(Object(e)).forEac
4537h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var WU,fs,IS,ig,RS,LS,Qc;var $U=function(){function t(r,e,n,i,a,o){A(this,t),c(this,"properties",void 0),c(this,"extent",void 0),c(this,"type",void 0),c(this,"id",void 0),c(this,"_pbf",void 0),c(this,"_geometry",void 0),c(this,"_keys",void 0),c(this,"_values",void 0),c(this,"_geometryInfo",void 0),this.properties={},this.extent=n,this.type=0,this.id=null,this._pbf=r,this._geometry=-1,this._keys=i,this._values=a,this._geometryInfo=o,r.readFields(GU,this,e)}return T(t,[{key:"loadGeometry",value:function(){var e=this._pbf;e.pos=this._geometry,WU=e.readVarint()+e.pos,fs=1,ig=0,RS=0,LS=0,Qc=0;for(var n=[],i=[];e.pos<WU;)if(ig<=0&&(IS=e.readVarint(),fs=IS&7,ig=IS>>3),ig--,fs===1||fs===2)RS+=e.readSVarint(),LS+=e.readSVarint(),fs===1&&n.push(Qc),i.push(RS,LS),Qc+=2;else if(fs===7){if(Qc>0){var a=n[n.length-1];i.push(i[a],i[a+1]),Qc+=2}}else throw new Error("unknown command ".concat(fs));return{data:i,indices:n}}},{key:"_toBinaryCoordinates",value:function(e){var n=this.loadGeometry(),i;e(n.data,this);var a=2;switch(this.type){case 1:this._geometryInfo.pointFeaturesCount++,this._geometryInfo.pointPositionsCount+=n.indices.length,i=HU({type:"Point"},n);break;case 2:this._geometryInfo.lineFeaturesCount++,this._geometryInfo.linePathsCount+=n.indices.length,this._geometryInfo.linePositionsCount+=n.data.length/a,i=HU({type:"LineString"},n);break;case 3:i=jU(n),this._geometryInfo.polygonFeaturesCount++,this._geometryInfo.polygonObjectsCount+=i.indices.length;var o=Lce(i.indices),s;try{for(o.s();!(s=o.n()).done;){var u=s.value;this._geometryInfo.polygonRingsCount+=u.length}}catch(f){o.e(f)}finally{o.f()}this._geometryInfo.polygonPositionsCount+=i.data.length/a;break;default:throw new Error("Invalid geometry type: ".concat(this.type))}var l={type:"Feature",geometry:i,properties:this.properties};return this.id!==null&&(l.id=this.id),l}},{key:"toBinaryCoordinates",value:function(e){if(typeof e=="function")return this._toBinaryCoordinates(e);var n=e.x,i=e.y,a=e.z,o=this.extent*Math.pow(2,a),s=this.extent*n,u=this.extent*i;return this._toBinaryCoordinates(function(l){return UU(l,s,u,o)})}}]),t}();var XU=function(){function t(r,e){A(this,t),c(this,"version",void 0),c(this,"name",void 0),c(this,"extent",void 0),c(this,"length",void 0),c(this,"_pbf",void 0),c(this,"_keys",void 0),c(this,"_values",void 0),c(this,"_features",void 0),this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=r,this._keys=[],this._values=[],this._features=[],r.readFields(Bce,this,e),this.length=this._features.length}return T(t,[{key:"feature",value:function(e,n){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var i=this._pbf.readVarint()+this._pbf.pos;return new $U(this._pbf,i,this.extent,this._keys,this._values,n)}}]),t}();function Bce(t,r,e){r&&e&&(t===15?r.version=e.readVarint():t===1?r.name=e.readString():t===5?r.extent=e.readVarint():t===2?r._features.push(e.pos):t===3?r._keys.push(e.readString()):t===4&&r._values.push(Fce(e)))}function Fce(t){for(var r=null,e=t.readVarint()+t.pos;t.pos<e;){var n=t.readVarint()>>3;r=n===1?t.readString():n===2?t.readFloat():n===3?t.readDouble():n===4?t.readVarint64():n===5?t.readVarint():n===6?t.readSVarint():n===7?t.readBoolean():null}return r}var qU=function t(r,e){A(this,t),c(this,"layers",void 0),this.layers=r.readFields(Dce,{},e)};function Dce(t,r,e){if(t===3&&e){var n=new XU(e,e.readVarint()+e.pos);n.length&&r&&(r[n.name]=n)}}function ag(t,r){var e,n,i=jce(r),a=(r==null||(e=r.gis)===null||e===void 0?void 0:e.format)||(r==null||(n=r.mvt)===null||n===void 0?void 0:n.shape);switch(a){case"columnar-table":return{shape:"columnar-table",data:kS(t,i)};case"geojson-row-table":{var o={shape:"geojson-row-table",data:YU(t,i)};return o}case"geojson":return YU(t,i);case"binary-geometry":return kS(t,i);case"binary":return kS(t,i);default:throw new Error(a)}}function kS(t,r){var e=Nce(t,r),n=W(e,2),i=n[0],a=n[1],o=OS(i,a);return o.byteLength=t.byteLength,o}function Nce(t,r){var e=[],n={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[e,n];var i=new qU(new BS.default(t)),a=r&&Array.isArray(r.layers)?r.layers:Object.keys(i.layers);return a.forEach(function(o){var s=i.layers[o];if(s)for(var u=0;u<s.length;u++){var l=s.feature(u,n),f=Gce(l,r,o);e.push(f)}}),[e,n]}function YU(t,r){if(t.byteLength<=0)return[];var e=[],n=new NU(new BS.default(t)),i=Array.isArray(r.layers)?r.layers:Object.keys(n.layers);
4537return i.forEach(function(a){var o=n.layers[a];if(o)for(var s=0;s<o.length;s++){var u=o.feature(s),l=Uce(u,r,a);e.push(l)}}),e}function jce(t){var r;if(!(t!=null&&t.mvt))throw new Error("mvt options required");var e=((r=t.mvt)===null||r===void 0?void 0:r.coordinates)==="wgs84",n=t.mvt.tileIndex,i=n&&Number.isFinite(n.x)&&Number.isFinite(n.y)&&Number.isFinite(n.z);if(e&&!i)throw new Error("MVT Loader: WGS84 coordinates need tileIndex property");return t.mvt}function Uce(t,r,e){var n=t.toGeoJSON(r.coordinates==="wgs84"?r.tileIndex:zce);return r.layerProperty&&(n.properties[r.layerProperty]=e),n}function Gce(t,r,e){var n=t.toBinaryCoordinates(r.coordinates==="wgs84"?r.tileIndex:Vce);return r.layerProperty&&n.properties&&(n.properties[r.layerProperty]=e),n}function zce(t,r){for(var e=r.extent,n=0;n<t.length;n++){var i=t[n];i[0]/=e,i[1]/=e}}function Vce(t,r){for(var e=r.extent,n=0,i=t.length;n<i;++n)t[n]/=e}function KU(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function ZU(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?KU(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):KU(Object(e)).forEac
4537h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var Hce="3.4.13",Wce={mvt:{shape:"geojson",coordinates:"local",layerProperty:"layerName",layers:void 0,tileIndex:null}},og={name:"Mapbox Vector Tile",id:"mvt",module:"mvt",version:Hce,extensions:["mvt","pbf"],mimeTypes:["application/vnd.mapbox-vector-tile","application/x-protobuf"],worker:!0,category:"geometry",options:Wce},$ce=ZU(ZU({},og),{},{parse:function(){var t=Y(FS.default.mark(function e(n,i){return FS.default.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",ag(n,i));case 1:case"end":return o.stop()}},e)}));function r(e,n){return t.apply(this,arguments)}return r}(),parseSync:ag,binary:!0});k();be();function JU(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function QU(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?JU(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):JU(Object(e)).forEac
4537h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var Xce={Point:e6,MultiPoint:qce,LineString:t6,MultiLineString:Yce,Polygon:r6,MultiPolygon:Kce};function e6(t,r,e){var n=W(t,2),i=n[0],a=n[1],o=W(r,2),s=o[0],u=o[1],l=Gt(s[0],u[0],i),f=Gt(s[1],u[1],a);return e.unprojectFlat([l,f])}function DS(t,r,e){return t.map(function(n){return e6(n,r,e)})}function qce(t,r,e){return DS(t,r,e)}function t6(t,r,e){return DS(t,r,e)}function Yce(t,r,e){return t.map(function(n){return t6(n,r,e)})}function r6(t,r,e){return t.map(function(n){return DS(n,r,e)})}function Kce(t,r,e){return t.map(function(n){return r6(n,r,e)})}function n6(t,r,e){var n=e.projectFlat([r.west,r.north]),i=e.projectFlat([r.east,r.south]),a=[n,i];return QU(QU({},t),{},{coordinates:Xce[t.type](t.coordinates,a,e)})}function Zce(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=Jce(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
4538In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function Jce(t,r){if(t){if(typeof t=="string")return i6(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return i6(t,r)}}function i6(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var Qce=["points","lines","polygons"];function NS(t,r,e,n){var i=Zce(Qce),a;try{for(i.s();!(a=i.n()).done;){var o=a.value,s=t[o]&&epe(t[o],r,e,n);if(s>=0)return s}}catch(u){i.e(u)}finally{i.f()}return-1}function epe(t,r,e,n){var i=t.featureIds.value;if(!i.length)return-1;var a=0,o=i[i.length-1]+1;if(n){var s=tpe(t,n);if(s)a=s[0],o=s[1]+1;else return-1}var u=-1;if(r in t.numericProps){var l=t.numericProps[r].value.findIndex(function(f,p){return f===e&&i[p]>=a&&i[p]<o});return l>=0?t.globalFeatureIds.value[l]:-1}else r?u=a6(t.properties,function(f){return f[r]===e},a,o):t.fields&&(u=a6(t.fields,function(f){return f.id===e},a,o));return u>=0?rpe(t,u):-1}function tpe(t,r){if(!t.__layers){for(var e={},n=t.properties,i=0;i<n.length;i++){var a=n[i],o=a.layerName;o&&(e[o]?e[o][1]=i:e[o]=[i,i])}t.__layers=e}return t.__layers[r]}function rpe(t,r){if(!t.__ids){for(var e=[],n=t.featureIds.value,i=t.globalFeatureIds.value,a=0;a<n.length;a++)e[n[a]]=i[a];t.__ids=e}return t.__ids[r]}function a6(t,r,e,n){for(var i=e;i<n;i++)if(r(t[i],i))return i;return-1}function npe(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=ipe(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
4539In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function ipe(t,r){if(t){if(typeof t=="string")return o6(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return o6(t,r)}}function o6(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function ape(t){var r=ope();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function ope(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function s6(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function Va(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};
4539r%2?s6(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):s6(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var jS=512,spe=Va(Va({},Ri.defaultProps),{},{data:La,onDataLoad:{type:"function",value:null,optional:!0,compare:!1},uniqueIdProperty:"",highlightedFeatureId:null,loaders:[og],binary:!0}),sg=function(t){L(e,t);var r=ape(e);function e(){return A(this,e),r.apply(this,arguments)}return T(e,[{key:"initializeState",value:function(){Z(S(e.prototype),"initializeState",this).call(this);var i=this.context.viewport.resolution!==void 0?!1:this.props.binary;this.setState({binary:i,data:null,tileJSON:null})}},{key:"isLoaded",get:function(){return this.state&&this.state.data&&this.state.tileset&&Z(S(e.prototype),"isLoaded",this)}},{key:"updateState",value:function(i){var a,o=i.props,s=i.oldProps,u=i.context,l=i.changeFlags;l.dataChanged&&this._updateTileData(),(a=this.state)!==null&&a!==void 0&&a.data&&(Z(S(e.prototype),"updateState",this).call(this,{props:o,oldProps:s,context:u,changeFlags:l}),this._setWGS84PropertyForTiles());var f=o.highlightColor;f!==s.highlightColor&&Array.isArray(f)&&this.setState({highlightColor:f})}},{key:"_updateTileData",value:function(){var n=Y(GS.default.mark(function a(){var o,s,u,l,f;return GS.default.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(o=this.props.data,s=null,!(typeof o=="string"&&!C1(o))){h.next=18;break}return u=this.props,l=u.onDataLoad,f=u.fetch,this.setState({data:null,tileJSON:null}),h.prev=5,h.next=8,f(o,{propName:"data",layer:this,loaders:[]});case 8:s=h.sent,h.next=15;break;case 11:h.prev=11,h.t0=h.catch(5),this.raiseError(h.t0,"loading TileJSON"),o=null;case 15:l&&l(s,{propName:"data",layer:this}),h.next=19;break;case 18:o.tilejson&&(s=o);case 19:s&&(o=s.tiles),this.setState({data:o,tileJSON:s});case 21:case"end":return h.stop()}},a,this,[[5,11]])}));function i(){return n.apply(this,arguments)}return i}()},{key:"_getTilesetOptions",value:function(){var i=Z(S(e.prototype),"_getTilesetOptions",this).call(this),a=this.state.tileJSON,o=this.props,s=o.minZ
4539oom,u=o.maxZoom;return a&&(Number.isFinite(a.minzoom)&&a.minzoom>s&&(i.minZoom=a.minzoom),Number.isFinite(a.maxzoom)&&(!Number.isFinite(u)||a.maxzoom<u)&&(i.maxZoom=a.maxzoom)),i}},{key:"renderLayers",value:function(){var i;return(i=this.state)!==null&&i!==void 0&&i.data?Z(S(e.prototype),"renderLayers",this).call(this):null}},{key:"getTileData",value:function(i){var a,o=this.state,s=o.data,u=o.binary,l=i.index,f=i.signal,p=ni(s,i);if(!p)return Promise.reject("Invalid URL");var h=this.getLoadOptions(),d=this.props.fetch;return h=Va(Va({},h),{},{mimeType:"application/x-protobuf",mvt:Va(Va({},(a=h)===null||a===void 0?void 0:a.mvt),{},{coordinates:this.context.viewport.resolution?"wgs84":"local",tileIndex:l}),gis:u?{format:"binary"}:{}}),d(p,{propName:"data",layer:this,loadOptions:h,signal:f})}},{key:"renderSubLayers",value:function(i){var a=i.tile.index,o=a.x,s=a.y,u=a.z,l=Math.pow(2,u),f=jS/l,p=-f,h=jS*o/l,d=jS*(1-s/l),v=new ye().scale([f,p,1]);i.autoHighlight=!1,this.context.viewport.resolution||(i.modelMatrix=v,i.coordinateOrigin=[h,d,0],i.coordinateSystem=de.CARTESIAN,i.extensions=[].concat(ae(i.extensions||[]),[new al]));var m=Z(S(e.prototype),"renderSubLayers",this).call(this,i);return this.state.binary&&!(m instanceof Ri)&&ne.warn("renderSubLayers() must return GeoJsonLayer when using binary:true")(),m}},{key:"_updateAutoHighlight",value:function(i){var a=this.props.uniqueIdProperty,o=this.state,s=o.hoveredFeatureId,u=o.hoveredFeatureLayerName,l=i.object,f,p;l&&(f=US(l,a),p=u6(l));var h=this.props.highlightColor;typeof h=="function"&&(h=h(i)),(s!==f||u!==p)&&this.setState({highlightColor:h,hoveredFeatureId:f,hoveredFeatureLayerName:p})}},{key:"getPickingInfo",value:function(i){var a=Z(S(e.prototype),"getPickingInfo",this).call(this,i),o=Boolean(this.context.viewport.resolution);if(this.state.binary&&a.index!==-1){var s=i.sourceLayer.props.data;a.object=tg(s,{globalFeatureId:a.index})}return a.object&&!o&&(a.object=f6(a.object,a.tile.bbox,this.context.viewport)),a}},{key:"getSubLayerPropsByTile",value:function(i){return{highlightedObjectIndex:this.getHighlightedObjectIndex(i),highlightColor:this.state.highlightColor}}},{key:"getHighlightedObjectIndex",value:function(i){var a=this.state,o=a.hoveredFeatureId,s=a.hoveredFeatureLayerName,u=a.binary,l=this.props,f=l.uniqueIdProperty,p=l.highlightedFeatureId,h=i.content,d=l6(p),v=l6(o)||d;if(!v)return-1;var m=d?p:o;return Array.isArray(h)?h.findIndex(function(g){var y=US(g,f)===m,_=d||u6(g)===s;return y&&_}):h&&u?NS(h,f,m,d?"":s):-1}},{key:"_pickObjects",value:function(i){var a=this.context,o=a.deck,s=a.viewport,u=s.width,l=s.height,f=s.x,p=s.y,h=[this.id];return o.pickObjects({x:f,y:p,width:u,height:l,layerIds:h,maxObjects:i})}},{key:"getRenderedFeatures",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,a=this._pickObjects(i),o=new Set,s=[],u=npe(a),l;try{for(u.s();!(l=u.n()).done;){var f=l.value,p=US(f.object,this.props.uniqueIdProperty);p===void 0?s.push(f.object):o.has(p)||(o.add(p),s.push(f.object))}}catch(h){u.e(h)}finally{u.f()}return s}},{key:"_setWGS84PropertyForTiles",value:function(){var i=this,a="dataInWGS84",o=this.state.tileset;o.selectedTiles.forEach(function(s){s.hasOwnProperty(a)||Object.defineProperty(s,a,{get:function(){if(!s.content)return null;if(i.state.binary&&Array.isArray(s.content)&&!s.content.length)return[];var l=s.bbox;if(s._contentWGS84===void 0&&M1(l)){var f=i.state.binary?tg(s.content):s.content;s._contentWGS84=f.map(function(p){return f6(p,l,i.context.viewport)})}return s._contentWGS84}})})}}]),e}(Ni);c(sg,"layerName","MVTLayer");c(sg,"defaultProps",spe);function US(t,r){if(t.properties&&r)return t.properties[r];if("id"in t)return t.id}function u6(t){var r;return((r=t.properties)===null||r===void 0?void 0:r.layerName)||null}function l6(t){return t!=null&&t!==""}function f6(t,r,e){var n=Va(Va({},t),{},{geometry:{type:t.geometry.type}});return Object.defineProperty(n.geometry,"coordinates",{get:function(){var a=n6(t.geometry,r,e);return a.coordinates}}),n}F();j();k();be();var c6="0123456789bcdefghjkmnpqrstuvwxyz",p6={};for(ep=0;ep<c6.length;ep++)p6[c6.charAt(ep)]=ep;var ep,upe=-90,lpe=90,fpe=-180,cpe=180;function ppe(t){for(var r=!0,e=lpe,n=upe,i=cpe,a=fpe,o,s=0,u=0,l=t.length;u<l;u++){var f=t[u].toLowerCase();s=p6[f];for(var p=4;p>=0;p--){var h=s>>p&1;r?(o=(i+a)/2,h===1?a=o:i=o):(o=(e+n)/2,h===1?n=o:e=o),r=!r}}return[n,a,e,i]}function h6(t){var r=ppe(t),e=W(r,4),n=e[0],i=e[1],a=e[2],o=e[3];return[o,a,o,n,i,n,i,a,o,a]}function hpe(t){var r=dpe();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function dpe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var vpe={getGeohash:{type:"accessor",value:function(r){return r.geohash}}},ug=function(t){L(e,t);var r=hpe(e);function e(){return A(this,e),r.apply(this,arguments)}return T(e,[{key:"indexToBounds",value:function(){var i=this.props,a=i.data,o=i.getGeohash;return{data:a,_normalize:!1,positionFormat:"XY",getPolygon:function(u,l){return h6(o(u,l))}}}}]),e}(rn);c(ug,"layerName","GeohashLayer");c(ug,"defaultProps",vpe);var zS={};Lr(zS,{Buffer:()=>Pe,ConeGeometry:()=>Lh,CubeGeometry:()=>va,CylinderGeometry:()=>Bh,FEATURES:()=>Ee,Framebuffer:()=>Le,Geometry:()=>Re,IcoSphereGeometry:()=>Dh,Model:()=>Ie,PlaneGeometry:()=>jh,Program:()=>la,ProgramManager:()=>Yr,Renderbuffer:()=>dr,SphereGeometry:()=>Gh,Texture2D:()=>Ce,Texture3D:()=>Ds,TextureCube:()=>ho,Timeline:()=>ma,Transform:()=>mr,TransformFeedback:()=>fa,TruncatedConeGeometry:()=>da,cloneTextureFrom:()=>js,copyToTexture:()=>Ns,cssToDeviceRatio:()=>Jt,getParameters:()=>Un,hasFeatures:()=>qt,instrumentGLContext:()=>gi,isWebGL2:()=>ge,readPixelsToBuffer:()=>yi,setParameters:()=>It,withParameters:()=>ke});var VS={};Lr(VS,{fetchFile:()=>Ts,load:()=>Bt,parse:()=>so,registerLoaders:()=>tf});F();j();k();F();j();k();var ut=me(x6());var v0t=typeof window<"u"?window:global;var cs=typeof document<"u"?document:{};function ype(){}function _pe(t){t&&console.error(t.error)}var S6={container:ut.default.object,gl:ut.default.object,mapboxApiAccessToken:ut.default.string,mapboxApiUrl:ut.default.string,attributionControl:ut.default.bool,preserveDrawingBuffer:ut.default.bool,reuseMaps:ut.default.bool,transformRequest:ut.default.func,mapOptions:ut.default.object,mapStyle:ut.default.oneOfType([ut.default.string,ut.default.object]),visible:ut.default.bool,asyncRender:ut.default.bool,onLoad:ut.default.func,onError:ut.default.func,width:ut.default.number,height:ut.default.number,viewState:ut.default.object,longitude:ut.default.number,latitude:ut.default.number,zoom:ut.default.number,bearing:ut.default.number,pitch:ut.default.number,altitude:ut.default.number},lg={container:cs.body,mapboxApiAccessToken:bpe(),mapboxApiUrl:"https://api.mapbox.com",preserveDrawingBuffer:!1,attributionControl:!0,reuseMaps:!1,mapOptions:{},mapStyle:"mapbox://styles/mapbox/light-v8",visible:!0,asyncRender:!1,onLoad:ype,onError:_pe,width:0,height:0,longitude:0,latitude:0,zoom:0,bearing:0,pitch:0,altitude:1.5};function bpe(){var t=null;if(typeof window<"u"&&window.location){var r=window.location.search.match(/access_token=([^&\/]*)/);t=r&&r[1]}return!t&&typeof process<"u"&&(t=t||process.env.MapboxAccessToken||process.env.REACT_APP_MAPBOX_ACCESS_TOKEN),t||"no-token"}function A6(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"component";t.debug&&ut.default.checkPropTypes(S6,t,"prop",r)}var pl=function(){function t(r){var e=this;if(A(this,t),c(this,"mapboxgl",void 0),c(this,"props",lg),c(this,"_map",null),c(this,"width",0),c(this,"height",0),c(this,"_fireLoadEvent",function(){e.props.onLoad({type:"load",target:e._map})}),!r.mapboxgl)throw new Error("Mapbox not available");this.mapboxgl=r.mapboxgl,t.initialized||(t.initialized=!0,this._checkStyleSheet(this.mapboxgl.version)),this._initialize(r)}return T(t,[{key:"finalize",value:function(){return this._destroy(),this}},{key:"setProps",value:function(e){return this._update(this.props,e),this}},{key:"resize",value:function(){return this._map.resize(),this}},{key:"redraw",value:function(){var e=this._map;e.style&&(e._frame&&(e._frame.cancel(),e._frame=null),e._render())}},{key:"getMap",value:function(){return this._map}},{key:"_reuse",value:function(e){this._map=t.savedMap;var n=this._map.getContainer(),i=e.container;for(i.classList.add("mapboxgl-map");n.childNodes.length>0;)i.appendChild(n.childNodes[0]);this._map._container=i,t.savedMap=null,e.mapStyle&&this._map.setStyle(e.mapStyle,{diff:!1}),this._map.isStyleLoaded()?this._fireLoadEvent():this._map.once("styledata",this._fireLoadEvent)}},{key:"_create",value:function(e){if(e.reuseMaps&&t.savedMap)this._reuse(e);else{if(e.gl){var n=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=function(){return HTMLCanvasElement.prototype.getContext=n,e.gl}}var i={container:e.container,center:[0,0],zoom:8,pitch:0,bearing:0,maxZoom:24,style:e.mapStyle,interactive:!1,trackResize:!1,attributionControl:e.attributionControl,preserveDrawingBuffer:e.preserveDrawingBuffer};e.transformRequest&&(i.transformRequest=e.transformRequest),this._map=new this.mapboxgl.Map(Object.assign({},i,e.mapOptions)),this._map.once("load",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(e){var n=this;e=Object.assign({},lg,e),A6(e,"Mapbox"),this.mapboxgl.accessToken=e.mapboxApiAccessToken||lg.mapboxApiAccessToken,this.mapboxgl.baseApiUrl=e.mapboxApiUrl,this._create(e);var i=e,a=i.container;Object.defineProperty(a,"offsetWidth",{get:function(){return n.width}}),Object.defineProperty(a,"clientWidth",{get:function(){return n.width}}),Object.defineProperty(a,"offsetHeight",{get:function(){return n.height}}),Object.defineProperty(a,"clientHeight",{get:function(){return n.height}});var o=this._map.getCanvas();o&&(o.style.outline="none"),this._updateMapViewport({},e),this._updateMapSize({},e),this.props=e}},{key:"_update",value:function(e,n){if(this._map){n=Object.assign({},this.props,n),A6(n,"Mapbox");var i=this._updateMapViewport(e,n),a=this._updateMapSize(e,n);!n.asyncRender&&(i||a)&&this.redraw(),this.props=n}}},{key:"_updateMapSize",value:function(e,n){var i=e.width!==n.width||e.height!==n.height;return i&&(this.width=n.width,this.height=n.height,this.resize()),i}},{key:"_updateMapViewport",value:function(e,n){var i=this._getViewState(e),a=this._getViewState(n),o=a.latitude!==i.latitude||a.longitude!==i.longitude||a.zoom!==i.zoom||a.pitch!==i.pitch||a.bearing!==i.bearing||a.altitude!==i.altitude;return o&&(this._map.jumpTo(this._viewStateToMapboxProps(a)),a.altitude!==i.altitude&&(this._map.transform.altitude=a.altitude)),o}},{key:"_getViewState",value:function(e){var n=e.viewState||e,i=n.longitude,a=n.latitude,o=n.zoom,s=n.pitch,u=s===void 0?0:s,l=n.bearing,f=l===void 0?0:l,p=n.altitude,h=p===void 0?1.5:p;return{longitude:i,latitude:a,zoom:o,pitch:u,bearing:f,altitude:h}}},{key:"_checkStyleSheet",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"0.47.0";if(!(typeof cs>"u"))try{var n=cs.createElement("div");n.className="mapboxgl-map",n.style.display="none",cs.body.append(n);var i=window.getComputedStyle(n).position!=="static";if(!i){var a=cs.createElement("link");a.setAttribute("rel","stylesheet"),a.setAttribute("type","text/css"),a.setAttribute("href","https://api.tiles.mapbox.com/mapbox-gl-js/v".concat(e,"/mapbox-gl.css")),cs.head.append(a)}}catch{}}},{key:"_viewStateToMapboxProps",value:function(e){return{center:[e.longitude,e.latitude],zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}}}]),t}();c(pl,"initialized",!1);c(pl,"propTypes",S6);c(pl,"defaultProps",lg);c(pl,"savedMap",null);function T6(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function HS(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};
4539r%2?T6(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):T6(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function xpe(t){var r=Ape();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function Ape(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var w6={position:"absolute",left:0,top:0,width:"100%",height:"100%"};function Spe(t){var r=t.container,e=r===void 0?document.body:r;if(typeof e=="string"&&(e=document.getElementById(e)),!e)throw Error("Deck: container not found");var n=window.getComputedStyle(e);n.position==="static"&&(e.style.position="relative");var i=document.createElement("div");e.appendChild(i),Object.assign(i.style,w6);var a=document.createElement("canvas");return e.appendChild(a),Object.assign(a.style,w6),{container:e,mapCanvas:i,deckCanvas:a}}var P6=function(t){L(e,t);var r=xpe(e);function e(n){var i;if(A(this,e),typeof document>"u")throw Error("Deck can only be used in the browser");var a=Spe(n),o=a.mapCanvas,s=a.deckCanvas,u=n.viewState||n.initialViewState,l=Number.isFinite(u&&u.latitude),f=n.map,p=f===void 0?globalThis.mapboxgl||globalThis.maplibregl:f;return i=r.call(this,HS({canvas:s},n)),c(q(i),"_map",void 0),p&&p.Map?i._map=l&&new pl(HS(HS({},n),{},{viewState:u,container:o,mapboxgl:p})):i._map=p,i}return T(e,[{key:"getMapboxMap",value:function(){return this._map&&this._map.getMap()}},{key:"finalize",value:function(){this._map&&this._map.finalize(),Z(S(e.prototype),"finalize",this).call(this)}},{key:"setProps",value:function(i){"mapStyle"in i&&this._map&&this._map._map.setStyle(i.mapStyle),Z(S(e.prototype),"setProps",this).call(this,i)}},{key:"_drawLayers",value:function(i,a){if(this._map){var o=this.getViewports()[0];o&&this._map.setProps({width:o.width,height:o.height,viewState:o})}Z(S(e.prototype),"_drawLayers",this).call(this,i,a)}}]),e}(Nr);globalThis.luma=globalThis.luma||{};globalThis.loaders=globalThis.loaders||{};Object.assign(globalThis.luma,zS);Object.assign(globalThis.loaders,VS);F();j();k();k();F();j();k();var lt={SUM:1,MEAN:2,MIN:3,MAX:4};function O6(t,r){return t+r}function Tpe(t,r){return r>t?r:t}function wpe(t,r){return r<t?r:t}function Ppe(t,r){if(Number.isFinite(r))return t.length?r:null;var e=t.map(r).filter(Number.isFinite);return e.length?e.reduce(O6,0)/e.length:null}function Ope(t,r){if(Number.isFinite(r))return t.length?t.length*r:null;var e=t.map(r).filter(Number.isFinite);return e.length?e.reduce(O6,0):null}function Epe(t,r){if(Number.isFinite(r))return t.length?r:null;var e=t.map(r).filter(Number.isFinite);return e.length?e.reduce(Tpe,-1/0):null}function Cpe(t,r){if(Number.isFinite(r))return t.length?r:null;var e=t.map(r).filter(Number.isFinite);return e.length?e.reduce(wpe,1/0):null}function hl(t,r,e){var n=lt[t]||lt.SUM;switch(r=Mpe(r,e),n){case lt.MIN:return function(i){return Cpe(i,r)};case lt.SUM:return function(i){return Ope(i,r)};case lt.MEAN:return function(i){return Ppe(i,r)};case lt.MAX:return function(i){return Epe(i,r)};default:return null}}function Mpe(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Number.isFinite(t)?t:function(e){return r.index=e.index,t(e.source,r)}}function E6(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function(e){return r.indices=e.map(function(n){return n.index}),t(e.map(function(n){return n.source}),r)}}var dl,fg,C6={projectPoints:!1,viewport:null,createBufferObjects:!0,moduleSettings:{}},Ha=3402823466e29,WS=[32775,32774],$S=[32776,32774],M6=[32776,32775],XS=(dl={},c(dl,lt.SUM,32774),c(dl,lt.MEAN,32774),c(dl,lt.MIN,WS),c(dl,lt.MAX,$S),dl);var I6={size:1,operation:lt.SUM,needMin:!1,needMax:!1,combineMaxMin:!1},R6=4;var U0t={format:34836,type:5126,border:0,mipmaps:!1,parameters:(fg={},c(fg,10240,9728),c(fg,10241,9728),fg),dataFormat:6408,width:1,height:1};var L6=`#define SHADER_NAME gpu-aggregation-to-grid-vs
4540
4541attribute vec3 positions;
4542attribute vec3 positions64Low;
4543attribute vec3 weights;
4544uniform vec2 cellSize;
4545uniform vec2 gridSize;
4546uniform bool projectPoints;
4547uniform vec2 translation;
4548uniform vec3 scaling;
4549
4550varying vec3 vWeights;
4551
4552vec2 project_to_pixel(vec4 pos) {
4553  vec4 result;
4554  pos.xy = pos.xy/pos.w;
4555  result = pos + vec4(translation, 0., 0.);
4556  result.xy = scaling.z > 0. ? result.xy * scaling.xy : result.xy;
4557  return result.xy;
4558}
4559
4560void main(void) {
4561
4562  vWeights = weights;
4563
4564  vec4 windowPos = vec4(positions, 1.);
4565  if (projectPoints) {
4566    windowPos = project_position_to_clipspace(positions, positions64Low, vec3(0));
4567  }
4568
4569  vec2 pos = project_to_pixel(windowPos);
4570
4571  vec2 pixelXY64[2];
4572  pixelXY64[0] = vec2(pos.x, 0.);
4573  pixelXY64[1] = vec2(pos.y, 0.);
4574  vec2 gridXY64[2];
4575  gridXY64[0] = div_fp64(pixelXY64[0], vec2(cellSize.x, 0));
4576  gridXY64[1] = div_fp64(pixelXY64[1], vec2(cellSize.y, 0));
4577  float x = floor(gridXY64[0].x);
4578  float y = floor(gridXY64[1].x);
4579  pos = vec2(x, y);
4580  pos = (pos * (2., 2.) / (gridSize)) - (1., 1.);
4581  vec2 offset = 1.0 / gridSize;
4582  pos = pos + offset;
4583
4584  gl_Position = vec4(pos, 0.0, 1.0);
4585  gl_PointSize = 1.0;
4586}
4587`;var k6=`#define SHADER_NAME gpu-aggregation-to-grid-fs
4588
4589precision highp float;
4590
4591varying vec3 vWeights;
4592
4593void main(void) {
4594  gl_FragColor = vec4(vWeights, 1.0);
4595  DECKGL_FILTER_COLOR(gl_FragColor, geometry);
4596}
4597`;var B6=`#version 300 es
4598#define SHADER_NAME gpu-aggregation-all-vs-64
4599
4600in vec2 position;
4601uniform ivec2 gridSize;
4602out vec2 vTextureCoord;
4603
4604void main(void) {
4605  vec2 pos = vec2(-1.0, -1.0);
4606  vec2 offset = 1.0 / vec2(gridSize);
4607  pos = pos + offset;
4608
4609  gl_Position = vec4(pos, 0.0, 1.0);
4610
4611  int yIndex = gl_InstanceID / gridSize[0];
4612  int xIndex = gl_InstanceID - (yIndex * gridSize[0]);
4613
4614  vec2 yIndexFP64 = vec2(float(yIndex), 0.);
4615  vec2 xIndexFP64 = vec2(float(xIndex), 0.);
4616  vec2 gridSizeYFP64 = vec2(gridSize[1], 0.);
4617  vec2 gridSizeXFP64 = vec2(gridSize[0], 0.);
4618
4619  vec2 texCoordXFP64 = div_fp64(yIndexFP64, gridSizeYFP64);
4620  vec2 texCoordYFP64 = div_fp64(xIndexFP64, gridSizeXFP64);
4621
4622  vTextureCoord = vec2(texCoordYFP64.x, texCoordXFP64.x);
4623  gl_PointSize = 1.0;
4624}
4625`;var F6=`#version 300 es
4626#define SHADER_NAME gpu-aggregation-all-fs
4627
4628precision highp float;
4629
4630in vec2 vTextureCoord;
4631uniform sampler2D uSampler;
4632uniform bool combineMaxMin;
4633out vec4 fragColor;
4634void main(void) {
4635  vec4 textureColor = texture(uSampler, vec2(vTextureCoord.s, vTextureCoord.t));
4636  if (textureColor.a == 0.) {
4637    discard;
4638  }
4639  fragColor.rgb = textureColor.rgb;
4640  fragColor.a = combineMaxMin ? textureColor.r : textureColor.a;
4641}
4642`;var D6=`#define SHADER_NAME gpu-aggregation-transform-mean-vs
4643attribute vec4 aggregationValues;
4644varying vec4 meanValues;
4645
4646void main()
4647{
4648  bool isCellValid = bool(aggregationValues.w > 0.);
4649  meanValues.xyz = isCellValid ? aggregationValues.xyz/aggregationValues.w : vec3(0, 0, 0);
4650  meanValues.w = aggregationValues.w;
4651  gl_PointSize = 1.0;
4652}
4653`;k();var cg,Ipe=(cg={},c(cg,10240,9728),c(cg,10241,9728),cg);function vl(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=r.width,n=e===void 0?1:e,i=r.height,a=i===void 0?1:i,o=r.data,s=o===void 0?null:o,u=r.unpackFlipY,l=u===void 0?!0:u,f=r.parameters,p=f===void 0?I
4653pe:f,h=new Ce(t,{data:s,format:ge(t)?34836:6408,type:5126,border:0,mipmaps:!1,parameters:p,dataFormat:6408,width:n,height:a,unpackFlipY:l});return h}function tp(t,r){var e=r.id,n=r.width,i=n===void 0?1:n,a=r.height,o=a===void 0?1:a,s=r.texture,u=new Le(t,{id:e,width:i,height:o,attachments:c({},36064,s)});return u}function Rpe(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=Lpe(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
4654In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function Lpe(t,r){if(t){if(typeof t=="string")return N6(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return N6(t,r)}}function N6(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function j6(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function ur(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?j6(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):j6(Object(e)).forEac
4654h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var kpe=["aggregationBuffer","maxMinBuffer","minBuffer","maxBuffer"],U6={maxData:"maxBuffer",minData:"minBuffer",maxMinData:"maxMinBuffer"},Bpe=[Ee.WEBGL2,Ee.COLOR_ATTACHMENT_RGBA32F,Ee.BLEND_EQUATION_MINMAX,Ee.FLOAT_BLEND,Ee.TEXTURE_FLOAT],lr=function(){function t(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};A(this,t),this.id=e.id||"gpu-grid-aggregator",this.gl=r,this.state={weightAttributes:{},textures:{},meanTextures:{},buffers:{},framebuffers:{},maxMinFramebuffers:{},minFramebuffers:{},maxFramebuffers:{},equations:{},resources:{},results:{}},this._hasGPUSupport=ge(r)&&qt(this.gl,Ee.BLEND_EQUATION_MINMAX,Ee.COLOR_ATTACHMENT_RGBA32F,Ee.TEXTURE_FLOAT),this._hasGPUSupport&&this._setupModels()}return T(t,[{key:"delete",value:function(){var e=this.gridAggregationModel,n=this.allAggregationModel,i=this.meanTransform,a=this.state,o=a.textures,s=a.framebuffers,u=a.maxMinFramebuffers,l=a.minFramebuffers,f=a.maxFramebuffers,p=a.meanTextures,h=a.resources;e?.delete(),n?.delete(),i?.delete(),Dpe([s,o,u,l,f,p,h])}},{key:"run",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.setState({results:{}});var n=this._normalizeAggregationParams(e);return this._hasGPUSupport||ne.log(1,"GPUGridAggregator: not supported")(),this._runAggregation(n)}},{key:"getData",value:function(e){var n={},i=this.state.results;i[e].aggregationData||(i[e].aggregationData=i[e].aggregationBuffer.getData()),n.aggregationData=i[e].aggregationData;for(var a in U6){var o=U6[a];(i[e][a]||i[e][o])&&(i[e][a]=i[e][a]||i[e][o].getData(),n[a]=i[e][a])}return n}},{key:"updateShaders",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.setState({shaderOptions:e,modelDirty:!0})}},{key:"_normalizeAggregationParams",value:function(e){var n=ur(ur({},C6),e),i=n.weights;return i&&(n.weights=Fpe(i)),n}},{key:"setState",value:function(e){Object.assign(this.state,e)}},{key:"_getAggregateData",value:function(e){var n={},i=this.state,a=i.textures,o=i.framebuffers,s=i.maxMinFramebuffers,u=i.minFramebuffers,l=i.maxFramebuffers,f=i.resources,p=e.weights;for(var h in p){n[h]={};var d=p[h],v=d.needMin,m=d.needMax,g=d.combineMaxMin;n[h].aggregationTexture=a[h],n[h].aggregationBuffer=yi(o[h],{target:p[h].aggregationBuffer,sourceType:5126}),v&&m&&g?(n[h].maxMinBuffer=yi(s[h],{target:p[h].maxMinBuffer,sourceType:5126}),n[h].maxMinTexture=f["".concat(h,"-maxMinTexture")]):(v&&(n[h].minBuffer=yi(u[h],{target:p[h].minBuffer,sourceType:5126}),n[h].minTexture=f["".concat(h,"-minTexture")]),m&&(n[h].maxBuffer=yi(l[h],{target:p[h].maxBuffer,sourceType:5126}),n[h].maxTexture=f["".concat(h,"-maxTexture")]))}return this._trackGPUResultBuffers(n,p),n}},{key:"_renderAggregateData",value:function(e){var n=e.cellSize,i=e.projectPoints,a=e.attributes,o=e.moduleSettings,s=e.numCol,u=e.numRow,l=e.weights,f=e.translation,p=e.scaling,h=this.state,d=h.maxMinFramebuffers,v=h.minFramebuffers,m=h.maxFramebuffers,g=[s,u],y={blend:!0,depthTest:!1,blendFunc:[1,1]},_={cellSize:n,gridSize:g,projectPoints:i,translation:f,scaling:p};for(var b in l){var x=l[b],w=x.needMin,P=x.needMax,E=w&&P&&l[b].combineMaxMin;this._renderToWeightsTexture({id:b,parameters:y,moduleSettings:o,uniforms:_,gridSize:g,attributes:a,weights:l}),E?this._renderToMaxMinTexture({id:b,parameters:ur(ur({},y),{},{blendEquation:M6}),gridSize:g,minOrMaxFb:d[b],clearParams:{clearColor:[0,0,0,Ha]},combineMaxMin:E}):(w&&this._renderToMaxMinTexture({id:b,parameters:ur(ur({},y),{},{blendEquation:WS}),gridSize:g,minOrMaxFb:v[b],clearParams:{clearColor:[Ha,Ha,Ha,0]},combineMaxMin:E}),P&&this._renderToMaxMinTexture({id:b,parameters:ur(ur({},y),{},{blendEquation:$S}),gridSize:g,minOrMaxFb:m[b],clearParams:{clearColor:[0,0,0,0]},combineMaxMin:E}))}}},{key:"_renderToMaxMinTexture",value:function(e){var n=e.id,i=e.parameters,a=e.gridSize,o=e.minOrMaxFb,s=e.combineMaxMin,u=e.clearParams,l=u===void 0?{}:u,f=this.state.framebuffers,p=this.gl,h=this.allAggregationModel;ke(p,ur(ur({},l),{},{framebuffer:o,viewport:[0,0,a[0],a[1]]}),function(){p.clear(16384),h.draw({parameters:i,uniforms:{uSampler:f[n].texture,gridSize:a,combineMaxMin:s}})})}},{key:"_renderToWeightsTexture",value:function(e){var n=e.id,i=e.parameters,a=e.moduleSettings,o=e.uniforms,s=e.gridSize,u=e.weights,l=this.state,f=l.framebuffers,p=l.equations,h=l.weightAttributes,d=this.gl,v=this.gridAggregationModel,m=u[n].operation,g=m===lt.MIN?[Ha,Ha,Ha,0]:[0,0,0,0];if(ke(d,{framebuffer:f[n],viewport:[0,0,s[0],s[1]],clearColor:g},function(){d.clear(16384);var w={weights:h[n]};v.draw({parameters:ur(ur({},i),{},{blendEquation:p[n]}),moduleSettings:a,uniforms:o,attributes:w})}),m===lt.MEAN){var y=this.state,_=y.meanTextures,b=y.textures,x={_sourceTextures:{aggregationValues:_[n]},_targetTexture:b[n],elementCount:b[n].width*b[n].height};this.meanTransform?this.meanTransform.update(x):this.meanTransform=Upe(d,x),this.meanTransform.run({parameters:{blend:!1,depthTest:!1}}),f[n].attach(c({},36064,b[n]))}}},{key:"_runAggregation",value:function(e){this._updateModels(e),this._setupFramebuffers(e),this._renderAggregateData(e);var n=this._getAggregateData(e);return this.setState({results:n}),n}},{key:"_setupFramebuffers",value:function(e){var n=this.state,i=n.textures,a=n.framebuffers,o=n.maxMinFramebuffers,s=n.minFramebuffers,u=n.maxFramebuffers,l=n.meanTextures,f=n.equations,p=e.weights,h=e.numCol,d=e.numRow,v={width:h,height:d};for(var m in p){var g=p[m],y=g.needMin,_=g.needMax,b=g.combineMaxMin,x=g.operation;i[m]=p[m].aggregationTexture||i[m]||vl(this.gl,{id:"".concat(m,"-texture"),width:h,height:d}),i[m].resize(v);var w=i[m];x===lt.MEAN&&(l[m]=l[m]||vl(this.gl,{id:"".concat(m,"-mean-texture"),width:h,height:d}),l[m].resize(v),w=l[m]),a[m]?a[m].attach(c({},36064,w)):a[m]=tp(this.gl,{id:"".concat(m,"-fb"),width:h,height:d,texture:w}),a[m].resize(v),f[m]=XS[x]||XS.SUM,(y||_)&&(y&&_&&b?o[m]||(w=p[m].maxMinTexture||this._getMinMaxTexture("".concat(m,"-maxMinTexture")),o[m]=tp(this.gl,{id:"".concat(m,"-maxMinFb"),texture:w})):(y&&(s[m]||(w=p[m].minTexture||this._getMinMaxTexture("".concat(m,"-minTexture")),s[m]=tp(this.gl,{id:"".concat(m,"-minFb"),texture:w}))),_&&(u[m]||(w=p[m].maxTexture||this._getMinMaxTexture("".concat(m,"-maxTexture")),u[m]=tp(this.gl,{id:"".concat(m,"-maxFb"),texture:w})))))}}},{key:"_getMinMaxTexture",value:function(e){var n=this.state.resources;return n[e]||(n[e]=vl(this.gl,{id:"resourceName"})),n[e]}},{key:"_setupModels",value:function(){var e,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=n.numCol,a=i===void 0?0:i,o=n.numRow,s=o===void 0?0:o,u=this.gl,l=this.state.shaderOptions;
4654if((e=this.gridAggregationModel)===null||e===void 0||e.delete(),this.gridAggregationModel=Npe(u,l),!this.allAggregationModel){var f=a*s;this.allAggregationModel=jpe(u,f)}}},{key:"_setupWeightAttributes",value:function(e){var n=this.state.weightAttributes,i=e.weights;for(var a in i)n[a]=e.attributes[a]}},{key:"_trackGPUResultBuffers",value:function(e,n){var i=this.state.resources;for(var a in e)if(e[a]){var o=Rpe(kpe),s;try{for(o.s();!(s=o.n()).done;){var u=s.value;if(e[a][u]&&n[a][u]!==e[a][u]){var l="gpu-result-".concat(a,"-").concat(u);i[l]&&i[l].delete(),i[l]=e[a][u]}}}catch(f){o.e(f)}finally{o.f()}}}},{key:"_updateModels",value:function(e){var n=e.vertexCount,i=e.attributes,a=e.numCol,o=e.numRow,s=this.state.modelDirty;s&&(this._setupModels(e),this.setState({modelDirty:!1})),this._setupWeightAttributes(e),this.gridAggregationModel.setVertexCount(n),this.gridAggregationModel.setAttributes(i),this.allAggregationModel.setInstanceCount(a*o)}}],[{key:"getAggregationData",value:function(e){var n=e.aggregationData,i=e.maxData,a=e.minData,o=e.maxMinData,s=e.pixelIndex,u=s*R6,l={};return n&&(l.cellCount=n[u+3],l.cellWeight=n[u]),o?(l.maxCellWieght=o[0],l.minCellWeight=o[3]):(i&&(l.maxCellWieght=i[0],l.totalCount=i[3]),a&&(l.minCellWeight=a[0],l.totalCount=i[3])),l}},{key:"getCellData",value:function(e){for(var n=e.countsData,i=e.size,a=i===void 0?1:i,o=n.length/4,s=new Float32Array(o*a),u=new Uint32Array(o),l=0;l<o;l++){for(var f=0;f<a;f++)s[l*a+f]=n[l*4+f];u[l]=n[l*4+3]}return{cellCounts:u,cellWeights:s}}},{key:"isSupported",value:function(e){return qt(e,Bpe)}}]),t}();function Fpe(t){var r={};for(var e in t)r[e]=ur(ur({},I6),t[e]);return r}function Dpe(t){t=Array.isArray(t)?t:[t],t.forEach(function(r){for(var e in r)r[e].delete()})}function Npe(t,r){var e=Ci({vs:L6,fs:k6,modules:[yo,qe]},r);return new Ie(t,ur({id:"Gird-Aggregation-Model",vertexCount:1,drawMode:0},e))}function jpe(t,r){return new Ie(t,{id:"All-Aggregation-Model",vs:B6,fs:F6,modules:[yo],vertexCount:1,drawMode:0,isInstanced:!0,instanceCount:r,attributes:{position:[0,0]}})}function Upe(t,r){return new mr(t,ur({vs:D6,_targetTextureVarying:"meanValues"},r))}F();j();k();var sn=[[255,255,178],[254,217,118],[254,178,76],[253,141,60],[240,59,32],[189,0,38]];function Wa(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Float32Array,n;if(Number.isFinite(t[0]))n=new e(t);else{n=new e(t.length*4);for(var i=0,a=0;a<t.length;a++){var o=t[a];n[i++]=o[0],n[i++]=o[1],n[i++]=o[2],n[i++]=Number.isFinite(o[3])?o[3]:255}}if(r)for(var s=0;s<n.length;s++)n[s]/=255;return n}var G6=`#define SHADER_NAME screen-grid-layer-vertex-shader
4655#define RANGE_COUNT 6
4656
4657attribute vec3 positions;
4658attribute vec3 instancePositions;
4659attribute vec4 instanceCounts;
4660attribute vec3 instancePickingColors;
4661
4662uniform float opacity;
4663uniform vec3 cellScale;
4664uniform vec4 minColor;
4665uniform vec4 maxColor;
4666uniform vec4 colorRange[RANGE_COUNT];
4667uniform vec2 colorDomain;
4668uniform bool shouldUseMinMax;
4669uniform sampler2D maxTexture;
4670
4671varying vec4 vColor;
4672varying float vSampleCount;
4673
4674vec4 quantizeScale(vec2 domain, vec4 range[RANGE_COUNT], float value) {
4675  vec4 outColor = vec4(0., 0., 0., 0.);
4676  if (value >= domain.x && value <= domain.y) {
4677    float domainRange = domain.y - domain.x;
4678    if (domainRange <= 0.) {
4679      outColor = colorRange[0];
4680    } else {
4681      float rangeCount = float(RANGE_COUNT);
4682      float rangeStep = domainRange / rangeCount;
4683      float idx = floor((value - domain.x) / rangeStep);
4684      idx = clamp(idx, 0., rangeCount - 1.);
4685      int intIdx = int(idx);
4686      outColor = colorRange[intIdx];
4687    }
4688  }
4689  outColor = outColor / 255.;
4690  return outColor;
4691}
4692
4693void main(void) {
4694  vSampleCount = instanceCounts.a;
4695
4696  float weight = instanceCounts.r;
4697  float maxWeight = texture2D(maxTexture, vec2(0.5)).r;
4698
4699  float step = weight / maxWeight;
4700  vec4 minMaxColor = mix(minColor, maxColor, step) / 255.;
4701
4702  vec2 domain = colorDomain;
4703  float domainMaxValid = float(colorDomain.y != 0.);
4704  domain.y = mix(maxWeight, colorDomain.y, domainMaxValid);
4705  vec4 rangeColor = quantizeScale(domain, colorRange, weight);
4706
4707  float rangeMinMax = float(shouldUseMinMax);
4708  vec4 color = mix(rangeColor, minMaxColor, rangeMinMax);
4709  vColor = vec4(color.rgb, color.a * opacity);
4710  picking_setPickingColor(instancePickingColors);
4711
4712  gl_Position = vec4(instancePositions + positions * cellScale, 1.);
4713}
4714`;var z6=`#define SHADER_NAME screen-grid-layer-fragment-shader
4715
4716precision highp float;
4717
4718varying vec4 vColor;
4719varying float vSampleCount;
4720
4721void main(void) {
4722  if (vSampleCount <= 0.0) {
4723    discard;
4724  }
4725  gl_FragColor = vColor;
4726
4727  DECKGL_FILTER_COLOR(gl_FragColor, geometry);
4728}
4729`;function V6(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function qS(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?V6(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):V6(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function Gpe(t){var r=zpe();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function zpe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Vpe=[0,0,0,0],Hpe=[0,255,0,255],Wpe=["minColor","maxColor","colorRange","colorDomain"],$pe={cellSizePixels:{value:100,min:1},cellMarginPixels:{value:2,min:0,max:5},colorDomain:null,colorRange:sn},ml=function(t){L(e,t);var r=Gpe(e);function e(){var n;A(this,e);for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return n=r.call.apply(r,[this].concat(a)),c(q(n),"state",void 0),n}return T(e,[{key:"getShaders",value:function(){return{vs:G6,fs:z6,modules:[rt]}}},{key:"initializeState",value:function(){var i=this.context.gl,a=this.getAttributeManager();a.addInstanced({instancePositions:{size:3,update:this.calculateInstancePositions},instanceCounts:{size:4,noAlloc:!0}}),this.setState({model:this._getModel(i)})}},{key:"shouldUpdateState",value:function(i){var a=i.changeFlags;return a.somethingChanged}},{key:"updateState",value:function(i){Z(S(e.prototype),"updateState",this).call(this,i);var a=i.oldProps,o=i.props,s=i.changeFlags,u=this.getAttributeManager();o.numInstances!==a.numInstances?u.invalidateAll():a.cellSizePixels!==o.cellSizePixels&&u.invalidate("instancePositions"),this._updateUniforms(a,o,s)}},{key:"draw",value:function(i){var a=i.uniforms,o=this.props,s=o.parameters,u=o.maxTexture,l=this.props.minColor||Vpe,f=this.props.maxColor||Hpe,p=this.props.colorDomain||[1,0],h=this.state.model;h.setUniforms(a).setUniforms({minColor:l,maxColor:f,maxTexture:u,colorDomain:p}).draw({parameters:qS({depthTest:!1,depthMask:!1},s)})}},{key:"calculateInstancePositions",value:function(i,a){for(var o=a.numInstances,s=this.context.viewport,u=s.width,l=s.height,f=this.props.cellSizePixels,p=Math.ceil(u/f),h=i.value,d=i.size,v=0;v<o;v++){var m=v%p,g=Math.floor(v/p);h[v*d+0]=m*f/u*2-1,h[v*d+1]=1-g*f/l*2,h[v*d+2]=0}}},{key:"_getModel",value:function(i){return new Ie(i,qS(qS({},this.getShaders()),{},{id:this.props.id,geometry:new Re({drawMode:6,attributes:{positions:new Float32Array([0,0,0,1,0,0,1,1,0,0,1,0])}}),isInstanced:!0}))}},{key:"_shouldUseMinMax",value:function(){var i=this.props,a=i.minColor,o=i.maxColor,s=i.colorDomain,u=i.colorRange;return a||o?(ne.deprecated("ScreenGridLayer props: minColor and maxColor","colorRange, colorDomain")(),!0):!(s||u)}},{key:"_updateUniforms",value:function(i,a,o){var s=this.state.model;if(Wpe.some(function(g){return i[g]!==a[g]})&&s.setUniforms({shouldUseMinMax:this._shouldUseMinMax()}),i.colorRange!==a.colorRange&&s.setUniforms({colorRange:Wa(a.colorRange)}),i.cellMarginPixels!==a.cellMarginPixels||i.cellSizePixels!==a.cellSizePixels||o.viewportChanged){var u=this.context.viewport,l=u.width,f=u.height,p=this.props,h=p.cellSizePixels,d=p.cellMarginPixels,v=h>d?d:0,m=new Float32Array([(h-v)/l*2,-(h-v)/f*2,1]);s.setUniforms({cellScale:m})}}}],[{key:"isSupported",value:function(i){return qt(i,[Ee.TEXTURE_FLOAT])}}]),e}(He);c(ml,"layerName","ScreenGridCellLayer");c(ml,"defaultProps",$pe);F();j();k();F();j();k();function H6(t,r){var e={};for(var n in t)r.includes(n)||(e[n]=t[n]);return e}function W6(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=Xpe(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}
4729}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
4730In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function Xpe(t,r){if(t){if(typeof t=="string")return $6(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return $6(t,r)}}function $6(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function qpe(t){var r=Ype();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function Ype(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Cn=function(t){L(e,t);var r=qpe(e);function e(){var n;A(this,e);for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return n=r.call.apply(r,[this].concat(a)),c(q(n),"state",void 0),n}return T(e,[{key:"initializeAggregationLayer",value:function(i){Z(S(e.prototype),"initializeState",this).call(this,this.context),this.setState({ignoreProps:H6(this.constructor._propTypes,i.data.props),dimensions:i})}},{key:"updateState",value:function(i){Z(S(e.prototype),"updateState",this).call(this,i);var a=i.changeFlags;if(a.extensionsChanged){var o=this.getShaders({});o&&o.defines&&(o.defines.NON_INSTANCED_MODEL=1),this.updateShaders(o)}this._updateAttributes()}},{key:"updateAttributes",value:function(i){this.setState({changedAttributes:i})}},{key:"getAttributes",value:function(){return this.getAttributeManager().getShaderAttributes()}},{key:"getModuleSettings",value:function(){var i=this.context,a=i.viewport,o=i.mousePosition,s=i.gl,u=Object.assign(Object.create(this.props),{viewport:a,mousePosition:o,pickingActive:0,devicePixelRatio:Jt(s)});return u}},{key:"updateShaders",value:function(i){}},{key:"isAggregationDirty",value:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=i.props,s=i.oldProps,u=i.changeFlags,l=a.compareAll,f=l===void 0?!1:l,p=a.dimension,h=this.state.ignoreProps,d=p.props,v=p.accessors,m=v===void 0?[]:v,g=u.updateTriggersChanged;if(u.dataChanged)return!0;if(g){if(g.all)return!0;var y=W6(m),_;try{for(y.s();!(_=y.n()).done;){var b=_.value;if(g[b])return!0}}catch(E){y.e(E)}finally{y.f()}}if(f)return u.extensionsChanged?!0:mu({oldProps:s,newProps:o,ignoreProps:h,propTypes:this.constructor._propTypes});var x=W6(d),w;try{for(x.s();!(w=x.n()).done;){var P=w.value;if(o[P]!==s[P])return!0}}catch(E){x.e(E)}finally{x.f()}return!1}},{key:"isAttributeChanged",value:function(i){var a=this.state.changedAttributes;return i?a&&a[i]!==void 0:!Kpe(a)}},{key:"_getAttributeManager",value:function(){return new Sa(this.context.gl,{id:this.props.id,stats:this.context.stats})}}]),e}(gt);c(Cn,"layerName","AggregationLayer");function Kpe(t){var r=!0;for(var e in t){r=!1;break}return r}be();F();j();k();function Zpe(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=Jpe(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
4731In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function Jpe(t,r){if(t){if(typeof t=="string")return X6(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return X6(t,r)}}function X6(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function pg(t,r,e){var n=e;return n.domain=function(){return t},n.range=function(){return r},n}function q6(t,r){var e=function(i){return ohe(t,r,i)};return pg(t,r,e)}function Qpe(t,r){var e=function(i){return she(t,r,i)};return pg(t,r,e)}function ehe(t,r){for(var e=t.sort(Y6),n=0,i=Math.max(1,r.length),a=new Array(i-1);++n<i;)a[n-1]=the(e,n/i);var o=function(u){return nhe(a,r,u)};return o.thresholds=function(){return a},pg(t,r,o)}function Y6(t,r){return t-r}function the(t,r){var e=t.length;if(r<=0||e<2)return t[0];if(r>=1)return t[e-1];var n=(e-1)*r,i=Math.floor(n),a=t[i],o=t[i+1];return a+(o-a)*(n-i)}function rhe(t,r){for(var e=0,n=t.length;e<n;){var i=e+n>>>1;Y6(t[i],r)>0?n=i:e=i+1}return e}function nhe(t,r,e){return r[rhe(t,e)]}function ihe(t,r,e,n){var i="".concat(n),a=r.get(i);return a===void 0&&(a=t.push(n),r.set(i,a)),e[(a-1)%e.length]}function ahe(t,r){var e=new Map,n=[],i=Zpe(t),a;try{for(i.s();!(a=i.n()).done;){var o=a.value,s="".concat(o);e.has(s)||e.set(s,n.push(o))}}catch(l){i.e(l)}finally{i.f()}var u=function(f){return ihe(n,e,r,f)};return pg(t,r,u)}function ohe(t,r,e){var n=t[1]-t[0];if(n<=0)return ne.warn("quantizeScale: invalid domain, returning range[0]")(),r[0];var i=n/r.length,a=Math.floor((e-t[0])/i),o=Math.max(Math.min(a,r.length-1),0);return r[o]}function she(t,r,e){return(e-t[0])/(t[1]-t[0])*(r[1]-r[0])+r[0]}function K6(t){return t!=null}function uhe(t){var r=[];return t.forEach(function(e){!r.includes(e)&&K6(e)&&r.push(e)}),r}function Z6(t,r){var e=typeof r=="function"?t.map(r):t;return e.filter(K6)}function J6(t,r){return Z6(t,r)}function Q6(t,r){return uhe(Z6(t,r))}function eG(t,r,e){return Math.max(r,Math.min(e,t))}function tG(t){switch(t){case"quantize":return q6;case"linear":return Qpe;case"quantile":return ehe;case"ordinal":return ahe;default:return q6}}function rG(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=lhe(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}
4731}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
4732In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function lhe(t,r){if(t){if(typeof t=="string")return nG(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return nG(t,r)}}function nG(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var aG=function(r){return r.length},fhe=3402823466e29,oG=function(r){return r.points},sG=function(r){return r.index},iG=function(r,e){return r<e?-1:r>e?1:r>=e?0:NaN},che={getValue:aG,getPoints:oG,getIndex:sG,filterData:null},gl=function(){function t(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:che;A(this,t),c(this,"maxCount",void 0),c(this,"maxValue",void 0),c(this,"minValue",void 0),c(this,"totalCount",void 0),c(this,"aggregatedBins",void 0),c(this,"sortedBins",void 0),c(this,"binMap",void 0),this.aggregatedBins=this.getAggregatedBins(r,e),this._updateMinMaxValues(),this.binMap=this.getBinMap()}return T(t,[{key:"getAggregatedBins",value:function(e,n){for(var i=n.getValue,a=i===void 0?aG:i,o=n.getPoints,s=o===void 0?oG:o,u=n.getIndex,l=u===void 0?sG:u,f=n.filterData,p=typeof f=="function",h=e.length,d=[],v=0,m=0;m<h;m++){var g=e[m],y=s(g),_=l(g),b=p?y.filter(f):y;g.filteredPoints=p?b:null;var x=b.length?a(b):null;x!=null&&(d[v]={i:Number.isFinite(_)?_:m,value:x,counts:b.length},v++)}return d}},{key:"_percentileToIndex",value:function(e){var n=this.sortedBins.length;if(n<2)return[0,0];var i=e.map(function(f){return eG(f,0,100)}),a=W(i,2),o=a[0],s=a[1],u=Math.ceil(o/100*(n-1)),l=Math.floor(s/100*(n-1));return[u,l]}},{key:"getBinMap",value:function(){var e={},n=rG(this.aggregatedBins),i;try{for(n.s();!(i=n.n()).done;){var a=i.value;e[a.i]=a}}catch(o){n.e(o)}finally{n.f()}return e}},{key:"_updateMinMaxValues",value:function(){var e=0,n=0,i=fhe,a=0,o=rG(this.aggregatedBins),s;try{for(o.s();!(s=o.n()).done;){var u=s.value;e=e>u.counts?e:u.counts,n=n>u.value?n:u.value,i=i<u.value?i:u.value,a+=u.counts}}catch(l){o.e(l)}finally{o.f()}this.maxCount=e,this.maxValue=n,this.minValue=i,this.totalCount=a}},{key:"getValueRange",value:function(e){if(this.sortedBins||(this.sortedBins=this.aggregatedBins.sort(function(o,s){return iG(o.value,s.value)})),!this.sortedBins.length)return[];var n=0,i=this.sortedBins.length-1;if(Array.isArray(e)){var a=this._percentileToIndex(e);n=a[0],i=a[1]}return[this.sortedBins[n].value,this.sortedBins[i].value]}},{key:"getValueDomainByScale",value:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=W(n,2),a=i[0],o=a===void 0?0:a,s=i[1],u=s===void 0?100:s;if(this.sortedBins||(this.sortedBins=this.aggregatedBins.sort(function(f,p){return iG(f.value,p.value)})),!this.sortedBins.length)return[];var l=this._percentileToIndex([o,u]);return this._getScaleDomain(e,l)}},{key:"_getScaleDomain",value:function(e,n){var i=W(n,2),a=i[0],o=i[1],s=this.sortedBins;switch(e){case"quantize":case"linear":return[s[a].value,s[o].value];case"quantile":return J6(s.slice(a,o+1),function(u){return u.value});case"ordinal":return Q6(s,function(u){return u.value});default:return[s[a].value,s[o].value]}}}]),t}();k();be();var lG=6378e3;function hg(t){return Number.isFinite(t)?t:0}function dg(t,r){for(var e=t.positions.value,n=1/0,i=-1/0,a=1/0,o=-1/0,s,u,l=0;l<r;l++)u=e[l*3],s=e[l*3+1],n=s<n?s:n,i=s>i?s:i,a=u<a?u:a,o=u>o?u:o;var f={xMin:hg(a),xMax:hg(o),yMin:hg(n),yMax:hg(i)};return f}function phe(t,r,e,n){var i=n.width,a=n.height,o=e===de.CARTESIAN?[-i/2,-a/2]:[-180,-90];ne.assert(e===de.CARTESIAN||e===de.LNGLAT||e===de.DEFAULT);var s=t.xMin,u=t.yMin;return[-1*(uG(s-o[0],r.xOffset)+o[0]),-1*(uG(u-o[1],r.yOffset)+o[1])]}function uG(t,r){var e=t<0?-1:1,n=e<0?Math.abs(t)+r:Math.abs(t);return n=Math.floor(n/r)*r,n*e}function YS(t,r){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e)return{xOffset:r,yOffset:r};var n=t.yMin,i=t.yMax,a=(n+i)/2;return hhe(r,a)}function vg(t,r,e,n){var i=YS(t,r,n!==de.CARTESIAN),a=phe(t,i,n,e),o=t.xMin,s=t.yMin,u=t.xMax,l=t.yMax,f=u-o+i.xOffset,p=l-s+i.yOffset,h=Math.ceil(f/i.xOffset),d=Math.ceil(p/i.yOffset);return{gridOffset:i,translation:a,width:f,height:p,numCol:h,numRow:d}}function hhe(t,r){var e=dhe(t),n=vhe(r,t);return{yOffset:e,xOffset:n}}function dhe(t){return t/lG*(180/Math.PI)}function vhe(t,r){return r/lG*(180/Math.PI)/Math.cos(t*Math.PI/180)}function fG(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function mhe(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};
4732r%2?fG(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):fG(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function ghe(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=yhe(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
4733In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function yhe(t,r){if(t){if(typeof t=="string")return cG(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return cG(t,r)}}function cG(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function yl(t,r){var e=_he(t,r),n=bhe(e);return{gridHash:e.gridHash,gridOffset:e.gridOffset,data:n}}function _he(t,r){var e=t.data,n=e===void 0?[]:e,i=t.cellSize,a=r.attributes,o=r.viewport,s=r.projectPoints,u=r.numInstances,l=a.positions.value,f=a.positions.getAccessor(),p=f.size,h=r.boundingBox||xhe(a.positions,u),d=r.posOffset||[180,90],v=r.gridOffset||YS(h,i);if(v.xOffset<=0||v.yOffset<=0)return{gridHash:{},gridOffset:v};var m=o.width,g=o.height,y=Math.ceil(m/v.xOffset),_=Math.ceil(g/v.yOffset),b={},x=Ot(n),w=x.iterable,P=x.objectInfo,E=new Array(3),C=ghe(w),I;try{for(C.s();!(I=C.n()).done;){var O=I.value;P.index++,E[0]=l[P.index*p],E[1]=l[P.index*p+1],E[2]=p>=3?l[P.index*p+2]:0;var D=s?o.project(E):E,N=W(D,2),H=N[0],$=N[1];if(Number.isFinite(H)&&Number.isFinite($)){var ee=Math.floor(($+d[1])/v.yOffset),V=Math.floor((H+d[0])/v.xOffset);if(!s||V>=0&&V<y&&ee>=0&&ee<_){var U="".concat(ee,"-").concat(V);b[U]=b[U]||{count:0,points:[],lonIdx:V,latIdx:ee},b[U].count+=1,b[U].points.push({source:O,index:P.index})}}}}catch(X){C.e(X)}finally{C.f()}return{gridHash:b,gridOffset:v,offsets:[d[0]*-1,d[1]*-1]}}function bhe(t){var r=t.gridHash,e=t.gridOffset,n=t.offsets,i=new Array(Object.keys(r).length),a=0;for(var o in r){var s=o.split("-"),u=parseInt(s[0],10),l=parseInt(s[1],10),f=a++;i[f]=mhe({index:f,position:[n[0]+e.xOffset*l,n[1]+e.yOffset*u]},r[o])}return i}function xhe(t,r){for(var e=t.value,n=t.getAccessor(),i=n.size,a=1/0,o=-1/0,s=1/0,u=-1/0,l,f,p=0;p<r;p++)f=e[p*i],l=e[p*i+1],Number.isFinite(f)&&Number.isFinite(l)&&(a=l<a?l:a,o=l>o?l:o,s=f<s?f:s,u=f>u?f:u);return{xMin:s,xMax:u,yMin:a,yMax:o}}function Ahe(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=She(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
4734In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function She(t,r){if(t){if(typeof t=="string")return pG(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return pG(t,r)}}function pG(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function The(t){var r=whe();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}
4734function whe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var ps=function(t){L(e,t);var r=The(e);function e(){var n;A(this,e);for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return n=r.call.apply(r,[this].concat(a)),c(q(n),"state",void 0),n}return T(e,[{key:"initializeAggregationLayer",value:function(i){var a=i.dimensions,o=this.context.gl;Z(S(e.prototype),"initializeAggregationLayer",this).call(this,a),this.setState({layerData:{},gpuGridAggregator:new lr(o,{id:"".concat(this.id,"-gpu-aggregator")}),cpuGridAggregator:yl})}},{key:"updateState",value:function(i){Z(S(e.prototype),"updateState",this).call(this,i),this.updateAggregationState(i);var a=this.state,o=a.aggregationDataDirty,s=a.aggregationWeightsDirty,u=a.gpuAggregation;if(!(this.getNumInstances()<=0)){var l=!1;(o||u&&s)&&(this._updateAggregation(i),l=!0),!u&&(o||s)&&(this._updateWeightBins(),this._uploadAggregationResults(),l=!0),this.setState({aggregationDirty:l})}}},{key:"finalizeState",value:function(i){var a,o=this.state.weights.count;o&&o.aggregationBuffer&&o.aggregationBuffer.delete(),(a=this.state.gpuGridAggregator)===null||a===void 0||a.delete(),Z(S(e.prototype),"finalizeState",this).call(this,i)}},{key:"updateShaders",value:function(i){this.state.gpuAggregation&&this.state.gpuGridAggregator.updateShaders(i)}},{key:"updateAggregationState",value:function(i){ne.assert(!1)}},{key:"allocateResources",value:function(i,a){if(this.state.numRow!==i||this.state.numCol!==a){var o=a*i*4*4,s=this.context.gl,u=this.state.weights;for(var l in u){var f=u[l];f.aggregationBuffer&&f.aggregationBuffer.delete(),f.aggregationBuffer=new Pe(s,{byteLength:o,accessor:{size:4,type:5126,divisor:1}})}}}},{key:"updateResults",value:function(i){var a=i.aggregationData,o=i.maxMinData,s=i.maxData,u=i.minData,l=this.state.weights.count;l&&(l.aggregationData=a,l.maxMinData=o,l.maxData=s,l.minData=u)}},{key:"_updateAggregation",value:function(i){var a=this.state,o=a.cpuGridAggregator,s=a.gpuGridAggregator,u=a.gridOffset,l=a.posOffset,f=a.translation,p=f===void 0?[0,0]:f,h=a.scaling,d=h===void 0?[0,0,0]:h,v=a.boundingBox,m=a.projectPoints,g=a.gpuAggregation,y=a.numCol,_=a.numRow,b=i.props,x=this.context.viewport,w=this.getAttributes(),P=this.getNumInstances();if(g){var C=this.state.weights;s.run({weights:C,cellSize:[u.xOffset,u.yOffset],numCol:y,numRow:_,translation:p,scaling:d,vertexCount:P,projectPoints:m,attributes:w,moduleSettings:this.getModuleSettings()})}else{var E=o(b,{gridOffset:u,projectPoints:m,attributes:w,viewport:x,posOffset:l,boundingBox:v});this.setState({layerData:E})}}},{key:"_updateWeightBins",value:function(){var i=this.state.getValue,a=new gl(this.state.layerData.data||[],{getValue:i});this.setState({sortedBins:a})}},{key:"_uploadAggregationResults",value:function(){var i=this.state,a=i.numCol,o=i.numRow,s=this.state.layerData.data,u=this.state.sortedBins,l=u.aggregatedBins,f=u.minValue,p=u.maxValue,h=u.totalCount,d=4,v=a*o*d,m=new Float32Array(v).fill(0),g=Ahe(l),y;try{for(g.s();!(y=g.n()).done;){var _=y.value,b=s[_.i],x=b.lonIdx,w=b.latIdx,P=_.value,E=_.counts,C=(x+w*a)*d;m[C]=P,m[C+d-1]=E}}catch(N){g.e(N)}finally{g.f()}var I=new Float32Array([p,0,0,f]),O=new Float32Array([p,0,0,h]),D=new Float32Array([f,0,0,h]);this.updateResults({aggregationData:m,maxMinData:I,maxData:O,minData:D})}}]),e}(Cn);c(ps,"layerName","GridAggregationLayer");function Phe(t){var r=Ohe();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function Ohe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function hG(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function KS(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};
4734r%2?hG(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):hG(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var Ehe=KS(KS({},ml.defaultProps),{},{getPosition:{type:"accessor",value:function(r){return r.position}},getWeight:{type:"accessor",value:1},gpuAggregation:!0,aggregation:"SUM"}),dG="positions",Che={data:{props:["cellSizePixels"]},weights:{props:["aggregation"],accessors:["getWeight"]}},mg=function(t){L(e,t);var r=Phe(e);function e(){var n;A(this,e);for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return n=r.call.apply(r,[this].concat(a)),c(q(n),"state",void 0),n}return T(e,[{key:"initializeState",value:function(){var i,a=this.context.gl;if(!ml.isSupported(a)){this.setState({supported:!1}),ne.error("ScreenGridLayer: ".concat(this.id," is not supported on this browser"))();return}Z(S(e.prototype),"initializeAggregationLayer",this).call(this,{dimensions:Che,getCellSize:function(l){return l.cellSizePixels}});var o={count:{size:1,operation:lt.SUM,needMax:!0,maxTexture:vl(a,{id:"".concat(this.id,"-max-texture")})}};this.setState({supported:!0,projectPoints:!0,weights:o,subLayerData:{attributes:{}},maxTexture:o.count.maxTexture,positionAttributeName:"positions",posOffset:[0,0],translation:[1,-1]});var s=this.getAttributeManager();s.add((i={},c(i,dG,{size:3,accessor:"getPosition",type:5130,fp64:this.use64bitPositions()}),c(i,"count",{size:3,accessor:"getWeight"}),i))}},{key:"shouldUpdateState",value:function(i){var a=i.changeFlags;return this.state.supported&&a.somethingChanged}},{key:"updateState",value:function(i){Z(S(e.prototype),"updateState",this).call(this,i)}},{key:"renderLayers",value:function(){if(!this.state.supported)return[];var i=this.state,a=i.maxTexture,o=i.numRow,s=i.numCol,u=i.weights,l=this.props.updateTriggers,f=u.count.aggregationBuffer,p=this.getSubLayerClass("cells",ml);return new p(this.props,this.getSubLayerProps({id:"cell-layer",updateTriggers:l}),{data:{attributes:{instanceCounts:f}},maxTexture:a,numInstances:o*s})}},{key:"finalizeState",value:function(i){Z(S(e.prototype),"finalizeState",this).call(this,i);var a=this.state,o=a.aggregationBuffer,s=a.maxBuffer,u=a.maxTexture;o?.delete(),s?.delete(),u?.delete()}},{key:"getPickingInfo",value:function(i){var a=i.info,o=a.index;if(o>=0){var s=this.state,u=s.gpuGridAggregator,l=s.gpuAggregation,f=s.weights,p=l?u.getData("count"):f.count;a.object=lr.getAggregationData(KS({pixelIndex:o},p))}return a}},{key:"updateResults",value:function(i){var a=i.aggregationData,o=i.maxData,s=this.state.weights.count;s.aggregationData=a,s.aggregationBuffer.setData({data:a}),s.maxData=o,s.maxTexture.setImageData({data:o})}},{key:"updateAggregationState",value:function(i){var a=i.props.cellSizePixels,o=i.oldProps.cellSizePixels!==a,s=i.changeFlags.viewportChanged,u=i.props.gpuAggregation;this.state.gpuAggregation!==i.props.gpuAggregation&&u&&!lr.isSupported(this.context.gl)&&(ne.warn("GPU Grid Aggregation not supported, falling back to CPU")(),u=!1);var l=u!==this.state.gpuAggregation;this.setState({gpuAggregation:u});var f=this.isAttributeChanged(dG),p=this.state.dimensions,h=p.data,d=p.weights,v=f||l||s||this.isAggregationDirty(i,{compareAll:u,dimension:h}),m=this.isAggregationDirty(i,{dimension:d});this.setState({aggregationDataDirty:v,aggregationWeightsDirty:m});var g=this.context.viewport;if(s||o){var y=g.width,_=g.height,b=Math.ceil(y/a),x=Math.ceil(_/a);this.allocateResources(x,b),this.setState({scaling:[y/2,-_/2,1],gridOffset:{xOffset:a,yOffset:a},width:y,height:_,numCol:b,numRow:x})}m&&this._updateAccessors(i),(v||m)&&this._resetResults()}},{key:"_updateAccessors",value:function(i){var a=i.props,o=a.getWeight,s=a.aggregation,u=a.data,l=this.state.weights.count;l&&(l.getWeight=o,l.operation=lt[s]),this.setState({getValue:hl(s,o,{data:u})})}},{key:"_resetResults",value:function(){var i=this.state.weights.count;i&&(i.aggregationData=null)}}]),e}(ps);c(mg,"layerName","ScreenGridLayer");c(mg,"defaultProps",Ehe);F();j();k();Ge();k();F();j();function vG(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function Mn(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};
4734r%2?vG(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):vG(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function mG(){}var gG=["getBins","getDomain","getScaleFunc"],yG=[{key:"fillColor",accessor:"getFillColor",pickingInfo:"colorValue",getBins:{triggers:{value:{prop:"getColorValue",updateTrigger:"getColorValue"},weight:{prop:"getColorWeight",updateTrigger:"getColorWeight"},aggregation:{prop:"colorAggregation"},filterData:{prop:"_filterData",updateTrigger:"_filterData"}}},getDomain:{triggers:{lowerPercentile:{prop:"lowerPercentile"},upperPercentile:{prop:"upperPercentile"},scaleType:{prop:"colorScaleType"}}},getScaleFunc:{triggers:{domain:{prop:"colorDomain"},range:{prop:"colorRange"}},onSet:{props:"onSetColorDomain"}},nullValue:[0,0,0,0]},{key:"elevation",accessor:"getElevation",pickingInfo:"elevationValue",getBins:{triggers:{value:{prop:"getElevationValue",updateTrigger:"getElevationValue"},weight:{prop:"getElevationWeight",updateTrigger:"getElevationWeight"},aggregation:{prop:"elevationAggregation"},filterData:{prop:"_filterData",updateTrigger:"_filterData"}}},getDomain:{triggers:{lowerPercentile:{prop:"elevationLowerPercentile"},upperPercentile:{prop:"elevationUpperPercentile"},scaleType:{prop:"elevationScaleType"}}},getScaleFunc:{triggers:{domain:{prop:"elevationDomain"},range:{prop:"elevationRange"}},onSet:{props:"onSetElevationDomain"}},nullValue:-1}],Mhe=function(r){return r.cellSize},_l=function(){function t(r){A(this,t),this.state={layerData:{},dimensions:{}},this.changeFlags={},this.dimensionUpdaters={},this._getCellSize=r.getCellSize||Mhe,this._getAggregator=r.getAggregator,this._addDimension(r.dimensions||yG)}return T(t,[{key:"updateState",value:function(e,n){var i=e.oldProps,a=e.props,o=e.changeFlags;this.updateGetValueFuncs(i,a,o);var s=this.needsReProjectPoints(i,a,o),u=!1;if(o.dataChanged||s)this.getAggregatedData(a,n),u=!0;else{var l=this.getDimensionChanges(i,a,o)||[];l.forEach(function(f){return typeof f=="function"&&f()}),u=!0}return this.setState({aggregationDirty:u}),this.state}},{key:"setState",value:function(e){this.state=Mn(Mn({},this.state),e)}},{key:"setDimensionState",value:function(e,n){this.setState({dimensions:Mn(Mn({},this.state.dimensions),{},c({},e,Mn(Mn({},this.state.dimensions[e]),n)))})}},{key:"normalizeResult",value:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return e.hexagons?Mn({data:e.hexagons},e):e.layerData?Mn({data:e.layerData},e):e}},{key:"getAggregatedData",value:function(e,n){var i=this._getAggregator(e),a=i(e,n);this.setState({layerData:this.normalizeResult(a)}),this.changeFlags={layerData:!0},this.getSortedBins(e)}},{key:"updateGetValueFuncs",value:function(e,n,i){for(var a in this.dimensionUpdaters){var o=this.dimensionUpdaters[a].getBins.triggers,s=o.value,u=o.weight,l=o.aggregation,f=n[s.prop],p=this.needUpdateDimensionStep(this.dimensionUpdaters[a].getBins,e,n,i);p&&(f?f=E6(f,{data:n.data}):f=hl(n[l.prop],n[u.prop],{data:n.data})),f&&this.setDimensionState(a,{getValue:f})}}},{key:"needsReProjectPoints",value:function(e,n,i){return this._getCellSize(e)!==this._getCellSize(n)||this._getAggregator(e)!==this._getAggregator(n)||i.updateTriggersChanged&&(i.updateTriggersChanged.all||i.updateTriggersChanged.getPosition)}},{key:"addDimension",value:function(e){this._addDimension(e)}},{key:"_addDimension",value:function(){var e=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];n.forEach(function(i){var a=i.key;e.dimensionUpdaters[a]=e.getDimensionUpdaters(i),e.state.dimensions[a]={getValue:null,domain:null,sortedBins:null,scaleFunc:mG}})}},{key:"getDimensionUpdaters",value:function(e){var n=e.key,i=e.accessor,a=e.pickingInfo,o=e.getBins,s=e.getDomain,u=e.getScaleFunc,l=e.nullValue;return{key:n,accessor:i,pickingInfo:a,getBins:Mn({updater:this.getDimensionSortedBins},o),getDomain:Mn({updater:this.getDimensionValueDomain},s),getScaleFunc:Mn({updater:this.getDimensionScale}
4734,u),attributeAccessor:this.getSubLayerDimensionAttribute(n,l)}}},{key:"needUpdateDimensionStep",value:function(e,n,i,a){return Object.values(e.triggers).some(function(o){return o.updateTrigger?a.dataChanged||a.updateTriggersChanged&&(a.updateTriggersChanged.all||a.updateTriggersChanged[o.updateTrigger]):n[o.prop]!==i[o.prop]})}},{key:"getDimensionChanges",value:function(e,n,i){var a=this,o=[],s=function(f){var p=gG.find(function(h){return a.needUpdateDimensionStep(a.dimensionUpdaters[f][h],e,n,i)});p&&o.push(a.dimensionUpdaters[f][p].updater.bind(a,n,a.dimensionUpdaters[f]))};for(var u in this.dimensionUpdaters)s(u);return o.length?o:null}},{key:"getUpdateTriggers",value:function(e){var n=this,i=e.updateTriggers||{},a={},o=function(l){var f=n.dimensionUpdaters[l].accessor;a[f]={},gG.forEach(function(p){Object.values(n.dimensionUpdaters[l][p].triggers).forEach(function(h){var d=h.prop,v=h.updateTrigger;if(v){var m=i[v];ue(m)==="object"&&!Array.isArray(m)?Object.assign(a[f],m):m!==void 0&&(a[f][d]=m)}else a[f][d]=e[d]})})};for(var s in this.dimensionUpdaters)o(s);return a}},{key:"getSortedBins",value:function(e){for(var n in this.dimensionUpdaters)this.getDimensionSortedBins(e,this.dimensionUpdaters[n])}},{key:"getDimensionSortedBins",value:function(e,n){var i=n.key,a=this.state.dimensions[i].getValue,o=new gl(this.state.layerData.data||[],{getValue:a,filterData:e._filterData});this.setDimensionState(i,{sortedBins:o}),this.getDimensionValueDomain(e,n)}},{key:"getDimensionValueDomain",value:function(e,n){var i=n.getDomain,a=n.key,o=i.triggers,s=o.lowerPercentile,u=o.upperPercentile,l=o.scaleType,f=this.state.dimensions[a].sortedBins.getValueDomainByScale(e[l.prop],[e[s.prop],e[u.prop]]);this.setDimensionState(a,{valueDomain:f}),this.getDimensionScale(e,n)}},{key:"getDimensionScale",value:function(e,n){var i=n.key,a=n.getScaleFunc,o=n.getDomain,s=a.triggers,u=s.domain,l=s.range,f=o.triggers.scaleType,p=a.onSet,h=e[l.prop],d=e[u.prop]||this.state.dimensions[i].valueDomain,v=tG(f&&e[f.prop]),m=v(d,h);ue(p)==="object"&&typeof e[p.props]=="function"&&e[p.props](m.domain()),this.setDimensionState(i,{scaleFunc:m})}},{key:"getSubLayerDimensionAttribute",value:function(e,n){var i=this;return function(a){var o=i.state.dimensions[e],s=o.sortedBins,u=o.scaleFunc,l=s.binMap[a.index];if(l&&l.counts===0)return n;var f=l&&l.value,p=u.domain(),h=f>=p[0]&&f<=p[p.length-1];return h?u(f):n}}},{key:"getSubLayerAccessors",value:function(e){var n={};for(var i in this.dimensionUpdaters){var a=this.dimensionUpdaters[i].accessor;n[a]=this.getSubLayerDimensionAttribute(e,i)}return n}},{key:"getPickingInfo",value:function(e){var n=e.info,i=n.picked&&n.index>-1,a=null;if(i){var o=this.state.layerData.data[n.index],s={};for(var u in this.dimensionUpdaters){var l=this.dimensionUpdaters[u].pickingInfo,f=this.state.dimensions[u].sortedBins,p=f.binMap[o.index]&&f.binMap[o.index].value;s[l]=p}a=Object.assign(s,o,{points:o.filteredPoints||o.points})}return n.picked=Boolean(a),n.object=a,n}},{key:"getAccessor",value:function(e){return this.dimensionUpdaters.hasOwnProperty(e)?this.dimensionUpdaters[e].attributeAccessor:mG}}],[{key:"defaultDimensions",value:function(){return yG}}]),t}();function Ihe(t){var r=Rhe();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function Rhe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _G(){}var Lhe={colorDomain:null,colorRange:sn,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:_G,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:_G,gridAggregator:yl,cellSize:{type:"number",min:0,max:1e3,value:1e3},coverage:{type:"number",min:0,max:1,value:1},getPosition:{type:"accessor",value:function(r){return r.position}},extruded:!1,material:!0,_filterData:{type:"function",value:null,optional:!0}},hs=function(t){L(e,t);var r=Ihe(e);function e(){return A(this,e),r.apply(this,arguments)}return T(e,[{key:"initializeState",value:function(){var i=new _l({getAggregator:function(s){return s.gridAggregator},getCellSize:function(s){return s.cellSize}});this.state={cpuAggregator:i,aggregatorState:i.state};var a=this.getAttributeManager();a.add({positions:{size:3,type:5130,accessor:"getPosition"}})}},{key:"updateState",value:function(i){Z(S(e.prototype),"updateState",this).call(this,i),this.setState({aggregatorState:this.state.cpuAggregator.updateState(i,{viewport:this.context.viewport,attributes:this.getAttributes(),numInstances:this.getNumInstances()})})}},{key:"getPickingInfo",value:function(i){var a=i.info;return this.state.cpuAggregator.getPickingInfo({info:a})}},{key:"_onGetSublayerColor",value:function(i){return this.state.cpuAggregator.getAccessor("fillColor")(i)}},{key:"_onGetSublayerElevation",value:function(i){return this.state.cpuAggregator.getAccessor("elevation")(i)}},{key:"_getSublayerUpdateTriggers",value:function(){return this.state.cpuAggregator.getUpdateTriggers(this.props)}},{key:"renderLayers",value:function(){var i=this.props,a=i.elevationScale,o=i.extruded,s=i.cellSize,u=i.coverage,l=i.material,f=i.transitions,p=this.state.cpuAggregator,h=this.getSubLayerClass("grid-cell",Mu),d=this._getSublayerUpdateTriggers();return new h({cellSize:s,coverage:u,material:l,elevationScale:a,extruded:o,getFillColor:this._onGetSublayerColor.bind(this),getElevation:this._onGetSublayerElevation.bind(this),transitions:f&&{getFillColor:f.getColorValue||f.getColorWeight,getElevation:f.getElevationValue||f.getElevationWeight}}
4734,this.getSubLayerProps({id:"grid-cell",updateTriggers:d}),{data:p.state.layerData.data})}}]),e}(Cn);c(hs,"layerName","CPUGridLayer");c(hs,"defaultProps",Lhe);F();j();k();var bl=Math.PI/3,khe=[0,bl,2*bl,3*bl,4*bl,5*bl];function Bhe(t){return t[0]}function Fhe(t){return t[1]}function ZS(){var t=0,r=0,e=1,n=1,i=Bhe,a=Fhe,o,s,u;function l(p){var h={},d=[],v,m=p.length;for(v=0;v<m;++v)if(!(isNaN(y=+i.call(null,g=p[v],v,p))||isNaN(_=+a.call(null,g,v,p)))){var g,y,_,b=Math.round(_=_/u),x=Math.round(y=y/s-(b&1)/2),w=_-b;if(Math.abs(w)*3>1){var P=y-x,E=x+(y<x?-1:1)/2,C=b+(_<b?-1:1),I=y-E,O=_-C;P*P+w*w>I*I+O*O&&(x=E+(b&1?1:-1)/2,b=C)}var D=x+"-"+b,N=h[D];N?N.push(g):(d.push(N=h[D]=[g]),N.x=(x+(b&1)/2)*s,N.y=b*u)}return d}function f(p){var h=0,d=0;return khe.map(function(v){var m=Math.sin(v)*p,g=-Math.cos(v)*p,y=m-h,_=g-d;return h=m,d=g,[y,_]})}return l.hexagon=function(p){return"m"+f(p==null?o:+p).join("l")+"z"},l.centers=function(){for(var p=[],h=Math.round(r/u),d=Math.round(t/s),v=h*u;v<n+o;v+=u,++h)for(var m=d*s+(h&1)*s/2;m<e+s/2;m+=s)p.push([m,v]);return p},l.mesh=function(){var p=f(o).slice(0,4).join("l");return l.centers().map(function(h){return"M"+h+"m"+p}).join("")},l.x=function(p){return arguments.length?(i=p,l):i},l.y=function(p){return arguments.length?(a=p,l):a},l.radius=function(p){return arguments.length?(o=+p,s=o*2*Math.sin(bl),u=o*1.5,l):o},l.size=function(p){return arguments.length?(t=r=0,e=+p[0],n=+p[1],l):[e-t,n-r]},l.extent=function(p){return arguments.length?(t=+p[0][0],r=+p[0][1],e=+p[1][0],n=+p[1][1],l):[[t,r],[e,n]]},l.radius(1)}function Dhe(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=Nhe(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
4735In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function Nhe(t,r){if(t){if(typeof t=="string")return bG(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return bG(t,r)}}function bG(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function xG(t,r){var e=t.data,n=t.radius,i=r.viewport,a=r.attributes,o=e.length?jhe(e,r):null,s=Uhe(n,i,o),u=[],l=Ot(e),f=l.iterable,p=l.objectInfo,h=a.positions.value,d=a.positions.getAccessor(),v=d.size,m=Dhe(f),g;try{for(m.s();!(g=m.n()).done;){var y=g.value;p.index++;var _=p.index*v,b=[h[_],h[_+1]],x=Number.isFinite(b[0])&&Number.isFinite(b[1]);x?u.push({screenCoord:i.projectFlat(b),source:y,index:p.index}):ne.warn("HexagonLayer: invalid position")()}}catch(E){m.e(E)}finally{m.f()}var w=ZS().radius(s).x(function(E){return E.screenCoord[0]}).y(function(E){return E.screenCoord[1]}),P=w(u);return{hexagons:P.map(function(E,C){return{position:i.unprojectFlat([E.x,E.y]),points:E,index:C}}),radiusCommon:s}}function jhe(t,r){var e=r.attributes,n=e.positions.value,i=e.positions.getAccessor(),a=i.size,o=1/0,s=1/0,u=-1/0,l=-1/0,f;for(f=0;f<a*t.length;f+=a){var p=n[f],h=n[f+1],d=Number.isFinite(p)&&Number.isFinite(h);d&&(o=Math.min(p,o),u=Math.max(p,u),s=Math.min(h,s),l=Math.max(h,l))}return[o,s,u,l].every(Number.isFinite)?[(o+u)/2,(s+l)/2]:null}function Uhe(t,r,e){var n=r.getDistanceScales(e),i=n.unitsPerMeter;return t*i[0]}function AG(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function SG(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?AG(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):AG(Object(e)).forEac
4735h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function Ghe(t){var r=zhe();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function zhe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function TG(){}var Vhe={colorDomain:null,colorRange:sn,getColorValue:{type:"accessor",value:null},getColorWeight:{type:"accessor",value:1},colorAggregation:"SUM",lowerPercentile:{type:"number",value:0,min:0,max:100},upperPercentile:{type:"number",value:100,min:0,max:100},colorScaleType:"quantize",onSetColorDomain:TG,elevationDomain:null,elevationRange:[0,1e3],getElevationValue:{type:"accessor",value:null},getElevationWeight:{type:"accessor",value:1},elevationAggregation:"SUM",elevationLowerPercentile:{type:"number",value:0,min:0,max:100},elevationUpperPercentile:{type:"number",value:100,min:0,max:100},elevationScale:{type:"number",min:0,value:1},elevationScaleType:"linear",onSetElevationDomain:TG,radius:{type:"number",value:1e3,min:1},coverage:{type:"number",min:0,max:1,value:1},extruded:!1,hexagonAggregator:xG,getPosition:{type:"accessor",value:function(r){return r.position}},material:!0,_filterData:{type:"function",value:null,optional:!0}},gg=function(t){L(e,t);var r=Ghe(e);function e(){var n;A(this,e);for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return n=r.call.apply(r,[this].concat(a)),c(q(n),"state",void 0),n}return T(e,[{key:"initializeState",value:function(){var i=new _l({getAggregator:function(s){return s.hexagonAggregator},getCellSize:function(s){return s.radius}});this.state={cpuAggregator:i,aggregatorState:i.state,vertices:null};var a=this.getAttributeManager();a.add({positions:{size:3,type:5130,accessor:"getPosition"}})}},{key:"updateState",value:function(i){if(Z(S(e.prototype),"updateState",this).call(this,i),i.changeFlags.propsOrDataChanged){var a=this.state.cpuAggregator.updateState(i,{viewport:this.context.viewport,attributes:this.getAttributes()});if(this.state.aggregatorState.layerData!==a.layerData){var o=a.layerData||{},s=o.hexagonVertices;this.setState({vertices:s&&this.convertLatLngToMeterOffset(s)})}this.setState({aggregatorState:a})}}},{key:"convertLatLngToMeterOffset",value:function(i){var a=this.context.viewport;if(Array.isArray(i)&&i.length===6){var o=i[0],s=i[3],u=[(o[0]+s[0])/2,(o[1]+s[1])/2],l=a.projectFlat(u),f=a.getDistanceScales(u),p=f.metersPerUnit,h=i.map(function(d){var v=a.projectFlat(d);return[(v[0]-l[0])*p[0],(v[1]-l[1])*p[1]]});return h}return ne.error("HexagonLayer: hexagonVertices needs to be an array of 6 points")(),null}},{key:"getPickingInfo",value:function(i){var a=i.info;return this.state.cpuAggregator.getPickingInfo({info:a})}},{key:"_onGetSublayerColor",value:function(i){return this.state.cpuAggregator.getAccessor("fillColor")(i)}},{key:"_onGetSublayerElevation",value:function(i){return this.state.cpuAggregator.getAccessor("elevation")(i)}},{key:"_getSublayerUpdateTriggers",value:function(){return this.state.cpuAggregator.getUpdateTriggers(this.props)}},{key:"renderLayers",value:function(){var i=this.props,a=i.elevationScale,o=i.extruded,s=i.coverage,u=i.material,l=i.transitions,f=this.state,p=f.aggregatorState,h=f.vertices,d=this.getSubLayerClass("hexagon-cell",Kn),v=this._getSublayerUpdateTriggers(),m=h?{vertices:h,radius:1}:{radius:p.layerData.radiusCommon||1,radiusUnits:"common",angle:90};return new d(SG(SG({},m),{},{diskResolution:6,elevationScale:a,extruded:o,coverage:s,material:u,getFillColor:this._onGetSublayerColor.bind(this),getElevation:this._onGetSublayerElevation.bind(this),transitions:l&&{getFillColor:l.getColorValue||l.getColorWeight,getElevation:l.getElevationValue||l.getElevationWeight}}),this.getSubLayerProps({id:"hexagon-cell",updateTriggers:v}),{data:p.layerData.data})}}]),e}(Cn);c(gg,"layerName","HexagonLayer");c(gg,"defaultProps",Vhe);F();j();k();k();k();var he,pe=.5,_e=1/6,J={N:[0,pe],E:[pe,0],S:[0,-pe],W:[-pe,0],NE:[pe,pe],NW:[-pe,pe],SE:[pe,-pe],SW:[-pe,-pe]},xl=[J.W,J.SW,J.S],Al=[J.S,J.SE,J.E],Sl=[J.E,J.NE,J.N],Tl=[J.NW,J.W,J.N],wl=[[-pe,_e],[-pe,-_e],[-_e,-pe],[_e,-pe]],Pl=[[-_e,-pe],[_e,-pe],[pe,-_e],[pe,_e]],Ol=[[pe,-_e],[pe,_e],[_e,pe],[-_e,pe]],El=[[-pe,_e],[-pe,-_e],[_e,pe],[-_e,pe]],wG=[J.W,J.SW,J.SE,J.E],PG=[J.S,J.SE,J.NE,J.N],OG=[J.NW,J.W,J.E,J.NE],EG=[J.NW,J.SW,J.S,J.N],CG=[[-pe,_e],[-pe,-_e],[pe,-_e],[pe,_e]],MG=[[-_e,-pe],[_e,-pe],[_e,pe],[-_e,pe]],Hhe=[J.NW,J.SW,J.SE,J.NE],IG=[J.NW,J.SW,J.SE,J.E,J.N],RG=[J.W,J.SW,J.SE,J.NE,J.N],LG=[J.NW,J.W,J.S,J.SE,J.NE],kG=[J.NW,J.SW,J.S,J.E,J.NE],BG=[J.NW,J.W,[pe,-_e],[pe,_e],J.N],FG=[[-_e,-pe],[_e,-pe],J.E,J.NE,J.N],DG=[[-pe,_e],[-pe,-_e],J.S,J.SE,J.E],NG=[J.W,J.SW,J.S,[_e,pe],[-_e,pe]],jG=[J.NW,J.W,[-_e,-pe],[_e,-pe],J.N],UG=[[-pe,_e],[-pe,-_e],J.E,J.NE,J.N],GG=[J.S,J.SE,J.E,[_e,pe],[-_e,pe]],zG=[J.W,J.SW,J.S,[pe,-_e],[pe,_e]],VG=[J.W,J.SW,J.SE,J.E,[_e,pe],[-_e,pe]],HG=[[-pe,_e],[-pe,-_e],J.S,J.SE,J.NE,J.N],WG=[J.NW,J.W,[-_e,-pe],[_e,-pe],J.E,J.NE],$G=[J.NW,J.SW,J.S,[pe,-_e],[pe,_e],J.N],Cl=[J.W,J.SW,J.S,J.E,J.NE,J.N],Ml=[J.NW,J.W,J.S,J.SE,J.E,J.N],yg=[[-pe,_e],[-pe,-_e],[-_e,-pe],[_e,-pe],J.E,J.NE,J.N],_g=[J.W,J.SW,J.S,[pe,-_e],[pe,_e],[_e,pe],[-_e,pe]],bg=[J.NW,J.W,[-_e,-pe],[_e,-pe],[pe,-_e],[pe,_e],J.N],xg=[[-pe,_e],[-pe,-_e],J.S,J.SE,J.E,[_e,pe],[-_e,pe]],XG=[[-pe,_e],[-pe,-_e],[-_e,-pe],[_e,-pe],[pe,-_e],[pe,_e],[_e,pe],[-_e,pe]],qG={0:[],1:[[J.W,J.S]],2:[[J.S,J.E]],3:[[J.W,J.E]],4:[[J.N,J.E]],5:{0:[[J.W,J.S],[J.N,J.E]],1:[[J.W,J.N],[J.S,J.E]]},6:[[J.N,J.S]],7:[[J.W,J.N]],8:[[J.W,J.N]],9:[[J.N,J.S]],10:{0:[[J.W,J.N],[J.S,J.E]],1:[[J.W,J.S],[J.N,J.E]]},11:[[J.N,J.E]],12:[[J.W,J.E]],13:[[J.S,J.E]],14:[[J.W,J.S]],15:[]};function ve(t){return parseInt(t,4)}var YG=(he={}
4735,c(he,ve("0000"),[]),c(he,ve("2222"),[]),c(he,ve("2221"),[xl]),c(he,ve("2212"),[Al]),c(he,ve("2122"),[Sl]),c(he,ve("1222"),[Tl]),c(he,ve("0001"),[xl]),c(he,ve("0010"),[Al]),c(he,ve("0100"),[Sl]),c(he,ve("1000"),[Tl]),c(he,ve("2220"),[wl]),c(he,ve("2202"),[Pl]),c(he,ve("2022"),[Ol]),c(he,ve("0222"),[El]),c(he,ve("0002"),[wl]),c(he,ve("0020"),[Pl]),c(he,ve("0200"),[Ol]),c(he,ve("2000"),[El]),c(he,ve("0011"),[wG]),c(he,ve("0110"),[PG]),c(he,ve("1100"),[OG]),c(he,ve("1001"),[EG]),c(he,ve("2211"),[wG]),c(he,ve("2112"),[PG]),c(he,ve("1122"),[OG]),c(he,ve("1221"),[EG]),c(he,ve("2200"),[CG]),c(he,ve("2002"),[MG]),c(he,ve("0022"),[CG]),c(he,ve("0220"),[MG]),c(he,ve("1111"),[Hhe]),c(he,ve("1211"),[IG]),c(he,ve("2111"),[RG]),c(he,ve("1112"),[LG]),c(he,ve("1121"),[kG]),c(he,ve("1011"),[IG]),c(he,ve("0111"),[RG]),c(he,ve("1110"),[LG]),c(he,ve("1101"),[kG]),c(he,ve("1200"),[BG]),c(he,ve("0120"),[FG]),c(he,ve("0012"),[DG]),c(he,ve("2001"),[NG]),c(he,ve("1022"),[BG]),c(he,ve("2102"),[FG]),c(he,ve("2210"),[DG]),c(he,ve("0221"),[NG]),c(he,ve("1002"),[jG]),c(he,ve("2100"),[UG]),c(he,ve("0210"),[GG]),c(he,ve("0021"),[zG]),c(he,ve("1220"),[jG]),c(he,ve("0122"),[UG]),c(he,ve("2012"),[GG]),c(he,ve("2201"),[zG]),c(he,ve("0211"),[VG]),c(he,ve("2110"),[HG]),c(he,ve("1102"),[WG]),c(he,ve("1021"),[$G]),c(he,ve("2011"),[VG]),c(he,ve("0112"),[HG]),c(he,ve("1120"),[WG]),c(he,ve("1201"),[$G]),c(he,ve("2101"),[Cl]),c(he,ve("0121"),[Cl]),c(he,ve("1012"),[Ml]),c(he,ve("1210"),[Ml]),c(he,ve("0101"),{0:[xl,Sl],1:[Cl],2:[Cl]}),c(he,ve("1010"),{0:[Tl,Al],1:[Ml],2:[Ml]}),c(he,ve("2121"),{0:[Cl],1:[Cl],2:[xl,Sl]}),c(he,ve("1212"),{0:[Ml],1:[Ml],2:[Tl,Al]}),c(he,ve("2120"),{0:[yg],1:[yg],2:[wl,Sl]}),c(he,ve("2021"),{0:[_g],1:[_g],2:[xl,Ol]}),c(he,ve("1202"),{0:[bg],1:[bg],2:[Tl,Pl]}),c(he,ve("0212"),{0:[xg],1:[xg],2:[Al,El]}),c(he,ve("0102"),{0:[wl,Sl],1:[yg],2:[yg]}),c(he,ve("0201"),{0:[xl,Ol],1:[_g],2:[_g]}),c(he,ve("1020"),{0:[Tl,Pl],1:[bg],2:[bg]}),c(he,ve("2010"),{0:[Al,El],1:[xg],2:[xg]}),c(he,ve("2020"),{0:[El,Pl],1:[XG],2:[wl,Ol]}),c(he,ve("0202"),{0:[Ol,wl],1:[XG],2:[El,Pl]}
4735),he);function KG(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function ZG(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?KG(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):KG(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var ds={ISO_LINES:1,ISO_BANDS:2},Whe={zIndex:0,zOffset:.005};function rp(t,r){return Array.isArray(r)?t<r[0]?0:t<r[1]?1:2:t>=r?1:0}function JG(t){var r=t.cellWeights,e=t.x,n=t.y,i=t.width,a=t.height,o=t.threshold;t.thresholdValue&&(ne.deprecated("thresholdValue","threshold")(),o=t.thresholdValue);var s=e<0,u=e>=i-1,l=n<0,f=n>=a-1,p=s||u||l||f,h={},d={};s||f?d.top=0:(h.top=r[(n+1)*i+e],d.top=rp(h.top,o)),u||f?d.topRight=0:(h.topRight=r[(n+1)*i+e+1],d.topRight=rp(h.topRight,o)),u||l?d.right=0:(h.right=r[n*i+e+1],d.right=rp(h.right,o)),s||l?d.current=0:(h.current=r[n*i+e],d.current=rp(h.current,o));var v=d.top,m=d.topRight,g=d.right,y=d.current,_=-1;Number.isFinite(o)&&(_=v<<3|m<<2|g<<1|y),Array.isArray(o)&&(_=v<<6|m<<4|g<<2|y);var b=0;return p||(b=rp((h.top+h.topRight+h.right+h.current)/4,o)),{code:_,meanCode:b}}function JS(t){var r=t.gridOrigin,e=t.cellSize,n=t.x,i=t.y,a=t.code,o=t.meanCode,s=t.type,u=s===void 0?ds.ISO_LINES:s,l=ZG(ZG({},Whe),t.thresholdData),f=u===ds.ISO_BANDS?YG[a]:qG[a];Array.isArray(f)||(f=f[o]);var p=l.zIndex*l.zOffset,h=(n+1)*e[0],d=(i+1)*e[1],v=r[0]+h,m=r[1]+d;if(u===ds.ISO_BANDS){var g=[];return f.forEach(function(_){var b=[];_.forEach(function(x){var w=v+x[0]*e[0],P=m+x[1]*e[1];b.push([w,P,p])}),g.push(b)}),g}var y=[];return f.forEach(function(_){_.forEach(function(b){var x=v+b[0]*e[0],w=m+b[1]*e[1];y.push([x,w,p])})}),y}function QG(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=$he(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
4736In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function $he(t,r){if(t){if(typeof t=="string")return ez(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return ez(t,r)}}function ez(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function tz(t){var r=t.thresholdData,e=t.cellWeights,n=t.gridSize,i=t.gridOrigin,a=t.cellSize,o=[],s=[],u=n[0],l=n[1],f=0,p=0,h=QG(r),d;try{for(h.s();!(d=h.n()).done;)for(var v=d.value,m=v.contour,g=m.threshold,y=-1;y<u;y++)for(var _=-1;_<l;_++){var b=JG({cellWeights:e,threshold:g,x:y,y:_,width:u,height:l}),x=b.code,w=b.meanCode,P={type:ds.ISO_BANDS,gridOrigin:i,cellSize:a,x:y,y:_,width:u,height:l,code:x,meanCode:w,thresholdData:v};if(Array.isArray(g)){P.type=ds.ISO_BANDS;var E=JS(P),C=QG(E),I;try{for(C.s();!(I=C.n()).done;){var O=I.value;s[p++]={vertices:O,contour:m}}}catch(H){C.e(H)}finally{C.f()}}else{P.type=ds.ISO_LINES;for(var D=JS(P),N=0;N<D.length;N+=2)o[f++]={start:D[N],end:D[N+1],contour:m}}}}catch(H){h.e(H)}finally{h.f()}return{contourSegments:o,contourPolygons:s}}function Xhe(t){var r=qhe();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function qhe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var rz=[255,255,255,255],Yhe=1,Khe=1,Zhe={cellSize:{type:"number",min:1,max:1e3,value:1e3},getPosition:{type:"accessor",value:function(r){return r.position}},getWeight:{type:"accessor",value:1},gpuAggregation:!0,aggregation:"SUM",contours:{type:"object",value:[{threshold:Khe}],optional:!0,compare:3},zOffset:.005},nz="positions",Jhe={data:{props:["cellSize"]},weights:{props:["aggregation"],accessors:["getWeight"]}},Ag=function(t){L(e,t);var r=Xhe(e);function e(){return A(this,e),r.apply(this,arguments)}return T(e,[{key:"initializeState",value:function(){var i;Z(S(e.prototype),"initializeAggregationLayer",this).call(this,{dimensions:Jhe}),this.setState({contourData:{},projectPoints:!1,weights:{count:{size:1,operation:lt.SUM}}});var a=this.getAttributeManager();a.add((i={},c(i,nz,{size:3,accessor:"getPosition",type:5130,fp64:this.use64bitPositions()}),c(i,"count",{size:3,accessor:"getWeight"}),i))}},{key:"updateState",value:function(i){Z(S(e.prototype),"updateState",this).call(this,i);var a=!1,o=i.oldProps,s=i.props,u=this.state.aggregationDirty;(o.contours!==s.contours||o.zOffset!==s.zOffset)&&(a=!0,this._updateThresholdData(i.props)),this.getNumInstances()>0&&(u||a)&&this._generateContours()}},{key:"renderLayers",value:function(){var i=this.state.contourData,a=i.contourSegments,o=i.contourPolygons,s=this.getSubLayerClass("lines",wu),u=this.getSubLayerClass("bands",Jn),l=a&&a.length>0&&new s(this.getSubLayerProps({id:"lines"}),{data:this.state.contourData.contourSegments,getSourcePosition:function(h){return h.start},getTargetPosition:function(h){return h.end},getColor:function(h){return h.contour.color||rz},getWidth:function(h){return h.contour.strokeWidth||Yhe}}),f=o&&o.length>0&&new u(this.getSubLayerProps({id:"bands"}),{data:this.state.contourData.contourPolygons,getPolygon:function(h){return h.vertices},getFillColor:function(h){return h.contour.color||rz}});return[l,f]}},{key:"updateAggregationState",value:function(i){var a=i.props,o=i.oldProps,s=a.cellSize,u=a.coordinateSystem,l=this.context.viewport,f=o.cellSize!==s,p=a.gpuAggregation;this.state.gpuAggregation!==a.gpuAggregation&&p&&!lr.isSupported(this.context.gl)&&(ne.w
4736arn("GPU Grid Aggregation not supported, falling back to CPU")(),p=!1);var h=p!==this.state.gpuAggregation;this.setState({gpuAggregation:p});var d=this.state.dimensions,v=this.isAttributeChanged(nz),m=d.data,g=d.weights,y=this.state.boundingBox;if(v&&(y=dg(this.getAttributes(),this.getNumInstances()),this.setState({boundingBox:y})),v||f){var _=vg(y,s,l,u),b=_.gridOffset,x=_.translation,w=_.width,P=_.height,E=_.numCol,C=_.numRow;this.allocateResources(C,E),this.setState({gridOffset:b,boundingBox:y,translation:x,posOffset:x.slice(),gridOrigin:[-1*x[0],-1*x[1]],width:w,height:P,numCol:E,numRow:C})}var I=v||h||this.isAggregationDirty(i,{dimension:m,compareAll:p}),O=this.isAggregationDirty(i,{dimension:g});O&&this._updateAccessors(i),(I||O)&&this._resetResults(),this.setState({aggregationDataDirty:I,aggregationWeightsDirty:O})}},{key:"_updateAccessors",value:function(i){var a=i.props,o=a.getWeight,s=a.aggregation,u=a.data,l=this.state.weights.count;l&&(l.getWeight=o,l.operation=lt[s]),this.setState({getValue:hl(s,o,{data:u})})}},{key:"_resetResults",value:function(){var i=this.state.weights.count;i&&(i.aggregationData=null)}},{key:"_generateContours",value:function(){var i=this.state,a=i.numCol,o=i.numRow,s=i.gridOrigin,u=i.gridOffset,l=i.thresholdData,f=this.state.weights.count,p=f.aggregationData;p||(p=f.aggregationBuffer.getData(),f.aggregationData=p);var h=lr.getCellData({countsData:p}),d=h.cellWeights,v=tz({thresholdData:l,cellWeights:d,gridSize:[a,o],gridOrigin:s,cellSize:[u.xOffset,u.yOffset]});this.setState({contourData:v})}},{key:"_updateThresholdData",value:function(i){for(var a=i.contours,o=i.zOffset,s=a.length,u=new Array(s),l=0;l<s;l++){var f=a[l];u[l]={contour:f,zIndex:f.zIndex||l,zOffset:o}}this.setState({thresholdData:u})}}]),e}(ps);c(Ag,"layerName","ContourLayer");c(Ag,"defaultProps",Zhe);F();j();k();F();j();k();F();j();k();var iz=`#version 300 es
4737#define SHADER_NAME gpu-grid-cell-layer-vertex-shader
4738#define RANGE_COUNT 6
4739
4740in vec3 positions;
4741in vec3 normals;
4742
4743in vec4 colors;
4744in vec4 elevations;
4745in vec3 instancePickingColors;
4746uniform vec2 offset;
4747uniform bool extruded;
4748uniform float cellSize;
4749uniform float coverage;
4750uniform float opacity;
4751uniform float elevationScale;
4752
4753uniform ivec2 gridSize;
4754uniform vec2 gridOrigin;
4755uniform vec2 gridOriginLow;
4756uniform vec2 gridOffset;
4757uniform vec2 gridOffsetLow;
4758uniform vec4 colorRange[RANGE_COUNT];
4759uniform vec2 elevationRange;
4760uniform vec2 colorDomain;
4761uniform bool colorDomainValid;
4762uniform vec2 elevationDomain;
4763uniform bool elevationDomainValid;
4764
4765layout(std140) uniform;
4766uniform ColorData
4767{
4768  vec4 maxMinCount;
4769} colorData;
4770uniform ElevationData
4771{
4772  vec4 maxMinCount;
4773} elevationData;
4774
4775#define EPSILON 0.00001
4776out vec4 vColor;
4777
4778vec4 quantizeScale(vec2 domain, vec4 range[RANGE_COUNT], float value) {
4779  vec4 outColor = vec4(0., 0., 0., 0.);
4780  if (value >= (domain.x - EPSILON) && value <= (domain.y + EPSILON)) {
4781    float domainRange = domain.y - domain.x;
4782    if (domainRange <= 0.) {
4783      outColor = colorRange[0];
4784    } else {
4785      float rangeCount = float(RANGE_COUNT);
4786      float rangeStep = domainRange / rangeCount;
4787      float idx = floor((value - domain.x) / rangeStep);
4788      idx = clamp(idx, 0., rangeCount - 1.);
4789      int intIdx = int(idx);
4790      outColor = colorRange[intIdx];
4791    }
4792  }
4793  return outColor;
4794}
4795
4796float linearScale(vec2 domain, vec2 range, float value) {
4797  if (value >= (domain.x - EPSILON) && value <= (domain.y + EPSILON)) {
4798    return ((value - domain.x) / (domain.y - domain.x)) * (range.y - range.x) + range.x;
4799  }
4800  return -1.;
4801}
4802
4803void main(void) {
4804  vec2 clrDomain = colorDomainValid ? colorDomain : vec2(colorData.maxMinCount.a, colorData.maxMinCount.r);
4805  vec4 color = quantizeScale(clrDomain, colorRange, colors.r);
4806
4807  float elevation = 0.0;
4808
4809  if (extruded) {
4810    vec2 elvDomain = elevationDomainValid ? elevationDomain : vec2(elevationData.maxMinCount.a, elevationData.maxMinCount.r);
4811    elevation = linearScale(elvDomain, elevationRange, elevations.r);
4812    elevation = elevation  * (positions.z + 1.0) / 2.0 * elevationScale;
4813  }
4814  float shouldRender = float(color.r > 0.0 && elevations.r >= 0.0);
4815  float dotRadius = cellSize / 2. * coverage * shouldRender;
4816
4817  int yIndex = (gl_InstanceID / gridSize[0]);
4818  int xIndex = gl_InstanceID - (yIndex * gridSize[0]);
4819
4820  vec2 instancePositionXFP64 = mul_fp64(vec2(gridOffset[0], gridOffsetLow[0]), vec2(float(xIndex), 0.));
4821  instancePositionXFP64 = sum_fp64(instancePositionXFP64, vec2(gridOrigin[0], gridOriginLow[0]));
4822  vec2 instancePositionYFP64 = mul_fp64(vec2(gridOffset[1], gridOffsetLow[1]), vec2(float(yIndex), 0.));
4823  instancePositionYFP64 = sum_fp64(instancePositionYFP64, vec2(gridOrigin[1], gridOriginLow[1]));
4824
4825  vec3 centroidPosition = vec3(instancePositionXFP64[0], instancePositionYFP64[0], elevation);
4826  vec3 centroidPosition64Low = vec3(instancePositionXFP64[1], instancePositionYFP64[1], 0.0);
4827  geometry.worldPosition = centroidPosition;
4828  vec3 pos = vec3(project_size(positions.xy + offset) * dotRadius, 0.);
4829  picking_setPickingColor(instancePickingColors);
4830
4831  gl_Position = project_position_to_clipspace(centroidPosition, centroidPosition64Low, pos, geometry.position);
4832
4833  vec3 normals_commonspace = project_normal(normals);
4834
4835   if (extruded) {
4836    vec3 lightColor = lighting_getLightColor(color.rgb, project_uCameraPosition, geometry.position.xyz, normals_commonspace);
4837    vColor = vec4(lightColor, color.a * opacity) / 255.;
4838  } else {
4839    vColor = vec4(color.rgb, color.a * opacity) / 255.;
4840  }
4841}
4842`;var az=`#version 300 es
4843#define SHADER_NAME gpu-grid-cell-layer-fragment-shader
4844
4845precision highp float;
4846
4847in vec4 vColor;
4848
4849out vec4 fragColor;
4850
4851void main(void) {
4852  fragColor = vColor;
4853  fragColor = picking_filterColor(fragColor);
4854}
4855`;function oz(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function sz(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};
4855r%2?oz(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):oz(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function Qhe(t){var r=ede();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function ede(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var QS=0,eT=1,tde={colorDomain:null,colorRange:sn,elevationDomain:null,elevationRange:[0,1e3],elevationScale:{type:"number",min:0,value:1},gridSize:{type:"array",value:[1,1]},gridOrigin:{type:"array",value:[0,0]},gridOffset:{type:"array",value:[0,0]},cellSize:{type:"number",min:0,max:1e3,value:1e3},offset:{type:"array",value:[1,1]},coverage:{type:"number",min:0,max:1,value:1},extruded:!0,material:!0},Sg=function(t){L(e,t);var r=Qhe(e);function e(){return A(this,e),r.apply(this,arguments)}return T(e,[{key:"getShaders",value:function(){return Z(S(e.prototype),"getShaders",this).call(this,{vs:iz,fs:az,modules:[qe,Dr,rt,yo]})}},{key:"initializeState",value:function(i){var a=i.gl,o=this.getAttributeManager();o.addInstanced({colors:{size:4,noAlloc:!0},elevations:{size:4,noAlloc:!0}});var s=this._getModel(a);this._setupUniformBuffer(s),this.setState({model:s})}},{key:"_getModel",value:function(i){return new Ie(i,sz(sz({},this.getShaders()),{},{id:this.props.id,geometry:new va,isInstanced:!0}))}},{key:"draw",value:function(i){var a=i.uniforms,o=this.props,s=o.cellSize,u=o.offset,l=o.extruded,f=o.elevationScale,p=o.coverage,h=o.gridSize,d=o.gridOrigin,v=o.gridOffset,m=o.elevationRange,g=o.colorMaxMinBuffer,y=o.elevationMaxMinBuffer,_=[An(d[0]),An(d[1])],b=[An(v[0]),An(v[1])],x=this.getDomainUniforms(),w=Wa(this.props.colorRange);this.bindUniformBuffers(g,y),this.state.model.setUniforms(a).setUniforms(x).setUniforms({cellSize:s,offset:u,extruded:l,elevationScale:f,coverage:p,gridSize:h,gridOrigin:d,gridOriginLow:_,gridOffset:v,gridOffsetLow:b,colorRange:w,elevationRange:m}).draw(),this.unbindUniformBuffers(g,y)}},{key:"bindUniformBuffers",value:function(i,a){i.bind({target:35345,index:QS}),a.bind({target:35345,index:eT})}},{key:"unbindUniformBuffers",value:function(i,a){i.unbind({target:35345,index:QS}),a.unbind({target:35345,index:eT})}},{key:"getDomainUniforms",value:function(){var i=this.props,a=i.colorDomain,o=i.elevationDomain,s={};return a!==null?(s.colorDomainValid=!0,s.colorDomain=a):s.colorDomainValid=!1,o!==null?(s.elevationDomainValid=!0,s.elevationDomain=o):s.elevationDomainValid=!1,s}},{key:"_setupUniformBuffer",value:function(i){var a=this.context.gl,o=i.program.handle,s=a.getUniformBlockIndex(o,"ColorData"),u=a.getUniformBlockIndex(o,"ElevationData");a.uniformBlockBinding(o,s,QS),a.uniformBlockBinding(o,u,eT)}}]),e}(He);c(Sg,"layerName","GPUGridCellLayer");c(Sg,"defaultProps",tde);function uz(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function lz(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?uz(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):uz(Object(e)).forEac
4855h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function rde(t){var r=nde();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function nde(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var ide={colorDomain:null,colorRange:sn,getColorWeight:{type:"accessor",value:1},colorAggregation:"SUM",elevationDomain:null,elevationRange:[0,1e3],getElevationWeight:{type:"accessor",value:1},elevationAggregation:"SUM",elevationScale:{type:"number",min:0,value:1},cellSize:{type:"number",min:1,max:1e3,value:1e3},coverage:{type:"number",min:0,max:1,value:1},getPosition:{type:"accessor",value:function(r){return r.position}},extruded:!1,material:!0},ade={data:{props:["cellSize","colorAggregation","elevationAggregation"]}},fz="positions",vs=function(t){L(e,t);var r=rde(e);function e(){return A(this,e),r.apply(this,arguments)}return T(e,[{key:"initializeState",value:function(i){var a,o=i.gl,s=lr.isSupported(o);s||ne.error("GPUGridLayer is not supported on this browser, use GridLayer instead")(),Z(S(e.prototype),"initializeAggregationLayer",this).call(this,{dimensions:ade}),this.setState({gpuAggregation:!0,projectPoints:!1,isSupported:s,weights:{color:{needMin:!0,needMax:!0,combineMaxMin:!0,maxMinBuffer:new Pe(o,{byteLength:4*4,accessor:{size:4,type:5126,divisor:1}})},elevation:{needMin:!0,needMax:!0,combineMaxMin:!0,maxMinBuffer:new Pe(o,{byteLength:4*4,accessor:{size:4,type:5126,divisor:1}})}},positionAttributeName:"positions"});var u=this.getAttributeManager();u.add((a={},c(a,fz,{size:3,accessor:"getPosition",type:5130,fp64:this.use64bitPositions()}),c(a,"color",{size:3,accessor:"getColorWeight"}),c(a,"elevation",{size:3,accessor:"getElevationWeight"}),a))}},{key:"updateState",value:function(i){if(this.state.isSupported!==!1){Z(S(e.prototype),"updateState",this).call(this,i);var a=this.state.aggregationDirty;a&&this.setState({gridHash:null})}}},{key:"getHashKeyForIndex",value:function(i){var a=this.state,o=a.numRow,s=a.numCol,u=a.boundingBox,l=a.gridOffset,f=[s,o],p=[u.xMin,u.yMin],h=[l.xOffset,l.yOffset],d=Math.floor(i/f[0]),v=i-d*f[0],m=Math.floor((d*h[1]+p[1]+90+h[1]/2)/h[1]),g=Math.floor((v*h[0]+p[0]+180+h[0]/2)/h[0]);return"".concat(m,"-").concat(g)}},{key:"getPositionForIndex",value:function(i){var a=this.state,o=a.numRow,s=a.numCol,u=a.boundingBox,l=a.gridOffset,f=[s,o],p=[u.xMin,u.yMin],h=[l.xOffset,l.yOffset],d=Math.floor(i/f[0]),v=i-d*f[0],m=d*h[1]+p[1],g=v*h[0]+p[0];return[g,m]}},{key:"getPickingInfo",value:function(i){var a=i.info,o=i.mode,s=a.index,u=null;if(s>=0){var l=this.state.gpuGridAggregator,f=this.getPositionForIndex(s),p=lr.getAggregationData(lz({pixelIndex:s},l.getData("color"))),h=lr.getAggregationData(lz({pixelIndex:s},l.getData("elevation")));if(u={colorValue:p.cellWeight,elevationValue:h.cellWeight,count:p.cellCount||h.cellCount,position:f,totalCount:p.totalCount||h.totalCount},o!=="hover"){var d=this.props,v=this.state.gridHash;if(!v){var m=this.state,g=m.gridOffset,y=m.translation,_=m.boundingBox,b=this.context.viewport,x=this.getAttributes(),w=yl(d,{gridOffset:g,attributes:x,viewport:b,translation:y,boundingBox:_});v=w.gridHash,this.setState({gridHash:v})}var P=this.getHashKeyForIndex(s),E=v[P];Object.assign(u,E)}}return a.picked=Boolean(u),a.object=u,a}},{key:"renderLayers",value:function(){if(!this.state.isSupported)return null;var i=this.props,a=i.elevationScale,o=i.extruded,s=i.cellSize,u=i.coverage,l=i.material,f=i.elevationRange,p=i.colorDomain,h=i.elevationDomain,d=this.state,v=d.weights,m=d.numRow,g=d.numCol,y=d.gridOrigin,_=d.gridOffset,b=v.color,x=v.elevation,w=Wa(this.props.colorRange),P=this.getSubLayerClass("gpu-grid-cell",Sg);return new P({gridSize:[g,m],gridOrigin:y,gridOffset:[_.xOffset,_.yOffset],colorRange:w,elevationRange:f,colorDomain:p,elevationDomain:h,cellSize:s,coverage:u,material:l,elevationScale:a,extruded:o}
4855,this.getSubLayerProps({id:"gpu-grid-cell"}),{data:{attributes:{colors:b.aggregationBuffer,elevations:x.aggregationBuffer}},colorMaxMinBuffer:b.maxMinBuffer,elevationMaxMinBuffer:x.maxMinBuffer,numInstances:g*m})}},{key:"finalizeState",value:function(i){var a=this.state.weights,o=a.color,s=a.elevation;[o,s].forEach(function(u){var l=u.aggregationBuffer,f=u.maxMinBuffer;f.delete(),l?.delete()}),Z(S(e.prototype),"finalizeState",this).call(this,i)}},{key:"updateAggregationState",value:function(i){var a=i.props,o=i.oldProps,s=a.cellSize,u=a.coordinateSystem,l=this.context.viewport,f=o.cellSize!==s,p=this.state.dimensions,h=this.isAttributeChanged(fz),d=h||this.isAttributeChanged(),v=this.state.boundingBox;if(h&&(v=dg(this.getAttributes(),this.getNumInstances()),this.setState({boundingBox:v})),h||f){var m=vg(v,s,l,u),g=m.gridOffset,y=m.translation,_=m.width,b=m.height,x=m.numCol,w=m.numRow;this.allocateResources(w,x),this.setState({gridOffset:g,translation:y,gridOrigin:[-1*y[0],-1*y[1]],width:_,height:b,numCol:x,numRow:w})}var P=d||this.isAggregationDirty(i,{dimension:p.data,compareAll:!0});P&&this._updateAccessors(i),this.setState({aggregationDataDirty:P})}},{key:"_updateAccessors",value:function(i){var a=i.props,o=a.colorAggregation,s=a.elevationAggregation,u=this.state.weights,l=u.color,f=u.elevation;l.operation=lt[o],f.operation=lt[s]}}]),e}(ps);c(vs,"layerName","GPUGridLayer");c(vs,"defaultProps",ide);function ode(t){var r=sde();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function sde(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function cz(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function tT(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?cz(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):cz(Object(e)).forEac
4855h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var ude=tT(tT(tT({},vs.defaultProps),hs.defaultProps),{},{gpuAggregation:!1}),Tg=function(t){L(e,t);var r=ode(e);function e(){var n;A(this,e);for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return n=r.call.apply(r,[this].concat(a)),c(q(n),"state",void 0),n}return T(e,[{key:"initializeState",value:function(){this.state={useGPUAggregation:!0}}},{key:"updateState",value:function(i){var a=i.props;this.setState({useGPUAggregation:this.canUseGPUAggregation(a)})}},{key:"renderLayers",value:function(){var i=this.props,a=i.data,o=i.updateTriggers,s=this.state.useGPUAggregation?"GPU":"CPU",u=this.state.useGPUAggregation?this.getSubLayerClass("GPU",vs):this.getSubLayerClass("CPU",hs);return new u(this.props,this.getSubLayerProps({id:s,updateTriggers:o}),{data:a})}},{key:"canUseGPUAggregation",value:function(i){var a=i.gpuAggregation,o=i.lowerPercentile,s=i.upperPercentile,u=i.getColorValue,l=i.getElevationValue,f=i.colorScaleType;return!(!a||!lr.isSupported(this.context.gl)||o!==0||s!==100||u!==null||l!==null||f==="quantile"||f==="ordinal")}}]),e}(gt);c(Tg,"layerName","GridLayer");c(Tg,"defaultProps",ude);be();F();j();k();be();function lde(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=fde(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
4856In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function fde(t,r){if(t){if(typeof t=="string")return pz(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return pz(t,r)}}function pz(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function dz(t){var r=t.map(function(s){return s[0]}),e=t.map(function(s){return s[1]}),n=Math.min.apply(null,r),i=Math.max.apply(null,r),a=Math.min.apply(null,e),o=Math.max.apply(null,e);return[n,a,i,o]}function vz(t,r){return r[0]>=t[0]&&r[2]<=t[2]&&r[1]>=t[1]&&r[3]<=t[3]}var hz=new Float32Array(12);function rT(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2,e=0,n=lde(t),i;try{for(n.s();!(i=n.n()).done;)for(var a=i.value,o=0;o<r;o++)hz[e++]=a[o]||0}catch(s){n.e(s)}finally{n.f()}return hz}function mz(t,r,e){var n=W(t,4),i=n[0],a=n[1],o=n[2],s=n[3],u=o-i,l=s-a,f=u,p=l;u/l<r/e?f=r/e*l:p=e/r*u,f<r&&(f=r,p=e);var h=(o+i)/2,d=(s+a)/2;return[h-f/2,d-p/2,h+f/2,d+p/2]}function gz(t,r){var e=W(r,4),n=e[0],i=e[1],a=e[2],o=e[3];return[(t[0]-n)/(a-n),(t[1]-i)/(o-i)]}function yz(t){var r=t.gl,e=t.floatTargetSupport;return e?{format:ge(r)?34836:6408,type:5126}:{format:6408,type:5121}}F();j();k();var _z=`#define SHADER_NAME heatp-map-layer-vertex-shader
4857
4858uniform sampler2D maxTexture;
4859uniform float intensity;
4860uniform vec2 colorDomain;
4861uniform float threshold;
4862uniform float aggregationMode;
4863
4864attribute vec3 positions;
4865attribute vec2 texCoords;
4866
4867varying vec2 vTexCoords;
4868varying float vIntensityMin;
4869varying float vIntensityMax;
4870
4871void main(void) {
4872  gl_Position = project_position_to_clipspace(positions, vec3(0.0), vec3(0.0));
4873  vTexCoords = texCoords;
4874  vec4 maxTexture = texture2D(maxTexture, vec2(0.5));
4875  float maxValue = aggregationMode < 0.5 ? maxTexture.r : maxTexture.g;
4876  float minValue = maxValue * threshold;
4877  if (colorDomain[1] > 0.) {
4878    maxValue = colorDomain[1];
4879    minValue = colorDomain[0];
4880  }
4881  vIntensityMax = intensity / maxValue;
4882  vIntensityMin = intensity / minValue;
4883}
4884`;var bz=`#define SHADER_NAME triangle-layer-fragment-shader
4885
4886precision highp float;
4887
4888uniform float opacity;
4889uniform sampler2D texture;
4890uniform sampler2D colorTexture;
4891uniform float aggregationMode;
4892
4893varying vec2 vTexCoords;
4894varying float vIntensityMin;
4895varying float vIntensityMax;
4896
4897vec4 getLinearColor(float value) {
4898  float factor = clamp(value * vIntensityMax, 0., 1.);
4899  vec4 color = texture2D(colorTexture, vec2(factor, 0.5));
4900  color.a *= min(value * vIntensityMin, 1.0);
4901  return color;
4902}
4903
4904void main(void) {
4905  vec4 weights = texture2D(texture, vTexCoords);
4906  float weight = weights.r;
4907
4908  if (aggregationMode > 0.5) {
4909    weight /= max(1.0, weights.a);
4910  }
4911  if (weight <= 0.) {
4912     discard;
4913  }
4914
4915  vec4 linearColor = getLinearColor(weight);
4916  linearColor.a *= opacity;
4917  gl_FragColor =linearColor;
4918}
4919`;function xz(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function wg(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};
4919r%2?xz(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):xz(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function cde(t){var r=pde();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function pde(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var nT=function(t){L(e,t);var r=cde(e);function e(){return A(this,e),r.apply(this,arguments)}return T(e,[{key:"getShaders",value:function(){return{vs:_z,fs:bz,modules:[qe]}}},{key:"initializeState",value:function(i){var a=i.gl,o=this.getAttributeManager();o.add({positions:{size:3,noAlloc:!0},texCoords:{size:2,noAlloc:!0}}),this.setState({model:this._getModel(a)})}},{key:"_getModel",value:function(i){var a=this.props.vertexCount;return new Ie(i,wg(wg({},this.getShaders()),{},{id:this.props.id,geometry:new Re({drawMode:6,vertexCount:a})}))}},{key:"draw",value:function(i){var a=i.uniforms,o=this.state.model,s=this.props,u=s.texture,l=s.maxTexture,f=s.colorTexture,p=s.intensity,h=s.threshold,d=s.aggregationMode,v=s.colorDomain;o.setUniforms(wg(wg({},a),{},{texture:u,maxTexture:l,colorTexture:f,intensity:p,threshold:h,aggregationMode:d,colorDomain:v})).draw()}}]),e}(He);c(nT,"layerName","TriangleLayer");var Az=`attribute vec3 positions;
4920attribute vec3 positions64Low;
4921attribute float weights;
4922varying vec4 weightsTexture;
4923uniform float radiusPixels;
4924uniform float textureWidth;
4925uniform vec4 commonBounds;
4926uniform float weightsScale;
4927void main()
4928{
4929  weightsTexture = vec4(weights * weightsScale, 0., 0., 1.);
4930
4931  float radiusTexels  = project_pixel_size(radiusPixels) * textureWidth / (commonBounds.z - commonBounds.x);
4932  gl_PointSize = radiusTexels * 2.;
4933
4934  vec3 commonPosition = project_position(positions, positions64Low);
4935  gl_Position.xy = (commonPosition.xy - commonBounds.xy) / (commonBounds.zw - commonBounds.xy) ;
4936  gl_Position.xy = (gl_Position.xy * 2.) - (1.);
4937}
4938`;var Sz=`varying vec4 weightsTexture;
4939float gaussianKDE(float u){
4940  return pow(2.71828, -u*u/0.05555)/(1.77245385*0.166666);
4941}
4942void main()
4943{
4944  float dist = length(gl_PointCoord - vec2(0.5, 0.5));
4945  if (dist > 0.5) {
4946    discard;
4947  }
4948  gl_FragColor = weightsTexture * gaussianKDE(2. * dist);
4949  DECKGL_FILTER_COLOR(gl_FragColor, geometry);
4950}
4951`;var Tz=`attribute vec4 inTexture;
4952varying vec4 outTexture;
4953
4954void main()
4955{
4956outTexture = inTexture;
4957gl_Position = vec4(0, 0, 0, 1.);
4958gl_PointSize = 1.0;
4959}
4960`;var wz=`varying vec4 outTexture;
4961void main() {
4962  gl_FragColor = outTexture;
4963  gl_FragColor.g = outTexture.r / max(1.0, outTexture.a);
4964}
4965`;var Il;function Pz(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function Rl(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?Pz(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Pz(Object(e)).forEac
4965h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function hde(t){var r=dde();return function(){var n=S(t),i;if(r){var a=S(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return B(this,i)}}function dde(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var vde=2,iT={mipmaps:!1,parameters:(Il={},c(Il,10240,9729),c(Il,10241,9729),c(Il,10242,33071),c(Il,10243,33071),Il),dataFormat:6408},Oz=[0,0],mde={SUM:0,MEAN:1},gde={getPosition:{type:"accessor",value:function(r){return r.position}},getWeight:{type:"accessor",value:1},intensity:{type:"number",min:0,value:1},radiusPixels:{type:"number",min:1,max:100,value:50},colorRange:sn,threshold:{type:"number",min:0,max:1,value:.05},colorDomain:{type:"array",value:null,optional:!0},aggregation:"SUM",weightsTextureSize:{type:"number",min:128,max:2048,value:2048},debounceTimeout:{type:"number",min:0,max:1e3,value:500}},yde=[Ee.BLEND_EQUATION_MINMAX,Ee.TEXTURE_FLOAT],_de=[Ee.COLOR_ATTACHMENT_RGBA32F,Ee.FLOAT_BLEND],bde={data:{props:["radiusPixels"]}},Pg=function(t){L(e,t);var r=hde(e);function e(){var n;A(this,e);for(var i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return n=r.call.apply(r,[this].concat(a)),c(q(n),"state",void 0),n}return T(e,[{key:"initializeState",value:function(){var i=this.context.gl;if(!qt(i,yde)){this.setState({supported:!1}),ne.error("HeatmapLayer: ".concat(this.id," is not supported on this browser"))();return}Z(S(e.prototype),"initializeAggregationLayer",this).call(this,bde),this.setState({supported:!0,colorDomain:Oz}),this._setupTextureParams(),this._setupAttributes(),this._setupResources()}},{key:"shouldUpdateState",value:function(i){var a=i.changeFlags;return a.somethingChanged}},{key:"updateState",value:function(i){this.state.supported&&(Z(S(e.prototype),"updateState",this).call(this,i),this._updateHeatmapState(i))}},{key:"_updateHeatmapState",value:function(i){var a=i.props,o=i.oldProps,s=this._getChangeFlags(i);(s.dataChanged||s.viewportChanged)&&(s.boundsChanged=this._updateBounds(s.dataChanged),this._updateTextureRenderingBounds()),s.dataChanged||s.boundsChanged?(clearTimeout(this.state.updateTimer),this.setState({isWeightMapDirty:!0})):s.viewportZoomChanged&&this._debouncedUpdateWeightmap(),a.colorRange!==o.colorRange&&this._updateColorTexture(i),this.state.isWeightMapDirty&&this._updateWeightmap(),this.setState({zoom:i.context.viewport.zoom})}},{key:"renderLayers",value:function(){if(!this.state.supported)return[];var i=this.state,a=i.weightsTexture,o=i.triPositionBuffer,s=i.triTexCoordBuffer,u=i.maxWeightsTexture,l=i.colorTexture,f=i.colorDomain,p=this.props,h=p.updateTriggers,d=p.intensity,v=p.threshold,m=p.aggregation,g=this.getSubLayerClass("triangle",nT);return new g(this.getSubLayerProps({id:"triangle-layer",updateTriggers:h}),{coordinateSystem:de.DEFAULT,data:{attributes:{positions:o,texCoords:s}},vertexCount:4,maxTexture:u,colorTexture:l,aggregationMode:mde[m]||0,texture:a,intensity:d,threshold:v,colorDomain:f})}},{key:"finalizeState",value:function(i){Z(S(e.prototype),"finalizeState",this).call(this,i);var a=this.state,o=a.weightsTransform,s=a.weightsTexture,u=a.maxWeightTransform,l=a.maxWeightsTexture,f=a.triPositionBuffer,p=a.triTexCoordBuffer,h=a.colorTexture,d=a.updateTimer;o?.delete(),s?.delete(),u?.delete(),l?.delete(),f?.delete(),p?.delete(),h?.delete(),d&&clearTimeout(d)}},{key:"_getAttributeManager",value:function(){return new Sa(this.context.gl,{id:this.props.id,stats:this.context.stats})}},{key:"_getChangeFlags",value:function(i){var a={},o=this.state.dimensions;a.dataChanged=this.isAttributeChanged()||this.isAggregationDirty(i,{compareAll:!0,dimension:o.data}),a.viewportChanged=i.changeFlags.viewportChanged;var s=this.state.zoom;return(!i.context.viewport||i.context.viewport.zoom!==s)&&(a.viewportZoomChanged=!0),a}},{key:"_createTextures",value:function(){var i=this.context.gl,a=this.state,o=a.textureSize,s=a.format,u=a.type;this.setState({weightsTexture:new Ce(i,Rl({width:o,height:o,format:s,type:u},iT)),maxWeightsTexture:new Ce(i,Rl({format:s,type:u},iT))})}},{key:"_setupAttributes",value:function(){var i=this.getAttributeManager();i.add({positions:{size:3,type:5130,accessor:"getPosition"},weights:{size:1,accessor:"getWeight"}}),this.setState({positionAttributeName:"positions"})}}
4965,{key:"_setupTextureParams",value:function(){var i=this.context.gl,a=this.props.weightsTextureSize,o=Math.min(a,Un(i,3379)),s=qt(i,_de),u=yz({gl:i,floatTargetSupport:s}),l=u.format,f=u.type,p=s?1:1/255;this.setState({textureSize:o,format:l,type:f,weightsScale:p}),s||ne.warn("HeatmapLayer: ".concat(this.id," rendering to float texture not supported, fallingback to low precession format"))()}},{key:"getShaders",value:function(i){return Z(S(e.prototype),"getShaders",this).call(this,i==="max-weights-transform"?{vs:Tz,_fs:wz}:{vs:Az,_fs:Sz})}},{key:"_createWeightsTransform",value:function(){var i,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=this.context.gl,s=this.state.weightsTransform,u=this.state.weightsTexture;(i=s)===null||i===void 0||i.delete(),s=new mr(o,Rl({id:"".concat(this.id,"-weights-transform"),elementCount:1,_targetTexture:u,_targetTextureVarying:"weightsTexture"},a)),this.setState({weightsTransform:s})}},{key:"_setupResources",value:function(){var i=this.context.gl;this._createTextures();var a=this.state,o=a.textureSize,s=a.weightsTexture,u=a.maxWeightsTexture,l=this.getShaders("weights-transform");this._createWeightsTransform(l);var f=this.getShaders("max-weights-transform"),p=new mr(i,Rl(Rl({id:"".concat(this.id,"-max-weights-transform"),_sourceTextures:{inTexture:s},_targetTexture:u,_targetTextureVarying:"outTexture"},f),{},{elementCount:o*o}));this.setState({weightsTexture:s,maxWeightsTexture:u,maxWeightTransform:p,zoom:null,triPositionBuffer:new Pe(i,{byteLength:48,accessor:{size:3}}),triTexCoordBuffer:new Pe(i,{byteLength:48,accessor:{size:2}})})}},{key:"updateShaders",value:function(i){this._createWeightsTransform(i)}},{key:"_updateMaxWeightValue",value:function(){var i=this.state.maxWeightTransform;i.run({parameters:{blend:!0,depthTest:!1,blendFunc:[1,1],blendEquation:32776}})}},{key:"_updateBounds",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,a=this.context.viewport,o=[a.unproject([0,0]),a.unproject([a.width,0]),a.unproject([a.width,a.height]),a.unproject([0,a.height])].map(function(d){return d.map(Math.fround)}),s=dz(o),u={visibleWorldBounds:s,viewportCorners:o},l=!1;if(i||!this.state.worldBounds||!vz(this.state.worldBounds,s)){var f=this._worldToCommonBounds(s),p=this._commonToWorldBounds(f);this.props.coordinateSystem===de.LNGLAT&&(p[1]=Math.max(p[1],-85.051129),p[3]=Math.min(p[3],85.051129),p[0]=Math.max(p[0],-360),p[2]=Math.min(p[2],360));var h=this._worldToCommonBounds(p);u.worldBounds=p,u.normalizedCommonBounds=h,l=!0}return this.setState(u),l}},{key:"_updateTextureRenderingBounds",value:function(){var i=this.state,a=i.triPositionBuffer,o=i.triTexCoordBuffer,s=i.normalizedCommonBounds,u=i.viewportCorners,l=this.context.viewport;a.subData(rT(u,3));var f=u.map(function(p){return gz(l.projectPosition(p),s)});o.subData(rT(f,2))}},{key:"_updateColorTexture",value:function(i){var a=i.props.colorRange,o=this.state.colorTexture,s=Wa(a,!1,Uint8Array);o?o.setImageData({data:s,width:a.length}):o=new Ce(this.context.gl,Rl({data:s,width:a.length,height:1},iT)),this.setState({colorTexture:o})}},{key:"_updateWeightmap",value:function(){var i=this,a,o=this.props,s=o.radiusPixels,u=o.colorDomain,l=o.aggregation,f=this.state,p=f.weightsTransform,h=f.worldBounds,d=f.textureSize,v=f.weightsTexture,m=f.weightsScale;this.state.isWeightMapDirty=!1;var g=this._worldToCommonBounds(h,{useLayerCoordinateSystem:!0});if(u&&l==="SUM"){var y=this.context.viewport,_=y.distanceScales.metersPerUnit[2]*(g[2]-g[0])/d;this.state.colorDomain=u.map(function(x){return x*_*m})}else this.state.colorDomain=u||Oz;var b={radiusPixels:s,commonBounds:g,textureWidth:d,weightsScale:m};p.update({elementCount:this.getNumInstances()}),ke(this.context.gl,{clearColor:[0,0,0,0]},function(){p.run({uniforms:b,parameters:{blend:!0,depthTest:!1,blendFunc:[1,1],blendEquation:32774},clearRenderTarget:!0,attributes:i.getAttributes(),moduleSettings:i.getModuleSettings()})}),this._updateMaxWeightValue(),v.setParameters((a={},c(a,10240,9729),c(a,10241,9729),a))}},{key:"_debouncedUpdateWeightmap",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,a=this.state.updateTimer,o=this.props.debounceTimeout;i?(a=null,this._updateBounds(!0),this._updateTextureRenderingBounds(),this.setState({isWeightMapDirt
4965y:!0})):(this.setState({isWeightMapDirty:!1}),clearTimeout(a),a=setTimeout(this._debouncedUpdateWeightmap.bind(this,!0),o)),this.setState({updateTimer:a})}},{key:"_worldToCommonBounds",value:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=a.useLayerCoordinateSystem,s=o===void 0?!1:o,u=W(i,4),l=u[0],f=u[1],p=u[2],h=u[3],d=this.context.viewport,v=this.state.textureSize,m=this.props.coordinateSystem,g=s&&(m===de.LNGLAT_OFFSETS||m===de.METER_OFFSETS),y=g?d.projectPosition(this.props.coordinateOrigin):[0,0],_=v*vde/d.scale,b,x;return s&&!g?(b=this.projectPosition([l,f,0]),x=this.projectPosition([p,h,0])):(b=d.projectPosition([l,f,0]),x=d.projectPosition([p,h,0])),mz([b[0]-y[0],b[1]-y[1],x[0]-y[0],x[1]-y[1]],_,_)}},{key:"_commonToWorldBounds",value:function(i){var a=W(i,4),o=a[0],s=a[1],u=a[2],l=a[3],f=this.context.viewport,p=f.unprojectPosition([o,s]),h=f.unprojectPosition([u,l]);return p.slice(0,2).concat(h.slice(0,2))}}]),e}(Cn);c(Pg,"layerName","HeatmapLayer");c(Pg,"defaultProps",gde);F();j();k();k();function Ez(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function Cz(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?Ez(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Ez(Object(e)).forEac
4965h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var aT=85.05113;function sT(t,r,e,n){if(e){if(e.userData._googleMap===t)return e;Og(e)}var i={click:null,rightclick:null,dblclick:null,mousemove:null,mouseout:null},a=new Nr(Cz(Cz({},n),{},{useDevicePixels:n.interleaved?!0:n.useDevicePixels,style:n.interleaved?null:{pointerEvents:"none"},parent:xde(r,n.style),initialViewState:{longitude:0,latitude:0,zoom:1},controller:!1})),o=function(l){i[l]=t.addListener(l,function(f){return Sde(a,l,f)})};for(var s in i)o(s);return a.userData._googleMap=t,a.userData._eventListeners=i,a}function xde(t,r){var e=document.createElement("div");if(e.style.position="absolute",Object.assign(e.style,r),"getPanes"in t){var n;(n=t.getPanes())===null||n===void 0||n.overlayLayer.appendChild(e)}else{var i;(i=t.getMap())===null||i===void 0||i.getDiv().appendChild(e)}return e}function Og(t){var r=t.userData._eventListeners;for(var e in r)r[e]&&r[e].remove();t.finalize()}function Mz(t,r){var e=Iz(t),n=e.width,i=e.height,a=r.getProjection(),o=t.getBounds();if(!o)return{width:n,height:i,left:0,top:0};
4965var s=o.getNorthEast(),u=o.getSouthWest(),l=a.fromLatLngToDivPixel(s),f=a.fromLatLngToDivPixel(u),p=oT(a,n/2,i/2),h=new google.maps.LatLng(0,p[0]),d=a.fromLatLngToContainerPixel(h),v=a.fromLatLngToDivPixel(h);if(!l||!f||!v||!d)return{width:n,height:i,left:0,top:0};var m=Math.round(v.x-d.x),g=v.y-d.y,y=oT(a,n/2,0),_=oT(a,n/2,i),b=p[1],x=p[0];if(Math.abs(b)>aT){b=b>0?aT:-aT;var w=new google.maps.LatLng(b,x),P=a.fromLatLngToContainerPixel(w);g+=P.y-i/2}g=Math.round(g);var E=new _n(y).sub(_),C=180*E.verticalAngle()/Math.PI;C<0&&(C+=360);var I=t.getHeading()||0,O=t.getZoom()-1,D;if(C===0)D=i?(f.y-l.y)/i:1;else if(C===I){var N=new _n([l.x,l.y]).sub([f.x,f.y]).len(),H=new _n([n,-i]).len();D=H?N/H:1}return O+=Math.log2(D||1),{width:n,height:i,left:m,top:g,zoom:O,bearing:C,pitch:t.getTilt(),latitude:b,longitude:x}}function uT(t,r){var e=Iz(t),n=e.width,i=e.height,a=r.getCameraParams(),o=a.center,s=a.heading,u=a.tilt,l=a.zoom,f=25,p=i?n/i:1,h=.75,d=3e14,v=new ye().perspective({fovy:f*Math.PI/180,aspect:p,near:h,far:d}),m=.5*v[5];return{width:n,height:i,viewState:{altitude:m,bearing:s,latitude:o.lat(),longitude:o.lng(),pitch:u,projectionMatrix:v,repeat:!0,zoom:l-1}}}function Iz(t){var r=t.getDiv().firstChild;return{width:r.offsetWidth,height:r.offsetHeight}}function oT(t,r,e){var n=new google.maps.Point(r,e),i=t.fromContainerPixelToLatLng(n);return[i.lng(),i.lat()]}function Ade(t,r){if(t.pixel)return t.pixel;var e=r.getViewports()[0].project([t.latLng.lng(),t.latLng.lat()]);return{x:e[0],y:e[1]}}function Sde(t,r,e){if(t.isInitialized){var n={type:r,offsetCenter:Ade(e,t),srcEvent:e};switch(r){case"click":case"rightclick":n.type="click",n.tapCount=1,t._onPointerDown(n),t._onEvent(n);break;case"dblclick":n.type="click",n.tapCount=2,t._onEvent(n);break;case"mousemove":n.type="pointermove",t._onPointerMove(n);break;case"mouseout":n.type="pointerleave",t._onPointerMove(n);break;default:return}}}var Tde=["width","height","left","top"];function Rz(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function ms(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?Rz(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Rz(Object(e)).forEac
4965h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var wde=function(){return!1},Pde={depthMask:!0,depthTest:!0,blend:!0,blendFunc:[770,771,1,771],blendEquation:32774};function Lz(){}var Ode={interleaved:!0},kz=function(){function t(r){A(this,t),c(this,"props",{}),c(this,"_map",null),c(this,"_deck",null),c(this,"_overlay",null),this.setProps(ms(ms({},Ode),r))}return T(t,[{key:"setMap",value:function(e){var n=this;if(e!==this._map){var i=google.maps.RenderingType,a=i.VECTOR,o=i.UNINITIALIZED;if(this._map){var s;!e&&this._map.getRenderingType()===a&&this.props.interleaved&&this._overlay.requestRedraw(),(s=this._overlay)===null||s===void 0||s.setMap(null),this._map=null}if(e){this._map=e;var u=e.getRenderingType();u!==o?this._createOverlay(e):e.addListener("renderingtype_changed",function(){n._createOverlay(e)})}}}},{key:"setProps",value:function(e){if(Object.assign(this.props,e),this._deck){var n=this._deck.getCanvas();if(e.style&&n!==null&&n!==void 0&&n.parentElement){var i=n.parentElement.style;Object.assign(i,e.style),e.style=null}this._deck.setProps(e)}}},{key:"pickObject",value:function(e){return this._deck&&this._deck.pickObject(e)}},{key:"pickMultipleObjects",value:function(e){return this._deck&&this._deck.pickMultipleObjects(e)}},{key:"pickObjects",value:function(e){return this._deck&&this._deck.pickObjects(e)}},{key:"finalize",value:function(){this.setMap(null),this._deck&&(Og(this._deck),this._deck=null)}},{key:"_createOverlay",value:function(e){var n=this.props.interleaved,i=google.maps.RenderingType,a=i.VECTOR,o=i.UNINITIALIZED,s=e.getRenderingType();if(s!==o){var u=s===a&&google.maps.WebGLOverlayView,l=u?google.maps.WebGLOverlayView:google.maps.OverlayView,f=new l;f instanceof google.maps.WebGLOverlayView?(n?(f.onAdd=Lz,f.onContextRestored=this._onContextRestored.bind(this),f.onDraw=this._onDrawVectorInterleaved.bind(this)):(f.onAdd=this._onAdd.bind(this),f.onContextRestored=Lz,f.onDraw=this._onDrawVectorOverlay.bind(this)),f.onContextLost=this._onContextLost.bind(this)):(f.onAdd=this._onAdd.bind(this),f.draw=this._onDrawRaster.bind(this)),f.onRemove=this._onRemove.bind(this),this._overlay=f,this._overlay.setMap(e)}}},{key:"_onAdd",value:function(){this._deck=sT(this._map,this._overlay,this._deck,this.props)}},{key:"_onContextRestored",value:function(e){var n=this,i=e.gl;if(!(!this._map||!this._overlay)){var a=function(){n._overlay&&n._overlay.requestRedraw()},o=sT(this._map,this._overlay,this._deck,ms({gl:i,_customRender:a},this.props));this._deck=o;var s=o.animationLoop;s._renderFrame=function(){var u=i.getParameter(34964);ke(i,{},function(){s.onRender()}),i.bindBuffer(34962,u)}}}},{key:"_onContextLost",value:function(){this._deck&&(Og(this._deck),this._deck=null)}},{key:"_onRemove",value:function(){var e;(e=this._deck)===null||e===void 0||e.setProps({layerFilter:wde})}},{key:"_onDrawRaster",value:function(){if(!(!this._deck||!this._map)){var e=this._deck,n=Mz(this._map,this._overlay),i=n.width,a=n.height,o=n.left,s=n.top,u=Ii(n,Tde),l=e.getCanvas();if(l!=null&&l.parentElement){var f=l.parentElement.style;f.left="".concat(o,"px"),f.top="".concat(s,"px")}var p=1e4;e.setProps({width:i,height:a,viewState:ms({altitude:p,repeat:!0},u)}),e.redraw()}}},{key:"_onDrawVectorInterleaved",value:function(e){var n=e.gl,i=e.transformer;if(!(!this._deck||!this._map)){var a=this._deck;if(a.setProps(ms(ms({},uT(this._map,i)),{},{width:null,height:null})),a.isInitialized){var o=Un(n,36006);a.setProps({_framebuffer:o}),a.needsRedraw({clearRedrawFlags:!0}),It(n,{viewport:[0,0,n.canvas.width,n.canvas.height],scissor:[0,0,n.canvas.width,n.canvas.height],stencilFunc:[519,0,255,519,0,255]}),ke(n,Pde,function(){a._drawLayers("google-vector",{clearCanvas:!1})})}}}},{key:"_onDrawVectorOverlay",value:function(e){var n=e.transformer;if(!(!this._deck||!this._map)){var i=this._deck;i.setProps(ms({},uT(this._map,n))),i.redraw()}}}]),t}();F();j();k();k();function Bz(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function gs(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};
4965r%2?Bz(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Bz(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var lT=512,Ede=Math.PI/180;function Eg(t){var r=t.map,e=t.gl,n=t.deck;if(r.__deck)return r.__deck;var i=n?.props._customRender,a=n?.props.onLoad,o=cT(gs(gs({},n?.props),{},{_customRender:function(){r.triggerRepaint(),i?.("")}})),s;return(!n||n.props.gl===e)&&(Object.assign(o,{gl:e,width:null,height:null,touchAction:"unset",viewState:Ll(r)}),n!=null&&n.isInitialized?Fz(n,r):o.onLoad=function(){a?.(),Fz(s,r)}),n?(s=n,n.setProps(o),n.userData.isExternal=!0):(s=new Nr(o),r.on("remove",function(){fT(r)})),s.userData.mapboxLayers=new Set,r.__deck=s,r.on("render",function(){s.isInitialized&&Mde(s,r)}),s}function Fz(t,r){var e=function n(){t.isInitialized?Ide(t,r):r.off("move",n)};r.on("move",e)}function fT(t){var r;(r=t.__deck)===null||r===void 0||r.finalize(),t.__deck=null}function cT(t){var r=gs(gs({},t),{},{parameters:gs({depthMask:!0,depthTest:!0,blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthFunc:515,blendEquation:32774},t.parameters),views:t.views||[new ko({id:"mapbox"})]});return r}function Dz(t,r){t.userData.mapboxLayers.add(r),pT(t)}function Nz(t,r){t.userData.mapboxLayers.delete(r),pT(t)}function jz(t,r){pT(t)}function Uz(t,r,e){var n=t.userData,i=n.currentViewport,a=!1;i||(i=Gz(t,r,!0),t.userData.currentViewport=i,a=!0),t.isInitialized&&t._drawLayers("mapbox-repaint",{viewports:[i],layerFilter:function(s){var u=s.layer;return e.id===u.id||u.props.operation.includes("terrain")},clearStack:a,clearCanvas:!1})}function Ll(t){var r,e=t.getCenter(),n=e.lng,i=e.lat,a={longitude:(n+540)%360-180,latitude:i,zoom:t.getZoom(),bearing:t.getBearing(),pitch:t.getPitch(),padding:t.getPadding(),repeat:t.getRenderWorldCopies()};return(r=t.getTerrain)!==null&&r!==void 0&&r.call(t)&&Cde(t,a),a}function Cde(t,r){if(t.getFreeCameraOptions){var e=t.getFreeCameraOptions(),n=e.position;if(!n||n.z===void 0)return;var i=t.transform.height,a=r.longitude,o=r.latitude,s=r.pitch,u=n.x*lT,l=(1-n.y)*lT,f=n.z*lT,p=mt([a,o]),h=u-p[0],d=l-p[1],v=Math.sqrt(h*h+d*d),m=s*Ede,g=1.5*i,y=m<.001?g*Math.cos(m)/f:g*Math.sin(m)/v;r.zoom=Math.log2(y);var _=g*Math.cos(m)/y,b=f-_;r.position=[0,0,b/Po(o)]}else typeof t.transform.elevation=="number"&&(r.position=[0,0,t.transform.elevation])}function Gz(t,r){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return new Sr(gs(gs({id:"mapbox",x:0,y:0,width:t.width,height:t.height},Ll(r)),{},{nearZMultiplier:e?.02:.1,nearZ:r.transform._nearZ/r.transform.height,farZ:r.transform._farZ/r.transform.height}))}function Mde(t,r){var e=t.userData,n=e.mapboxLayers,i=e.isExternal;if(i){var a=Array.from(n,function(p){return p.id}),o=gr(t.props.layers,Boolean),s=o.some(function(p){return p&&!a.includes(p.id)}),u=t.getViewports(),l=u.findIndex(function(p){return p.id==="mapbox"}),f=u.length>1||l<0;(s||f)&&(l>=0&&(u=u.slice(),u[l]=Gz(t,r,!1)),t._drawLayers("mapbox-repaint",{viewports:u,layerFilter:function(h){return(!t.props.layerFilter||t.props.layerFilter(h))&&(h.viewport.id!=="mapbox"||!a.includes(h.layer.id))},clearCanvas:!1}))}t.userData.currentViewport=null}function Ide(t,r){t.setProps({viewState:Ll(r)}),t.needsRedraw({clearRedrawFlags:!0})}function pT(t){if(!t.userData.isExternal){var r=[];t.userData.mapboxLayers.forEach(function(e){var n=e.props.type,i=new n(e.props);r.push(i)}),t.setProps({layers:r})}}var Cg=function(){function t(r){if(A(this,t),c(this,"id",void 0),c(this,"type",void 0),c(this,"renderingMode",void 0),c(this,"map",void 0),c(this,"deck",void 0),c(this,"props",void 0),!r.id)throw new Error("Layer must have an unique id");this.id=r.id,this.type="custom",this.renderingMode=r.renderingMode||"3d",this.map=null,this.deck=null,this.props=r}return T(t,[{key:"onAdd",value:function(e,n){this.map=e,this.deck=Eg({map:e,gl:n,deck:this.props.deck}),Dz(this.deck,this)}},{key:"onRemove",value:function(){this.deck&&Nz(this.deck,this)}},{key:"setProps",value:function(e){Object.assign(this.props,e,{id:this.id}),this.deck&&jz(this.deck,this)}},{key:"render",value:function(){Uz(this.deck,this.map,this)}}]),t}();F();j();k();function Mg(t,r){var e=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=Rde(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(l){throw l},f:i}
4965}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
4966In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){e=e.call(t)},n:function(){var l=e.next();return a=l.done,l},e:function(l){o=!0,s=l},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(o)throw s}}}}function Rde(t,r){if(t){if(typeof t=="string")return zz(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return zz(t,r)}}function zz(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var hT="__UNDEFINED__";function np(t,r,e,n){if(!(!t||!r||!t.style||!t.style._loaded)){var i=gr(n,Boolean);if(e!==n){var a=gr(e,Boolean),o=new Set(a.map(function($){return $.id})),s=Mg(i),u;try{for(s.s();!(u=s.n()).done;){var l=u.value;o.delete(l.id)}}catch($){s.e($)}finally{s.f()}var f=Mg(o),p;try{for(f.s();!(p=f.n()).done;){var h=p.value;t.getLayer(h)&&t.removeLayer(h)}}catch($){f.e($)}finally{f.f()}}var d=Mg(i),v;try{for(d.s();!(v=d.n()).done;){var m=v.value,g=t.getLayer(m.id);g?g.implementation.setProps(m.props):t.addLayer(new Cg({id:m.id,deck:r}),m.props.beforeId)}}catch($){d.e($)}finally{d.f()}var y=t.style._order,_={},b=Mg(i),x;try{for(b.s();!(x=b.n()).done;){var w=x.value,P=w.props.beforeId;(!P||!y.includes(P))&&(P=hT),_[P]=_[P]||[],_[P].push(w.id)}}catch($){b.e($)}finally{b.f()}for(var E in _)for(var C=_[E],I=E===hT?y.length:y.indexOf(E),O=E===hT?void 0:E,D=C.length-1;D>=0;D--){var N=C[D],H=y.indexOf(N);H!==I-1&&(t.moveLayer(N,O),H>I&&I++),I--,O=N}}}var Lde=["interleaved"];function Vz(t,r){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),e.push.apply(e,n)}return e}function kl(t){for(var r=1;r<arguments.length;r++){var e=arguments[r]!=null?arguments[r]:{};r%2?Vz(Object(e),!0).forEach(function(n){c(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Vz(Object(e)).forEac
4966h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}var Hz=function(){function t(r){var e=this;A(this,t),c(this,"_props",void 0),c(this,"_deck",void 0),c(this,"_map",void 0),c(this,"_container",void 0),c(this,"_interleaved",void 0),c(this,"_lastMouseDownPoint",void 0),c(this,"_handleStyleChange",function(){np(e._map,e._deck,e._props.layers,e._props.layers)}),c(this,"_updateContainerSize",function(){if(e._map&&e._container){var o=e._map.getContainer(),s=o.clientWidth,u=o.clientHeight;Object.assign(e._container.style,{width:"".concat(s,"px"),height:"".concat(u,"px")})}}),c(this,"_updateViewState",function(){var o=e._deck;o&&(o.setProps({viewState:Ll(e._map)}),o.isInitialized&&o.redraw())}),c(this,"_handleMouseEvent",function(o){var s=e._deck;if(!(!s||!s.isInitialized)){var u={type:o.type,offsetCenter:o.point,srcEvent:o},l=e._lastMouseDownPoint;switch(!o.point&&l&&(u.deltaX=o.originalEvent.clientX-l.clientX,u.deltaY=o.originalEvent.clientY-l.clientY,u.offsetCenter={x:l.x+u.deltaX,y:l.y+u.deltaY}),u.type){case"mousedown":s._onPointerDown(u),e._lastMouseDownPoint=kl(kl({},o.point),{},{clientX:o.originalEvent.clientX,clientY:o.originalEvent.clientY});break;case"dragstart":u.type="panstart",s._onEvent(u);break;case"drag":u.type="panmove",s._onEvent(u);break;case"dragend":u.type="panend",s._onEvent(u);break;case"click":u.tapCount=1,s._onEvent(u);break;case"dblclick":u.type="click",u.tapCount=2,s._onEvent(u);break;case"mousemove":u.type="pointermove",s._onPointerMove(u);break;case"mouseout":u.type="pointerleave",s._onPointerMove(u);break;default:return}}});var n=r.interleaved,i=n===void 0?!1:n,a=Ii(r,Lde);this._interleaved=i,this._props=a}return T(t,[{key:"setProps",value:function(e){this._interleaved&&e.layers&&np(this._map,this._deck,this._props.layers,e.layers),Object.assign(this._props,e),this._deck&&this._deck.setProps(this._interleaved?cT(this._props):this._props)}},{key:"onAdd",value:function(e){return this._map=e,this._interleaved?this._onAddInterleaved(e):this._onAddOverlaid(e)}},{key:"_onAddOverlaid",value:function(e){var n=document.createElement("div");return Object.assign(n.style,{position:"absolute",left:0,top:0,pointerEvents:"none"}),this._container=n,this._deck=new Nr(kl(kl({},this._props),{},{parent:n,viewState:Ll(e)})),e.on("resize",this._updateContainerSize),e.on("render",this._updateViewState),e.on("mousedown",this._handleMouseEvent),e.on("dragstart",this._handleMouseEvent),e.on("drag",this._handleMouseEvent),e.on("dragend",this._handleMouseEvent),e.on("mousemove",this._handleMouseEvent),e.on("mouseout",this._handleMouseEvent),e.on("click",this._handleMouseEvent),e.on("dblclick",this._handleMouseEvent),this._updateContainerSize(),n}},{key:"_onAddInterleaved",value:function(e){return this._deck=Eg({map:e,gl:e.painter.context.gl,deck:new Nr(kl(kl({},this._props),{},{gl:e.painter.context.gl}))}),e.on("styledata",this._handleStyleChange),np(e,this._deck,[],this._props.layers),document.createElement("div")}},{key:"onRemove",value:function(){var e=this._map;e&&(this._interleaved?this._onRemoveInterleaved(e):this._onRemoveOverlaid(e)),this._deck=void 0,this._map=void 0,this._container=void 0}},{key:"_onRemoveOverlaid",value:function(e){var n;e.off("resize",this._updateContainerSize),e.off("render",this._updateViewState),e.off("mousedown",this._handleMouseEvent),e.off("dragstart",this._handleMouseEvent),e.off("drag",this._handleMouseEvent),e.off("dragend",this._handleMouseEvent),e.off("mousemove",this._handleMouseEvent),e.off("mouseout",this._handleMouseEvent),e.off("click",this._handleMouseEvent),e.off("dblclick",this._handleMouseEvent),(n=this._deck)===null||n===void 0||n.finalize()}},{key:"_onRemoveInterleaved",value:function(e){e.off("styledata",this._handleStyleChange),np(e,this._deck,this._props.layers,[]),fT(e)}},{key:"getDefaultPosition",value:function(){return"top-left"}},{key:"pickObject",value:function(e){return Je(this._deck),this._deck.pickObject(e)}},{key:"pickMultipleObjects",value:function(e){return Je(this._deck),this._deck.pickMultipleObjects(e)}},{key:"pickObjects",value:function(e){return Je(this._deck),this._deck.pickObjects(e)}},{key:"finalize",value:function(){this._map&&this._map.removeControl(this)}},{key:"getCanvas",value:function(){return this._map?this._interleaved?this._map.getCanvas():this._deck.getCanvas():null}}]),t}();var ip=me(Rv());ji._checkH3Lib=function(){var t='include the <script src="https://unpkg.com/h3-js@^3.0.0"><\/script> tag before the deck.gl script tag. https://deck.gl/docs/api-reference/geo-layers/h3-hexagon-layer';
4966if(ip){if(!ip.polyfill&&ip.polygonToCells)throw new Error("Incompatible h3-js version. ".concat(t))}else throw new Error("To use H3 functionality, ".concat(t))};return yV(kde);})();
4967      return __exports__;
4968      });

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